mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 07:28:30 +03:00
Merge remote-tracking branch 'galenwp/factor'
Conflicts: urb/urbit.pill urb/zod/ape/bit.hoon urb/zod/arvo/eyre.hoon urb/zod/mar/hook.hoon urb/zod/pub/bit/fab/hymn.hook urb/zod/pub/docs/dev/hoon/principles/1-twigs.md urb/zod/pub/docs/dev/hoon/principles/2-syntax.md urb/zod/pub/docs/dev/hoon/reference/odors.md urb/zod/pub/docs/dev/hoon/reference/pronunciation.md urb/zod/pub/docs/dev/hoon/runes/sg/sgcn.md urb/zod/pub/docs/dev/hoon/runes/sm.md urb/zod/pub/docs/dev/hoon/runes/sm/smsg.md urb/zod/pub/docs/dev/hoon/runes/sm/smzz.md urb/zod/pub/docs/dev/hoon/runes/ts/tssg.md urb/zod/pub/docs/dev/hoon/runes/wt/wthz.md urb/zod/pub/docs/dev/hoon/runes/wt/wtls.md urb/zod/pub/docs/dev/hoon/runes/zp/zpzp.md urb/zod/pub/docs/theory/whitepaper.md urb/zod/pub/docs/user/appliance.md urb/zod/pub/docs/user/intro.md urb/zod/pub/docs/user/talk.md Merged Galen and Anton's web refactoring work
This commit is contained in:
commit
d5e097e82a
206
ape/bit.hoon
206
ape/bit.hoon
@ -1,206 +0,0 @@
|
||||
::
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 314
|
||||
/- talk, bit-api
|
||||
/+ talk, sole, http
|
||||
!:
|
||||
:::: sivtyv-barnel
|
||||
:: be sure to have oauth2-code markk
|
||||
[talk bit-api .]
|
||||
|%
|
||||
++ axle
|
||||
$: cred=(unit ,[app-secret=@t client-id=@t])
|
||||
oauth-code=(unit ,@t)
|
||||
auth=(unit ,[access=@t refresh=@t])
|
||||
contacts=(map ,@t ,@t)
|
||||
outgoing=(map ship ,@t) incoming=(map ,@t ship)
|
||||
==
|
||||
++ move ,[bone note]
|
||||
++ hapt ,[ship path]
|
||||
++ note
|
||||
$% [%send wire [ship term] %poke mesa]
|
||||
[%them wire (unit hiss)]
|
||||
[%hiss wire mark bit-any]
|
||||
==
|
||||
++ gift
|
||||
$% [%nice ~]
|
||||
[%mean ares]
|
||||
==
|
||||
++ sign
|
||||
$% [%thou p=httr]
|
||||
[%unto %coup p=(unit tang)]
|
||||
==
|
||||
++ mesa
|
||||
$% [%bit-addr-request ~]
|
||||
[%bit-addr-made @t]
|
||||
[%talk-command command]
|
||||
==
|
||||
--
|
||||
::
|
||||
!:
|
||||
|_ [hid=bowl vat=axle]
|
||||
:: ++ prep ~&(%bit-prep-wipe ,_`.)
|
||||
++ return [*(list move) .]
|
||||
++ redirect-uri [hostname `/~~/home/pub/bit/fab ~]
|
||||
++ hostname ^- hart
|
||||
?+ (clan our.hid) !!
|
||||
%czar [| ?+(our.hid `8.443 %~fyr `8.444) `/localhost]
|
||||
%duke [| `8.443 `/org/urbit/(crip +:<our.hid>)]
|
||||
==
|
||||
++ auth-url
|
||||
%+ weld "https://sandbox.coinbase.com/oauth/authorize"
|
||||
%- tail:earn :~
|
||||
'response_type'^%code
|
||||
'client_id'^client-id:(need cred.vat)
|
||||
'redirect_uri'^(crip (earn redirect-uri))
|
||||
'scope'^'user balance buy sell send transactions addresses'
|
||||
'meta[send_limit_amount]'^'1'
|
||||
'meta[send_limit_curency]'^'BTC'
|
||||
'meta[send_limit_period]'^'day'
|
||||
==
|
||||
++ old-api
|
||||
|= [pour-path=wire end-point=path req=$|(%get [%post p=json])]
|
||||
^- move
|
||||
%^ send:http ost.hid pour-path
|
||||
[/com/coinbase/api v1/end-point req ~ ['access_token' access:(need auth.vat)]~]
|
||||
::
|
||||
++ api-call
|
||||
|= [res=mark req=bit-api-call] ^+ return
|
||||
~| %missing-access-token
|
||||
[[ost.hid %hiss / res bit-api-call/[access:(need auth.vat) req]]~ +>.$]
|
||||
::
|
||||
++ print |=(msg=tape [[(publish [%lin & (crip msg)]~)]~ +>.$])
|
||||
++ callback-uri [hostname [`%json /~/to/[dap.hid]/json] ~[anon/'' wire/'/']]
|
||||
++ poke-auth
|
||||
|= arg=[secr=cord id=cord]
|
||||
=. cred.vat `arg
|
||||
=+ prl=`purl`(need (epur (crip auth-url)))
|
||||
:_ +>.$
|
||||
:- %- publish
|
||||
:~ [%lin & 'secret and client id saved successfully']
|
||||
[%lin & 'please click on the url below to continue authentication']
|
||||
[%url prl ~]
|
||||
==
|
||||
~
|
||||
::
|
||||
++ sigh-tang |=([* err=tang] (mean err))
|
||||
++ send-friend :: inter-app interface
|
||||
|= [way=wire his=ship mez=$%([%bit-addr-request ~] [%bit-addr-made @t])]
|
||||
^- move
|
||||
[ost.hid %send way [his dap.hid] %poke mez]
|
||||
::
|
||||
++ poke-bit-send |=(req=bit-send (api-call %bit-transaction send/req))
|
||||
++ sigh-bit-transaction
|
||||
|=([* trid=@t] (print "transaction success {(trip trid)}"))
|
||||
::
|
||||
++ poke-bit-ship-send :: send to ship
|
||||
|= [to=ship amount=@t]
|
||||
=. outgoing.vat (~(put by outgoing.vat) to amount)
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
(send-friend /sent to %bit-addr-request ~)
|
||||
++ poke-bit-addr-request :: give your address to receive bit
|
||||
|= ~ :: gen new address with callback
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
%+ old-api /addr-request/(scot %p src.hid)
|
||||
:+ /addresses %post
|
||||
%+ joba %address
|
||||
%- jobe :~
|
||||
label/(jape "address for {<src.hid>}")
|
||||
'callback_url'^(jape (earn callback-uri))
|
||||
==
|
||||
::
|
||||
++ pour-addr-request :: send new address to sender
|
||||
|= [pax=path rez=json]
|
||||
=+ adr=(need ((ot address/so ~):jo rez))
|
||||
=+ his=(slav %p +<.pax)
|
||||
~! incoming.vat
|
||||
=. incoming.vat
|
||||
(~(put by incoming.vat) adr his)
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
(send-friend [%message ~] his %bit-addr-made adr)
|
||||
::
|
||||
++ poke-bit-addr-made :: receive address for sending
|
||||
|= addr=@t
|
||||
=+ amount=(~(got by outgoing.vat) src.hid) :: get amount to send
|
||||
(api-call %bit-transaction txt-send/[addr amount])
|
||||
::
|
||||
++ poke-oauth2-code
|
||||
|= code=cord
|
||||
=. oauth-code.vat
|
||||
[~ code]
|
||||
?< ?=(~ cred.vat)
|
||||
=+ req=[code [client-id app-secret]:u.cred.vat redirect-uri]
|
||||
[[ost.hid %hiss / %oauth-tokens bit-get-token/req]~ +>.$]
|
||||
::
|
||||
++ sigh-oauth-tokens
|
||||
|= [wire toke=[access=@t refresh=@t]]
|
||||
=.(auth.vat `toke (print "authenticated."))
|
||||
::
|
||||
++ poke-buy
|
||||
|=(arg=[amount=@t currency=@t] ?<(=(amount.arg ~) (api-call %json %buy arg)))
|
||||
++ poke-sell
|
||||
|=(arg=[amount=@t currency=@t] ?<(=(amount.arg ~) (api-call %json %sell arg)))
|
||||
++ sigh-json |=([* a=json] ~&(a return))
|
||||
++ poke-list |=(~ (api-call %bit-accounts %list ~))
|
||||
++ sigh-bit-accounts |=([* acc=bit-accounts] ~&(accounts=acc return))
|
||||
++ poke-send-raw
|
||||
|= arg=[to=@t amone=(unit ,@t) cur=(unit ,@t) amtwo=(unit ,@t) nt=(unit ,@t)]
|
||||
=+ adr=?~((~(get by contacts.vat) to.arg) to ~&('contact-exists' (~(get by contacts.vat) to.arg)))
|
||||
=+ ^= info
|
||||
?~ cur.arg
|
||||
[to/s/to.arg amount/s/(need amone.arg) ~]
|
||||
?~ nt.arg
|
||||
[to/s/to.arg 'amount_currency_iso'^s/(need cur.arg) 'amount_string'^s/(need amtwo.arg) ~]
|
||||
[to/s/to.arg amount/s/(need amtwo.arg) 'amount_string'^s/(need amtwo.arg) ~]
|
||||
=+ ^= pst
|
||||
(jobe transaction/(jobe info) ~)
|
||||
[[(old-api /send /transactions/'send_money' %post pst) ~] +>.$]
|
||||
::
|
||||
++ poke-json
|
||||
|= arg=json
|
||||
~& arg
|
||||
=+ [adr amo]=(need %.(arg (ot address/so amount/no ~):jo))
|
||||
=+ frm=(~(get by incoming.vat) adr)
|
||||
(print "just received {(trip amo)} BTC from {<frm>}")
|
||||
::(old-api /get-id /transactions/[transaction-id] %get)
|
||||
++ pour-get-id :: display transaction info
|
||||
|= [pax=path rez=json]
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
!!
|
||||
::
|
||||
++ thou
|
||||
|= [way=wire res=httr]
|
||||
?+ -.way !!
|
||||
%message `+>.$
|
||||
?(%addr-request %get-id)
|
||||
~| 'must receive a 200'
|
||||
~| res
|
||||
?> =(200 p.res)
|
||||
%- ?-(-.way %addr-request pour-addr-request, %get-id pour-get-id)
|
||||
[way (rash q:(need r.res) apex:poja)]
|
||||
==
|
||||
::
|
||||
++ publish
|
||||
|= act=(list speech)
|
||||
^- move
|
||||
=+ ^= thotz
|
||||
%+ turn act
|
||||
|= sp=speech ^- thought
|
||||
=+ ^= tail
|
||||
:- ^- audience
|
||||
:+ :- `partner`[%& our.hid ?+((clan our.hid) !! %czar %court, %duke %porch)]
|
||||
^- (pair envelope delivery)
|
||||
[`envelope`[& ~] %pending]
|
||||
~
|
||||
~
|
||||
`statement`[now.hid ~ sp]
|
||||
:- `@`(sham eny.hid tail)
|
||||
tail
|
||||
[ost.hid %send /auth [our.hid %talk] %poke [%talk-command %publish thotz]]
|
||||
--
|
649
ape/cloud.hoon
649
ape/cloud.hoon
@ -1,649 +0,0 @@
|
||||
:: digital ocean fleet management
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 314
|
||||
/- talk
|
||||
::
|
||||
::
|
||||
:::: sivtyv-barnel
|
||||
::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: data structures ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
!:
|
||||
[talk .]
|
||||
|%
|
||||
++ instance
|
||||
$: plat=?(%do %gce) name=@t id=@t status=@t created=@da snapshot=name=@t ::disk=@u region=@t
|
||||
::ip=(list ,@if)
|
||||
==
|
||||
++ image
|
||||
$: plat=?(%do %gce) name=@t id=@t
|
||||
==
|
||||
++ create-req-do
|
||||
$:
|
||||
name=@t ::region=@t
|
||||
size=@t image=@t ssh=(list cord)
|
||||
backups=(unit ,?) ipv6=(unit ,?)
|
||||
private-networking=(unit ,?) user-data=(unit ,@t)
|
||||
==
|
||||
++ create-req-gce ,[project=@t zone=@t name=@t machine-type=@t]
|
||||
++ axle
|
||||
$: auth=[do=keys gce=keys] toke=[do=tokens gce=tokens]
|
||||
insts=(map ,@t instance) images=(map [,[@t @t] image])
|
||||
==
|
||||
++ keys ,[authc=(unit ,@t) client-secret=(unit ,@t)]
|
||||
++ tokens ,[access=@t refresh=@t]
|
||||
++ move ,[bone card]
|
||||
++ card
|
||||
$% [%diff %json json]
|
||||
[%wait wire @da]
|
||||
[%send wire [ship term] %poke %talk-command command]
|
||||
[%them wire (unit hiss)]
|
||||
==
|
||||
++ droplet-action
|
||||
$% [%start ~]
|
||||
[%stop ~]
|
||||
[%reboot ~]
|
||||
[%delete ~]
|
||||
[%snapshot p=@t]
|
||||
==
|
||||
++ cloud-command
|
||||
$% [%action id=@t name=@t act=droplet-action]
|
||||
[%create-do p=json]
|
||||
[%create-gce p=json]
|
||||
==
|
||||
--
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: miscellaneous functions ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
!:
|
||||
|%
|
||||
++ auth-queries
|
||||
|= code=cord
|
||||
:~ 'grant_type'^'authorization_code'
|
||||
'code'^code
|
||||
:- 'client_id'
|
||||
'd8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f'
|
||||
'redirect_uri'^'http://localhost:8443/home/pub/cloud/fab'
|
||||
==
|
||||
::
|
||||
++ parse-iso8601
|
||||
=< (cook to-time (parsf ;"{parse-day}T{parse-seconds}{parse-zone}"))
|
||||
|%
|
||||
++ to-time
|
||||
|= [[y=@u m=@u d=@u] t=[h=@u m=@u s=@u ms=@u] [syn=? zh=@u zm=@u]]
|
||||
^- @da
|
||||
%- year
|
||||
^- date
|
||||
=: h.t ?:(syn (sub h.t zh) (add h.t zh))
|
||||
m.t ?:(syn (sub m.t zm) (add m.t zm))
|
||||
==
|
||||
[[& y] m d h.t m.t s.t (div (mul ms.t 0x1.0000) 1.000) ~]
|
||||
++ parse-day (parsf ;"{dem}\-{dem}\-{dem}")
|
||||
++ parse-seconds (parsf ;"{dem}:{dem}:{dem}{(optional ;~(pfix dot dem))}")
|
||||
++ optional |*(fel=_rule ;~(pose fel (easy 0)))
|
||||
++ parse-zone
|
||||
;~ pose
|
||||
(cold [& 0 0] (jest 'Z'))
|
||||
(parsf ;"{parse-zone-sign}{dem}:{dem}")
|
||||
==
|
||||
++ parse-zone-sign ;~(plug ;~(pose (cold & lus) (cold | hep)))
|
||||
--
|
||||
++ parse-cloud-command
|
||||
=+ jo
|
||||
%- of :~
|
||||
[%create-gce some]
|
||||
[%create-do some]
|
||||
::[%create-gce some]
|
||||
:- %action
|
||||
(ot id/so name/so act/parse-droplet-action ~)
|
||||
==
|
||||
++ parse-droplet-action
|
||||
=> jo
|
||||
%- of :~
|
||||
[%start ul]
|
||||
[%stop ul]
|
||||
[%reboot ul]
|
||||
[%delete ul]
|
||||
[%snapshot so]
|
||||
==
|
||||
++ key-do
|
||||
(mo [%start 'power_on'] [%stop 'shutdown'] [%reboot 'power_cycle'] ~)
|
||||
::
|
||||
++ adapter-do
|
||||
|= a=cord
|
||||
(~(got by key-do) a)
|
||||
::
|
||||
++ parse-ip-do
|
||||
=> jo
|
||||
%- ot
|
||||
:_ ~ v4/(ar (ot 'ip_address'^(su lip:ag) ~))
|
||||
::
|
||||
++ parse-ip-gce
|
||||
=> jo
|
||||
%+ cu |=(a=(list (list ,@if)) `(list ,@if)`(zing a))
|
||||
(ar (ot 'accessConfigs'^(ar (ot 'natIP'^(su lip:ag) ~)) ~))
|
||||
::
|
||||
++ tail-url
|
||||
|= a=cord
|
||||
-:(flop q.q:(need (epur a)))
|
||||
::
|
||||
++ parse-region
|
||||
=> jo
|
||||
(ot name/so ~)
|
||||
::
|
||||
++ parse-id-text
|
||||
|= jon=json
|
||||
?.(?=([?(%n %s) *] jon) ~ (some p.jon))
|
||||
::
|
||||
++ create-do-body
|
||||
|= $: name=@t ::region=@t
|
||||
size=@t image=@t ssh-keys=(list cord)
|
||||
backups=(unit ,?) ipv6=(unit ,?) private-networking=(unit ,?) user-data=(unit ,@t)
|
||||
==
|
||||
%- jobe
|
||||
:~ name/s/name ::region/s/region
|
||||
size/s/size image/s/image ::(jone image)
|
||||
backups/?~(backups ~ b/u.backups) ipv6/?~(ipv6 ~ b/u.ipv6)
|
||||
'user_data'^?~(user-data ~ s/u.user-data) 'private_networking'^?~(private-networking ~ b/u.private-networking)
|
||||
==
|
||||
::
|
||||
++ convert-do
|
||||
|= a=?(%start %stop %reboot %snapshot)
|
||||
?- a
|
||||
%start
|
||||
'power_on'
|
||||
%stop
|
||||
'shutdown'
|
||||
%reboot
|
||||
'power_cycle'
|
||||
%snapshot
|
||||
'snapshot'
|
||||
==
|
||||
::
|
||||
++ instance-to-json
|
||||
|= a=(list instance)
|
||||
^- json
|
||||
%+ joba 'instances'
|
||||
:- %a
|
||||
%+ turn a
|
||||
|= instance
|
||||
^- json
|
||||
%- jobe
|
||||
:~ name/`json`s/name
|
||||
id/s/id
|
||||
status/s/status
|
||||
created/s/(crip (dust (yore created)))
|
||||
::region/s/region
|
||||
snapshot/s/snapshot
|
||||
::disk/`json`(jone disk)
|
||||
::ip/a/(turn ip |=(a=@if s/(rsh 3 1 (scot %if a))))
|
||||
==
|
||||
++ map-to-list
|
||||
|= a=(map [,[@t @t] image])
|
||||
^- liz=(list image)
|
||||
%+ turn (~(tap by a) *(list ,[[@t @t] image]))
|
||||
|=(a=[[@t @t] image] `image`+.a)
|
||||
::
|
||||
++ image-to-json
|
||||
|= a=(list image)
|
||||
%+ joba 'images'
|
||||
:- %a
|
||||
%+ turn a
|
||||
|= image
|
||||
^- json
|
||||
%- jobe
|
||||
:~ name/s/name id/s/id ==
|
||||
--
|
||||
::::::::::::::::
|
||||
:: main door ::
|
||||
::::::::::::::::
|
||||
!:
|
||||
|_ [bowl vat=axle]
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: miscellaneous arms that have to be in main door for scope reasons ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
::
|
||||
::++ prep ,_`.
|
||||
::
|
||||
++ thou
|
||||
|= [pour-path=path resp=?(httr *)]
|
||||
^- [(list move) _+>.$]
|
||||
~& unhandled-pour-path/resp
|
||||
:_ +>.$ ~
|
||||
++ httpreq
|
||||
|= $: pour-path=wire :: must be in main door because of scope
|
||||
domain=(list cord) end-point=path
|
||||
req-type=$?(%get %delt [%post json]) headers=math
|
||||
queries=quay
|
||||
==
|
||||
^- move
|
||||
=+ ^- parsed-url=purl
|
||||
:+ ^= host-port :: ++hart
|
||||
:+ security=%.y
|
||||
port=~
|
||||
host=[%.y [path=[%com domain]]]
|
||||
endpoint=[extensions=~ point=end-point] :: ++pork,
|
||||
q-strings=queries :: ++quay
|
||||
=+ ^- request=hiss :: cast to hiss
|
||||
:- parsed-url
|
||||
?@ req-type
|
||||
[req-type headers ~]
|
||||
[%post headers ~ (tact (pojo +.req-type))]
|
||||
:^ ost %them pour-path
|
||||
`(unit hiss)`[~ request]
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: manage supscriptions and publish to talk ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ peer
|
||||
|= pax=path
|
||||
^- [(list move) _+>.$]
|
||||
:_ +>.$
|
||||
=+ lis=(~(tap by insts.vat))
|
||||
[ost %diff %json (instance-to-json (turn lis |=(a=[@t instance] +.a)))]~
|
||||
::
|
||||
++ spam
|
||||
|= jon=json
|
||||
%+ turn (~(tap by sup))
|
||||
|= [sub=bone @ pax=path]
|
||||
^- move
|
||||
[sub %diff %json jon]
|
||||
::
|
||||
++ publish
|
||||
|= [act=(list speech)]
|
||||
^- move
|
||||
=+ ^= spchz
|
||||
%+ turn act
|
||||
|= sp=speech
|
||||
=+ ^= tail
|
||||
:- ^- audience
|
||||
:+ :- `partner`[%& our ?+((clan our) !! %czar %court, %duke %porch)]
|
||||
^- (pair envelope delivery)
|
||||
[`envelope`[& ~] %pending]
|
||||
~
|
||||
~
|
||||
`statement`[now ~ sp]
|
||||
^- thought
|
||||
:- `@`(sham eny tail)
|
||||
tail
|
||||
=+ mez=[%talk-command [%publish `(list thought)`spchz]]
|
||||
[ost %send /pub [our %talk] %poke mez]
|
||||
++ thou-pub |=(~ :_(+>.$ ~))
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: authentication ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ poke-cloud-auth
|
||||
|= [cde=cord typ=cord]
|
||||
^- [(list move) _+>.$]
|
||||
?: =(%do typ)
|
||||
=. authc.do.auth.vat
|
||||
[~ cde]
|
||||
:_ +>.$ ~
|
||||
=. access.gce.toke.vat
|
||||
cde
|
||||
:_ +>.$
|
||||
:_ list-gce
|
||||
(publish [%lin & 'successfully authenticated to gce']~)
|
||||
::
|
||||
++ poke-cloud-secret
|
||||
|= [secret=cord typ=cord]
|
||||
^- [(list move) _+>.$]
|
||||
?+ typ ~|(missing-platform=typ !!)
|
||||
%do
|
||||
=. client-secret.do.auth.vat
|
||||
[~ secret]
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
%+ httpreq /do/auth
|
||||
:^ ~[%digitalocean %cloud] `path`/v1/oauth/token
|
||||
[%post ~]
|
||||
:- ~ `quay`['client_secret'^secret (auth-queries (need authc.do.auth.vat))]
|
||||
==
|
||||
::
|
||||
++ thou-do-auth
|
||||
|= [~ resp=httr]
|
||||
^- [(list move) _+>.$]
|
||||
~| resp
|
||||
=+ body=(rash q:(need r.resp) apex:poja)
|
||||
~| recieve-auth/resp(r body)
|
||||
=+ [ac re]=(need ((ot 'access_token'^so 'refresh_token'^so ~):jo body))
|
||||
=: access.do.toke.vat ac
|
||||
refresh.do.toke.vat re
|
||||
==
|
||||
:_ +>.$
|
||||
:- (publish [%lin & 'successfully authenticated']~)
|
||||
list-do
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: create digital ocean droplets ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ create-do
|
||||
|= act=json
|
||||
=+ ^- deets=create-req-do
|
||||
%- need
|
||||
%. act
|
||||
=> jo
|
||||
%- ot
|
||||
:~ name/so size/so image/so :: id key:img object region/so
|
||||
ssh/(ar so) backups/(mu bo)
|
||||
'ipv6'^(mu bo) 'priv_networking'^(mu bo) 'user_data'^(mu so)
|
||||
==
|
||||
=+ ^- body=json
|
||||
%- create-do-body :*
|
||||
name.deets size.deets image.deets ssh.deets backups.deets ::region.deets
|
||||
ipv6.deets private-networking.deets user-data.deets
|
||||
==
|
||||
%- httpreq :*
|
||||
/create-do
|
||||
~[%digitalocean %api] /v2/droplets
|
||||
[%post body]
|
||||
%^ mo ['Content-Type' 'application/json; charset=utf-8' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~]
|
||||
~
|
||||
~
|
||||
==
|
||||
::
|
||||
++ thou-create-do |=([path resp=httr] ~&(resp :_(+>.$ ~)))
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: create google instances ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ reserve-ip
|
||||
|= name=json
|
||||
=+ nam=(need ((ot name/so ~):jo name))
|
||||
%- httpreq
|
||||
:* /reserve-ip/[nam]
|
||||
~['googleapis' 'www']
|
||||
/compute/v1/projects/urbcloud/regions/us-central1/addresses
|
||||
[%post (joba name/s/nam)]
|
||||
%^ mo ['Content-Type' 'application/json' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~]
|
||||
~
|
||||
*quay
|
||||
==
|
||||
::
|
||||
++ thou-reserve-ip
|
||||
|= [pax=path resp=httr]
|
||||
~& resp
|
||||
~| r.resp
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja)
|
||||
=+ ur=(need ((ot 'targetLink'^so ~):jo parsed))
|
||||
~& initial-response/parsed
|
||||
=+ name=-:(flop q.q:(need (epur ur)))
|
||||
=+(buf=`@da`(add ~s10 now) :_(+>.$ [ost %wait `path`/check-ip-status/[name] buf]~))
|
||||
::
|
||||
++ wake-check-ip-status
|
||||
|= [name=path ~]
|
||||
~& this-is-the-name/name
|
||||
=+ nam=?~(name !! -.name)
|
||||
:_ +>.$
|
||||
:_ ~
|
||||
%- httpreq
|
||||
:* `path`/check-ip-status/[nam]
|
||||
~['googleapis' 'www']
|
||||
`path`/compute/v1/projects/urbcloud/regions/us-central1/addresses/[nam]
|
||||
%get
|
||||
%^ mo ['Content-Type' 'application/json' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~]
|
||||
~
|
||||
*quay
|
||||
==
|
||||
++ thou-check-ip-status
|
||||
|= [name=path resp=httr]
|
||||
~& api-resp/resp
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja)
|
||||
!!
|
||||
::?. =('RESERVED' (need ((ot status/so ~):jo parsed)))
|
||||
::
|
||||
|
||||
|
||||
++ create-gce
|
||||
|= jon=json
|
||||
=+ ^- [name=@t image=@t number=@ud]
|
||||
(need ((ot name/so 'instance_img'^so number/ni ~):jo jon))
|
||||
|- ^- (list move)
|
||||
?~ number ~
|
||||
:_ $(number (dec number))
|
||||
=+ nam=(cat 3 name (scot %ud number))
|
||||
=+ ^- body=json
|
||||
%- jobe
|
||||
:~ name/s/nam 'machineType'^s/'zones/us-central1-a/machineTypes/n1-standard-1'
|
||||
:- %disks :- %a :_ ~
|
||||
%- jobe
|
||||
:+ 'initializeParams'^`json`(joba 'sourceImage'^s/image)
|
||||
boot/b/%.y
|
||||
~
|
||||
:- 'networkInterfaces' :- %a :_ ~
|
||||
(joba 'network' `json`[%s 'global/networks/default'])
|
||||
==
|
||||
^- move
|
||||
%- httpreq
|
||||
:* `path`/create-gce
|
||||
`(list cord)`~['googleapis' 'www'] `path`/compute/v1/projects/urbcloud/zones/us-central1-a/'instances'
|
||||
[%post `json`body]
|
||||
%^ mo ['Content-Type' 'application/json' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~]
|
||||
~
|
||||
`quay`[%key access.gce.toke.vat]~
|
||||
==
|
||||
::
|
||||
++ thou-create-gce |=([path resp=httr] ~&(resp :_(+>.$ ~)))
|
||||
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: perform actions on instances (both kinds) ::
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ poke-json :: receive action from client
|
||||
|= jon=json
|
||||
^- [(list move) _+>.$]
|
||||
=+ action=`cloud-command`(need (parse-cloud-command jon))
|
||||
:_ +>.$
|
||||
?- -.action
|
||||
%create-gce [(reserve-ip p.action)]~
|
||||
%create-do [(create-do p.action)]~
|
||||
::%create-gce [(create-gce p.action)]
|
||||
%action [(instance-action [id name act]:action)]~
|
||||
==
|
||||
++ instance-action
|
||||
|= [id=@t name=@t action=droplet-action]
|
||||
=+ d=(~(got by insts.vat) id)
|
||||
~| 'can\'t find id'
|
||||
=+ typ=?~(d !! -.d)
|
||||
?- typ
|
||||
%do
|
||||
=+ ^= meth
|
||||
?: ?=(%delete -.action)
|
||||
%delt
|
||||
[%post (jobe type/s/(convert-do -.action) ?.(?=(%snapshot -.action) ~ [name/s/p.action ~]))]
|
||||
^- move
|
||||
=+ ^= req
|
||||
%- httpreq :*
|
||||
/do/[-.action]
|
||||
~[%digitalocean %api]
|
||||
?:(?=(%delt meth) /v2/droplets/[id] /v2/droplets/[id]/actions)
|
||||
meth
|
||||
%^ mo ['Content-Type' 'application/json' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~] ~
|
||||
*quay
|
||||
==
|
||||
req
|
||||
::
|
||||
%gce
|
||||
=+ ^= head-query
|
||||
:- %^ mo ['Content-Type' 'application/json' ~]
|
||||
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~] ~
|
||||
*quay
|
||||
?- -.action
|
||||
?(%start %stop %reboot %'snapshot')
|
||||
=+ end=/compute/v1/projects/urbcloud/zones/us-central1-a/instances/[name]
|
||||
%- httpreq
|
||||
:* /gce-act/[-.action] ~['googleapis' 'www']
|
||||
(welp end [?:(?=(%reboot -.action) 'reset' -.action) ~])
|
||||
[%post ~]
|
||||
head-query
|
||||
==
|
||||
::
|
||||
%delete
|
||||
=+ end=/compute/v1/projects/urbcloud/zones/us-central1-a/instances/[name]
|
||||
%- httpreq
|
||||
:* /gce-act/[-.action] ~['googleapis' 'www']
|
||||
end
|
||||
%delt
|
||||
head-query
|
||||
==
|
||||
==
|
||||
==
|
||||
++ thou-do-act
|
||||
|= [pax=path resp=httr]
|
||||
~& [resp act/pax]
|
||||
:_ +>.$ ~
|
||||
::
|
||||
++ thou-gce-act
|
||||
|= [pax=path resp=httr]
|
||||
~& [resp act/pax]
|
||||
:_ +>.$ ~
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: retrieve google instances and images ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ list-gce
|
||||
^- (list move)
|
||||
:+ (list-something-gce /zones/['us-central1-a']/instances)
|
||||
(list-something-gce /global/snapshots)
|
||||
~
|
||||
::
|
||||
++ list-something-gce
|
||||
|= endpoint=path
|
||||
=+ ^= lis
|
||||
:*
|
||||
/list-gce/[-.endpoint]
|
||||
~[%googleapis %www] (welp /compute/v1/projects/urbcloud endpoint)
|
||||
%get ~
|
||||
^- quay
|
||||
[%'access_token' access.gce.toke.vat]~
|
||||
==
|
||||
~! lis
|
||||
~! +<:httpreq
|
||||
(httpreq lis)
|
||||
::
|
||||
++ thou-list-gce-zones :: instances
|
||||
|= [pax=path resp=httr]
|
||||
^- [(list move) _+>.$]
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja) :: body httr to json
|
||||
~| 'no list received or bad json'
|
||||
=+ items=(need ((ot items/(ar some) ~):jo parsed))
|
||||
=+ ^- ins=(list ,[@t instance])
|
||||
~| 'bad-json'^items
|
||||
%+ turn items
|
||||
|= in=json
|
||||
=< [id .]
|
||||
^- instance
|
||||
:- %gce
|
||||
%- need
|
||||
%. in =+ jo
|
||||
%- ot
|
||||
:~ name/so id/so status/so 'creationTimestamp'^(su parse-iso8601) ::zone/so
|
||||
'machineType'^(cu tail-url so)
|
||||
:: 'networkInterfaces'^parse-ip-gce
|
||||
==
|
||||
=. insts.vat
|
||||
%- mo
|
||||
%+ weld ins
|
||||
%+ skip (~(tap by insts.vat)) :: keep non-gce
|
||||
|= a=[@t instance] ?=(%gce +<.a)
|
||||
=+ buf=`@da`(add ~s10 now)
|
||||
=+ liz=(~(tap by insts.vat))
|
||||
=+ tail=(turn liz |=(a=[@t instance] +.a))
|
||||
:_ +>.$ ::
|
||||
:- [ost %wait /refresh-gce buf]
|
||||
(spam (instance-to-json tail))
|
||||
::
|
||||
++ thou-list-gce-global :: imgs
|
||||
|= [pax=path resp=httr]
|
||||
^- [(list move) _+>.$]
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja)
|
||||
=+ imgz=(need ((ot items/(ar some) ~):jo parsed))
|
||||
=. images.vat
|
||||
%- mo
|
||||
%+ weld
|
||||
%+ skip (~(tap by images.vat) *(list ,[[@t @t] image]))
|
||||
|=(a=[[@t @t] image] ?=(%gce ->.a))
|
||||
%+ turn imgz
|
||||
|= a=json
|
||||
=< [[name %gce] .]
|
||||
^- image
|
||||
:- %gce
|
||||
%- need
|
||||
%. a =+ jo
|
||||
%- ot
|
||||
[name/so id/so ~]
|
||||
:_ +>.$ [(spam `json`(image-to-json `(list image)`(map-to-list images.vat)))]
|
||||
::
|
||||
++ wake-refresh-gce |=([path ~] [list-gce +>.$])
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: list digital ocean droplets and images ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
++ list-do
|
||||
:+((list-something-do %droplets) (list-something-do %images) ~)
|
||||
++ list-something-do
|
||||
|= som=@tas
|
||||
=+ ^= lis
|
||||
:~ /list-do/[som]
|
||||
~[%digitalocean %api] /v2/[som]
|
||||
%get
|
||||
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~] ~)
|
||||
==
|
||||
(httpreq lis)
|
||||
::
|
||||
++ thou-list-do-droplets
|
||||
|= [pax=path resp=httr]
|
||||
^- [(list move) _+>.$]
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja) :: parse httr to json
|
||||
~| recieve-list/parsed
|
||||
=+ dar=(need ((ot droplets/(ar some) ~):jo parsed)) :: reparse ar of insts
|
||||
=+ ^- dropz=(list ,[@t instance])
|
||||
~| bad-json/-.dar
|
||||
%+ turn dar
|
||||
|= drp=json ^- [@t instance]
|
||||
=- ~! - -
|
||||
=< [id .]
|
||||
^- instance
|
||||
:- %do
|
||||
%- need
|
||||
%. drp
|
||||
=+ jo
|
||||
%- ot
|
||||
:~ name/so id/parse-id-text status/so 'created_at'^(su parse-iso8601) ::region/parse-region
|
||||
image/(ot name/so ~) ::disk/ni networks/parse-ip-do
|
||||
==
|
||||
=. insts.vat
|
||||
%- mo
|
||||
%+ weld dropz
|
||||
%+ skip (~(tap by insts.vat) *(list ,[@t instance]))
|
||||
|=(a=[@t instance] ?=(%do +>.$))
|
||||
=+ buf=`@da`(add ~s10 now)
|
||||
:_ +>.$
|
||||
:- [ost %wait /refresh-do buf]
|
||||
%- spam
|
||||
%- instance-to-json
|
||||
%+ turn (~(tap by insts.vat) *(list ,[@t instance]))
|
||||
|=(a=[@t instance] +.a)
|
||||
::
|
||||
++ thou-list-do-images
|
||||
|= [pax=path resp=httr]
|
||||
=+ parsed=(rash q:(need r.resp) apex:poja)
|
||||
~| crashed-do-images/parsed
|
||||
=+ imgz=(need ((ot images/(ar (ot [name/so distribution/so id/no ~])) ~):jo parsed))
|
||||
=+ ^- images=(list ,[[@t @t] image])
|
||||
%+ turn imgz
|
||||
|= [name=@t dist=@t id=@t]
|
||||
=+ nom=(cat 3 name dist)
|
||||
[[%do nom] `image`[%do nom id]]
|
||||
=. images.vat
|
||||
%- mo
|
||||
%+ weld images
|
||||
%+ skip (~(tap by images.vat) *(list ,[[@t @t] image]))
|
||||
|=(a=[[@t @t] image] ?=(%do ->.a))
|
||||
:_ +>.$ ~[(spam `json`(image-to-json `(list image)`(map-to-list images.vat)))]
|
||||
::
|
||||
++ wake-refresh-do |=([path ~] [list-do +>.$])
|
||||
--
|
@ -1,85 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct1/ape :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- sole, oct1 :: structures
|
||||
/+ sole, oct1 :: libraries
|
||||
[. sole oct1] :: ::
|
||||
:: :: ::
|
||||
:::: :::::: interfaces
|
||||
!: :: ::
|
||||
=> |% ::
|
||||
++ axon ,[%0 eye=face gam=game] :: agent state
|
||||
++ card ,[%diff %sole-effect sole-effect] :: update
|
||||
++ face (map bone sole-share) :: console state
|
||||
++ move (pair bone card) :: cause and action
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: parsers
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ colm (cook |=(a=@ (sub a '1')) (shim '1' '3')) :: row or column
|
||||
++ come ;~(plug colm ;~(pfix fas colm)) :: coordinate
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: process core
|
||||
:: :: ::
|
||||
|_ $: bowl :: system state
|
||||
moz=(list move) :: pending actions
|
||||
axon :: server state, v0
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :::::: process tools
|
||||
:: :: ::
|
||||
++ abet [(flop moz) .(moz ~)] :: resolve
|
||||
++ bike $+(_. _+>) :: self-transformer
|
||||
++ dish |=(cad=card %_(+> moz [[ost cad] moz])) :: request
|
||||
++ eels (~(tap by sup)) :: all clients
|
||||
++ echo |= [all=(list sink) fun=bike] =+ old=+>+<- ::
|
||||
|- ^+ +>.^$ ?~ all +>.^$(+<- old) ::
|
||||
=. ost p.i.all ::
|
||||
$(all t.all, +>.^$ (fun +>.^$)) ::
|
||||
++ flap |=(con=bike (echo eels con)) :: update all clients
|
||||
++ here ~(. go gam) :: game core
|
||||
:: :: ::
|
||||
:::: :::::: process logic
|
||||
:: :: ::
|
||||
++ fail (fect %bel ~) :: user error
|
||||
++ fect |=(sole-effect (dish %diff %sole-effect +<)) :: update console
|
||||
++ kick |= point =^ dud gam ~(m at:here +<) ::
|
||||
?.(dud fail wild:kind) ::
|
||||
++ kind =+(res:here ?~(- + (word(gam new:here) ->))) :: move result
|
||||
++ prom (fect %pro %& %oct1 voy:here) :: update prompt
|
||||
++ rend (turn `wall`tab:here |=(tape txt/+<)) :: table print
|
||||
++ sawn .(eye (~(del by eye) ost)) :: console unsubscribe
|
||||
++ seen .(eye (~(put by eye) ost *sole-share)) :: console subscribe
|
||||
++ show prom:(fect %mor rend) :: update console
|
||||
++ tame (flap |=(_. prom:+<)) :: light update
|
||||
++ wild (flap |=(_. show:+<)) :: full update
|
||||
++ word |=(tape (flap |=(_+> (fect:+< txt/+>+<)))) ::
|
||||
:: :: ::
|
||||
:::: :::::: process UI
|
||||
:: :: ::
|
||||
++ work :: console action
|
||||
|= act=sole-action ::
|
||||
=+ say=(~(got by eye) ost) ::
|
||||
|^ ?+(-.act abet %det (delt +.act), %ret dive) ::
|
||||
++ abet ..work(eye (~(put by eye) ost say)) :: resolve
|
||||
++ delt |= cal=sole-change :: edit command line
|
||||
=^ cul say (~(remit sole say) cal good) ::
|
||||
?~(cul abet fail:(fect:abet det/u.cul)) ::
|
||||
++ dive =+ (rust (tufa buf.say) (punt come)) :: apply command line
|
||||
?~(- fail ?~(-> show (kick:wipe ->+))) ::
|
||||
++ good |=((list ,@c) -:(rose (tufa +<) come)) :: validate input
|
||||
++ wipe =^ cal say (~(transmit sole say) set/~) :: clear line
|
||||
(fect:abet %det cal) ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: arvo handlers
|
||||
:: :: ::
|
||||
++ peer-sole |=(* abet:show:seen) :: console subscribe
|
||||
++ prep |= (unit (pair (list move) axon)) :: update self
|
||||
abet:?~(+< +> wild(+<+ +<+)) ::
|
||||
++ poke-sole-action |=(sole-action abet:(work +<)) :: console input
|
||||
++ pull-sole |=(* abet:sawn) :: console unsubscribe
|
||||
--
|
103
ape/oct2.hoon
103
ape/oct2.hoon
@ -1,103 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct2/ape :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- sole, oct2 :: structures
|
||||
/+ sole, oct2 :: libraries
|
||||
[. sole oct2] :: ::
|
||||
:: :: ::
|
||||
:::: :::::: interfaces
|
||||
!: :: ::
|
||||
=> |% ::
|
||||
++ axle ,[eye=face gam=game] :: agent state
|
||||
++ card $% [%diff lime] :: update
|
||||
[%quit ~] :: cancel
|
||||
== ::
|
||||
++ face (map bone sole-share) :: console state
|
||||
++ lime ,[%sole-effect sole-effect] :: :sole update
|
||||
++ move (pair bone card) :: cause and action
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: past state
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ axon $%([%1 axle] [%0 axle-0]) :: all states
|
||||
++ axle-0 ,[eye=face gam=game-0] :: old axle
|
||||
++ game-0 ,[who=? box=board boo=board] :: old game
|
||||
++ wake |= axon :- %1 ?- +<- %1 +<+ :: rough upgrade
|
||||
%0 [eye [who ~^~ ~ box boo]:gam]:+<+ ::
|
||||
== -- ::
|
||||
:: :: ::
|
||||
:::: :::::: parsers
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ colm (cook |=(a=@ (sub a '1')) (shim '1' '3')) :: row or column
|
||||
++ come ;~(plug colm ;~(pfix fas colm)) :: coordinate
|
||||
++ cope |=(? ?:(+< (stag %| (cold ~ sig)) come)) :: with wait mode
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: process core
|
||||
:: :: ::
|
||||
|_ $: bowl ::
|
||||
moz=(list move) :: pending actions
|
||||
[%1 axle] :: process state, v1
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :::::: process tools
|
||||
:: :: ::
|
||||
++ abet [(flop moz) .(moz ~)] :: resolve
|
||||
++ bike $+(_. _+>) :: self-transformer
|
||||
++ dish |=(cad=card %_(+> moz [[ost cad] moz])) :: request
|
||||
++ echo |= [all=(list sink) fun=bike] =+ old=+>+<- :: publish to all
|
||||
|- ^+ +>.^$ ?~ all +>.^$(+<- old) ::
|
||||
=> .(ost p.i.all, src q.i.all) ::
|
||||
$(all t.all, +>.^$ (fun +>.^$)) ::
|
||||
++ flap |=(con=bike (echo (~(tap by sup)) con)) :: update all clients
|
||||
++ here ~(. go src gam) :: game core
|
||||
:: :: ::
|
||||
:::: :::::: server logic
|
||||
:: :: ::
|
||||
++ fail (fect %bel ~) :: user error
|
||||
++ fect |=(sole-effect (dish %diff %sole-effect +<)) :: update console
|
||||
++ heal |= old=axon =. +>+<+> (wake old) :: complete update
|
||||
=- +>.$(gam -) ?. !=(1 +<-) gam ::
|
||||
(muy:here (turn (~(tap by sup)) |=(sink q))) ::
|
||||
++ kick |= point =^ dud gam ~(m at:here +<) ::
|
||||
?.(dud fail wild:kind) ::
|
||||
++ kind =+(res:here ?~(- + (word(gam new:here) ->))) :: move result
|
||||
++ hail |=(? tame(gam (hey:here +<))) :: toggle subscriber
|
||||
++ prom (fect %pro %& %oct2 voy:here) :: update prompt
|
||||
++ rend (turn `wall`tab:here |=(tape txt/+<)) :: table print
|
||||
++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe
|
||||
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
|
||||
++ show prom:(fect %mor rend) :: update console
|
||||
++ tame (flap |=(_. prom:+<)) :: light update
|
||||
++ wild (flap |=(_. show:+<)) :: full update
|
||||
++ word |=(tape (flap |=(_+> (fect:+< txt/+>+<)))) ::
|
||||
:: :: ::
|
||||
:::: :::::: console UI
|
||||
:: :: ::
|
||||
++ work :: console action
|
||||
|= act=sole-action ::
|
||||
=+ say=(~(got by eye) ost) ::
|
||||
|^ ?+(-.act abet %det (delt +.act), %ret dive) ::
|
||||
++ abet ..work(eye (~(put by eye) ost say)) :: resolve
|
||||
++ cusp (cope !ept:here) :: parsing rule
|
||||
++ delt |= cal=sole-change :: edit command line
|
||||
=^ cul say (~(remit sole say) cal good) ::
|
||||
?~(cul abet fail:(fect:abet det/u.cul)) ::
|
||||
++ dive =+ (rust (tufa buf.say) (punt come)) :: apply command line
|
||||
?~(- fail ?~(-> show (kick:wipe ->+))) ::
|
||||
++ good |=((list ,@c) -:(rose (tufa +<) cusp)) :: validate input
|
||||
++ wipe =^ cal say (~(transmit sole say) set/~) :: clear line
|
||||
(fect:abet %det cal) ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: arvo handlers
|
||||
:: :: ::
|
||||
++ peer-sole |=(* abet:show:seen) :: console subscribe
|
||||
++ poke-sole-action |=(sole-action abet:(work +<)) :: console input
|
||||
++ prep |= (unit (pair (list move) axon)) :: update self
|
||||
abet:?~(+< +> wild:(heal +<+>)) ::
|
||||
++ pull-sole |=(* abet:sawn) :: console unsubscribe
|
||||
--
|
116
ape/oct3.hoon
116
ape/oct3.hoon
@ -1,116 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct3/ape :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- sole, oct3 :: structures
|
||||
/+ sole, oct3 :: libraries
|
||||
[. sole oct3] :: ::
|
||||
:: :: ::
|
||||
:::: :::::: interfaces
|
||||
!: :: ::
|
||||
=> |% ::
|
||||
++ axle ,[eye=face gam=game] :: agent state
|
||||
++ card $% [%diff lime] :: update
|
||||
[%quit ~] :: cancel
|
||||
== ::
|
||||
++ face (map bone sole-share) :: console state
|
||||
++ lime $% [%sole-effect sole-effect] :: :sole update
|
||||
[%oct3-update play] :: :oct3 update
|
||||
== ::
|
||||
++ move (pair bone card) :: cause and action
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: past state
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ axon $%([%1 axle] [%0 axle-0]) :: all states
|
||||
++ axle-0 ,[eye=face gam=game-0] :: old axle
|
||||
++ game-0 ,[who=? box=board boo=board] :: old game
|
||||
++ wake |= axon :- %1 ?- +<- %1 +<+ :: coarse upgrade
|
||||
%0 [eye [who ~^~ ~ box boo]:gam]:+<+ ::
|
||||
== -- ::
|
||||
:: :: ::
|
||||
:::: :::::: parsers
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ colm (cook |=(a=@ (sub a '1')) (shim '1' '3')) :: row or column
|
||||
++ come ;~(plug colm ;~(pfix fas colm)) :: coordinate
|
||||
++ cope |=(? ?:(+< (stag %| (cold ~ sig)) come)) :: with wait mode
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: process core
|
||||
:: :: ::
|
||||
|_ $: bowl ::
|
||||
moz=(list move) :: pending actions
|
||||
[%1 axle] :: process state, v1
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :::::: process tools
|
||||
:: :: ::
|
||||
++ abet [(flop moz) .(moz ~)] :: resolve
|
||||
++ bike $+(_. _+>) :: self-transformer
|
||||
++ dish |=(cad=card %_(+> moz [[ost cad] moz])) :: request
|
||||
++ echo |= [all=(list sink) fun=bike] =+ old=+>+<- :: publish to all
|
||||
|- ^+ +>.^$ ?~ all +>.^$(+<- old) ::
|
||||
=> .(ost p.i.all, src q.i.all) ::
|
||||
$(all t.all, +>.^$ (fun +>.^$)) ::
|
||||
++ eels (~(tap by sup)) :: all clients
|
||||
++ elfs (prey /oct3 +<-) :: network clients
|
||||
++ elks (prey /sole +<-) :: console clients
|
||||
++ flap |= [net=bike con=bike] :: update all clients
|
||||
(echo:(echo elks con) elfs net) ::
|
||||
++ here ~(. go src gam) :: game core
|
||||
:: :: ::
|
||||
:::: :::::: server logic
|
||||
:: :: ::
|
||||
++ fail ?:(soul (fect %bel ~) ~|(%invalid-move !!)) :: user error
|
||||
++ fect |=(sole-effect (dish %diff %sole-effect +<)) :: update console
|
||||
++ fact |=(play (dish %diff %oct3-update +<)) :: update partner
|
||||
++ hail |=(? tame(gam (hey:here +<))) :: toggle subscriber
|
||||
++ heal |= old=axon =. +>+<+> (wake old) :: complete update
|
||||
=- +>.$(gam -) ?. !=(1 +<-) gam ::
|
||||
(muy:here (turn eels |=(sink q))) ::
|
||||
++ kick |= point =^ dud gam ~(m at:here +<) ::
|
||||
?.(dud fail wild:kind) ::
|
||||
++ kind =+(res:here ?~(- + (word(gam new:here) ->))) :: move result
|
||||
++ prom (fect %pro %& %oct3 voy:here) :: update prompt
|
||||
++ rend (turn `wall`tab:here |=(tape txt/+<)) :: table print
|
||||
++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe
|
||||
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
|
||||
++ show prom:(fect %mor rend) :: update console
|
||||
++ soul =+((~(get by sup) ost) ?=([~ * %sole *] -)) :: is console
|
||||
++ tame (flap |=(_. (fact:+< &/gam)) |=(_. prom:+<)) :: light update
|
||||
++ wild (flap |=(_. (fact:+< &/gam)) |=(_. show:+<)) :: full update
|
||||
++ word |= txt=tape %+ flap :: game message
|
||||
|=(_+> (fact:+< |/txt)) ::
|
||||
|=(_+> (fect:+< txt/txt)) ::
|
||||
:: :: ::
|
||||
:::: :::::: console UI
|
||||
:: :: ::
|
||||
++ work :: console action
|
||||
|= act=sole-action ::
|
||||
=+ say=(~(got by eye) ost) ::
|
||||
|^ ?+(-.act abet %det (delt +.act), %ret dive) ::
|
||||
++ abet ..work(eye (~(put by eye) ost say)) :: resolve
|
||||
++ cusp (cope !ept:here) :: parsing rule
|
||||
++ delt |= cal=sole-change :: edit command line
|
||||
=^ cul say (~(remit sole say) cal good) ::
|
||||
?~(cul abet fail:(fect:abet det/u.cul)) ::
|
||||
++ dive =+ (rust (tufa buf.say) (punt come)) :: apply command line
|
||||
?~(- fail ?~(-> show (kick:wipe ->+))) ::
|
||||
++ good |=((list ,@c) -:(rose (tufa +<) cusp)) :: validate input
|
||||
++ wipe =^ cal say (~(transmit sole say) set/~) :: clear line
|
||||
(fect:abet %det cal) ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: arvo handlers
|
||||
:: :: ::
|
||||
++ peer-oct3 |=(* abet:tame:(hail &)) :: urbit subscribe
|
||||
++ peer-sole |=(* abet:show:seen) :: console subscribe
|
||||
++ poke-sole-action |=(sole-action abet:(work +<)) :: console input
|
||||
++ poke-oct3-move |=(point abet:wild:(kick +<)) :: urbit move
|
||||
++ prep |= (unit (pair (list move) axon)) :: update self
|
||||
abet:?~(+< +> wild:(heal +<+>)) ::
|
||||
++ pull-oct3 |=(* abet:(hail |)) :: urbit unsubscribe
|
||||
++ pull-sole |=(* abet:sawn) :: console unsubscribe
|
||||
--
|
139
ape/oct4.hoon
139
ape/oct4.hoon
@ -1,139 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct4/ape :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- sole, oct4 :: structures
|
||||
/+ sole, oct4 :: libraries
|
||||
[. sole oct4] :: ::
|
||||
:: :: ::
|
||||
:::: :::::: interfaces
|
||||
!: :: ::
|
||||
=> |% ::
|
||||
++ axle ,[eye=face rem=(unit ship) gam=game] :: agent state
|
||||
++ card $% [%diff lime] :: update
|
||||
[%quit ~] :: cancel
|
||||
[%peer wire dock path] :: subscribe
|
||||
[%poke wire dock pear] :: send move
|
||||
[%pull wire dock ~] :: unsubscribe
|
||||
== ::
|
||||
++ face (map bone sole-share) :: console state
|
||||
++ lime $% [%sole-effect sole-effect] :: :sole update
|
||||
[%oct4-update play] :: :oct4 update
|
||||
== ::
|
||||
++ move (pair bone card) :: cause and action
|
||||
++ pear ,[%oct4-move point] :: outgoing move
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: past state
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ agon (unit ,[(list move) axon]) :: boot argument
|
||||
++ axon $%([%1 axle] [%0 axle-0]) :: all states
|
||||
++ axle-0 ,[eye=face gam=game-0] :: old axle
|
||||
++ game-0 ,[who=? box=board boo=board] :: old game
|
||||
++ wake |= axon :- %1 ?- +<- %1 +<+ :: coarse upgrade
|
||||
%0 [eye ~ [who ~^~ ~ box boo]:gam]:+<+ ::
|
||||
== -- ::
|
||||
:: :: ::
|
||||
:::: :::::: parsers
|
||||
:: :: ::
|
||||
=> |% ::
|
||||
++ colm (cook |=(a=@ (sub a '1')) (shim '1' '3')) :: row or column
|
||||
++ come ;~(plug colm ;~(pfix fas colm)) :: coordinate
|
||||
++ comb (pick come ;~(pfix sig (punt fed:ag))) :: all command input
|
||||
++ cope |=(? ?:(+< (stag %| (cold ~ sig)) comb)) :: with wait mode
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: process core
|
||||
:: :: ::
|
||||
|_ $: bowl ::
|
||||
moz=(list move) :: pending actions
|
||||
[%1 axle] :: process state, v1
|
||||
== ::
|
||||
:: :: ::
|
||||
:::: :::::: process tools
|
||||
:: :: ::
|
||||
++ abet [(flop moz) .(moz ~)] :: resolve
|
||||
++ bike $+(_. _+>) :: self-transformer
|
||||
++ dish |=(cad=card %_(+> moz [[ost cad] moz])) :: request
|
||||
++ done (echo eels |=(_. (dish:+< %quit ~))) :: cancel everyone
|
||||
++ echo |= [all=(list sink) fun=bike] =+ old=+>+<- :: publish to all
|
||||
|- ^+ +>.^$ ?~ all +>.^$(+<- old) ::
|
||||
=> .(ost p.i.all, src q.i.all) ::
|
||||
$(all t.all, +>.^$ (fun +>.^$)) ::
|
||||
++ eels (~(tap by sup)) :: all clients
|
||||
++ elfs (prey /oct4 +<-) :: network clients
|
||||
++ elks (prey /sole +<-) :: console clients
|
||||
++ emit |=(lime (dish %diff +<)) :: publish
|
||||
++ flap |= [net=bike con=bike] :: update all clients
|
||||
(echo:(echo elks con) elfs net) ::
|
||||
++ here ~(. go src gam) :: game core
|
||||
:: :: ::
|
||||
:::: :::::: server logic
|
||||
:: :: ::
|
||||
++ fail ?:(soul (fect %bel ~) ~|(%invalid-move !!)) :: user error
|
||||
++ fect |=(sole-effect (emit %sole-effect +<)) :: update console
|
||||
++ fact |=(play (emit %oct4-update +<)) :: update partner
|
||||
++ hail |=(? ?^(rem +> tame(gam (hey:here +<)))) :: toggle subscriber
|
||||
++ harp |=(game ?:(=(gam +<) +> wild(gam +<))) :: update game
|
||||
++ heal |= old=axon =. +>+<+> (wake old) :: complete update
|
||||
=- +>.$(gam -) ?. !=(1 +<-) gam ::
|
||||
(muy:here (turn eels |=(sink q))) ::
|
||||
++ hear |=(play ?-(+<- | (word +<+), & (harp +<+))) :: network update
|
||||
++ kick |= point =^ dud gam ~(m at:here +<) ::
|
||||
?.(dud fail wild:?~(rem kind (send +>-))) ::
|
||||
++ kind =+(res:here ?~(- + (word(gam new:here) ->))) :: move result
|
||||
++ plan |= (unit ship) ?~ +< stop(gam new:here) :: link/unlink
|
||||
?^(rem fail link(rem +<)) ::
|
||||
++ plot |= (each point (unit ship)) :: apply command
|
||||
?-(+<- & (kick +<+), | (plan +<+)) ::
|
||||
++ like |*(* [/oct4 [+.rem dap] +<]) :: friend message
|
||||
++ link (dish peer/(like /oct4)) :: subscribe to friend
|
||||
++ prom (fect %pro %& %oct4 stat) :: update prompt
|
||||
++ rend (turn `wall`tab:here |=(tape txt/+<)) :: table print
|
||||
++ sawn (hail(eye (~(del by eye) ost)) |) :: console unsubscribe
|
||||
++ seen (hail(eye (~(put by eye) ost *sole-share)) &) :: console subscribe
|
||||
++ send |=(point (dish poke/(like %oct4-move +<))) :: send move
|
||||
++ show prom:(fect %mor rend) :: update console
|
||||
++ soul =+((~(get by sup) ost) ?=([~ * %sole *] -)) :: is console
|
||||
++ stat (weld ?~(rem ~ "@{(scow p/u.rem)}") voy:here) :: prompt line
|
||||
++ stop ?~(rem done wild:(dish pull/(like ~))) :: unsubscribe
|
||||
++ tame (flap |=(_. (fact:+< &/gam)) |=(_. prom:+<)) :: light update
|
||||
++ wild (flap |=(_. (fact:+< &/gam)) |=(_. show:+<)) :: full update
|
||||
++ with |=(? (word(rem ?:(+< rem ~)) "{<[+< src]>}")) ::
|
||||
++ word |= txt=tape %+ flap :: game message
|
||||
|=(_+> (fact:+< |/txt)) ::
|
||||
|=(_+> (fect:+< txt/txt)) ::
|
||||
:: :: ::
|
||||
:::: :::::: console UI
|
||||
:: :: ::
|
||||
++ work :: console action
|
||||
|= act=sole-action ::
|
||||
=+ say=(~(got by eye) ost) ::
|
||||
|^ ?+(-.act abet %det (delt +.act), %ret dive) ::
|
||||
++ abet ..work(eye (~(put by eye) ost say)) :: resolve
|
||||
++ cusp (cope !ept:here) :: parsing rule
|
||||
++ delt |= cal=sole-change :: edit command line
|
||||
=^ cul say (~(remit sole say) cal good) ::
|
||||
?~(cul abet fail:(fect:abet det/u.cul)) ::
|
||||
++ dive =+ (rust (tufa buf.say) (punt comb)) :: apply command line
|
||||
?~(- fail ?~(-> show (plot:wipe ->+))) ::
|
||||
++ good |=((list ,@c) -:(rose (tufa +<) cusp)) :: validate input
|
||||
++ wipe =^ cal say (~(transmit sole say) set/~) :: clear line
|
||||
(fect:abet %det cal) ::
|
||||
-- ::
|
||||
:: :: ::
|
||||
:::: :::::: arvo handlers
|
||||
:: :: ::
|
||||
++ reap-oct4 |=([* (unit)] abet:(with =(~ +<+))) :: linked to friend
|
||||
++ coup-oct4 |=([* (unit)] abet:?~(+<+ +> fail)) :: move acknowledge
|
||||
++ diff-oct4-update |=([* play] abet:(hear +<+)) :: network update
|
||||
++ peer-oct4 |=(* abet:tame:(hail &)) :: urbit subscribe
|
||||
++ peer-sole |=(* abet:show:seen) :: console subscribe
|
||||
++ poke-sole-action |=(sole-action abet:(work +<)) :: console input
|
||||
++ poke-oct4-move |=(point abet:wild:(kick +<)) :: urbit move
|
||||
++ prep |=(agon abet:?~(+< +> (heal +<+>))) :: load state
|
||||
++ pull-oct4 |=(* abet:(hail |)) :: urbit unsubscribe
|
||||
++ pull-sole |=(* abet:sawn) :: console unsubscribe
|
||||
++ quit-oct4 |=(* abet:?~(rem +> wild(rem ~))) :: unlinked by friend
|
||||
--
|
@ -1,8 +0,0 @@
|
||||
/- twitter
|
||||
!:
|
||||
[twitter .]
|
||||
|_ [bowl ~]
|
||||
++ poke-noun |=(span (onwards [%peer / [our %twit] /user/[+<]]))
|
||||
++ onwards |*([mark *] [[ost +<]~ +>.$])
|
||||
++ diff-twit-feed |=([* a=(list twit-stat)] ?~(a `+>.$ ~&(i.a $(a t.a))))
|
||||
--
|
219
ape/twit.hoon
219
ape/twit.hoon
@ -1,219 +0,0 @@
|
||||
:: Twitter daemon
|
||||
::
|
||||
:::: /hook/core/twit/app
|
||||
::
|
||||
/- twitter
|
||||
/+ twitter, talk
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
[twitter .]
|
||||
|%
|
||||
++ twit-path :: valid peer path
|
||||
$% :: [%home ~] :: home timeline
|
||||
[%user p=@t ~] :: user's tweets
|
||||
[%post p=span:,@uv ~] :: status of status
|
||||
==
|
||||
::
|
||||
++ axle :: app state
|
||||
$: %0
|
||||
kes=(map span keys:twit-do) :: auth
|
||||
out=(map ,@uvI (each ,[span cord] stat)) :: sent tweets
|
||||
ran=(map path ,[p=@ud q=@da]) :: polls active
|
||||
fed=(jar path stat) :: feed cache
|
||||
==
|
||||
::
|
||||
++ gift :: subscription action
|
||||
$% [%quit ~] :: terminate
|
||||
[%diff gilt] :: send data
|
||||
==
|
||||
++ gilt
|
||||
$% [%twit-feed p=(list stat)] :: posts in feed
|
||||
[%twit-stat p=stat] :: tweet accepted
|
||||
[%ares term (list tank)]
|
||||
==
|
||||
::
|
||||
++ move ,[bone card]
|
||||
++ card :: arvo request
|
||||
$? gift
|
||||
$% [%them path ~ u=hiss] :: HTTP request
|
||||
[%poke wire dock %talk-command command:talk] ::
|
||||
[%wait path p=@da] :: timeout
|
||||
== ==
|
||||
::
|
||||
++ sign :: arvo response
|
||||
$% [%e %thou p=httr] :: HTTP result
|
||||
[%t %wake ~] :: timeout ping
|
||||
==
|
||||
::
|
||||
++ stat twit-stat :: recieved tweet
|
||||
--
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|_ [bowl axle]
|
||||
++ any-auth ?~(kes (auth) (auth p.n.kes)) :: use any keys
|
||||
++ auth :: build API door
|
||||
|= a=span
|
||||
~| [%no-auth a]
|
||||
~(. twit (~(got by kes) a) now `@`eny)
|
||||
::
|
||||
++ cull :: remove seen tweets
|
||||
|= [pax=path rep=(list stat)] ^+ rep
|
||||
=+ pev=(sa (turn (~(get ja fed) pax) |=(stat id)))
|
||||
(skip rep |=(stat (~(has in pev) id)))
|
||||
::
|
||||
++ done [*(list move) .]
|
||||
++ dely :: next polling timeout
|
||||
|= pax=path
|
||||
^- [(unit time) _ran]
|
||||
=+ cur=(~(get by ran) pax)
|
||||
=+ tym=(add now (mul ~s8 (bex ?~(cur 0 p.u.cur))))
|
||||
:: ~& dely/`@dr`(sub tym now)
|
||||
?: &(?=(^ cur) (gte tym q.u.cur) (gth q.u.cur now))
|
||||
[~ ran]
|
||||
[`tym (~(put by ran) pax ?~(cur 0 (min 5 +(p.u.cur))) tym)]
|
||||
::
|
||||
++ wait :: ensure poll by path
|
||||
|= [pax=path mof=(list move)]
|
||||
=^ tym ran (dely pax)
|
||||
:_ +>.$
|
||||
?~ tym
|
||||
:: ~& no-wait/ran
|
||||
mof
|
||||
:: ~& will-wait/u.tym
|
||||
:- [ost %wait pax u.tym]
|
||||
mof
|
||||
::
|
||||
++ poke-twit-do :: recieve request
|
||||
|= act=twit-do
|
||||
^+ [*(list move) +>]
|
||||
?- -.q.act
|
||||
%auth
|
||||
:- [(print "authed @{(trip p.act)}")]~
|
||||
+>.$(kes (~(put by kes) p.act p.q.act)) :: XX verify key
|
||||
%post
|
||||
=: out (~(put by out) p.q.act %& p.act q.q.act)
|
||||
ran (~(del by ran) /peer/home)
|
||||
==
|
||||
%+ wait /peer/home
|
||||
=+ mez=(stat-upda:(auth p.act) [%status q.q.act]~ ~)
|
||||
[ost %them /post/(scot %uv p.q.act) ~ mez]~
|
||||
==
|
||||
::
|
||||
++ wake-peer
|
||||
|= [pax=path ~] ^+ done
|
||||
~& twit-wake/peer/pax
|
||||
:_ +>.$
|
||||
?. (~(has by ran) peer/pax) :: ignore if retracted
|
||||
~
|
||||
=+ => |=([a=bone @ b=path] [b a])
|
||||
pus=(~(gas ju *(jug path bone)) (turn (~(tap by sup)) .))
|
||||
?~ (~(get ju pus) pax)
|
||||
~
|
||||
~& peer-again/[pax ran]
|
||||
(pear | our pax)
|
||||
::
|
||||
++ thou
|
||||
|= [pax=path hit=httr] ^+ done
|
||||
?+ p.hit ~|([%unknown-code p.hit] !!)
|
||||
429 :: Rate-limit
|
||||
=. ran (~(put by ran) pax 6 now)
|
||||
=+ lim=%.(%x-rate-limit-reset ;~(biff ~(get by (mo q.hit)) poja ni:jo))
|
||||
=+ tym=?~(lim (add ~m7.s30 now) (add ~1970.1.1 (mul ~s1 u.lim)))
|
||||
~& retrying-in/`@dr`(sub tym now)
|
||||
:_(+>.$ [ost %wait pax tym]~)
|
||||
::
|
||||
200 :: OK
|
||||
=+ jon=(need (poja q:(need r.hit)))
|
||||
:: ~& twit-resp/%.(jon ?+(-.jon !! %o stat:twir, %a (ar:jo stat:twir)))
|
||||
?+ pax ~|([%http-missed pax] !!)
|
||||
[%post @ ~] :: post acknowledged
|
||||
=+ ^= rep
|
||||
~| [%bad-post jon]
|
||||
(need %.(jon stat:twir))
|
||||
=. out (~(put by out) (slav %uv i.t.pax) %| rep)
|
||||
:_ +>.$
|
||||
=+ pax=/[who.rep]/status/(rsh 3 2 (scot %ui id.rep))
|
||||
:- (print (earn [& ~ `/com/twitter] `pax ~))
|
||||
(spam pax (tweet-good rep))
|
||||
[%peer *] :: feed data
|
||||
=+ ^= rep
|
||||
~| [%bad-feed jon]
|
||||
(need %.(jon (ar:jo stat:twir)))
|
||||
:: ~& got-feed/[(scag 5 (turn rep |=(stat id))) fed]
|
||||
=+ ren=(cull t.pax rep) :: new messages
|
||||
?~ ren
|
||||
(wait pax ~) :: pump polling
|
||||
:: ~& spam-feed/ren
|
||||
=: ran (~(del by ran) pax) :: clear poll delay
|
||||
fed (~(put by fed) t.pax rep) :: saw last message
|
||||
==
|
||||
(wait pax (spam t.pax [%diff twit-feed/(flop ren)] ~))
|
||||
==
|
||||
::
|
||||
?(400 401 403 404) :: Err
|
||||
=+ ^- git=gift
|
||||
=+ err=%.(q:(need r.hit) ;~(biff poja mean:twir))
|
||||
:^ %diff %ares %bad-http
|
||||
[leaf/"HTTP Code {<p.hit>}" (turn (need err) mean:twip)]
|
||||
?+ pax [[ost git]~ +>.$]
|
||||
[%post @ ~]
|
||||
[(spam pax git ~) +>.$]
|
||||
==
|
||||
==
|
||||
++ tweet-good |=(rep=stat `(list gift)`~[[%diff %twit-stat rep] [%quit ~]])
|
||||
++ peer |=(pax=path :_(+> (pear & src pax))) :: accept subscription
|
||||
++ pear :: poll, possibly returning current data
|
||||
|= [ver=? @ pax=path]
|
||||
^- (list move)
|
||||
?. ?=(twit-path pax)
|
||||
~|([%missed-path pax] !!)
|
||||
=> .(pax `twit-path`pax)
|
||||
?: ?=(%post -.pax)
|
||||
?. ver ~
|
||||
=+ sta=(~(get by out) (slav %uv p.pax))
|
||||
?. ?=([~ %| ^] sta) :: post not received
|
||||
~
|
||||
~[[ost %diff %twit-stat p.u.sta] [ost %quit ~]]
|
||||
=+ ole=(~(get ja fed) pax)
|
||||
:_ ^- (list move)
|
||||
?. ver ~
|
||||
?~ ole ~
|
||||
[ost %diff %twit-feed (flop ole)]~
|
||||
=- `move`[ost %them peer/pax ~ `hiss`-]
|
||||
=+ opt=?~(ole ~ ['since_id' (lutt:twit id.i.ole)]~)
|
||||
=+ aut=any-auth
|
||||
?- -.pax
|
||||
%user (stat-user:aut [(to-sd p.pax)]~ opt)
|
||||
:: %home (stat-home:auth ~ opt)
|
||||
==
|
||||
::
|
||||
++ to-sd :: parse user name/numb
|
||||
|= a=span ^- sd:twit
|
||||
~| [%not-user a]
|
||||
%+ rash a
|
||||
;~(pose (stag %user-id dem) (stag %screen-name user:twir))
|
||||
::
|
||||
:: ++ pull :: release subscription
|
||||
:: |= ost=bone
|
||||
:: ?. (~(has by sup) ost) `+>.$ :: XX should not occur
|
||||
:: =+ [his pax]=(~(got by sup) ost)
|
||||
:: ?: (lth 1 ~(wyt in (~(get ju pus) pax)))
|
||||
:: `+>.$
|
||||
:: =: ran (~(del by ran) [%peer pax])
|
||||
:: fed (~(del by fed) pax)
|
||||
:: ==
|
||||
:: `+>.$
|
||||
::
|
||||
++ spam :: send by path
|
||||
|= [a=path b=(list gift)] ^- (list move)
|
||||
%- zing ^- (list (list move))
|
||||
%+ turn (~(tap by sup))
|
||||
|= [ost=bone @ pax=path]
|
||||
?. =(pax a) ~
|
||||
(turn b |=(c=gift [ost c]))
|
||||
::
|
||||
++ print
|
||||
|=(mes=tape [ost %poke / [our %talk] (said our %twit now eny leaf/mes ~)])
|
||||
--
|
@ -1,6 +1,6 @@
|
||||
:: There is no love that is not an echo
|
||||
::
|
||||
:::: /hoon/echo/ape
|
||||
:::: /hoon/ask/app
|
||||
::
|
||||
/? 314
|
||||
/+ sole
|
@ -1,5 +1,5 @@
|
||||
!:
|
||||
::::
|
||||
:::: /hoon/curl/app
|
||||
::
|
||||
|_ [[^ ^ ost=@ ^] ~]
|
||||
++ poke |*(a=[mark *] :_(+> [ost %hiss / %wain a]~))
|
@ -729,7 +729,7 @@
|
||||
=- ?~(too - [%cast u.too -])
|
||||
:+ %ride gen
|
||||
:- [%$ dy-twig-head]
|
||||
[%plan he-beam / zuse arc lib ~ ~]
|
||||
[%plan he-beam blob/** zuse arc lib ~ ~]
|
||||
::
|
||||
++ dy-step :: advance project
|
||||
|= nex=@ud
|
@ -1,5 +1,5 @@
|
||||
:: :: ::
|
||||
:::: /hoon/hood/ape :: ::
|
||||
:::: /hoon/hood/app :: ::
|
||||
:: :: ::
|
||||
/? 314 :: zuse version
|
||||
/+ sole, talk, helm, kiln, drum, write :: libraries
|
||||
@ -107,6 +107,7 @@
|
||||
++ poke-helm-reload (wrap poke-reload):from-helm
|
||||
++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm
|
||||
++ poke-helm-reset (wrap poke-reset):from-helm
|
||||
++ poke-helm-serve (wrap poke-serve):from-helm
|
||||
++ poke-helm-send-hi (wrap poke-send-hi):from-helm
|
||||
++ poke-helm-send-ask (wrap poke-send-ask):from-helm
|
||||
++ poke-helm-verb (wrap poke-verb):from-helm
|
||||
@ -127,7 +128,10 @@
|
||||
++ poke-kiln-overload (wrap poke-overload):from-kiln
|
||||
++ poke-kiln-unmount (wrap poke-unmount):from-kiln
|
||||
++ poke-kiln-unsync (wrap poke-unsync):from-kiln
|
||||
++ poke-write-comment (wrap poke-comment):from-write
|
||||
++ poke-write-paste (wrap poke-paste):from-write
|
||||
++ poke-write-tree (wrap poke-tree):from-write
|
||||
++ poke-write-wipe (wrap poke-wipe):from-write
|
||||
++ poke-will (wrap poke-will):from-helm
|
||||
++ quit-drum-phat (wrap quit-phat):from-drum
|
||||
++ reap-drum-phat (wrap reap-phat):from-drum
|
@ -2151,14 +2151,14 @@
|
||||
=+ grams:(~(got by stories) man)
|
||||
[ost.hid %info /jamfile our.hid (foal paf [%talk-telegrams !>(-)])]
|
||||
::
|
||||
++ poke-save
|
||||
++ poke-talk-save
|
||||
|= man=span
|
||||
^- (quip move +>)
|
||||
=+ paf=/(scot %p our.hid)/home/(scot %da now.hid)/talk/[man]/talk-telegrams
|
||||
=+ grams:(~(got by stories) man)
|
||||
[[ost.hid %info /jamfile our.hid (foal paf [%talk-telegrams !>(-)])]~ +>.$]
|
||||
::
|
||||
++ poke-load
|
||||
++ poke-talk-load
|
||||
|= man=span
|
||||
=+ ^= grams
|
||||
%- (hard (list telegram))
|
||||
@ -2168,15 +2168,14 @@
|
||||
=+ toy=(~(got by stories) man)
|
||||
[~ +>.$(stories (~(put by stories) man toy(grams grams, count (lent grams))))]
|
||||
::
|
||||
++ poke-log
|
||||
++ poke-talk-log
|
||||
|= man=span
|
||||
~& %poke-log
|
||||
|
||||
^- (quip move +>)
|
||||
:- [(log-to-file man) ~]
|
||||
+>.$(log (~(put by log) man count:(~(got by stories) man)))
|
||||
::
|
||||
++ poke-unlog
|
||||
++ poke-talk-unlog
|
||||
|= man=span
|
||||
^- (quip move +>)
|
||||
:- ~
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
::::
|
||||
:::: /hoon/work/app
|
||||
::
|
||||
/? 314
|
||||
/- work
|
@ -566,7 +566,7 @@
|
||||
%+ skid `(list (pair path miso))`ins
|
||||
|= [pax=path mis=miso]
|
||||
?> ?=(%ins -.mis)
|
||||
?& ?=([?(%hoon %hook) *] (flop pax))
|
||||
?& ?=([%hoon *] (flop pax))
|
||||
?=(%mime p.p.mis)
|
||||
==
|
||||
=. +>.$
|
||||
@ -1367,8 +1367,6 @@
|
||||
?: (~(has by hat) pax) !! ::
|
||||
%+ ~(put by bar) pax
|
||||
%- make-direct
|
||||
?: &(?=(%mime -.p.mys) =([%hook ~] (slag (dec (lent pax)) pax)))
|
||||
`page`[%hook +.+.q.q.p.mys]
|
||||
?: &(?=(%mime -.p.mys) =([%hoon ~] (slag (dec (lent pax)) pax)))
|
||||
`page`[%hoon +.+.q.q.p.mys]
|
||||
[p q.q]:p.mys
|
||||
@ -1616,7 +1614,7 @@
|
||||
?~ lob
|
||||
[~ ~]
|
||||
=+ mar=(lobe-to-mark u.lob)
|
||||
?. ?=(?(%hoon %hook) mar)
|
||||
?. ?=(%hoon mar)
|
||||
[~ ~ %| u.lob]
|
||||
:^ ~ ~ %&
|
||||
:+ mar [%atom %t]
|
||||
@ -2637,10 +2635,8 @@
|
||||
|= [a=path b=miso]
|
||||
?& ?=(%ins -.b)
|
||||
?=(%mime p.p.b)
|
||||
=+ (slag (dec (lent a)) a)
|
||||
?| =([%hook ~] -)
|
||||
=([%hoon ~] -)
|
||||
== ==
|
||||
?=([%hoon ~] (slag (dec (lent a)) a))
|
||||
==
|
||||
:~ [hen %pass /one %c %info p.bem q.bem %& one]
|
||||
[hen %pass /two %c %info p.bem q.bem %& two]
|
||||
==
|
||||
|
213
arvo/eyre.hoon
213
arvo/eyre.hoon
@ -66,9 +66,10 @@
|
||||
-- ::
|
||||
|% :: models
|
||||
++ bolo :: eyre state
|
||||
$: %3 :: version
|
||||
$: %4 :: version
|
||||
gub=@t :: random identity
|
||||
hov=(unit ship) :: master for remote
|
||||
top=beam :: ford serve prefix
|
||||
ged=duct :: client interface
|
||||
ded=(set duct) :: killed requests
|
||||
lyv=(map duct live) :: living requests
|
||||
@ -141,7 +142,7 @@
|
||||
$| ~
|
||||
$% [%$ p=httr] :: direct response
|
||||
[%red ~] :: parent redirect
|
||||
[%boil p=whir q=term r=beam payload=quay] :: ford request
|
||||
[%bake p=whir q=mark r=coin s=beam] :: ford request
|
||||
::
|
||||
[%js p=@t] :: script
|
||||
[%json p=json] :: data
|
||||
@ -159,13 +160,11 @@
|
||||
::
|
||||
++ fcgi :: credential caboose
|
||||
|= [quy=quay ced=cred] ^- coin
|
||||
:* %many
|
||||
[%$ %ta ~]
|
||||
[%blob ced]
|
||||
|- ^- (list coin)
|
||||
?~ quy ~
|
||||
[[%$ %t p.i.quy] [%$ %t q.i.quy] $(quy t.quy)]
|
||||
==
|
||||
:+ %many
|
||||
[%blob ced]
|
||||
|- ^- (list coin)
|
||||
?~ quy [%$ %n ~]~
|
||||
[[%$ %t p.i.quy] [%$ %t q.i.quy] $(quy t.quy)]
|
||||
::
|
||||
++ gsig |=([a=dock b=path] [(scot %p p.a) q.a b])
|
||||
++ session-from-cookies
|
||||
@ -232,7 +231,7 @@
|
||||
|= tan=tang
|
||||
;html
|
||||
;head
|
||||
;link(rel "stylesheet", href "/home/lib/base.css"); :: XX desk
|
||||
;link(rel "stylesheet", href "/lib/base.css");
|
||||
;title: server error
|
||||
==
|
||||
;body:div#c.err:pre:code:"{(wush 80 tan)}"
|
||||
@ -421,51 +420,69 @@
|
||||
{ship:urb.ship,code:null},
|
||||
function(){urb.redir()})
|
||||
}
|
||||
urb.submit = function(){
|
||||
if(urb.ship !== $ship.text().toLowerCase())
|
||||
return urb.redir($ship.text().toLowerCase()) // XX redundant?
|
||||
urb.is_me = function(ship) {
|
||||
return (urb.ship === ship)
|
||||
}
|
||||
urb.submit = function(ship,pass){
|
||||
if(!urb.is_me(ship))
|
||||
return urb.redir(ship)
|
||||
req(
|
||||
"/~/auth.json?PUT",
|
||||
{ship:$ship.text().toLowerCase(), code:pass.value},
|
||||
{ship:ship, code:pass},
|
||||
function(){
|
||||
if(urb.foreign) urb.redir()
|
||||
else document.location.reload()
|
||||
})
|
||||
}
|
||||
urb.away = function(){req("/~/auth.json?DELETE", {},
|
||||
function(){document.getElementById("c").innerHTML = "<p>Goodbye.</p>" }
|
||||
function(){document.getElementById("c").innerHTML = "" }
|
||||
)}
|
||||
'''
|
||||
++ etag
|
||||
'''
|
||||
if(!window.urb) window.urb = {}
|
||||
urb.waspFrom = function(sel,attr){
|
||||
Array.prototype.map.call(document.querySelectorAll(sel),
|
||||
function(ele){
|
||||
if(!ele[attr] || (new URL(ele[attr])).host != document.location.host)
|
||||
return;
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open("HEAD", ele[attr])
|
||||
xhr.send()
|
||||
xhr.onload = function(){
|
||||
var dep = this.getResponseHeader("etag")
|
||||
if(dep) urb.wasp(JSON.parse(dep.substr(2)))
|
||||
}})}
|
||||
if(urb.wasp){urb.waspFrom('script','src'); urb.waspFrom('link','href')}
|
||||
urb.waspAll = function(sel){
|
||||
Array.prototype.map.call(document.querySelectorAll(sel), urb.waspElem)
|
||||
}
|
||||
urb.waspElem = function(ele){
|
||||
url = ele.src || ele.href
|
||||
if(!url || (new URL(url)).host != document.location.host)
|
||||
return;
|
||||
urb.waspUrl(url)
|
||||
}
|
||||
urb.waspUrl = function(url){
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open("HEAD", url)
|
||||
xhr.send()
|
||||
xhr.onload = urb.waspLoadedXHR
|
||||
}
|
||||
urb.waspLoadedXHR = function(){
|
||||
var dep = this.getResponseHeader("etag")
|
||||
if(dep) urb.wasp(JSON.parse(dep.substr(2)))
|
||||
}
|
||||
if(urb.wasp){urb.waspAll('script'); urb.waspAll('link')}
|
||||
'''
|
||||
--
|
||||
++ xml
|
||||
|%
|
||||
++ login-page
|
||||
%+ titl 'Log in :urbit'
|
||||
;= ;h1: Please log in
|
||||
;p.ship
|
||||
;div.sig: ~
|
||||
;span#ship(contenteditable "");
|
||||
%+ titl 'Sign in - Urbit'
|
||||
;= ;div.container
|
||||
;div.row
|
||||
;div.col-md-4
|
||||
;h1.sign: Sign in
|
||||
==
|
||||
;div.col-md-8
|
||||
;p.ship
|
||||
;label.sig: ~
|
||||
;input#ship.mono(contenteditable "", placeholder "planet");
|
||||
==
|
||||
;input#pass.mono(type "password", placeholder "passcode");
|
||||
;h2.advice: Your passcode code has been printed to your console.
|
||||
;pre:code#err;
|
||||
==
|
||||
==
|
||||
==
|
||||
;input#pass(type "password");
|
||||
;h2.advice: (Your login code has been printed to your console.)
|
||||
;pre:code#err;
|
||||
;script@"/~/at/~/auth.js";
|
||||
;script:'''
|
||||
$(function() {
|
||||
@ -473,8 +490,8 @@
|
||||
$pass = $('#pass')
|
||||
$ship.on('keydown', function(e) {
|
||||
if(e.keyCode === 13 || e.keyCode === 9) {
|
||||
if(urb.ship !== $ship.text().toLowerCase())
|
||||
urb.redir($ship.text().toLowerCase())
|
||||
if(!urb.is_me($ship.val().toLowerCase()))
|
||||
urb.redir($ship.val().toLowerCase())
|
||||
$pass.show()
|
||||
$pass.focus()
|
||||
e.preventDefault()
|
||||
@ -485,11 +502,11 @@
|
||||
})
|
||||
$pass.on('keydown', function(e) {
|
||||
if(e.keyCode === 13) {
|
||||
urb.submit()
|
||||
urb.submit($ship.val().toLowerCase(),$pass.val())
|
||||
}
|
||||
})
|
||||
if(window.ship) {
|
||||
$ship.text(urb.ship)
|
||||
$ship.val(urb.ship)
|
||||
$pass.focus()
|
||||
} else {
|
||||
$pass.hide()
|
||||
@ -500,11 +517,23 @@
|
||||
::
|
||||
++ logout-page
|
||||
%+ titl 'Log out'
|
||||
;= ;h1: Goodbye ~;{span#ship}.
|
||||
;button#act(onclick "urb.away()"): Log out
|
||||
;pre:code#err;
|
||||
;script@"/~/at/~/auth.js";
|
||||
==
|
||||
;= ;div.container
|
||||
;div.row
|
||||
;div.col-md-4
|
||||
;h1.sign: Bye!
|
||||
==
|
||||
;div.col-md-8#c
|
||||
;p.ship
|
||||
;label.sig: ~
|
||||
;span#ship;
|
||||
==
|
||||
;button#act(onclick "urb.away()"): Go
|
||||
;pre:code#err;
|
||||
;script@"/~/at/~/auth.js";
|
||||
==
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
++ poke-test
|
||||
%+ titl 'Poke'
|
||||
@ -530,7 +559,8 @@
|
||||
;title:"{(trip a)}"
|
||||
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/".
|
||||
"libs/jquery/2.1.1/jquery.min.js");
|
||||
;link(rel "stylesheet", href "/home/lib/base.css");
|
||||
;link(rel "stylesheet", href "/lib/css/fonts.css");
|
||||
;link(rel "stylesheet", href "/lib/css/bootstrap.css");
|
||||
==
|
||||
;body:div#c:"*{b}"
|
||||
==
|
||||
@ -561,13 +591,19 @@
|
||||
|= kyz=kiss
|
||||
^+ +>
|
||||
=. our ?~(hov our u.hov) :: XX
|
||||
=. p.top our :: XX necessary?
|
||||
?- -.kyz
|
||||
%born +>.$(ged hen) :: register external
|
||||
%serv
|
||||
=< ~&([%serving (tope top)] .)
|
||||
?^(p.kyz +>.$(top p.kyz) +>.$(q.top p.kyz))
|
||||
::
|
||||
%crud
|
||||
+>.$(mow [[hen %slip %d %flog kyz] mow])
|
||||
::
|
||||
%init :: register ownership
|
||||
+>.$(hov ?~(hov [~ p.kyz] [~ (min u.hov p.kyz)]))
|
||||
=. our ?~(hov p.kyz (min u.hov p.kyz))
|
||||
+>.$(hov [~ our], top [[our %home ud/0] /web])
|
||||
::
|
||||
%this :: inbound request
|
||||
%- emule |. ^+ ..apex
|
||||
@ -757,12 +793,14 @@
|
||||
$|(~ [?(%on %ay %ow) *]) ~|(e/ford/lost/tee !!)
|
||||
[%of @ ~] ~|(e/ford/lost/tee !!)
|
||||
[%si ~] (give-sigh q.sih)
|
||||
::
|
||||
[%hi ^]
|
||||
?: ?=(%| -.q.sih)
|
||||
(give-sigh q.sih) :: XX crash?
|
||||
=* cay p.q.sih
|
||||
?> ?=(%hiss p.cay)
|
||||
(pass-note tee [%e %meta :(slop !>(%them) !>(~) q.cay)])
|
||||
::
|
||||
[%he *] :: XX hack
|
||||
=. ..axon $(tee p.tee)
|
||||
%_ ..axon
|
||||
@ -796,6 +834,9 @@
|
||||
?. ?=(%& -.q.sih)
|
||||
(fail 404 p.sih p.q.sih)
|
||||
=* cay p.q.sih
|
||||
?: ?=(%red-quri p.cay)
|
||||
=+ url=((hard quri) q.q.cay)
|
||||
(give-thou 307 [location/(crip (apex:earn url))]~ ~)
|
||||
?. ?=(%mime p.cay)
|
||||
=+ bek=-:(need (tome p.tee))
|
||||
=+ bik=?+(r.bek bek [%ud %0] bek(r da/now))
|
||||
@ -816,7 +857,6 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ root-beak `beak`[our %home da/now] :: XX
|
||||
++ emule
|
||||
|= a=_|?(..emule) ^+ ..emule
|
||||
=+ mul=(mule a)
|
||||
@ -842,7 +882,7 @@
|
||||
::
|
||||
++ back :: %ford bounce
|
||||
|= [tea=whir mar=mark cay=cage]
|
||||
(pass-note tea (ford-req root-beak [%cast mar `cay]))
|
||||
(pass-note tea (ford-req -.top [%cast mar `cay]))
|
||||
::
|
||||
++ del-deps
|
||||
|= [a=@uvH b=(each duct ixor)] ^+ +>.$
|
||||
@ -940,14 +980,10 @@
|
||||
++ nice-json (teba ^nice-json)
|
||||
++ pass-note (teba ^pass-note)
|
||||
::
|
||||
++ ford-boil
|
||||
|= [wir=whir ext=term bem=beam quy=quay]
|
||||
=+ yac=for-client
|
||||
=. him.yac ?.(aut anon him.yac)
|
||||
=: r.bem ?+(r.bem r.bem [%ud %0] da/now)
|
||||
s.bem [%web ~(rent co (fcgi quy fcgi-cred.yac)) s.bem]
|
||||
==
|
||||
(execute wir -.bem [%boil ext bem ~])
|
||||
++ fcgi-cred
|
||||
^- cred
|
||||
?: aut fcgi-cred:for-client
|
||||
%*(fcgi-cred for-client him anon)
|
||||
::
|
||||
::
|
||||
++ apex
|
||||
@ -968,8 +1004,11 @@
|
||||
%json (give-json 200 cug p.pez)
|
||||
%html (give-html 200 cug p.pez)
|
||||
%htme (give-html 401 cug p.pez)
|
||||
%boil
|
||||
(ford-boil [p.pez q.pez r.pez payload.pez])
|
||||
%bake
|
||||
=+ req=[%bake mar=q.pez [r s]:pez]
|
||||
=+ red=req(mar %red-quri)
|
||||
(execute p.pez -.s.pez `silk`[%alts ~[red req]])
|
||||
::
|
||||
%red
|
||||
=+ url=(earn hat pok(p [~ %html]) quy)
|
||||
?+ p.pok ~|(bad-redirect/[p.pok url] !!)
|
||||
@ -1008,6 +1047,8 @@
|
||||
^- (each perk httr)
|
||||
|^ =+ hit=as-magic-filename
|
||||
?^ hit [%| u.hit]
|
||||
?: is-spur
|
||||
[%& %spur (flop q.pok)]
|
||||
=+ bem=as-beam
|
||||
?^ bem [%& %beam u.bem]
|
||||
?. check-oryx
|
||||
@ -1033,14 +1074,16 @@
|
||||
==
|
||||
==
|
||||
::
|
||||
++ as-beam
|
||||
++ is-spur |(?~(q.pok & ((sane %tas) i.q.pok)))
|
||||
++ as-beam
|
||||
^- (unit beam)
|
||||
|-
|
||||
?~ q.pok
|
||||
$(q.pok /index)
|
||||
?. ((sane %tas) i.q.pok)
|
||||
(tome q.pok)
|
||||
`[[our i.q.pok ud/0] (flop t.q.pok)]
|
||||
?~ q.pok ~
|
||||
=+ ^- (unit ,[@ dez=desk rel=?]) :: /=desk/, /=desk=/
|
||||
(rush i.q.pok ;~(plug tis sym ;~(pose (cold | tis) (easy &))))
|
||||
?~ - (tome q.pok) :: /~ship/desk/case/...
|
||||
:+ ~ [our dez.u r.top]
|
||||
?. rel.u (flop t.q.pok)
|
||||
(weld (flop t.q.pok) s.top) :: /=desk/... as hoon /=desk%/...
|
||||
::
|
||||
++ as-aux-request :: /~/... req parser
|
||||
^- (unit perk)
|
||||
@ -1145,8 +1188,9 @@
|
||||
:: request. In the future it's possible the payload could be
|
||||
:: a specific mark instead.
|
||||
++ process-payload
|
||||
?+ mef quy
|
||||
%post `quay`(weld quy `quay`(rash q:(need bod) yquy:urlp))
|
||||
^- [quay meth]
|
||||
?+ mef [quy mef]
|
||||
%post [`quay`(weld quy `quay`(rash q:(need bod) yquy:urlp)) %get]
|
||||
==
|
||||
++ process
|
||||
^- (each pest ,_done)
|
||||
@ -1161,17 +1205,17 @@
|
||||
%auth (process-auth p.hem)
|
||||
%away [%& %html logout-page:xml]
|
||||
?(%beam %spur)
|
||||
=+ nquy=process-payload
|
||||
=^ payload mef process-payload
|
||||
=+ ext=(fall p.pok %urb)
|
||||
=+ bem=?-(-.hem %beam p.hem, %spur [root-beak p.hem])
|
||||
=+ wir=`whir`[%ha (tope -.bem ~)]
|
||||
=. wir ?+(mef !! %post wir, %get wir, %head [%he wir])
|
||||
=+ bem=?-(-.hem %beam p.hem, %spur [-.top (weld p.hem s.top)])
|
||||
~| bad-beam/q.bem
|
||||
?< =([~ 0] (sky %cw (tope bem(+ ~, r [%da now]))))
|
||||
?. aut
|
||||
[%& %boil [wir ext bem nquy]]
|
||||
[%| (ford-boil [wir ext bem nquy])] :: XX properly
|
||||
::
|
||||
=+ wir=`whir`[%ha (tope -.bem ~)]
|
||||
=. wir ?+(mef !! %get wir, %head [%he wir])
|
||||
=. r.bem ?+(r.bem r.bem [%ud %0] da/now)
|
||||
=+ arg=(fcgi payload fcgi-cred)
|
||||
=+ [%& %bake wir ext arg bem]
|
||||
?.(aut - [%| (resolve -)]) :: XX properly
|
||||
::
|
||||
%bugs
|
||||
?- p.hem
|
||||
@ -1196,7 +1240,7 @@
|
||||
::
|
||||
%poll
|
||||
?: ?=([~ %js] p.pok) :: XX treat non-json cases?
|
||||
=+ polling-url=['/' (apex:earn %| pok(u.p %json) quy)]
|
||||
=+ polling-url=(apex:earn %| pok(u.p %json) quy)
|
||||
[%& %js (add-json (joba %wurl (jape polling-url)) poll:js)]
|
||||
=. lyv (~(put by lyv) hen %wasp p.hem)
|
||||
|-
|
||||
@ -1231,7 +1275,7 @@
|
||||
?~ p.pez pez
|
||||
?+ -.p.pez ~&(bad-inject/p.pez !!)
|
||||
%red pez
|
||||
%boil
|
||||
%bake
|
||||
=. ya abet.yac
|
||||
[%| (resolve ~ p.pez(p [%at ses.yac p.p.pez]))]
|
||||
::
|
||||
@ -1607,19 +1651,21 @@
|
||||
~
|
||||
::
|
||||
++ load :: take previous state
|
||||
=+ bolo-3=,_[%3 +(|2 |3.+)]:*bolo :: no top
|
||||
=+ even-2=?(even [%mean p=[dock path] *]) :: old %quit
|
||||
=+ ^= stem-2 :: no die, sus
|
||||
,_=+(*stem -(|3 |5.-, q.eve *(map ,@u even-2)))
|
||||
=+ bolo-2=,_[%2 %*(+ *bolo wix *(map ixor stem-2))]
|
||||
=+ bolo-2=,_[%2 %*(+ *bolo-3 wix *(map ixor stem-2))]
|
||||
=+ bolo-1=,_[%1 +(|4 |5.+)]:*bolo-2 :: no lyv
|
||||
|= old=?(bolo bolo-1 bolo-2)
|
||||
|= old=?(bolo bolo-1 bolo-2 bolo-3)
|
||||
^+ ..^$
|
||||
?- -.old
|
||||
%3 ..^$(+>- old)
|
||||
%4 ..^$(+>- old)
|
||||
%3 $(-.old %4, |2.+.old [[[(need hov.old) %home ud/0] /web] |2.+.old])
|
||||
%2 =+ evn=|=(a=even-2 ?+(-.a a %mean [%quit p.a]))
|
||||
=+ stm=|=(a=stem-2 a(|3 [now ~ |3.a(q.eve (~(run by q.eve.a) evn))]))
|
||||
$(old [%3 +.old(wix (~(run by wix.old) stm))])
|
||||
%1 $(old [%2 +(|4 [~ |4.+])]:old)
|
||||
$(-.old %3, wix.old (~(run by wix.old) stm))
|
||||
%1 $(-.old %2, |4.+.old [~ |4.+.old])
|
||||
==
|
||||
::
|
||||
++ scry
|
||||
@ -1646,3 +1692,4 @@
|
||||
q.hin
|
||||
[mos ..^$]
|
||||
--
|
||||
|
||||
|
531
arvo/ford.hoon
531
arvo/ford.hoon
@ -22,7 +22,7 @@
|
||||
-- ::
|
||||
|% :: structures
|
||||
++ axle :: all %ford state
|
||||
$: %1 :: version for update
|
||||
$: %2 :: version for update
|
||||
pol=(map ship baby) ::
|
||||
== ::
|
||||
++ baby :: state by ship
|
||||
@ -56,8 +56,7 @@
|
||||
== ::
|
||||
++ calx :: concrete cache line
|
||||
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile
|
||||
[%bake p=calm q=(trel mark beam heel) r=(unit vase)]:: load
|
||||
[%lilt p=calm q=beak r=(jug mark mark)] :: translation graph
|
||||
[%bake p=calm q=(trel mark coin beam) r=(unit vase)] :: load
|
||||
[%slit p=calm q=[p=type q=type] r=type] :: slam type
|
||||
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
|
||||
[%slap p=calm q=[p=vase q=twig] r=vase] :: compute
|
||||
@ -83,7 +82,6 @@
|
||||
?+ sem !!
|
||||
%hood ?>(?=(%hood -.cax) r.cax)
|
||||
%bake ?>(?=(%bake -.cax) r.cax)
|
||||
%lilt ?>(?=(%lilt -.cax) r.cax)
|
||||
%slap ?>(?=(%slap -.cax) r.cax)
|
||||
%slam ?>(?=(%slam -.cax) r.cax)
|
||||
%slim ?>(?=(%slim -.cax) r.cax)
|
||||
@ -106,7 +104,7 @@
|
||||
++ chub :: cache merge
|
||||
|= [a=cafe b=cafe] ::
|
||||
^- cafe ::
|
||||
[(grom p.a p.b) (grum q.a q.b)] ::
|
||||
[(~(uni in p.a) p.b) (~(uni by q.a) q.b)] ::
|
||||
:: ::
|
||||
++ faun (flux |=(a=vase [%& %noun a])) :: vase to gage
|
||||
++ feel (flux |=(a=cage q.a)) :: cage to vase
|
||||
@ -136,15 +134,6 @@
|
||||
++ flue |=(a=cafe (fine a ~)) :: cafe to empty
|
||||
++ flux |* a=_,* :: bolt lift (fmap)
|
||||
|*([b=cafe c=_+<.a] (fine b (a c))) ::
|
||||
++ grom :: merge sets
|
||||
|* [one=(set) two=(set)]
|
||||
^+ one
|
||||
(~(gas in one) (~(tap in two) ~)) :: XX ugh
|
||||
::
|
||||
++ grum :: merge maps
|
||||
|* [one=(map) two=(map)]
|
||||
^+ one
|
||||
(~(gas by one) (~(tap by two) ~)) :: XX ugh
|
||||
::
|
||||
++ lark :: filter arch names
|
||||
|= [wox=$+(span (unit ,@)) arc=arch]
|
||||
@ -288,21 +277,7 @@
|
||||
== ==
|
||||
::
|
||||
++ zo
|
||||
~% %ford-z
|
||||
..is
|
||||
==
|
||||
%fade fade
|
||||
%fair fair
|
||||
%fang fang
|
||||
%lime lime
|
||||
%lima lima
|
||||
%link link
|
||||
%lion lion
|
||||
%lily lily
|
||||
%lope lope
|
||||
%make make
|
||||
%meow meow
|
||||
==
|
||||
~% %ford-z ..is ~
|
||||
|_ [num=@ud task]
|
||||
++ abet %_(..zo q.tad.bay (~(put by q.tad.bay) num +<+))
|
||||
++ amok
|
||||
@ -373,7 +348,7 @@
|
||||
:- p=p.nuf
|
||||
^= q
|
||||
?- -.q.nuf
|
||||
%0 [%0 p=(grom p.q.hoc p.q.nuf) q=[q.q.hoc q.q.nuf]]
|
||||
%0 [%0 p=(~(uni in p.q.hoc) p.q.nuf) q=[q.q.hoc q.q.nuf]]
|
||||
%1 q.nuf
|
||||
%2 q.nuf
|
||||
==
|
||||
@ -382,7 +357,7 @@
|
||||
^= q
|
||||
?- -.q.nuf
|
||||
%0 q.hoc
|
||||
%1 [%1 p=(grom p.q.nuf p.q.hoc)]
|
||||
%1 [%1 p=(~(uni in p.q.nuf) p.q.hoc)]
|
||||
%2 q.nuf
|
||||
==
|
||||
%2 hoc
|
||||
@ -403,23 +378,23 @@
|
||||
^= q
|
||||
?- -.q.nuf
|
||||
%1 q.nuf
|
||||
%2 [%2 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
|
||||
%0 [%0 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
|
||||
%2 [%2 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
|
||||
%0 [%0 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
|
||||
== ==
|
||||
::
|
||||
++ coop :: bolt alter
|
||||
|* [hoc=(bolt) fun=(burg)]
|
||||
|* [hoc=(bolt) fun=$+(cafe (bolt))]
|
||||
?- -.q.hoc
|
||||
%1 hoc
|
||||
%0 hoc
|
||||
%2 =+ nuf=(fun(+<- p.hoc))
|
||||
%2 =+ nuf=(fun p.hoc)
|
||||
:- p=p.nuf
|
||||
^= q
|
||||
?- -.q.nuf
|
||||
%1 q.nuf
|
||||
%0 [%0 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
|
||||
%0 [%0 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
|
||||
%2 =. q.q.nuf (welp q.q.nuf q.q.hoc)
|
||||
[%2 p=(grom `_p.q.nuf`p.q.hoc p.q.nuf) q=q.q.nuf]
|
||||
[%2 p=(~(uni in `_p.q.nuf`p.q.hoc) p.q.nuf) q=q.q.nuf]
|
||||
== ==
|
||||
::
|
||||
++ coup :: toon to bolt
|
||||
@ -510,19 +485,6 @@
|
||||
++ dash :: process cache
|
||||
|= cof=cafe
|
||||
^+ +>
|
||||
~? |
|
||||
:+ %dash (lent (skim (~(tap in p.cof)) |=(a=calx ?=(%bake -.a))))
|
||||
=. q.cof (~(dif by q.cof) jav.bay)
|
||||
=+ num=10
|
||||
%. |= a=(list calx)
|
||||
=+ len=(lent a)
|
||||
=- [len (scag num (turn a f)) ?:((gth len num) %etc ~)]
|
||||
=+ dewe=|=(beam +<(s ?+(s s [@ %web *] t.t.s)))
|
||||
f=|=(b=calx [-.b ?+(-.b ~ %bake [p.q.b (tope (dewe q.q.b))])])
|
||||
%~ run by
|
||||
=< `(jar term calx)`(~(rep by q.cof) .)
|
||||
|= [[* a=calx] b=(jar term calx)]
|
||||
(~(add ja b) -.a a)
|
||||
%_(+> jav.bay q.cof)
|
||||
::
|
||||
++ diff :: diff
|
||||
@ -609,7 +571,7 @@
|
||||
|= [cof=cafe for=mark bem=beam]
|
||||
^- (bolt hood)
|
||||
%+ cool |.(leaf/"ford: fade {<[(tope bem)]>}")
|
||||
%+ cope (cope (make cof [%bake for bem ~]) furl)
|
||||
%+ cope (liar cof %*(. bem s [for s.bem]))
|
||||
|= [cof=cafe cay=cage]
|
||||
%+ (clef %hood) (fine cof bem(r [%ud 0]) cay)
|
||||
^- (burg (pair beam cage) hood)
|
||||
@ -633,7 +595,7 @@
|
||||
?~ opt (flue cof)
|
||||
|- ^- (bolt (unit beam))
|
||||
=. i.s.bem (tack opt)
|
||||
%+ cope (lima cof %hoon bem ~)
|
||||
%+ cope (lima cof %hoon many/~ bem)
|
||||
|= [cof=cafe vax=(unit vase)] ^- (bolt (unit beam))
|
||||
?^ vax (fine cof `bem)
|
||||
?~ t.opt (flue cof)
|
||||
@ -708,21 +670,21 @@
|
||||
%+ knee *^horn |. ~+
|
||||
;~ pfix fas
|
||||
;~ pose
|
||||
(stag %toy ;~(sfix sym fas))
|
||||
(stag %ape ;~(pfix sig ape:read))
|
||||
(stag %arg ;~(pfix buc ape:read))
|
||||
(stag %day ;~(pfix bar day:read))
|
||||
(stag %alt ;~(pfix bar alt:read))
|
||||
(stag %dub ;~(pfix tis dub:read))
|
||||
(stag %fan ;~(pfix dot fan:read))
|
||||
(stag %for ;~(pfix com for:read))
|
||||
(stag %hel ;~(pfix cen hel:read))
|
||||
(stag %hub ;~(pfix pat day:read))
|
||||
(stag %hel ;~(pfix cen day:read))
|
||||
(stag %lin ;~(pfix pam lin:read))
|
||||
(stag %man ;~(pfix tar man:read))
|
||||
(stag %nap ;~(pfix cab day:read))
|
||||
(stag %now ;~(pfix pam day:read))
|
||||
(stag %now ;~(pfix pat day:read))
|
||||
(stag %saw ;~(pfix sem saw:read))
|
||||
(stag %see ;~(pfix col see:read))
|
||||
(stag %sic ;~(pfix ket sic:read))
|
||||
(stag %toy ;~(sfix toy:read fas))
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -736,6 +698,10 @@
|
||||
%+ rail
|
||||
(ifix [sel ser] (stag %cltr (most ace wide:vez)))
|
||||
;~(pfix gap tall:vez)
|
||||
::
|
||||
++ alt
|
||||
%+ rail (ifix [pel per] (most ace day))
|
||||
;~(sfix (star day) gap duz)
|
||||
::
|
||||
++ day
|
||||
%+ rail
|
||||
@ -744,48 +710,47 @@
|
||||
::
|
||||
++ dub
|
||||
%+ rail
|
||||
;~(plug sym ;~(pfix tis apex(tol |)))
|
||||
;~(pfix gap ;~(plug sym ;~(pfix gap apex)))
|
||||
;~(plug sym ;~(pfix tis day))
|
||||
;~(pfix gap ;~(plug sym day))
|
||||
::
|
||||
++ fan
|
||||
%+ rail fail
|
||||
;~(sfix (star ;~(pfix gap apex)) ;~(plug gap duz))
|
||||
;~(sfix (star day) gap duz)
|
||||
::
|
||||
++ for
|
||||
%+ rail
|
||||
;~(plug (ifix [sel ser] hath) apex(tol |))
|
||||
;~(pfix gap ;~(plug hath ;~(pfix gap apex)))
|
||||
%+ rail fail
|
||||
=- ;~(sfix (star -) gap duz)
|
||||
;~(pfix gap fas ;~(plug hath day))
|
||||
::
|
||||
++ hel
|
||||
++ lin
|
||||
%+ rail
|
||||
;~(plug ;~(pose ;~(sfix dem:ag cen) (easy 0)) apex(tol |))
|
||||
;~(pfix gap ;~(plug ;~(pose ;~(sfix dem:ag gap) (easy 0)) apex))
|
||||
;~(plug (plus ;~(sfix sym pam)) day)
|
||||
=+ (cook |=(a=term [a ~]) sym)
|
||||
;~(pfix gap ;~(plug - day))
|
||||
::
|
||||
++ man
|
||||
%+ rail fail
|
||||
%- sear
|
||||
:_ ;~(sfix (star ;~(pfix gap apex)) ;~(plug gap duz))
|
||||
|= fan=(list ^horn)
|
||||
=| naf=(list (pair term ^horn))
|
||||
|- ^- (unit (map term ^horn))
|
||||
?~ fan (some (~(gas by *(map term ^horn)) naf))
|
||||
?. ?=(%dub -.i.fan) ~
|
||||
$(fan t.fan, naf [[p.i.fan q.i.fan] naf])
|
||||
%+ cook ~(gas by *(map term ^horn))
|
||||
=< ;~(sfix (star (sear . day)) gap duz)
|
||||
|= a=^horn ^- (unit ,[term ^horn])
|
||||
?+(-.a ~ %dub `[p.a q.a])
|
||||
::
|
||||
++ saw
|
||||
%+ rail
|
||||
;~(plug ;~(sfix wide:vez sem) apex(tol |))
|
||||
;~(pfix gap ;~(plug tall:vez ;~(pfix gap apex)))
|
||||
;~(plug ;~(sfix wide:vez sem) day)
|
||||
;~(pfix gap ;~(plug tall:vez day))
|
||||
::
|
||||
++ see
|
||||
%+ rail
|
||||
;~(plug ;~(sfix have col) apex(tol |))
|
||||
;~(pfix gap ;~(plug have ;~(pfix gap apex)))
|
||||
;~(plug ;~(sfix have col) day)
|
||||
;~(pfix gap ;~(plug have day))
|
||||
::
|
||||
++ sic
|
||||
%+ rail
|
||||
;~(plug ;~(sfix toil:vez ket) apex(tol |))
|
||||
;~(pfix gap ;~(plug howl:vez ;~(pfix gap apex)))
|
||||
;~(plug ;~(sfix toil:vez ket) day)
|
||||
;~(pfix gap ;~(plug howl:vez day))
|
||||
::
|
||||
++ toy ;~(plug ;~(pose (cold | zap) (easy &)) sym)
|
||||
--
|
||||
::
|
||||
--
|
||||
@ -917,103 +882,44 @@
|
||||
$(yom t.yom, axe (peg axe 3))
|
||||
::
|
||||
++ lads :: possible children
|
||||
|= [cof=cafe bem=beam arg=heel]
|
||||
|= [cof=cafe bem=beam]
|
||||
^- (bolt (map span ,~))
|
||||
=| [res=(map span ,~) new=(qeu beam)]
|
||||
=+ all=`(set beam)`[bem `~]
|
||||
|^ %+ with (cope ?^(arg (flue cof) kids) return)
|
||||
|=(_. (with (cope marks look) next))
|
||||
::
|
||||
++ done .
|
||||
++ with
|
||||
|* [a=(bolt ,_done) b=$+(_done (bolt))] ^+ *b
|
||||
(cope a |=([cof=cafe c=_done] (b c(cof cof))))
|
||||
::
|
||||
++ return
|
||||
%- flux
|
||||
|=(a=(map span ,~) done(res (~(uni by res) a)))
|
||||
::
|
||||
++ next
|
||||
|= _. => +<
|
||||
^- (bolt (map span ,~))
|
||||
?^ s.bem
|
||||
$(s.bem t.s.bem, arg [i.s.bem arg])
|
||||
?: =(~ new) (fine cof res)
|
||||
=^ bem new ~(get to new)
|
||||
~| next-beam/(tope bem)
|
||||
?< (gth (lent +.bem) 10)
|
||||
$(bem bem, arg ~)
|
||||
::
|
||||
++ kids
|
||||
%^ lash cof bem
|
||||
|= [cof=cafe dir=span]
|
||||
%+ cope (lend cof bem(s [dir s.bem]))
|
||||
(flux |=(a=arch ?~(dir.a ~ (some ~))))
|
||||
::
|
||||
++ marks
|
||||
=< (cope (laze cof bem) (flux .))
|
||||
|= a=(map mark ,?) ^- (list mark)
|
||||
(turn :_(head (skip :_(tail (~(tap by a)))))) :: | = %hook
|
||||
::
|
||||
++ look
|
||||
|= [cof=cafe hok=(list mark)] ^- (bolt ,_done)
|
||||
?~ hok (fine cof done)
|
||||
%+ with $(hok t.hok)
|
||||
|= _done ^- (bolt ,_done)
|
||||
=+ bim=bem(s [i.hok s.bem])
|
||||
=+ hid=(fade cof %hook bim)
|
||||
?: ?=(%2 -.q.hid)
|
||||
(fine cof done)
|
||||
=< (cope hid (flux .))
|
||||
|= hyd=hood
|
||||
=^ neu all
|
||||
(chop:(meow bim (flop arg)) all %fan fan.hyd)
|
||||
done(new (~(gas to new) (~(tap in `(set beam)`neu))))
|
||||
--
|
||||
%^ lash cof bem
|
||||
|= [cof=cafe dir=span]
|
||||
%+ cope (lend cof bem(s [dir s.bem]))
|
||||
(flux |=(a=arch ?~(dir.a ~ (some ~))))
|
||||
::
|
||||
++ laze :: find real or virtual
|
||||
|= [cof=cafe bem=beam]
|
||||
%^ lash cof bem
|
||||
|= [cof=cafe for=mark]
|
||||
^- (bolt (unit ,?))
|
||||
^- (bolt (unit ,~))
|
||||
?. ((sane %tas) for) (flue cof)
|
||||
=. s.bem [for s.bem]
|
||||
%+ cope (lend cof bem)
|
||||
|= [cof=cafe arc=arch]
|
||||
?^ fil.arc (fine cof (some &))
|
||||
?. (~(has by dir.arc) %hook)
|
||||
(flue cof)
|
||||
%+ cope (lend cof bem(s [%hook s.bem]))
|
||||
|= [cof=cafe arc=arch]
|
||||
?~ fil.arc
|
||||
(flue cof)
|
||||
(fine cof (some |))
|
||||
(fine cof (bind fil.arc ,~))
|
||||
::
|
||||
++ lace :: load real or virtual
|
||||
|= [cof=cafe for=mark bem=beam arg=heel lit=?]
|
||||
|= [cof=cafe for=mark arg=coin bem=beam]
|
||||
^- (bolt vase)
|
||||
%+ cool |.(leaf/"ford: load {<for>} {<(tope bem)>}")
|
||||
=. s.bem [for s.bem]
|
||||
?: lit
|
||||
%+ cool |.(leaf/"ford: load {<for>} {<(tope bem)>}")
|
||||
%+ cope (liar cof bem)
|
||||
|= [cof=cafe cay=cage]
|
||||
?. =(for p.cay)
|
||||
(flaw cof leaf/"unexpected mark {<p.cay>}" ~)
|
||||
((lake for) cof q.cay)
|
||||
%+ cool |.(leaf/"ford: hook {<for>} {<(tope bem)>}")
|
||||
%+ cope (fade cof %hook bem)
|
||||
|= [cof=cafe hyd=hood]
|
||||
(cope (abut:(meow bem arg) cof hyd) (lake for))
|
||||
%+ cope (liar cof bem)
|
||||
|= [cof=cafe cay=cage]
|
||||
?. =(for p.cay)
|
||||
(flaw cof leaf/"unexpected mark {<p.cay>}" ~)
|
||||
((lake for) cof q.cay)
|
||||
::
|
||||
++ lake :: check/coerce
|
||||
|= for=mark
|
||||
|= [cof=cafe sam=vase]
|
||||
^- (bolt vase)
|
||||
%+ cool |.(leaf/"ford: check {<[for bek `@p`(mug q.sam)]>}")
|
||||
?: ?=(?(%hoon %hook) for)
|
||||
?: ?=(%hoon for)
|
||||
=+ mas=((soft ,@t) q.sam)
|
||||
?~ mas
|
||||
(flaw cof [leaf/"ford: bad hoon or hook: {<[for bek]>}"]~)
|
||||
(flaw cof [leaf/"ford: bad hoon: {<[for bek]>}"]~)
|
||||
(fine cof [%atom %t] u.mas)
|
||||
%+ cope (fang cof for)
|
||||
|= [cof=cafe tux=vase]
|
||||
@ -1065,7 +971,7 @@
|
||||
|= [cof=cafe bem=beam] ^- (bolt vase)
|
||||
%+ cope (fame cof bem)
|
||||
|= [cof=cafe bem=beam]
|
||||
(cope (fade cof %hoon bem) abut:(meow bem ~))
|
||||
(cope (fade cof %hoon bem) abut:(meow bem many/~))
|
||||
::
|
||||
++ lend :: load arch
|
||||
|= [cof=cafe bem=beam]
|
||||
@ -1088,107 +994,53 @@
|
||||
(flaw cof leaf/"file not found" (smyt (tope bem)) ~)
|
||||
(fine cof u.u.von)
|
||||
::
|
||||
++ lily :: translation targets
|
||||
++ lily
|
||||
|= [cof=cafe for=mark] ^- (bolt (set ,@tas))
|
||||
%+ cope (lilt cof)
|
||||
|= [cof=cafe lil=(jug mark mark)]
|
||||
(fine cof (~(get ju lil) for))
|
||||
::
|
||||
++ lilt
|
||||
|= cof=cafe ^- (bolt (jug mark mark))
|
||||
%+ (clef %lilt) (fine cof bek)
|
||||
^- (burg beak (jug mark mark))
|
||||
|= [cof=cafe bek=beak]
|
||||
%+ cope (lyle(bek bek) cof)
|
||||
%+ cope (coop (fang cof for) |=(cof=cafe (fine cof %void ~)))
|
||||
%- flux
|
||||
|= mav=(map mark vase)
|
||||
=+ all=(~(tap by mav))
|
||||
|- ^- (jug mark mark)
|
||||
?~ all ~
|
||||
%- ~(gas ju $(all t.all))
|
||||
=+ `[for=mark vax=vase]`i.all
|
||||
~| weg=(jam 3 p.vax)
|
||||
%+ weld
|
||||
^- (list ,[mark mark])
|
||||
?. (slob %grab p.vax) ~
|
||||
=+ gab=(slap vax [%cnzy %grab])
|
||||
:: =+ opt=(skip (sloe p.gap) |=(fro=mark =(fro %noun)))
|
||||
(turn (sloe p.gab) |=(fro=mark [fro for]))
|
||||
?. (slob %grow p.vax) ~
|
||||
=+ gow=(slap vax [%cnzy %grow])
|
||||
(turn (sloe p.gow) |=(too=mark [for too]))
|
||||
::
|
||||
++ lyle :: all mark doors
|
||||
|= cof=cafe ^- (bolt (map mark vase))
|
||||
=| [sup=path res=(map mark vase)]
|
||||
|^ `(bolt (map mark vase))`wide
|
||||
++ here [bek (welp sup /mar)]
|
||||
++ wide
|
||||
%+ cope (lend cof here)
|
||||
|= [cof=cafe arc=arch]
|
||||
=+ all=(skim (turn (~(tap by dir.arc)) head) (sane %tas))
|
||||
=. all (sort all gth) :: short-deepest
|
||||
|- ^- (bolt (map mark vase))
|
||||
?~ all (fine cof res)
|
||||
%+ cope $(all t.all)
|
||||
|= [cof=cafe res=(map mark vase)]
|
||||
=. ^res res
|
||||
=- (cope - (tall i.all))
|
||||
?. (~(has by dir.arc) %hoon) (flue cof)
|
||||
node(cof cof)
|
||||
::
|
||||
++ tall
|
||||
|= for=term
|
||||
|= [cof=cafe new=(unit ,[mark vase])]
|
||||
wide(cof cof, sup [for sup], res (~(gas by res) (drop new)))
|
||||
::
|
||||
++ node
|
||||
^- (bolt (unit ,[mark vase]))
|
||||
=+ pax=(flop sup)
|
||||
?~ pax (flue cof)
|
||||
=+ for=(tack pax)
|
||||
?: (~(has by res) for) (flue cof)
|
||||
=+ raf=(lear cof here)
|
||||
?. ?=(%2 -.q.raf)
|
||||
(cope raf (flux |=(vax=vase (some [for vax]))))
|
||||
=- ((slog (flop `tang`-)) (flue cof))
|
||||
=+ (lent t.pax)
|
||||
?: ?~ - | :: error if level above built
|
||||
(~(has by res) (tack i.pax (scag (dec -) t.pax)))
|
||||
~
|
||||
:_(q.q.raf leaf/"! {<`mark`for>} build failed, ignoring.")
|
||||
--
|
||||
|= vax=vase ^- (set mark)
|
||||
%- =- ~(gas in `(set mark)`-)
|
||||
?. (slob %grow p.vax) ~
|
||||
(sa (sloe p:(slap vax [%cnzy %grow])))
|
||||
?. (slob %garb p.vax) ~
|
||||
=+ (slap vax [%cnzy %garb])
|
||||
(fall ((soft (list mark)) q) ~)
|
||||
::
|
||||
++ lima :: load at depth
|
||||
|= [cof=cafe for=mark bem=beam arg=heel]
|
||||
%+ (clef %bake) [p=cof q=[%0 p=[bem `~] q=[for bem arg]]]
|
||||
|= [cof=cafe for=mark bem=beam arg=heel]
|
||||
|= [cof=cafe for=mark arg=coin bem=beam]
|
||||
%+ (clef %bake) [p=cof q=[%0 p=[bem `~] q=[for arg bem]]]
|
||||
|= [cof=cafe for=mark arg=coin bem=beam]
|
||||
^- (bolt (unit vase))
|
||||
%+ cope (laze cof bem)
|
||||
|= [cof=cafe mal=(map mark ,?)]
|
||||
=+ lit=(~(get by mal) for)
|
||||
?^ lit
|
||||
(cope (lace cof for bem arg u.lit) (flux some))
|
||||
|= [cof=cafe mal=(map mark ,~)]
|
||||
?: (~(has by mal) for)
|
||||
(cope (lace cof for arg bem) (flux some))
|
||||
=+ opt=(sa (turn (~(tap by mal)) head)) :: XX asymptotics
|
||||
%+ cope (lion cof for opt)
|
||||
|= [cof=cafe wuy=(list ,@tas)]
|
||||
?~ wuy (flue cof)
|
||||
%+ cope
|
||||
(lace cof i.wuy bem arg (~(got by mal) i.wuy))
|
||||
(lace cof i.wuy arg bem)
|
||||
|= [cof=cafe hoc=vase]
|
||||
(cope (lope cof i.wuy t.wuy hoc) (flux some))
|
||||
::
|
||||
++ lime :: load beam
|
||||
|= [cof=cafe for=mark bem=beam arg=heel]
|
||||
=+ [mob=bem mer=(flop arg)]
|
||||
|- ^- (bolt vase)
|
||||
%+ cope (lima cof for mob (flop mer))
|
||||
|= [cof=cafe for=mark arg=coin bem=beam]
|
||||
^- (bolt vase)
|
||||
%+ cope (lima cof for arg bem)
|
||||
|= [cof=cafe vux=(unit vase)]
|
||||
?^ vux (fine cof u.vux)
|
||||
?~ s.mob
|
||||
%+ flaw cof
|
||||
~[leaf/"build {<for>}" leaf/"no usable ancestors" (smyt (tope bem))]
|
||||
^$(s.mob t.s.mob, mer [i.s.mob mer])
|
||||
(limp cof for arg bem)
|
||||
::
|
||||
++ limp :: render
|
||||
|= [cof=cafe for=mark arg=coin bem=beam]
|
||||
%+ cope (fame cof -.bem /[for]/ren)
|
||||
|= [cof=cafe bom=beam]
|
||||
(cope (fade cof %hoon bom) abut:(meow bem arg))
|
||||
|
||||
:: |= [cof=cafe vax=vase]
|
||||
:: %+ flaw cof
|
||||
:: ~[leaf/"build {<for>}" leaf/"no usable ancestors" (smyt (tope bem))]
|
||||
::
|
||||
++ link :: translate
|
||||
|= [cof=cafe too=mark for=mark vax=vase]
|
||||
@ -1219,12 +1071,22 @@
|
||||
|= [cof=cafe too=mark fro=(set mark)]
|
||||
:: ~& lion/[too=too fro=(sa fro)]
|
||||
^- (bolt (list mark))
|
||||
=- %+ coop (gro cof too `~) :: XX better grab layer
|
||||
|= cof=cafe
|
||||
%+ cope (fang cof too)
|
||||
|= [cof=cafe vax=vase] ^- (bolt (list mark))
|
||||
?. (slob %grab p.vax) (flue cof)
|
||||
%+ cope
|
||||
(gro cof (sa (sloe p:(slap vax [%cnzy %grab]))))
|
||||
(flux |=(a=path (welp a /[too])))
|
||||
^= gro
|
||||
|= [cof=cafe tag=(set mark)]
|
||||
=| $: war=(map mark (list mark))
|
||||
pax=(list mark) won=[p=mark q=(qeu mark)]
|
||||
==
|
||||
%. [cof fro]
|
||||
|= [cof=cafe fro=(set mark)] ^- (bolt (list mark))
|
||||
?: =(too p.won)
|
||||
?: (~(has in tag) p.won)
|
||||
(fine cof (flop pax))
|
||||
=+ for=(skip (~(tap by fro)) ~(has by war))
|
||||
=. for (sort for aor) :: XX useful?
|
||||
@ -1269,7 +1131,7 @@
|
||||
:: =+ ^= pre
|
||||
:: ?+ -.kas -.kas
|
||||
:: ^ %cell
|
||||
:: %boil [-.kas p.kas (tope q.kas)]
|
||||
:: :: %boil [-.kas p.kas (tope q.kas)]
|
||||
:: %bake [-.kas p.kas (tope q.kas)]
|
||||
:: %core [-.kas (tope p.kas)]
|
||||
:: ==
|
||||
@ -1291,27 +1153,33 @@
|
||||
==
|
||||
::
|
||||
%$ (fine cof %& p.kas)
|
||||
%bake
|
||||
:: ~& > [p.kas (tope q.kas)]
|
||||
:: %+ cool |.(leaf/"ford: bake {<p.kas>} {<(tope q.kas)>}")
|
||||
%+ cope (lima cof p.kas q.kas r.kas)
|
||||
|= [cof=cafe vux=(unit vase)]
|
||||
?~ vux
|
||||
(flaw cof leaf/"file not found" (smyt (tope q.kas)) ~)
|
||||
(fine cof [%& p.kas u.vux])
|
||||
:: %bake
|
||||
:: :: ~& > [p.kas (tope q.kas)]
|
||||
:: :: %+ cool |.(leaf/"ford: bake {<p.kas>} {<(tope q.kas)>}")
|
||||
:: %+ cope (lima cof p.kas q.kas r.kas s.kas)
|
||||
:: |= [cof=cafe vux=(unit vase)]
|
||||
:: ?~ vux
|
||||
:: (flaw cof leaf/"file not found" (smyt (tope r.kas)) ~)
|
||||
:: (fine cof [%& p.kas u.vux])
|
||||
:: ::
|
||||
%alts
|
||||
%. cof
|
||||
|= cof=cafe ^- (bolt gage)
|
||||
?~ p.kas (flaw cof leaf/"ford: out of options" ~)
|
||||
(coop ^$(cof cof, kas i.p.kas) ..$(p.kas t.p.kas))
|
||||
::
|
||||
%boil
|
||||
%bake
|
||||
^- (bolt gage)
|
||||
%+ cool |.(leaf/"ford: boil {<p.kas>} {<(tope q.kas)>} {<r.kas>}")
|
||||
%+ cope (lamp cof q.kas)
|
||||
%+ cool |.(leaf/"ford: bake {<p.kas>} {<(tope r.kas)>} {~(rend co q.kas)}")
|
||||
%+ cope (lamp cof r.kas)
|
||||
|= [cof=cafe bem=beam]
|
||||
%+ cope (lime cof p.kas bem r.kas)
|
||||
%+ cope (lime cof p.kas q.kas bem)
|
||||
|= [cof=cafe vax=vase]
|
||||
(fine cof `gage`[%& p.kas vax])
|
||||
::
|
||||
%bunt
|
||||
%+ cool |.(leaf/"ford: bunt {<p.kas>}")
|
||||
?: ?=(?(%hoon %hook) p.kas)
|
||||
?: ?=(%hoon p.kas)
|
||||
(fine cof %& p.kas [%atom %t] '')
|
||||
%+ cope (fang cof p.kas)
|
||||
|= [cof=cafe tux=vase]
|
||||
@ -1458,25 +1326,13 @@
|
||||
|=(val=* `vase`[typ val])
|
||||
::
|
||||
++ meow :: assemble
|
||||
|= [how=beam arg=heel]
|
||||
|= [how=beam arg=coin]
|
||||
=| $: rop=(map term (pair hoof twig)) :: structures
|
||||
bil=(map term (pair hoof twig)) :: libraries
|
||||
boy=(list twig) :: body stack
|
||||
lit=? :: drop arguments
|
||||
==
|
||||
~% %meow ..meow
|
||||
==
|
||||
%able able
|
||||
%abut abut
|
||||
%apex apex
|
||||
%body body
|
||||
%chad chad
|
||||
%chai chai
|
||||
%chap chap
|
||||
%head head
|
||||
%hone hone
|
||||
%neck neck
|
||||
%wilt wilt
|
||||
==
|
||||
~% %meow ..meow ~
|
||||
|%
|
||||
++ able :: assemble preamble
|
||||
^- twig
|
||||
@ -1493,7 +1349,7 @@
|
||||
%+ cope (maim cof pit able)
|
||||
|= [cof=cafe bax=vase]
|
||||
%+ cope (chap cof bax [%fan fan.hyd])
|
||||
|= [cof=cafe gox=vase]
|
||||
|= [cof=cafe mar=mark gox=vase]
|
||||
%+ cope (maim cof (slop gox bax) [%tssg (flop boy)])
|
||||
|= [cof=cafe fin=vase]
|
||||
(fine cof fin)
|
||||
@ -1534,7 +1390,7 @@
|
||||
%+ cope $(poy t.poy)
|
||||
|= [cof=cafe nex=(list (pair ,@ vase))]
|
||||
%+ cope (chap(s.how [p.i.poy s.how]) cof bax hon)
|
||||
(flux |=(elt=vase [[q.i.poy elt] nex]))
|
||||
(flux |=([mar=mark elt=vase] [[q.i.poy elt] nex]))
|
||||
%- flux
|
||||
|= yal=(list (pair ,@ vase)) ^- vase
|
||||
?~ yal [[%cube 0 [%atom %n]] 0]
|
||||
@ -1544,7 +1400,7 @@
|
||||
|= [cof=cafe bax=vase hon=horn]
|
||||
^- (bolt vase)
|
||||
%+ cope
|
||||
%+ cope (lads cof how ~)
|
||||
%+ cope (lads cof how)
|
||||
%- some-in-map
|
||||
|= [cof=cafe dir=span]
|
||||
=+ nod=(chap(s.how [dir s.how]) cof bax hon)
|
||||
@ -1552,33 +1408,42 @@
|
||||
(flue cof)
|
||||
(cope nod (flux some))
|
||||
%- flux
|
||||
|= doy=(map ,@ vase) ^- vase
|
||||
|= doy=(map ,@ cage) ^- vase
|
||||
?~ doy [[%cube 0 [%atom %n]] 0]
|
||||
%+ slop
|
||||
(slop [[%atom %ta] p.n.doy] q.n.doy)
|
||||
(slop [[%atom %ta] p.n.doy] q.q.n.doy)
|
||||
(slop $(doy l.doy) $(doy r.doy))
|
||||
::
|
||||
++ chap :: produce resources
|
||||
|= [cof=cafe bax=vase hon=horn]
|
||||
^- (bolt vase)
|
||||
^- (bolt cage)
|
||||
?- -.hon
|
||||
%ape (maim cof bax p.hon)
|
||||
%ape (cope (maim cof bax p.hon) (flux |=(a=vase [%noun a])))
|
||||
%arg
|
||||
%+ cope (maim cof bax p.hon)
|
||||
|= [cof=cafe gat=vase]
|
||||
(maul cof gat !>([how arg]))
|
||||
%+ cope (maim cof !>(~) ((jock |) arg))
|
||||
|= [cof=cafe val=vase]
|
||||
%+ cope (maul cof gat (slop !>(how) val))
|
||||
(flux |=(a=vase noun/a))
|
||||
::
|
||||
%alt
|
||||
%. cof
|
||||
|= cof=cafe ^- (bolt cage)
|
||||
?~ p.hon (flaw cof leaf/"ford: out of options" ~)
|
||||
(coop ^$(cof cof, hon i.p.hon) ..$(p.hon t.p.hon))
|
||||
::
|
||||
%day (chad cof bax %dr p.hon)
|
||||
%dub
|
||||
%+ cope $(hon q.hon)
|
||||
(flux |=(vax=vase [[%face p.hon p.vax] q.vax]))
|
||||
(flux |=([mar=mark vax=vase] [mar [%face p.hon p.vax] q.vax]))
|
||||
::
|
||||
%fan
|
||||
%- cope :_ (flux |=(a=vase noun/a))
|
||||
%+ cope
|
||||
|- ^- (bolt (list vase))
|
||||
?~ p.hon (flue cof)
|
||||
%+ cope ^$(cof cof, hon i.p.hon)
|
||||
|= [cof=cafe vax=vase]
|
||||
|= [cof=cafe mar=mark vax=vase]
|
||||
%+ cope ^$(cof cof, p.hon t.p.hon)
|
||||
(flux |=(tev=(list vase) [vax tev]))
|
||||
|= [cof=cafe tev=(list vase)]
|
||||
@ -1587,15 +1452,25 @@
|
||||
?~ tev [[%cube 0 [%atom %n]] 0]
|
||||
(slop i.tev $(tev t.tev))
|
||||
::
|
||||
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
|
||||
%hel
|
||||
%= $
|
||||
hon q.hon
|
||||
arg (scag p.hon arg)
|
||||
s.how (weld (slag p.hon arg) s.how)
|
||||
==
|
||||
%hub (chad cof bax %ud p.hon)
|
||||
%for
|
||||
=+ opt=|.(>(turn p.hon |=([a=path ^] a))<)
|
||||
|- ^- (bolt cage)
|
||||
?~ p.hon (flaw cof leaf/"ford: no match" >(tope how)< *opt ~)
|
||||
?: =(p.i.p.hon (scag (lent p.i.p.hon) (flop s.how)))
|
||||
^$(hon q.i.p.hon)
|
||||
$(p.hon t.p.hon)
|
||||
::
|
||||
%hel $(hon p.hon, lit |)
|
||||
%lin
|
||||
%+ cope $(hon q.hon)
|
||||
|= [cof=cafe cay=cage] ^- (bolt cage)
|
||||
?~ p.hon (fine cof cay)
|
||||
%+ cope $(p.hon t.p.hon)
|
||||
|= [cof=cafe cay=cage]
|
||||
(cope (make cof %cast i.p.hon `cay) furl)
|
||||
::
|
||||
%man
|
||||
%- cope :_ (flux |=(a=vase noun/a))
|
||||
|- ^- (bolt vase)
|
||||
?~ p.hon (fine cof [[%cube 0 [%atom %n]] 0])
|
||||
%+ cope $(p.hon l.p.hon)
|
||||
@ -1603,65 +1478,50 @@
|
||||
%+ cope ^$(cof cof, p.hon r.p.hon)
|
||||
|= [cof=cafe rig=vase]
|
||||
%+ cope ^^^$(cof cof, hon q.n.p.hon)
|
||||
|= [cof=cafe vax=vase]
|
||||
|= [cof=cafe mar=mark vax=vase]
|
||||
%+ fine cof
|
||||
%+ slop
|
||||
(slop [[%atom %tas] p.n.p.hon] vax)
|
||||
(slop lef rig)
|
||||
::
|
||||
%now (chad cof bax %da p.hon)
|
||||
%nap (chai cof bax p.hon)
|
||||
%now
|
||||
%+ cope (chad cof bax %da p.hon)
|
||||
(flux |=(a=vase noun/a))
|
||||
::
|
||||
%nap
|
||||
%+ cope (chai cof bax p.hon)
|
||||
(flux |=(a=vase noun/a))
|
||||
::
|
||||
%saw
|
||||
%+ cope $(hon q.hon)
|
||||
|= [cof=cafe mar=mark sam=vase]
|
||||
%+ cope (maim cof bax p.hon)
|
||||
|= [cof=cafe gat=vase]
|
||||
%+ cope (maul cof gat sam)
|
||||
(flux |=(a=vase noun/a))
|
||||
::
|
||||
%see
|
||||
=. r.p.hon ?:(?=([%ud 0] r.p.hon) r.how r.p.hon)
|
||||
$(hon q.hon, how p.hon)
|
||||
::
|
||||
%saw
|
||||
%+ cope $(hon q.hon)
|
||||
|= [cof=cafe sam=vase]
|
||||
%+ cope (maim cof bax p.hon)
|
||||
|= [cof=cafe gat=vase]
|
||||
(maul cof gat sam)
|
||||
::
|
||||
%sic
|
||||
%+ cope $(hon q.hon)
|
||||
|= [cof=cafe vax=vase]
|
||||
|= [cof=cafe mar=mark vax=vase]
|
||||
%+ cope (maim cof bax [%bctr p.hon])
|
||||
|= [cof=cafe tug=vase]
|
||||
?. (~(nest ut p.tug) | p.vax)
|
||||
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
|
||||
(fine cof [p.tug q.vax])
|
||||
(fine cof [mar p.tug q.vax])
|
||||
::
|
||||
%toy (cope (cope (make cof %boil p.hon how ~) furl) feel)
|
||||
==
|
||||
::
|
||||
++ chop :: possible subpaths
|
||||
|= [old=(set beam) hon=horn]
|
||||
=+ acc=[new=*(set beam) old=old]
|
||||
|- ^+ acc
|
||||
?- -.hon
|
||||
?(%ape %arg %toy) acc
|
||||
?(%dub %sic %saw) $(hon q.hon)
|
||||
?(%day %hub %nap %now) acc :: drop to avoid cycles
|
||||
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
|
||||
%see
|
||||
=. r.p.hon ?:(?=([%ud 0] r.p.hon) r.how r.p.hon)
|
||||
$(hon q.hon, how p.hon)
|
||||
::
|
||||
%hel
|
||||
=. s.how (weld (slag p.hon arg) s.how)
|
||||
?: (~(has in old.acc) how) acc
|
||||
[(~(put in new.acc) how) (~(put in old.acc) how)]
|
||||
::
|
||||
%fan
|
||||
|- ^+ acc
|
||||
?~ p.hon acc
|
||||
^$(hon i.p.hon, acc $(p.hon t.p.hon))
|
||||
::
|
||||
%man
|
||||
|- ^+ acc
|
||||
?~ p.hon acc
|
||||
=. acc $(p.hon l.p.hon, acc $(p.hon r.p.hon))
|
||||
^$(hon q.n.p.hon)
|
||||
%toy
|
||||
?: p.hon
|
||||
=. arg ?.(lit arg many/~)
|
||||
(cope (make cof %bake q.hon arg how) furl)
|
||||
%+ cool |.(leaf/"ford: hook {<q.hon>} {<(tope how)>}")
|
||||
%+ cope (fade cof %hoon how)
|
||||
|= [cof=cafe hyd=hood]
|
||||
%+ cope (abut:(meow how arg) cof hyd)
|
||||
;~(cope (lake q.hon) (flux |=(a=vase [q.hon a])))
|
||||
==
|
||||
::
|
||||
++ head :: consume structures
|
||||
@ -1768,7 +1628,7 @@
|
||||
|=([cof=cafe p=silk q=silk] (cope (make cof q) furl))
|
||||
==
|
||||
|= [cof=cafe cay=cage coy=cage] ^- (bolt gage)
|
||||
?: ?=(?(%hoon %hook) p.cay)
|
||||
?: ?=(%hoon p.cay)
|
||||
?. ?=(%txt-diff p.coy)
|
||||
(flaw cof leaf/"{<p.cay>} mark with bad diff type: {<p.coy>}" ~)
|
||||
=+ txt=((soft ,@t) q.q.cay)
|
||||
@ -1860,7 +1720,7 @@
|
||||
[%| $(a (turn (turn a2 head) |=(b=mass ?~(-.q.b !! p.q.b))))]
|
||||
%+ turn (~(tap by pol))
|
||||
|= [@ baby]
|
||||
:~ =< cache/[%| (turn `(list term)`/hood/bake/lilt/slit/slim/slap/slam .)]
|
||||
:~ =< cache/[%| (turn `(list term)`/hood/bake/slit/slim/slap/slam .)]
|
||||
=- |=(a=term [a `(~(get ja dep) a)])
|
||||
=< `dep=(jar term ,*)`(~(rep by jav) .)
|
||||
|=([[* a=[term *]] b=(jar term ,*)] (~(add ja b) a))
|
||||
@ -1894,8 +1754,7 @@
|
||||
~
|
||||
::
|
||||
++ load :: highly forgiving
|
||||
|= old=axle
|
||||
..^$(+>- old)
|
||||
|=(old=axle ..^$(+>- old))
|
||||
::=. old
|
||||
:: ?. ?=([%0 *] old) old :: remove at 1
|
||||
:: :- %1
|
||||
|
@ -210,7 +210,7 @@
|
||||
:: ~& [%mo-boot dap how byk]
|
||||
%+ mo-pass [%sys how dap (scot %p p.byk) q.byk (scot r.byk) ~]
|
||||
^- note-arvo
|
||||
[%f %exec our `[byk %core [byk [dap %ape ~]]]]
|
||||
[%f %exec our `[byk %core [byk [dap %app ~]]]]
|
||||
::
|
||||
++ mo-away :: foreign request
|
||||
|= [him=ship caz=cush] ::
|
||||
@ -1166,6 +1166,7 @@
|
||||
%merg `%c
|
||||
%mont `%c
|
||||
%ogre `%c
|
||||
%serv `%e
|
||||
%them `%e
|
||||
%wait `%b
|
||||
%want `%a
|
||||
|
@ -4631,7 +4631,7 @@
|
||||
^- toon
|
||||
?. ?=([2 *] ton) ton
|
||||
:- %2
|
||||
=. p.ton (moop p.ton)
|
||||
:: =. p.ton (moop p.ton)
|
||||
=+ yel=(lent p.ton)
|
||||
=. p.ton
|
||||
?. (gth yel 256) p.ton
|
||||
@ -8808,7 +8808,8 @@
|
||||
$(mew t.mew, rag q:(tock p.i.mew ^$(gen q.i.mew) rag))
|
||||
[%dtkt *] %noun
|
||||
[%dtls *] [%atom %$]
|
||||
[%dtzy *] ?:(=(%f p.gen) ?>((lte q.gen 1) bool) [%atom p.gen])
|
||||
[%dtzy *] ?: =(%n p.gen) ?>(=(0 q.gen) [%cube 0 [%atom %n]])
|
||||
?:(=(%f p.gen) ?>((lte q.gen 1) bool) [%atom p.gen])
|
||||
[%dtzz *] [%cube q.gen ?:(.?(q.gen) %noun [%atom p.gen])]
|
||||
[%dttr *] %noun
|
||||
[%dtts *] bool
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: %jael, secret storage
|
||||
::
|
||||
:::: /hoon/jael
|
||||
:::: /hoon/jael/arvo
|
||||
::
|
||||
!? 164
|
||||
::::
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: %kahn, social state
|
||||
::
|
||||
:::: /hoon/kahn
|
||||
:::: /hoon/kahn/arvo
|
||||
::
|
||||
!? 164
|
||||
::::
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: %lunt, fleet job control
|
||||
::
|
||||
:::: /hoon/lunt
|
||||
:::: /hoon/lunt/arvo
|
||||
::
|
||||
!? 164
|
||||
::::
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: %musk, realm management
|
||||
::
|
||||
:::: /hoon/musk
|
||||
:::: /hoon/musk/arvo
|
||||
::
|
||||
!? 164
|
||||
::::
|
||||
|
@ -1158,32 +1158,11 @@
|
||||
?:(=(~ fyl) ~ [(crip (flop fyl)) ~])
|
||||
::
|
||||
++ fuel :: parse fcgi
|
||||
|= [bem=beam but=path]
|
||||
=+ packed-quay=|-($|(~ [p=@t q=@t t=$]))
|
||||
|= [bem=beam ced=noun:cred quy=packed-quay]
|
||||
^- epic
|
||||
?> ?=([%web @ *] but)
|
||||
=+ dyb=(slay i.t.but)
|
||||
?> ?& ?=([~ %many *] dyb)
|
||||
?=([* * *] p.u.dyb)
|
||||
?=([%$ %ta *] i.p.u.dyb)
|
||||
?=([%blob *] i.t.p.u.dyb)
|
||||
==
|
||||
=+ ced=((hard cred) p.i.t.p.u.dyb)
|
||||
:: =+ nep=q.p.i.p.u.dyb
|
||||
=+ ^= gut ^- (list ,@t)
|
||||
%+ turn t.t.p.u.dyb
|
||||
|= a=coin ^- @t
|
||||
?> ?=([%$ %t @] a)
|
||||
?>(((sane %t) q.p.a) q.p.a)
|
||||
=+ ^= quy
|
||||
|- ^- (list ,[p=@t q=@t])
|
||||
?~ gut ~
|
||||
?> ?=(^ t.gut)
|
||||
[[i.gut i.t.gut] $(gut t.t.gut)]
|
||||
:* (~(gas by *(map cord cord)) quy)
|
||||
ced
|
||||
bem
|
||||
t.t.but
|
||||
==
|
||||
=+ qix=|-(`quay`?~(quy quy [[p q]:quy $(quy t.quy)]))
|
||||
[(mo qix) ((hard cred) ced) bem /]
|
||||
::
|
||||
++ sifo :: 64-bit encode
|
||||
|= tig=@
|
||||
@ -1296,10 +1275,10 @@
|
||||
=< |=(pul=purl `tape`(apex ~ pul))
|
||||
|%
|
||||
++ apex
|
||||
|= qur=quri
|
||||
|= qur=quri ^- tape
|
||||
?- -.qur
|
||||
%& (weld (head p.p.qur) `tape`['/' $(qur [%| +.p.qur])])
|
||||
%| (weld (body p.qur) (tail q.qur))
|
||||
%& (weld (head p.p.qur) $(qur [%| +.p.qur]))
|
||||
%| ['/' (weld (body p.qur) (tail q.qur))]
|
||||
==
|
||||
::
|
||||
++ body
|
||||
@ -1324,7 +1303,7 @@
|
||||
?~(rit ~ (weld (trip i.rit) ?~(t.rit "" `tape`['.' $(rit t.rit)])))
|
||||
==
|
||||
::
|
||||
?~(q.har ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.har)))])
|
||||
?~(q.har ~ `tape`[':' ((d-co:co 1) u.q.har)])
|
||||
==
|
||||
::
|
||||
++ tail
|
||||
@ -2519,6 +2498,7 @@
|
||||
[%crud p=@tas q=(list tank)] :: XX rethink
|
||||
[%hiss p=mark q=cage] :: outbound user req
|
||||
[%init p=@p] :: report install
|
||||
[%serv p=$|(desk beam)] :: set serving root
|
||||
[%them p=(unit hiss)] :: outbound request
|
||||
[%they p=@ud q=httr] :: inbound response
|
||||
[%this p=? q=clip r=httq] :: inbound request
|
||||
@ -2553,26 +2533,26 @@
|
||||
++ horn :: resource tree
|
||||
$% [%ape p=twig] :: /~ twig by hand
|
||||
[%arg p=twig] :: /$ argument
|
||||
[%day p=horn] :: /| list by @dr
|
||||
[%alt p=(list horn)] :: /| options
|
||||
[%dub p=term q=horn] :: /= apply face
|
||||
[%fan p=(list horn)] :: /. list
|
||||
[%for p=path q=horn] :: /, descend
|
||||
[%hel p=@ud q=horn] :: /% propagate heel
|
||||
[%hub p=horn] :: /@ list by @ud
|
||||
[%for p=(list (pair path:spur horn))] :: /, switch by path
|
||||
[%hel p=horn] :: /% propagate args
|
||||
[%lin p=(list mark) q=horn] :: /& translates
|
||||
[%man p=(map span horn)] :: /* hetero map
|
||||
[%nap p=horn] :: /_ homo map
|
||||
[%now p=horn] :: /& list by @da
|
||||
[%now p=horn] :: /@ list by @da
|
||||
[%saw p=twig q=horn] :: /; operate on
|
||||
[%see p=beam q=horn] :: /: relative to
|
||||
[%sic p=tile q=horn] :: /^ cast
|
||||
[%toy p=mark] :: /mark/ static
|
||||
[%toy p=? q=mark] :: /mark/ static/hook
|
||||
== ::
|
||||
++ milk (trel ship desk silk) :: sourced silk
|
||||
++ silk :: construction layer
|
||||
$& [p=silk q=silk] :: cons
|
||||
$% [%$ p=cage] :: literal
|
||||
[%bake p=mark q=beam r=path] :: local synthesis
|
||||
[%boil p=mark q=beam r=path] :: general synthesis
|
||||
[%alts p=(list silk)] :: options
|
||||
[%bake p=mark q=coin r=beam] :: local synthesis
|
||||
[%bunt p=mark] :: example of mark
|
||||
[%call p=silk q=silk] :: slam
|
||||
[%cast p=mark q=silk] :: translate
|
||||
@ -2585,7 +2565,7 @@
|
||||
[%mash p=mark q=milk r=milk] :: annotate
|
||||
[%mute p=silk q=(list (pair wing silk))] :: mutant
|
||||
[%pact p=silk q=silk] :: patch
|
||||
[%plan p=beam q=spur r=hood] :: structured assembly
|
||||
[%plan p=beam q=coin r=hood] :: structured assembly
|
||||
[%reef ~] :: kernel reef
|
||||
[%ride p=twig q=silk] :: silk thru twig
|
||||
[%tabl p=(list (pair silk silk))] :: list
|
||||
|
@ -1,2 +0,0 @@
|
||||
/: /%%%/tree/pub/docs /% /hymn/
|
||||
-<
|
@ -1,2 +0,0 @@
|
||||
/: /%%%/tree/pub/docs /% /json/
|
||||
-<
|
@ -1,2 +0,0 @@
|
||||
/: /%%%/tree/pub/front /% /hymn/
|
||||
-<
|
@ -1,2 +0,0 @@
|
||||
/: /%%%/tree/pub/front /% /json/
|
||||
-<
|
@ -1,14 +0,0 @@
|
||||
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ arg=[address=@t contact=@t ~] ~]
|
||||
:- %address-contact
|
||||
[address.arg contact.arg]
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [arg1=cord arg2=cord ~] ~] ::[arg=[cord cord ~] ~]]
|
||||
:- %auth
|
||||
[arg1 arg2]
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [amount=@t currency=@t ~] ~]
|
||||
:- %buy
|
||||
[amount currency]
|
@ -1,14 +0,0 @@
|
||||
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ arg=[contact=@t address=@t ~] ~]
|
||||
:- %bit-contact
|
||||
[contact.arg address.arg]
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ ~ ~]
|
||||
:- %list
|
||||
~
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [amount=@t currency=@t ~] ~]
|
||||
:- %sell
|
||||
[amount currency]
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [to=@uc amo=@t ~] ~]
|
||||
[%bit-send to amo]
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: ConCATenate file listings
|
||||
::
|
||||
:::: /hoon/gen/cat
|
||||
:::: /hoon/cat/gen
|
||||
::
|
||||
// /%%/ls/subdir
|
||||
// /%/pretty
|
||||
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/pretty/cat/gen
|
||||
::
|
||||
!:
|
||||
|%
|
||||
++ pretty-noun
|
||||
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
::::
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= [^ [arg=(list cord) ~]]
|
||||
:- %keys
|
||||
arg
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/curl/gen
|
||||
::
|
||||
/- sole
|
||||
[sole]
|
||||
:- %get |= [^ [a=tape ~] ~]
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
::::
|
||||
:::: /hoon/url/curl/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/ask/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|= [^ [mel=cord ~] ~]
|
||||
=+ adr=(star ;~(less (mask "\"\\()[],:;<>@") prn))
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/begin/hood/gun
|
||||
:::: /hoon/begin/hood/gen
|
||||
::
|
||||
/? 314
|
||||
/- sole
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/breload/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/cp/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path output=path ~] ~] kiln-cp/[input output])
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/hi/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [who=ship mez=$|(~ [a=tape ~])] ~] helm-send-hi/[who ?~(mez ~ `a.mez)])
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/init/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/mv/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path output=path ~] ~] kiln-mv/[input output])
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/rc/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/reboot/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/reload-desk/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/reload/hood/gen
|
||||
:::: /hoon/rf/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/rm/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [input=path ~] ~] kiln-rm/input)
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/schedule/hood/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve])
|
||||
|
17
gen/hood/serve.hoon
Normal file
17
gen/hood/serve.hoon
Normal file
@ -0,0 +1,17 @@
|
||||
::
|
||||
:::: /hoon/serve/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[pax=$|(term [i=span t=path]) ~] ~]
|
||||
==
|
||||
:- %helm-serve
|
||||
?@ pax pax
|
||||
=+ bem=(need (tome pax))
|
||||
?. =([%da now] r.bem) :: XX actual sentinel
|
||||
bem
|
||||
bem(r [%ud 0])
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/link/hood/gen
|
||||
:::: /hoon/unlink/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/mount/hood/gen
|
||||
:::: /hoon/unmount/hood/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/verb/hood/gun
|
||||
:::: /hoon/verb/hood/gen
|
||||
::
|
||||
/? 314
|
||||
/- sole
|
||||
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/subdir/ls/gen
|
||||
::
|
||||
|%
|
||||
++ subdir
|
||||
|= [pax=path des=(map ,@t ,~)]
|
||||
|
@ -1,2 +1,5 @@
|
||||
::
|
||||
:::: /hoon/make/gen
|
||||
::
|
||||
:- %say
|
||||
|=([^ arg=(list ,@) foo=_`@`1 bar=_`@`2] noun/[arg foo bar])
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/ticket/gen
|
||||
:::: /hoon/moon/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/pope/gen
|
||||
::
|
||||
:: Input twitter keys
|
||||
/- sole
|
||||
!:
|
||||
|
12
gen/talk/load.hoon
Normal file
12
gen/talk/load.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
::
|
||||
:::: /hoon/load/talk/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
==
|
||||
[%talk-load man]
|
12
gen/talk/log.hoon
Normal file
12
gen/talk/log.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
::
|
||||
:::: /hoon/log/talk/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
==
|
||||
[%talk-log man]
|
12
gen/talk/save.hoon
Normal file
12
gen/talk/save.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
::
|
||||
:::: /hoon/save/talk/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
==
|
||||
[%talk-save man]
|
12
gen/talk/unlog.hoon
Normal file
12
gen/talk/unlog.hoon
Normal file
@ -0,0 +1,12 @@
|
||||
::
|
||||
:::: /hoon/unlog/talk/gen
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
::::
|
||||
!:
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI byk=beak]
|
||||
[[man=span ~] ~]
|
||||
==
|
||||
[%talk-unlog man]
|
@ -1,10 +0,0 @@
|
||||
/- twitter
|
||||
::
|
||||
::::
|
||||
::
|
||||
[twitter .]
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[[who=span msg=cord ~] ~]
|
||||
==
|
||||
[%twit-do [who %post eny msg]]
|
@ -1,23 +0,0 @@
|
||||
:: Input twitter keys
|
||||
/- sole, twitter
|
||||
!:
|
||||
[sole twitter .]
|
||||
|%
|
||||
++ baz64 (cook crip (star alp))
|
||||
--
|
||||
!:
|
||||
:- %ask
|
||||
|= $: [now=@da eny=@uvI bec=beak]
|
||||
[~ ~]
|
||||
==
|
||||
^- (sole-result (cask twit-do))
|
||||
%+ sole-lo [%& %$ "User: "] %+ sole-go urs:ab |= acc=span
|
||||
%+ sole-lo [%& %$ "App token: "] %+ sole-go baz64 |= ctok=cord
|
||||
%+ sole-lo [%& %$ "App secret: "] %+ sole-go baz64 |= csec=cord
|
||||
%+ sole-lo [%& %$ "User token: "] %+ sole-go baz64 |= atok=cord
|
||||
%+ sole-lo [%& %$ "User secret: "] %+ sole-go baz64 |= asec=cord
|
||||
(sole-so %twit-do [acc %auth [ctok csec] atok asec])
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
hoontap
|
||||
AP3G1t8ki6rPzeeAqdWCTw03F
|
||||
VV784LPwZSaAxtF16RWWTnST4F85BHN8VqQKNyv7MprCkA0xZD
|
||||
2821727326-RZGXSeTn7hCFQfJqR0ViivM3YYpu2O1M71gelBl
|
||||
jW9VygFPOTsEK0WmrJDHYSoEnofOPdCE1oQRzueemVTl8
|
@ -1,13 +0,0 @@
|
||||
/+ sh-utils
|
||||
!:
|
||||
|_ [hide ~]
|
||||
++ peer ,_`.
|
||||
++ poke--args
|
||||
%+ add-subs [[our /twit] our /post/(scot %uv eny)]
|
||||
%^ gate-mess .
|
||||
|=([a=span b=cord ~] [/twit %twit-do !>([a %post eny b])])
|
||||
,_`.
|
||||
++ posh-twit-stat
|
||||
(args-into-gate . |=([@ @ a=@da @] tang/~[leaf/"Tweet recieved {<a>}"]))
|
||||
++ pour |*([ost=@ * sih=[@ ^]] :_(+>.$ [ost %give +.sih]~))
|
||||
--
|
@ -1,23 +0,0 @@
|
||||
:: Display twitter feed
|
||||
::
|
||||
:::: /hook/core/twitter-feed/app
|
||||
::
|
||||
/+ sh-utils
|
||||
!:
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
|_ [hide ~]
|
||||
++ stat ,[id=@u who=@ta now=@da txt=@t]
|
||||
++ rens
|
||||
:- %say
|
||||
|=(stat rose/[": " `~]^~[leaf/"{<now>} @{(trip who)}" leaf/(trip txt)])
|
||||
++ peer ,_`.
|
||||
++ poke--args
|
||||
|= [ost=bone his=ship who=span ~]
|
||||
%.(+< (add-subs [[our /twit] our /user/[who]] ,_`+>.$))
|
||||
::
|
||||
++ posh-twit-feed
|
||||
(args-into-gate . |=(a=(list stat) tang/(turn a rens)))
|
||||
:: ++ pour |*([ost=@ * sih=[@ ^]] :_(+>.$ [ost %give +.sih]~))
|
||||
--
|
@ -1,7 +0,0 @@
|
||||
/+ tree
|
||||
/: /%%/ /% /elem/
|
||||
::
|
||||
::::
|
||||
::
|
||||
^- (map path marl)
|
||||
[[/ ((getall:tree /h1/h2/h3/h4/h5/h6) -.-)] ~ ~]
|
195
lib/base.css
195
lib/base.css
@ -1,195 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau.woff");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-italic.woff");
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-medium.woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-mediumitalic.woff");
|
||||
font-weight: 500;
|
||||
font-style: italic;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-bold.woff");
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-bolditalic.woff");
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-super.woff");
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "bau";
|
||||
src: url("//storage.googleapis.com/urbit-extra/bau-superitalic.woff");
|
||||
font-weight: 600;
|
||||
font-style: italic;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-extralight.woff");
|
||||
font-weight: 200;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-light.woff");
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-regular.woff");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-medium.woff");
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-bold.woff");
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "scp";
|
||||
src: url("//storage.googleapis.com/urbit-extra/scp-black.woff");
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
input,
|
||||
button,
|
||||
body {
|
||||
font-family: "bau";
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
.mono {
|
||||
font-family:"scp";
|
||||
}
|
||||
|
||||
#c {
|
||||
width: 32rem;
|
||||
margin-left: -16rem;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
h1:after {
|
||||
content: "\2014";
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
h2.advice {
|
||||
margin-top: 2rem;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#c pre {
|
||||
font-size: .6rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
#pass {
|
||||
width: 32rem;
|
||||
}
|
||||
|
||||
button {
|
||||
border: .3rem solid #000;
|
||||
background-color: #fff;
|
||||
font-size: 1rem;
|
||||
padding: .3rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.sig {
|
||||
font-weight: 400;
|
||||
font-size: 2rem;
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
span#ship {
|
||||
font-family: 'bau';
|
||||
font-weight: 400;
|
||||
font-size: 1.2rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .1rem;
|
||||
display: inline-block;
|
||||
min-width: 1rem;
|
||||
}
|
||||
|
||||
input {
|
||||
font-family: 'scp';
|
||||
display: inline;
|
||||
}
|
||||
|
||||
span#ship,
|
||||
input {
|
||||
border: none;
|
||||
padding: .3rem;
|
||||
outline: none;
|
||||
border-bottom: 3px solid #555;
|
||||
}
|
||||
|
||||
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
|
||||
#c {
|
||||
width: 16rem;
|
||||
margin-left: -8rem;
|
||||
}
|
||||
#pass {
|
||||
width: 16rem;
|
||||
}
|
||||
input {
|
||||
-webkit-appearance: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
:: Core markdown parser, exposed as ++parse
|
||||
::
|
||||
::::
|
||||
:::: /hoon/parse/down-jet/lib
|
||||
::
|
||||
=+ =~
|
||||
|%
|
||||
|
@ -1,6 +1,6 @@
|
||||
:: ++down rendering arms
|
||||
!:
|
||||
::::
|
||||
:::: /hoon/rend/down-jet/lib
|
||||
::
|
||||
|%
|
||||
++ into-inner
|
||||
|
@ -47,6 +47,7 @@
|
||||
$% [%cash wire p=@p q=buck] ::
|
||||
[%conf wire dock %load ship term] ::
|
||||
[%flog wire flog] ::
|
||||
[%serv wire ?(desk beam)] ::
|
||||
[%poke wire dock pear] ::
|
||||
[%wont wire sock path *] :: send message
|
||||
== ::
|
||||
@ -94,6 +95,10 @@
|
||||
%^ emit %poke /helm/ask/(scot %p ~doznec)
|
||||
[[~doznec %ask] %ask-mail mel]
|
||||
::
|
||||
++ poke-serve
|
||||
|= top=?(desk beam) =< abet
|
||||
(emit %serv /helm/serv top)
|
||||
::
|
||||
++ poke-hi |=(mes=@t abet:(emit %flog /di %text "< {<src>}: {(trip mes)}"))
|
||||
++ coup-hi
|
||||
|= [pax=path cop=(unit tang)] =< abet
|
||||
|
@ -1,43 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct1/lib :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- oct1 :: structures
|
||||
:: :: ::
|
||||
:::: :::::: semantics
|
||||
!: :: ::
|
||||
[oct1 .]
|
||||
|% ::
|
||||
++ icon |=(? ?:(+< 'X' 'O')) :: display at
|
||||
++ bo :: per board
|
||||
|_ bud=board ::
|
||||
++ bit |=(@ =(1 (cut 0 [+< 1] bud))) :: moved at address
|
||||
++ get |=(point (bit (off +<))) :: get point
|
||||
++ off |=(point (add x (mul 3 y))) :: bitfield address
|
||||
++ set |=(point (con bud (bex (off +<)))) :: set point
|
||||
++ win %- lien :_ |=(a=@ =(a (dis a bud))) :: test for win
|
||||
(rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: with bitmasks
|
||||
-- ::
|
||||
++ go :: play from
|
||||
|_ game ::
|
||||
++ at |_ point :: per point
|
||||
++ g +>+< :: game
|
||||
++ k !|(x o) :: legal move
|
||||
++ m ?.(k [| g] [& g:t:?:(who y p)]) :: move
|
||||
++ o (~(get bo boo) +<) :: old at o
|
||||
++ p .(boo (~(set bo boo) +<)) :: play at o
|
||||
++ t .(who !who) :: take turn
|
||||
++ v ?:(x (icon &) ?:(o (icon |) '.')) :: view
|
||||
++ x (~(get bo box) +<) :: old at x
|
||||
++ y .(box (~(set bo box) +<)) :: play at x
|
||||
-- ::
|
||||
++ new +<(boo 0, box 0, who &) :: reset game
|
||||
++ res ?. |(~(win bo box) ~(win bo boo)) :: possible result
|
||||
?: =(511 (con boo box)) ::
|
||||
`"tie :-(" ~ `"{<~[(icon who)]>} wins" ::
|
||||
++ row |= y=@ :- (add y '1') %- zing :: print row
|
||||
(turn (gulf 0 3) |=(@ ~[' ' ~(v at y +<)])) ::
|
||||
++ tab ~["+ 1 2 3" (row 0) (row 1) (row 2)] :: print table
|
||||
++ voy ": {<~[(icon who)]>} (row/col): " :: print prompt
|
||||
--
|
||||
--
|
@ -1,59 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct2/lib :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- oct2 :: structures
|
||||
:: :: ::
|
||||
:::: :::::: semantics
|
||||
!: :: ::
|
||||
[oct2 .]
|
||||
|% ::
|
||||
++ icon |=(? ?:(+< 'X' 'O')) :: display at
|
||||
++ bo :: per board
|
||||
|_ bud=board ::
|
||||
++ bit |=(@ =(1 (cut 0 [+< 1] bud))) :: moved at address
|
||||
++ get |=(point (bit (off +<))) :: get point
|
||||
++ off |=(point (add x (mul 3 y))) :: bitfield address
|
||||
++ set |=(point (con bud (bex (off +<)))) :: set point
|
||||
++ win %- lien :_ |=(a=@ =(a (dis a bud))) :: test for win
|
||||
(rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: with bitmasks
|
||||
-- ::
|
||||
++ go :: play from
|
||||
|_ [src=ship game] ::
|
||||
++ at |_ point :: per point
|
||||
++ g `game`+>+<+ :: game
|
||||
++ k &(!|(x o) ept) :: legal move
|
||||
++ m ?.(k [| g] [& g:t:?:(who y p)]) :: move
|
||||
++ o (~(get bo boo) +<) :: old at o
|
||||
++ p .(boo (~(set bo boo) +<), q.sag `src) :: play at o
|
||||
++ t .(who !who) :: take turn
|
||||
++ v ?:(x (icon &) ?:(o (icon |) '.')) :: view
|
||||
++ x (~(get bo box) +<) :: old at x
|
||||
++ y .(box (~(set bo box) +<), p.sag `src) :: play at x
|
||||
-- ::
|
||||
++ ept =+(own |(&(=(~ -) !=(oth `src)) =(`src -))) :: we can play
|
||||
++ hey |=(? +>+<+(aud ((stat ship) +< src aud))) :: enter/leave
|
||||
++ muy |= (list ship) ?~ +< +>+<+ :: many in audience
|
||||
$(+< t.+<, aud ((stat ship) & i.+< aud)) ::
|
||||
++ nam =+ ?: =(p.sag `src) ['=' (icon &) ~] :: print name
|
||||
?: =(q.sag `src) ['=' (icon |) ~] ::
|
||||
"" (welp (scow %p src) `tape`-) ::
|
||||
++ new +<+(boo 0, box 0, who &, sag [~ ~]) :: reset game
|
||||
++ oth own(who !who) :: who owns other turn
|
||||
++ own ?:(who p.sag q.sag) :: who owns this turn
|
||||
++ res ?. |(~(win bo box) ~(win bo boo)) :: possible result
|
||||
?: =(511 (con boo box)) ::
|
||||
`"tie :-(" ~ `"{<nam>} wins" ::
|
||||
++ row |= y=@ :- (add y '1') %- zing :: print row
|
||||
(turn (gulf 0 3) |=(@ ~[' ' ~(v at y +<)])) ::
|
||||
++ str =+ [own ~[(icon who)]] ^- tape :: print player
|
||||
?~(-< -> (scow %p u.-<)) ::
|
||||
++ tab ~["+ 1 2 3" (row 0) (row 1) (row 2)] :: print table
|
||||
++ vew =- ?: =(~ -) ~ :(weld "[" - "]") :: print watchers
|
||||
=+ dow=(~(tap by aud)) |- ^- tape ::
|
||||
?~ dow ~ =+ mor=$(dow t.dow) ::
|
||||
:(weld nam(src p.i.dow) ?~(mor "" ", ") mor) ::
|
||||
++ voy =+ ~[(icon who)] %+ weld vew :: print prompt
|
||||
?.(ept " ({-}'s turn) " ": {-} (row/col): ")::
|
||||
--
|
||||
--
|
@ -1,60 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct3/lib :::::: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- oct3 :: structures
|
||||
:: :: ::
|
||||
:::: :::::: semantics
|
||||
!: :: ::
|
||||
[. ^oct3]
|
||||
|% ::
|
||||
++ icon |=(? ?:(+< 'X' 'O')) :: display at
|
||||
++ bo :: per board
|
||||
|_ bud=board ::
|
||||
++ bit |=(@ =(1 (cut 0 [+< 1] bud))) :: moved at address
|
||||
++ get |=(point (bit (off +<))) :: get point
|
||||
++ jon a/(turn (gulf 0 9) |=(@ b/(bit +<))) :: to json
|
||||
++ off |=(point (add x (mul 3 y))) :: bitfield address
|
||||
++ set |=(point (con bud (bex (off +<)))) :: set point
|
||||
++ win %- lien :_ |=(a=@ =(a (dis a bud))) :: test for win
|
||||
(rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: with bitmasks
|
||||
-- ::
|
||||
++ go :: play from
|
||||
|_ [src=ship game] ::
|
||||
++ at |_ point :: per point
|
||||
++ g `game`+>+<+ :: game
|
||||
++ k &(!|(x o) ept) :: legal move
|
||||
++ m ?.(k [| g] [& g:t:?:(who y p)]) :: move
|
||||
++ o (~(get bo boo) +<) :: old at o
|
||||
++ p .(boo (~(set bo boo) +<), q.sag `src) :: play at o
|
||||
++ t .(who !who) :: take turn
|
||||
++ v ?:(x (icon &) ?:(o (icon |) '.')) :: view
|
||||
++ x (~(get bo box) +<) :: old at x
|
||||
++ y .(box (~(set bo box) +<), p.sag `src) :: play at x
|
||||
-- ::
|
||||
++ ept =+(own |(&(=(~ -) !=(oth `src)) =(`src -))) :: we can play
|
||||
++ hey |=(? +>+<+(aud ((stat ship) +< src aud))) :: enter/leave
|
||||
++ muy |= (list ship) ?~ +< +>+<+ :: many in audience
|
||||
$(+< t.+<, aud ((stat ship) & i.+< aud)) ::
|
||||
++ nam =+ ?: =(p.sag `src) ['=' (icon &) ~] :: print name
|
||||
?: =(q.sag `src) ['=' (icon |) ~] ::
|
||||
"" (welp (scow %p src) `tape`-) ::
|
||||
++ new +<+(boo 0, box 0, who &, sag [~ ~]) :: reset game
|
||||
++ oth own(who !who) :: who owns other turn
|
||||
++ own ?:(who p.sag q.sag) :: who owns this turn
|
||||
++ res ?. |(~(win bo box) ~(win bo boo)) :: possible result
|
||||
?: =(511 (con boo box)) ::
|
||||
`"tie :-(" ~ `"{<nam>} wins" ::
|
||||
++ row |= y=@ :- (add y '1') %- zing :: print row
|
||||
(turn (gulf 0 3) |=(@ ~[' ' ~(v at y +<)])) ::
|
||||
++ str =+ [own ~[(icon who)]] ^- tape :: print player
|
||||
?~(-< -> (scow %p u.-<)) ::
|
||||
++ tab ~["+ 1 2 3" (row 0) (row 1) (row 2)] :: print table
|
||||
++ vew =- ?: =(~ -) ~ :(weld "[" - "]") :: print watchers
|
||||
=+ dow=(~(tap by aud)) |- ^- tape ::
|
||||
?~ dow ~ =+ mor=$(dow t.dow) ::
|
||||
:(weld nam(src p.i.dow) ?~(mor "" ", ") mor) ::
|
||||
++ voy =+ ~[(icon who)] %+ weld vew :: print prompt
|
||||
?.(ept " ({-}'s turn) " ": {-} (row/col): ")::
|
||||
--
|
||||
--
|
@ -1,60 +0,0 @@
|
||||
:: :: ::
|
||||
:::: /hoon/oct4/lib :: :: dependencies
|
||||
:: :: ::
|
||||
/? 310 :: arvo version
|
||||
/- oct4 :: structures
|
||||
:: :: ::
|
||||
:::: :: :: semantics
|
||||
!: :: ::
|
||||
[. ^oct4]
|
||||
|%
|
||||
++ icon |=(? ?:(+< 'X' 'O')) :: display at
|
||||
++ bo :: per board
|
||||
|_ bud=board ::
|
||||
++ bit |=(@ =(1 (cut 0 [+< 1] bud))) :: moved at address
|
||||
++ get |=(point (bit (off +<))) :: get point
|
||||
++ jon a/(turn (gulf 0 9) |=(@ b/(bit +<))) :: to json
|
||||
++ off |=(point (add x (mul 3 y))) :: bitfield address
|
||||
++ set |=(point (con bud (bex (off +<)))) :: set point
|
||||
++ win %- lien :_ |=(a=@ =(a (dis a bud))) :: test for win
|
||||
(rip 4 0wl04h0.4A0Aw.4A00s.0e070) :: with bitmasks
|
||||
-- ::
|
||||
++ go :: play from
|
||||
|_ [src=ship game] ::
|
||||
++ at |_ point :: per point
|
||||
++ g `game`+>+<+ :: game
|
||||
++ k &(!|(x o) ept) :: legal move
|
||||
++ m ?.(k [| g] [& g:t:?:(who y p)]) :: move
|
||||
++ o (~(get bo boo) +<) :: old at o
|
||||
++ p .(boo (~(set bo boo) +<), q.sag `src) :: play at o
|
||||
++ t .(who !who) :: take turn
|
||||
++ v ?:(x (icon &) ?:(o (icon |) '.')) :: view
|
||||
++ x (~(get bo box) +<) :: old at x
|
||||
++ y .(box (~(set bo box) +<), p.sag `src) :: play at x
|
||||
-- ::
|
||||
++ ept =+(own |(&(=(~ -) !=(oth `src)) =(`src -))) :: we can play
|
||||
++ hey |=(? +>+<+(aud ((stat ship) +< src aud))) :: enter/leave
|
||||
++ muy |= (list ship) ?~ +< +>+<+ :: many in audience
|
||||
$(+< t.+<, aud ((stat ship) & i.+< aud)) ::
|
||||
++ nam =+ ?: =(p.sag `src) ['=' (icon &) ~] :: print name
|
||||
?: =(q.sag `src) ['=' (icon |) ~] ::
|
||||
"" (welp (scow %p src) `tape`-) ::
|
||||
++ new +<+(boo 0, box 0, who &, sag [~ ~]) :: reset game
|
||||
++ oth own(who !who) :: who owns other turn
|
||||
++ own ?:(who p.sag q.sag) :: who owns this turn
|
||||
++ res ?. |(~(win bo box) ~(win bo boo)) :: possible result
|
||||
?: =(511 (con boo box)) ::
|
||||
`"tie :-(" ~ `"{<nam>} wins" ::
|
||||
++ row |= y=@ :- (add y '1') %- zing :: print row
|
||||
(turn (gulf 0 3) |=(@ ~[' ' ~(v at y +<)])) ::
|
||||
++ str =+ [own ~[(icon who)]] ^- tape :: print player
|
||||
?~(-< -> (scow %p u.-<)) ::
|
||||
++ tab ~["+ 1 2 3" (row 0) (row 1) (row 2)] :: print table
|
||||
++ vew =- ?: =(~ -) ~ :(weld "[" - "]") :: print watchers
|
||||
=+ dow=(~(tap by aud)) |- ^- tape ::
|
||||
?~ dow ~ =+ mor=$(dow t.dow) ::
|
||||
:(weld nam(src p.i.dow) ?~(mor "" ", ") mor) ::
|
||||
++ voy =+ ~[(icon who)] %+ weld vew :: print prompt
|
||||
?.(ept " ({-}'s turn) " ": {-} (row/col): ")::
|
||||
--
|
||||
--
|
@ -1,3 +1,6 @@
|
||||
::
|
||||
:::: /hoon/react/lib
|
||||
::
|
||||
!:
|
||||
|%
|
||||
++ react-elems :: XX /~
|
||||
@ -45,7 +48,9 @@
|
||||
=+ atr=(mo a.g.src)
|
||||
?: (~(has by atr) [%urb %codemirror])
|
||||
?> ?=([[%pre *] _:/(**) ~] src)
|
||||
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
|
||||
=. a.g.src
|
||||
[value/v.i.a.g.i.c.src (skip a.g.src |=([a=mane *] ?=(^ a)))]
|
||||
$(src [[%codemirror a.g.src] ~])
|
||||
?: (~(has by atr) [%urb %exec]) :: runnable code attribute tag
|
||||
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
|
||||
=* code v.i.a.g.i.c.src
|
||||
|
@ -1,107 +0,0 @@
|
||||
:: App construction utilities
|
||||
::
|
||||
:::: /hoon/sh-utils/lib
|
||||
::
|
||||
|%
|
||||
++ append
|
||||
|* a=*
|
||||
|* b=*
|
||||
[b a]
|
||||
::
|
||||
++ hapt (pair ship path)
|
||||
--
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ args-done |*(ref=_,[(list) ^] (add-exit (add-nice ref))) :: accept args
|
||||
::
|
||||
++ add-exit :: add "kill self" kiss
|
||||
|* ref=_,[(list) ^]
|
||||
%+ add-resp [%pass / %g %cide %$]
|
||||
ref
|
||||
::
|
||||
++ add-nice :: return "succcess" response
|
||||
|* ref=_,[(list) ^]
|
||||
%+ add-resp [%give %nice ~]
|
||||
ref
|
||||
::
|
||||
++ add-subs :: add gall subscription
|
||||
|* [hat=[hapt ship path] ref=_,[(list) ^]]
|
||||
(add-resp [%pass /show %g %show hat] ref)
|
||||
::
|
||||
++ args-into-gate :: poke--args from gate: output and exit
|
||||
|* [con=[* [hide *] *] gat=_,[@ *]]
|
||||
%- args-done
|
||||
%^ gate-outs con
|
||||
|=(a=_+<.gat [%rush (gat a)])
|
||||
,_`con
|
||||
::
|
||||
++ args-into-resp :: compute gifts with gate and exit
|
||||
|* [con=[* [hide *] *] gat=_,(pole ,[@ *])]
|
||||
%- args-done
|
||||
|* [ost=bone * arg=_+<.gat]
|
||||
:_ con
|
||||
%. (gat arg)
|
||||
|* a=(pole ,[@ *])
|
||||
?~ a ~
|
||||
a(- [ost %give -.a], + $(a +.a))
|
||||
::
|
||||
++ add-output :: send gift to /out
|
||||
|* [con=[* [hide *] *] ote=[@ *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
=+ sus=(~(tap in `(set bone)`(~(get ju pus.hid) /out)))
|
||||
=+ mof=(turn sus (append [%give ote]))
|
||||
|= _+<.ref
|
||||
=+ neu=(ref +<)
|
||||
neu(- (welp mof -.neu))
|
||||
::
|
||||
++ add-resp :: add response move to requesting bone
|
||||
|* [mof=[@ @ *] ref=_,[(list) ^]]
|
||||
|* [ost=bone _?@(+<.ref ~ +<+.ref)]
|
||||
=+ neu=(ref +<)
|
||||
neu(- [[ost mof] -.neu])
|
||||
::
|
||||
++ gate-give :: respond with computed gift
|
||||
|* [gat=_,[@ *] ref=_,[(list) ^]]
|
||||
(gate-move |*(_+<.gat [%give (gat +<)]) ref)
|
||||
::
|
||||
++ gate-bang :: respond with computed note
|
||||
|* [gat=_,[@ @ *] ref=_,[(list) ^]]
|
||||
(gate-move |*(_+<.gat [%pass /bang (gat +<)]) ref)
|
||||
::
|
||||
++ gate-mess :: respond with local message
|
||||
|* [con=[* [hide *] *] gat=_,[@ @ *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
%- gate-move :_ ref
|
||||
|* _+<.gat
|
||||
=+ `[imp=path mez=cage]`(gat +<)
|
||||
[%pass /poke %g %mess [our.hid imp] our.hid mez]
|
||||
::
|
||||
++ gate-move :: respond with computed move
|
||||
|* [gat=_,(mold) ref=_,[(list) ^]]
|
||||
|* [ost=bone * arg=_+<.gat]
|
||||
((add-resp (gat arg) ref) +<)
|
||||
::
|
||||
::
|
||||
++ gate-outs :: send computed gift to /out
|
||||
|* [con=[* [hide *] *] gat=_,[@ *] ref=_,[(list) ^]]
|
||||
|* [ost=bone * arg=_+<.gat]
|
||||
((add-output con (gat arg) ref) +<)
|
||||
::
|
||||
++ listen-in :: recieve standard input
|
||||
|* [con=[* [hide *] *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
(add-subs [[our +.imp] our /in/[-.imp]]:hid ref)
|
||||
::
|
||||
++ print
|
||||
|* [con=[* [hide *] *] tap=tape]
|
||||
(add-output con [%rush %tang [%leaf tap] ~] ,_[~ con])
|
||||
::
|
||||
++ verify :: type-check with context and move
|
||||
|* [con=^ mof=[@ *]]
|
||||
|* ref=_,[(list ,_mof) _con]
|
||||
|* _+<.ref
|
||||
^- [(list ,_mof) _con]
|
||||
(ref +<)
|
||||
--
|
@ -1,3 +0,0 @@
|
||||
:: Alias
|
||||
/+ sh-utils
|
||||
.
|
@ -1,64 +1,41 @@
|
||||
::
|
||||
:::: /hoon/tree/lib
|
||||
::
|
||||
/- tree-include
|
||||
!:
|
||||
|%
|
||||
++ extract
|
||||
|= a=marl ^- tape
|
||||
?~ a ~
|
||||
%- weld :_ $(a t.a)
|
||||
?. ?=(_:/(**) i.a)
|
||||
$(a c.i.a)
|
||||
v.i.a.g.i.a
|
||||
::
|
||||
++ getall
|
||||
++ getall :: search in manx
|
||||
|= tag=(list mane)
|
||||
|= ele=manx ^- marl
|
||||
?: (lien tag |=(a=mane =(a n.g.ele)))
|
||||
~[ele]
|
||||
(zing (turn c.ele ..$))
|
||||
++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
|
||||
++ find-in-tree
|
||||
|* [paz=fist:jo fun=$+(* (unit))]
|
||||
|= jon=json
|
||||
=+ a=`(list json)`~[jon]
|
||||
|^ (try)
|
||||
++ try
|
||||
|. ^+ *fun
|
||||
?~ a ~
|
||||
%+ biff (paz i.a)
|
||||
|* [b=(list json) c=*] ^+ *fun
|
||||
(baff (baff (fun c) try(a b)) try(a t.a))
|
||||
--
|
||||
::
|
||||
++ map-to-json
|
||||
++ map-to-json :: hoon data to json
|
||||
|* [a=$+(* cord) b=$+(* json)]
|
||||
|* c=(map) ^- json
|
||||
|* c=(map) ^- json :: XX c=(map _+<.a _+<.b)
|
||||
~! c
|
||||
(jobe (turn (~(tap by c)) |*([k=* v=*] [(a k) (b v)])))
|
||||
::
|
||||
++ json-front
|
||||
|= a=json ^- json
|
||||
=- (fall `(unit json)`- ~)
|
||||
%. a
|
||||
%+ find-in-tree (ot c/(ar some) gn/so ga/(om so) ~):jo
|
||||
|= [nom=span atr=(map span cord)] ^- (unit json)
|
||||
?. (~(has by atr) 'urb:front') ~
|
||||
?> ?=(%meta nom)
|
||||
(biff (~(get by atr) %value) poja)
|
||||
::
|
||||
++ read-schem
|
||||
=< (cook to-noun (cook to-tree apex))
|
||||
:: a.b_c.d => [[%a %b] [%c %d]]
|
||||
:: a.b_c, a_b__c => [[%a %b] %c]
|
||||
:: a_b_c, a__b_c => [%a [%b %c]]
|
||||
++ read-schem :: decode gapped noun
|
||||
=< (cook to-noun (cook build-grove apex))
|
||||
|%
|
||||
++ noun $|(term [noun noun]) :: shadow
|
||||
++ data $|(term [n=@ l=noun r=data])
|
||||
:: improper list of possible entry points
|
||||
++ grove $|(term [gap=@ sealed=noun pending=grove])
|
||||
++ apex ;~(plug sym (star ;~(plug delim sym)))
|
||||
++ delim ;~(pose (cold 0 dot) (cook lent (plus cab)))
|
||||
++ to-noun |=(a=data ?@(a a [l.a $(a r.a)]))
|
||||
++ to-tree
|
||||
|= [acc=data a=(list ,[p=@u q=term])]
|
||||
%+ roll a =< .(acc ^acc)
|
||||
|= [[n=@u v=term] acc=data]
|
||||
?@ acc [n acc v]
|
||||
?: (gth n n.acc) [n (to-noun acc) v]
|
||||
acc(r $(acc r.acc))
|
||||
++ to-noun |=(a=grove ?@(a a [sealed.a $(a pending.a)]))
|
||||
++ build-grove
|
||||
|= [a=grove b=(list ,[p=@u q=term])] ^- grove
|
||||
%+ roll b =< .(acc a)
|
||||
|= [[gap=@u v=term] acc=grove] ^- grove
|
||||
?@ acc [gap acc v]
|
||||
?: (gth gap gap.acc) [gap (to-noun acc) v]
|
||||
acc(pending $(acc pending.acc))
|
||||
--
|
||||
--
|
||||
|
||||
|
544
lib/twitter.hoon
544
lib/twitter.hoon
@ -1,544 +0,0 @@
|
||||
:: A Twitter API library.
|
||||
::
|
||||
:::: /hoon/twitter/lib
|
||||
::
|
||||
/? 314
|
||||
/- twitter
|
||||
=+ twit:twitter
|
||||
!:
|
||||
:::: functions
|
||||
::
|
||||
|%
|
||||
++ fass :: rewrite path
|
||||
|= a=path
|
||||
%- trip
|
||||
%^ gsub '-' '_'
|
||||
%+ reel a
|
||||
|= [p=@t q=@t]
|
||||
(cat 3 '/' (cat 3 p q))
|
||||
::
|
||||
++ gsub :: replace chars
|
||||
|= [a=@t b=@t t=@t]
|
||||
^- @t
|
||||
?~ t t
|
||||
%+ add (lsh 3 1 $(t (rsh 3 1 t)))
|
||||
=+ c=(mod t (bex 8))
|
||||
?:(=(a c) b c)
|
||||
::
|
||||
++ oauth :: OAuth 1.0 header
|
||||
|= $: med=meth
|
||||
url=tape
|
||||
pas=(list tape)
|
||||
key=keys
|
||||
zet=@
|
||||
ken=@
|
||||
==
|
||||
^- @t
|
||||
=+ non=(turn (rip 2 (shaw zet 128 ken)) |=(a=@ ~(x ne a)))
|
||||
=+ tim=(slag 2 (scow %ui (unt zet)))
|
||||
=+ sky=(crip :(weld (urle (trip sec.con.key)) "&" (urle (trip sec.acc.key))))
|
||||
=+ ^= bas
|
||||
^- tape
|
||||
=+ ^= hds
|
||||
%- reel :_ |=([p=tape q=tape] :(weld p "&" q))
|
||||
%- sort :_ aor
|
||||
%- weld :- pas
|
||||
^- (list tape)
|
||||
:~ :(weld "oauth_consumer_key=" (trip tok.con.key))
|
||||
:(weld "oauth_nonce=" non)
|
||||
:(weld "oauth_signature_method=HMAC-SHA1")
|
||||
:(weld "oauth_timestamp=" tim)
|
||||
:(weld "oauth_token=" (trip tok.acc.key))
|
||||
:(weld "oauth_version=1.0")
|
||||
==
|
||||
;: weld
|
||||
(trip (cuss (trip `@t`med))) "&"
|
||||
(urle url) "&"
|
||||
(urle (scag (dec (lent hds)) `tape`hds))
|
||||
==
|
||||
=+ sig=`tape`(sifo (swap 3 (hmac (swap 3 sky) (crip bas))))
|
||||
%- crip
|
||||
;: weld "OAuth "
|
||||
"oauth_consumer_key=" "\"" (trip tok.con.key) "\", "
|
||||
"oauth_nonce=" "\"" non "\", "
|
||||
"oauth_signature=" "\"" (urle sig) "\", "
|
||||
"oauth_signature_method=\"HMAC-SHA1\", "
|
||||
"oauth_timestamp=" "\"" tim "\", "
|
||||
"oauth_token=" "\"" (trip tok.acc.key) "\", "
|
||||
"oauth_version=1.0"
|
||||
==
|
||||
::
|
||||
++ valve :: produce request
|
||||
|= $: med=meth
|
||||
[rus=tape quy=quay]
|
||||
key=keys
|
||||
est=time
|
||||
eny=@
|
||||
==
|
||||
^- hiss
|
||||
=+ url="https://api.twitter.com/1.1{rus}.json"
|
||||
=+ req=|=(a=tape (scan a auri:epur))
|
||||
=+ ^= help
|
||||
|= quy=(list ,[tape tape])
|
||||
^- (list tape)
|
||||
%+ turn quy
|
||||
|= a=[p=tape q=tape]
|
||||
:(weld (urle p.a) "=" (urle q.a))
|
||||
=+ tan=(turn quy |=([p=@t q=@t] [(trip p) (trip q)]))
|
||||
=+ har=(help (turn tan |=(p=[p=tape q=tape] [p.p (urle q.p)])))
|
||||
=+ hab=(help tan)
|
||||
=+ lav=(reel har |=([p=tape q=tape] :(weld p "&" q)))
|
||||
=+ voy=?:(=(0 (lent lav)) ~ (scag (dec (lent lav)) `tape`lav))
|
||||
=+ vab=(reel hab |=([p=tape q=tape] :(weld p "&" q)))
|
||||
=+ vur=(crip ?:(=(0 (lent vab)) ~ (scag (dec (lent vab)) `tape`vab)))
|
||||
=+ ^= head
|
||||
%- ~(gas by *math)
|
||||
:~ ['authorization' [(oauth med url hab key est eny) ~]]
|
||||
['content-type' ['application/x-www-form-urlencoded' ~]]
|
||||
==
|
||||
?: =(%get med)
|
||||
?~ voy
|
||||
[(req url) med head ~]
|
||||
[(req :(weld url "?" voy)) med head ~]
|
||||
[(req url) med head (some [(met 3 vur) vur])]
|
||||
--
|
||||
!:
|
||||
:::: library
|
||||
::
|
||||
|%
|
||||
++ twip :: response printers
|
||||
|%
|
||||
++ mean
|
||||
|= [msg=@t num=@ud] ^- tank
|
||||
rose/[": " `~]^~[leaf/"Error {<num>}" leaf/(trip msg)]
|
||||
--
|
||||
++ twir :: response parsers
|
||||
|%
|
||||
++ fasp |*([a=@tas b=*] [(gsub '-' '_' a) b])
|
||||
++ user (cook crip (plus ;~(pose aln cab)))
|
||||
++ mean (ot errors/(ar (ot message/so code/ni ~)) ~):jo
|
||||
++ stat
|
||||
=+ jo
|
||||
^- $+(json (unit ,[id=@u who=@ta now=@da txt=@t]))
|
||||
%- ot
|
||||
:~ id/ni
|
||||
user/(ot (fasp screen-name/(su user)) ~)
|
||||
(fasp created-at/da)
|
||||
text/so
|
||||
==
|
||||
++ usel
|
||||
=+ jo
|
||||
^- $+(json (unit (list ,who=@ta)))
|
||||
=- (ot users/(ar -) ~)
|
||||
(ot (fasp screen-name/(su user)) ~)
|
||||
--
|
||||
++ twit
|
||||
=> |% :: request structures
|
||||
++ dev ,@t :: device name
|
||||
++ gat ,@t :: grant type
|
||||
++ lat ,@t :: latitude
|
||||
++ lid (list tid)
|
||||
++ lon ,@t :: longitude
|
||||
++ lsc (list scr)
|
||||
++ lst (list ,@t)
|
||||
++ nam ,@t :: location name
|
||||
++ pla ,@t :: place-id
|
||||
++ scr ,@t :: screen name
|
||||
++ slu ,@t :: category name
|
||||
++ tid ,@u
|
||||
++ tok ,@t :: oauth token
|
||||
++ url ,@t :: callback url
|
||||
::
|
||||
++ at ,[%access-token p=tok]
|
||||
++ de ,[%device p=dev]
|
||||
++ fo ,[%follow p=lid]
|
||||
++ gr ,[%grant-type p=gat]
|
||||
++ id ,[%id p=tid]
|
||||
++ ii ,[%'!inline' p=@t]
|
||||
++ is ,[%id p=lid]
|
||||
++ la ,[%lat p=lat]
|
||||
++ lo ,[%long p=lon]
|
||||
++ na ,[%name p=lid]
|
||||
++ oa ,[%oauth-callback p=url]
|
||||
++ os ,[%source-screen-name p=scr]
|
||||
++ pl ,[%place-id p=pla]
|
||||
++ qq ,[%q p=@t]
|
||||
++ sc ,[%screen-name p=scr]
|
||||
++ sd ?(ui sc)
|
||||
++ ss ,[%screen-name p=lsc]
|
||||
++ sl ,[%slug p=slu]
|
||||
++ si ,[%source-id p=tid]
|
||||
++ st ,[%status p=@t]
|
||||
++ te ,[%text p=@t]
|
||||
++ ti ,[%target-id p=tid]
|
||||
++ ts ,[%target-screen-name p=scr]
|
||||
++ tr ,[%track p=lst]
|
||||
++ ur ,[%url p=url]
|
||||
++ ui ,[%user-id p=tid]
|
||||
++ us ,[%user-id p=lid]
|
||||
--
|
||||
|_ [key=keys est=time eny=@uw]
|
||||
++ lutt |=(@ `@t`(rsh 3 2 (scot %ui +<)))
|
||||
++ llsc
|
||||
|= (list scr)
|
||||
(roll +< |=([p=scr q=@t] (cat 3 (cat 3 q ',') p)))
|
||||
::
|
||||
++ llst
|
||||
|= (list ,@t)
|
||||
(roll +< |=([p=@t q=@t] (cat 3 (cat 3 q ',') p)))
|
||||
::
|
||||
++ llid
|
||||
|= (list tid)
|
||||
(roll +< |=([p=tid q=@t] (cat 3 (cat 3 q ',') (lutt p))))
|
||||
::
|
||||
++ mold :: construct request
|
||||
|* [med=meth pax=path a=$+(* *)]
|
||||
|= [args=a quy=quay]
|
||||
(valve med (cowl pax args quy) key est eny)
|
||||
::
|
||||
++ cowl :: handle parameters
|
||||
|= $: pax=path
|
||||
ban=(list ,[p=@t q=?(@ (list ,@))])
|
||||
quy=quay
|
||||
==
|
||||
^- [path quay]
|
||||
?~ ban
|
||||
[(fass pax) quy]
|
||||
?: =('!inline' p.i.ban)
|
||||
?@ q.i.ban
|
||||
[(fass (welp pax /[`@t`q.i.ban])) quy]
|
||||
!!
|
||||
:- (fass pax)
|
||||
%+ welp quy
|
||||
%+ turn `(list ,[p=@t q=?(@ (list ,@))])`ban
|
||||
|= [p=@t q=?(@ (list ,@))]
|
||||
^- [@t @t]
|
||||
:- (gsub '-' '_' p)
|
||||
?@ q
|
||||
?- p
|
||||
?(%id %source-id %target-id %user-id) (lutt q)
|
||||
@ `@t`q
|
||||
==
|
||||
?- p
|
||||
?(%follow %id %name %user-id) (llid q)
|
||||
%track (llst q)
|
||||
%screen-name (llsc q)
|
||||
* !!
|
||||
==
|
||||
::
|
||||
++ stat-ment
|
||||
(mold %get /statuses/mentions-timeline ,~)
|
||||
::
|
||||
++ stat-user
|
||||
(mold %get /statuses/user-timeline ,[sd ~])
|
||||
::
|
||||
++ stat-home
|
||||
(mold %get /statuses/home-timeline ,~)
|
||||
::
|
||||
++ stat-retw
|
||||
(mold %get /statuses/retweets-of-me ,~)
|
||||
::
|
||||
++ stat-rets-iddd
|
||||
(mold %get /statuses/retweets ,[ii ~])
|
||||
::
|
||||
++ stat-show
|
||||
(mold %get /statuses/show ,[id ~])
|
||||
::
|
||||
++ stat-dest-iddd
|
||||
(mold %post /statuses/destroy ,[ii ~])
|
||||
::
|
||||
++ stat-upda
|
||||
(mold %post /statuses/update ,[st ~])
|
||||
::
|
||||
++ stat-retw-iddd
|
||||
(mold %post /statuses/retweet ,[ii ~])
|
||||
::
|
||||
++ stat-oemb-iddd
|
||||
(mold %get /statuses/oembed ,[id ~])
|
||||
::
|
||||
++ stat-oemb-urll
|
||||
(mold %get /statuses/oembed ,[ur ~])
|
||||
::
|
||||
++ stat-retw-idss
|
||||
(mold %get /statuses/retweeters/ids ,[id ~])
|
||||
::
|
||||
++ sear-twee
|
||||
(mold %get /search/tweets ,[qq ~])
|
||||
::
|
||||
++ stat-filt-foll
|
||||
(mold %post /statuses/filter ,[?(fo tr) ~])
|
||||
::
|
||||
++ stat-samp
|
||||
(mold %get /statuses/sample ,~)
|
||||
::
|
||||
++ stat-fire
|
||||
(mold %get /statuses/firehose ,~)
|
||||
::
|
||||
++ user
|
||||
(mold %get /user ,~)
|
||||
::
|
||||
++ site
|
||||
(mold %get /site ,[fo ~])
|
||||
::
|
||||
++ dire
|
||||
(mold %get /direct-messages ,~)
|
||||
::
|
||||
++ dire-sent
|
||||
(mold %get /direct-messages/sent ,~)
|
||||
::
|
||||
++ dire-show
|
||||
(mold %get /direct-messages/show ,[id ~])
|
||||
::
|
||||
++ dire-dest
|
||||
(mold %post /direct-messages/destroy ,[id ~])
|
||||
::
|
||||
++ dire-neww
|
||||
(mold %post /direct-messages/new ,[sd te ~])
|
||||
::
|
||||
++ frie-nore-idss
|
||||
(mold %get /friendships/no-retweets/ids ,~)
|
||||
::
|
||||
++ frie-idss
|
||||
(mold %get /friends/ids ,[sd ~])
|
||||
::
|
||||
++ foll-idss
|
||||
(mold %get /followers/ids ,[sd ~])
|
||||
::
|
||||
++ frie-inco
|
||||
(mold %get /friendships/incoming ,~)
|
||||
::
|
||||
++ frie-outg
|
||||
(mold %get /friendships/outgoing ,~)
|
||||
::
|
||||
++ frie-crea
|
||||
(mold %post /friendships/create ,[sd ~])
|
||||
::
|
||||
++ frie-dest
|
||||
(mold %post /friendships/destroy ,[sd ~])
|
||||
::
|
||||
++ frie-upda
|
||||
(mold %post /friendships/update ,[sd ~])
|
||||
::
|
||||
++ frie-show
|
||||
(mold %get /friendships/show ,[?(si os) ?(ti ts) ~])
|
||||
::
|
||||
++ frie-list
|
||||
(mold %get /friends/list ,[sd ~])
|
||||
::
|
||||
++ foll-list
|
||||
(mold %get /followers/list ,[sd ~])
|
||||
::
|
||||
++ frie-look
|
||||
(mold %get /friendships/lookup ,[?(us ss) ~])
|
||||
::
|
||||
++ acco-sett-gett
|
||||
(mold %get /account/settings ,~)
|
||||
::
|
||||
++ acco-veri
|
||||
(mold %get /account/verify-credentials ,~)
|
||||
::
|
||||
++ acco-sett-post
|
||||
(mold %post /account/settings ,~)
|
||||
::
|
||||
++ acco-upda-deli
|
||||
(mold %post /account/update-delivery-device ,[de ~])
|
||||
::
|
||||
++ acco-upda-prof
|
||||
(mold %post /account/update-profile ,~)
|
||||
::
|
||||
++ acco-upda-prof-back
|
||||
(mold %post /account/update-profile-background-image ,~)
|
||||
::
|
||||
++ acco-upda-prof-colo
|
||||
(mold %post /account/update-profile-colors ,~)
|
||||
::
|
||||
++ bloc-list
|
||||
(mold %get /blocks/list ,~)
|
||||
::
|
||||
++ bloc-idss
|
||||
(mold %get /blocks/ids ,~)
|
||||
::
|
||||
++ bloc-crea
|
||||
(mold %post /blocks/create ,[sd ~])
|
||||
::
|
||||
++ bloc-dest
|
||||
(mold %post /blocks/destroy ,[sd ~])
|
||||
::
|
||||
++ user-look
|
||||
(mold %get /users/lookup ,[?(us ss) ~])
|
||||
::
|
||||
++ user-show
|
||||
(mold %get /users/show ,[sd ~])
|
||||
::
|
||||
++ user-sear
|
||||
(mold %get /users/search ,[qq ~])
|
||||
::
|
||||
++ user-cont-tees
|
||||
(mold %get /users/contributees ,[sd ~])
|
||||
::
|
||||
++ user-cont-tors
|
||||
(mold %get /users/contributors ,[sd ~])
|
||||
::
|
||||
++ acco-remo
|
||||
(mold %post /account/remove-profile-banner ,~)
|
||||
::
|
||||
++ user-prof
|
||||
(mold %get /users/profile-banner ,[sd ~])
|
||||
::
|
||||
++ mute-user-crea
|
||||
(mold %post /mutes/users/create ,[sd ~])
|
||||
::
|
||||
++ mute-user-dest
|
||||
(mold %post /mutes/users/destroy ,[sd ~])
|
||||
::
|
||||
++ mute-user-idss
|
||||
(mold %get /mutes/users/ids ,~)
|
||||
::
|
||||
++ mute-user-list
|
||||
(mold %get /mutes/users/list ,~)
|
||||
::
|
||||
++ user-sugg-slug
|
||||
(mold %get /users/suggestions ,[sl ~])
|
||||
::
|
||||
++ user-sugg
|
||||
(mold %get /users/suggestions ,~)
|
||||
::
|
||||
++ favo-list
|
||||
(mold %get /favorites/list ,~)
|
||||
::
|
||||
++ favo-dest
|
||||
(mold %post /favorites/destroy ,[id ~])
|
||||
::
|
||||
++ favo-crea
|
||||
(mold %post /favorites/create ,[id ~])
|
||||
::
|
||||
++ list-list
|
||||
(mold %get /lists/list ,~)
|
||||
::
|
||||
++ list-stat
|
||||
(mold %get /lists/statuses ,~)
|
||||
::
|
||||
++ list-memb-dest
|
||||
(mold %post /lists/members/destroy ,~)
|
||||
::
|
||||
++ list-memb-hips
|
||||
(mold %get /lists/memberships ,[sd ~])
|
||||
::
|
||||
++ list-subs-bers
|
||||
(mold %get /lists/subscribers ,~)
|
||||
::
|
||||
++ list-subs-crea
|
||||
(mold %post /lists/subscribers/create ,~)
|
||||
::
|
||||
++ list-subs-show
|
||||
(mold %get /lists/subscribers/show ,[sd ~])
|
||||
::
|
||||
++ list-subs-dest
|
||||
(mold %post /lists/subscribers/destroy ,~)
|
||||
::
|
||||
++ list-memb-crea-alll
|
||||
(mold %post /lists/members/create-all ,[?(us ss) ~])
|
||||
::
|
||||
++ list-memb-show
|
||||
(mold %get /lists/members/show ,[sd ~])
|
||||
::
|
||||
++ list-memb-bers
|
||||
(mold %get /lists/members ,~)
|
||||
::
|
||||
++ list-memb-crea
|
||||
(mold %post /lists/members/create ,[sd ~])
|
||||
::
|
||||
++ list-dest
|
||||
(mold %post /lists/destroy ,~)
|
||||
::
|
||||
++ list-upda
|
||||
(mold %post /lists/update ,~)
|
||||
::
|
||||
++ list-crea
|
||||
(mold %post /lists/create ,[na ~])
|
||||
::
|
||||
++ list-show
|
||||
(mold %get /lists/show ,~)
|
||||
::
|
||||
++ list-subs-ions
|
||||
(mold %get /lists/subscriptions ,[sd ~])
|
||||
::
|
||||
++ list-memb-dest-alll
|
||||
(mold %post /lists/members/destroy-all ,[?(us ss) ~])
|
||||
::
|
||||
++ list-owne
|
||||
(mold %get /lists/ownerships ,[sd ~])
|
||||
::
|
||||
++ save-list
|
||||
(mold %get /saved-searches/list ,~)
|
||||
::
|
||||
++ save-show-iddd
|
||||
(mold %get /saved-searches/show ,[ii ~])
|
||||
::
|
||||
++ save-crea
|
||||
(mold %post /saved-searches/create ,[qq ~])
|
||||
::
|
||||
++ save-dest-iddd
|
||||
(mold %post /saved-searches/destroy ,[ii ~])
|
||||
::
|
||||
++ geoo-iddd-plac
|
||||
(mold %get /geo/id ,[ii ~])
|
||||
::
|
||||
++ geoo-reve
|
||||
(mold %get /geo/reverse-geocode ,[la lo ~])
|
||||
::
|
||||
++ geoo-sear
|
||||
(mold %get /geo/search ,~)
|
||||
::
|
||||
++ geoo-simi
|
||||
(mold %get /geo/similar-places ,[la lo na ~])
|
||||
::
|
||||
++ tren-plac
|
||||
(mold %get /trends/place ,[id ~])
|
||||
::
|
||||
++ tren-avai
|
||||
(mold %get /trends/available ,~)
|
||||
::
|
||||
++ tren-clos
|
||||
(mold %get /trends/closest ,[la lo ~])
|
||||
::
|
||||
++ user-repo
|
||||
(mold %post /users/report-spam ,[sd ~])
|
||||
::
|
||||
++ oaut-auth-cate
|
||||
(mold %get /oauth/authenticate ,~)
|
||||
::
|
||||
++ oaut-auth-rize
|
||||
(mold %get /oauth/authorize ,~)
|
||||
::
|
||||
++ oaut-acce
|
||||
(mold %post /oauth/access-token ,~)
|
||||
::
|
||||
++ oaut-requ
|
||||
(mold %post /oauth/request-token ,[oa ~])
|
||||
::
|
||||
++ oaut-toke
|
||||
(mold %post /oauth2/token ,[gr ~])
|
||||
::
|
||||
++ oaut-inva
|
||||
(mold %post /oauth2/invalidate-token ,[at ~])
|
||||
::
|
||||
++ help-conf
|
||||
(mold %get /help/configuration ,~)
|
||||
::
|
||||
++ help-lang
|
||||
(mold %get /help/languages ,~)
|
||||
::
|
||||
++ help-priv
|
||||
(mold %get /help/privacy ,~)
|
||||
::
|
||||
++ help-toss
|
||||
(mold %get /help/tos ,~)
|
||||
::
|
||||
++ appl-rate
|
||||
(mold %get /application/rate-limit-status ,~)
|
||||
::
|
||||
++ stat-look
|
||||
(mold %get /statuses/lookup ,[us ~])
|
||||
--
|
||||
--
|
@ -32,11 +32,28 @@
|
||||
:: pax/(cu deft (su fel:stab))
|
||||
:: dat/(of json/some mime/(pe / (cu taco so)) ~) :: XX mite
|
||||
:: ==
|
||||
++ poke-wipe
|
||||
|= sup=spur ^+ abet :: XX determine extension, beak
|
||||
=+ ext=%md
|
||||
?~ (file (tope beak-now [ext sup]))
|
||||
~|(not-found/[ext `path`(flop sup)] !!)
|
||||
=- abet:(emit %info write/~ our -)
|
||||
(fray (tope beak-now [ext sup]))
|
||||
::
|
||||
++ poke-tree
|
||||
|= [sup=spur mim=mime] ^+ abet :: XX determine extension, beak
|
||||
(poke--data [`%md (flop sup)] %mime mim)
|
||||
::
|
||||
++ poke-paste
|
||||
|= [typ=?(%hoon %md %txt) txt=@t] ^+ abet
|
||||
(poke--data [`typ /web/paste/(scot %da now)] %mime / (taco txt))
|
||||
::
|
||||
++ poke-comment
|
||||
|= [pax=path txt=@t] ^+ abet
|
||||
=. pax [%web (welp pax /(scot %da now))]
|
||||
=. txt (rap 3 (scot %p src) ': ' txt ~)
|
||||
(poke--data [`%comment-md pax] %mime / (taco txt))
|
||||
::
|
||||
++ poke--data
|
||||
|= [[ext=(unit ,@t) pax=path] dat=data] ^+ abet
|
||||
?~ ext $(ext [~ -.dat])
|
||||
@ -48,8 +65,8 @@
|
||||
::
|
||||
++ made
|
||||
|= [pax=wire @ res=gage] ^+ abet
|
||||
?. =(our src)
|
||||
~|(foreign-write/[our=our src=src] !!)
|
||||
:: ?. =(our src)
|
||||
:: ~|(foreign-write/[our=our src=src] !!)
|
||||
?+ -.res ~|(gage/-.res !!)
|
||||
%| (mean p.res)
|
||||
%& =- abet:(emit %info write/~ our -)
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /hoon/octo-game/mar
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
|_ cod=[who=? box=@ boo=@] :: game state
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun ,[who=? box=@ boo=@] :: clam from %noun
|
||||
--
|
||||
--
|
@ -1,21 +0,0 @@
|
||||
:: this mark is used to receive a confirmed transaction
|
||||
::
|
||||
:::: /hoon/bit-accounts/mar
|
||||
::
|
||||
/? 310
|
||||
/- bit-api
|
||||
!:
|
||||
[bit-api .]
|
||||
|_ bit-accounts
|
||||
::
|
||||
++ grab :: converter arm
|
||||
|%
|
||||
++ noun bit-accounts :: clam from noun
|
||||
++ json |= jon=^json ^- bit-accounts
|
||||
~| jon
|
||||
%- need %. jon
|
||||
=> jo
|
||||
=+ bal=(ot amount/so currency/(cu cass sa) ~)
|
||||
(ot accounts/(ar (ot id/so name/so balance/bal ~)) ~)
|
||||
--
|
||||
--
|
@ -1,5 +0,0 @@
|
||||
|_ @t
|
||||
++ grab |%
|
||||
++ noun cord
|
||||
--
|
||||
--
|
@ -1,6 +0,0 @@
|
||||
|_ ~
|
||||
++ grab |%
|
||||
++ noun ,~
|
||||
--
|
||||
--
|
||||
|
@ -1,31 +0,0 @@
|
||||
::
|
||||
:::: /hoon/bit-api-call/mar
|
||||
::
|
||||
/? 314
|
||||
/- bit-api
|
||||
[bit-api .]
|
||||
|_ [access-token=@t req=bit-api-call]
|
||||
::
|
||||
++ wrap
|
||||
|= [end-point=path req=$|(%get [%post p=json])]
|
||||
[/com/coinbase/sandbox/api v1/end-point req ~ ['access_token' access-token]~]
|
||||
::
|
||||
++ order
|
||||
|= [amount=@t currency=@t] ^- json
|
||||
(jobe qty/s/amount ?~(currency ~ [currency/s/currency ~]))
|
||||
++ grow
|
||||
|% ++ httpreq
|
||||
%- wrap
|
||||
|-
|
||||
?- -.req
|
||||
%list [/accounts %get]
|
||||
%buy [/buys %post (order +.req)]
|
||||
%sell [/sells %post (order +.req)]
|
||||
%send $(req [%txt-send (rsh 3 2 (scot %uc adr.req)) btc.req])
|
||||
%txt-send
|
||||
:+ /transactions/'send_money' %post
|
||||
(joba %transaction (jobe to/s/to.req amount/s/btc.req ~))
|
||||
|
||||
==
|
||||
--
|
||||
--
|
@ -1,21 +0,0 @@
|
||||
::
|
||||
:::: /hoon/bit-get-token/mar
|
||||
::
|
||||
/? 314
|
||||
/- bit-api
|
||||
/+ http
|
||||
[bit-api .]
|
||||
|_ req=bit-get-token
|
||||
::
|
||||
++ grow
|
||||
|% ++ httpreq
|
||||
^- request:http
|
||||
=- [/com/coinbase/sandbox /oauth/token [%post ~] ~ `quay`-]
|
||||
:~ ['grant_type' 'authorization_code']
|
||||
['code' oat.req]
|
||||
['redirect_uri' (crip (earn red.req))]
|
||||
['client_id' cid.req]
|
||||
['client_secret' sec.req]
|
||||
==
|
||||
--
|
||||
--
|
@ -1,17 +0,0 @@
|
||||
:: this mark is used to receive a confirmed transaction
|
||||
::
|
||||
:::: /hoon/bit-transaction/mar
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
|_ id=@t ::XX time
|
||||
::
|
||||
++ grab :: converter arm
|
||||
|%
|
||||
++ noun ,@t :: clam from noun
|
||||
++ json |= jon=^json
|
||||
~| jon
|
||||
(need ((ot transaction/(ot id/so ~) ~):jo jon))
|
||||
--
|
||||
--
|
||||
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /hoon/term-line/mar
|
||||
::
|
||||
/? 314
|
||||
|_ txt=cord
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun ,@t :: clam from %noun
|
||||
++ json (cork so:jo need)
|
||||
--
|
||||
--
|
@ -1,16 +0,0 @@
|
||||
:: this mark is used to receive incoming oauth2 tokens that we use to poke our %gall server
|
||||
::
|
||||
:::: /hook/door/do-auth/mar
|
||||
::
|
||||
/? 310
|
||||
!:
|
||||
|_ cod=cord
|
||||
::
|
||||
++ grab :: converter arm
|
||||
|%
|
||||
++ noun ,@t :: clam from noun
|
||||
++ json (cork (ot authcode/so platform/so ~):jo need) :: (need (so:jo jon))
|
||||
--
|
||||
--
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
!:
|
||||
|_ cod=cord
|
||||
::
|
||||
++ grab :: converter am
|
||||
|%
|
||||
++ noun ,@t :: clam from noun
|
||||
++ json (cork (ot secret/so platform/so ~):jo need) :: (need (so:jo jon))
|
||||
--
|
||||
--
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/core/md/pro
|
||||
:::: /hoon/coffee/mar
|
||||
::
|
||||
/? 314
|
||||
|_ mud=@t
|
||||
|
6
mar/comment-md.hoon
Normal file
6
mar/comment-md.hoon
Normal file
@ -0,0 +1,6 @@
|
||||
::
|
||||
:::: /hoon/comment-md/mar
|
||||
::
|
||||
/? 314
|
||||
::
|
||||
// /===/mar/md :: alias
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/core/css/mar
|
||||
:::: /hoon/css/mar
|
||||
::
|
||||
|_ mud=@t
|
||||
++ grow :: convert to
|
||||
|
@ -1,5 +1,5 @@
|
||||
::
|
||||
:::: /hoon/dill-belt/mar
|
||||
:::: /hoon/belt/dill/mar
|
||||
::
|
||||
/? 314
|
||||
/- kyev,sole
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user