diff --git a/app/gmail.hoon b/app/gmail.hoon new file mode 100644 index 000000000..f2f1a5c80 --- /dev/null +++ b/app/gmail.hoon @@ -0,0 +1,296 @@ +:: Three ways we interactg with this app +:: 1. .^(%gx /=gh=/endpoint) +:: 2. [%peer [our %gh] /endpoint] +:: 3. :gh &gh-poke %post /gists json-data + + +:: This is a driver for the Github API v3. +:: +:: You can interact with this in a few different ways: +:: +:: - .^(%gx /=gh=/read{/endpoint}) or subscribe to +:: /scry/x/read{/endpoint} for authenticated reads. +:: +:: - subscribe to /scry/x/listen/{owner}/{repo}/{events...} +:: for webhook-powered event notifications. For event list, +:: see https://developer.github.com/webhooks/. +:: +:: See the%github app for example usage. +:: +/? 314 +/- rfc, gmail-label, gmail-message +/+ http +:::: +/= rfctext /: /%/rfc /txt/ +:: +// /%/split +::/- gmail +:: /ape/gh/split.hoon defines ++split, which splits a request +:: at the end of the longest possible endpoint. +:: + +=> |% :: => only used for indentation + ++ move (pair bone card) + ++ subscription-result + $% {$arch arch} + {$json json} + {$null $~} + {$inbox (list {message-id/@t thread-id/@t})} + {$message from/@t subject/@t} + == + ++ card + $% {$diff subscription-result} + {$hiss wire {$~ $~} $httr {$hiss hiss}} + == + ++ easy-ot |*({key/@t parser/fist:jo} =+(jo (ot [key parser] ~))) + ++ sifo-google + |= a/cord ^- cord + =; fel (crip (scan (sifo a) fel)) + (star ;~(pose (cold '-' (just '+')) (cold '_' (just '/')) next)) + ++ ofis-google + |= a/cord ^- cord + =; fel (ofis (crip (rash a fel))) + (star ;~(pose (cold '+' (just '-')) (cold '/' (just '_')) next)) + -- +:: +|_ $: hid/bowl count/@ + web-hooks/(map @t {id/@t listeners/(set bone)}) + received-ids/(list @t) + == + +:: We can't actually give the response to pretty much anything +:: without blocking, so we just block unconditionally. +:: +++ prep ~& 'prep' _`. :: +:: +++ peek + |= {ren/@tas pax/path} + ^- (unit (unit (pair mark *))) + ~ +:: +++ peer-scry + |= pax/path + ^- {(list move) _+>.$} + ?> ?=({care ^} pax) :: assert %u + => (help i.pax i.t.pax t.t.pax) + => scry + %= make-move + count +(count) + == +:: +++ poke-email + |= {adr/@ta tyl/tape mez/wall} ^- (quip move +>) + ?> =(our.hid src.hid) + %- poke-gmail-req :* + %post + /messages/send + ~['uploadType'^%simple] + ['urbit' 'urbit.org'] :: [(crip "urbit+{}") 'urbit.org'] + :: + =- (rash adr -) + [;~((glue pat) . .)]:(cook crip (plus ;~(less pat next))) :: /[^@]+@[^@]+/ + :: + (crip tyl) + (role (turn mez crip)) + == +:: +++ poke-gmail-req + |= $: method/meth endpoint/path quy/quay + mes/message:rfc + :: label-req:gmail-label + == + ^- {(list move) _+>.$} + ?> ?=(valid-get-endpoint endpoint) + ?> =(our.hid src.hid) + :_ +>.$ :_ ~ + ^- move + :* ost.hid %hiss /poke/[method] `~ %httr %hiss + ^- purl + :+ [& ~ [%& /com/googleapis/www]] + [~ gmail+v1+users+me+`valid-get-endpoint`endpoint] + `quay`[[%alt %json] ~] + :: + :+ method `math`(malt ~[content-type+['application/json']~]) + =+ hoon-json-object=(joba %raw s+(sifo-google (message-to-rfc822:rfc mes))) + =+ request-body=(tact (pojo hoon-json-object)) + (some request-body) + ::(some (pojo label-req-to-json:gmail-label label-req:gmail-label ~)) XX + == +:: +:: HTTP response. We make sure the response is good, then +:: produce the result (as JSON) to whoever sent the request. +:: + +++ sigh-httr + |= {wir/wire res/httr} + ^- {(list move) _+>.$} + :: ~& wir+wir + ?. ?=({care @ @ @ *} wir) + :: pokes don't return anything + ~& sigh-poke+p.res + [~ +>.$] + =+ arg=(path (cue (slav %uv i.t.t.wir))) + :: ~& ittwir+i.t.t.wir + :_ +>.$ :_ ~ + :+ ost.hid %diff + ?+ i.wir null+~ + $x + ?~ r.res + json+(jobe err+s+%empty-response code+(jone p.res) ~) + =+ jon=(rush q.u.r.res apex:poja) + ?~ jon + json+(jobe err+s+%bad-json code+(jone p.res) body+s+q.u.r.res ~) + ?. =(2 (div p.res 100)) + json+(jobe err+s+%request-rejected code+(jone p.res) msg+u.jon ~) + :: + :: Once we know we have good data, we drill into the JSON + :: to find the specific piece of data referred to by 'arg' + :: + |- ^- subscription-result + ?~ arg + =+ switch=t.t.t.t.wir + ?+ switch [%json `json`u.jon] + {$messages $~} + =+ new-mezes=((ot messages+(ar (ot id+so 'threadId'^so ~)) ~):jo u.jon) + ::%+ turn new-mezes + ::|= id + ::?< ?=($~ new-mezes) + ::=. received-ids [new-mezes received-ids] + ::~& received-ids + ::=. received + [%inbox (need new-mezes)] + :: + {$messages @t $~} + :: + :: =+ body-parser==+(jo (ot body+(ot data+(cu ofis-google so) ~) ~)) :: (ok /body/data so):jo + :: ~& %.(u.jon (om (om |=(a/json (some -.a))):jo)) + :: ~& %.(u.jon (ot headers+(cu milt (ar (ot name+so value+so ~))) ~)) + =+ ^- $: headers/{from/@t subject/@t} + ::body-text/wain + == + ~| u.jon + =- (need (reparse u.jon)) + ^= reparse + =+ jo + =+ ^= from-and-subject + |= a/(map @t @t) ^- {@t @t} + [(~(got by a) 'From') (~(got by a) 'Subject')] + =+ ^= text-body + |= a/(list {@t @t}) ^- wain + %- lore + %- ofis-google + (~(got by (~(gas by *(map @t @t)) a)) 'text/plain') + %+ easy-ot %payload + %- ot :~ + headers+(cu from-and-subject (cu ~(gas by *(map @t @t)) (ar (ot name+so value+so ~)))) + :: parts+(cu text-body (ar (ot 'mimeType'^so body+(ot data+so ~) ~))) + == + :: =+ parsed-headers==+(jo ((ot payload+(easy-ot 'headers' (ar some)) ~) u.jon)) :: + :: =+ parsed-message==+(jo ((ot payload+(easy-ot 'parts' (ar body-parser)) ~) u.jon)) :: + ::~& [headers body-text] + ::=+ body==+(jo ((ot body+(easy-ot 'body' (easy-ot 'data' so))) parsed-message)) + [%message headers] + == + + =+ dir=((om:jo some) u.jon) + ?~ dir json+(jobe err+s+%no-children ~) + =+ new-jon=(~(get by u.dir) i.arg) + `subscription-result`$(arg t.arg, u.jon ?~(new-jon ~ u.new-jon)) + :: redo with next argument + :: + $y + ?~ r.res + ~& [err+s+%empty-response code+(jone p.res)] + arch+*arch + =+ jon=(rush q.u.r.res apex:poja) + ?~ jon + ~& [err+s+%bad-json code+(jone p.res) body+s+q.u.r.res] + arch+*arch + ?. =(2 (div p.res 100)) + ~& [err+s+%request-rejected code+(jone p.res) msg+u.jon] + arch+*arch + :: + :: Once we know we have good data, we drill into the JSON + :: to find the specific piece of data referred to by 'arg' + :: + |- ^- subscription-result + =+ dir=((om:jo some) u.jon) + ?~ dir + [%arch `(shax (jam u.jon)) ~] + ?~ arg + [%arch `(shax (jam u.jon)) (~(run by u.dir) $~)] + =+ new-jon=(~(get by u.dir) i.arg) + $(arg t.arg, u.jon ?~(new-jon ~ u.new-jon)) + == +:: +++ sigh-tang |=({a/wire b/tang} (mean >gmail+a< b)) +++ sigh + |= a/* + ~& a+a + :_ +>.$ ~ +:: +++ help + |= {ren/care style/@tas pax/path} + =^ query pax + =+ xap=(flop pax) + ?~ xap [~ ~] + =+ query=(rush i.xap ;~(pfix wut yquy:urlp)) + ?~ query [~ pax] + [u.query (flop t.xap)] + =^ arg pax ~|(pax [+ -]:(split pax)) + ~| [pax=pax arg=arg query=query] + =| mow/(list move) + |% + :: Resolve core + :: + ++ make-move + ^- {(list move) _+>.$} + [(flop mow) +>.$] + :: + ++ endpoint-to-purl + |= endpoint/path + ^- purl + %+ scan + "https://www.googleapis.com/gmail/v1/users/me{<`path`endpoint>}" + auri:epur + :: Send an HTTP req + ++ send-http + |= hiz/hiss + ^+ +> + =+ wir=`wire`[ren (scot %ud count) (scot %uv (jam arg)) style pax] + =+ new-move=[ost.hid %hiss wir `~ %httr [%hiss hiz]] + +>.$(mow [new-move mow]) + :: + ++ scry + ^+ . + ?+ style ~|(%invalid-style !!) + $read read +:: $listen listen + == + :: Standard GET request + ++ read (send-http (endpoint-to-purl pax) %get ~ ~) + + :: Subscription request +:: ++ listen +:: ^+ . +:: =+ events=?>(?=([@ @ *] pax) t.t.pax) +:: |- ^+ +>.$ +:: ?~ events +:: +>.$ +:: ?: (~(has by web-hooks) i.events) :: if hook exists +:: =. +>.$ (update-hook i.events) +:: $(events t.events) +:: =. +>.$ (create-hook i.events) +:: $(events t.events) + :: + -- +-- + + + + + + + + + diff --git a/app/gmail/rfc.txt b/app/gmail/rfc.txt new file mode 100644 index 000000000..f569d3a58 --- /dev/null +++ b/app/gmail/rfc.txt @@ -0,0 +1,6 @@ +From: urbit-test@gmail.com +To: jhenry.ault@gmail.com +Subject: As basic as it gets + +This is the plain text body of the message. Note the blank line +between the header information and the body of the message. diff --git a/app/gmail/split.hoon b/app/gmail/split.hoon new file mode 100644 index 000000000..a4fc2ce2a --- /dev/null +++ b/app/gmail/split.hoon @@ -0,0 +1,71 @@ +!: +|% +:: Splits a path into the endpoint prefix and the remainder, +:: which is assumed to be a path within the JSON object. We +:: choose the longest legal endpoint prefix. +:: +++ split + |= pax/path + :: =- ~& [%pax pax - (valid-endpoint pax)] - + =+ l=(lent pax) + |- ^- {path path} + ?: ?=(valid-get-endpoint (scag l pax)) + [(scag l pax) (slag l pax)] + ?~ l + ~& %bad-endpoint + ~|(%bad-endpoint !!) + $(l (dec l)) +:: +:: These are all the github GET endpoints, sorted with +:: `env LC_ALL=C sort` +:: +:: end-points include required query parameters +++ valid-get-endpoint + $? {$drafts id/@t $~} + {$drafts $~} + {$history $~} + {$labels id/@t $~} + {$labels $~} + {$messages id/@t $attachments id/@t $~} + {$messages id/@t $~} + {$messages $~} + {$profile $~} + {$threads id/@t $~} + {$threads $~} + == + +++ vaild-post-endpoint + $? {$drafts $send $~} + {$drafts $~} + {$messages id/@t $modify $~} + {$messages id/@t $trash $~} + {$messages id/@t $untrash $~} + {$messages $import $~} + {$messages $send $~} + {$messages $~} + {$labels $~} + {$threads id/@t $trash $~} + {$threads id/@t $untrash $~} + {$threads id/@t $modify} + {$stop $~} + {$watch $~} + == + +++ valid-delete-endpoint + $? {$drafts id/@t $~} + {$labels id/@t $~} + {$messages id/@t $~} + {$thread id/@t $~} + == +++ valid-put-endpoint + $? {$drafts id/@t $~} + {$labels id/@t $~} + == +++ valid-patch-endpoint + $? {$labels id/@t $~} + == + +-- + +:: + diff --git a/app/hood.hoon b/app/hood.hoon index c8186e3e5..3c78bb451 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -2,14 +2,16 @@ :::: /hoon/hood/app :: :: :: :: :: /? 310 :: zuse version -/+ sole, talk, helm, kiln, drum, write :: libraries -[. helm kiln drum] +/+ sole, talk, helm, kiln, drum, write, womb :: libraries +[. helm kiln drum] :: :: :: :::: :: :: !: :: :: => |% :: module boilerplate - ++ hood-0 :: - {$0 lac/(map @tas hood-part)} :: + ++ hood-old :: + {?($0 $1) lac/(map @tas hood-part-old)} :: + ++ hood-1 :: + {$1 lac/(map @tas hood-part)} :: ++ hood-good :: |* hed/hood-head :: |= paw/hood-part :: @@ -17,6 +19,7 @@ $drum ?>(?=($drum -.paw) `drum-part`paw) :: $helm ?>(?=($helm -.paw) `helm-part`paw) :: $kiln ?>(?=($kiln -.paw) `kiln-part`paw) :: + $womb ?>(?=($womb -.paw) `part:womb`paw) :: $write ?>(?=($write -.paw) `part:write`paw) :: == :: ++ hood-head _-:*hood-part :: @@ -26,22 +29,21 @@ $drum (drum-make our) :: $helm *helm-part :: $kiln *kiln-part :: + $womb *part:womb :: $write *part:write :: == :: - ++ hood-part-old :: - $? hood-part :: - {$drum $0 drum-pith-0} :: - == :: + ++ hood-part-old ?(hood-part) :: drum-part-old :: ++ hood-port :: |= paw/hood-part-old ^- hood-part :: ?+ -.paw paw :: - $drum (drum-port paw) :: + $drum (drum-port paw) :: == :: :: :: ++ hood-part :: - $% {$drum $1 drum-pith} :: + $% {$drum $1 drum-pith-1} :: {$helm $0 helm-pith} :: {$kiln $0 kiln-pith} :: + {$womb $1 pith:womb} :: {$write $0 pith:write} :: == :: -- :: @@ -49,7 +51,7 @@ :::: :: :: :: :: :: |_ $: hid/bowl :: system state - hood-0 :: server state + hood-1 :: server state == :: ++ able :: find+make part |* hed/hood-head @@ -63,8 +65,8 @@ :: :: :: :::: :: :: :: :: :: -++ prep :: - |= old/(unit hood-0) ^- (quip _!! +>) +++ prep + |= old/(unit hood-old) ^- (quip _!! +>) :: :- ~ ?~ old +> +>(lac (~(run by lac.u.old) hood-port)) @@ -85,6 +87,12 @@ ~? ?=(^ saw) [%kiln-overload-lame u.saw] [~ +>] :: +++ poke-hood-load + |= dat/hood-part + ?> =(our src) + ~& loaded+-.dat + [~ %_(+> lac (~(put by lac) -.dat dat))] +:: ++ coup-drum-phat (wrap take-coup-phat):from-drum ++ coup-helm-hi (wrap coup-hi):from-helm ++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum @@ -100,6 +108,7 @@ ++ from-drum (from-lib %drum [..$ _se-abet]:(drum)) ++ from-helm (from-lib %helm [..$ _abet]:(helm)) ++ from-kiln (from-lib %kiln [..$ _abet]:(kiln)) +++ from-womb (from-lib %womb [..$ _abet]:(womb)) ++ from-write (from-lib %write [..$ _abet]:(write)) :: ++ init-helm |=({way/wire *} [~ +>]) @@ -111,14 +120,17 @@ ++ note-helm (wrap take-note):from-helm ++ onto-drum (wrap take-onto):from-drum ++ peer-drum (wrap peer):from-drum +++ peek-x-womb peek-x:(womb hid (able %womb)) +++ peer-scry-x-womb (wrap peer-scry-x):from-womb ++ poke-dill-belt (wrap poke-dill-belt):from-drum +++ poke-drum-put (wrap poke-put):from-drum ++ poke-drum-link (wrap poke-link):from-drum ++ poke-drum-unlink (wrap poke-unlink):from-drum -:: ++ poke-drum-exit (wrap poke-exit):from-drum +++ poke-drum-exit (wrap poke-exit):from-drum ++ poke-drum-start (wrap poke-start):from-drum ++ poke-helm-hi (wrap poke-hi):from-helm ++ poke-helm-init (wrap poke-init):from-helm :: XX used? -++ poke-helm-invite (wrap poke-invite):from-helm +::++ poke-helm-invite (wrap poke-invite):from-helm ++ poke-helm-mass (wrap poke-mass):from-helm ++ poke-helm-reload (wrap poke-reload):from-helm ++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm @@ -146,6 +158,21 @@ ++ poke-kiln-overload (wrap poke-overload):from-kiln ++ poke-kiln-unmount (wrap poke-unmount):from-kiln ++ poke-kiln-unsync (wrap poke-unsync):from-kiln +++ poke-womb-invite (wrap poke-invite):from-womb +++ poke-womb-save (wrap poke-save):from-womb +++ poke-womb-obey (wrap poke-obey):from-womb +++ poke-womb-claim (wrap poke-claim):from-womb +++ poke-womb-do-ticket (wrap poke-do-ticket):from-womb +++ poke-womb-do-claim (wrap poke-do-claim):from-womb +++ poke-womb-rekey (wrap poke-rekey):from-womb +++ poke-womb-report (wrap poke-report):from-womb +++ poke-womb-manage (wrap poke-manage):from-womb +++ poke-womb-recycle (wrap poke-recycle):from-womb +++ poke-womb-manage-old-key (wrap poke-manage-old-key):from-womb +++ poke-womb-release (wrap poke-release):from-womb +++ poke-womb-release-ships (wrap poke-release-ships):from-womb +++ poke-womb-reinvite (wrap poke-reinvite):from-womb +++ poke-womb-replay-log (wrap poke-replay-log):from-womb ++ poke-write-sec-atom (wrap poke-sec-atom):from-write ++ poke-write-paste (wrap poke-paste):from-write ++ poke-write-comment (wrap poke-comment):from-write diff --git a/arvo/ames.hoon b/arvo/ames.hoon index dd381d6c8..b709c3036 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -63,7 +63,7 @@ |= {new/deed old/deed} ^- $& ?> (melt new old) - ?> =((shaf %meld (sham q.new)) (need (sure:as:(haul r.q.old) *code p.new))) + ?> =((shaf %meld (sham q.new)) (need (sure:as:(com:nu:crub r.q.old) *code p.new))) %& :: ++ melt :: proper connect @@ -99,7 +99,7 @@ |= wed/deed ^- $& ?> =+ rac=(clan r.p.q.wed) - =+ loy=(haul r.q.wed) + =+ loy=(com:nu:crub r.q.wed) ?: &(r.wed =(rac %czar)) %& ?> =(0 p.p.q.wed) ?> =(fig:ex:loy ?+(rac !! $czar (zeno r.p.q.wed), $pawn r.p.q.wed)) @@ -114,7 +114,7 @@ ?> ?& ?=(^ law) (lth p.p.q.i.law 9) :: 9-lives rule =(p.p.q.i.law p.i.mac) - =(r.q.i.law pub:ex:(weur q.i.mac)) + =(r.q.i.law pub:ex:(nol:nu:crub q.i.mac)) == $(mac t.mac, law t.law) == @@ -479,7 +479,7 @@ ?. =(fak.ton r.i.lew.wod.dur) ~|([%client-wrong-fake her] !!) :+ p.p.q.i.lew.wod.dur q.q.i.lew.wod.dur - (haul r.q.i.lew.wod.dur) + (com:nu:crub r.q.i.lew.wod.dur) :: ++ clon ^- life @@ -574,7 +574,7 @@ :- %fast %^ cat 7 p.u.yed.caq.dyr - (en:crua q.u.yed.caq.dyr mal) + (en:crub q.u.yed.caq.dyr mal) == :: ++ xeno :: xeno:lax:as:go @@ -729,7 +729,7 @@ |- ^- (list ship) ?:((lth our 256) ~ =+(seg=(sein our) [seg $(our seg)])) :: - (turn mac |=({p/life q/ring} [p q (weur q)])) + (turn mac |=({p/life q/ring} [p q (nol:nu:crub q)])) wil ~ ~ @@ -978,13 +978,13 @@ :- p %= q val - (turn val.q |=({p/life q/ring r/acru} [p q (weur q)])) + (turn val.q |=({p/life q/ring r/acru} [p q (nol:nu:crub q)])) == == ++ come :: come:am |= {ges/(unit @t) wid/@ bur/@ fak/?} :: instantiate pawn ^- {p/{p/ship q/@uvG} q/fort} - =+ loy=(bruw wid bur) + =+ loy=(pit:nu:crub wid bur) =+ rig=sec:ex:loy =+ our=`@p`fig:ex:loy =+ syp=[[0 ~ our now] [%en %pawn ges] pub:ex:loy] @@ -1002,7 +1002,7 @@ ++ czar !: :: czar:am |= {our/ship ger/@uw fak/?} :: instantiate emperor ^- {p/(list boon) q/fort} - =+ loy=?:(fak (bruw 2.048 our) (bruw 2.048 ger)) :: fake uses carrier / + =+ loy=?:(fak (pit:nu:crub 512 our) (pit:nu:crub 512 ger)) :: fake uses carrier / =+ fim==(fig:ex:loy (zeno our)) ?: &(!fak !fim) !! :: not fake & bad fig =+ mac=`mace`[[0 sec:ex:loy] ~] diff --git a/arvo/dill.hoon b/arvo/dill.hoon index 06a1ac695..c73b0758b 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -132,10 +132,7 @@ $czar [%czar ~] $duke [%duke %anon ~] $earl [%earl (scot %p p.kyz)] - $king :- %king - ?: =(~doznec p.kyz) :: so old tickets work - 'Urban Republic' - (scot %p p.kyz) + $king [%king (scot %p p.kyz)] $pawn [%pawn ~] == =+ yen=(scot %p (shax :(mix %ticket eny now))) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 37a17743a..ca87a066e 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -80,7 +80,7 @@ -- :: |% :: models ++ bolo :: eyre state - $: $5 :: version + $: $6 :: version gub/@t :: random identity hov/(unit ship) :: master for remote top/beam :: ford serve prefix @@ -99,8 +99,9 @@ sec/(map {iden (list @t)} driv) :: security drivers == :: :: -++ driv %+ pair (unit $@($~ vase)) :: driver state - (qeu (trel duct mark vase:hiss)) :: waiting requests +++ driv :: driver state + %+ pair (unit $@($~ vase)) :: main core + {liv/? req/(qeu (trel duct mark vase:hiss))} :: waiting requests :: ++ live :: in flight $% {$exec p/whir} :: ford build @@ -1696,13 +1697,13 @@ ~% %eyre-v ..is ~ |_ $: {usr/iden dom/path} cor/(unit $@($~ vase)) - req/(qeu {p/duct q/mark r/vase:hiss}) + {liv/? req/(qeu {p/duct q/mark r/vase:hiss})} == ++ self . ++ abet +>(sec (~(put by sec) +<- +<+)) ++ execute |=({a/whir-se b/{beak silk}} (execute:abet se+[a usr dom] b)) ++ dead-this |=(a/tang (fail:abet 500 0v0 a)) - ++ dead-hiss |=(a/tang (give-sigh:abet(req ~(nap to req)) %| a)) + ++ dead-hiss |=(a/tang pump(req ~(nap to req), ..vi (give-sigh %| a))) ++ eyre-them |=({a/whir-se b/vase} (eyre-them:abet se+[a usr dom] b)) ++ pass-note |=({a/whir-se b/note} (pass-note:abet se+[a usr dom] b)) :: XX block reqs until correct core checked in? @@ -1752,6 +1753,7 @@ ^+ abet ?~ cor build + ?. liv abet =+ ole=~(top to req) ?~ ole abet :: process hiss @@ -1776,22 +1778,23 @@ ?+ wir !! ?($receive-auth-query-string $in) (call %receive-auth-response httr+!>(hit)) ?($filter-request $out) + =. liv & ?. (has-arm %filter-response) (fin-httr !>(hit)) (call %filter-response httr+!>(hit)) == :: ++ get-made |= {wir/whir-se dep/@uvH res/(each cage tang)} ^+ abet - ?: ?=($core wir) (update dep res) + ?: ?=($core wir) (made-core dep res) %. res ?- wir - ?($filter-request $out) res-out - ?($filter-response $res) res-res - ?($receive-auth-response $bak) res-bak - ?($receive-auth-query-string $in) res-in + ?($filter-request $out) made-filter-request + ?($filter-response $res) made-filter-response + ?($receive-auth-response $bak) made-receive-auth-response + ?($receive-auth-query-string $in) made-receive-auth-query-string == :: - ++ update + ++ made-core |= {dep/@uvH gag/(each cage tang)} :: ~& got-update/dep =. ..vi (pass-note %core [%f [%wasp our dep &]]) @@ -1801,6 +1804,35 @@ pump ::(cor `~) :: userless %hiss defaults to "nop" driver (warn p.gag) :: + ++ made-filter-request + %+ on-ford-fail dead-hiss + %+ on-error warn |. + %- handle-moves :~ + give+do-give + send+(do-send %filter-request) + show+do-show + == + :: + ++ made-filter-response + %+ on-error dead-hiss |. + %- handle-moves :~ + give+do-give + send+(do-send %filter-request) + redo+_pump + == + :: + ++ made-receive-auth-query-string + %+ on-error dead-this |. + (handle-moves send+(do-send %receive-auth-query-string) ~) + :: + ++ made-receive-auth-response + %+ on-error dead-this |. + %- handle-moves :~ + give+do-give + send+(do-send %receive-auth-query-string) + redo+_pump(..vi (give-html 200 ~ exit:xml)) + == + :: :: Result handling :: :: XX formal dill-blit %url via hood @@ -1815,6 +1847,7 @@ ++ do-send |= wir/whir-se ^- $-(vase _abet) |= res/vase + =. liv | :: block requests until a reponse is given (eyre-them wir (slam !>(|=({$send a/hiss} a)) res)) :: ++ handle-moves @@ -1857,36 +1890,6 @@ =+ typ=cor-type ~| %core-mismatch ?>((~(nest ut typ) & p.roc) ~) - :: - :: - ++ res-in - %+ on-error dead-this |. - (handle-moves send+(do-send %receive-auth-query-string) ~) - :: - ++ res-res - %+ on-error dead-hiss |. - %- handle-moves :~ - give+do-give - send+(do-send %filter-request) - redo+_pump - == - :: - ++ res-bak - %+ on-error dead-this |. - %- handle-moves :~ - give+do-give - send+(do-send %receive-auth-query-string) - redo+_pump(..vi (give-html 200 ~ exit:xml)) - == - :: - ++ res-out - %+ on-ford-fail dead-hiss - %+ on-error warn |. - %- handle-moves :~ - give+do-give - send+(do-send %filter-request) - show+do-show - == -- -- -- . == @@ -1935,10 +1938,13 @@ ~ :: ++ load :: take previous state - =+ bolo-4={$4 _%*(+ *bolo lyv *(map duct ^))} - |= old/?(bolo bolo-4) + =+ driv-5=_=>(*driv [cor=p req=req.q]) + =+ bolo-5={$5 _=+(*bolo +.-(sec (~(run by sec.-) driv-5)))} + =+ bolo-4={$4 _%*(+ *bolo-5 lyv *(map duct ^))} + |= old/?(bolo bolo-5 bolo-4) ?- -.old - $5 ..^$(+>- old) + $6 ..^$(+>- old) + $5 $(old [%6 +.old(sec (~(run by sec.old) |=(driv-5 [cor & req])))]) $4 $(old [%5 +.old(lyv ~)]) :: minor leak == :: diff --git a/arvo/gall.hoon b/arvo/gall.hoon index d775f105c..4294050e8 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -82,7 +82,7 @@ == :: ++ stic :: statistics $: act/@ud :: change number - eny/@uvI :: entropy + eny/@uvJ :: entropy lat/@da :: time == :: -- :: @@ -91,7 +91,7 @@ . == =| all/axle :: all vane state |= $: now/@da :: urban time - eny/@uvI :: entropy + eny/@uvJ :: entropy ska/sley :: activate == :: opaque core ~% %gall-top ..is ~ @@ -557,7 +557,7 @@ == =+ unt=(~(get by q.zam) hen) =: act.tyc +(act.tyc) - eny.tyc (shax (mix (add dap act.tyc) eny)) + eny.tyc (shaz (mix (add dap act.tyc) eny)) lat.tyc now == ?^ unt @@ -647,7 +647,7 @@ ((slog leaf+"peek find fail" >tyl< >mar< ~) [~ ~]) =^ arm +>.$ (ap-farm q.u.cug) ?: ?=($| -.arm) ((slog leaf+"peek farm fail" p.arm) [~ ~]) - =^ zem +>.$ (ap-slam q.u.cug p.arm !>([ren (slag p.u.cug tyl)])) + =^ zem +>.$ (ap-slam q.u.cug p.arm !>((slag p.u.cug `path`[ren tyl]))) ?: ?=($| -.zem) ((slog leaf+"peek slam fail" p.zem) [~ ~]) ?+ q.p.zem ((slog leaf+"peek bad result" ~) [~ ~]) $~ ~ @@ -1046,7 +1046,6 @@ ++ ap-purr :: unwrap take |= {wha/term pax/path cag/cage} ^+ +> - =. q.cag (spec q.cag) =+ cug=(ap-find [wha p.cag pax]) ?~ cug (ap-lame wha (ap-suck "{(trip wha)}: no {<`path`[p.cag pax]>}")) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 4a1122611..2896e32f7 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -1192,7 +1192,7 @@ /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\ /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\ /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\ - /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\ + /ritpodmottamtolsavposnapnopsomfinfonbanmorworsip\ /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\ /sivtagpadsaldivdactansidfabtarmonranniswolmispal\ /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\ @@ -1202,7 +1202,7 @@ /tomdigfilfasmithobharmighinradmashalraglagfadtop\ /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\ /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\ - /laptalpitnambonrostonfodponsovnocsorlavmatmipfap' + /laptalpitnambonrostonfodponsovnocsorlavmatmipfip' ^= dex :: suffix syllables 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\ /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\ @@ -3931,11 +3931,14 @@ |% ++ bix (bass 16 (stun [2 2] six)) ++ fem (sear |=(a/@ (cha:fa a)) aln) - ++ hif (boss 256 ;~(plug tip tiq (easy ~))) - ++ huf %+ cook - |=({a/@ b/@} (wred:un ~(zug mu ~(zag mu [a b])))) - ;~(plug hif ;~(pfix hep hif)) - ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~))) + ++ haf (bass 256 ;~(plug tep tiq (easy ~))) + ++ hef %+ sear |=(a/@ ?:(=(a 0) ~ (some a))) + %+ bass 256 + ;~(plug tip tiq (easy ~)) + ++ hif (bass 256 ;~(plug tip tiq (easy ~))) + ++ hof (bass 0x1.0000 ;~(plug hef (stun [1 3] ;~(pfix hep hif)))) + ++ huf (bass 0x1.0000 ;~(plug hef (stun [0 3] ;~(pfix hep hif)))) + ++ hyf (bass 0x1.0000 ;~(plug hif (stun [3 3] ;~(pfix hep hif)))) ++ pev (bass 32 ;~(plug sev (stun [0 4] siv))) ++ pew (bass 64 ;~(plug sew (stun [0 4] siw))) ++ piv (bass 32 (stun [5 5] siv)) @@ -3963,6 +3966,7 @@ == ++ sox (cook |=(a/@ (sub a 87)) (shim 'a' 'f')) ++ ted (bass 10 ;~(plug sed (stun [0 2] sid))) + ++ tep (sear |=(a/@ ?:(=(a 'doz') ~ (ins:po a))) til) ++ tip (sear |=(a/@ (ins:po a)) til) ++ tiq (sear |=(a/@ (ind:po a)) til) ++ tid (bass 10 (stun [3 3] sid)) @@ -3997,14 +4001,16 @@ ++ dim (ape dip) ++ dip (bass 10 ;~(plug sed:ab (star sid:ab))) ++ dum (bass 10 (plus sid:ab)) - ++ fed ;~ pose - %+ bass 0x1.0000.0000.0000.0000 - ;~((glue doh) ;~(pose hyf:ab huf:ab) (more doh hyf:ab)) - :: - hyf:ab - huf:ab - hif:ab - tiq:ab + ++ fed %+ cook fend:ob + ;~ pose + %+ bass 0x1.0000.0000.0000.0000 :: oversized + ;~ plug + huf:ab + (plus ;~(pfix doh hyf:ab)) + == + hof:ab :: planet or moon + haf:ab :: star + tiq:ab :: galaxy == ++ fim (sear den:fa (bass 58 (plus fem:ab))) ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab))))) @@ -4086,37 +4092,27 @@ == :: $p - =+ dyx=(met 3 q.p.lot) + =+ sxz=(feen:ob q.p.lot) + =+ dyx=(met 3 sxz) :- '~' ?: (lte dyx 1) - (weld (trip (tod:po q.p.lot)) rep) - ?: =(2 dyx) - ;: weld - (trip (tos:po (end 3 1 q.p.lot))) - (trip (tod:po (rsh 3 1 q.p.lot))) - rep - == - =+ [dyz=(met 5 q.p.lot) fin=| dub=&] + (weld (trip (tod:po sxz)) rep) + =+ dyy=(met 4 sxz) + =+ imp=*@ |- ^- tape - ?: =(0 dyz) + ?: =(imp dyy) rep - %= $ - fin & - dub !dub - dyz (dec dyz) - q.p.lot (rsh 5 1 q.p.lot) - rep - =+ syb=(wren:un (end 5 1 q.p.lot)) - =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)]) - ;: weld - (trip (tos:po (end 3 1 p.cog))) - (trip (tod:po (rsh 3 1 p.cog))) - `tape`['-' ~] - (trip (tos:po (end 3 1 q.cog))) - (trip (tod:po (rsh 3 1 q.cog))) - `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])]) - rep - == + %= $ + sxz (rsh 4 1 sxz) + imp +(imp) + rep + =+ log=(end 4 1 sxz) + ;: weld + (trip (tos:po (rsh 3 1 log))) + (trip (tod:po (end 3 1 log))) + ?:(=((mod imp 4) 0) ?:(=(imp 0) "" "--") "-") + rep + == == :: $r @@ -4624,16 +4620,16 @@ ^- {@ @} :- r ?~ (mod n 2) - (~(sum fo 65.535) l (muk (snag n raku) 4 r)) - (~(sum fo 65.536) l (muk (snag n raku) 4 r)) + (~(sum fo 65.535) l (muk (snag n raku) 2 r)) + (~(sum fo 65.536) l (muk (snag n raku) 2 r)) :: ++ rund :: reverse round |= {n/@ l/@ r/@} ^- {@ @} :- r ?~ (mod n 2) - (~(dif fo 65.535) l (muk (snag n raku) 4 r)) - (~(dif fo 65.536) l (muk (snag n raku) 4 r)) + (~(dif fo 65.535) l (muk (snag n raku) 2 r)) + (~(dif fo 65.536) l (muk (snag n raku) 2 r)) :: ++ raku ^- (list @ux) @@ -11166,7 +11162,7 @@ :: ++ poke :: external apply |= {now/@da ovo/ovum} - =. eny (mix eny (shax now)) + =. eny (mix eny (shaz now)) :: ~& [%poke -.q.ovo] ^- {(list ovum) _+>} =^ zef niz diff --git a/arvo/jael.hoon b/arvo/jael.hoon new file mode 100644 index 000000000..8b405d1fc --- /dev/null +++ b/arvo/jael.hoon @@ -0,0 +1,90 @@ +:: %jael, secret +:: +:::: /hoon/jael + :: +!? 164 +:::: +|= pit=vase +=> =~ +:: private structures :: :: +:::: :: :: + :: :: :: +|% :: +++ bitx $~ :: any crypto wallet +++ prof :: per service profile + $: oat/(map user (safe @)) :: auth tokens + pax/(unit @t) :: actual password + == :: +++ safe |*(gate {exp/@da nub/+<}) :: secret w/expiration +++ tlsy $~ :: HTTPS secrets +++ whom @t :: foreign identity +++ wapi :: per api service + $: app/(map @tas (safe @)) :: per appname + use/(map whom prof) :: user secrets + == :: +++ land :: urbit secrets + $: lyf/@ud :: life number + sym/(map @p (map @uvH (safe @uvI))) :: shared keys + own/(map @ud (safe ring)) :: private key per life + == :: +++ user @ta :: user id per service +++ visa (map ship will) :: meta-will +-- +:: system structures +|% +++ axle :: %jael state + $: $0 :: %jael version + pri/land :: local crypto state + pub/(map @p will) :: will system + api/(map @tas wapi) :: web services + tix/(map @pG @p) :: old style tickets + tls/tlsy :: tls keys + val/(map @tas bitx) :: bitcoin etc + sub/(map path (set duct)) :: subscribers + == :: +++ gift :: out result <-$ + $% {$dead p/path} :: key expired + {$save p/(each * *)} :: backup + == :: +++ kiss :: in request ->$ + $% {$kill p/path} :: cancel path + {$know p/visa} :: learn will (new pki) + {$knew p/ship q/will} :: learn will (old pki) + {$next p/ring} :: update private key + {$tell p/path q/@da r/@} :: save atomic secret + {$tick p/@pG q/@p} :: save old ticket + == +-- +|% :: +++ call :: request + |= {hen/duct hic/(hypo (hobo kiss))} + ^- [p=(list move) q=_..^$] + !! +:: +++ 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`+>-.$ +:: +++ take :: response + |= {tea/wire hen/duct hin/(hypo noun)} + !! +-- diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index e5afb3a55..3ab5c376e 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2208,7 +2208,7 @@ ++ ares (unit {p/term q/(list tank)}) :: possible error ++ bale :: driver state |* a/_* :: %jael keys type - $: {our/ship now/@da eny/@uvI byk/beak} :: base info + $: {our/ship now/@da eny/@uvJ byk/beak} :: base info {usr/iden dom/(list @t)} :: req user, domain key/a :: secrets from %jael == :: @@ -2261,7 +2261,7 @@ == :: $: ost/bone :: opaque cause act/@ud :: change number - eny/@uvI :: entropy + eny/@uvJ :: entropy now/@da :: current time byk/beak :: load source == == :: diff --git a/gen/code.hoon b/gen/code.hoon index 48e94e97a..d4b549aec 100644 --- a/gen/code.hoon +++ b/gen/code.hoon @@ -2,7 +2,7 @@ :::: /hoon/code/gen :: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} $~ $~ == diff --git a/gen/gmail/list.hoon b/gen/gmail/list.hoon new file mode 100644 index 000000000..99f5bd0f8 --- /dev/null +++ b/gen/gmail/list.hoon @@ -0,0 +1,18 @@ +:: +:::: /hoon/list/gmail/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + arg/$@($~ {number/@u $~}) + $~ + == +?~ arg $(arg [5 ~]) +:- %noun +%+ turn (scag number.arg .^((list {@t @t}) %gx /=gmail=/read/messages)) +|= {message-id/@t thread-id/@t} +=+ .^({from/@t subject/@t} %gx /=gmail=/read/messages/[message-id]) +[from=from (trip subject)] diff --git a/gen/gmail/send.hoon b/gen/gmail/send.hoon new file mode 100644 index 000000000..125f21b29 --- /dev/null +++ b/gen/gmail/send.hoon @@ -0,0 +1,14 @@ +:: +:::: /hoon/send/gmail/gen + :: +/? 310 +/- rfc +:- %say +|= {^ {to/tape subject/tape opt/$@($~ {mess/tape $~})} _from="urbit-test@gmail.com"} +:- %gmail-req +:^ %post /messages/'send' ~['uploadType'^'simple'] +^- message:rfc +=+ parse-adr=;~((glue pat) (cook crip (star ;~(less pat next))) (cook crip (star next))) +:+ (scan from parse-adr) + (scan to parse-adr) +[(crip subject) ?~(opt '' (crip mess.opt))] diff --git a/gen/hood/autoload.hoon b/gen/hood/autoload.hoon index 5bdba0c57..e1ad31785 100644 --- a/gen/hood/autoload.hoon +++ b/gen/hood/autoload.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/?($~ {? $~}) $~} == :- %kiln-autoload diff --git a/gen/hood/begin.hoon b/gen/hood/begin.hoon index 7b375090f..8189ed678 100644 --- a/gen/hood/begin.hoon +++ b/gen/hood/begin.hoon @@ -12,7 +12,7 @@ -- [sole .] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/_(scug *@ *{his/@p tic/@p $~})} safety/?($on $off) == diff --git a/gen/hood/bonus.hoon b/gen/hood/bonus.hoon new file mode 100644 index 000000000..91d47a583 --- /dev/null +++ b/gen/hood/bonus.hoon @@ -0,0 +1,15 @@ +:: +:::: /hoon/reinvite/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{pas/@uvG opt/$@($~ {planets/@u $@($~ {stars/@u $~})})} $~} + == +?~ opt $(opt [planets=1]~) +?~ +.opt $(+.opt [stars=0]~) +:- %womb-bonus +[(scot %uv pas) 1 0] diff --git a/gen/hood/breload.hoon b/gen/hood/breload.hoon index d41da8016..a5a02b5e1 100644 --- a/gen/hood/breload.hoon +++ b/gen/hood/breload.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/(list term) $~} == :+ %helm-reload-desk %base diff --git a/gen/hood/cancel.hoon b/gen/hood/cancel.hoon index 1977f28b7..2b25f0db6 100644 --- a/gen/hood/cancel.hoon +++ b/gen/hood/cancel.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{syd/@tas $~} $~} == :- %kiln-cancel diff --git a/gen/hood/claim.hoon b/gen/hood/claim.hoon new file mode 100644 index 000000000..841e6fcce --- /dev/null +++ b/gen/hood/claim.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/claim/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{pas/@uvH her/@p $~} $~} + == +:- %womb-claim +[pas her] diff --git a/gen/hood/deset.hoon b/gen/hood/deset.hoon index 14ebf7ecb..87e0a45d5 100644 --- a/gen/hood/deset.hoon +++ b/gen/hood/deset.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-deset ~] diff --git a/gen/hood/exit.hoon b/gen/hood/exit.hoon new file mode 100644 index 000000000..544c48869 --- /dev/null +++ b/gen/hood/exit.hoon @@ -0,0 +1,15 @@ +:: +:::: /hoon/exit/hood/gen + :: +/? 310 +/- sole +:: +:::: + !: +[sole .] +:- %say +|= $: {now/@da eny/@ bec/beak} + {$~ $~} + == +~& %drum-exit +[%drum-exit ~] diff --git a/gen/hood/init-auth-basic.hoon b/gen/hood/init-auth-basic.hoon index 9d84a60b9..1d9ecdc11 100644 --- a/gen/hood/init-auth-basic.hoon +++ b/gen/hood/init-auth-basic.hoon @@ -8,7 +8,7 @@ !: [sole .] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$@($~ {dom/path $~})} $~ == diff --git a/gen/hood/init-oauth1.hoon b/gen/hood/init-oauth1.hoon index c3a56e4bc..552290ce5 100644 --- a/gen/hood/init-oauth1.hoon +++ b/gen/hood/init-oauth1.hoon @@ -8,7 +8,7 @@ !: [sole .] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$@($~ {dom/path $~})} $~ == diff --git a/gen/hood/init-oauth2.hoon b/gen/hood/init-oauth2.hoon index 04e217c23..04d9797a7 100644 --- a/gen/hood/init-oauth2.hoon +++ b/gen/hood/init-oauth2.hoon @@ -8,7 +8,7 @@ !: [sole .] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$@($~ {dom/path $~})} $~ == diff --git a/gen/hood/init-oauth2/google.hoon b/gen/hood/init-oauth2/google.hoon index 763990e64..3cf3dd4c6 100644 --- a/gen/hood/init-oauth2/google.hoon +++ b/gen/hood/init-oauth2/google.hoon @@ -8,7 +8,7 @@ !: [sole .] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$@($~ {jon/json $~})} $~ == diff --git a/gen/hood/invite.hoon b/gen/hood/invite.hoon new file mode 100644 index 000000000..5ea34cca4 --- /dev/null +++ b/gen/hood/invite.hoon @@ -0,0 +1,16 @@ +:: +:::: /hoon/invite/hood/gen + :: +/? 310 +:: +:::: + :: +/+ womb +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{who/@t $~} ref/(unit (each ship mail:womb)) sta/@} + == +:- %womb-invite +^- {cord reference invite}:womb +=+ inv=(scot %uv (end 7 1 eny)) +[inv ref [who 10 sta "You have been invited to Urbit: {(trip inv)}" "This is an invite of 10 planets"]] diff --git a/gen/hood/label.hoon b/gen/hood/label.hoon index cfe9ebcdb..03778b9ff 100644 --- a/gen/hood/label.hoon +++ b/gen/hood/label.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{syd/desk lab/@tas $~} $~} == :- %kiln-label diff --git a/gen/hood/link.hoon b/gen/hood/link.hoon index a21b96e74..f748df95b 100644 --- a/gen/hood/link.hoon +++ b/gen/hood/link.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {arg/$?({dap/term $~} {who/ship dap/term $~}) $~} == :- %drum-link diff --git a/gen/hood/load.hoon b/gen/hood/load.hoon new file mode 100644 index 000000000..f04a55f9c --- /dev/null +++ b/gen/hood/load.hoon @@ -0,0 +1,18 @@ +:: +:::: /hoon/load/hood/gen + :: +/? 310 +/+ womb +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI byk/beak} + {{dap/term pas/@uw $~} $~} + == +^- {$hood-load ?(part:womb)} +?+ dap ~|(unknown-backup+dap !!) + $womb + =+ dat=.^(@ %cx (tope byk /jam-crub/womb-part/bak/hood/app)) + [%hood-load ;;(part:womb (cue (dy:crub pas dat)))] +== diff --git a/gen/hood/manage-old-key.hoon b/gen/hood/manage-old-key.hoon new file mode 100644 index 000000000..3b60501e0 --- /dev/null +++ b/gen/hood/manage-old-key.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/manage-old-key/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{who/@p key/@ $~} $~} + == +:- %womb-manage-old-key +[who key] diff --git a/gen/hood/manage.hoon b/gen/hood/manage.hoon new file mode 100644 index 000000000..ae3c1b286 --- /dev/null +++ b/gen/hood/manage.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/manage/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {who/(list @p) $~} + == +:- %womb-manage +who diff --git a/gen/hood/mass.hoon b/gen/hood/mass.hoon index 3c26ceb45..e09ef26e6 100644 --- a/gen/hood/mass.hoon +++ b/gen/hood/mass.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-mass ~] diff --git a/gen/hood/merge.hoon b/gen/hood/merge.hoon index bff79b960..71ed24e9f 100644 --- a/gen/hood/merge.hoon +++ b/gen/hood/merge.hoon @@ -11,7 +11,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bek/beak} +|= $: {now/@da eny/@uvJ bek/beak} {arg/{?(sorc {syd/$@(desk beaky) sorc})} cas/case gem/?($auto germ)} == =* our p.bek diff --git a/gen/hood/mount.hoon b/gen/hood/mount.hoon index f757e938e..c8c4e17c8 100644 --- a/gen/hood/mount.hoon +++ b/gen/hood/mount.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{pax/path pot/$@($~ {v/@tas $~})} $~} == ?~ pot diff --git a/gen/hood/obey.hoon b/gen/hood/obey.hoon new file mode 100644 index 000000000..9ede9551e --- /dev/null +++ b/gen/hood/obey.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/obey/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{bos/$@($~ {i/@p $~})} $~} + == +:- %womb-obey +?~(bos ~ (some i.bos)) diff --git a/gen/hood/overload.hoon b/gen/hood/overload.hoon index 87a5fd38b..70be6cfdb 100644 --- a/gen/hood/overload.hoon +++ b/gen/hood/overload.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$@($~ {tym/@dr $~}) $~} == ?~ arg $(arg [~h4 ~]) diff --git a/gen/hood/rc.hoon b/gen/hood/rc.hoon index e802175e6..5cd208bd7 100644 --- a/gen/hood/rc.hoon +++ b/gen/hood/rc.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-reload ~[%c]] diff --git a/gen/hood/reboot.hoon b/gen/hood/reboot.hoon index 6f9dc085e..dbd8944d3 100644 --- a/gen/hood/reboot.hoon +++ b/gen/hood/reboot.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-reload ~[%z %a %b %c %d %e %f %g]] diff --git a/gen/hood/reinvite.hoon b/gen/hood/reinvite.hoon new file mode 100644 index 000000000..dc03d6ec5 --- /dev/null +++ b/gen/hood/reinvite.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/reinvite/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{pas/@uvG who/@t $~} $~} + == +:- %womb-reinvite +[pas who 3 0 "You have been inivted to Urbit" "This is a re-invite of 3 planets"] diff --git a/gen/hood/rekey.hoon b/gen/hood/rekey.hoon new file mode 100644 index 000000000..7941e7cb6 --- /dev/null +++ b/gen/hood/rekey.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/rekey/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {$~ $~} + == +:- %womb-rekey +~ diff --git a/gen/hood/release-ships.hoon b/gen/hood/release-ships.hoon new file mode 100644 index 000000000..6299f9f22 --- /dev/null +++ b/gen/hood/release-ships.hoon @@ -0,0 +1,14 @@ +:: +:::: /hoon/release/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {who/(list ship) $~} + == +:- %womb-release-ships +~? =(~ who) %no-ships-released +who diff --git a/gen/hood/release.hoon b/gen/hood/release.hoon new file mode 100644 index 000000000..0844be1d6 --- /dev/null +++ b/gen/hood/release.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/release/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{sta/@u gal/$@($~ {i/@u $~})} $~} + == +:- %womb-release +[?^(gal i.gal 0) sta] diff --git a/gen/hood/reload-desk.hoon b/gen/hood/reload-desk.hoon index 5f03f59f1..186465412 100644 --- a/gen/hood/reload-desk.hoon +++ b/gen/hood/reload-desk.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{desk (list term)} $~} == :- %helm-reload-desk diff --git a/gen/hood/reload.hoon b/gen/hood/reload.hoon index 7e0b45cc8..d6bd2187e 100644 --- a/gen/hood/reload.hoon +++ b/gen/hood/reload.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/(list term) $~} == :- %helm-reload diff --git a/gen/hood/replay-womb-log.hoon b/gen/hood/replay-womb-log.hoon new file mode 100644 index 000000000..cbf960273 --- /dev/null +++ b/gen/hood/replay-womb-log.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/reinvite/hood/gen + :: +/? 310 +/+ womb +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {log/(list {@uvI transaction:womb}) $~} + == +[%womb-replay-log log] diff --git a/gen/hood/report.hoon b/gen/hood/report.hoon new file mode 100644 index 000000000..25e116ae1 --- /dev/null +++ b/gen/hood/report.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/report/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{her/@p wil/will $~} $~} + == +:- %womb-report +[her wil] diff --git a/gen/hood/reset.hoon b/gen/hood/reset.hoon index 9473aded1..5cd90af81 100644 --- a/gen/hood/reset.hoon +++ b/gen/hood/reset.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-reset ~] diff --git a/gen/hood/rf.hoon b/gen/hood/rf.hoon index a632edbb9..9b7b3ca0f 100644 --- a/gen/hood/rf.hoon +++ b/gen/hood/rf.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/$~ $~} == [%helm-reload ~[%f]] diff --git a/gen/hood/save.hoon b/gen/hood/save.hoon new file mode 100644 index 000000000..6a86f06b1 --- /dev/null +++ b/gen/hood/save.hoon @@ -0,0 +1,14 @@ +:: +:::: /hoon/save/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI byk/beak} + {{dap/term $~} $~} + == +?+ dap ~|(unknown-backup+dap !!) + $womb [%womb-save (tope byk /womb-part/bak/hood/app)] +== diff --git a/gen/hood/serve.hoon b/gen/hood/serve.hoon index 006c7809b..684e92412 100644 --- a/gen/hood/serve.hoon +++ b/gen/hood/serve.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{pax/$@(term {i/knot t/path}) $~} $~} == :- %helm-serve diff --git a/gen/hood/start.hoon b/gen/hood/start.hoon index 8c17d7a11..a361d3467 100644 --- a/gen/hood/start.hoon +++ b/gen/hood/start.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{@ $@($~ {@ $~})} $~} == :- %drum-start diff --git a/gen/hood/sync.hoon b/gen/hood/sync.hoon index 3ccc6ad15..17d39a1ba 100644 --- a/gen/hood/sync.hoon +++ b/gen/hood/sync.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{syd/@tas her/@p sud/@tas $~} $~} == :- %kiln-sync diff --git a/gen/hood/syncs.hoon b/gen/hood/syncs.hoon index 96ee6195b..5aa543999 100644 --- a/gen/hood/syncs.hoon +++ b/gen/hood/syncs.hoon @@ -6,5 +6,5 @@ :::: !: :- %say -|= {{now/@da eny/@uvI bec/beak} $~ $~} +|= {{now/@da eny/@uvJ bec/beak} $~ $~} [%kiln-syncs ~] diff --git a/gen/hood/track.hoon b/gen/hood/track.hoon index f1d1119cb..4c44eea67 100644 --- a/gen/hood/track.hoon +++ b/gen/hood/track.hoon @@ -6,8 +6,8 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{syd/@tas her/@p sud/@tas $~} $~} == :- %kiln-track -[syd her sud]:arg \ No newline at end of file +[syd her sud]:arg diff --git a/gen/hood/transfer.hoon b/gen/hood/transfer.hoon new file mode 100644 index 000000000..5316c0613 --- /dev/null +++ b/gen/hood/transfer.hoon @@ -0,0 +1,16 @@ +:: +:::: /hoon/transfer/hood/gen + :: +/? 310 +/+ womb +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{pas/@uvH who/@t $~} $~} + == +:- %womb-reinvite +=+ [him=(scot %p p.bec) cas=(scot %da now) key=(scot %p pas)] +=+ [pla=planets sta=stars]:.^(balance:womb %gx /[him]/hood/[cas]/womb/balance/[key]) +[pas who pla sta "Email updated, new passcode" "Email correction"] diff --git a/gen/hood/unlink.hoon b/gen/hood/unlink.hoon index 32b0c8d95..15e7188be 100644 --- a/gen/hood/unlink.hoon +++ b/gen/hood/unlink.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {arg/$?({dap/term $~} {who/ship dap/term $~}) $~} == :- %drum-unlink diff --git a/gen/hood/unmount.hoon b/gen/hood/unmount.hoon index f2e82af24..4cfedaf01 100644 --- a/gen/hood/unmount.hoon +++ b/gen/hood/unmount.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{mon/$@(term {knot path}) $~} $~} == :- %kiln-unmount diff --git a/gen/hood/unsync.hoon b/gen/hood/unsync.hoon index 81ae2314b..36db12c6c 100644 --- a/gen/hood/unsync.hoon +++ b/gen/hood/unsync.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {arg/{syd/@tas her/@p sud/@tas $~} $~} == :- %kiln-unsync diff --git a/gen/moon.hoon b/gen/moon.hoon index 278018931..017cccc55 100644 --- a/gen/moon.hoon +++ b/gen/moon.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} $~ $~ == diff --git a/gen/pipe/cancel.hoon b/gen/pipe/cancel.hoon index 5af20d361..218d4f505 100644 --- a/gen/pipe/cancel.hoon +++ b/gen/pipe/cancel.hoon @@ -1,6 +1,6 @@ !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{app/term source/path station/knot $~} $~} == [%pipe-cancel app source station] diff --git a/gen/pipe/connect.hoon b/gen/pipe/connect.hoon index 0195e6ce7..3ed74341e 100644 --- a/gen/pipe/connect.hoon +++ b/gen/pipe/connect.hoon @@ -1,6 +1,6 @@ !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{app/term source/path station/knot $~} $~} == [%pipe-connect app source station] diff --git a/gen/pipe/list.hoon b/gen/pipe/list.hoon index 72400477d..5e2fb1252 100644 --- a/gen/pipe/list.hoon +++ b/gen/pipe/list.hoon @@ -1,6 +1,6 @@ !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {$~ $~} == [%pipe-list ~] diff --git a/gen/pope.hoon b/gen/pope.hoon index 3ca0c995a..eab5c1abb 100644 --- a/gen/pope.hoon +++ b/gen/pope.hoon @@ -5,10 +5,10 @@ :: Input twitter keys /- sole !: -=+ cryp=bruw :: XX change to ec2 ++brew eventually +=+ cryp=crub =+ [sole] :- %ask -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{who/ship $~} $~} == ^- (sole-result (cask tang)) @@ -19,9 +19,9 @@ %+ sole-lo [%| %pope-none "[press enter to compute]"] :: XX oy %+ sole-go (easy ~) |= $~ -=+ bur=(shax (add who (shax fra))) +=+ bur=(shaz (add who (shaz fra))) ~& %computing-fingerprint -=+ arc=(cryp 2.048 bur) +=+ arc=(pit:nu:cryp 512 bur) %+ sole-so %tang :~ leaf+"generator: {(scow %uw bur)}" leaf+"fingerprint: {(scow %uw fig:ex:arc)}" diff --git a/gen/solid.hoon b/gen/solid.hoon index 9f8f9b071..39e3ef5e5 100644 --- a/gen/solid.hoon +++ b/gen/solid.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {$~ $~} == :- %noun diff --git a/gen/talk/load.hoon b/gen/talk/load.hoon index bfcc9173f..f2a339055 100644 --- a/gen/talk/load.hoon +++ b/gen/talk/load.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {{man/knot $~} $~} == -[%talk-load man] \ No newline at end of file +[%talk-load man] diff --git a/gen/talk/log.hoon b/gen/talk/log.hoon index c3c2845e7..ccf3f1148 100644 --- a/gen/talk/log.hoon +++ b/gen/talk/log.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {{man/knot $~} $~} == -[%talk-log man] \ No newline at end of file +[%talk-log man] diff --git a/gen/talk/save.hoon b/gen/talk/save.hoon index e6da15b70..6b430506f 100644 --- a/gen/talk/save.hoon +++ b/gen/talk/save.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {{man/knot $~} $~} == -[%talk-save man] \ No newline at end of file +[%talk-save man] diff --git a/gen/talk/unlog.hoon b/gen/talk/unlog.hoon index 0810306d2..fa8bab19b 100644 --- a/gen/talk/unlog.hoon +++ b/gen/talk/unlog.hoon @@ -6,7 +6,7 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI byk/beak} +|= $: {now/@da eny/@uvJ byk/beak} {{man/knot $~} $~} == -[%talk-unlog man] \ No newline at end of file +[%talk-unlog man] diff --git a/gen/ticket.hoon b/gen/ticket.hoon index 18407e7d2..d985bbcfe 100644 --- a/gen/ticket.hoon +++ b/gen/ticket.hoon @@ -6,8 +6,8 @@ :::: !: :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{her/@p $~} $~} == :- %noun -.^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her)) \ No newline at end of file +.^(@p /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p her)) diff --git a/gen/twit/as.hoon b/gen/twit/as.hoon index 1f1596afd..0130b7465 100644 --- a/gen/twit/as.hoon +++ b/gen/twit/as.hoon @@ -4,7 +4,7 @@ :: [twitter .] :- %say -|= $: {now/@da eny/@uvI bec/beak} +|= $: {now/@da eny/@uvJ bec/beak} {{who/knot msg/cord $~} $~} == [%twit-do [who %post eny msg]] diff --git a/gen/twit/feed.hoon b/gen/twit/feed.hoon index a2fcd0b9e..f541cd0ef 100644 --- a/gen/twit/feed.hoon +++ b/gen/twit/feed.hoon @@ -7,7 +7,7 @@ :::: ~fyr :: :- %say -|= $: {now/@da eny/@uvI bek/beak} +|= $: {now/@da eny/@uvJ bek/beak} {{who/iden $~} typ/?($home $user)} == =+ pax=/(scot %p p.bek)/twit/(scot %da now)/[typ]/[who] diff --git a/gen/womb/balance.hoon b/gen/womb/balance.hoon new file mode 100644 index 000000000..1e7196586 --- /dev/null +++ b/gen/womb/balance.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/balance/womb/gen + :: +/? 310 +/+ womb +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {pas/@uvG $~} + who/(unit @p) + == +=- [%womb-balance .^(balance:womb %gx /[him]/hood/[cas]/womb/balance/[key]/womb-balance)] +[him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now) key=(scot %uv pas)] diff --git a/gen/womb/balances.hoon b/gen/womb/balances.hoon new file mode 100644 index 000000000..b946b50f4 --- /dev/null +++ b/gen/womb/balances.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/balance/womb/gen + :: +/? 310 +/+ womb +:- %say +|= $: {now/@da eny/@uvI bec/beak} + $~ + who/(unit @p) + == +:- %womb-balance-all +=+ [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now)] +.^((set {passhash mail}:womb) %gx /[him]/hood/[cas]/womb/balance/womb-balance-all) diff --git a/gen/womb/shop.hoon b/gen/womb/shop.hoon new file mode 100644 index 000000000..0cf8037aa --- /dev/null +++ b/gen/womb/shop.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/shop/womb/gen + :: +/? 310 +:- %say +|= $: {now/@da eny/@uvI bec/beak} + arg/$@($~ {typ/?($stars $planets $galaxies) $~}) + who/(unit @p) + == +?~ arg $(arg ~[typ=%planets]) +=- [%ships .^((list ship) %gx /[him]/hood/[cas]/womb/shop/[typ.arg]/[nth]/ships)] +[him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now) nth=(scot %ud %.(10 ~(rad og eny)))] diff --git a/gen/womb/stats.hoon b/gen/womb/stats.hoon new file mode 100644 index 000000000..2d1c629bf --- /dev/null +++ b/gen/womb/stats.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/stats/womb/gen + :: +/? 310 +/+ womb +:- %say +|= $: {now/@da eny/@uvI bec/beak} + $~ + who/(unit @p) + == +:- %womb-stat-all +=+ [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now)] +.^((map ship stat:womb) %gx /[him]/hood/[cas]/womb/stats/womb-stat-all) diff --git a/lib/drum.hoon b/lib/drum.hoon index 82e61069f..c02437445 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -9,18 +9,13 @@ :::: :: :: :: :: :: |% :: :: -++ drum-part {$drum $1 drum-pith} :: -++ drum-part-any :: - $: $drum :: - $% {$1 drum-pith} :: - {$0 drum-pith-0} :: - == == :: -++ drum-pith-0 :: old drum-pith - %+ cork drum-pith |= drum-pith :: - +<(bin *(map bone source-0)) :: -++ drum-pith :: - $: eel/(set gill) :: connect to - ray/(set well) :: +++ drum-part {$drum $1 drum-pith-1} :: +++ drum-part-old {$drum $0 drum-pith-0} :: +++ drum-pith-0 _!! :: forgotten +++ drum-pith-1 :: + $: sys/(unit bone) :: local console + eel/(set gill) :: connect to + ray/(set well) :: fur/(map dude (unit server)) :: servers bin/(map bone source) :: terminals == :: @@ -32,19 +27,12 @@ $: syd/desk :: app identity cas/case :: boot case == :: -++ kill-0 (unit (list @c)) :: old kill buffer ++ kill :: kill ring $: pos/@ud :: ring position num/@ud :: number of entries max/_60 :: max entries old/(list (list @c)) :: entries proper == :: -++ source-0 :: old source without - %+ cork source |= source :: kill ring or - %= +< :: blt.target - kil *kill-0 :: - fug *(map gill (unit target-0)) :: - == :: ++ source :: input device $: edg/_80 :: terminal columns off/@ud :: window offset @@ -67,8 +55,6 @@ $: pos/@ud :: search position str/(list @c) :: search string == :: -++ target-0 :: target without blt - (cork target |=(target |1.+<)) :: ++ target :: application target $: blt/(pair (unit dill-belt) (unit dill-belt)) :: curr & prev belts ris/(unit search) :: reverse-i-search @@ -133,25 +119,17 @@ ^- drum-part :* %drum %1 + ~ :: sys (deft-fish our) :: eel (deft-apes our) :: ray ~ :: fur ~ :: bin == :: -:: ++ drum-port - |= old/drum-part-any - ^- drum-part - ?: ?=($1 &2.old) old - ~& [%drum-porting &2.old] - =; bin [%drum %1 |2.old(bin bin)] - %- ~(run by bin.old) - |= source-0 - %= +< - kil (kill ?~(kil ~ [1 1 60 [u.kil]~])) - fug %- ~(run by fug) - |= t/(unit target-0) - ?~(t ~ [~ [[~ ~] u.t]]) + |= old/?(drum-part drum-part-old) ^- drum-part + ?- &2.old + $1 old + $0 !! :: XX unreachable, see issue #242 == :: ++ drum-path :: encode path @@ -223,9 +201,13 @@ =< se-abet =< se-view (se-klin gyl) :: -:: ++ poke-exit :: -:: |=(~ se-abet:(se-blit `dill-blit`[%qit ~])) :: XX find bone -:: :: +++ poke-exit :: + |=($~ se-abet:(se-blit-sys `dill-blit`[%qit ~])) :: +:: +++ poke-put :: + |= {pax/path txt/@} + se-abet:(se-blit-sys [%sav pax txt]) :: +:: ++ reap-phat :: |= {way/wire saw/(unit tang)} =< se-abet =< se-view @@ -270,6 +252,7 @@ ?. se-ably =. . se-adit [(flop moz) +>+>+<+] + =. sys ?^(sys sys `ost) =. . se-subze:se-adze:se-adit :_ %_(+>+>+<+ bin (~(put by bin) ost `source`+>+<)) ^- (list move) @@ -486,6 +469,11 @@ |= bil/dill-blit +>(biz [bil biz]) :: +++ se-blit-sys :: output to system console + |= bil/dill-blit ^+ +> + ?~ sys ~&(%se-blit-no-sys +>) + (se-emit [u.sys %diff %dill-blit bil]) +:: ++ se-show :: show buffer, raw |= lin/(pair @ud (list @c)) ^+ +> @@ -513,7 +501,12 @@ |= mov/move %_(+> moz [mov moz]) :: -++ se-talk +++ se-emil :: emit moves + |= mov/(list move) + ?~ mov +> + $(mov t.mov, +> (se-emit i.mov)) +:: +++ se-talk |= tac/(list tank) ^+ +> :: XX talk should be usable for stack traces, see urbit#584 which this change @@ -617,10 +610,8 @@ ta-bel .(str.u.ris (scag (dec (lent str.u.ris)) str.u.ris)) ?: =(0 pos.inp) - ?: =(0 (lent buf.say.inp)) - (ta-act %clr ~) - :: .(+> (se-blit %bel ~)) - ta-bel + (ta-act %clr ~) + :: .(+> (se-blit %bel ~)) =+ pre=(dec pos.inp) (ta-hom %del pre) :: @@ -850,9 +841,9 @@ $dot ?. &(?=(^ old.hit) ?=(^ -.old.hit)) ta-bel =+ old=`(list @c)`-.old.hit - =+ b=(bwrd (lent old) old nace) + =+ b=(bwrd (lent old) old nedg) %- ta-hom(ris ~) - (ta-cat pos.inp (slag (add b =(0 b)) old)) + (ta-cat pos.inp (slag b old)) :: $bac ?: =(0 pos.inp) ta-bel diff --git a/lib/helm.hoon b/lib/helm.hoon index 9b36a3f6f..e52f8ab92 100644 --- a/lib/helm.hoon +++ b/lib/helm.hoon @@ -78,8 +78,8 @@ ++ poke-begin :: make/send keypair |= hood-begin =< abet ?> ?=($~ bur) - =+ buz=(shax :(mix (jam ges) eny)) - =+ loy=(bruw 2.048 buz) + =+ buz=(shaz :(mix (jam ges) eny)) + =+ loy=(pit:nu:crub 512 buz) %- emit(bur `[his [0 sec:ex:loy]~]) [%wont /helm/ticket [our (sein his)] /a/ta his tic ges pub:ex:loy] :: @@ -98,8 +98,8 @@ :: ++ poke-send-ask |= mel/cord =< abet - %^ emit %poke /helm/ask/(scot %p ~doznec) - [[~doznec %ask] %ask-mail mel] + %^ emit %poke /helm/ask/(scot %p ~marzod) + [[~marzod %ask] %ask-mail mel] :: ++ poke-serve |= top/?(desk beam) =< abet diff --git a/lib/oauth2.hoon b/lib/oauth2.hoon index c491d016f..348462459 100644 --- a/lib/oauth2.hoon +++ b/lib/oauth2.hoon @@ -71,7 +71,7 @@ ++ our-host .^(hart %e /(scot %p our)/host/fake) ++ redirect-uri %- crip %- earn - %^ interpolate 'https://our-host/~/ac/:domain/:user/in' + %^ into-url:interpolate 'https://our-host/~/ac/:domain/:user/in' `our-host :~ domain+(join '.' (flop dom)) user+?:(state-usr '_state' (scot %ta usr)) diff --git a/lib/old-phon.hoon b/lib/old-phon.hoon new file mode 100644 index 000000000..fe378856d --- /dev/null +++ b/lib/old-phon.hoon @@ -0,0 +1,203 @@ +:: Taken from old hoon.hoon +:: +:::: /hoon/old-phon/lib + :: +=< ;~(pfix sig fed:ag) +|% +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: section 2cE, phonetic base :: +:: +++ po + ::~/ %po + =+ :- ^= sis :: prefix syllables + 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\ + /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\ + /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\ + /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\ + /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\ + /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\ + /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\ + /sivtagpadsaldivdactansidfabtarmonranniswolmispal\ + /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\ + /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\ + /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\ + /havsaplindibhosdabbitbarracparloddosbortochilmac\ + /tomdigfilfasmithobharmighinradmashalraglagfadtop\ + /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\ + /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\ + /laptalpitnambonrostonfodponsovnocsorlavmatmipfap' + ^= dex :: suffix syllables + 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\ + /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\ + /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\ + /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\ + /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\ + /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\ + /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\ + /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\ + /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\ + /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\ + /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\ + /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\ + /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\ + /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\ + /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\ + /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes' + |% + ++ ins ::~/ %ins :: parse prefix + |= a/@tas + =+ b=0 + |- ^- (unit @) + ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b)))) + ++ ind ::~/ %ind :: parse suffix + |= a/@tas + =+ b=0 + |- ^- (unit @) + ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b)))) + ++ tos ::~/ %tos :: fetch prefix + |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis))) + ++ tod ::~/ %tod :: fetch suffix + |=(a/@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex))) + -- +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: section 2eL, formatting (path) :: +:: +++ ab + |% + ++ hif (boss 256 ;~(plug tip tiq (easy ~))) + ++ huf %+ cook + |=({a/@ b/@} (wred:un ~(zug mu ~(zag mu [a b])))) + ;~(plug hif ;~(pfix hep hif)) + ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~))) + ++ tip (sear |=(a/@ (ins:po a)) til) + ++ tiq (sear |=(a/@ (ind:po a)) til) + ++ til (boss 256 (stun [3 3] low)) + -- +++ ag + |% + ++ fed ;~ pose + %+ bass 0x1.0000.0000.0000.0000 + ;~((glue doh) ;~(pose hyf:ab huf:ab) (more doh hyf:ab)) + :: + hyf:ab + huf:ab + hif:ab + tiq:ab + == + -- +:: +++ mu + |_ {top/@ bot/@} + ++ zag [p=(end 4 1 (add top bot)) q=bot] + ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot] + ++ zug (mix (lsh 4 1 top) bot) + -- +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: section 2eN, pseudo-cryptography :: +:: +++ un :: =(x (wred (wren x))) + |% + ++ wren :: conceal structure + |= pyn/@ ^- @ + =+ len=(met 3 pyn) + ?: =(0 len) + 0 + => .(len (dec len)) + =+ mig=(zaft (xafo len (cut 3 [len 1] pyn))) + %+ can 3 + %- flop ^- (list {@ @}) + :- [1 mig] + |- ^- (list {@ @}) + ?: =(0 len) + ~ + => .(len (dec len)) + =+ mog=(zyft :(mix mig (end 3 1 len) (cut 3 [len 1] pyn))) + [[1 mog] $(mig mog)] + :: + ++ wred :: restore structure + |= cry/@ ^- @ + =+ len=(met 3 cry) + ?: =(0 len) + 0 + => .(len (dec len)) + =+ mig=(cut 3 [len 1] cry) + %+ can 3 + %- flop ^- (list {@ @}) + :- [1 (xaro len (zart mig))] + |- ^- (list {@ @}) + ?: =(0 len) + ~ + => .(len (dec len)) + =+ mog=(cut 3 [len 1] cry) + [[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)] + :: + ++ xafo |=({a/@ b/@} +((mod (add (dec b) a) 255))) + ++ xaro |=({a/@ b/@} +((mod (add (dec b) (sub 255 (mod a 255))) 255))) + :: + ++ zaft :: forward 255-sbox + |= a/@D + =+ ^= b + 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0. + 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038. + 1f4a.dca2.6fdf.66f9.f561.a12e.5a16.f7b0.a39f.364e.cb70.7318. + 1de1.ad31.63d1.abd4.db68.6a33.134d.a760.edee.5434.493a.e323. + 930d.8f3d.3562.bb81.0b24.43cf.bea5.a6eb.52b4.0229.06b2.6704. + 78c9.45ec.d75e.58af.c577.b7b9.c40e.017d.90c3.87f8.96fa.1153. + 0372.7f30.1c32.ac83.ff17.c6e4.d36d.6b55.e2ce.8c71.8a5b.b6f3. + 9d4b.eab5.8b3c.e7f2.a8fe.9574.5de0.bf20.3f15.9784.9939.5f9c. + e609.564f.d8a4.b825.9819.94aa.2c08.8e4c.9b22.477a.2840.3ed6. + 3750.6ef1.44dd.89ef.6576.d00a.fbda.9ed2.3b6c.7b0c.bde9.2ade. + 5c88.c182.481a.1b0f.2bfd.d591.2726.57ba + (cut 3 [(dec a) 1] b) + :: + ++ zart :: reverse 255-sbox + |= a/@D + =+ ^= b + 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613. + dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3. + 1e95.5fec.ffbc.f187.fbe2.6680.7c77.d30e.e94a.9414.fd9a.017d. + 3a7e.5a55.8ff5.8bf9.c181.e5b6.6ab2.35da.50aa.9293.3bc0.cdc6. + f3bf.1a58.4130.f844.3846.744e.36a0.f205.789e.32d8.5e54.5c22. + 0f76.fce7.4569.0d99.d26e.e879.dc16.2df4.887f.1ffe.4dba.6f5d. + bbcc.2663.1762.aed7.af8a.ca20.dbb4.9bc7.a942.834c.105b.c4d4. + 8202.3e61.a671.90e6.273d.bdab.3157.cfa4.0c2e.df86.2496.f7ed. + 2b48.2a9d.5318.a343.d128.be9c.a5ad.6bb5.6dfa.c5e1.3408.128d. + 2c04.0339.97a1.2ff0.49d0.eeb8.6c0a.0b37.b967.c347.d9ac.e072. + e409.7b9f.1598.1d3f.33de.8ce3.8970.8e7a + (cut 3 [(dec a) 1] b) + :: + ++ zyft :: forward 256-sbox + |= a/@D + =+ ^= b + 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5. + 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d. + 986a.768c.f8e8.c4c7.2f1c.effe.3cae.01c0.253e.65d3.3872. + ce0e.7a74.8ac6.daac.7e5c.6479.44ec.4143.3d20.4af0.ee6c. + c828.deca.0377.249f.ffcd.7b4f.eb7d.66f2.8951.042e.595a. + 8e13.f9c3.a79a.f788.6199.9391.7fab.6200.4ce5.0758.e2f1. + 7594.c945.d218.4248.afa1.e61a.54fb.1482.bea4.96a2.3473. + 63c2.e7cb.155b.120a.4ed7.bfd8.b31b.4008.f329.fca3.5380. + 9556.0cb2.8722.2bea.e96e.3ac5.d1bc.10e3.2c52.a62a.b1d6. + 35aa.d05e.f6a8.0f3b.31ed.559d.09ad.f585.6d21.fd1d.8d67. + 370b.26f4.70c1.b923.4684.6fbd.cf8b.5036.0539.9cdc.d93f. + 9068.1edf.8f33.b632.d427.97fa.9ee1 + (cut 3 [a 1] b) + :: + ++ zyrt :: reverse 256-sbox + |= a/@D + =+ ^= b + 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48. + 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605. + c077.4337.17bd.9eda.62a4.79a7.ccb8.44cd.8e64.1ec4.5b6b. + 1842.ffd8.1dfb.fd07.f2f9.594c.3be3.73c6.2cb6.8438.e434. + 8d3d.ea6a.5268.72db.a001.2e11.de8c.88d3.0369.4f7a.87e2. + 860d.0991.25d0.16b9.978a.4bf4.2a1a.e96c.fa50.85b5.9aeb. + 9dbb.b2d9.a2d1.7bba.66be.e81f.1946.29a8.f5d2.f30c.2499. + c1b3.6583.89e1.ee36.e0b4.6092.937e.d74e.2f6f.513e.9615. + 9c5d.d581.e7ab.fe74.f01b.78b1.ae75.af57.0ec2.adc7.3245. + 12bf.2314.3967.0806.31dc.cb94.d43f.493c.54a6.0421.c3a1. + 1c4a.28ac.fc0b.26ca.5870.e576.f7f1.616d.905f.ef41.33bc. + df4d.225e.2d56.7fd6.1395.a3f8.c582 + (cut 3 [a 1] b) + -- +-- diff --git a/lib/talk.hoon b/lib/talk.hoon index e24c8817a..5a5f619e1 100644 --- a/lib/talk.hoon +++ b/lib/talk.hoon @@ -31,7 +31,7 @@ [now.bol *bouquet [%app dap.bol (crip (earn url))]] :: XX :: ++ said :: app message - |= {our/@p dap/term now/@da eny/@uvI mes/(list tank)} + |= {our/@p dap/term now/@da eny/@uvJ mes/(list tank)} :- %talk-command ^- command :- %publish diff --git a/lib/womb.hoon b/lib/womb.hoon new file mode 100644 index 000000000..d76bccdd5 --- /dev/null +++ b/lib/womb.hoon @@ -0,0 +1,851 @@ +:: :: :: +:::: /hoon/womb/lib :: :: + :: :: :: +/? 310 :: version +/+ talk, old-phon +:: :: :: +:::: :: :: + :: :: :: +|% +++ foil :: ship allocation map + |* mold :: entry mold + $: min/@u :: minimum entry + ctr/@u :: next allocated + und/(set @u) :: free under counter + ove/(set @u) :: alloc over counter + max/@u :: maximum entry + box/(map @u +<) :: entries + == :: +-- :: +:: :: +:::: :: + :: :: +|% :: +++ managed :: managed plot + |* mold :: + %- unit :: unsplit + %+ each +< :: subdivided + mail :: delivered +:: :: +++ divided :: get division state + |* (managed) :: + ?- +< :: + $~ ~ :: unsplit + {$~ $| *} ~ :: delivered + {$~ $& *} (some p.u.+<) :: subdivided + == :: +:: :: +++ moon (managed _!!) :: undivided moon +:: +++ planet :: subdivided planet + (managed (lone (foil moon))) :: +:: :: +++ star :: subdivided star + (managed (pair (foil moon) (foil planet))) :: +:: :: +++ galaxy :: subdivided galaxy + (managed (trel (foil moon) (foil planet) (foil star))):: +:: :: +++ ticket @G :: old 64-bit ticket +++ passcode @uvH :: 128-bit passcode +++ passhash @uwH :: passocde hash +++ mail @t :: email address +++ balance :: invitation balance + $: planets/@ud :: planet count + stars/@ud :: star count + owner/mail :: owner's email + history/(list mail) :: transfer history + == :: +++ client :: per email + $: sta/@ud :: unused star refs + has/(set @p) :: planets owned + == :: +++ property :: subdivided plots + $: galaxies/(map @p galaxy) :: galaxy + planets/(map @p planet) :: star + stars/(map @p star) :: planet + == :: +++ invite :: + $: who/mail :: who to send to + pla/@ud :: planets to send + sta/@ud :: stars to send + wel/welcome :: welcome message + == :: +++ welcome :: welcome message + $: intro/tape :: in invite email + hello/tape :: as talk message + == :: +++ reference :: affiliate credit + (unit (each @p mail)) :: ship or email +:: :: +++ reference-rate 2 :: star refs per star +++ stat (pair live dist) :: external info +++ live ?($cold $seen $live) :: online status +++ dist :: allocation + $% {$free $~} :: unallocated + {$owned p/mail} :: granted, status + {$split p/(map ship stat)} :: all given ships + == :: +:: :: +++ ames-tell :: .^ a+/=tell= type + |^ {p/(list elem) q/(list elem)} :: + ++ elem $^ {p/elem q/elem} :: + {term p/*} :: somewhat underspecified + -- :: +-- :: +:: :: :: +:::: :: :: + :: :: :: +|% +++ part {$womb $1 pith} :: womb state +++ pith :: womb content + $: boss/(unit ship) :: outside master + bureau/(map passhash balance) :: active invitations + office/property :: properties managed + hotel/(map (each ship mail) client) :: everyone we know + recycling/(map ship @) :: old ticket keys + == :: +-- :: +:: :: :: +:::: :: :: + :: :: :: +|% :: arvo structures +++ card :: + $% {$flog wire flog} :: + {$info wire @p @tas nori} :: fs write (backup) + :: {$wait $~} :: delay acknowledgment + {$diff gilt} :: subscription response + {$poke wire dock pear} :: app RPC + {$next wire p/ring} :: update private key + {$tick wire p/@pG q/@p} :: save ticket + {$knew wire p/ship q/will} :: learn will (old pki) + == :: +++ pear :: + $% {$email mail tape wall} :: send email + {$womb-do-ticket ship} :: request ticket + {$womb-do-claim ship @p} :: issue ship + {$drum-put path @t} :: log transaction + == :: +++ gilt :: scry result + $% {$ships (list ship)} :: + {$womb-balance balance} :: + {$womb-balance-all (map passhash mail)} :: + {$womb-stat stat} :: + {$womb-stat-all (map ship stat)} :: + {$womb-ticket-info passcode ?($fail $good $used)} :: + == +++ move (pair bone card) :: user-level move +:: +++ transaction :: logged poke + $% {$report her/@p wyl/will} + {$release gal/@ud sta/@ud} + {$release-ships (list ship)} + {$claim aut/passcode her/@p} + {$recycle who/mail him/knot tik/knot} + {$bonus tid/cord pla/@ud sta/@ud} + {$invite tid/cord ref/reference inv/invite} + {$reinvite aut/passcode inv/invite} + == +-- +|% +++ ames-grab :: XX better ames scry + |= {a/term b/ames-tell} ^- * + =; all (~(got by all) a) + %- ~(gas by *(map term *)) + %- zing + %+ turn (weld p.b q.b) + |= b/elem:ames-tell ^- (list {term *}) + ?@ -.b [b]~ + (weld $(b p.b) $(b q.b)) +:: +++ murn-by + |* {a/(map) b/$-(* (unit))} + ^- ?~(a !! (map _p.n.a _(need (b q.n.a)))) + %- malt + %+ murn (~(tap by a)) + ?~ a $~ + |= _c=n.a ^- (unit _[p.n.a (need (b q.n.a))]) + =+ d=(b q.c) + ?~(d ~ (some [p.c u.d])) +:: +++ unsplit + |= a/(map ship (managed)) ^- (list {ship *}) + %+ skim (~(tap by a)) + |=({@ a/(managed)} ?=($~ a)) +:: +++ issuing + |* a/(map ship (managed)) + ^- (list {ship _(need (divided *~(got by a)))}) + (sort (~(tap by (murn-by a divided))) lor) +:: +++ issuing-under + |* {a/bloq b/ship c/(map @u (managed))} + ^- (list {ship _(need (divided *~(got by c)))}) + %+ turn (sort (~(tap by (murn-by c divided))) lor) + |*(d/{@u *} [(rep a b -.d ~) +.d]) +++ cursor (pair (unit ship) @u) +++ neis |=(a/ship ^-(@u (rsh (dec (xeb (dec (xeb a)))) 1 a))) :: postfix +:: +:: Create new foil of size +++ fo-init + |= a/bloq :: ^- (foil *) + [min=1 ctr=1 und=~ ove=~ max=(dec (bex (bex a))) box=~] +:: +++ fo + |_ (foil $@($~ *)) + ++ nth :: index + |= a/@u ^- (pair (unit @u) @u) + ?: (lth a ~(wyt in und)) + =+ out=(snag a (sort (~(tap in und)) lth)) + [(some out) 0] + =. a (sub a ~(wyt in und)) + |- ^- {(unit @u) @u} + ?: =(ctr +(max)) [~ a] + ?: =(0 a) [(some ctr) a] + $(a (dec a), +<.nth new) + :: + +- fin +< :: abet + ++ new :: alloc + ?: =(ctr +(max)) +< + =. ctr +(ctr) + ?. (~(has in ove) ctr) +< + new(ove (~(del in ove) ctr)) + :: + +- get :: nullable + |= a/@p ^+ ?~(box ~ q.n.box) + (fall (~(get by box) (neis a)) ~) + :: + +- put + |* {a/@u b/*} ^+ fin :: b/_(~(got by box)) + ~| put+[a fin] + ?> (fit a) + =; adj adj(box (~(put by box) a b)) + ?: (~(has in box) a) fin + ?: =(ctr a) new + ?: (lth a ctr) + ?. (~(has in und) a) fin + fin(und (~(del in und) a)) + ?. =(a ctr:new) :: heuristic + fin(ove (~(put in ove) a)) + =+ n=new(+< new) + n(und (~(put in und.n) ctr)) + :: + ++ fit |=(a/@u &((lte min a) (lte a max))) :: in range + ++ gud :: invariant + ?& (fit(max +(max)) ctr) + (~(all in und) fit(max ctr)) + (~(all in ove) fit(min ctr)) + (~(all in box) |=({a/@u *} (fit a))) + |- ^- ? + ?: =(min max) & + =- &(- $(min +(min))) + %+ gte 1 :: at most one of + ;: add + ?:(=(min ctr) 1 0) + ?:((~(has in und) min) 1 0) + ?:((~(has in ove) min) 1 0) + ?:((~(has by box) min) 1 0) + == + == + -- +-- +:: :: :: +:::: :: :: + !: :: :: +=+ cfg=[can-claim=| can-recycle=|] :: temporarily disabled +=+ [replay=| stat-no-email=|] :: XX globals +|= {bowl part} :: main womb work +|_ moz/(list move) +++ abet :: resolve + ^- (quip move *part) + [(flop moz) +>+<+] +:: +++ teba :: install resolved + |= a/(quip move *part) ^+ +> + +>(moz (flop -.a), +>+<+ +.a) +:: +++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card +++ emil :: return cards + |= (list card) + ^+ +> + ?~(+< +> $(+< t.+<, +> (emit i.+<))) +:: +:: +++ take-n :: compute range + |= {{index/@u count/@u} get/$-(@u cursor)} + ^- (list ship) + ?~ count ~ + %+ biff p:(get index) + |= a/ship ^- (list ship) + [a ^$(index +(index), count (dec count))] +:: +++ available :: enumerate free ships + |= all/(map ship (managed)) ^- $-(@u cursor) + =+ pur=(sort (turn (unsplit all) head) lth) + =+ len=(lent pur) + |=(a/@u ?:((gte a len) [~ (sub a len)] [(some (snag a pur)) a])) +:: +:: foil cursor to ship cursor, using sized parent +++ prefix + |= {a/bloq b/@p {c/(unit @u) d/@u}} ^- cursor + ?~ c [c d] + [(some (rep a b u.c ~)) d] +:: +++ in-list :: distribute among options + |* {a/(list) b/@u} ^+ [(snag *@ a) b] + =+ c=(lent a) + [(snag (mod b c) a) (div b c)] +:: +++ ames-last-seen :: last succesful ping + |= a/ship ~+ ^- (unit time) + ?: =(a our) (some now) + %- (hard (unit time)) + ~| ames-look+/(scot %p our)/tell/(scot %da now)/(scot %p a) + %+ ames-grab %rue + .^(ames-tell %a /(scot %p our)/tell/(scot %da now)/(scot %p a)) +:: +++ neighboured :: filter for connectivity + |* a/(list {ship *}) ^+ a + %+ skim a + |= {b/ship *} + ?=(^ (ames-last-seen b)) +:: +++ shop-galaxies (available galaxies.office) :: unassigned %czar +:: +:: Stars can be either whole or children of galaxies +++ shop-stars :: unassigned %king + |= nth/@u ^- cursor + =^ out nth %.(nth (available stars.office)) + ?^ out [out nth] + %+ shop-star nth + (neighboured (issuing galaxies.office)) +:: +++ shop-star :: star from galaxies + |= {nth/@u lax/(list {who/@p * * r/(foil star)})} ^- cursor + ?: =(~ lax) [~ nth] + =^ sel nth (in-list lax nth) + (prefix 3 who.sel (~(nth fo r.sel) nth)) +:: +++ shop-planets :: unassigned %duke + |= nth/@u ^- cursor + =^ out nth %.(nth (available planets.office)) + ?^ out [out nth] + =^ out nth + %+ shop-planet nth + (neighboured (issuing stars.office)) + ?^ out [out nth] + (shop-planet-gal nth (issuing galaxies.office)) +:: +++ shop-planet :: planet from stars + |= {nth/@u sta/(list {who/@p * q/(foil planet)})} ^- cursor + ?: =(~ sta) [~ nth] + =^ sel nth (in-list sta nth) + (prefix 4 who.sel (~(nth fo q.sel) nth)) +:: +++ shop-planet-gal :: planet from galaxies + |= {nth/@u lax/(list {who/@p * * r/(foil star)})} ^- cursor + ?: =(~ lax) [~ nth] + =^ sel nth (in-list lax nth) + %+ shop-planet nth + (neighboured (issuing-under 3 who.sel box.r.sel)) +:: +++ peek-x-shop :: available ships + |= tyl/path ^- (unit (unit {$ships (list @p)})) + =; a ~& peek-x-shop+[tyl a] a + =; res (some (some [%ships res])) + =+ [typ nth]=~|(bad-path+tyl (raid tyl typ=%tas nth=%ud ~)) + :: =. nth (mul 3 nth) + ?+ typ ~|(bad-type+typ !!) + $galaxies (take-n [nth 3] shop-galaxies) + $planets (take-n [nth 3] shop-planets) + $stars (take-n [nth 3] shop-stars) + == +:: +++ get-managed-galaxy ~(got by galaxies.office) :: office read +++ mod-managed-galaxy :: office write + |= {who/@p mod/$-(galaxy galaxy)} ^+ +> + =+ gal=(mod (get-managed-galaxy who)) + +>.$(galaxies.office (~(put by galaxies.office) who gal)) +:: +++ get-managed-star :: office read + |= who/@p ^- star + =+ (~(get by stars.office) who) + ?^ - u + =+ gal=(get-managed-galaxy (sein who)) + ?. ?=({$~ $& *} gal) ~|(unavailable-star+(sein who) !!) + (fall (~(get by box.r.p.u.gal) (neis who)) ~) +:: +++ mod-managed-star :: office write + |= {who/@p mod/$-(star star)} ^+ +> + =+ sta=(mod (get-managed-star who)) :: XX double traverse + ?: (~(has by stars.office) who) + +>.$(stars.office (~(put by stars.office) who sta)) + %+ mod-managed-galaxy (sein who) + |= gal/galaxy ^- galaxy + ?> ?=({$~ $& *} gal) + gal(r.p.u (~(put fo r.p.u.gal) (neis who) sta)) +:: +++ get-managed-planet :: office read + |= who/@p ^- planet + =+ (~(get by planets.office) who) + ?^ - u + ?: (~(has by galaxies.office) (sein who)) + =+ gal=(get-managed-galaxy (sein who)) + ?. ?=({$~ $& *} gal) ~|(unavailable-galaxy+(sein who) !!) + (~(get fo q.p.u.gal) who) + =+ sta=(get-managed-star (sein who)) + ?. ?=({$~ $& *} sta) ~|(unavailable-star+(sein who) !!) + (~(get fo q.p.u.sta) who) +:: +++ mod-managed-planet :: office write + |= {who/@p mod/$-(planet planet)} ^+ +> + =+ pla=(mod (get-managed-planet who)) :: XX double traverse + ?: (~(has by planets.office) who) + +>.$(planets.office (~(put by planets.office) who pla)) + ?: (~(has by galaxies.office) (sein who)) + %+ mod-managed-galaxy (sein who) + |= gal/galaxy ^- galaxy + ?> ?=({$~ $& *} gal) + gal(q.p.u (~(put fo q.p.u.gal) (neis who) pla)) + %+ mod-managed-star (sein who) + |= sta/star ^- star + ?> ?=({$~ $& *} sta) + sta(q.p.u (~(put fo q.p.u.sta) (neis who) pla)) +:: +++ get-live :: last-heard time ++live + |= a/ship ^- live + =+ rue=(ames-last-seen a) + ?~ rue %cold + ?:((gth (sub now u.rue) ~m5) %seen %live) +:: +++ stat-any :: unsplit status + |= {who/@p man/(managed _!!)} ^- stat + :- (get-live who) + ?~ man [%free ~] + ?: stat-no-email [%owned ''] + [%owned p.u.man] +:: +++ stat-planet :: stat of planet + |= {who/@p man/planet} ^- stat + ?. ?=({$~ $& ^} man) (stat-any who man) + :- (get-live who) + =+ pla=u:(divided man) + :- %split + %- malt + %+ turn (~(tap by box.p.pla)) + |=({a/@u b/moon} =+((rep 5 who a ~) [- (stat-any - b)])) +:: +++ stat-star :: stat of star + |= {who/@p man/star} ^- stat + ?. ?=({$~ $& ^} man) (stat-any who man) + :- (get-live who) + =+ sta=u:(divided man) + :- %split + %- malt + %+ welp + %+ turn (~(tap by box.p.sta)) + |=({a/@u b/moon} =+((rep 5 who a ~) [- (stat-any - b)])) + %+ turn (~(tap by box.q.sta)) + |=({a/@u b/planet} =+((rep 4 who a ~) [- (stat-planet - b)])) +:: +++ stat-galaxy :: stat of galaxy + |= {who/@p man/galaxy} ^- stat + ?. ?=({$~ $& ^} man) (stat-any who man) + =+ gal=u:(divided man) + :- (get-live who) + :- %split + %- malt + ;: welp + %+ turn (~(tap by box.p.gal)) + |=({a/@u b/moon} =+((rep 5 who a ~) [- (stat-any - b)])) + :: + %+ turn (~(tap by box.q.gal)) + |=({a/@u b/planet} =+((rep 4 who a ~) [- (stat-planet - b)])) + :: + %+ turn (~(tap by box.r.gal)) + |=({a/@u b/star} =+((rep 3 who a ~) [- (stat-star - b)])) + == +:: +++ stats-ship :: inspect ship + |= who/@p ^- stat + ?- (clan who) + $pawn !! + $earl !! + $duke (stat-planet who (get-managed-planet who)) + $king (stat-star who (get-managed-star who)) + $czar (stat-galaxy who (get-managed-galaxy who)) + == +:: +++ peek-x-stats :: inspect ship/system + |= tyl/path + ?^ tyl + ?> |(=(our src) =([~ src] boss)) :: privileged info + ``womb-stat+(stats-ship ~|(bad-path+tyl (raid tyl who=%p ~))) + ^- (unit (unit {$womb-stat-all (map ship stat)})) + =. stat-no-email & :: censor adresses + :^ ~ ~ %womb-stat-all + %- ~(uni by (~(urn by planets.office) stat-planet)) + %- ~(uni by (~(urn by stars.office) stat-star)) + (~(urn by galaxies.office) stat-galaxy) +:: +++ peek-x-balance :: inspect invitation + |= tyl/path + ?~ tyl + ?> |(=(our src) =([~ src] boss)) :: priveledged + ``[%womb-balance-all (~(run by bureau) |=(balance owner))] + ^- (unit (unit {$womb-balance balance})) + =+ pas=~|(bad-path+tyl (raid tyl pas=%uv ~)) + %- some + %+ bind (~(get by bureau) (shaf %pass pas)) + |=(bal/balance [%womb-balance bal]) +:: +:: ++ old-phon ;~(pfix sig fed:ag:hoon151) :: library +++ parse-ticket + |= {a/knot b/knot} ^- {him/@ tik/@} + [him=(rash a old-phon) tik=(rash b old-phon)] +:: +++ check-old-ticket + |= {a/ship b/@pG} ^- (unit ?) + %+ bind (~(get by recycling) (sein a)) + |= key/@ ^- ? + =(b `@p`(end 6 1 (shaf %tick (mix a (shax key))))) +:: +:: +++ peek-x-ticket + |= tyl/path + ^- (unit (unit {$womb-ticket-info passcode ?($fail $good $used)})) + ?. ?=({@ @ $~} tyl) ~|(bad-path+tyl !!) + =+ [him tik]=(parse-ticket i.tyl i.t.tyl) + %+ bind (check-old-ticket him tik) + |= gud/? + :+ ~ %womb-ticket-info + =+ pas=`passcode`(end 7 1 (sham %tick him tik)) + :- pas + ?. gud %fail + ?: (~(has by bureau) (shaf %pass pas)) %used + %good +:: +++ peer-scry-x :: subscription like .^ + |= tyl/path + =< abet + =+ gil=(peek-x tyl) + ~| tyl + ?~ gil ~|(%block-stub !!) + ?~ u.gil ~|(%bad-path !!) + (emit %diff u.u.gil) +:: +++ peek-x :: stateless read + |= tyl/path ^- (unit (unit gilt)) + ~| peek+x+tyl + ?~ tyl ~ + ?+ -.tyl ~ + :: /shop/planets/@ud (list @p) up to 3 planets + :: /shop/stars/@ud (list @p) up to 3 stars + :: /shop/galaxies/@ud (list @p) up to 3 galaxies + $shop (peek-x-shop +.tyl) + :: /stats general stats dump + :: /stats/@p what we know about @p + $stats (peek-x-stats +.tyl) + :: /balance all invitations + :: /balance/passcode invitation status + $balance (peek-x-balance +.tyl) + :: /ticket/ship/ticket check ticket usability + $ticket (peek-x-ticket +.tyl) + == +:: +++ poke-manage-old-key :: add to recyclable tickets + |= {a/ship b/@} + =< abet + ?> |(=(our src) =([~ src] boss)) :: privileged + .(recycling (~(put by recycling) a b)) +:: +++ poke-manage :: add to property + |= a/(list ship) + =< abet + ?> |(=(our src) =([~ src] boss)) :: privileged + |- + ?~ a . + ?+ (clan i.a) ~|(bad-size+(clan i.a) !!) + $duke + ?. (~(has by planets.office) i.a) + $(a t.a, planets.office (~(put by planets.office) i.a ~)) + ~|(already-managing+i.a !!) + :: + $king + ?. (~(has by stars.office) i.a) + $(a t.a, stars.office (~(put by stars.office) i.a ~)) + ~|(already-managing+i.a !!) + :: + $czar + ?. (~(has by galaxies.office) i.a) + $(a t.a, galaxies.office (~(put by galaxies.office) i.a ~)) + ~|(already-managing+i.a !!) + == +:: +++ email :: send email + |= {wir/wire adr/mail msg/tape} ^+ +> + ?: replay +> :: dont's send email in replay mode + ~& do-email+[adr msg] + ::~&([%email-stub adr msg] +>) + (emit %poke [%mail wir] [our %gmail] %email adr "Your Urbit Invitation" [msg]~) +:: +++ log-transaction :: logged poke + |= a/transaction ^+ +> + ?: replay +> + (emit %poke /log [our %hood] %drum-put /womb-events/(scot %da now)/hoon (crip )) +:: +++ poke-replay-log :: rerun transactions + |= a/(list {eny/@uvI pok/transaction}) + ?~ a abet + ~& womb-replay+-.pok.i.a + =. eny eny.i.a + =. replay & + %_ $ + a t.a + +> + ?- -.pok.i.a + $claim (teba (poke-claim +.pok.i.a)) + $bonus (teba (poke-bonus +.pok.i.a)) + $invite (teba (poke-invite +.pok.i.a)) + $report (teba (poke-report +.pok.i.a)) + $release (teba (poke-release +.pok.i.a)) + $recycle (teba (poke-recycle +.pok.i.a)) + $reinvite (teba (poke-reinvite +.pok.i.a)) + $release-ships (teba (poke-release-ships +.pok.i.a)) + == + == +:: +++ poke-bonus :: expand invitation + |= {tid/cord pla/@ud sta/@ud} + =< abet + =. log-transaction (log-transaction %bonus +<) + ?> |(=(our src) =([~ src] boss)) :: priveledged + =/ pas ~|(bad-invite+tid `passcode`(slav %uv tid)) + %_ . + bureau + %+ ~(put by bureau) (shaf %pass pas) + =/ bal ~|(%bad-passcode (~(got by bureau) (shaf %pass pas))) + bal(planets (add pla planets.bal), stars (add sta stars.bal)) + == +:: +++ poke-invite :: create invitation + |= {tid/cord ref/reference inv/invite} + =< abet + =. log-transaction (log-transaction %invite +<) + =. hotel + ?~ ref hotel + ?~ sta.inv hotel + %+ ~(put by hotel) u.ref + =+ cli=(fall (~(get by hotel) u.ref) *client) + cli(sta +(sta.cli)) + (invite-from ~ tid inv) +:: +++ invite-from :: traced invitation + |= {hiz/(list mail) tid/cord inv/invite} ^+ +> + ?> |(=(our src) =([~ src] boss)) :: priveledged + =+ pas=~|(bad-invite+tid `passcode`(slav %uv tid)) + ?: (~(has by bureau) (shaf %pass pas)) + ~|([%duplicate-passcode pas who.inv replay=replay] !!) + =. bureau (~(put by bureau) (shaf %pass pas) [pla.inv sta.inv who.inv hiz]) + (email /invite who.inv intro.wel.inv) +:: +:: ++ coup-invite :: invite sent +:: +++ poke-reinvite :: split invitation + |= {aut/passcode inv/invite} :: further invite + =< abet + =. log-transaction (log-transaction %reinvite +<) + ?> =(src src) :: self-authenticated + =+ ~|(%bad-passcode bal=(~(got by bureau) (shaf %pass aut))) + =. stars.bal (sub stars.bal sta.inv) + =. planets.bal (sub planets.bal pla.inv) + =. bureau (~(put by bureau) (shaf %pass aut) bal) + =+ tid=(scot %uv (end 7 1 (shaf %pass eny))) + (invite-from [owner.bal history.bal] tid inv) +:: +++ poke-obey :: set/reset boss + |= who/(unit @p) + =< abet + ?> =(our src) :: me only + .(boss who) +:: +++ poke-save :: write backup + |= pax/path + =< abet + ?> =(our src) :: me only + =+ pas=`@uw`(shas %back eny) + ~& [%backing-up pas=pas] + =; dif (emit %info /backup [our dif]) + %+ foal (welp pax /jam-crub) + [%jam-crub !>((en:crub pas (jam `part`+:abet)))] +:: +++ poke-rekey :: extend will + |= $~ + =< abet + ?> |(=(our src) =([~ src] boss)) :: privileged + :: (emit /rekey %next sec:ex:(pit:nu:crub 512 (shaz (mix %next (shaz eny))))) + ~& %rekey-stub . +:: +++ poke-report :: report will + |= {her/@p wyl/will} :: + =< abet + =. log-transaction (log-transaction %report +<) + ?> =(src src) :: self-authenticated + (emit %knew /report her wyl) +:: +++ use-reference :: bonus stars + |= a/(each @p mail) ^- (unit _+>) + ?. (~(has by hotel) a) ~ + =+ cli=(~(get by hotel) a) + ?~ cli ~ + ?. (gte sta.u.cli reference-rate) ~ + =. sta.u.cli (sub sta.u.cli reference-rate) + `+>.$(hotel (~(put by hotel) a u.cli)) +:: +++ poke-do-ticket :: issue child ticket + |= her/ship + =< abet + ?> =(our (sein her)) + ?> |(=(our src) =([~ src] boss)) :: privileged + =+ tik=.^(@p %a /(scot %p our)/tick/(scot %da now)/(scot %p her)) + :: =. emit (emit /tick %tick tik her) + (emit %poke /tick [src %hood] [%womb-do-claim her tik]) :: XX peek result +:: +++ needy + |* a/(each * tang) + ?- -.a + $& p.a + $| ((slog (flop p.a)) (mean p.a)) + == +:: +++ poke-do-claim :: deliver ticket + |= {her/ship tik/@p} + =< abet + ^+ +> + ?> =(src (sein her)) :: from the parent which could ticket + =+ sta=(stats-ship her) + ?> ?=($cold p.sta) :: a ship not yet started + ?- -.q.sta + $free !! :: but allocated + $owned :: to an email + (email /ticket p.q.sta "Ticket for {}: {<`@pG`tik>}") + :: + $split :: or ship distribution + %.(+>.$ (slog leaf+"Ticket for {}: {<`@pG`tik>}" ~)) :: XX emit via console formally? + == +:: +++ poke-recycle :: save ticket as balance + |= {who/mail him-t/knot tik-t/knot} + ?. can-recycle.cfg ~|(%ticket-recycling-offline !!) + =< abet + =. log-transaction (log-transaction %recycle +<) + ?> =(src src) + =+ [him tik]=(parse-ticket him-t tik-t) + ?> (need (check-old-ticket him tik)) + =+ pas=`passcode`(end 7 1 (sham %tick him tik)) + ?: (~(has by bureau) (shaf %pass pas)) + ~|(already-recycled+[him-t tik-t] !!) + =+ bal=`balance`?+((clan him) !! $duke [1 0 who ~], $king [0 1 who ~]) + .(bureau (~(put by bureau) (shaf %pass pas) bal)) +:: +++ poke-claim :: claim plot, req ticket + |= {aut/passcode her/@p} + ?. can-claim.cfg ~|(%ticketing-offline !!) + =< abet + =. log-transaction (log-transaction %claim +<) + ?> =(src src) + (claim-any aut her) +:: +++ claim-any :: register + |= {aut/passcode her/@p} + =; claimed + :: =. claimed (emit.claimed %wait $~) :: XX delay ack + (emit.claimed %poke /tick [(sein her) %hood] [%womb-do-ticket her]) + =+ ~|(%bad-passcode bal=(~(got by bureau) (shaf %pass aut))) + ?+ (clan her) ~|(bad-size+(clan her) !!) + $king + =; all (claim-star.all owner.bal her) + =+ (use-reference &+src) + ?^ - u :: prefer using references + =+ (use-reference |+owner.bal) + ?^ - u + =. stars.bal ~|(%no-stars (dec stars.bal)) + +>.$(bureau (~(put by bureau) (shaf %pass aut) bal)) + :: + $duke + =. planets.bal ~|(%no-planets (dec planets.bal)) + =. bureau (~(put by bureau) (shaf %pass aut) bal) + (claim-planet owner.bal her) + == +:: +++ claim-star :: register + |= {who/mail her/@p} ^+ +> + %+ mod-managed-star her + |= a/star ^- star + ?^ a ~|(impure-star+[her a] !!) + (some %| who) +:: +++ claim-planet :: register + |= {who/mail her/@p} ^+ +> + =. hotel + %+ ~(put by hotel) |+who + =+ cli=(fall (~(get by hotel) |+who) *client) + cli(has (~(put in has.cli) her)) + %+ mod-managed-planet her + |= a/planet ^- planet + ?^ a ~|(impure-planet+[her a] !!) + (some %| who) +:: +++ poke-release-ships :: release specific + |= a/(list ship) + =< abet ^+ +> + =. log-transaction (log-transaction %release-ships +<) + ?> =(our src) :: privileged + %+ roll a + =+ [who=*@p res=+>.$] + |. ^+ res + ?+ (clan who) ~|(bad-size+(clan who) !!) + $king (release-star who res) + $czar (release-galaxy who res) + == +:: +++ poke-release :: release to subdivide + |= {gal/@ud sta/@ud} :: + =< abet ^+ +> + =. log-transaction (log-transaction %release +<) + ?> =(our src) :: privileged + =. +> + ?~ gal +> + =+ all=(take-n [0 gal] shop-galaxies) + ?. (gth gal (lent all)) + (roll all release-galaxy) + ~|(too-few-galaxies+[want=gal has=(lent all)] !!) + ^+ +> + ?~ sta +> + =+ all=(take-n [0 sta] shop-stars) + ~& got-stars+all + %- (slog leaf+"For issuing to proceed smoothly, immediately upon boot, ". + "each should |obey {} to honor ticket requests." ~) + ?. (gth sta (lent all)) + (roll all release-star) + ~|(too-few-stars+[want=sta has=(lent all)] !!) +:: +++ release-galaxy :: subdivide %czar + =+ [who=*@p res=.] + |. ^+ res + %+ mod-managed-galaxy:res who + |= gal/galaxy ^- galaxy + ~& release+who + ?^ gal ~|(already-used+who !!) + (some %& (fo-init 5) (fo-init 4) (fo-init 3)) +:: +++ release-star :: subdivide %king + =+ [who=*@p res=.] + |. ^+ res + =. res (emit.res %poke /tick [(sein who) %hood] [%womb-do-ticket who]) + %+ mod-managed-star:res who + |= sta/star ^- star + ~& release+who + ?^ sta ~|(already-used+[who u.sta] !!) + (some %& (fo-init 4) (fo-init 3)) +-- diff --git a/mar/drum-put.hoon b/mar/drum-put.hoon new file mode 100644 index 000000000..d1dc4b86a --- /dev/null +++ b/mar/drum-put.hoon @@ -0,0 +1,11 @@ +:: +:::: /hoon/do-claim/womb/mar + :: +/? 310 +|_ {path @} +:: +++ grab :: convert from + |% + ++ noun {path @} :: clam from %noun + -- +-- diff --git a/mar/email.hoon b/mar/email.hoon new file mode 100644 index 000000000..cdedcd361 --- /dev/null +++ b/mar/email.hoon @@ -0,0 +1,11 @@ +:: +:::: /hoon/email/mar + :: +/? 310 +|_ {adr/@ta tyl/tape mez/wall} +:: +++ grab :: convert from + |% + ++ noun {@ta tape wall} :: clam from %noun + -- +-- diff --git a/mar/gmail/req.hoon b/mar/gmail/req.hoon new file mode 100644 index 000000000..d8d872ff1 --- /dev/null +++ b/mar/gmail/req.hoon @@ -0,0 +1,8 @@ +/- rfc, gmail-label + +|_ {method/meth endpoint/path query/quay mes/?(message:rfc label-req:gmail-label)} :: jon=(unit json)] +++ grab + |% + ++ noun {method/meth endpoint/path query/quay mes/?(message:rfc label-req:gmail-label)}:: jon=(unit json)] + -- +-- diff --git a/mar/jam-crub.hoon b/mar/jam-crub.hoon new file mode 100644 index 000000000..bd3739706 --- /dev/null +++ b/mar/jam-crub.hoon @@ -0,0 +1,17 @@ +:: +:::: /hoon/jam-crub/mar + :: +/? 310 +!: +|_ mud/@ +++ grow + |% + ++ mime [/application/octet-stream (taco mud)] + -- +++ grab + |% :: convert from + ++ noun @ :: clam from %noun + ++ mime |=({* octs} q) + -- +++ grad %mime +-- diff --git a/mar/jam.hoon b/mar/jam.hoon index 3647266fa..88d76e25c 100644 --- a/mar/jam.hoon +++ b/mar/jam.hoon @@ -8,9 +8,9 @@ |% ++ mime [/application/octet-stream (taco mud)] -- +++ garb /womb-part ++ grab |% :: convert from - ++ mime |=({p/mite q/octs} q.q) ++ noun @ :: clam from %noun -- ++ grad %mime diff --git a/mar/mime.hoon b/mar/mime.hoon index 28c909023..e89831ffe 100644 --- a/mar/mime.hoon +++ b/mar/mime.hoon @@ -4,6 +4,11 @@ /? 310 !: |_ own/mime +++ grow + |% + ++ jam `@`q.q.own + -- +:: ++ grab :: convert from |% ++ noun mime :: clam from %noun diff --git a/mar/ships.hoon b/mar/ships.hoon new file mode 100644 index 000000000..31596da2a --- /dev/null +++ b/mar/ships.hoon @@ -0,0 +1,14 @@ +:: +:::: /hoon/ships/mar + :: +/? 310 +|_ all/(list ship) +++ grab |% + ++ noun (list ship) + ++ json (corl need (ar (su fed:ag)):jo) + -- +++ grow |% + ++ json `^json`[%a (turn all |=(a/ship (jape +:)))] + -- +++ grad %json +-- diff --git a/mar/womb/balance.hoon b/mar/womb/balance.hoon new file mode 100644 index 000000000..e22a35c2a --- /dev/null +++ b/mar/womb/balance.hoon @@ -0,0 +1,25 @@ +:: +:::: /hoon/stat-all/womb/mar + :: +/? 310 +/+ womb +:: +:::: ~fyr + :: +|_ balance:womb +:: +++ grab :: convert from + |% + ++ noun balance:womb :: clam from %noun + -- +++ grow + |% + ++ json + %- jobe :~ + owner+[%s owner] + stars+(jone stars) + planets+(jone planets) + history+[%a (turn history |=(a/knot s+a))] + == + -- +-- diff --git a/mar/womb/claim.hoon b/mar/womb/claim.hoon new file mode 100644 index 000000000..dc271c349 --- /dev/null +++ b/mar/womb/claim.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/claim/womb/mar + :: +/? 310 +|_ {aut/@uvH her/@p} +:: +++ grab :: convert from + |% + ++ noun {@uvH @p} :: clam from %noun + ++ json (corl need (ot aut+(su ;~(pfix (jest '0v') viz:ag)) her+(su fed:ag) ~):jo) + -- +-- diff --git a/mar/womb/do-claim.hoon b/mar/womb/do-claim.hoon new file mode 100644 index 000000000..72a012cee --- /dev/null +++ b/mar/womb/do-claim.hoon @@ -0,0 +1,11 @@ +:: +:::: /hoon/do-claim/womb/mar + :: +/? 310 +|_ {her/ship tik/@p} +:: +++ grab :: convert from + |% + ++ noun {ship @p} :: clam from %noun + -- +-- diff --git a/mar/womb/do-ticket.hoon b/mar/womb/do-ticket.hoon new file mode 100644 index 000000000..ff5d71ee5 --- /dev/null +++ b/mar/womb/do-ticket.hoon @@ -0,0 +1,11 @@ +:: +:::: /hoon/do-ticket/womb/mar + :: +/? 310 +|_ her/ship +:: +++ grab :: convert from + |% + ++ noun @p :: clam from %noun + -- +-- diff --git a/mar/womb/invite.hoon b/mar/womb/invite.hoon new file mode 100644 index 000000000..6d14ddd6e --- /dev/null +++ b/mar/womb/invite.hoon @@ -0,0 +1,28 @@ +:: +:::: /hoon/stat-all/womb/mar + :: +/? 310 +/+ womb +:: +:::: ~fyr + :: +|_ {cord reference invite}:womb +:: +++ grab :: convert from + |% + ++ noun {cord reference invite}:womb :: clam from %noun + ++ json + %+ corl need + => jo + =+ ^= mail + ;~ simu + ;~(pfix (plus ;~(less pat next)) pat) + (cook crip (star ;~(less ace prn))) + == + %- ot :~ + tid+so + ref+(mu (su (pick ;~(pfix (jest '0v') viz:ag) mail))) + inv+(ot who+(su mail) pla+ni sta+ni wel+(ot intro+sa hello+sa ~) ~) + == + -- +-- diff --git a/mar/womb/part.hoon b/mar/womb/part.hoon new file mode 100644 index 000000000..9168154aa --- /dev/null +++ b/mar/womb/part.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/part/womb/mar + :: +/? 310 +/+ womb +|_ all/part:womb +++ grad %jam +++ grow |% ++ jam (^jam all) + -- +++ grab |% ++ jam |=(a/@ (noun (cue a))) + ++ noun part:womb +-- -- diff --git a/mar/womb/recycle.hoon b/mar/womb/recycle.hoon new file mode 100644 index 000000000..a4dd1c51b --- /dev/null +++ b/mar/womb/recycle.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/recycle/womb/mar + :: +/? 310 +|_ {who/@txmail him/knot tik/knot} +:: +++ grab :: convert from + |% + ++ noun {@t @t @t} :: clam from %noun + ++ json (corl need (ot who+so him+so tik+so ~):jo) + -- +-- diff --git a/mar/womb/replay-log.hoon b/mar/womb/replay-log.hoon new file mode 100644 index 000000000..087ac99e2 --- /dev/null +++ b/mar/womb/replay-log.hoon @@ -0,0 +1,10 @@ +:: +:::: /hoon/replay-log/womb/mar + :: +/? 310 +/+ womb +|_ log/(list {@uvI transaction:womb}) +++ grab |% + ++ noun (list {@uvI transaction:womb}) + -- +-- diff --git a/mar/womb/stat-all.hoon b/mar/womb/stat-all.hoon new file mode 100644 index 000000000..4f6970c53 --- /dev/null +++ b/mar/womb/stat-all.hoon @@ -0,0 +1,33 @@ +:: +:::: /hoon/stat-all/womb/mar + :: +/? 310 +/+ womb +:: +:::: ~fyr + :: +|_ all/(map ship stat:womb) +:: +++ grab :: convert from + |% + ++ noun (map ship stat:womb) :: clam from %noun + -- +++ grow + |% + ++ json + %- jobe + %+ turn (~(tap by all)) + |= {a/ship b/stat:womb} ^- {cord ^json} + :- (crip +:) + (jobe live+[%s p.b] dist+(json-dist q.b) ~) + :: + ++ json-dist + |= a/dist:womb + %+ joba -.a + ?- -.a + $free b+& + $owned s+p.a + $split json(all p.a) + == + -- +-- diff --git a/mar/womb/ticket-info.hoon b/mar/womb/ticket-info.hoon new file mode 100644 index 000000000..5acf092b9 --- /dev/null +++ b/mar/womb/ticket-info.hoon @@ -0,0 +1,22 @@ +:: +:::: /hoon/stat-all/womb/mar + :: +/? 310 +:: +:::: ~fyr + :: +|_ {pas/@uvH status/?($fail $good $used)} +:: +++ grab + |% + ++ noun {@uvH ?($fail $good $used)} + -- +++ grow + |% + ++ json + %- jobe :~ + passcode+(jape ) + status+[%s status] + == + -- +-- diff --git a/sur/gmail-label.hoon b/sur/gmail-label.hoon new file mode 100644 index 000000000..9e6a9a30c --- /dev/null +++ b/sur/gmail-label.hoon @@ -0,0 +1,34 @@ +:: This structure is the hoon equivalent of the labels resource used by the +:: gmail api + + +|% +++ label-list-visibility + $? $'labelHide' :: Do not show the label in the label list + $'labelShow' :: Show the label in the label list. (Default) + $'labelShowIfUnread' :: Show the label if any unread msgs w/that label. + == +++ message-list-visibility + $? $hide :: Do not show the label in the message list. + $show :: Show the label in the message list. (Default) + == +-- + +|% +:: label request is the body of the post request you send to gmail to create +:: a labels resource +++ label-req {llv/label-list-visibility mlv/message-list-visibility name/@t} + +:: the label resource returned by gmail in response to your successful request +++ label * + +++ label-req-to-json + |= label-req + %- jobe :^ + ['name' `json`s+name] + ['labelListVisibility' `json`s+(crip (sifo `cord`llv))] + ['messageListVisibility' `json`s+(crip (sifo `cord`mlv))] + ~ +-- + + diff --git a/sur/gmail-message.hoon b/sur/gmail-message.hoon new file mode 100644 index 000000000..810b4c03c --- /dev/null +++ b/sur/gmail-message.hoon @@ -0,0 +1 @@ +{to/@p subj/@t body/wain} diff --git a/sur/rfc.hoon b/sur/rfc.hoon index 869bb3116..7860564a8 100644 --- a/sur/rfc.hoon +++ b/sur/rfc.hoon @@ -9,7 +9,6 @@ ++ email-adr-to-text |=({name/@t domain/@t} (trip (rap 3 name '@' domain ~))) ++ message-to-rfc822 |= a/message ^- cord - %- crip ^- tape %- sifo %- crip """ From: {(email-adr-to-text from.a)} diff --git a/sur/sole.hoon b/sur/sole.hoon index a1f258d16..d911d81de 100644 --- a/sur/sole.hoon +++ b/sur/sole.hoon @@ -82,7 +82,7 @@ == :: ++ sole-args :: generator arguments |* _[* *] :: - {{now/@da eny/@uvI bek/beak} {+<- +<+}} :: + {{now/@da eny/@uvJ bek/beak} {+<- +<+}} :: :: :: :: :: ++ sole-so :: construct result diff --git a/web/lib/js/urb.js b/web/lib/js/urb.js index 244b9b1dc..c77edfaf8 100644 --- a/web/lib/js/urb.js +++ b/web/lib/js/urb.js @@ -134,7 +134,7 @@ window.urb.send = function(data,params,cb) { // or send(data, cb) this.qreq('post',url,params,true,function(err,data) { /* if(err) { $send.seqn--; } - else */ if(data && data.data.fail && urb.wall !== false) { + else */ if(data && data.data.fail && urb.wall !== false && params.wall !== false) { document.location = "#ERROR" document.write("
"+JSON.stringify(params.xyro)+"\n"
                             +data.data.mess+"
") // XX @@ -189,6 +189,9 @@ window.urb.poll = function(params) { if($this.cabs[fn]) $this.cabs[fn].call(this,err2, {status: res.status, data: res.data.data.json}) // XX non-json + break; + case "quit": + // XX necessary behaviour? break; default: throw new Error("Lost event %"+res.data.type) diff --git a/web/womb.hoon b/web/womb.hoon new file mode 100644 index 000000000..a4267e546 --- /dev/null +++ b/web/womb.hoon @@ -0,0 +1,16 @@ +:: +:::: /hoon/womb/web + :: +/? 310 +;module(nav_title "Hello", nav_no-dpad "", nav_no-sibs "") + ;script@"/~/at/=home=/web/lib/js/urb.js"; +:: ;link/"/womb/main.css"(rel "stylesheet"); + ;script@"./main.js"; +:: ;h3: Warning: planet and star names not final. +:: ;p +:: ; This is a test network, and the ;{code "@p"} phonetic network address +:: ; transcription scheme is undergoing revision. Any claimed ships are +:: ; provisional and may cease to exist before full continuity is reached. +:: == + ;womb; +== diff --git a/web/womb/main.js b/web/womb/main.js new file mode 100644 index 000000000..ae1e7685f --- /dev/null +++ b/web/womb/main.js @@ -0,0 +1,1092 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= minLength ? pass : void 0)); + } + }); +}); + + +},{"../util.coffee":15}],10:[function(require,module,exports){ +var Actions, FromStore, Scry, Store, div, i, recl, ref, rele; + +Actions = require('../Actions.coffee'); + +Store = require('../Store.coffee'); + +recl = React.createClass; + +rele = React.createElement; + +ref = React.DOM, div = ref.div, i = ref.i; + +FromStore = function(path, Child) { + return recl({ + displayName: "FromStore." + path.split('/').join('-'), + getInitialState: function() { + return this.retrieveData(); + }, + retrieveData: function() { + var data, obj; + data = Store.retrieve(this.getPath()); + return ( + obj = { + loaded: data != null + }, + obj["" + (this.getKey())] = data, + obj + ); + }, + getKey: function() { + return path.match(/[a-z0-9-]+/)[0]; + }, + getPath: function() { + return path.replace(/:([a-z0-9_.~-]+)/g, (function(_this) { + return function(m, key) { + return _this.props[key]; + }; + })(this)); + }, + componentDidMount: function() { + return Store.addChangeListener(this.changeListener); + }, + componentWillUnmount: function() { + return Store.removeChangeListener(this.changeListener); + }, + componentDidUpdate: function(_props, _state) { + if (_props !== this.props) { + return this.setState(this.retrieveData()); + } + }, + changeListener: function() { + if (this.isMounted()) { + return this.setState(this.retrieveData()); + } + }, + render: function() { + return rele(Child, _.extend({}, this.props, this.state, { + path: this.getPath() + })); + } + }); +}; + +Scry = function(path, Child) { + return FromStore(path, recl({ + displayName: "Scry", + checkProps: function() { + if (!this.props.loaded) { + return Actions.getData(this.props.path); + } + }, + componentDidMount: function() { + return this.checkProps(); + }, + componentDidUpdate: function(_props, _state) { + return this.checkProps(); + }, + render: function() { + return div({ + style: { + display: "inline" + } + }, !this.props.loaded ? i({ + key: "load" + }, "Fetching data...") : rele(Child, _.extend({}, this.props, { + key: "got" + }), this.props.children)); + } + })); +}; + +module.exports = Scry; + +module.exports.FromStore = FromStore; + + +},{"../Actions.coffee":1,"../Store.coffee":4}],11:[function(require,module,exports){ +var input, name, recl, shipShape; + +shipShape = require('../util.coffee').shipShape; + +input = React.DOM.input; + +recl = React.createClass; + +name = function(displayName, component) { + return _.extend(component, { + displayName: displayName + }); +}; + +module.exports = name("ShipInput", function(arg) { + var defaultValue, length, onInputShip; + onInputShip = arg.onInputShip, length = arg.length, defaultValue = arg.defaultValue; + return input({ + defaultValue: defaultValue, + onChange: function(arg1) { + var ship, target; + target = arg1.target; + ship = target.value.trim(); + if (ship[0] !== '~') { + ship = "~" + ship; + } + return onInputShip(((shipShape(ship)) && ship.length === length ? ship.slice(1) : void 0)); + } + }); +}); + + +},{"../util.coffee":15}],12:[function(require,module,exports){ +var Label, Scry, Stat, clas, code, div, labels, li, name, p, pre, recl, ref, rele, span, ul; + +clas = require('classnames'); + +Scry = require('./Scry.coffee'); + +Label = require('./Label.coffee'); + +recl = React.createClass; + +rele = React.createElement; + +name = function(displayName, component) { + return _.extend(component, { + displayName: displayName + }); +}; + +ref = React.DOM, p = ref.p, ul = ref.ul, li = ref.li, span = ref.span, div = ref.div, pre = ref.pre, code = ref.code; + +labels = { + free: "Unallocated", + owned: "Issued", + split: "Distributing" +}; + +Stat = name("Stat", function(arg) { + var className, dist, free, live, owned, ship, split, stats; + stats = arg.stats; + return ul({}, (function() { + var ref1, results; + results = []; + for (ship in stats) { + ref1 = stats[ship], live = ref1.live, dist = ref1.dist; + free = dist.free, owned = dist.owned, split = dist.split; + className = clas(dist); + results.push(li({ + className: className, + key: ship + }, span({ + className: "mono" + }, "~" + ship), " (", live, "): ", (function() { + switch (false) { + case free == null: + return Label(labels.free); + case owned == null: + return Label(labels.owned); + case split == null: + if (_.isEmpty(split)) { + return Label(labels.split); + } else { + return rele(Stat, { + stats: split + }); + } + break; + default: + throw new Error("Bad stat: " + (_.keys(dist))); + } + })())); + } + return results; + })()); +}); + +module.exports = Scry("/stats", Stat); + + +},{"./Label.coffee":7,"./Scry.coffee":10,"classnames":16}],13:[function(require,module,exports){ +var ClaimButton, Scry, ShipInput, Shop, ShopShips, button, div, h6, li, recl, ref, rele, span, ul; + +Scry = require('./Scry.coffee'); + +ShipInput = require('./ShipInput.coffee'); + +ClaimButton = require('./ClaimButton.coffee'); + +ref = React.DOM, ul = ref.ul, li = ref.li, div = ref.div, h6 = ref.h6, button = ref.button, span = ref.span; + +recl = React.createClass; + +rele = React.createElement; + +ShopShips = Scry("/shop/:type/:nth", function(arg) { + var ship, shop; + shop = arg.shop; + return ul({ + className: "shop" + }, (function() { + var i, len, results; + results = []; + for (i = 0, len = shop.length; i < len; i++) { + ship = shop[i]; + results.push(li({ + className: "option", + key: ship + }, span({ + className: "mono" + }, "~", ship, " "), rele(ClaimButton, { + ship: ship + }))); + } + return results; + })()); +}); + +Shop = function(type, length) { + return recl({ + displayName: "Shop-" + type, + roll: function() { + return { + shipSelector: Math.floor(Math.random() * 10) + }; + }, + reroll: function() { + return this.setState(this.roll()); + }, + getInitialState: function() { + return this.roll(); + }, + onInputShip: function(customShip) { + return this.setState({ + customShip: customShip + }); + }, + render: function() { + var ref1; + return div({}, h6({}, "Avaliable " + type + " (random). ", button({ + onClick: this.reroll + }, "Reroll")), rele(ShopShips, _.extend({}, this.props, { + type: type, + nth: this.state.shipSelector + })), h6({}, "Custom"), div({}, "Specific " + type + ": ", rele(ShipInput, { + length: length, + onInputShip: this.onInputShip + }), rele(ClaimButton, { + ship: (ref1 = this.state.customShip) != null ? ref1 : "" + }))); + } + }); +}; + +module.exports = Shop; + + +},{"./ClaimButton.coffee":6,"./Scry.coffee":10,"./ShipInput.coffee":11}],14:[function(require,module,exports){ +var MainComponent, TreeActions; + +MainComponent = require('./components/Main.coffee'); + +TreeActions = window.tree.actions; + +TreeActions.registerComponent("womb", MainComponent); + + +},{"./components/Main.coffee":8}],15:[function(require,module,exports){ +var PO, SHIPSHAPE, + slice = [].slice; + +SHIPSHAPE = /^~?([a-z]{3}|[a-z]{6}(-[a-z]{6}){0,3}|[a-z]{6}(-[a-z]{6}){3}(--[a-z]{6}(-[a-z]{6}){3})+)$/; + +PO = 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\nrigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\nholpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\nlosdilforpilramtirwintadbicdifrocwidbisdasmidlop\nrilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\nritpodmottamtolsavposnapnopsomfinfonbanporworsip\nronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\nsivtagpadsaldivdactansidfabtarmonranniswolmispal\nlasdismaprabtobrollatlonnodnavfignomnibpagsopral\nbilhaddocridmocpacravripfaltodtiltinhapmicfanpat\ntaclabmogsimsonpinlomrictapfirhasbosbatpochactid\nhavsaplindibhosdabbitbarracparloddosbortochilmac\ntomdigfilfasmithobharmighinradmashalraglagfadtop\nmophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\nnimlarfitwalrapsarnalmoslandondanladdovrivbacpol\nlaptalpitnambonrostonfodponsovnocsorlavmatmipfap\n\nzodnecbudwessevpersutletfulpensytdurwepserwylsun\nrypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\nlunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\npyldulhetmevruttylwydtepbesdexsefwycburderneppur\nrysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\nsecmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\nselrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\nsyptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\nlytdusnebrumtynseglyxpunresredfunrevrefmectedrus\nbexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\ntenlusnussyltecmexpubrymtucfyllepdebbermughuttun\nbylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\nwedducfurfexnulluclennerlexrupnedlecrydlydfenwel\nnydhusrelrudneshesfetdesretdunlernyrsebhulryllud\nremlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\nlyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'; + +module.exports = { + unpackFrond: function(a) { + var alts, key, ref; + ref = _.keys(a), key = ref[0], alts = 2 <= ref.length ? slice.call(ref, 1) : []; + if (!_.isEmpty(alts)) { + throw new Error("Improper frond: " + ([key].concat(slice.call(alts)).join(','))); + } + return [key, a[key]]; + }, + uvShape: function(a) { + return (a.slice(0, 2) === "0v") && /^[0-9a-v]{1,5}(\.[0-9a-v]{5})*$/.test(a.slice(2)); + }, + shipShape: function(a) { + return (SHIPSHAPE.test(a)) && _.all(a.match(/[a-z]{3}/g), function(b) { + return -1 !== PO.indexOf(b); + }); + }, + mailShape: function(a) { + var valid; + return valid = a.indexOf('@') !== -1 && a.indexOf('.') !== -1 && a.length > 7 && a.split(".")[1].length > 1 && a.split("@")[0].length > 0 && a.split("@")[1].length > 4; + } +}; + + +},{}],16:[function(require,module,exports){ +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + classes.push(classNames.apply(null, arg)); + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + // register as 'classnames', consistent with npm package name + define('classnames', [], function () { + return classNames; + }); + } else { + window.classNames = classNames; + } +}()); + +},{}],17:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } + throw TypeError('Uncaught, unspecified "error" event.'); + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}]},{},[14]);