diff --git a/ape/ask.hoon b/ape/ask.hoon deleted file mode 100644 index d6953849c..000000000 --- a/ape/ask.hoon +++ /dev/null @@ -1,57 +0,0 @@ -:: -:::: /hoon+ask+ape - :: -/? 314 -/+ sole -[. sole] -|% - ++ card - $% {$diff $sole-effect sole-effect} - == --- -!: -|_ {bow/bowl adr/(set cord) sos/(map bone sole-share)} -++ peer-sole - |= path - ^- (quip {bone card} +>) - ~| [%not-in-whitelist src.bow] - ?> (~(has in (sa (limo ~zod our.bow ~talsur-todres ~))) src.bow) - :_ +>.$(sos (~(put by sos) ost.bow *sole-share)) - =- [(effect %mor pro+[& %$ ""] -)]~ - =+ all=adrs - [tan+(turn all message) (turn all put-mail)] -:: -++ adrs (sort (~(tap by adr)) aor) -++ effect |=(fec/sole-effect [ost.bow %diff %sole-effect fec]) -++ message |=(ask/@t leaf+"ask: {(trip ask)}") -++ put-mail |=(ask/@t =+(pax=(rash ask unix-path) [%sav pax ''])) -++ unix-path :: split into path of "name" and "extension" - ;~ (glue dot) - (cook crip (star ;~(less dot next))) - ;~(plug (cook crip (star next)) (easy ~)) - == -:: -++ poke-ask-mail - |= ask/@t - ^- (quip {bone card} +>) - ~| have-mail+ask - ?< (~(has in adr) ask) - :_ +>.$(adr (~(put in adr) ask)) - =+ [mez=[(message ask)]~ sav=(put-mail ask)] - %+ turn (prey /sole bow) - |=({ost/bone ^} (effect(ost.bow ost) %mor tan+mez sav ~)) -:: -++ poke-sole-action - |= act/sole-action - ^- (quip {bone card} +>) - ?- -.act - $clr `+>.$ - $ret [[(effect tan+(turn adrs message))]~ +>.$] :: re-print list - $det :: reject all input - =+ som=(~(got by sos) ost.bow) :: XX this code belongs in a library - =^ inv som (~(transceive sole som) +.act) - =^ det som (~(transmit sole som) inv) - =. sos (~(put by sos) ost.bow som) - [[(effect det+det)]~ +>.$] - == --- diff --git a/ape/bit.hoon b/ape/bit.hoon deleted file mode 100644 index dee970827..000000000 --- a/ape/bit.hoon +++ /dev/null @@ -1,220 +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.444 `/org+urbit+(crip +:)] - == -++ 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 {}") - '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 {}") - ::(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]] --- diff --git a/ape/cloud.hoon b/ape/cloud.hoon deleted file mode 100644 index b644549a6..000000000 --- a/ape/cloud.hoon +++ /dev/null @@ -1,691 +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 - == -++ image - $: plat/?($do $gce) - name/@t - id/@t - == -++ create-req-do - $: name/@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 - size/@t - image/@t - ssh-keys/(list cord) - backups/(unit ?) - ipv6+(unit ?) - private-networking/(unit ?) - user-data/(unit @t) - == - %- jobe - :~ name+s+name - size+s+size - image+s+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))) - snapshot+s+snapshot - == -++ 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 :: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -++ 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) - ~| receive-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 - 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 - 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 - ~| receive-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) - image+(ot name+so ~) - == - =. 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 +>.$]) --- diff --git a/ape/oct1.hoon b/ape/oct1.hoon deleted file mode 100644 index 559c3d8d5..000000000 --- a/ape/oct1.hoon +++ /dev/null @@ -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 --- diff --git a/ape/oct2.hoon b/ape/oct2.hoon deleted file mode 100644 index b839c8e8b..000000000 --- a/ape/oct2.hoon +++ /dev/null @@ -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 --- diff --git a/ape/oct3.hoon b/ape/oct3.hoon deleted file mode 100644 index 43c2d8275..000000000 --- a/ape/oct3.hoon +++ /dev/null @@ -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 --- diff --git a/ape/oct4.hoon b/ape/oct4.hoon deleted file mode 100644 index 28144dc62..000000000 --- a/ape/oct4.hoon +++ /dev/null @@ -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 --- diff --git a/ape/twif.hoon b/ape/twif.hoon deleted file mode 100644 index 6bc4e3f59..000000000 --- a/ape/twif.hoon +++ /dev/null @@ -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)))) --- diff --git a/ape/twit.hoon b/ape/twit.hoon deleted file mode 100644 index 510675e68..000000000 --- a/ape/twit.hoon +++ /dev/null @@ -1,221 +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 $~} :: 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 {}" (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:^talk our %twit now eny leaf+mes ~)] --- diff --git a/ape/work.hoon b/ape/work.hoon deleted file mode 100644 index 551594921..000000000 --- a/ape/work.hoon +++ /dev/null @@ -1,337 +0,0 @@ -:: -:::: - :: -/? 314 -/- work -/+ talk -!: -:::: - :: -[. work] -|% -++ move (pair bone card) :: all actions -++ card :: general card - $% {$diff $work-report client} :: - {$peer wire dock path} :: - {$poke wire dock pear} :: - == :: -++ pear :: poke fruit - $% {$talk-command command:talk} :: - == :: --- -!: -:::: - :: -|_ $: bowl - client - connected/? :: subscribed to talk - count/@ud :: / messages from talk - unordered/(map {@uvH @u} (pair ship flesh:work-stuff:talk)) - == -++ at - |= client-task - =| moves/(list move) - |% - ++ abet - ^- {(list move) _+>.$} - [(flop moves) +>.$(tasks (~(put by tasks) id.tax +<.$))] - :: - ++ abut - ^- {(list move) _+>.$} - [(flop moves) +>.$] - :: - ++ send-audience - |= {to/(set station:talk) action/duty:work-stuff:talk} - %_ +>.$ - eny (sham eny action) - moves - :_ moves - ^- move - :* ost %poke - /sending+(scot %uv id.tax)/(scot %ud version.tax) - [our %talk] - %talk-command - => [. talk] ^- command:talk - :- %publish - |- ^- (list thought) - :_ ~ - :+ (shaf %task eny) - %- mo ^- (list {partner envelope delivery}) - %+ turn (~(tap in to)) - |=(sat/station [[%& sat] [*envelope %pending]]) - [now *bouquet [%tax action]] - == - == - :: - ++ send - |= action/duty:work-stuff:talk - (send-audience audience action) - :: - ++ send-archive - |= to/(set station:talk) - (send-audience to %archive id.tax) - :: - ++ send-create (send %create tax) - ++ send-change |* * - ?: =(our creator.tax) - (send-update +(version.tax) our +<) - %+ send-audience - [[creator.tax (main:talk creator.tax)] ~ ~] - [%change id.tax +<] - ++ send-update |*(* (send %update id.tax +<)) - ++ process-update - |= up/update - ^+ +> - ?- -.up - $add ?>(?=($comment +<.up) (send-change %add-comment our +>.up)) - $doer - ?- +<.up - $release (send-change %set-doer ~) - $claim (send-change %set-doer `our) - == - :: - $set - ?- +<.up - $audience (process-audience to.up) - $date-due (send-change %set-date-due +>.up) - $title (send-change %set-title +>.up) - $description (send-change %set-description +>.up) - $tags (send-change %set-tags +>.up) - $done (send-change %set-done +>.up) - == - == - ++ process-audience - |= to/(set station:talk) - ^+ +> - =. +>.$ (send-archive (~(dif in audience) to)) - =. +>.$ (send-audience (~(dif in to) audience) %create tax) - +>.$(audience to) - -- -:: -++ prep - |= $= old - $_ - =< $ - %- unit - $: client - ? - @ud - (map {@uvH @u} (pair ship flesh:work-stuff:talk)) - == - ^- {(list move) _+>.$} - initialize(+<+ ?~(old +<+.+>.$ u.old)) -:: -++ initialize - ^- {(list move) _.} - ?: connected - [~ .] - :_ .(connected %&) :_ ~ - [ost %peer /peering [our %talk] /f+(main:talk our)/(scot %ud count)] -:: -++ process-duty - |= {when/@da her/ship from/(set station:talk) action/duty:work-stuff:talk} - ^- {(list move) _+>.$} - =- =^ mof con mirror-to-web:con - [(welp mof mos) con] - ^- {mos/(list move) con/_+>.$} - ?- -.action - $create - =+ existing-task=(~(get by tasks) id.tax.action) - ?: ?& ?=(^ existing-task) - !=(tax.action tax.u.existing-task) - !archived.u.existing-task - == - ~& :* %new-task-with-old-id - her=her - from=from - new-task=tax.action - existing-task=u.existing-task - == - [~ +>.$] - ?. =(her creator.tax.action) - ~& :* %created-with-bad-creator - her=her - from=from - new-task=tax.action - existing-task=existing-task - == - [~ +>.$] - =. tasks - %^ ~(put by tasks) id.tax.action | - :_ tax.action - ?~ existing-task from - (~(uni in audience.u.existing-task) from) - =. sort ?^(existing-task sort [id.tax.action sort]) - [~ +>.$] - :: - $archive - =+ tax=(~(get by tasks) id.action) - ?~ tax - ~& :* %archive-for-nonexistent-task - her=her - from=from - action=action - == - [~ +>.$] - ?: !=(her creator.tax.u.tax) - ~& :* %archiver-not-creator - her=her - from=from - action=action - tax=tax - == - [~ +>.$] - =. tasks - %+ ~(put by tasks) id.action - :* =(~ (~(dif in audience.u.tax) from)) - (~(dif in audience.u.tax) from) - tax.u.tax - == - [~ +>.$] - :: - $change - =+ tax=(~(get by tasks) id.action) - ?~ tax - ~& :* %change-for-nonexistent-task - her=her - from=from - action=action - == - [~ +>.$] - ?: !=(our creator.tax.u.tax) - ~& :* %me-not-creator - her=her - from=from - action=action - tax=tax - == - [~ +>.$] - abet:(send-update:(at u.tax) +(version.tax.u.tax) her meat.action) - :: - $update - =+ tax=(~(get by tasks) id.action) - ?~ tax - ~& :* %update-for-nonexistent-task - her=her - from=from - action=action - == - [~ +>.$] - ?: !=(her creator.tax.u.tax) - ~& :* %her-not-creator - her=her - from=from - action=action - tax=tax - == - [~ +>.$] - ?. =(version.action +(version.tax.u.tax)) - ~& :* %update-bad-version - her - from=from - action=action - tax=tax - == - ?: (lte version.action version.tax.u.tax) - ~& %really-bad-version - [~ +>.$] - :- ~ - %_ +>.$ - unordered - %+ ~(put by unordered) - [id.action version.action] - [her.action meat.action] - == - |- - =. tasks - %+ ~(put by tasks) id.action - :+ archived.u.tax - (~(uni in audience.u.tax) from) - =. version.tax.u.tax version.action - =. date-modified.tax.u.tax when - ?- -.meat.action - $set-doer tax.u.tax(doer her.meat.action) - $set-date-due tax.u.tax(date-due wen.meat.action) - $set-tags tax.u.tax(tags tag.meat.action) - $set-title tax.u.tax(title til.meat.action) - $set-description tax.u.tax(description des.meat.action) - $set-done tax.u.tax(done ?.(don.meat.action ~ `when)) - $add-comment - %= tax.u.tax - discussion [[when [who com]:meat.action] discussion.tax.u.tax] - == - == - =+ ooo=(~(get by unordered) id.action +(version.action)) - ?~ ooo - [~ +>.^$] - %= $ - version.action +(version.action) - her.action p.u.ooo - meat.action q.u.ooo - == - == -:: -++ mirror-to-web - ^- {(list move) _.} - ~& [%mirroring sort=(turn sort |=(a/@uv `@uv`(rsh 2 25 a)))] - :_ . - %+ murn (~(tap by sup)) - |= {ust/bone her/ship pax/path} - ^- (unit move) - ?:(?=({$sole *} pax) ~ `[ust full-report]) -:: -++ full-report [%diff %work-report tasks sort] -++ peer-repo |=(path [[ost full-report]~ +>.$]) -++ coup - |= {way/wire saw/(unit tang)} - ^- {(list move) _+>.$} - ?> ?=($~ saw) - [~ +>.$] -:: -++ quit-peering |=(way/wire ?>(?=($~ way) initialize(connected |))) -++ reap-peering - |= {way/wire saw/(unit tang)} - ^- {(list move) _+>.$} - ?> ?=({$~ $~} +<) - [~ +>.$] -:: -++ poke-work-command - |= cod/command - ?. =(our src) - ~|([%wrong-user our=our src=src] !!) - ?- -.cod - $sort mirror-to-web(sort p.cod) - $old - =^ mow +>.$ - =+ (at (~(got by tasks) id.cod)) - abet:(process-update:- dif.cod) - =^ mov +>.$ mirror-to-web - [(welp mov mow) +>.$] - $new - =. +>.cod +>.cod(date-created now, version 0, date-modified now) - abut:send-create:(at | +.cod) - == -:: -:: XX test the disconnection case -++ diff-talk-report - |= {way/wire rep/report:talk} - ^- {(list move) _+>.$} - ?> ?=($grams -.rep) - |- ^- {(list move) _+>.^$} - ?~ q.rep [~ +>.^$] - =. count +(count) - =* her p.i.q.rep - =* when p.r.q.i.q.rep - =* said r.r.q.i.q.rep - ?. ?=($tax -.said) - $(p.rep +(p.rep), q.rep t.q.rep) - =+ ^- from/(set station:talk) - %- sa ^- (list station:talk) - %+ murn (~(tap by q.q.i.q.rep)) - => talk - |= {par/partner *} - `(unit station)`?.(?=($& -.par) ~ `p.par) - =^ mos +>.^$ (process-duty when her from +.said) - =^ mof +>.^$ $(p.rep +(p.rep), q.rep t.q.rep) - [(weld mos mof) +>.^$] --- diff --git a/ape/write.hoon b/ape/write.hoon deleted file mode 100644 index 3b3c60032..000000000 --- a/ape/write.hoon +++ /dev/null @@ -1,36 +0,0 @@ -:: File writer -:: -:::: /hoon+write+app - :: -|_ {bowl $~} -++ beak-now byk(r [%da now]) -++ poke-json - |= jon/json - =- (poke--data (need (- jon.+))) - => jo - %- ot :~ - pax+(cu deft (su fel:stab)) - dat+(of json+some mime+(pe / (cu taco so)) ~) :: XX mite - == -:: -++ poke-write-paste - |= {typ/?($hoon $md $txt) txt/@t} - (poke--data [`typ /pub+paste+(scot %da now)] %mime / (taco txt)) -:: -++ poke--data - |= {{ext/(unit @t) pax/path} dat/$$({$json json} {$mime mime})} - ?~ ext $(ext [~ -.dat]) - =+ cay=?-(-.dat %json [-.dat !>(+.dat)], %mime [-.dat !>(+.dat)]) - ?: =(u.ext -.dat) (made pax ~ `cay) - [[ost %exec pax our ~ beak-now %cast u.ext `cay]~ +>.$] :: XX defer %nice -:: -++ made - |= {pax/wire @ res/gage} - ?. =(our src) - ~|(foreign-write+[our=our src=src] !!) - ?+ -.res ~|(gage+-.res !!) - $| (mean p.res) - $& =- [[ost %info / our -]~ +>.$] - (foal :(welp (tope beak-now ~) pax /[-.p.res]) p.res) - == --- diff --git a/arvo/jael.hoon b/arvo/jael.hoon deleted file mode 100644 index 785cc7f5f..000000000 --- a/arvo/jael.hoon +++ /dev/null @@ -1,146 +0,0 @@ -:: %jael, secret storage -:: -:::: /hoon+jael - :: -!? 164 -:::: -:: %jael is logically homogeneous, but please follow these conventions: -:: -:: /cap :: foreign app keys -:: /service :: service name, eg %face for FB -:: /appid :: your ship's app-id -:: /@uvH :: by hash -:: /@ud :: by number -:: /@tas :: by name -:: -:: /key :: foreign user secrets -:: /service :: service name, eg %face -:: /userid :: user identity -:: -:: /urb :: urbit secrets -:: /tok+hash - -|= pit=vase -=> =~ -:: structures -|% -++ axle :: %jael state - $: %0 :: %jael version - ent=@ :: entropy - sef=safe :: secret tree - red=(map duct (set path)) :: reverse subscribers - == :: -++ gift :: out result <-$ - $% [%dead p=path] :: key expired - [%live p=path q=@] :: key created - == :: -++ kiss :: in request ->$ - $% [%kill p=path] :: discard secret - [%make p=@uw q=(unit ,@da) r=@ud s=path] :: generate random - [%nuke ~] :: erase subscriber - [%tell p=@uw q=(unit ,@da) r=path] :: save secret - == :: -++ move ,[p=duct q=(mold note gift)] :: typed move -++ note :: out request $-> - $% $: %b :: to %behn - $% [%wait p=@da] :: - [%rest p=@da] :: - == == == :: -++ perm (pair ,@ud (list ,@ud)) :: prime definition -++ safe :: - $: nub=(unit ,@uw) :: secret - dex=(unit ,@da) :: expiration - sud=(set duct) :: subscribers - kin=(map term safe) :: children - == :: --- :: -:: programs -|% -++ bu - |_ $: xap=path - fes=(list safe) - moz=(list move) - == - axle - :: - ++ bu-abet :: resolve - ^- axle - ?~ xap +<+ - %= bu-abet - xap t.xap - fes t.fes - sef %= i.fes - kin - ?: =(*safe sef) - (~(del by kin.i.fes) i.xap) - (~(put by kin.i.fes) i.xap sef) - == - == - :: - ++ bu-kill :: destroy - ^+ . - =+ dus=(~(tap by - - :: - ++ bu-ajar :: descend - |= pax=path - ^+ +> - ?~ pax +>.$ - %= $ - pax t.pax - xap [i.pax xap] - fes [sef fes] - sef (fall (~(get by kin.sef) i.pax) *safe) - == - -- -++ bury - |= [pax=path lex=axle] - (~(bu-ajar bu [~ ~ ~] tof.lex lex) pax) --- -. == -=| axle -|= [now=@da eny=@ ski=sled] :: activate -^? :: opaque core -|% :: -++ call :: request - |= [hen=duct hic=(hypo (hobo kiss))] - ^- [p=(list move) q=_..^$] - => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) - =^ moz +>+>- - =< bu-abet - ?- -.p.q.hic - %kill - kill:(bury p.p.q.hic +>+>-) - :: - %make - %nuke - %tell - == -:: -++ doze - |= [now=@da hen=duct] - ^- (unit ,@da) - ~ -:: -++ load :: highly forgiving - |= old=* - =+ lox=((soft axle) old) - ^+ ..^$ - ?~ lox - ~& %jael-reset - ..^$ - ..^$(+>- u.lox) -:: -++ scry - |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] - ^- (unit (unit (pair mark ,*))) - :: actually scry - ~ -:: -++ stay :: save w+o cache - `axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~]))) -:: -++ take :: response - |= [tea=wire hen=duct hin=(hypo noun)] - !! --- diff --git a/arvo/kahn.hoon b/arvo/kahn.hoon deleted file mode 100644 index d8d39b791..000000000 --- a/arvo/kahn.hoon +++ /dev/null @@ -1,103 +0,0 @@ -:: %kahn, social state -:: -:::: /hoon+kahn - :: -!? 164 -:::: -|= pit=vase -=> =~ -:: structures -|% -++ axle :: %kahn state - $: %0 :: - soc=(map monk node) :: social graph - red=(map duct (set monk)) :: reverse subscribers - == :: -++ cert (each will ,*) :: urbit or other -++ gift :: out result <-$ - $: [%then p=node] :: propagate change - == :: -++ node :: social identity - $: tin=(map monk link) :: inbound links - oud=(map monk link) :: outbound links - cet=cert :: certificate - sud=(set duct) :: subscribers - == :: -++ khan ,[p=@tas q=@ta] :: foreign identity -++ kiss :: social update - $: [%cert p=monk q=cert] :: set certificate - [%hear p=monk] :: watch identity - [%know p=monk q=(map monk link)] :: set forward links - [%nuke ~] :: erase subscriber - == :: -++ link (pair rank ,@da) :: trust+expiration -++ monk (each ship khan) :: general identity -++ rank :: privilege ring - $? %0 :: complete trust - %1 :: structural trust - %2 :: social trust - %3 :: neutral trust - %4 :: negative trust - == :: --- :: -. == -=| axle -=* lex - -|= [now=@da eny=@ ski=sled] :: activate -^? :: opaque core -|% :: -++ call :: request - |= [hen=duct hic=(hypo (hobo kiss))] - ^- [p=(list move) q=_..^$] - => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) - !! -:: -++ doze - |= [now=@da hen=duct] - ^- (unit ,@da) - ~ -:: -++ load :: highly forgiving - |= old=* - =+ lox=((soft axle) old) - ^+ ..^$ - ?~ lox - ~& %khan-reset - ..^$ - ..^$(+>- u.lox) -:: -++ scry - |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] - ^- (unit (unit (pair mark ,*))) - ?. =(big [~ who]) ~ - =+ ^= yub ^- [(unit monk) - ?: =(%urb syd) - ?. ?=([* ~] tyl) ~ - =+ goy=(slaw %p - - ?+ ?=([%$ %da @] - ?+ lot ~ - [%$ %ud @] - %+ bind - (perm who u.hun q.p.lot [syd t.tyl]) - |=(a=* [%noun a]) - :: - ?. =(now q.p.lot) ~ - %+ bind - (temp who u.hun [syd t.tyl]) - |=(a=* [%noun a]) - == - ?. ?=([%da - =+ mok ^- (unit monk) - ?: =(%urb face) - ( - -:: -++ stay :: save w+o cache - `axle`+>-.$ -:: -++ take :: response - |= [tea=wire hen=duct hin=(hypo noun)] - !! --- - diff --git a/arvo/lunt.hoon b/arvo/lunt.hoon deleted file mode 100644 index d76d1837d..000000000 --- a/arvo/lunt.hoon +++ /dev/null @@ -1,104 +0,0 @@ -:: %lunt, fleet job control -:: -:::: /hoon+lunt - :: -!? 164 -:::: -|= pit=vase -=> =~ -:: structures -|% -++ axle :: %lunt state - $: %0 :: - all=(map ship axil) :: state by owner - == :: -++ born ,[p=brat q=(unit ship)] :: task identity -++ brat ,@ud :: task number -++ bulb :: - $: p=@p :: ship identity - q=home :: server data - == :: -++ home :: storage access - $: pad=@uvH :: passcode - huc=husk :: log server - sog=hulk :: storage server - == :: -++ hulk :: checkpoint service - $% [%astr p=@ud q=@ud] :: S3 - == :: -++ husk :: log server - $: pro=@tas :: protocol - cap=@uvH :: access code - srv=(list (pair ,@ud clip)) :: server cluster - == :: -++ gift :: result - $: [%die p=brat] :: kill - [%int p=brat] :: interrupt - [%run p=brat q=@p r=home] :: load - [%say p=brat q=(list ovum)] :: send events - [%new p=brat q=@p r=home s=(list ovum)] :: create - == :: -++ kiss :: request - $: [%com p=@p] :: toggle compute svr - [%end p=brat] :: local end - [%fan p=@ud] :: set local fanout - [%kil ~] :: terminate ship - [%int ~] :: interrupt ship - [%new p=@p q=(set ,@p) q=home r=@uvI] :: create ship - [%run p=@p q=home] :: run existing ship - [%say p=(list ovum)] :: remote events - [%sto p=husk] :: toggle logger - == :: -++ axil :: - $: bus=(unit ,@p) :: master - loc=@ud :: local resources - hen=(unit duct) :: effect duct - ent=@ :: entropy - seq=@ :: brat sequence - why=(map duct born) :: hosted ships - how=(map born duct) :: reverse why - hut=(map born home) :: storage control - ham=(set hulk) :: block stores - sto=(set husk) :: log stores - com=(set ship) :: compute resources - == :: --- :: -. == -=| axle -=* lex - -|= [now=@da eny=@ ski=sled] :: activate -^? :: opaque core -|% :: -++ call :: request - |= [hen=duct hic=(hypo (hobo kiss))] - ^- [p=(list move) q=_..^$] - => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) - !! -:: -++ doze - |= [now=@da hen=duct] - ^- (unit ,@da) - ~ -:: -++ load :: highly forgiving - |= old=* - =+ lox=((soft axle) old) - ^+ ..^$ - ?~ lox - ~& %lunt-reset - ..^$ - ..^$(+>- u.lox) -:: -++ scry - |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] - ^- (unit (unit (pair mark ,*))) - ~ -:: -++ stay :: save w+o cache - `axle`+>-.$ -:: -++ take :: response - |= [tea=wire hen=duct hin=(hypo noun)] - !! --- - diff --git a/arvo/musk.hoon b/arvo/musk.hoon deleted file mode 100644 index a8187eb66..000000000 --- a/arvo/musk.hoon +++ /dev/null @@ -1,94 +0,0 @@ -:: %musk, realm management -:: -:::: /hoon+musk - :: -!? 164 -:::: -|= pit=vase -=> =~ -:: structures -|% -++ axle :: %musk state - $: %0 :: - all=(map ship axil) :: state by owner - == :: -++ axil :: - $: kid=(map ship girl) :: daughters - deq=(map narc ship) :: reverse address - siq=(map ship (list clan)) :: ship to clans - kes=(map clan (list ship)) :: clan to ships - == :: -++ clan ,@tas :: group identity -++ narc :: contact address - $: [%$ p=ship] :: urbit - [%m p=@t q=@t] :: email p@q - [%f p=@t] :: facebook - [%g p=@t] :: google - [%p p=@t] :: phone message - [%t p=@t] :: twitter - == :: -++ pony :: daughter status - $% [%cold ~] :: virginal - [%dead ~] :: written off - [%fake ~] :: virtual - [%free ~] :: downloaded - [%here ~] :: hosted - [%left p=(unit ship)] :: run away to - == :: -++ rank :: relative privilege - $? %0 :: enemy - %1 :: neighbor - %2 :: guest+customer - %3 :: friend+employee - %4 :: officer+family - %5 :: self+admin - == :: -++ girl :: - $: hop=pony :: status - tag=(unit ,@tas) :: petname - tip=rank :: rank - fig=(set narc) :: identities - loc=(unit ,[p=@da q=@ud r=clip]) :: last position - sym=(set ,[p=@ q=@uvH]) :: symmetric keys? - wyl=will :: crypto will - == :: --- :: -. == -=| axle -=* lex - -|= [now=@da eny=@ ski=sled] :: activate -^? :: opaque core -|% :: -++ call :: request - |= [hen=duct hic=(hypo (hobo kiss))] - ^- [p=(list move) q=_..^$] - => .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic))) - !! -:: -++ doze - |= [now=@da hen=duct] - ^- (unit ,@da) - ~ -:: -++ load :: highly forgiving - |= old=* - =+ lox=((soft axle) old) - ^+ ..^$ - ?~ lox - ~& %lunt-reset - ..^$ - ..^$(+>- u.lox) -:: -++ scry - |= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path] - ^- (unit (unit (pair mark ,*))) - ~ -:: -++ stay :: save w+o cache - `axle`+>-.$ -:: -++ take :: response - |= [tea=wire hen=duct hin=(hypo noun)] - !! --- - diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon deleted file mode 100644 index dd75fa480..000000000 --- a/arvo/zuse.hoon +++ /dev/null @@ -1,2341 +0,0 @@ -:: -:: zuse (3), standard library (tang) -:: -~% %zuse + ~ -!: -|% - :::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:::: chapter 3b, Arvo libraries :::: -:: :::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bA, lite number theory :: -:: -++ dope - ~/ %dope - |= a/@ - ~& [%dope-zuse (mug +>)] - :(mul a a a) -:: -++ fu :: modulo (mul p q) - |= a/{p/@ q/@} - =+ b=?:(=([0 0] a) 0 (~(inv fo p.a) (~(sit fo p.a) q.a))) - |% - ++ dif - |= {c/{@ @} d/{@ @}} - [(~(dif fo p.a) -.c -.d) (~(dif fo q.a) +.c +.d)] - :: - ++ exp - |= {c/@ d/{@ @}} - :- (~(exp fo p.a) (mod c (dec p.a)) -.d) - (~(exp fo q.a) (mod c (dec q.a)) +.d) - :: - ++ out :: garner's formula - |= c/{@ @} - %+ add - +.c - (mul q.a (~(pro fo p.a) b (~(dif fo p.a) -.c (~(sit fo p.a) +.c)))) - :: - ++ pro - |= {c/{@ @} d/{@ @}} - [(~(pro fo p.a) -.c -.d) (~(pro fo q.a) +.c +.d)] - :: - ++ sum - |= {c/{@ @} d/{@ @}} - [(~(sum fo p.a) -.c -.d) (~(sum fo q.a) +.c +.d)] - :: - ++ sit - |= c/@ - [(mod c p.a) (mod c q.a)] - -- -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bB, cryptosuites :: -:: -++ crua !: :: cryptosuite A (RSA) - ^- acru - =| {mos/@ pon/(unit {p/@ q/@ r/{p/@ q/@} s/_*fu})} - => |% - ++ mx (dec (met 0 mos)) :: bit length - ++ dap :: OEAP decode - |= {wid/@ xar/@ dog/@} ^- {p/@ q/@} - =+ pav=(sub wid xar) - =+ qoy=(cut 0 [xar pav] dog) - =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy)) - [dez (mix qoy (shaw %pad-a pav dez))] - :: - ++ pad :: OEAP encode - |= {wid/@ rax/{p/@ q/@} meg/@} ^- @ - =+ pav=(sub wid p.rax) - ?> (gte pav (met 0 meg)) - ^- @ - =+ qoy=(mix meg (shaw %pad-a pav q.rax)) - =+ dez=(mix q.rax (shaw %pad-b p.rax qoy)) - (can 0 [p.rax dez] [pav qoy] ~) - :: - ++ pull |=(a/@ (~(exp fo mos) 3 a)) - ++ push |=(a/@ (~(exp fo mos) 5 a)) - ++ pump - |= a/@ ^- @ - ?~ pon !! - (out.s.u.pon (exp.s.u.pon p.r.u.pon (sit.s.u.pon a))) - :: - ++ punt - |= a/@ ^- @ - ?~ pon !! - (out.s.u.pon (exp.s.u.pon q.r.u.pon (sit.s.u.pon a))) - -- - |% - ++ as - => |% - ++ haul :: revealing haul - |= a/pass - =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)] - ?> =('a' mag) - ..as(mos bod, pon ~) - -- - ^? - |% ++ seal - |= {a/pass b/@ c/@} - ^- @ - => .(c (sign b c)) - =+ her=(haul a) - =+ det=(lte (add 256 (met 0 c)) mx.her) - =+ lip=?:(det c 0) - =- (add ?:(p.mav 0 1) (lsh 0 1 q.mav)) - ^= mav ^- {p/? q/@} - :- det - =+ dog=(pad mx.her [256 b] lip) - =+ hog=(push.her dog) - =+ ben=(en b c) - ?:(det hog (jam hog ben)) - ++ sign - |= {a/@ b/@} ^- @ - =- (add ?:(p.mav 0 1) (lsh 0 1 q.mav)) - ^= mav ^- {p/? q/@} - =+ det=(lte (add 128 (met 0 b)) mx) - :- det - =+ hec=(shaf (mix %agis a) b) - =+ dog=(pad mx [128 hec] ?:(det b 0)) - =+ hog=(pump dog) - ?:(det hog (jam hog b)) - ++ sure - |= {a/@ b/@} - ^- (unit @) - =+ [det==(0 (end 0 1 b)) bod=(rsh 0 1 b)] - =+ gox=?:(det [p=bod q=0] ((hard {p/@ q/@}) (cue bod))) - =+ dog=(pull p.gox) - =+ pig=(dap mx 128 dog) - =+ log=?:(det q.pig q.gox) - ?.(=(p.pig (shaf (mix %agis a) log)) ~ [~ log]) - ++ tear - |= {a/pass b/@} - ^- (unit {p/@ q/@}) - =+ her=(haul a) - =+ [det==(0 (end 0 1 b)) bod=(rsh 0 1 b)] - =+ gox=?:(det [p=bod q=0] ((hard {p/@ q/@}) (cue bod))) - =+ dog=(punt p.gox) - =+ pig=(dap mx 256 dog) - =+ ^= cow - ^- (unit @) - ?: det - [~ q.pig] - (de p.pig q.gox) - ?~ cow ~ - => .(cow (sure:as.her p.pig u.cow)) - ?~ cow ~ - [~ p.pig u.cow] - -- - :: - ++ de - |+ {key/@ cep/@} ^- (unit @) - =+ toh=(met 8 cep) - ?: (lth toh 2) - ~ - =+ adj=(dec toh) - =+ [hax=(end 8 1 cep) bod=(rsh 8 1 cep)] - =+ msg=(mix (~(raw og (mix hax key)) (mul 256 adj)) bod) - ?. =(hax (shax (mix key (shax (mix adj msg))))) - ~ - [~ msg] - :: - ++ dy |+({a/@ b/@} (need (de a b))) - ++ en - |+ {key/@ msg/@} ^- @ux - =+ len=(met 8 msg) - =+ adj=?:(=(0 len) 1 len) - =+ hax=(shax (mix key (shax (mix adj msg)))) - (rap 8 hax (mix msg (~(raw og (mix hax key)) (mul 256 adj))) ~) - :: - ++ ex ^? - |% ++ fig ^- @uvH (shaf %afig mos) - ++ pac ^- @uvG (end 6 1 (shaf %acod sec)) - ++ pub ^- pass (cat 3 'a' mos) - ++ sec ^- ring ?~(pon !! (cat 3 'A' (jam p.u.pon q.u.pon))) - -- - :: - ++ nu - => |% - ++ elcm - |= {a/@ b/@} - (div (mul a b) d:(egcd a b)) - :: - ++ eldm - |= {a/@ b/@ c/@} - (~(inv fo (elcm (dec b) (dec c))) a) - :: - ++ ersa - |= {a/@ b/@} - [a b [(eldm 3 a b) (eldm 5 a b)] (fu a b)] - -- - ^? - |% ++ com - |= a/@ - ^+ ^?(..nu) - ..nu(mos a, pon ~) - :: - ++ pit - |= {a/@ b/@} - =+ c=(rsh 0 1 a) - =+ [d=(ramp c [3 5 ~] b) e=(ramp c [3 5 ~] +(b))] - ^+ ^?(..nu) - ..nu(mos (mul d e), pon [~ (ersa d e)]) - :: - ++ nol - |= a/@ - ^+ ^?(..nu) - =+ b=((hard {p/@ q/@}) (cue a)) - ..nu(mos (mul p.b q.b), pon [~ (ersa p.b q.b)]) - -- - -- -++ bruw :: create keypair - |= {a/@ b/@} :: width seed - ^- acru - (pit:nu:crua a b) -:: -++ haul :: activate public key - |= a/pass - ^- acru - =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)] - ?> =('a' mag) - (com:nu:crua bod) -:: -++ weur :: activate secret key - |= a/ring - ^- acru - =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)] - ?> =('A' mag) - (nol:nu:crua bod) -:: -++ trua :: test rsa - |= msg/@tas - ^- @ - =+ ali=(bruw 1.024 (shax 'ali')) - =+ bob=(bruw 1.024 (shax 'bob')) - =+ tef=(sign:as.ali [0 msg]) - =+ lov=(sure:as.ali [0 tef]) - ?. &(?=(^ lov) =(msg u.lov)) - ~|(%test-fail-sign !!) - =+ key=(shax (shax (shax msg))) - =+ sax=(seal:as.ali pub:ex.bob key msg) - =+ tin=(tear:as.bob pub:ex.ali sax) - ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin)) - ~|(%test-fail-seal !!) - msg -:: -++ crub :: cryptosuite B (Ed) - ^- acru - =| {puc/pass sed/ring} - => |% - ++ dap :: OEAP decode - |= {wid/@ xar/@ dog/@} ^- {p/@ q/@} - =+ pav=(sub wid xar) - =+ qoy=(cut 0 [xar pav] dog) - =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy)) - [dez (mix qoy (shaw %pad-a pav dez))] - :: - ++ pad :: OEAP encode - |= {wid/@ rax/{p/@ q/@} meg/@} ^- @ - =+ pav=(sub wid p.rax) - ?> (gte pav (met 0 meg)) - ^- @ - =+ qoy=(mix meg (shaw %pad-a pav q.rax)) - =+ dez=(mix q.rax (shaw %pad-b p.rax qoy)) - (can 0 [p.rax dez] [pav qoy] ~) - -- - |% - ++ as - => |% - ++ haul :: revealing haul - |= a/pass - !! - -- - ^? - |% ++ seal - |= {a/pass b/@ c/@} - ^- @ - !! - ++ sign - |= {a/@ b/@} ^- @ - !! - ++ sure - |= {a/@ b/@} - ^- (unit @) - !! - ++ tear - |= {a/pass b/@} - ^- (unit {p/@ q/@}) - !! - -- - :: - ++ de - |+ {key/@ cep/@} ^- (unit @) - !! - :: - ++ dy - |+ {a/@ b/@} ^- @ - !! - ++ en - |+ {key/@ msg/@} ^- @ux - !! - :: - ++ ex ^? - |% ++ fig ^- @uvH (shaf %bfig puc) - ++ pac ^- @uvG (end 6 1 (shaf %acod sec)) - ++ pub ^- pass (cat 3 'b' puc) - ++ sec ^- ring sed - -- - :: - ++ nu - ^? - |% ++ com - |= a/@ - ^+ ^?(..nu) - ..nu(sed ~, puc a) - :: - ++ pit - |= {a/@ b/@} - ^+ ^?(..nu) - ..nu(sed b, puc (puck:ed b)) - :: - ++ nol - |= a/@ - ^+ ^?(..nu) - ..nu(sed a, puc (puck:ed a)) - -- - -- -++ brew :: create keypair - |= {a/@ b/@} :: width seed - ^- acru - (pit:nu:crub a b) -:: -++ hail :: activate public key - |= a/pass - ^- acru - =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)] - ?> =('b' mag) - (com:nu:crub bod) -:: -++ wear :: activate secret key - |= a/ring - ^- acru - =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)] - ?> =('b' mag) - (nol:nu:crub bod) -:: -++ trub :: test ed - |= msg/@tas - ^- @ - =+ ali=(brew 1.024 (shax 'ali')) - =+ bob=(brew 1.024 (shax 'bob')) - =+ tef=(sign:as.ali [0 msg]) - =+ lov=(sure:as.ali [0 tef]) - ?. &(?=(^ lov) =(msg u.lov)) - ~|(%test-fail-sign !!) - =+ key=(shax (shax (shax msg))) - =+ sax=(seal:as.ali pub:ex.bob key msg) - =+ tin=(tear:as.bob pub:ex.ali sax) - ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin)) - ~|(%test-fail-seal !!) - msg -:: -++ hmac :: HMAC-SHA1 - |= {key/@ mes/@} - =+ ip=(fil 3 64 0x36) - =+ op=(fil 3 64 0x5c) - =+ ^= kex - ?: (gth (met 3 key) 64) - (lsh 3 44 (shan (swap 3 key))) - (lsh 3 (sub 64 (met 3 key)) (swap 3 key)) - =+ inn=(shan (swap 3 (cat 3 (swap 3 mes) (mix ip kex)))) - (shan (swap 3 (cat 3 inn (mix op kex)))) -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bC, UTC :: Gregorian only -:: -++ dawn :: Jan 1 weekday - |= yer/@ud - =+ yet=(sub yer 1) - %- mod :_ 7 - :(add 1 (mul 5 (mod yet 4)) (mul 4 (mod yet 100)) (mul 6 (mod yet 400))) -:: -++ daws :: date weekday - |= yed/date - %- mod :_ 7 - (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1))) -:: -++ deal :: to leap sec time - |= yer/@da - =+ n=0 - =+ yud=(yore yer) - |- ^- date - ?: (gte yer (add (snag n lef:yu) ~s1)) - (yore (year yud(s.t (add n s.t.yud)))) - ?: &((gte yer (snag n lef:yu)) (lth yer (add (snag n lef:yu) ~s1))) - yud(s.t (add +(n) s.t.yud)) - ?: =(+(n) (lent lef:yu)) - (yore (year yud(s.t (add +(n) s.t.yud)))) - $(n +(n)) -:: -++ lead :: from leap sec time - |= ley/date - =+ ler=(year ley) - =+ n=0 - |- ^- @da - =+ led=(sub ler (mul n ~s1)) - ?: (gte ler (add (snag n les:yu) ~s1)) - led - ?: &((gte ler (snag n les:yu)) (lth ler (add (snag n les:yu) ~s1))) - ?: =(s.t.ley 60) - (sub led ~s1) - led - ?: =(+(n) (lent les:yu)) - (sub led ~s1) - $(n +(n)) -:: -++ dust :: print UTC format - |= yed/date - ^- tape - =+ wey=(daws yed) - ;: weld - `tape`(snag wey (turn wik:yu |=(a/tape (scag 3 a)))) - ", " ~(rud at d.t.yed) " " - `tape`(snag (dec m.yed) (turn mon:yu |=(a/tape (scag 3 a)))) - " " (scag 1 ~(rud at y.yed)) (slag 2 ~(rud at y.yed)) " " - ~(rud at h.t.yed) ":" ~(rud at m.t.yed) ":" ~(rud at s.t.yed) - " " "+0000" - == -:: -++ stud !: :: parse UTC format - =< |= a/cord :: expose parsers - %+ biff (rush a (more sepa elem)) - |= b/(list _(wonk *elem)) ^- (unit date) - =- ?.((za:jo -) ~ (some (zp:jo -))) - ^+ =+ [*date u=unit] - *{(u _[a y]) (u _m) (u _d.t) (u _+.t) $~} - :~ :: XX types - |-(?~(b ~ ?.(?=($y -.i.b) $(b t.b) `+.i.b))) - |-(?~(b ~ ?.(?=($m -.i.b) $(b t.b) `+.i.b))) - |-(?~(b ~ ?.(?=($d -.i.b) $(b t.b) `+.i.b))) - |-(?~(b ~ ?.(?=($t -.i.b) $(b t.b) `+.i.b))) - == - |% - :: - ++ snug - |= a/wall - |= b/tape - =+ [pos=1 len=(lent b)] - |- ^- (unit @u) - ?~ a ~ - ?: =(b (scag len i.a)) - `pos - $(pos +(pos), a t.a) - :: - :: - ++ sepa ;~(pose ;~(plug com (star ace)) (plus ace)) - ++ elem - ;~ pose - (stag %t t) (stag %y y) (stag %m m) (stag %d d) - (stag %w w) (stag %z z) - == - :: - ++ y (stag %& (bass 10 (stun 3^4 dit))) - ++ m (sear (snug mon:yu) (plus alf)) - ++ d (bass 10 (stun 1^2 dit)) - ++ t [;~(plug - - + (easy ~))]:[;~(sfix d col) d] - ++ w (sear (snug wik:yu) (plus alf)) - ++ z [;~(plug (mask "-+") . .)]:(bass 10 (stun 2^2 dit)) - -- -:: -++ unt :: UGT to UTC time - |= a/@ - (div (sub a ~1970.1.1) ~s1) -:: -++ yu :: UTC format constants - |% - ++ mon ^- (list tape) - :~ "January" "February" "March" "April" "May" "June" "July" - "August" "September" "October" "November" "December" - == - :: - ++ wik ^- (list tape) - :~ "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" - "Friday" "Saturday" - == - :: - ++ les ^- (list @da) - :~ ~2015.7.1 ~2012.7.1 ~2009.1.1 ~2006.1.1 ~1999.1.1 ~1997.7.1 - ~1996.1.1 ~1994.7.1 ~1993.7.1 ~1992.7.1 ~1991.1.1 ~1990.1.1 - ~1988.1.1 ~1985.7.1 ~1983.7.1 ~1982.7.1 ~1981.7.1 ~1980.1.1 - ~1979.1.1 ~1978.1.1 ~1977.1.1 ~1976.1.1 ~1975.1.1 ~1974.1.1 - ~1973.1.1 ~1972.7.1 - == - ++ lef ^- (list @da) - :~ ~2015.6.30..23.59.59 ~2012.6.30..23.59.59 - ~2008.12.31..23.59.58 ~2005.12.31..23.59.57 - ~1998.12.31..23.59.56 ~1997.6.30..23.59.55 - ~1995.12.31..23.59.54 ~1994.6.30..23.59.53 - ~1993.6.30..23.59.52 ~1992.6.30..23.59.51 - ~1990.12.31..23.59.50 ~1989.12.31..23.59.49 - ~1987.12.31..23.59.48 ~1985.6.30..23.59.47 - ~1983.6.30..23.59.46 ~1982.6.30..23.59.45 - ~1981.6.30..23.59.44 ~1979.12.31..23.59.43 - ~1978.12.31..23.59.42 ~1977.12.31..23.59.41 - ~1976.12.31..23.59.40 ~1975.12.31..23.59.39 - ~1974.12.31..23.59.38 ~1973.12.31..23.59.37 - ~1972.12.31..23.59.36 ~1972.6.30..23.59.35 - == - -- -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bD, JSON and XML :: -:: -++ moon :: mime type to text - |= myn/mite - %- crip - |- ^- tape - ?~ myn ~ - ?: =(~ t.myn) (trip i.myn) - (weld (trip i.myn) `tape`['/' $(myn t.myn)]) -:: -++ perk :: pars cube fork - |* a/(pole @tas) - ?~ a fail - ;~ pose - (cold -.a (jest -.a)) - $(a +.a) - == -:: -++ poja :: parse JSON - =< |=(a/cord `(unit json)`(rush a apex)) - |% - ++ apex :: JSON value - %+ knee *json |. ~+ - %+ ifix [spac spac] - ;~ pose - (cold ~ (jest 'null')) - (stag %b bool) - (stag %s stri) - (cook |=(s/tape [%n p=(rap 3 s)]) numb) - abox - obox - == - ++ tops ;~(pose abox obox) :: JSON strict - :: JSON arrays - ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) apex))) - :: JSON objects - ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) apex) - ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair)) - ++ obox (stag %o (cook mo obje)) - :: JSON booleans - ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false'))) - :: JSON strings - ++ stri (cook crip (ifix [doq doq] (star jcha))) - ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string - ++ esca :: Escaped character - ;~ pfix bas - ;~ pose - doq fas soq bas - (sear ~(get by `(map @t @)`(mo b+8 t+9 n+10 f+12 r+13 ~)) low) - ;~(pfix (just 'u') (cook tuft qix:ab)) :: 4-digit hex to UTF-8 - == - == - :: JSON numbers - ++ numb - ;~ (comp twel) - (mayb (piec hep)) - ;~ pose - (piec (just '0')) - ;~(plug (shim '1' '9') digs) - == - (mayb frac) - (mayb expo) - == - ++ digs (star (shim '0' '9')) - ++ expo :: Exponent part - ;~ (comp twel) - (piec (mask "eE")) - (mayb (piec (mask "+-"))) - digs - == - ++ frac ;~(plug dot digs) :: Fractional part - :: whitespace - ++ spac (star (mask [`@`9 `@`10 `@`13 ' ' ~])) - ++ ws |*(sef/rule ;~(pfix spac sef)) - :: plumbing - ++ mayb |*(bus/rule ;~(pose bus (easy ""))) - ++ twel |=({a/tape b/tape} (weld a b)) - ++ piec - |* bus/rule - (cook |=(a/@ [a ~]) bus) - -- -:: -++ pojo :: print json - =| rez/tape - |= val/json - ^- tape - ?~ val (weld "null" rez) - ?- -.val - $a - :- '[' - =. rez [']' rez] - !. - ?~ p.val rez - |- - ?~ t.p.val ^$(val i.p.val) - ^$(val i.p.val, rez [',' $(p.val t.p.val)]) - :: - $b (weld ?:(p.val "true" "false") rez) - $n (weld (trip p.val) rez) - $s - :- '"' - =. rez ['"' rez] - =+ viz=(trip p.val) - !. - |- ^- tape - ?~ viz rez - =+ hed=(jesc i.viz) - ?: ?=({@ $~} hed) :: common case - [i.hed $(viz t.viz)] :: cons-and-tail - (weld hed $(viz t.viz)) - :: - $o - :- '{' - =. rez ['}' rez] - =+ viz=(~(tap by p.val)) - ?~ viz rez - !. - |- ^+ rez - ?~ t.viz ^$(val [%s p.i.viz], rez [':' ^$(val q.i.viz)]) - =. rez [',' $(viz t.viz)] - ^$(val [%s p.i.viz], rez [':' ^$(val q.i.viz)]) - == -:: -++ poxo :: node to tape - =< |=(a/manx `tape`(apex a ~)) - |_ _[unq=`?`| cot=`?`|] :: self-close all tags - ++ apex :: top level - |= {mex/manx rez/tape} - ^- tape - ?: ?=({$$ {{$$ *} $~}} g.mex) - (escp v.i.a.g.mex rez) - =+ man=`mane`n.g.mex - =. unq |(unq =(%script man) =(%style man)) - =+ tam=(name man) - =+ att=`mart`a.g.mex - :- '<' - %+ welp tam - =- ?~(att rez [' ' (attr att rez)]) - ^- rez/tape - ?: &(?=($~ c.mex) |(cot (clot man))) - [' ' '/' '>' rez] - :- '>' - (many c.mex :(weld "" rez)) - :: - ++ attr :: attributes to tape - |= {tat/mart rez/tape} - ^- tape - ?~ tat rez - =. rez $(tat t.tat) - ;: weld - (name n.i.tat) - "=\"" - (escp(unq |) v.i.tat '"' ?~(t.tat rez [' ' rez])) - == - :: - ++ escp :: escape for xml - |= {tex/tape rez/tape} - ?: unq - (weld tex rez) - =+ xet=`tape`(flop tex) - !. - |- ^- tape - ?~ xet rez - %= $ - xet t.xet - rez ?- i.xet - $34 ['&' 'q' 'u' 'o' 't' ';' rez] - $38 ['&' 'a' 'm' 'p' ';' rez] - $39 ['&' '#' '3' '9' ';' rez] - $60 ['&' 'l' 't' ';' rez] - $62 ['&' 'g' 't' ';' rez] - * [i.xet rez] - == - == - :: - ++ many :: nodelist to tape - |= {lix/(list manx) rez/tape} - |- ^- tape - ?~ lix rez - (apex i.lix $(lix t.lix)) - :: - ++ name :: name to tape - |= man/mane ^- tape - ?@ man (trip man) - (weld (trip -.man) `tape`[':' (trip +.man)]) - :: - ++ clot ~+ :: self-closing tags - %~ has in - %- sa ^- (list term) :~ - %area %base %br %col %command %embed %hr %img %input %keygen - %link %meta %param %source %track %wbr - == - -- -:: -++ poxa :: xml parser - =< |=(a/cord (rush a apex)) - |_ ent/_`(map term @t)`[[%apos '\''] ~ ~] - ++ apex - =+ spa=;~(pose comt whit) - %+ knee *manx |. ~+ - %+ ifix [(star spa) (star spa)] - ;~ pose - %+ sear |=({a/marx b/marl c/mane} ?.(=(c n.a) ~ (some [a b]))) - ;~(plug head many tail) - empt - == - :: - ++ attr :: attributes - %+ knee *mart |. ~+ - %- star - ;~ plug - ;~(pfix (plus whit) name) - ;~ pose - (ifix [;~(plug tis doq) doq] (star ;~(less doq escp))) - (ifix [;~(plug tis soq) soq] (star ;~(less soq escp))) - (easy ~) - == - == - :: - ++ chrd :: character data - %+ cook |=(a/tape ^-(mars :/(a))) - (plus ;~(less doq ;~(pose (just `@`10) escp))) - :: - ++ comt :: comments - =- (ifix [(jest '')] (star -)) - ;~ pose - ;~(less hep prn) - whit - ;~(less (jest '-->') hep) - == - :: - ++ escp ;~(pose ;~(less gal gar pam prn) enty) - ++ enty :: entity - %+ ifix pam^sem - ;~ pose - =+ def=^+(ent (mo [%gt '>'] [%lt '<'] [%amp '&'] [%quot '"'] ~)) - %+ sear ~(get by (~(uni by def) ent)) - (cook crip ;~(plug alf (stun 1^31 aln))) - %+ cook |=(a/@c ?:((gth a 0x10.ffff) '�' (tuft a))) - =< ;~(pfix hax ;~(pose - +)) - :- (bass 10 (stun 1^8 dit)) - (bass 16 ;~(pfix (mask "xX") (stun 1^8 hit))) - == - :: - ++ empt :: self-closing tag - %+ ifix [gal (jest '/>')] - ;~(plug ;~(plug name attr) (cold ~ (star whit))) - :: - ++ head :: opening tag - (ifix [gal gar] ;~(plug name attr)) - :: - ++ many - (more (star comt) ;~(pose apex chrd)) - :: - ++ name :: tag name - =+ ^= chx - %+ cook crip - ;~ plug - ;~(pose cab alf) - (star ;~(pose cab dot alp)) - == - ;~(pose ;~(plug ;~(sfix chx col) chx) chx) - :: - ++ tail (ifix [(jest ' |% ++ grub (unit *) - ++ fist $+(json grub) - -- - |% - ++ ar :: array as list - |* wit/fist - |= jon/json - ?. ?=({$a *} jon) ~ - %- zl - |- - ?~ p.jon ~ - [i=(wit i.p.jon) t=$(p.jon t.p.jon)] - :: - ++ at :: array as tuple - |* wil/(pole fist) - |= jon/json - ?. ?=({$a *} jon) ~ - =+ raw=((at-raw wil) p.jon) - ?.((za raw) ~ (some (zp raw))) - :: - ++ at-raw :: array as tuple - |* wil/(pole fist) - |= jol/(list json) - ?~ wil ~ - :- ?~(jol ~ (-.wil i.jol)) - ((at-raw +.wil) ?~(jol ~ t.jol)) - :: - ++ bo :: boolean - |=(jon/json ?.(?=({$b *} jon) ~ [~ u=p.jon])) - :: - ++ bu :: boolean not - |=(jon/json ?.(?=({$b *} jon) ~ [~ u=!p.jon])) - :: - ++ ci :: maybe transform - |* {poq/$+(* *) wit/fist} - |= jon/json - (biff (wit jon) poq) - :: - ++ cu :: transform - |* {poq/$+(* *) wit/fist} - |= jon/json - (bind (wit jon) poq) - :: - ++ da :: UTC date - |= jon/json - ?. ?=({$s *} jon) ~ - (bind (stud p.jon) |=(a/date (year a))) - :: - ++ di :: millisecond date - %- cu :_ ni - |= a/@u ^- @da - (add ~1970.1.1 (div (mul ~s1 a) 1.000)) - :: - ++ mu :: true unit - |* wit/fist - |= jon/json - ?~(jon (some ~) (bind (wit jon) some)) - :: - ++ ne :: number as real - |= jon/json - ^- (unit @rd) - !! - :: - ++ ni :: number as integer - |= jon/json - ?. ?=({$n *} jon) ~ - (rush p.jon dem) - :: - ++ no :: number as cord - |= jon/json - ?. ?=({$n *} jon) ~ - (some p.jon) - :: - ++ of :: object as frond - |* wer/(pole {cord fist}) - |= jon/json - ?. ?=({$o {@ *} $~ $~} jon) ~ - |- - ?~ wer ~ - ?: =(-.-.wer p.n.p.jon) - ((pe -.-.wer +.-.wer) q.n.p.jon) - ((of +.wer) jon) - :: - ++ ot :: object as tuple - |* wer/(pole {cord fist}) - |= jon/json - ?. ?=({$o *} jon) ~ - =+ raw=((ot-raw wer) p.jon) - ?.((za raw) ~ (some (zp raw))) - :: - ++ ot-raw :: object as tuple - |* wer/(pole {cord fist}) - |= jom/(map @t json) - ?~ wer ~ - =+ ten=(~(get by jom) -.-.wer) - [?~(ten ~ (+.-.wer u.ten)) ((ot-raw +.wer) jom)] - :: - ++ om :: object as map - |* wit/fist - |= jon/json - ?. ?=({$o *} jon) ~ - (zm (~(run by p.jon) wit)) - :: - ++ op :: parse keys of map - |* {fel/rule wit/fist} - %+ cu mo - %- ci :_ (om wit) - |= a/(map cord _(need *wit)) - ^- (unit (list _[(wonk *fel) (need *wit)])) - =- (zl (turn (~(tap by a)) -)) - |* {a/cord b/*} - =+ nit=(rush a fel) - ?~ nit ~ - (some [u.nit b]) - :: - ++ pe :: prefix - |* {pre/* wit/fist} - (cu |*(a/* [pre a]) wit) - :: - ++ sa :: string as tape - |= jon/json - ?.(?=({$s *} jon) ~ (some (trip p.jon))) - :: - ++ so :: string as cord - |= jon/json - ?.(?=({$s *} jon) ~ (some p.jon)) - :: - ++ su :: parse string - |* sab/rule - |= jon/json - ?. ?=({$s *} jon) ~ - (rush p.jon sab) - :: - ++ ul |=(jon/json ?~(jon (some ~) ~)) :: null - ++ za :: full unit pole - |* pod/(pole (unit)) - ?~ pod & - ?~ -.pod | - (za +.pod) - :: - ++ zl :: collapse unit list - |* lut/(list (unit)) - ?. |- ^- ? - ?~(lut & ?~(i.lut | $(lut t.lut))) - ~ - %- some - |- - ?~ lut ~ - [i=u:+.i.lut t=$(lut t.lut)] - :: - ++ zp :: unit tuple - |* but/(pole (unit)) - ?~ but !! - ?~ +.but - u:->.but - [u:->.but (zp +.but)] - :: - ++ zm :: collapse unit map - |* lum/(map term (unit)) - ?: (~(rep by lum) |=({{@ a/(unit)} b/_|} |(b ?=($~ a)))) - ~ - (some (~(run by lum) need)) - -- -:: -++ joba :: object from k-v pair - |= {p/@t q/json} - ^- json - [%o [[p q] ~ ~]] -:: -++ jobe :: object from k-v list - |= a/(list {p/@t q/json}) - ^- json - [%o (~(gas by *(map @t json)) a)] -:: -++ jape :: string from tape - |= a/tape - ^- json - [%s (crip a)] -:: -++ jone :: number from unsigned - |= a/@u - ^- json - :- %n - ?: =(0 a) '0' - (crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))]))))) -:: -++ jode :: ms timestamp - |= a/time - =- (jone (div (mul - 1.000) ~s1)) - (add (div ~s1 2.000) (sub a ~1970.1.1)) -:: -++ jesc - =+ utf=|=(a/@ ['\\' 'u' ((x-co 4):co a)]) - |= a/@ ^- tape - ?+ a ?:((gth a 0x1f) [a ~] (utf a)) - $10 "\\n" - $34 "\\\"" - $92 "\\\\" - == -:: -++ scanf :: formatted scan - |* {tape (pole _:/(*{$^(rule tape)}))} - => .(+< [a b]=+<) - (scan a (parsf b)) -++ parsf :: make parser from: - |^ |* a/(pole _:/(*{$^(rule tape)})) :: ;"chars{rule}chars" - %- cook :_ (bill (norm a)) - |* (list) - ?~ +< ~ - ?~ t i - [i $(+< t)] - :: - :: .= (norm [;"{n}, {n}"]:n=dim:ag) ~[[& dim] [| ", "] [& dim]]:ag - ++ norm - |* (pole _:/(*{$^(rule tape)})) - ?~ +< ~ - => .(+< [i=+<- t=+<+]) - :_ t=$(+< t) - =+ rul=->->.i - ^= i - ?~ rul [%| p=rul] - ?~ +.rul [%| p=rul] - ?@ &2.rul [%| p=;;(tape rul)] - [%& p=rul] - :: - :: .= (bill ~[[& dim] [| ", "] [& dim]]:ag) - :: ;~(plug dim ;~(pfix com ace ;~(plug dim (easy)))):ag - ++ bill - |* (list (each rule tape)) - ?~ +< (easy ~) - ?: ?=($| -.i) ;~(pfix (jest (crip p.i)) $(+< t)) - %+ cook |*({* *} [i t]=+<) - ;~(plug p.i $(+< t)) - -- -:: -++ taco :: atom to octstream - |= tam/@ ^- octs - [(met 3 tam) tam] -:: -++ tact :: tape to octstream - |= tep/tape ^- octs - (taco (rap 3 tep)) -:: -++ tell :: wall to octstream - |= wol/wall ^- octs - =+ buf=(rap 3 (turn wol |=(a/tape (crip (weld a `tape`[`@`10 ~]))))) - [(met 3 buf) buf] -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bF, filesystem interface :: -:: -++ feel :: simple file write - |= {pax/path val/cage} - ^- miso - =+ dir=((hard arch) .^(%cy pax)) - ?~ fil.dir [%ins val] - [%mut val] -:: -++ file :: simple file load - |= pax/path - ^- (unit) - =+ dir=((hard arch) .^(%cy pax)) - ?~(fil.dir ~ [~ .^(%cx pax)]) -:: -++ foal :: high-level write - |= {pax/path val/cage} - ^- toro - ?> ?=({* * * *} pax) - [i.t.pax [%& [[[t.t.t.pax (feel pax val)] ~]]]] -:: -++ fray :: high-level delete - |= pax/path - ^- toro - ?> ?=({* * * *} pax) - [i.t.pax [%& [[[t.t.t.pax [%del ~]] ~]]]] -:: -++ furl :: unify changes - |= {one/toro two/toro} - ^- toro - ~| %furl - ?> ?& =(p.one p.two) :: same path - &(?=($& -.q.one) ?=($& -.q.two)) :: both deltas - == - [p.one [%& (weld p.q.one p.q.two)]] -:: -++ tame :: parse kite path - |= hap/path - ^- (unit kite) - ?. ?=({@ @ @ @ *} hap) ~ - =+ :* hyr=(slay i.hap) - fal=(slay i.t.hap) - dyc=(slay i.t.t.hap) - ved=(slay i.t.t.t.hap) - :: ved=(slay i.t.hap) - :: fal=(slay i.t.t.hap) - :: dyc=(slay i.t.t.t.hap) - tyl=t.t.t.t.hap - == - ?. ?=({$~ $$ $tas @} hyr) ~ - ?. ?=({$~ $$ $p @} fal) ~ - ?. ?=({$~ $$ $tas @} dyc) ~ - ?. ?=({$~ $$ case} ved) ~ - =+ his=`@p`q.p.u.fal - =+ [dis=(end 3 1 q.p.u.hyr) rem=(rsh 3 1 q.p.u.hyr)] - ?. ?&(?=($c dis) ?=(?($v $w $x $y $z) rem)) ~ - [~ rem p.u.ved q.p.u.fal q.p.u.dyc tyl] -:: -++ tome :: parse path to beam - |= pax/path - ^- (unit beam) - ?. ?=({* * * *} pax) ~ - %+ biff (slaw %p i.pax) - |= who/ship - %+ biff (slaw %tas i.t.pax) - |= dex/desk - %+ biff (slay i.t.t.pax) - |= cis/coin - ?. ?=({$$ case} cis) ~ - `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)] -:: -++ tope :: beam to path - |= bem/beam - ^- path - [(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)] -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bG, URL handling :: -:: -++ deft :: parse url extension - |= rax/(list @t) - |- ^- pork - ?~ rax - [~ ~] - ?^ t.rax - [p.pok [ire q.pok]]:[pok=$(rax t.rax) ire=i.rax] - =+ ^- raf/(like term) - => |=(a/@ ((sand %tas) (crip (flop (trip a))))) - (;~(sfix (sear . sym) dot) [1^1 (flop (trip i.rax))]) - ?~ q.raf - [~ [i.rax ~]] - =+ `{ext/term {@ @} fyl/tape}`u.q.raf - :- `ext - ?:(=(~ fyl) ~ [(crip (flop fyl)) ~]) -:: -++ fuel :: parse fcgi - |= {bem/beam but/path} - ^- 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 - == -:: -++ sifo :: 64-bit encode - |= tig/@ - ^- tape - =+ poc=(~(dif fo 3) 0 (met 3 tig)) - =+ pad=(lsh 3 poc (swap 3 tig)) - =+ ^= cha - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - =+ ^= sif - |- ^- tape - ?~ pad - ~ - =+ d=(end 0 6 pad) - [(cut 3 [d 1] cha) $(pad (rsh 0 6 pad))] - (weld (flop (slag poc sif)) (reap poc '=')) -:: -++ ofis :: XX broken - =- |=(a/cord (rash a fel)) - =< fel=(cook |+(a/@ `@t`(swap 3 a)) (bass 64 .)) - =- (cook welp ;~(plug (plus siw) (stun 0^2 (cold %0 tis)))) - ^= siw - ;~ pose - (cook |=(a/@ (sub a 'A')) (shim 'A' 'Z')) - (cook |=(a/@ (sub a 'G')) (shim 'a' 'z')) - (cook |=(a/@ (add a 4)) (shim '0' '9')) - (cold 62 (just '+')) - (cold 63 (just '/')) - == -:: -:: .= ~[p=~.ack q=~.~sarnel r=~..y] -:: (dray ~[p=%tas q=%p r=%f] %ack ~sarnel &) -++ dray :: load tuple into path - =- |* {a/{@tas (pole @tas)} b/*} ^- (paf a) - => .(b `(tup a)`b) - ?~ +.a [(scot -.a b) ~] - [(scot -.a -.b) `(paf +.a)`(..$ +.a +.b)] - :- paf=|*(a/(pole) ?~(a $~ {(odo:raid -.a(. %ta)) (..$ +.a)})) - tup=|*({a/@tas b/(pole @tas)} =+(c=(odo:raid a) ?~(b c {c (..$ b)}))) -:: -:: .= [p=%ack q=~sarnel r=&] -:: (raid /ack+~sarnel+.y p=%tas q=%p r=%f ~) -++ raid :: demand path odors - =- |* {a/path b/{@tas (pole @tas)}} - ?~ +.b `(odo -.b)`(slav -.b -.a) - [`(odo -.b)`(slav -.b -.a) (..$ +.a +.b)] - ^= odo - |* a/@tas - |= b/* - =< a(. (. b)) :: preserve face - ?+ a @ - $c @c $da @da $dr @dr $f @f $if @if $is @is $p @p - $u @u $uc @uc $ub @ub $ui @ui $ux @ux $uv @uv $uw @uw - $s @s $t @t $ta @ta $tas @tas - == -:: -++ read :: parse odored path - =< |*({a/path b/{@tas (pole @tas)}} ((+> b) a)) - |* b/{@tas (pole @tas)} - |= a/path - ?~ a ~ - =+ hed=(slaw -.b i.a) - ?~ +.b - ^- (unit (odo:raid -.b)) - ?^(+.a ~ hed) - ^- (unit {(odo:raid -.b) _(need *(..^$ +.b))}) - (both hed ((..^$ +.b) +.a)) -:: -++ urle :: URL encode - |= tep/tape - ^- tape - %- zing - %+ turn tep - |= tap/char - =+ xen=|=(tig/@ ?:((gte tig 10) (add tig 55) (add tig '0'))) - ?: ?| &((gte tap 'a') (lte tap 'z')) - &((gte tap 'A') (lte tap 'Z')) - &((gte tap '0') (lte tap '9')) - =('.' tap) - =('-' tap) - =('~' tap) - =('_' tap) - == - [tap ~] - ['%' (xen (rsh 0 4 tap)) (xen (end 0 4 tap)) ~] -:: -++ urld :: URL decode - |= tep/tape - ^- (unit tape) - ?~ tep [~ ~] - ?: =('%' i.tep) - ?. ?=({@ @ *} t.tep) ~ - =+ nag=(mix i.t.tep (lsh 3 1 i.t.t.tep)) - =+ val=(rush nag hex:ag) - ?~ val ~ - =+ nex=$(tep t.t.t.tep) - ?~(nex ~ [~ [`@`u.val u.nex]]) - =+ nex=$(tep t.tep) - ?~(nex ~ [~ i.tep u.nex]) -:: -++ earf :: purf to tape - |= purf - (weld (earn p) ?~(q "" `tape`['#' (trip u.q)])) -:: -++ earl :: localize purl - |= {who/@p pul/purl} - ^- purl - pul(q.q [(rsh 3 1 (scot %p who)) q.q.pul]) -:: -++ earn :: purl to tape - =< |=(pul/purl `tape`(apex ~ pul)) - |% - ++ apex - |= qur/quri - ?- -.qur - $& (weld (head p.p.qur) `tape`['/' $(qur [%| +.p.qur])]) - $| (weld (body p.qur) (tail q.qur)) - == - :: - ++ body - |= pok/pork ^- tape - ?~ q.pok ~ - |- - =+ seg=(trip i.q.pok) - ?~ t.q.pok - ?~(p.pok seg (welp seg '.' (trip u.p.pok))) - (welp seg '/' $(q.pok t.q.pok)) - :: - ++ head - |= har/hart - ^- tape - ;: weld - ?:(&(p.har !?=(hoke r.har)) "https://" "http://") - :: - ?- -.r.har - $| (trip (rsh 3 1 (scot %if p.r.har))) - $& =+ rit=(flop p.r.har) - |- ^- tape - ?~(rit ~ (weld (trip i.rit) ?~(t.rit "" `tape`['.' $(rit t.rit)]))) - == - :: - ?~(q.har ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.har)))]) - == - :: - ++ tail - |= kay/quay - ^- tape - ?: =(~ kay) ~ - :- '?' - |- ^- tape - ?~ kay ~ - ;: welp - (urle (trip p.i.kay)) - ?~(q.i.kay ~ ['=' (urle (trip q.i.kay))]) - ?~(t.kay ~ `tape`['&' $(kay t.kay)]) - == - -- -:: -++ urlp :: url+header parser - |% - ++ apat :: 2396 abs_path - %+ cook deft - (ifix [fas ;~(pose fas (easy ~))] (more fas smeg)) - ++ aurf :: 2396 with fragment - %+ cook |+(a/purf a) - ;~(plug auri (punt ;~(pfix hax (cook crip (star pque))))) - ++ auri :: 2396 URL - %+ cook - |= a/purl - ?.(?=(hoke r.p.a) a a(p.p &)) - ;~ plug - ;~ plug - %+ sear - |= a/@t - ^- (unit ?) - ?+(a ~ $http [~ %|], $https [~ %&]) - ;~(sfix scem ;~(plug col fas fas)) - thor - == - ;~(plug ;~(pose apat (easy *pork)) yque) - == - ++ cock :: cookie - (most ;~(plug sem ace) ;~(plug toke ;~(pfix tis tosk))) - ++ dlab :: 2396 domainlabel - %+ sear - |= a/@ta - ?.(=('-' (rsh 3 (dec (met 3 a)) a)) [~ u=a] ~) - %+ cook cass - ;~(plug aln (star alp)) - :: - ++ fque (cook crip (plus pquo)) :: normal query field - ++ fquu (cook crip (star pquo)) :: optional field - ++ pcar ;~(pose pure pesc psub col pat) :: 2396 path char - ++ pcok ;~(less bas sem com doq prn) :: cookie char - ++ pesc ;~(pfix cen mes) :: 2396 escaped - ++ pold (cold ' ' (just '+')) :: old space code - ++ pque ;~(pose pcar fas wut) :: 3986 query char - ++ pquo ;~(pose pure pesc pold fas wut) :: normal query char - ++ pure ;~(pose aln hep dot cab sig) :: 2396 unreserved - ++ psub ;~ pose :: 3986 sub-delims - zap buc pam soq pel per - tar lus com sem tis - == - ++ ptok ;~ pose :: 2616 token - aln zap hax buc cen pam soq tar lus - hep dot ket cab tec bar sig - == - ++ scem :: 2396 scheme - %+ cook cass - ;~(plug alf (star ;~(pose aln lus hep dot))) - :: - ++ smeg (cook crip (plus pcar)) :: 2396 segment - ++ tock (cook crip (plus pcok)) :: 6265 cookie-value - ++ tosk ;~(pose tock (ifix [doq doq] tock)) :: 6265 cookie-value - ++ toke (cook crip (plus ptok)) :: 2616 token - ++ thor :: 2396 host+port - %+ cook |*(a/{* *} [+.a -.a]) - ;~ plug - thos - ;~((bend) (easy ~) ;~(pfix col dim:ag)) - == - ++ thos :: 2396 host, no local - ;~ plug - ;~ pose - %+ stag %& - %+ sear :: LL parser weak here - |= a/(list @t) - =+ b=(flop a) - ?> ?=(^ b) - =+ c=(end 3 1 i.b) - ?.(&((gte c 'a') (lte c 'z')) ~ [~ u=b]) - (most dot dlab) - :: - %+ stag %| - =+ tod=(ape:ag ted:ab) - %+ bass 256 - ;~(plug tod (stun [3 3] ;~(pfix dot tod))) - == - == - ++ yque :: query ending - ;~ pose - ;~(pfix wut yquy) - (easy ~) - == - ++ yquy :: query - ;~ pose :: proper query - %+ more - ;~(pose pam sem) - ;~(plug fque ;~(pose ;~(pfix tis fquu) (easy ''))) - :: - %+ cook :: funky query - |=(a/tape [[%$ (crip a)] ~]) - (star pque) - == - ++ zest :: 2616 request-uri - ;~ pose - (stag %& (cook |=(a/purl a) auri)) - (stag %| ;~(plug apat yque)) - == - -- -++ epur :: url+header parser - =>(urlp |=(a/cord `(unit purl)`(rush a auri))) -:: -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bH, names etc :: -:: -++ clan :: ship to rank - |= who/ship ^- rank - =+ wid=(met 3 who) - ?: (lte wid 1) %czar - ?: =(2 wid) %king - ?: (lte wid 4) %duke - ?: (lte wid 8) %earl - ?> (lte wid 16) %pawn -:: -++ glam :: carrier names - |= zar/@pD ^- tape - (weld "galaxy " (scow %p zar)) -:: -++ gnom :: ship display name - |= {{our/@p now/@da} him/@p} ^- @t - =+ yow=(scot %p him) - =+ pax=[(scot %p our) %name (scot %da now) yow ~] - =+ woy=((hard @t) .^(%a pax)) - ?: =(%$ woy) yow - (rap 3 yow ' ' woy ~) -:: -++ gnow - |= {who/@p gos/gcos} ^- @t - ?- -.gos - $czar (rap 3 '|' (rap 3 (glam who)) '|' ~) - $king (rap 3 '_' p.gos '_' ~) - $earl (rap 3 ':' p.gos ':' ~) - $pawn ?~(p.gos %$ (rap 3 '.' u.p.gos '.' ~)) - $duke - ?: ?=($anon -.p.gos) %$ - %+ rap 3 - ^- (list @) - ?- -.p.gos - $punk ~['"' q.p.gos '"'] - ?($lord $lady) - =+ ^= nad - =+ nam=`name`s.p.p.gos - %+ rap 3 - :~ p.nam - ?~(q.nam 0 (cat 3 ' ' u.q.nam)) - ?~(r.nam 0 (rap 3 ' (' u.r.nam ')' ~)) - ' ' - s.nam - == - ?:(=(%lord -.p.gos) ~['[' nad ']'] ~['(' nad ')']) - == - == -++ pale :: filter peers - |= {hid/bowl fun/$+(sink ?)} - (skim (~(tap by sup.hid)) fun) -:: -++ prix :: filter gate - |= pax/path |= sink ^- ? - ?~ pax & ?~ r.+< | - &(=(i.pax i.r.+<) $(pax t.pax, r.+< t.r.+<)) -:: -++ prey |=({pax/path hid/bowl} (pale hid (prix pax))) :: prefix -++ hunt :: first of unit dates - |= {one/(unit @da) two/(unit @da)} - ^- (unit @da) - ?~ one two - ?~ two one - ?:((lth u.one u.two) one two) -:: -:: ++ mojo :: compiling load -:: |= [pax=path src=*] -:: ^- (each twig (list tank)) -:: ?. ?=(@ src) -:: [%| ~[[leaf+"musk: malformed: {}"]]] -:: =+ ^= mud -:: %- mule |. -:: ((full vest) [1 1] (trip src)) -:: ?: ?=(| -.mud) mud -:: ?~ q.p.mud -:: :~ %| -:: leaf+"musk: syntax error: {}" -:: leaf+"musk: line {}, column {}" -:: == -:: [%& p.u.q.p.mud] -:: :: -++ mole :: new to old sky - |= ska/$+(* (unit (unit))) - |= a/* - ^- (unit) - =+ b=(ska a) - ?~ b ~ - ?~ u.b ~ - [~ u.u.b] -:: :: -:: ++ much :: constructing load -:: |= [pax=path src=*] -:: ^- gank -:: =+ moj=(mojo pax src) -:: ?: ?=(| -.moj) moj -:: (mule |.((slap !>(+>.$) `twig`p.moj))) -:: :: -:: ++ musk :: compiling apply -:: |= [pax=path src=* sam=vase] -:: ^- gank -:: =+ mud=(much pax src) -:: ?: ?=(| -.mud) mud -:: (mule |.((slam p.mud sam))) -:: :: -++ pack :: light path encoding - |= {a/term b/path} ^- span - %+ rap 3 :- (wack a) - (turn b |=(c/span (cat 3 '_' (wack c)))) -:: -++ puck :: light path decoding - =+ fel=(most cab (sear wick urt:ab)) - |=(a/span `(unit {p/term q/path})`(rush a fel)) -:: -++ saxo :: autocanon - |= who/ship - ^- (list ship) - ?: (lth who 256) [who ~] - [who $(who (sein who))] -:: -++ sein :: autoboss - |= who/ship ^- ship - =+ mir=(clan who) - ?- mir - $czar who - $king (end 3 1 who) - $duke (end 4 1 who) - $earl (end 5 1 who) - $pawn `@p`0 - == -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: section 3bI, Arvo structures :: -:: -++ acru :: asym cryptosuite - $_ ^? |% :: opaque object - ++ as ^? :: asym ops - |% ++ seal |=({a/pass b/@ c/@} *@) :: encrypt to a - ++ sign |=({a/@ b/@} *@) :: certify as us - ++ sure |=({a/@ b/@} *(unit @)) :: authenticate from us - ++ tear |= {a/pass b/@} :: accept from a - *(unit {p/@ q/@}) :: - -- :: - ++ de |+({a/@ b/@} *(unit @)) :: symmetric de, soft - ++ dy |+({a/@ b/@} *@) :: symmetric de, hard - ++ en |+({a/@ b/@} *@) :: symmetric en - ++ ex ^? :: export - |% ++ fig *@uvH :: fingerprint - ++ pac *@uvG :: default passcode - ++ pub *pass :: public key - ++ sec *ring :: private key - -- :: - ++ nu ^? :: reconstructors - |% ++ pit |=({a/@ b/@} ^?(..nu)) :: from [width seed] - ++ nol |=(a/@ ^?(..nu)) :: from naked ring - ++ com |=(a/@ ^?(..nu)) :: from naked pass - -- :: - -- :: -++ aeon @ud :: -++ agon (map {p/ship q/desk} {p/@ud q/@ud r/waks}) :: mergepts -++ ankh :: fs node (new) - $: fil/(unit {p/lobe q/cage}) :: file - dir/(map @ta ankh) :: folders - == :: -++ apex {p/@uvI q/(map @ta @uvI) r/(map @ta $~)} :: node report (old) -++ ares (unit {p/term q/(list tank)}) :: possible error -++ ball @uw :: statement payload -++ bait {p/skin q/@ud r/dove} :: fmt nrecvd spec -++ bath :: convo per client - $: sop/shed :: not stalled - raz/(map path race) :: statements inbound - ryl/(map path rill) :: statements outbound - == :: -++ beam {{p/ship q/desk r/case} s/path} :: global name -++ beak {p/ship q/desk r/case} :: garnish with beak -++ bird :: packet in travel - $: gom/soap :: message identity - mup/@ud :: pktno in msg - nux/@ud :: xmission count - lys/@da :: last sent - pac/rock :: packet data - == :: -++ bitt (map bone (pair ship path)) :: incoming subs -++ blob :: fs blob - $% {$delta p/lobe q/{p/mark q/lobe} r/page} :: delta on q - {$direct p/lobe q/page} :: immediate - == :: -++ boat (map (pair bone wire) (trel bean ship path)) :: outgoing subs -++ boon :: fort output - $% {$beer p/ship q/@uvG} :: gained ownership - {$cake p/sock q/soap r/coop s/duct} :: e2e message result - {$coke p/sock q/soap r/cape s/duct} :: message result - {$mead p/lane q/rock} :: accept packet - {$milk p/sock q/soap r/*} :: accept message - {$mulk p/sock q/soap r/*} :: e2e pass message - {$ouzo p/lane q/rock} :: transmit packet - {$wine p/sock q/tape} :: notify user - == :: -++ bowl :: standard app state - $: $: our/ship :: host - src/ship :: guest - dap/term :: agent - == :: - $: wex/boat :: outgoing subs - sup/bitt :: incoming subs - == :: - $: ost/bone :: opaque cause - act/@ud :: change number - eny/@uvI :: entropy - now/@da :: current time - byk/beak :: load source - == == :: -++ bray {p/life q/(unit life) r/ship s/@da} :: our parent us now -++ brow {p/@da q/@tas} :: browser version -++ buck {p/mace q/will} :: all security data -++ cake {p/sock q/skin r/@} :: top level packet -++ cape :: end-to-end result - $? $good :: delivered - $dead :: rejected - == :: -++ care ?($u $v $w $x $y $z) :: clay submode -++ case :: ship desk case spur - $% {$da p/@da} :: date - {$tas p/@tas} :: label - {$ud p/@ud} :: number - == :: -++ chum @uvI :: hashed passcode -++ clot :: symmetric record - $: yed/(unit {p/hand q/code}) :: outbound - heg/(map hand code) :: proposed - qim/(map hand code) :: inbound - == :: -++ coal * :: untyped vase -++ code @uvI :: symmetric key -++ cone :: reconfiguration - $% {$& p/twig} :: transform - {$| p/(list @tas)} :: alter - == :: -++ chum @uvI :: hashed passcode -++ claw :: startup chain - $: joy/(unit coal) :: local context - ran/(unit coal) :: arguments - pux/(unit path) :: execution path - jiv/(unit coal) :: app configuration - kyq/(unit coal) :: app customization - gam/(unit coal) :: app image - == :: -++ clip (each @if @is) :: client IP -++ coal * :: untyped vase -++ code @uvI :: symmetric key -++ cone :: reconfiguration - $% {$& p/twig} :: transform - {$| p/(list @tas)} :: alter - == :: -++ coop (unit ares) :: e2e ack -++ corn :: flow by server - $: hen/duct :: admin channel - nys/(map flap bait) :: packets incoming - olz/(map flap cape) :: packets completed - wab/(map ship bath) :: relationship - == :: -++ cred :: credential - $: hut/hart :: client host - aut/(jug @tas @t) :: client identities - orx/oryx :: CSRF secret - acl/(unit @t) :: accept-language - cip/(each @if @is) :: client IP - cum/(map @tas *) :: custom dirt - == :: -++ deed {p/@ q/step r/?} :: sig stage fake? -++ dome :: project state - $: ank/ankh :: state - let/@ud :: top id - hit/(map @ud tako) :: changes by id - lab/(map @tas @ud) :: labels - == :: -++ dore :: foreign contact - $: wod/road :: connection to - wyl/will :: inferred mirror - caq/clot :: symmetric key state - == :: -++ dove {p/@ud q/(map @ud @)} :: count hash 13-blocks -++ epic :: FCGI parameters - $: qix/(map @t @t) :: query - ced/cred :: client credentials - bem/beam :: original path - but/path :: ending - == :: -++ flap @uvH :: network packet id -++ flow :: packet connection - $: rtt/@dr :: decaying avg rtt - wid/@ud :: logical wdow msgs - == :: -++ fort :: formal state - $: $0 :: version - gad/duct :: client interface - hop/@da :: network boot date - ton/town :: security - zac/(map ship corn) :: flows by server - == :: -++ gank (each vase (list tank)) :: abstract result -++ gilt {@tas *} :: presumed gift -++ gens {p/lang q/gcos} :: general identity -++ germ :: merge style - $? $init :: new desk - $this :: ours with parents - $that :: hers with parents - $fine :: fast forward - $meet :: orthogonal files - $mate :: orthogonal changes - $meld :: force merge - == :: -++ gcos :: id description - $% {$czar $~} :: 8-bit ship - {$duke p/what} :: 32-bit ship - {$earl p/@t} :: 64-bit ship - {$king p/@t} :: 16-bit ship - {$pawn p/(unit @t)} :: 128-bit ship - == :: -++ govt path :: country+postcode -++ hand @uvH :: hash of code -++ hart {p/? q/(unit @ud) r/host} :: http sec+port+host -++ hate {p/purl q/@p r/moth} :: semi-cooked request -++ heir {p/@ud q/mess r/(unit love)} :: status+headers+data -++ hiss {p/purl q/moth} :: outbound request -++ hist {p/@ud q/(list @t)} :: depth texts -++ hole @t :: session identity -++ hort {p/(unit @ud) q/host} :: http port+host -++ host (each (list @t) @if) :: http host -++ hoke %+ each {$localhost $~} :: local host - ?($.0.0.0.0 $.127.0.0.1) :: -++ httq :: raw http request - $: p/meth :: method - q/@t :: unparsed url - r/(list {p/@t q/@t}) :: headers - s/(unit octs) :: body - == :: -++ httr {p/@ud q/mess r/(unit octs)} :: raw http response -++ httx :: encapsulated http - $: p/? :: https? - q/clip :: source IP - r/httq :: - == :: -++ kite {p/care q/case r/ship s/desk t/spur} :: parsed global name -++ json :: normal json value - $@ $~ :: null - $% {$a p/(list json)} :: array - {$b p/?} :: boolean - {$o p/(map @t json)} :: object - {$n p/@ta} :: number - {$s p/@t} :: string - == :: -++ lamb :: short path - $% {$& p/@tas} :: auto - {$| p/twig} :: manual - == :: -++ lane :: packet route - $% {$if p/@da q/@ud r/@if} :: IP4/public UDP/addr - {$is p/@ud q/(unit lane) r/@is} :: IPv6 w+alternates - {$ix p/@da q/@ud r/@if} :: IPv4 provisional - == :: -++ lang @ta :: IETF lang as code -++ lark {p/(unit @tas) q/lawn} :: parsed command -++ lass ?($0 $1 $2) :: power increment -++ lath $% :: pipeline stage - {$0 p/lass q/lamb r/(list cone) s/twig} :: command - {$1 p/twig} :: generator - {$2 p/twig} :: filter - == :: -++ lawn (list lath) :: -++ lice {p/ship q/buck} :: full license -++ life @ud :: regime number -++ lint (list rock) :: fragment array -++ lobe @uvI :: blob ref -++ love $% :: http response - {$ham p/manx} :: html node - {$mid p/mite q/octs} :: mime-typed data - {$raw p/httr} :: raw http response - {$wan p/wain} :: text lines - {$zap p/@ud q/(list tank)} :: status+error - == :: -++ maki {p/@ta q/@ta r/@ta s/path} :: -++ mace (list {p/life q/ring}) :: private secrets -++ math (map @t (list @t)) :: semiparsed headers -++ meal :: payload - $% {$back p/cape q/flap r/@dr} :: acknowledgment - {$buck p/coop q/flap r/@dr} :: e2e ack - {$bond p/life q/path r/@ud s/*} :: message - {$bund p/life q/path r/@ud s/*} :: e2e message - {$carp p/@ q/@ud r/@ud s/flap t/@} :: skin+inx+cnt+hash - {$fore p/ship q/(unit lane) r/@} :: forwarded packet - == :: -++ mess (list {p/@t q/@t}) :: raw http headers -++ meta :: path metadata - $% {$& q/@uvI} :: hash - {$| q/(list @ta)} :: dir - == :: -++ meth :: http methods - $? $conn :: CONNECT - $delt :: DELETE - $get :: GET - $head :: HEAD - $opts :: OPTIONS - $post :: POST - $put :: PUT - $trac :: TRACE - == :: -++ mime {p/mite q/octs} :: mimetyped data -++ mite (list @ta) :: mime type -++ miso :: ankh delta - $% {$del $~} :: delete - {$ins p/cage} :: insert - {$dif p/cage} :: mutate from diff - {$mut p/cage} :: mutate from raw - == :: -++ misu :: computed delta - $% {$del $~} :: delete - {$ins p/cage} :: insert - {$dif p/lobe q/cage} :: mutate from diff - == :: -++ mizu {p/@u q/(map @ud tako) r/rang} :: new state -++ moar {p/@ud q/@ud} :: normal change range -++ moat {p/case q/case r/path} :: change range -++ mood {p/care q/case r/path} :: request in desk -++ moth {p/meth q/math r/(unit octs)} :: http operation -++ name {p/@t q/(unit @t) r/(unit @t) s/@t} :: first mid+nick last -++ newt ?($boot $kick $mess $slay $wake) :: lifecycle events -++ nori :: repository action - $% {$& p/soba} :: delta - {$| p/@tas} :: label - == :: -++ nuri :: repository action - $% {$& p/suba} :: delta - {$| p/@tas} :: label - == :: -++ octs {p/@ud q/@t} :: octet-stream -++ oryx @t :: CSRF secret -++ page (cask) :: untyped cage -++ pail ?($none $warm $cold) :: connection status -++ plan (trel view (pair @da (unit @dr)) path) :: subscription -++ plea {p/@ud q/{p/? q/@t}} :: live prompt -++ plop blob :: unvalidated blob -++ pork {p/(unit @ta) q/(list @t)} :: fully parsed url -++ pred {p/@ta q/@tas r/@ta $~} :: proto-path -++ prod {p/prom q/tape r/tape} :: prompt -++ prom ?($text $pass $none) :: format type -++ purf (pair purl (unit @t)) :: url with fragment -++ purl {p/hart q/pork r/quay} :: parsed url -++ putt :: outgoing message - $: ski/snow :: sequence acked+sent - wyv/(list rock) :: packet list XX gear - == :: -++ pyre :: cascade stash - $: p/(map {p/path q/path r/coal} coal) :: by path - q/(map {p/path q/@uvI r/coal} coal) :: by source hash - r/(map {p/* q/coal} coal) :: by (soft) twig - == :: -++ quay (list {p/@t q/@t}) :: parsed url query -++ quri :: request-uri - $% {$& p/purl} :: absolute - {$| p/pork q/quay} :: relative - == :: -++ race :: inbound stream - $: did/@ud :: filled sequence - dod/? :: not processing - bum/(map @ud ares) :: nacks - mis/(map @ud {p/cape q/lane r/flap s/(unit)}) :: misordered - == :: -++ rank ?($czar $king $duke $earl $pawn) :: ship width class -++ rang $: hut/(map tako yaki) :: - lat/(map lobe blob) :: - == :: -++ rand :: unvalidated rant - $: p/{p/care q/case r/@tas} :: clade release book - q/path :: spur - r/page :: data - == :: -++ rant :: namespace binding - $: p/{p/care q/case r/@tas} :: clade release book - q/path :: spur - r/cage :: data - == :: -++ rave :: general request - $% {$sing p/mood} :: single request - {$next p/mood} :: next version - {$many p/? q/moat} :: change range - == :: -++ rill :: outbound stream - $: sed/@ud :: sent - san/(map @ud duct) :: outstanding - == :: -++ riot (unit rant) :: response+complete -++ road :: secured oneway route - $: exp/@da :: expiration date - lun/(unit lane) :: route to friend - lew/will :: will of friend - == :: -++ rock @uvO :: packet -++ rout {p/(list host) q/path r/oryx s/path} :: http route (new) -++ rump {p/care q/case r/@tas s/path} :: relative path -++ saba {p/ship q/@tas r/moar s/dome} :: patch+merge -++ sack {p/ship q/ship} :: incoming [our his} -++ sufi :: domestic host - $: hoy/(list ship) :: hierarchy - val/wund :: private keys - law/will :: server will - seh/(map hand {p/ship q/@da}) :: key cache - hoc/(map ship dore) :: neighborhood - == :: -++ salt @uv :: entropy -++ seal :: auth conversation - $: whu/(unit ship) :: client identity - pul/purl :: destination url - wit/? :: wait for partner - foy/(unit {p/ship q/hole}) :: partner to notify - pus/(unit @ta) :: password - == :: -++ sect ?($black $blue $red $orange $white) :: banner -++ shed :: packet flow - $: $: rtt/@dr :: smoothed rtt - rto/@dr :: retransmit timeout - rtn/(unit @da) :: next timeout - rue/(unit @da) :: last heard from - == :: - $: nus/@ud :: number sent - nif/@ud :: number live - nep/@ud :: next expected - caw/@ud :: logical window - cag/@ud :: congest thresh - == :: - $: diq/(map flap @ud) :: packets sent - pyz/(map soup @ud) :: message+unacked - puq/(qeu {p/@ud q/soul}) :: packet queue - == :: - == :: -++ skit {p/(unit @ta) q/(list @ta) r/(list @ta)} :: tracking path -++ skin ?($none $open $fast $full) :: encoding stem -++ snow {p/@ud q/@ud r/(set @ud)} :: window exceptions -++ soap {p/{p/life q/life} q/path r/@ud} :: statement id -++ soup {p/path q/@ud} :: new statement id -++ soul :: packet in travel - $: gom/soup :: message identity - nux/@ud :: xmission count - liv/? :: deemed live - lys/@da :: last sent - pac/rock :: packet data - == :: -++ soba (list {p/path q/miso}) :: delta -++ sock {p/ship q/ship} :: outgoing [from to] -++ spur path :: ship desk case spur -++ step {p/bray q/gens r/pass} :: identity stage -++ suba (list {p/path q/misu}) :: delta -++ tako @ :: yaki ref -++ tick @ud :: process id -++ toro {p/@ta q/nori} :: general change -++ town :: all security state - $: lit/@ud :: imperial modulus - any/@ :: entropy - urb/(map ship sufi) :: all keys and routes - fak/? :: - == :: -++ tube {p/@ta q/@ta r/@ta s/path} :: canonical path -++ tutu * :: presumed type -++ yaki {p/(list tako) q/(map path lobe) r/tako t/@da} :: commit -++ view ?($u $v $w $x $y $z) :: view mode -++ waks (map path woof) :: list file states -++ what :: logical identity - $% {$anon $~} :: anonymous - {$lady p/whom} :: female person () - {$lord p/whom} :: male person [] - {$punk p/sect q/@t} :: opaque handle "" - == :: -++ whom {p/@ud q/govt r/sect s/name} :: year+govt+id -++ woof $@ $know :: udon transform - {$chan (list {$@(@ud {p/@ud q/@ud})})} :: -++ wund (list {p/life q/ring r/acru}) :: mace in action -++ will (list deed) :: certificate -++ zuse %310 :: hoon+zuse kelvin -:: :: -:::: :::: this will become `%york`, vane structures. - :: :: -++ gift-ames :: out result <-$ - $% {$hear p/lane q/@} :: receive packet - {$init p/@p} :: report install - {$mass p/mass} :: memory usage - {$send p/lane q/@} :: transmit packet - {$waft p/sock q/*} :: response message - {$wart p/sock q/@tas r/path s/*} :: network request - {$went p/ship q/cape} :: reaction message - {$woot p/ship q/coop} :: e2e reaction message - == :: -++ kiss-ames :: in request ->$ - $% {$barn $~} :: new unix process - {$crud p/@tas q/(list tank)} :: error with trace - {$cash p/@p q/buck} :: civil license - {$hear p/lane q/@} :: receive packet - {$hole p/lane q/@} :: packet failed - {$junk p/@} :: entropy - {$kick p/@da} :: wake up - {$make p/(unit @t) q/@ud r/@ s/?} :: wild license - {$sith p/@p q/@uw r/?} :: imperial generator - {$wake $~} :: timer activate - {$want p/sock q/path r/*} :: send message - {$wegh $~} :: report memory - {$west p/sack q/path r/*} :: network request - {$wont p/sock q/path r/*} :: e2e send message - == :: -:: -:::: %behn - :: -++ gift-behn :: out result <-$ - $% {$mass p/mass} :: memory usage - {$wake $~} :: wakey-wakey - == :: -++ kiss-behn :: in request ->$ - $% {$rest p/@da} :: cancel alarm - {$wait p/@da} :: set alarm - {$wake $~} :: timer activate - {$wegh $~} :: report memory - == :: -:: -:::: %clay - :: -++ khan :: - $: fil/(unit (unit cage)) :: XX see khan-to-soba - dir/(unit (map @ta (unit khan))) :: - == :: -++ mode (list {path (unit mime)}) :: -++ riff {p/desk q/(unit rave)} :: request+desist -:::: :: -++ gift-clay :: out result <-$ - $% {$ergo p/@tas q/mode} :: version update - {$hill p/(list @tas)} :: mount points - {$mack p/(unit tang)} :: ack - {$mass p/mass} :: memory usage - {$mere p/(each (set path) (pair term tang))} :: merge result - {$note p/@tD q/tank} :: debug message - {$ogre p/@tas} :: delete mount point - {$writ p/riot} :: response - == :: -++ kiss-clay :: in request ->$ - $% {$boat $~} :: pier rebooted - {$drop p/@p q/@tas} :: cancel pending merge - {$info p/@p q/@tas r/nori} :: internal edit - {$init p/@p} :: report install - {$into p/@tas q/? r/mode} :: external edit - {$merg p/@p q/@tas r/@p s/@tas t/case u/germ} :: merge desks - {$mont p/@tas q/@p r/@tas s/path} :: mount to unix - {$ogre p/$@(@tas beam)} :: delete mount point - {$warp p/sock q/riff} :: file request - {$wegh $~} :: report memory - {$west p/sack q/path r/*} :: network request - == :: -:: -:::: - :: -++ blew {p/@ud q/@ud} :: columns rows -++ belt :: old belt - $% {$aro p/?($d $l $r $u)} :: arrow key - {$bac $~} :: true backspace - {$ctl p/@c} :: control-key - {$del $~} :: true delete - {$met p/@c} :: meta-key - {$ret $~} :: return - {$txt p/(list @c)} :: utf32 text - == :: -++ blit :: old blit - $% {$bel $~} :: make a noise - {$clr $~} :: clear the screen - {$hop p/@ud} :: set cursor position - {$lin p/(list @c)} :: set current line - {$mor $~} :: newline - {$sag p/path q/*} :: save to jamfile - {$sav p/path q/@} :: save to file - {$url p/@t} :: activate url - == :: -++ dill-belt :: new belt - $% {$aro p/?($d $l $r $u)} :: arrow key - {$bac $~} :: true backspace - {$cru p/@tas q/(list tank)} :: echo error - {$ctl p/@} :: control-key - {$del $~} :: true delete - {$hey $~} :: refresh - {$met p/@} :: meta-key - {$ret $~} :: return - {$rez p/@ud q/@ud} :: resize, cols, rows - {$txt p/(list @c)} :: utf32 text - {$yow p/gill} :: connect to app - == :: -++ dill-blit :: new blit - $% {$bel $~} :: make a noise - {$clr $~} :: clear the screen - {$hop p/@ud} :: set cursor position - {$mor p/(list dill-blit)} :: multiple blits - {$pro p/(list @c)} :: show as cursor+line - {$qit $~} :: close console - {$out p/(list @c)} :: send output line - {$sag p/path q/*} :: save to jamfile - {$sav p/path q/@} :: save to file - {$url p/@t} :: activate url - == :: -++ flog :: sent to %dill - $% {$crud p/@tas q/(list tank)} :: - {$heft $~} :: - {$text p/tape} :: - {$veer p/@ta q/path r/@t} :: install vane - {$vega p/path} :: reboot by path - {$verb $~} :: verbose mode - == :: -++ gill (pair ship term) :: general contact -:::: -++ gift-dill :: out result <-$ - $% {$bbye $~} :: reset prompt - {$blit p/(list blit)} :: terminal output - {$burl p/@t} :: activate url - {$init p/@p} :: set owner - {$logo $~} :: logout - {$mass p/mass} :: memory usage - {$veer p/@ta q/path r/@t} :: install vane - {$vega p/path} :: reboot by path - {$verb $~} :: verbose mode - == :: -++ kiss-dill :: in request ->$ - $% {$belt p/belt} :: terminal input - {$blew p/blew} :: terminal config - {$boot p/*} :: weird %dill boot - {$crud p/@tas q/(list tank)} :: error with trace - {$flog p/flog} :: wrapped error - {$flow p/@tas q/(list gill)} :: terminal config - {$hail $~} :: terminal refresh - {$heft $~} :: memory report - {$hook $~} :: this term hung up - {$harm $~} :: all terms hung up - {$init p/ship} :: after gall ready - {$tick p/@p q/@p} :: initial ticket - {$noop $~} :: no operation - {$talk p/tank} :: - {$text p/tape} :: - {$veer p/@ta q/path r/@t} :: install vane - {$vega p/path} :: reboot by path - {$verb $~} :: verbose mode - == :: -:: -:::: %eyre - :: -++ gram :: inter-ship message - =+ fuz={path *} :: ames format - $? {{$lon $~} p/hole} :: login request - {{$aut $~} p/hole} :: login reply - {{$hat $~} p/hole q/hart} :: login redirect - {{$get $~} p/@uvH q/{? clip httq}} :: remote request - {{$got $~} p/@uvH q/httr} :: remote response - {{$gib $~} p/@uvH} :: remote cancel - == :: -:::: :: -++ kiss-eyre :: in request ->$ - $% {$born $~} :: new unix process - {$crud p/@tas q/(list tank)} :: XX rethink - {$hiss p/mark q/cage} :: outbound user req - {$init p/@p} :: report install - {$them p/(unit hiss)} :: outbound request - {$they p/@ud q/httr} :: inbound response - {$this p/? q/clip r/httq} :: inbound request - {$thud $~} :: inbound cancel - {$wegh $~} :: report memory - {$west p/sack q/fuz:gram} :: network request - == :: -++ gift-eyre :: out result <-$ - $% {$mass p/mass} :: memory usage - {$mack p/(unit tang)} :: message ack - {$sigh p/cage} :: marked http response - {$thou p/httr} :: raw http response - {$thus p/@ud q/(unit hiss)} :: http request+cancel - {$veer p/@ta q/path r/@t} :: drop-through - {$vega p/path} :: drop-through - == :: -:: -:::: %ford - :: -++ hood :: assembly plan - $: zus/@ud :: zuse kelvin - sur/(list hoof) :: structures - lib/(list hoof) :: libraries - fan/(list horn) :: resources - src/(list hoop) :: program - == :: -++ hoof (pair term (unit (pair case ship))) :: resource reference -++ hoop :: source in hood - $% {$& p/twig} :: direct twig - {$| p/beam} :: resource location - == :: -++ horn :: resource tree - $% {$ape p/twig} :: /~ twig by hand - {$arg p/twig} :: /$ argument - {$day p/horn} :: /| list by @dr - {$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 - {$man p/(map span horn)} :: /* hetero map - {$nap p/horn} :: /_ homo map - {$now p/horn} :: /& list by @da - {$saw p/twig q/horn} :: /; operate on - {$see p/beam q/horn} :: /: relative to - {$sic p/twig q/horn} :: /^ cast - {$toy p/mark} :: /mark+ static - == :: -++ 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 - {$bunt p/mark} :: example of mark - {$call p/silk q/silk} :: slam - {$cast p/mark q/silk} :: translate - {$core p/beam} :: build program - {$diff p/silk q/silk} :: diff - {$dude p/(trap tank) q/silk} :: error wrap - {$file p/beam} :: from clay - {$flag p/(set $@(@uvH beam)) q/silk} :: add dependencies - {$join p/mark q/silk r/silk} :: merge - {$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 - {$reef $~} :: kernel reef - {$ride p/twig q/silk} :: silk thru twig - {$tabl p/(list (pair silk silk))} :: list - {$vale p/mark q/*} :: validate - {$volt p/(cask *)} :: unsafe add type - == :: -:::: -++ bilk (pair beak silk) :: sourced request -++ gage :: recursive cage+tang - $% {$& p/cage} :: success - {$| p/tang} :: error - {$tabl p/(list (pair gage gage))} :: table of results - == -++ gift-ford :: out result <-$ - $% {$made p/@uvH q/gage} :: computed result - {$mass p/mass} :: memory usage - {$news p/@uvH} :: fresh depends - == :: -++ kiss-ford :: in request ->$ - $% {$exec p/@p q/(unit bilk)} :: make / kill - {$wasp p/@p q/{@uvH ?}} :: depends ask / kill - {$wegh $~} :: report memory - == :: -:: -:::: %gall - :: -++ club :: agent action - $% {$peel p/mark q/path} :: translated peer - {$peer p/path} :: subscribe - {$poke p/cage} :: apply - {$puff p/mark q/noun} :: unchecked poke - {$pull $~} :: unsubscribe - {$punk p/mark q/cage} :: translated poke - {$pump $~} :: pump yes+no - == :: -++ cuft :: internal gift - $% {$coup p/(unit tang)} :: poke result - {$diff p/cage} :: subscription output - {$doff p/mark q/noun} :: untyped diff - {$quit $~} :: close subscription - {$reap p/(unit tang)} :: peer result - == :: -++ culm :: config action - $% {$load p/scup} :: load+reload - :: {$kick $~} :: restart everything - :: {$stop $~} :: toggle suspend - :: {$wipe $~} :: destroy all state - == :: -++ cush (pair term club) :: internal kiss -++ dude term :: server identity -++ scup (pair ship desk) :: autoupdate -++ well (pair desk term) :: -++ suss (trel dude @tas @da) :: config report -:::: :: -++ kiss-gall :: incoming request - $% {$conf p/dock q/culm} :: configure app - {$init p/ship} :: set owner - {$deal p/sock q/cush} :: full transmission - {$west p/sack q/path r/*} :: network request - {$wegh $~} :: report memory - == :: -++ gift-gall :: outgoing result - $% {$mass p/mass} :: memory usage - {$onto p/(each suss tang)} :: about agent - {$unto p/cuft} :: within agent - {$mack p/(unit tang)} :: message ack - == :: -:: -:::: %arvo - :: -++ gift-arvo :: out result <-$ - $? gift-ames - gift-clay - gift-dill - gift-eyre - gift-ford - gift-gall - gift-behn - == -++ kiss-arvo :: in request ->$ - $? kiss-ames - kiss-clay - kiss-dill - kiss-eyre - kiss-ford - kiss-gall - kiss-behn - == -++ note-arvo :: out request $-> - $? {@tas $meta vase} - $% {$a kiss-ames} - {$b kiss-behn} - {$c kiss-clay} - {$d kiss-dill} - {$e kiss-eyre} - {$f kiss-ford} - {$g kiss-gall} - == == -++ sign-arvo :: in result $<- - $% {$a gift-ames} - {$b gift-behn} - {$c gift-clay} - {$d gift-dill} - {$e gift-eyre} - {$f gift-ford} - {$g gift-gall} - == --- diff --git a/gen/bit/address-contact.hoon b/gen/bit/address-contact.hoon deleted file mode 100644 index bbc6289b7..000000000 --- a/gen/bit/address-contact.hoon +++ /dev/null @@ -1,14 +0,0 @@ - -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ arg/{address/@t contact/@t $~} $~} -:- %address-contact -[address.arg contact.arg] - - diff --git a/gen/bit/auth.hoon b/gen/bit/auth.hoon deleted file mode 100644 index c1f3bdc4e..000000000 --- a/gen/bit/auth.hoon +++ /dev/null @@ -1,11 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::: - !: -:- %say -|= {^ {arg1+cord arg2+cord $~} $~} -:- %auth -[arg1 arg2] diff --git a/gen/bit/buy.hoon b/gen/bit/buy.hoon deleted file mode 100644 index b1c52d590..000000000 --- a/gen/bit/buy.hoon +++ /dev/null @@ -1,11 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ {amount/@t currency/@t $~} $~} -:- %buy -[amount currency] diff --git a/gen/bit/contact-address.hoon b/gen/bit/contact-address.hoon deleted file mode 100644 index 9c55a7430..000000000 --- a/gen/bit/contact-address.hoon +++ /dev/null @@ -1,14 +0,0 @@ - -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ arg/{contact/@t address/@t $~} $~} -:- %bit-contact -[contact.arg address.arg] - - diff --git a/gen/bit/list.hoon b/gen/bit/list.hoon deleted file mode 100644 index 1829b3b32..000000000 --- a/gen/bit/list.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ $~ $~} -:- %list -~ - diff --git a/gen/bit/sell.hoon b/gen/bit/sell.hoon deleted file mode 100644 index 3ed11ff45..000000000 --- a/gen/bit/sell.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ {amount/@t currency/@t $~} $~} -:- %sell -[amount currency] - diff --git a/gen/bit/send.hoon b/gen/bit/send.hoon deleted file mode 100644 index 1f8a983ad..000000000 --- a/gen/bit/send.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::::: - !: -:- %say -|= {^ {to/@uc amo/@t $~} $~} -[%bit-send to amo] - - diff --git a/gen/cat.hoon b/gen/cat.hoon deleted file mode 100644 index 9339d22e1..000000000 --- a/gen/cat.hoon +++ /dev/null @@ -1,33 +0,0 @@ -:: ConCATenate file listings -:: -:::: /hoon+gen+cat - :: -// /%%/ls+subdir -// /%/pretty -!: -:::: - :: -:- %say -|= {^ {arg/(list path)} $~} -=- tang+(flop `tang`(zing -)) -%+ turn arg -|= pax/path -^- tang -=+ ark=;;(arch .^(%cy pax)) -?^ fil.ark - ?: =(%sched -:(flop pax)) - [>;;((map ,@da cord) .^(%cx pax))<]~ - [leaf+(spud pax) (pretty-file .^(%cx pax))] -?- dir.ark :: handle ambiguity - $~ - [rose+[" " `~]^~[leaf+"~" (smyt pax)]]~ -:: - {{@t $~} $~ $~} - $(pax (welp pax /[p.n.dir.ark])) -:: - * - =- [palm+[": " ``~]^-]~ - :~ rose+[" " `~]^~[leaf+"*" (smyt pax)] - `tank`(subdir pax dir.ark) - == -== diff --git a/gen/cat/pretty.hoon b/gen/cat/pretty.hoon deleted file mode 100644 index ff8973e2b..000000000 --- a/gen/cat/pretty.hoon +++ /dev/null @@ -1,25 +0,0 @@ -!: -|% -++ pretty-noun - |= pri=* ^- tank - ?~ pri - leaf+"~" - ?@ pri - leaf+?:(((sane %tas) pri) <`@tas`pri> ) - =< rose+[" " ?:(- "~[" "[") "]"]^+ - |- ^- [? (list tank)] - ?~ +.pri - [& ^$(pri -.pri) ~] - ?@ +.pri - [| ^$(pri -.pri) ^$(pri +.pri) ~] - [+< - +>]:[^$(pri -.pri) $(pri +.pri)] -:: -++ vale-cord |=(a=cord `?`(levy (trip a) |=(b=@ |((gte b 32) =(10 b))))) -:: -++ pretty-file - =+ wain-to-tang=|=(a=wain (turn a |=(b=cord leaf+(trip b)))) - |= fyl=* ^- tang - =+ `(unit wain)`?@(fyl `(lore fyl) ((soft wain) fyl)) - ?^ - (wain-to-tang u) - [(pretty-noun fyl)]~ --- diff --git a/gen/coin/keys.hoon b/gen/coin/keys.hoon deleted file mode 100644 index 7cdbd3935..000000000 --- a/gen/coin/keys.hoon +++ /dev/null @@ -1,11 +0,0 @@ -:: -:::: - :: -/? 310 -:: -:::: - !: -:- %say -|= [^ [arg=(list cord) ~]] -:- %keys -arg diff --git a/gen/curl.hoon b/gen/curl.hoon deleted file mode 100644 index f813331c2..000000000 --- a/gen/curl.hoon +++ /dev/null @@ -1,6 +0,0 @@ -/- sole -[sole] -:- %get |= {^ {a/tape $~} $~} -%+ sole-at (scan a auri:epur) -|= hit/httr -(sole-so %httr hit) diff --git a/gen/curl/url.hoon b/gen/curl/url.hoon deleted file mode 100644 index db33d0e56..000000000 --- a/gen/curl/url.hoon +++ /dev/null @@ -1,10 +0,0 @@ -:: -:::: - :: -/? 310 -:: -::::: - !: -:- %say -|= {^ {arg/tape $~} $~} -purl+(scan arg auri:epur) diff --git a/gen/hello.hoon b/gen/hello.hoon deleted file mode 100644 index 23cec09c9..000000000 --- a/gen/hello.hoon +++ /dev/null @@ -1,11 +0,0 @@ -:: -:::: /hoon+hello+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= {^ {{txt/@tas $~} $~}} -:- %noun -(crip (weld "hello, " (flop (trip txt)))) diff --git a/gen/hood/ask.hoon b/gen/hood/ask.hoon deleted file mode 100644 index 90942a322..000000000 --- a/gen/hood/ask.hoon +++ /dev/null @@ -1,6 +0,0 @@ -:- %say -|= {^ {mel/cord $~} $~} -=+ adr=(star ;~(less (mask "\"\\()[],:;<>@") prn)) -=+ dom=[;~(plug dlab dot (most dot dlab))]:urlp -=+ ~|(bad-email+mel (rash mel ;~((glue pat) adr dom))) -helm-send-ask+mel diff --git a/gen/hood/begin.hoon b/gen/hood/begin.hoon deleted file mode 100644 index 3e1c72bcd..000000000 --- a/gen/hood/begin.hoon +++ /dev/null @@ -1,58 +0,0 @@ -:: -:::: /hoon+begin+hood+gun - :: -/? 314 -/- sole -:: -:::: - !: -=> |% - ++ begs {his/@p tic/@p yen/@t ges/gens} - ++ scug |*({a/@ b/(pole)} ?~(b ~ ?~(a ~ [-.b $(b +.b, a (dec a))]))) - -- -[sole .] -:- %ask -|= $: {now/@da eny/@uvI bec/beak} - {arg/_(scug *@ ~{his/*@p tic/*@p})} - safety/?($on $off) - == -^- (sole-result (cask begs)) -?. =(safety %off) - %+ sole-yo - :- %leaf - "|begin is deprecated, please invoke urbit with -w [name] -t [ticket]" - sole-no -=- ?~ arg - - =+ (fun.q.q his.arg) - ?~ +.arg - - (fun.q.q tic.arg) -%+ sole-lo - [%& %helm-begin "your urbit: ~"] -%+ sole-go fed:ag -|= his/@p -%+ sole-lo - [%& %helm-ticket "your ticket: ~"] -%+ sole-go fed:ag -|= tic/@p -%+ sole-lo - [%& %helm-entropy "some entropy: "] -%+ sole-go (boss 256 (more gon qit)) -|= yen/@t -=+ ney=(shax yen) -%+ sole-yo `tank`[%leaf "entropy check: {(scow %p `@p`(mug ney))}"] -%+ sole-so %helm-begin -:* his - tic - ney -:: - ^- gens - :- %en - =+ can=(clan his) - ?- can - $czar [%czar ~] - $duke [%duke %anon ~] - $earl [%earl (scot %p his)] - $king [%king ?:(=(~doznec his) 'Urban Republic' (scot %p his))] - $pawn [%pawn ~] - == -== diff --git a/gen/hood/breload.hoon b/gen/hood/breload.hoon deleted file mode 100644 index 650bf1614..000000000 --- a/gen/hood/breload.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/(list term) $~} - == -:+ %helm-reload-desk %base -arg diff --git a/gen/hood/cancel.hoon b/gen/hood/cancel.hoon deleted file mode 100644 index aa5ac15ca..000000000 --- a/gen/hood/cancel.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+cancel+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{syd/@tas $~} $~} - == -:- %kiln-cancel -syd diff --git a/gen/hood/cp.hoon b/gen/hood/cp.hoon deleted file mode 100644 index cbccfbddb..000000000 --- a/gen/hood/cp.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ {input/path output/path $~} $~} kiln-cp+[input output]) diff --git a/gen/hood/deset.hoon b/gen/hood/deset.hoon deleted file mode 100644 index 0616c983b..000000000 --- a/gen/hood/deset.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+deset+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/$~ $~} - == -[%helm-deset ~] diff --git a/gen/hood/hi.hoon b/gen/hood/hi.hoon deleted file mode 100644 index 508f78e60..000000000 --- a/gen/hood/hi.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ {who/ship mez/$@($~ {a/tape $~})} $~} helm-send-hi+[who ?~(mez ~ `a.mez)]) diff --git a/gen/hood/init.hoon b/gen/hood/init.hoon deleted file mode 100644 index e19ed47eb..000000000 --- a/gen/hood/init.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {$~ $~} - == -:- %hood-init -p.bec diff --git a/gen/hood/invite.hoon b/gen/hood/invite.hoon deleted file mode 100644 index be5ee36c5..000000000 --- a/gen/hood/invite.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+invite+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{who/@p myl/@t $~} $~} - == -[%helm-invite who myl] diff --git a/gen/hood/label.hoon b/gen/hood/label.hoon deleted file mode 100644 index 1fa5f3282..000000000 --- a/gen/hood/label.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+label+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/{syd/desk lab/@tas $~} $~} - == -:- %kiln-label -[syd lab]:arg diff --git a/gen/hood/link.hoon b/gen/hood/link.hoon deleted file mode 100644 index 811e8a463..000000000 --- a/gen/hood/link.hoon +++ /dev/null @@ -1,15 +0,0 @@ -:: -:::: /hoon+link+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI byk/beak} - {arg/$?({dap/term $~} {who/ship dap/term $~}) $~} - == -:- %drum-link -?~ +.arg - [p.byk dap.arg] -[who.arg dap.arg] diff --git a/gen/hood/mass.hoon b/gen/hood/mass.hoon deleted file mode 100644 index 5ff359a54..000000000 --- a/gen/hood/mass.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+mass+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/$~ $~} - == -[%helm-mass ~] diff --git a/gen/hood/merge.hoon b/gen/hood/merge.hoon deleted file mode 100644 index 4ce5ca8df..000000000 --- a/gen/hood/merge.hoon +++ /dev/null @@ -1,33 +0,0 @@ -:: -:::: /hoon+merge+hood+gen - :: -/? 314 -!: -|% -++ beaky {span span span $~} -++ sorc ?({bek/beaky $~} {her/@p sud/@tas $~}) --- -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bek/beak} - {arg/{?(sorc {syd/$@(desk beaky) sorc})} gem/?($auto germ)} - == -=* our p.bek -|^ :- %kiln-merge - ^- {syd/desk her/ship sud/desk gem/?($auto germ)} - ?- arg - {@ @ $~} =+(arg [sud ?.(=(our her) her (sein her)) sud gem]) - {^ $~} =+((pars bek.arg) [dez ?.(=(our who) who (sein who)) dez gem]) - {* @ @ $~} [(pars-src syd.arg) =+(arg [her sud gem])] - {* ^ $~} [(pars-src syd.arg) =+((pars bek.arg) [who dez gem])] - == -++ pars |=(a/beaky =+((need (tome a)) `{who/ship dez/desk}`{p q})) -++ pars-src - |= syd=$@(desk beaky) - ?@ syd syd - =+ (pars syd) - ~| [%into-foreign who `path`syd] - ?>(=(our who) dez) --- diff --git a/gen/hood/mv.hoon b/gen/hood/mv.hoon deleted file mode 100644 index 88f4df57e..000000000 --- a/gen/hood/mv.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ {input/path output/path $~} $~} kiln-mv+[input output]) diff --git a/gen/hood/overload.hoon b/gen/hood/overload.hoon deleted file mode 100644 index 517e2fbee..000000000 --- a/gen/hood/overload.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+overload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{arg/term $~} $~} - == -:- %kiln-overload -arg diff --git a/gen/hood/rc.hoon b/gen/hood/rc.hoon deleted file mode 100644 index f7711656c..000000000 --- a/gen/hood/rc.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/$~ $~} - == -[%helm-reload ~[%c]] diff --git a/gen/hood/reboot.hoon b/gen/hood/reboot.hoon deleted file mode 100644 index 57d9f85b6..000000000 --- a/gen/hood/reboot.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/$~ $~} - == -[%helm-reload ~[%z %a %b %c %d %e %f %g]] diff --git a/gen/hood/reload-desk.hoon b/gen/hood/reload-desk.hoon deleted file mode 100644 index 3560a4202..000000000 --- a/gen/hood/reload-desk.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/{desk (list term)} $~} - == -:- %helm-reload-desk -arg diff --git a/gen/hood/rf.hoon b/gen/hood/rf.hoon deleted file mode 100644 index ce9a62474..000000000 --- a/gen/hood/rf.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: -:::: /hoon+reload+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/$~ $~} - == -[%helm-reload ~[%f]] diff --git a/gen/hood/rm.hoon b/gen/hood/rm.hoon deleted file mode 100644 index b350b79d4..000000000 --- a/gen/hood/rm.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ {input/path $~} $~} kiln-rm+input) diff --git a/gen/hood/schedule.hoon b/gen/hood/schedule.hoon deleted file mode 100644 index 86ac4c3b1..000000000 --- a/gen/hood/schedule.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ {where/path tym/@da eve/@t $~} $~} kiln-schedule+[where tym eve]) diff --git a/gen/hood/sync.hoon b/gen/hood/sync.hoon deleted file mode 100644 index d70ff4815..000000000 --- a/gen/hood/sync.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+sync+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/{syd/@tas her/@p sud/@tas $~} $~} - == -:- %kiln-sync -[syd her sud]:arg diff --git a/gen/hood/unix.hoon b/gen/hood/unix.hoon deleted file mode 100644 index ab9412c94..000000000 --- a/gen/hood/unix.hoon +++ /dev/null @@ -1,16 +0,0 @@ -:: -:::: /hoon+unix+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{syd/@tas syn/?($~ {? $~})} $~} - == -:+ %hood-unix - syd -?~ syn - ~ -`-.syn diff --git a/gen/hood/unlink.hoon b/gen/hood/unlink.hoon deleted file mode 100644 index 9d6f2d69b..000000000 --- a/gen/hood/unlink.hoon +++ /dev/null @@ -1,15 +0,0 @@ -:: -:::: /hoon+link+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI byk/beak} - {arg/$?({dap/term $~} {who/ship dap/term $~}) $~} - == -:- %drum-unlink -?~ +.arg - [p.byk dap.arg] -[who.arg dap.arg] diff --git a/gen/hood/unmount.hoon b/gen/hood/unmount.hoon deleted file mode 100644 index 38eb415b4..000000000 --- a/gen/hood/unmount.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+mount+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{mon/$@(term {span path}) $~} $~} - == -:- %kiln-unmount -mon diff --git a/gen/hood/unsync.hoon b/gen/hood/unsync.hoon deleted file mode 100644 index c2144f7bd..000000000 --- a/gen/hood/unsync.hoon +++ /dev/null @@ -1,13 +0,0 @@ -:: -:::: /hoon+unsync+hood+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {arg/{syd/@tas her/@p sud/@tas $~} $~} - == -:- %kiln-unsync -[syd her sud]:arg diff --git a/gen/ls.hoon b/gen/ls.hoon deleted file mode 100644 index f63a9b276..000000000 --- a/gen/ls.hoon +++ /dev/null @@ -1,12 +0,0 @@ -:: LiSt directory subnodes -:: -:::: /hoon+ls+gen - :: -// /%/subdir -!: -:::: - :: -:- %say -|= {^ {arg/path $~} $~} -=+ lon=((hard arch) .^(%cy arg)) -tang+[?~(dir.lon leaf+"~" (subdir arg dir.lon))]~ diff --git a/gen/ls/subdir.hoon b/gen/ls/subdir.hoon deleted file mode 100644 index 500922f3a..000000000 --- a/gen/ls/subdir.hoon +++ /dev/null @@ -1,20 +0,0 @@ -|% -++ subdir - |= {pax/path des/(map @t $~)} - ^- tank - :+ %rose [" " `~] - %+ turn (sort (~(tap by des)) aor) - |= {kid/@ta $~} - =+ paf=`path`/[kid] - =- :+ %rose ["/" ~ ?:(dir "/" ~)] - (turn paf |=(a/span leaf+(trip a))) - |- ^- {dir/? paf/path} - =+ arf=;;(arch .^(%cy (weld pax paf))) - ?^ fil.arf - [| paf] - ?~ dir.arf - [& paf] :: !! - ?. ?+({^ $~ $~} dir.arf) - [& paf] - $(paf (welp paf /[p.n.dir.arf])) --- diff --git a/gen/make.hoon b/gen/make.hoon deleted file mode 100644 index 9e7527560..000000000 --- a/gen/make.hoon +++ /dev/null @@ -1,2 +0,0 @@ -:- %say -|=({^ arg/(list @) foo/_`@`1 bar/_`@`2} noun+[arg foo bar]) diff --git a/gen/moon.hoon b/gen/moon.hoon deleted file mode 100644 index 2d797ccac..000000000 --- a/gen/moon.hoon +++ /dev/null @@ -1,16 +0,0 @@ -:: -:::: /hoon+ticket+gen - :: -/? 314 -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvI bec/beak} - [$~ $~] - == -:- %noun -?> =(1 (met 5 p.bec)) -=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec) -=+ tic=((hard @p) .^(/a+(scot %p p.bec)/tick+(scot %da now)/(scot %p mon))) -"moon: {<`@p`mon>}; ticket: {}" diff --git a/gen/pope.hoon b/gen/pope.hoon deleted file mode 100644 index b16171e0a..000000000 --- a/gen/pope.hoon +++ /dev/null @@ -1,24 +0,0 @@ -:: Input twitter keys -/- sole -!: -=+ cryp=bruw :: XX change to ec2 ++brew eventually -=+ [sole] -:- %ask -|= $: {now/@da eny/@uvI bec/beak} - {{who/ship $~} $~} - == -^- (sole-result (cask tang)) -%+ sole-yo leaf+"generating carrier {(scow %p who)} (#{(scow %ud who)})" -%+ sole-lo [%| %pope-pass "passphrase: "] -%+ sole-go (boss 256 (star prn)) -|= fra/@t -%+ sole-lo [%| %pope-none "[press enter to compute]"] :: XX oy -%+ sole-go (easy ~) -|= $~ -=+ bur=(shax (add who (shax fra))) -~& %computing-fingerprint -=+ arc=(cryp 2.048 bur) -%+ sole-so %tang -:~ leaf+"generator: {(scow %uw bur)}" - leaf+"fingerprint: {(scow %uw fig:ex:arc)}" -== diff --git a/gen/tree.hoon b/gen/tree.hoon deleted file mode 100644 index fe2486910..000000000 --- a/gen/tree.hoon +++ /dev/null @@ -1,21 +0,0 @@ -:: Tree view recursive directory contents -:: -:::: /hoon+tree+gen - :: -!: -:::: - :: -:- %say -|= {^ {pax/path fla/$@($~ {$full $~})} $~} -=+ len=(lent pax) -=+ rend=?^(fla smyt |=(a/path (smyt (slag len a)))) -:- %tang %- flop -|- ^- tang -=+ ark=;;(arch .^(cy+pax)) -=- ?~ fil.ark - - [(rend pax) -] -%- zing -%+ turn - (sort (~(tap by dir.ark)) aor) -|= {a/@t $~} -^$(pax (welp pax /[a])) diff --git a/gen/twit/as.hoon b/gen/twit/as.hoon deleted file mode 100644 index 2fc5671c5..000000000 --- a/gen/twit/as.hoon +++ /dev/null @@ -1,10 +0,0 @@ -/- twitter -:: -:::: - :: -[twitter .] -:- %say -|= $: {now/@da eny/@uvI bec/beak} - {{who/span msg/cord $~} $~} - == -[%twit-do [who %post eny msg]] diff --git a/gen/twit/auth.hoon b/gen/twit/auth.hoon deleted file mode 100644 index 030f10c2a..000000000 --- a/gen/twit/auth.hoon +++ /dev/null @@ -1,20 +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]) - diff --git a/gen/twit/tweet.hoon b/gen/twit/tweet.hoon deleted file mode 100644 index f4eb808ab..000000000 --- a/gen/twit/tweet.hoon +++ /dev/null @@ -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 received {}"])) -++ pour |*({ost/@ * sih/{@ ^}} :_(+>.$ [ost %give +.sih]~)) --- diff --git a/gen/twit/twitter-feed.hoon b/gen/twit/twitter-feed.hoon deleted file mode 100644 index f92f1f78a..000000000 --- a/gen/twit/twitter-feed.hoon +++ /dev/null @@ -1,22 +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+"{} @{(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))) --- diff --git a/lib/down-jet.hoon b/lib/down-jet.hoon deleted file mode 100644 index 2f5813a11..000000000 --- a/lib/down-jet.hoon +++ /dev/null @@ -1,19 +0,0 @@ -:: -:::: /hoon+down-jet+lib - :: -/- markdown -:: -:::: - :: -[markdown .] -// /%/parse :: inli donp parse -// /%/rend :: sing sung sang flat into-inner -~% %down ..is ~ -|% -++ mark - ~/ %mark - |= p/@t - (normalize (rash p parse)) -:: -++ print sing --- diff --git a/lib/down-jet/parse.hoon b/lib/down-jet/parse.hoon deleted file mode 100644 index b35e4db92..000000000 --- a/lib/down-jet/parse.hoon +++ /dev/null @@ -1,1002 +0,0 @@ -:: Core markdown parser, exposed as ++parse -:: -:::: - :: -=+ =~ -|% -++ loca |*(a/_* {p/@u q/a}) -++ stack (list (loca tops)) --- -|% -++ htm-enty :: XX belongs in zuse - ~+ - =- |= tub/nail ^- (like @t) %. tub :: export context - =+(poxa enty(ent mapping)) - ^- mapping/(map span @tF) - =+ pax=/==5%%/html5-entities/json :: XX %%/ - =+ maf=%.(pax ;~(biff file (soft json) (om so):jo)) - ?^ maf u.maf - ~& no-enty+pax - (mo amp+'&' quot+'"' apos+'\'' lt+'<' gt+'>' ~) :: fallback -:: -++ skem-symb (star ;~(pose dot alp)) -++ skem-set ~+ ^- (set cord) :: URI schemes - :: (sa `wain`/http+https+javascript) - =- (sa `wain`(rash - (more gah (cook crip skem-symb)))) - ''' - coap doi javascript aaa aaas about acap cap cid crid data dav dict dns file - ftp geo go gopher h323 http https iax icap im imap info ipp iris iris.beep - iris.xpc iris.xpcs iris.lwz ldap mailto mid msrp msrps mtqp mupdate news nfs - ni nih nntp opaquelocktoken pop pres rtsp service session shttp sieve sip sips - sms snmp soap.beep soap.beeps tag tel telnet tftp thismessage tn3270 tip tv - urn vemmi ws wss xcon xcon-userid xmlrpc.beep xmlrpc.beeps xmpp z39.50r - z39.50s adiumxtra afp afs aim apt attachment aw beshare bitcoin bolo callto - chrome chrome-extension content cvs com-eventbrite-attendee dlna-playsingle - dlna-playcontainer dtn dvb ed2k facetime feed finger fish gg git gizmoproject - gtalk hcp icon ipn irc irc6 ircs itms jar jms keyparc lastfm ldaps magnet maps - market message mms ms-help msnim mumble mvn notes oid palm paparazzi platform - proxy psyc query res resource rmi rsync rtmp secondlife sftp sgn skype smb - soldat spotify ssh steam svn teamspeak things udp unreal ut2004 ventrilo - view-source webcal wtai wyciwyg xfire xri ymsgr - ''' -:: -++ uri-skem (sear (flit |=(a/tape (~(has in skem-set) (cass a)))) skem-symb) --- -:: -:::: - :: -|% -++ nal (just `@`10) -++ end (full (easy ~)) -++ eol ;~(pose (cold ~ nal) end) -::++ match |=(a/rege (curr scan (ra a))) -:: -++ tab - |= tub/nail - ^- (like cord) - ?. ?=({$9 *} q.tub) - (fail tub) - =+ sto=+((~(inv fe 1) (dec q.p.tub))) :: virt spaces produced - =+ neu=(weld (reap sto ' ') t.q.tub) - (next tub(q neu)) -:: -++ whif |*(a/rule ;~(sfix a (star ace))) -++ ahed |*(a/rule ;~(simu a (easy ~))) -++ opts |*(a/rule ;~((bend) (easy ~) a)) -++ lots |*({a/@u b/rule} ;~(pfix (stun [a a] b) (star b))) -++ leas |*(a/rule ;~(pfix ;~(less (stun 4^4 ace) (stun 0^3 ace)) a)) -++ pech - |* a/{rule rule} - |= tub/nail - ^- (like (each _(wonk (-.a)) _(wonk (+.a)))) - %. tub - ;~(pose (stag %& -.a) (stag %| +.a)) -:: -++ lite :: literal matched - |* a/rule - |= tub/nail ^- (like tape) - =+ vex=(a tub) - ?~ q.vex vex - =+ tap=q.q.u.q.vex - =- vex(p.u.q -) - |- ^+ "" - ?: =(tap q.tub) ~ - ?~ q.tub !! - [i.q.tub $(q.tub t.q.tub)] -:: -++ enrule :: XX - |* a/$+(tape *) - |= tub/nail - ^- (like a) - [[0 0] ~ (a q.tub) [0 0] ~] --- == - =~ -|% -++ strip - |= {a/$+(nail edge) b/tape} - ^- tape - =+ q:(a 1^1 b) - ?~(- b q.q.u.-) -:: -++ inli :: inline parsers - =+ [bug=| rec="" nol=|] - |_ ref/(map cord {p/tape q/(unit tape)}) - ++ unesc - |= a/tape - (scan a (star ;~(pose nore(rec ~) nal))) :: XX - :: - ++ esc - ;~ pfix bas - (mask "!\"#$%&'()*+,-./:;<=>?@[\\]^_`\{|}~") - == - ++ spec (mask rec) - ++ norc ~+ ;~(pose esc ;~(less spec prn)) - ++ nore ~+ ;~(pose htm-enty norc) - :: - ++ trim-sp - |= a/tape - ^- tape - %+ strip (star gah) - (flop (strip (star gah) (flop a))) - :: - ++ child - =< |= tub/nail ^- (like inline) %. tub :: expose parsers - %+ cook |=(a/inline ~?(bug a a)) - ;~(pose code line link blot:link htmt) - |% - ++ fens - |= a/tape - %+ knee *tape |. ~+ - |= tub/nail ^- (like tape) - =+ vex=((plus tec) tub) - ?~ q.vex - (plug (codc tub) ^^$) - ?: =(a p.u.q.vex) - vex(p.u.q ~) - =+ neu=|=(b/tape (weld `tape`p.u.q.vex b)) - ((cook neu ^^$) q.u.q.vex) - :: - ++ codc ;~(pose (cold ' ' (plus gah)) prn) - ++ code - =- ;~(pose - (stag %$ (plus tec))) - %+ stag %code - %+ cook trim-sp - |= tub/nail - ?. ?=({$'`' ^} q.tub) - (fail tub) - =+ vex=((plus tec) tub) - (pfix vex (fens (wonk vex))) - :: - ++ madn - |= a/mane ^- ? - => |=(b/span ?=(^ (rush b ;~(plug alf (star aln))))) - ?@ a (. a) - &((. -.a) (. +.a)) - :: - ++ htmt - %+ stag %htmt - =- (cook crip (lite -)) :: XX - %- sear :_ - ;~(pose empt:poxa (pech [head tail]:poxa)) - %- flit - |= a/$^({marx $~} $%({$& marx} {$| p/mane})) - ?- -.a - ^ (madn n.a) - $& (madn n.a) - $| (madn p.a) - == - :: - ++ line - %+ cold [%line ~] - ;~(plug ;~(pose (lots 2 ace) bas) nal) - :: - ++ empty - |= a/inline - ^- ? - ?& ?=($$ -.a) - ?=($~ (strip (star ;~(pose ace nal)) p.a)) - == - :: - ++ link ::=+(blot=fail |=(nail (fail +<))) - =< =- |=(tub/nail (pra tub)) :: expose parsers - ?: nol pra=auto ::;~(pose auto pexp) - =- pra=;~(pose auto (cook - apex)) - |=({a/kids b/{tape (unit tape)}} [[%link b] a]) - |% - ++ apex - =+ ^- rob/$+(nail (like {kids $@(cord {tape (unit tape)})})) - ;~(plug text(nol &) labe) - :: - |= tub/nail - ^- (like (pair kids {tape (unit tape)})) - :: (fail tub) - =+ vex=(rob tub) - ?~ q.vex - vex - =- ?~(rez vex(q ~) vex(+.p.u.q u.rez)) - ^- rez/(unit {tape (unit tape)}) - =+ [~ atr]=(wonk vex) - ?^ atr - `atr - ?. ?=($~ atr) - (~(get by ref) atr) - =+ vux=(text:href tub) - ?~ q.vux ~ - (~(get by ref) (wonk vux)) - :: - ++ text - =. rec ['[' ']' rec] - (ifix sel^ser many) - :: - ++ titl (opts ;~(pfix (plus gah) titl:href)) - ++ labe - =+ wra=[;~(plug pel .) ;~(plug . per)]:(star gah) - ;~ pose - (ifix wra ;~(plug dest:href titl)) - ;~(pfix (star gah) text:href) - (easy '') - == - :: - ++ blot - %- cook :_ ;~(pfix zap [.(rob ;~(plug text labe))]:apex) - |=({a/kids b/{tape (unit tape)}} [[%blot b] a]) - :: - ++ mail - %+ cook |=(_[a="" b='' c="" d=*wall] :(welp a b^c (zing d))) - ;~ plug - (plus ;~(less (mask "\"\\ (),:;<>@[]") prn)) - pat - (plus alp) - (star ;~(plug dot (plus alp))) - == - :: - ++ auto - %+ ifix gal^gar - ;~ pose - (cook |=(a/tape [link+["mailto:{a}" ~] ~[`a]]) mail) - :: - =+ cha=;~(pose htm-enty ;~(less (mask "<> ") prn)) - %+ cook - |= a/_["" ""] - [link+[(weld a) ~] ~[`(weld a)]] - ;~(plug uri-skem col (star cha)) - == - :: - ++ pexp :: XX non-link nested - %- cook :_ (ifix sel^ser many) - |=(a/kids (reso:many "[" (welp a `"]" ~))) - -- - -- - :: - ++ href - =< |= tub/nail %. tub :: expose parsers - ;~ plug - ;~(sfix text col (star gah)) - (sear (flit |=(tape ?=(^ +<))) dest) - ;~(sfix (opts ;~(pfix (plus gah) titl)) (star ace) eol) - == - |% - ++ dest - ;~ pose - (ifix gal^gar (star ;~(pose esc nore(rec "<>")))) - (pexp nore(rec " ")) - == - ++ pexp - |* cha/rule - =+ chu=;~(less pel per cha) - |- :: XX Chesterton fence - %+ knee *tape |. ~+ - ;~ pose - ;~(plug chu ^$) - ;~(plug pel (cook welp ;~(plug (star chu) per ^$))) - (easy ~) - == - ++ text - =- (ifix sel^ser (cook cass (star -))) - ;~ pose - (cook |=(a/char (cat 3 '\\' a)) esc) - (cold ' ' (plus gah)) - ;~(less sel ser prn) - == - ++ titl - %. ~[soq^soq doq^doq pel^per] - |* a/(pole {rule rule}) - ?~ a fail - ;~ pose - (ifix -.a (star ;~(pose esc htm-enty ;~(less ->.a prn)))) - $(a +.a) - == - -- - ++ consol - |= a/kids - ^- kids - ?~ a ~ - ?+ -.i.a [i.a $(a t.a)] - $$ - ?~ t.a a - ?: ?=(_-.i.a -.i.t.a) - $(a t.a(p.i (weld p.i.a p.i.t.a))) - [i.a $(a t.a)] - == - ++ pars :: XX - => |% - ++ nufh {tape kids} - ++ fens ?($'*' $'_') - ++ nuft {nufh ?(tape {tape ?($| fens)})} - ++ reso - |= a/nufh - ^- kids - ?~ -.a +.a - [[%$ -.a] +.a] - :: - ++ veld - |= {a/$@(char inline) _[b c]=*nuft} - ^- nuft - :_ c - ?@ a - [[a -.b] +.b] - ?~ -.a - [(weld p.a -.b) +.b] - [~ a (reso b)] - :: - ++ rend - |= nuf/nufh - %. (reso nuf) - |= a/kids - ^- tape - ?~ a ~ - %- weld :_ $(a t.a) - ?@ -.i.a - ?+ -.i.a - $~ p.i.a - == - =+ [p q]=i.a - ?+ -.p "[{(trip -.p)}]<{$(a q)}>" - $emph "({$(a q)})" - == - -- - |= tap/tape ^- kids - =. tap (trim-sp tap) - =+ vex=(many 1^1 tap) - ?~ q.vex - ~ - =+ [a ~ b]=u.q.vex - ?~(b a (welp a [`b]~)) - :: - ++ many - => pars :: XX - |= tub/nail ^- (like kids) - =- [[0 0] ~ (reso -<) [0 0] ;;(tape ->)] :: XX - =+ [ins=`?(fens $~)`~ bof=| noz=|] - ?~ q.tub [`~ ~] - =+ [p=*char [i t]=[i t]:q.tub] :: prev current next - =< ?<(&(?=({* @} +) !?=($~ +>)) .) :: XX do type stuff - |^ ^- nuft - ?: ?=(?($'*' $'_') i) - dlim - =+ elm=(;~(pose child ;~(pfix (star ace) nal) nore) [1 1] i t) - ?~ q.elm - done(t [i t]) :: XX next? - =+ [a ~ b]=u.q.elm - ~? bug [a b] - (push(t b) a) - :: - ++ next (push i) - ++ push :: continue with head - |= a/$@(char inline) - ^- nuft - ~? ?@(a | bug) fon+a - ?~ t (veld a done) - =: noz & - i i ::?+(i i fens p) - == - (veld a ^$(+< [i t])) - :: - ++ done [[~ ~] ?~(ins t [t %|])] - :: - ++ pull :: consume chunk - ^- nuft - ?> ?=(fens i) :: XX do type stuff - =: bof ?~(ins | |(bof !=(ins i))) - ins i - noz | - == - ?~ t - (veld i done) - $(+<+ t) - :: - ++ flome - |= a/_+:*nuft - ^- {(unit ?($| fens)) tape} - ?. ?=({* ?($| fens)} a) - [~ a] - [[~ +.a] -.a] - :: - ++ empa - |= a/nufh - ^- inline - [[%emph |] (reso a)] - :: - ++ ends - |= {a/tape b/tape} - ?: &(?=(^ b) =(i i.b)) - $(b t.b) - ?: &(?=(^ a) =(i i.a)) - $(a t.a) - ?> ?=(fens i) :: XX do type stuff - ?& |(?=($~ b) !=(' ' i.b)) - |(=('*' i) [?=($~ q)]:(aln 1^1 a)) - == - :: - ++ dlim - ^- nuft - ~? bug [&3 &2] - =+ clo=&(noz !=(~ ins) (ends t p ~)) :: can close delim - ?: &(clo =(ins i)) :: correct close - [`~ t] - ?: &(bof !=(ins i)) :: outer close - ?> ?=(fens i) :: XX do type stuff - [`~ t i] - ?~ t - (veld i done) - ?. (ends [p]~ t) - next - =+ [a tak]=pull - => .(t `_""`t) :: XX do type stuff - =^ b t (flome tak) - ?~ b - (push (empa a)) - ~? > bug clot+[a i t] - ?: =(i u.b) - (push (empa a)) - ?~ ins :: outermost - [a(- [i -.a]) t] ::(veld i a t) - [a(- [i -.a]) t u.b] ::(veld i a t u.b) - -- - :: - -- --- -:: -:::: - :: -|% -++ nesting $% {$bloq *} :: Used for fishing - {$item *} - {$list {$item $~}} - == -++ accepting ?($para $code) -++ list-nest :: can add list item? - =+ sam=[?>(?=($list -.p..) p..)]:(tops [%list ~]~) :: XX do type stuff - |= {a/_sam b/_sam} ^- ? - .= ?@(q.a q.a q.q.a) :: by checking delimiter characters - ?@(q.b q.b q.q.b) -:: -:: =- =((cha p.a) (cha p.b)) -:: ^= cha -:: |= a=_sam -:: ?@(q.a q.a q.q.a) -:: -++ closes-code - =+ sam=[?>(?=($code -) p..)]:(node [%code ~]) :: XX do type stuff - |= {a/_sam b/_sam} - ?~ a ?=($~ b) - ?~ b | - ?^ r.u.b | - ?& =(p.u.a p.u.b) - (gte q.u.b q.u.a) - == -:: -++ blank - |= a/tape ^- ? - ?~ a & - &(=(' ' i.a) $(a t.a)) -:: -++ dehax :: strip trailing hax - =+ nobas=;~(sfix (plus hax) ;~(pose ace end)) - |= a/tape - %- flop - :(strip nobas (star ace) (flop a)) -:: -++ scab - |* {a/tape b/rule} - (wonk (b [1 1] a)) -:: -++ donp - |% - ++ blok - :~ %article %aside %blockquote %body %button %canvas %caption %col - %colgroup %dd %div %dl %dt %embed %fieldset %figcaption %figure - %footer %footer %form %h1 %h2 %h3 %h4 %h5 %h6 %header %hgroup - %hr %iframe %li %map %object %ol %output %p %pre %progress - %script %section %style %table %tbody %td %textarea %tfoot - %th %thead %tr %ul %video - == - ++ htm-head =+ blu=(flit ~(has in (sa `wain`blok))) - =+ blo=(sear blu (cook cass (star aln))) - %+ stag %html - ;~ plug gal - ;~ pose - ;~(plug blo ;~(pose fas gar gah)) - ;~(plug fas blo ;~(pose gar gah)) - (mask "?!") - == - == - ++ leaf (leas ;~(pose head hrul fcode)) :: any node - ++ head - %+ cook |=(a/tape [%head (lent a) ~]) - ;~(sfix (stun 1^6 hax) ;~(pose ace (ahed eol))) - :: - ++ hrul - %+ cold [%hrul ~] - %. ~[tar hep cab] :: (vary "*-_") - |* a/(pole rule) - ?~ a fail - ;~(pose ;~(plug (lots 3 (whif -.a)) (ahed eol)) $(a +.a)) - :: - ++ limar :: list marker - %+ stag %list - %- leas - %+ stag & - =- ;~(sfix - ;~(pose (ahed eol) ;~(sfix ace ;~(pose (leas) (easy))))) - ;~ pose - (mask "*+-") - ;~(plug dem (mask ".)")) - == - :: - ++ line - ;~(sfix (star prn) eol) - :: - ++ blomar - %+ cold [%bloq ~] - %- leas - ;~ pose - ;~(plug gar ace) - gar - == - ++ setext - %- leas - ;~(sfix ;~(pose (cold 2 (plus hep)) (cold 1 (plus tis))) (star ace)) - ++ icode (cold `node`[%code ~ ~] (stun 4^4 ace)) - ++ fcode - %. ~['`' '~'] :: (vary "`~") - |* a/(pole char) - ?~ a fail - =- ;~(pose fel $(a +.a)) - ^= fel - %- cook :_ ;~ plug - (lots 3 (just -.a)) - (star ;~(less tec prn)) - (ahed eol) - == - |= {b/(list) c/tape $~} - ^+ [?>(?=($code -) .)]:*node :: XX do type stuff - [%code `[-.a (add 3 (lent b)) c] ~] - -- -:: -++ normalize - |= a/down ^- down - %+ turn a |= b/elem - ?^ -.b b(q (turn q.b ..$)) - =- ?+(-.b b $para b(p (- p.b)), $head b(q (- q.b))) - |= c/kids ^- kids - ?~ c ~ - ?: ?& ?=(^ t.c) - ?=($$ -.i.c) - ?=($$ -.i.t.c) - == - $(c t.c(p.i (weld p.i.c p.i.t.c))) - =. i.c - ?.(?=($$ -.i.c) i.c [%$ (trip (crip p.i.c))]) :: XX valid tapes - :_ $(c t.c) - ?@ -.i.c i.c - =* d q.i.c - ?~ d - i.c - ?. ?& ?=({* $~} d) - ?=({$emph $|} -.i.c) - ?=({$emph $|} -.i.d) - == - i.c(q $(c d)) - [[%emph %&] $(c q.i.d)] -:: -++ parseb =>(parse .(bug &)) -++ parse - =+ [bug=| bugi=|] - |= tub/nail - =. q.tub - %+ scan q.tub :: tab hackery :: XX per line - (star ;~(pose prn tab nal)) - =| $: $: top/down :: finished toplevel elements - {sap/@u nod/node} :: spacing currrent leaf block - cur/stack :: stack of nested current blocks - == - {bun/_| hat/_|} :: prev blank? halt? - ref/(map cord {p/tape q/(unit tape)}) :: link references - == - |^ ^- (like _top) - ?. hat - $:eat-line - ?^ cur - $:pop - => cull - =- [p.tub `[- tub]] - (flop (turn top (proc-inline [-(bug bugi)]:[~(pars inli ref) .]))) - :: - ++ self . - :: - ++ halt .(hat &) - :: - ++ debu [&2 &2.-]:&2 - :: - ++ proc-inline :: parse inline kids - |= pac/_pars:inli :: cache - |= a/elem - ?^ -.a a(q (flop (turn q.a ..$))) - ?+ -.a a - $code - ?~ p.a a - a(r.u.p (unesc:inli r.u.p.a)) - $para - ?> ?=({{$$ *} $~} p.a) :: XX do type stuff - a(p (pac p.i.p.a)) - $head - ?~ q.a a - ?> ?=({{$$ *} $~} q.a) :: XX do type stuff - a(q (pac p.i.q.a)) - == - :: - ++ snack :: advance by parser - |* a/rule - ^- {(unit _(wonk (a))) nail} - =+ vex=(a tub) - ?~ q.vex [~ tub] - [`p q]:u.q.vex - :: - ++ snake :: advance with trace - |* fel/rule - =- (snack (here - fel)) - |*({{{@ a/@u} {@ b/@u}} c/*} [p=(sub b a) q=c]) - :: - :: - ++ pop :: resolve container - ^+ self - => cull - ?~ cur self - =- => .(cur t.cur, q.p.tub p.i.cur) - ?~ cur self(top [hed top]) - self(q.q.i.cur [hed q.q.i.cur]) - ^- hed/tops - =+ cub=q.i.cur - ?+ -.p.cub cub - $list - %_ cub - p.p - p.p.cub :: XX set this upon parsing blank-headed block - == - == - :: - ++ bye :: resolution arms - |% - ++ leaf :: resolve node - ^+ self - =^ nol nod - [nod [%defn ~]] - ?: ?=($defn -.nol) self - ~? > bug clod+[nol tub] - ?~ cur self(top [nol top]) - self(q.q.i.cur [nol q.q.i.cur]) - :: - ++ pop-til :: unwind stack - |= a/stack - ^+ self - ?~ cur self - ?: =(a cur) self - $(self pop) - :: - ++ top-list - =+ laz=cur - |- - ?~ cur laz - =. laz ?:(?=($list -.p.q.i.cur) cur laz) - $(cur t.cur) - :: - ++ top-bloq - =+ laz=cur - |- - ?~ cur laz - =. laz ?:(?=($bloq -.p.q.i.cur) cur laz) - $(cur t.cur) - -- - :: - ++ cull :: resolve node block - =< leaf:bye - ^+ self - =. sap 0 - ?+ -.nod self - $html - self(p.nod (flop p.nod)) - $code - =< self(q.nod (flop q.nod)) - |- - ?^ p.nod . - ?~ q.nod . - ?: (blank (trip i.q.nod)) $(q.nod t.q.nod) - . - $para - ?~ p.nod self(nod [%defn ~]) - =+ olt=tub - =. q.tub - =- (trip (role -)) - %+ turn - ;;((list {$$ p/tape}) (flop p.nod)) :: XX do type stuff - |=({@ a/tape} (crip a)) - |- ^+ self - =^ ren tub (snack (leas href):inli) - ?^ ren - ?: (~(has by ref) -.u.ren) $ - $(ref (~(put by ref) u.ren)) - =. q.tub (strip (star gah) q.tub) - ?~ q.tub self(nod [%defn ~], tub olt) - self(nod [%para [%$ q.tub]~], tub olt) - == - :: - ++ push :: open block - |= nit/(loca _p:*tops) ^+ +> - =. self cull - =+ toz=[q.nit ~] - ?. ?=({$list ^} q.nit) - (shove p.nit toz) - =. self (shove p.nit toz) - (shove p.nit [%item ~]~) - :: - ++ shove - |= a/(loca tops) ^+ +> - ?~ cur +>(cur [a cur]) - :: =* cub q.i.cur - ?. ?=(nesting [-.p.q.i.cur -.q.a]) - $(+> pop) - +>(cur [a cur]) - :: - ++ pump :: push leaf block - |= a/$^({p/node q/@u} node) - ^+ +> - =+ nex=cull - ?@ -.a nex(nod a) - nex(nod p.a, sap q.a) - :: - ++ match :: check top element - |= a/elem ^- ? - ?~ cur | - =(-.a -.q.i.cur) - :: - :: - ++ collapse :: skim elems off top - |= a/(list (pair @ tops)) ^+ +> - ?~ a +> - :: ?: ?=([[@ *] ~] a) +> - ~? bug yank+[i.a blos] - ?> (match q.i.a) - :: ~& [%no-match a cur] - :: !! - $(a t.a, +> pop) - :: - ++ offset - ^- @u - ?~ cur 0 - ?: ?=($bloq -.p.q.i.cur) - p.i.cur - offset(cur t.cur) - :: - ++ delist (pop-til top-list):bye - ++ debloq - |= ruc/_(flop cur) - ^+ self - ?~ ruc self - ?. ?=($bloq -.p.q.i.ruc) - $(ruc t.ruc) - (collapse (flop ruc)) - :: - ++ nil-li - ?& ?=($defn -.nod) - ?=(^ cur) - ?=({{$item $~} $~} q.i.cur) - == - ++ widen ^+ cur :: list loosening - =< ?~ cur ~ - ?. ?=($item -.p.q.i.cur) - (. cur) - [i.cur (. t.cur)] - |= a/_cur ^+ a - ~? > bug naro+[debu nil-li a cur] - ?~ a a - ?: ?=({{$item $~} $~} q.i.a) - a - ?. ?=($list -.p.q.i.a) - [i.a $(a t.a)] - a(p.p.q.i |) - :: - ++ blos :: extract elem list - (flop (turn cur |*({@ a/tops} a))) - :: - ++ eat-line :: high-level line nom - ^+ . - ~? >> bug line+curlin - :: => [bup=bun sepa:eat] - :: ?: bun:+ + :: blank line nommed - :: =< .(bun |) - :: =. bun bup - ~? bug line-stat+[debu cur] - ?: ?=($html -.nod) - =+ sep=(sepa:eat) - ?: bun.sep sep - span:eat.+ - => [ruc .]=olds:eat - ?: &(?=($~ ruc) ?=({$code ^ *} nod)) - code:eat - =+ sep=(sepa:eat ruc) - ?: bun.sep - ~? bug nilli+[debu nil-li nod cur]:sep - =. bun.sep - ?^(ruc & ?^(cur | !nil-li:sep)) :: XX Chesterton fence - sep - =< .(bun |) - =~ [ruc=ruc sep(bun bun)] - (lazy:eat ruc) - news:eat - node:eat - span:eat - :: ~? bug seated+[nod blos] . - == - :: - ++ curlin (scab q.tub (star prn)) - ++ eat - |% - ++ sepa :: consume blank line - |= ruc/_(flop cur) ^+ self - ?: ?=({$code ^ *} nod) :: ignore in blocks - self - =^ buf tub (snack ;~(sfix (star ace) nal)) - ?~ buf - self(bun |) - ~? bug seat+cur - =. self - ?: bun - delist - =. bun & - (debloq ruc) - ?+ -.nod self - $para cull - $html cull - $code =- self(q.nod -) - ?~ q.nod q.nod - [(crip (slag 4 u.buf)) q.nod] - == - :: - ++ horz :: horizontal rule - ^+ self - =^ neu tub (snack (leas hrul:donp)) - ?~ neu self - (pump u.neu) - :: - ++ olds :: previous nest levels - =+ [ruc=(flop cur) ovs=0] - |- ^+ [ruc self] - ?: =(~ q.tub) - [~ halt] - ?~ ruc [ruc self] - ~? bug heat+[debu q.i.ruc cur] - ?- -.p.q.i.ruc - $bloq - =^ neu tub (snack blomar:donp) - ?^ neu $(ruc t.ruc, ovs p.i.ruc) - [ruc self] - :: - $list - ?~ t.ruc !! - :: $(t.ruc [p.i.ruc [%item ~] ~]~) :: XX why this - ?> ?=($item -.p.q.i.t.ruc) - ~? bug leat+[p.i.t.ruc debu] - =^ den tub (snack (stun [p p]:i.t.ruc ace)) - ?^ den $(ruc t.t.ruc) - ?. =(self horz) [ruc self] :: XX efficiency - ?: ?=({$code ^ *} nod) - [~ self] :: XX correct? - =^ neu tub (snake limar:donp) - ?~ neu [ruc self] - => .(q.u.neu ^+(p.q.i.ruc q.u.neu)) :: XX do type stuff - ?. (list-nest p.q.i.ruc q.u.neu) - =. self (collapse (flop ruc)) - [~ (push u.neu)] - =. self (collapse (flop t.ruc)) - [~ (push p.u.neu [%item ~])] - :: - $item - !! - == - :: - ++ aces |=(a/@u ^+(tub +:(snack (stun 0^a ace)))) :: nom optional leading - :: - ++ lazy :: errant prev bloqs - |= ruc/(list (pair @ tops)) - ^+ self - ~? bug laze+[debu ruc] - ?. ?=($para -.nod) - (collapse (flop ruc)) - ?: |([?=(^ -)]:lead [?=(^ -)]:(snack leaf:donp)) :: XX efficiency - (collapse (flop ruc)) - :: =. tub +:(snack (star ace)) - self - ::self(tub (aces p.i.cur)) :: XX correct? - :: =< (collapse (flop ruc)) - :: |- ^+ . - :: ?~ ruc ..$ - :: ?. ?=([%bloq ~] -.q.i.ruc) - :: ..$ - :: $(ruc t.ruc) - :: - ++ lead :: enter into tops - %- snake - => donp - ;~(plug ;~(pose blomar limar)) - :: - ++ news :: enter nest levels - |- ^+ self - ?. =(self horz) self :: XX efficiency - =^ neu tub - lead - ?~ neu - self - =. bun | :: don't wide new lists - $(self (push u.neu)) - :: - ++ node :: consume leaf node - ^+ self - ~? bug neat+curlin - ::=. self ?.(bun self cull) - ?^ [q]:((leas htm-head):donp tub) :: XX efficiency - (pump [%html ~]) - =+ ^= hez - %+ stag %heas - ?. ?=({$para {$$ *} $~} nod) - fail - ;~(plug setext:donp (cold p.nod (ahed eol))) - =+ ico=?:(?=($para -.nod) fail icode:donp) - =+ saf=q.p.+:(snack (star ace)) :: XX efficiency - =^ neu tub - (snack ;~(pose hez ico leaf:donp)) - ~? bug feat+[bun saf blos neu] - =. cur - ?.(bun cur widen) - ?~ neu - =. tub +:(snack (star ace)) - ?. ?=($para -.nod) - cull - self - ?+ -.u.neu (pump u.neu) - $heas self(nod u.neu(- %head)) :: replace extant para - $code ?^ p.u.neu - (pump u.neu (dec saf)) - ?: ?=({$code $~ *} nod) - self - (pump u.neu) - == - :: - ++ code - ^+ self - ?> ?=({$code ^ *} nod) :: XX do type stuff - ~? bug ceas+[sap] - =. tub (aces sap) - =+ [neu tup]=(snack ;~(sfix (leas fcode):donp eol)) - ?: &(?=(^ neu) (closes-code p.nod p.u.neu)) - =. q.nod q.nod - cull(tub tup) - =^ buf tub (snack ;~(sfix (star ace) nal)) - ?^ buf - self(q.nod [(crip u.buf) q.nod]) - span - :: - ++ span :: raw text - ^+ self - ?: =(~ q.tub) halt - =^ lin tub - (snack line:donp) - ?~ lin - halt - ~? bug adva+u.lin - |- - ?~ u.lin - ?+ -.nod cull - $code self - $html self(p.nod ['' p.nod]) - == - ?+ -.nod (pump para+~[`u.lin]) - $para self(p.nod :_(p.nod `u.lin)) - $head ?^ q.nod $(self cull) - self(q.nod [`(dehax u.lin)]~) - $code self(q.nod :_(q.nod (crip u.lin))) - $html self(p.nod :_(p.nod (crip u.lin))) - == - :: - -- --- -- - == diff --git a/lib/down-jet/rend.hoon b/lib/down-jet/rend.hoon deleted file mode 100644 index c00f8c449..000000000 --- a/lib/down-jet/rend.hoon +++ /dev/null @@ -1,239 +0,0 @@ -:: ++down rendering arms -!: -:::: - :: -|% -++ into-inner - |= {a/marl b/manx} - ?~ c.b b(c a) - $(b i.c.b) -:: -++ flat - |= a/marl - ^- tape - ?~ a ~ - %- weld :_ $(a t.a) - ^- tape - ?~ n.g.i.a - ?>(?=(_:/(**) i.a) v.i.a.g.i.a) - ?+ n.g.i.a $(a c.i.a) - $img - %- zing ^- wall - %+ murn a.g.i.a |= {a/mane b/tape} - ^- (unit tape) - ?+ a ~ - $alt [~ b] - == - == -++ sanitize - |= a/marl ^- tape - =- (zing `wall`(scan (flat a) fel)) - =< fel=;~(sfix (star ;~(plug (cold '-' -) (plus +))) (star next)) - [(star ;~(less aln prn)) ;~(pose nud low (cook |=(a/@ (add a ' ')) hig))] -:: -++ sang :: tight item children - |= a/(list elem) - ^- marl - ?~ a ~ - %- weld :_ $(a t.a) - ?. ?=($para -.i.a) - (sing i.a ~) - (sung p.i.a) -:: -++ sing :: elem to manx - => |% - ++ first-word - |= a/tape - =. a (trip (crip a)) :: XX valid tapes - ^- (unit tape) - =. a q.q:(need q:((star ace) [1 1] a)) - =+ vex=((plus ;~(less ace prn)) [1 1] a) - ?~ q.vex ~ - (some (wonk vex)) - -- - =+ [tig=| had=*(unit mane)] - |= lum/(list elem) - |^ ^- marl - =+ a=apex - ?~ q.a - p.a - (weld p.a $(lum q.a)) - :: - ++ apex - ^- {p/marl q/_lum} - ?~ lum - ?~ had [~ ~] - (lose "unclosed {}") - => [ele=i.lum .(lum t.lum)] - ?. ?=($html -.ele) - (push (reso ele) ~) - :: begin reparsing of html that the spec jankily lets through :: - =+ tex=(trip (role p.ele)) - =^ mar lum (chomp tex (sear |=(a/marl ?~(a ~ (some a))) many:poxa)) - ?^ mar - (push u.mar) - =^ hed lum (chomp tex head:poxa) - ?^ hed - =+ max=`marx`u.hed - (push(lum q) [max p] ~):[apex(had `n.max) .] - =^ tal lum (chomp tex tail:poxa) - ?~ tal - =^ cha lum (chomp tex prn) - ?^ cha - (push :/([u.cha]~) ~) - (push ;lost:"{tex}" ~) - ?: =(had tal) - [~ lum] - ?^ had - =. lum [ele lum] - (lose "unclosed {}") - (lose "close {}") - :: end reparsing of html that the spec jankily lets through :: - :: - ++ lose |=(a/tape [[;lost:"{a}"]~ lum]) - ++ chomp - |* {tap/tape fel/rule} - ^- {(unit _(wonk *fel)) _lum} - =+ vex=(fel 1^1 tap) - ?~ q.vex [~ lum] - :- [~ (wonk vex)] - ?~(q.q.u.q.vex lum [[%html (lore (crip q.q.u.q.vex))] lum]) - :: - ++ push - |= a/marl - ^+ apex - ?~ a apex - [[b p] q]:[b=i.a (push t.a)] - :: - ++ reso - |= a/elem - ?^ -.a - =. tig ?.(?=($list -.p.a) tig p.p.a) - ?: &(tig ?=($item -.p.a)) - [/li (sang q.a)] - %+ into-inner ^$(lum q.a) - ?- -.p.a - $bloq ;blockquote; - $item ;li; - $list ?@ q.p.a ;ul; - ?: =(1 p.q.p.a) ;ol; - =+ num=(pojo (jone p.q.p.a)) - ;ol(start num); - == - ?- -.a :: :/("unimplemented {}") - $html !! :: handled earlier XX do type stuff - $para [/p (sung p.a)] - $head - =+ [hed=(add %h0 (lsh 3 1 p.a)) kid=(sung q.a)] - [[hed id+(sanitize kid) ~] kid] - :: - $hrul ;hr; - $meta =+ jon=`json`o+(~(run by p.a) |=(cord s++<)) - ;meta(value "{(pojo jon)}", name "frontmatter", urb_front ""); - :: %html - ::=+ tex=(role (turn p.a crip)) - ::=+ (poxa tex) - ::?^ - u.- - ::=+ (rush tex (star ;~(pose gah comt:poxa))) - ::?^ - :/(~) - ::;lost: {} - :: :/([(role (turn p.a crip))]~) :: XX haaaaaaack - $defn :/(~) - $code =+ lan=?~(p.a ~ (first-word r.u.p.a)) - =+ tex=(trip (role q.a)) - ?~ lan ;pre:code:"{tex}" - ;pre:code(class "language-{u.lan}"):"{tex}" - - == - -- -:: -++ sung - |= lim/kids - =+ had=*(unit mane) - |^ ^- marl - =+ a=apex - ?~ q.a - p.a - (weld p.a $(lim q.a)) - :: - ++ apex - ^- {p/marl q/_lim} - ?~ lim - ?~ had [~ ~] - (lose "unclosed {}") - => [ele=i.lim .(lim t.lim)] - ?. ?=($htmt -.ele) - ?: &(?=($$ -.ele) ?=({{$$ *} *} lim)) - apex(p.i.lim (weld p.ele p.i.lim)) - (push (reso ele) ~) - =+ tex=(trip p.ele) - =^ emo lim (chomp tex empt:poxa) - ?^ emo - =+ man=`manx`u.emo - (push man ~) - =^ hed lim (chomp tex head:poxa) - ?^ hed - =+ max=`marx`u.hed - (push(lim q) [max p] ~):[apex(had `n.max) .] - =^ tal lim (chomp tex tail:poxa) - ?~ tal - (push ;lost:"{tex}" ~) - ?: =(had tal) - [~ lim] - ?^ had - =. lim [ele lim] - (lose "unclosed {}") - (lose "unopened {}") - :: - ++ lose |=(a/tape [[;lost:"{a}"]~ lim]) - ++ chomp - |* {tap/tape fel/rule} - ^- {(unit _(wonk *fel)) _lim} - =+ vex=(fel 1^1 tap) - ?~ q.vex [~ lim] - :- [~ (wonk vex)] - ?~(q.q.u.q.vex lim [[%htmt (crip q.q.u.q.vex)] lim]) - :: - ++ push - |= a/marl - ^+ apex - ?~ a apex - [[b p] q]:[b=i.a (push t.a)] - :: - ++ urly - |= a/tape ^- tape - ?~ a ~ - :: ?: (gth i.a 0xff) "XX" :: XX - ?: ?| [?=(^ q)]:(alp 1^1 a) - (~(has in (sa "!*'();:@&=+$,/?/%.~_")) i.a) :: XX reparse - == - [i.a $(a t.a)] - (weld (urle (trip i.a)) $(a t.a)) - :: - ++ reso - |= b/inline - ^- manx - ?@ -.b - ?- -.b - $$ :/(p.b) - $line ;br; - $code ;code:"{p.b}" - $htmt !! ::p.b :: handled earlier :: XX do type stuff - == - ?: ?=($blot -.p.b) - =+ res=`manx`;img(src (urly p.p.b), alt (flat (turn q.b ..$))); - :: ;img@"{p.p.b}"; - ?~ q.p.b res - res(a.g (welp a.g.res title+u.q.p.b ~)) - =+ kid=(sung q.b) - %+ into-inner kid - ?- p.b - {$emph ?} ?.(p.p.b ;em; ;strong;) - {$delt $~} ;del; - {$link ^} =+ url=(urly p.p.b) - =. url ?^(url url "#{(sanitize kid)}") - ?~ q.p.b ;a/"{url}"; - ;a/"{url}"(title u.q.p.b); - == - -- --- diff --git a/lib/frontmatter.hoon b/lib/frontmatter.hoon deleted file mode 100644 index cdb4639b5..000000000 --- a/lib/frontmatter.hoon +++ /dev/null @@ -1,34 +0,0 @@ -:: -:::: /hoon+frontmatter+lib - :: -/? 314 -!: -|% -++ atr-lines - |= atr/(map cord cord) - %+ turn (sort (~(tap by atr)) |=({{a/@ @} {b/@ @}} (aor a b))) - |= {k/cord v/cord} - (rap 3 k ': ' v ~) -:: -++ atr-key ;~(sfix (star ;~(less col prn)) col ace) -++ print - |= {atr/(map cord cord) src/wain} - ?~ atr src - ['---' (welp (atr-lines atr) '---' src)] -++ parse - =| atr/(map cord cord) - |= wan/wain ^+ [atr mud=''] - ?~ wan [~ ''] - ?^ (rush i.wan (star ace)) - $(wan t.wan) - ?. =('---' i.wan) [~ (role wan)] - |- ^+ [atr mud=''] - ?~ t.wan ~|(%unclosed-metadata !!) - ?: =('---' i.t.wan) [atr (role t.t.wan)] - ?^ (rush i.t.wan (star ace)) - $(wan t.wan) - =- $(wan t.wan, atr (~(put by atr) (crip key) (crip val))) - ~| malformed-attribute+i.t.wan - ^- {key/tape ^ val/tape} - +>:(atr-key 1^1 (trip i.t.wan)) --- diff --git a/lib/oct1.hoon b/lib/oct1.hoon deleted file mode 100644 index d52df9d46..000000000 --- a/lib/oct1.hoon +++ /dev/null @@ -1,43 +0,0 @@ -:: :: :: -:::: /hoon+oct1/lib :::::: dependencies - :: :: :: -/? 310 :: arvo version -/- oct1 :: structures -=> ^oct1 :: namespace -:: :: :: -:::: :::::: semantics - !: :: :: -|% :: -++ 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:oct1 :: - ++ 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 - -- --- diff --git a/lib/oct2.hoon b/lib/oct2.hoon deleted file mode 100644 index de39e05ee..000000000 --- a/lib/oct2.hoon +++ /dev/null @@ -1,59 +0,0 @@ -:: :: :: -:::: /hoon+oct2/lib :::::: dependencies - :: :: :: -/? 310 :: arvo version -/- oct2 :: structures -=> ^oct2 :: namespace -:: :: :: -:::: :::::: semantics - !: :: :: -|% :: -++ 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 :-(" ~ `"{} 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): "):: - -- --- diff --git a/lib/oct3.hoon b/lib/oct3.hoon deleted file mode 100644 index f3e3c1390..000000000 --- a/lib/oct3.hoon +++ /dev/null @@ -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 :-(" ~ `"{} 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): "):: - -- --- diff --git a/lib/oct4.hoon b/lib/oct4.hoon deleted file mode 100644 index 20db78ff5..000000000 --- a/lib/oct4.hoon +++ /dev/null @@ -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 :-(" ~ `"{} 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): "):: - -- --- diff --git a/lib/react.hoon b/lib/react.hoon deleted file mode 100644 index 472c49bc2..000000000 --- a/lib/react.hoon +++ /dev/null @@ -1,132 +0,0 @@ -!: -|% -++ react-elems :: XX /~ - ~+ %- sa ^- (list term) - :~ %a %abbr %address %area %article %aside %audio %b %base - %bdi %bdo %big %blockquote %body %br %button %canvas %caption - %cite %code %col %colgroup %data %datalist %dd %del %details - %dfn %dialog %div %dl %dt %em %embed %fieldset %figcaption - %figure %footer %form %h1 %h2 %h3 %h4 %h5 %h6 %head %header - %hr %html %i %iframe %img %input %ins %kbd %keygen %label - %legend %li %link %main %map %mark %menu %menuitem %meta - %meter %nav %noscript %object %ol %optgroup %option %output %p - %param %picture %pre %progress %q %rp %rt %ruby %s %samp - %script %section %select %small %source %span %strong %style - %sub %summary %sup %table %tbody %td %textarea %tfoot %th - %thead %time %title %tr %track %u %ul %var %video %wbr - %circle %defs %ellipse %g %line %linear-gradient %mask %path - %pattern %polygon %polyline %radial-gradient %rect %stop %svg - %text %tspan - == -++ react-attrs - ~+ ^- (map term cord) - %- mo ^- (list {term cord}) - :- [%class 'className'] - =- (rash - (more next (cook |=(a/tape [(cass a) (crip a)]) (star alf)))) - ''' - accept acceptCharset accessKey action allowFullScreen allowTransparency alt - async autoComplete autoFocus autoPlay cellPadding cellSpacing charSet checked - classID className colSpan cols content contentEditable contextMenu controls - coords crossOrigin data dateTime defer dir disabled download draggable encType - form formAction formEncType formMethod formNoValidate formTarget frameBorder - headers height hidden high href hrefLang htmlFor httpEquiv icon id label lang - list loop low manifest marginHeight marginWidth max maxLength media mediaGroup - method min multiple muted name noValidate open optimum pattern placeholder - poster preload radioGroup readOnly rel required role rowSpan rows sandbox scope - scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc - srcSet start step style tabIndex target title type useMap value width wmode - ''' -++ react-vale - ~(has in react-elems) -:: -++ react-to-json - |= src/manx ^- json - ?: ?=(_:/(**) src) - (jape v.i.a.g.src) - =+ atr=(mo a.g.src) - ?: (~(has by atr) [%urb %codemirror]) - ?> ?=({{$pre *} _:/(**) $~} src) - $(src ;codemirror(value "{v.i.a.g.i.c.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 - %_ $ - src - =+ =< result=(mule .) - !.(|.((slap !>(.) (ream (crip code))))) :: compile and run safely - =+ claz=?:(-.result "rancode" "failedcode") - ;div(class "{claz}") - ;pre:"{code}" - ;+ ?: ?=($& -.result) - ;code:"{~(ram re (sell p.result))}" - ;pre - ;div:"error" - ;* %+ turn p.result - |= a/tank - ^- manx - ;div:"{~(ram re a)}" - == == - == - %- jobe :~ - c+a+(turn c.src ..$) - gn+s+(mane-to-cord n.g.src) - =< ga+(jobe (turn a.g.src .)) - |= {a/mane b/tape} ^- {cord json} - :_ (jape b) - ?^ a (mane-to-cord a) - (fall (~(get by react-attrs) a) a) - == -:: -++ mane-to-cord |=(a/mane `cord`?@(a a (rap 3 -.a ':' +.a ~))) -:: generates React javascript XX deprecated -++ react-to-tape - |= src/manx ^- tape - ?: (~(has by (mo a.g.src)) [%urb %codemirror]) - ?> ?=({{$pre *} _:/(**) $~} src) - $(src ;codemirror(value "{v.i.a.g.i.c.src}");) - ?: (~(has by (mo a.g.src)) [%urb %exec]) :: runnable code attribute tag - ?> ?=({{$pre *} _:/(**) $~} src) :: verify its only a text node - =* code v.i.a.g.i.c.src - =+ ^= result - (mule |.((slap !>(.) (ream (crip code))))) :: compile and run safely - ?: ?=($.y -.result) :: it was ok - =+ ^= new - ;div(class "rancode") - ;pre:"{code}" - ;code:"{~(ram re (sell p.result))}" - == - $(src new) - =+ ^= error - ;div(class "failedcode") - ;pre:"{code}" - ;pre - ;div:"error" - ;* %+ turn - (scag (dec (lent p.result)) p.result) :: hide react trace - |= a/tank - ^- manx - ;div:"{~(ram re a)}" - == - == - $(src error) - ;: weld - "React.createElement(" - =* tan n.g.src - ?^ tan !! :: namespaces unsupported - ?: (react-vale tan) - "'{(trip tan)}'" - (trip tan) - ", " - =- (pojo (jobe (turn a.g.src -))) - |= {a/mane b/tape} - =. a ?+(a a $class 'className') - ?^(a !! [a (jape b)]) - ", " - =< ~(ram re %rose [", " "[" "]"] (turn c.src .)) - |= a/manx - ?: ?=(_:/(**) a) - leaf+(pojo (jape v.i.a.g.a)) - leaf+^$(src a) - ")" - == --- diff --git a/lib/tree.hoon b/lib/tree.hoon deleted file mode 100644 index d1f4e26c3..000000000 --- a/lib/tree.hoon +++ /dev/null @@ -1,65 +0,0 @@ -/- tree-include -!: -|% -++ extract - |= a/marl ^- tape - ?~ a ~ - %- weld :_ $(a t.a) - ?. ?=(_:/(**) i.a) - $(a c.i.a) - v.i.a.g.i.a -:: -++ getall - |= 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 - |* {a/$+(* cord) b/$+(* json)} - |* c/(map) ^- json - ~! 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)) - |% - ++ noun $@(term [noun noun]) :: shadow - ++ data $@(term {n/@ l/noun r/data}) - ++ 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)) - -- --- diff --git a/lib/twitter.hoon b/lib/twitter.hoon deleted file mode 100644 index ac1ececd4..000000000 --- a/lib/twitter.hoon +++ /dev/null @@ -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 {}" 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 $~}) - -- --- diff --git a/sur/bit-api.hoon b/sur/bit-api.hoon deleted file mode 100644 index 0bd035dbb..000000000 --- a/sur/bit-api.hoon +++ /dev/null @@ -1,18 +0,0 @@ -|% -++ bit-any - $% {$bit-get-token bit-get-token} - {$bit-api-call tok/@t bit-api-call} - == -++ bit-api-call - $% {$send bit-send} - {$txt-send to/@t btc/@t} - {$buy amount/@t currency/@t} - {$sell amount/@t currency/@t} - {$list $~} - == -++ bit-send {adr/@uc btc/@t} -++ bit-ship-send {who/@p btc/@t} -++ bit-get-token {oat/@t {cid/@t sec/@t} red/purl} -++ bit-accounts (list {id/@t name/@t balance/{num/@t cur/term}}) --- - diff --git a/sur/down.hoon b/sur/down.hoon deleted file mode 100644 index 2e08b5380..000000000 --- a/sur/down.hoon +++ /dev/null @@ -1,7 +0,0 @@ -:: -:::: /hoon+gate+down+sur - :: -/? 314 -/- markdown -down.markdown - diff --git a/sur/foobar.hoon b/sur/foobar.hoon deleted file mode 100644 index 4d54e60dd..000000000 --- a/sur/foobar.hoon +++ /dev/null @@ -1 +0,0 @@ -,@ diff --git a/sur/markdown.hoon b/sur/markdown.hoon deleted file mode 100644 index f6952a66a..000000000 --- a/sur/markdown.hoon +++ /dev/null @@ -1,39 +0,0 @@ -|% -++ down (list elem) -++ kids (list inline) -++ inline - =+ ^= inlik - $% {$emph p/?} :: strong? - {$delt $~} :: strikethrough - {$link p/tape q/(unit tape)} - {$blot p/tape q/(unit tape)} :: image - == - =+ ^= inlin - $% {$$ p/tape} - {$line $~} - {$code p/tape} - {$htmt p/cord} :: XX (each marx mane) - == - $^({p/inlik q/kids} inlin) -:: -:: -++ elem $^(tops node) -++ tops :: childful block - $: $= p - $% {$bloq $~} - {$list p/? q/$@(char {p/@u q/char})} :: tight ordered? - {$item $~} - == - q/down - == -++ node :: childless block - $% {$para p/kids} - {$meta p/(map cord cord)} :: front matter - {$hrul $~} - {$head p/@u q/kids} - {$code p/(unit {p/char q/@u r/tape}) q/wain} :: info contents - {$html p/wain} - {$defn $~} :: empty para - == --- - diff --git a/sur/oct1.hoon b/sur/oct1.hoon deleted file mode 100644 index 69d89c852..000000000 --- a/sur/oct1.hoon +++ /dev/null @@ -1,16 +0,0 @@ -:: :: :: -:::: /hoon+oct1/sur :::::: dependencies - :: :: :: -/? 310 :: arvo version -:: :: :: -:::: :::::: semantics - :: :: :: -|% :: -++ board @ :: one-player bitfield -++ point {x/@ y/@} :: coordinate -++ game :: game state - $: who/? :: whose turn - box/board :: X board - boo/board :: O board - == :: --- diff --git a/sur/oct2.hoon b/sur/oct2.hoon deleted file mode 100644 index e077aa0fc..000000000 --- a/sur/oct2.hoon +++ /dev/null @@ -1,19 +0,0 @@ -:: :: :: -:::: /hoon+oct2/sur :::::: dependencies - :: :: :: -/? 310 :: arvo version -:: :: :: -:::: :::::: semantics - :: :: :: -|% :: -++ board @ :: one-player bitfield -++ point {x/@ y/@} :: coordinate -++ stage (pair (unit ship) (unit ship)) :: players -++ game :: game state - $: who/? :: whose turn - sag/stage :: who's playing - aud/(map ship @ud) :: who's watching - box/board :: X board - boo/board :: O board - == :: --- diff --git a/sur/oct3.hoon b/sur/oct3.hoon deleted file mode 100644 index 2b6634ba8..000000000 --- a/sur/oct3.hoon +++ /dev/null @@ -1,20 +0,0 @@ -:: :: :: -:::: /hoon+oct3/sur :::::: dependencies - :: :: :: -/? 310 :: arvo version -:: :: :: -:::: :::::: semantics - :: :: :: -|% :: -++ board @ :: one-player bitfield -++ point {x/@ y/@} :: coordinate -++ stage (pair (unit ship) (unit ship)) :: players -++ play (each game tape) :: update -++ game :: game state - $: who/? :: whose turn - sag/stage :: who's playing - aud/(map ship @ud) :: who's watching - box/board :: X board - boo/board :: O board - == :: --- diff --git a/sur/oct4.hoon b/sur/oct4.hoon deleted file mode 100644 index 1007cb349..000000000 --- a/sur/oct4.hoon +++ /dev/null @@ -1,20 +0,0 @@ -:: :: :: -:::: /hoon+oct4/sur :::::: dependencies - :: :: :: -/? 310 :: -:: :: :: -:::: :::::: semantics - :: :: :: -|% :: -++ board @ :: one-player bitfield -++ point {x/@ y/@} :: coordinate -++ stage (pair (unit ship) (unit ship)) :: players -++ play (each game tape) :: update -++ game :: game state - $: who/? :: whose turn - sag/stage :: who's playing - aud/(map ship @ud) :: who's watching - box/board :: X board - boo/board :: O board - == :: --- diff --git a/sur/term-ctrl.hoon b/sur/term-ctrl.hoon deleted file mode 100644 index 31b413aa2..000000000 --- a/sur/term-ctrl.hoon +++ /dev/null @@ -1 +0,0 @@ -,%hail diff --git a/sur/term-in.hoon b/sur/term-in.hoon deleted file mode 100644 index d13ff357f..000000000 --- a/sur/term-in.hoon +++ /dev/null @@ -1,7 +0,0 @@ -$: pax=path :: -$= jof :: -$% [%line p=cord] :: - [%res p=span] :: - [%cmd p=char] :: - [%type p=?] :: -== == :: diff --git a/sur/term-line.hoon b/sur/term-line.hoon deleted file mode 100644 index 5d433a4ce..000000000 --- a/sur/term-line.hoon +++ /dev/null @@ -1,4 +0,0 @@ -$: p=[p=cord q=prom r=cord] - q=(list cord) - r=(list ?(tank [%stem p=@da q=tank r=tank])) -== diff --git a/sur/tree-include.hoon b/sur/tree-include.hoon deleted file mode 100644 index 027c3fee8..000000000 --- a/sur/tree-include.hoon +++ /dev/null @@ -1,7 +0,0 @@ -|- -$: body/json - head/json - snip/json - meta/json - sect/json -== diff --git a/sur/twitter.hoon b/sur/twitter.hoon deleted file mode 100644 index 98fb51175..000000000 --- a/sur/twitter.hoon +++ /dev/null @@ -1,16 +0,0 @@ -|% -++ twit-do => twit {p/span q/command} :: user and action -++ twit-stat {id/@u who/@ta now/@da txt/@t} :: received tweet -++ twit - |% - ++ keys :: twitter-key type - $: con/{tok/@t sec/@t} :: user key pair - acc/{tok/@t sec/@t} :: app key pair - == - :: - ++ command :: poke action - $% {$auth p/keys} :: set API keys - {$post p/@uvI q/cord} :: post a tweet - == - -- --- diff --git a/sur/user.hoon b/sur/user.hoon deleted file mode 100644 index ff1cbbed1..000000000 --- a/sur/user.hoon +++ /dev/null @@ -1,3 +0,0 @@ -$% {$in p/{p/@p q/@t}} - {$out p/{p/@p q/@t}} -== diff --git a/sur/users.hoon b/sur/users.hoon deleted file mode 100644 index 91b11bff3..000000000 --- a/sur/users.hoon +++ /dev/null @@ -1 +0,0 @@ -(list {p/@p q/@t}) diff --git a/sur/wand.hoon b/sur/wand.hoon deleted file mode 100644 index 80d8c9594..000000000 --- a/sur/wand.hoon +++ /dev/null @@ -1,6 +0,0 @@ -:: -:::: /hoon+gate+down+sur - :: -/? 314 -/- markdown -down diff --git a/sur/work.hoon b/sur/work.hoon deleted file mode 100644 index 92b811cc9..000000000 --- a/sur/work.hoon +++ /dev/null @@ -1,58 +0,0 @@ -:: -:::: /hoon+work+sur - :: - :: A block comment might go here! - :: -/- talk -|% -++ client - $: tasks/(map @uvH client-task) - sort/(list @uvH) - == -++ client-task - $: archived/_| - audience/(set station:talk) - tax/task - == -++ task - $: id/@uvH - date-created/@da - version/@u - date-modified/@da - creator/@p - doer/(unit @p) - tags/(set @t) - date-due/(unit @da) - done/(unit @da) - title/@t - description/@t :: XX (list @t) - discussion/(list comment) - == -++ comment - $: date/@da - ship/@p - body/@t :: XX (list @t) - == -++ command - $% {$new audience/(set station:talk) task} - {$old id/@uvH dif/update} - {$sort p/(list @uvH)} - == -++ update :: XX rename, web-edit? - $% $: $set - $% {$audience to/(set station:talk)} - {$date-due p/(unit @da)} - {$title p/@t} - {$description p/@t} - {$tags p/(set @t)} - {$done p/?} - == == - $: $add - $% {$comment @t} - == == - $: $doer - $% {$release $~} - {$claim $~} - == == - == --- diff --git a/sur/zing.hoon b/sur/zing.hoon deleted file mode 100644 index 9484ab6e8..000000000 --- a/sur/zing.hoon +++ /dev/null @@ -1,6 +0,0 @@ -$: %mess p=path - $= q - $% [%do p=@t] - [%exp p=@t q=tank] - [%say p=@t] -== == diff --git a/sur/zong.hoon b/sur/zong.hoon deleted file mode 100644 index fa07797d2..000000000 --- a/sur/zong.hoon +++ /dev/null @@ -1,6 +0,0 @@ -$% $: %mess p=@da q=ship - $= r - $% [%do p=@t] - [%exp p=@t q=tank] - [%say p=@t] -== == == diff --git a/sur/zung.hoon b/sur/zung.hoon deleted file mode 100644 index 22522b35b..000000000 --- a/sur/zung.hoon +++ /dev/null @@ -1,8 +0,0 @@ -$% $: %mess p=path - $= q - $% [%do p=@t] - [%exp p=@t q=tank] - [%say p=@t] - == == - [%init p=ship q=path] -==