on 7aa7661 help sign in
base-desk/lib/azimuthio.hoon+3−3
since splitsnapshots
unifiedsplit
@@ -43,8 +43,8 @@
43 url=url
43 url=url
44 header-list=['Content-Type'^'application/json' ~]
44 header-list=['Content-Type'^'application/json' ~]
45 ^= body
45 ^= body
46− %- some %- as-octs:mimes:html
46+ %- some %- as-octt:mimes:html
47− %- en:json:html
47+ %- en-json:html
48 (request-to-json:rpc:ethereum id req)
48 (request-to-json:rpc:ethereum id req)
49 ==
49 ==
50 ;< ~ bind:m (send-request:strandio request)
50 ;< ~ bind:m (send-request:strandio request)
@@ -62,7 +62,7 @@
62 ?~ full-file.client-response
62 ?~ full-file.client-response
63 (pure:m ~)
63 (pure:m ~)
64 =/ body=@t q.data.u.full-file.client-response
64 =/ body=@t q.data.u.full-file.client-response
65− =/ jon=(unit json) (de:json:html body)
65+ =/ jon=(unit json) (de-json:html body)
66 ?~ jon
66 ?~ jon
67 (pure:m ~)
67 (pure:m ~)
68 =, dejs-soft:format
68 =, dejs-soft:format
base-desk/lib/dbug.hoon+3−9
@@ -4,8 +4,7 @@
4::
4::
5|%
5|%
6+$ poke
6+$ poke
7− $% [%skip depth=@ud =poke]
8− [%bowl ~]
7+ $% [%bowl ~]
9 [%state grab=cord]
8 [%state grab=cord]
10 [%incoming =about]
9 [%incoming =about]
11 [%outgoing =about]
10 [%outgoing =about]
@@ -33,13 +32,8 @@
33 ?. ?=(%dbug mark)
32 ?. ?=(%dbug mark)
34 =^ cards agent (on-poke:ag mark vase)
33 =^ cards agent (on-poke:ag mark vase)
35 [cards this]
34 [cards this]
35+ =/ dbug
36− =/ dbug !<(poke vase)
36+ !<(poke vase)
37− =? dbug ?=([%skip %0 *] dbug) poke.dbug
38− ?: ?=(%skip -.dbug)
39− =^ cards agent
40− %+ on-poke:ag %dbug
41− !>(`poke`dbug(depth (dec depth.dbug)))
42− [cards this]
43 =; =tang
37 =; =tang
44 ((%*(. slog pri 1) tang) [~ this])
38 ((%*(. slog pri 1) tang) [~ this])
45 ?- -.dbug
39 ?- -.dbug
base-desk/lib/ethereum.hoon+3−9
@@ -652,7 +652,7 @@
652 :^ url %post
652 :^ url %post
653 %- ~(gas in *math)
653 %- ~(gas in *math)
654 ~['Content-Type'^['application/json']~]
654 ~['Content-Type'^['application/json']~]
655− (some (as-octs (en:json:html jon)))
655+ (some (as-octt (en-json:html jon)))
656 :: +light-json-request: like json-request, but for %l
656 :: +light-json-request: like json-request, but for %l
657 ::
657 ::
658 :: TODO: Exorcising +purl from our system is a much longer term effort;
658 :: TODO: Exorcising +purl from our system is a much longer term effort;
@@ -665,7 +665,7 @@
665 :* %'POST'
665 :* %'POST'
666 (crip (en-purl:html url))
666 (crip (en-purl:html url))
667 ~[['content-type' 'application/json']]
667 ~[['content-type' 'application/json']]
668− (some (as-octs (en:json:html jon)))
668+ (some (as-octt (en-json:html jon)))
669 ==
669 ==
670 ::
670 ::
671 ++ batch-read-request
671 ++ batch-read-request
@@ -733,7 +733,7 @@
733 ::
733 ::
734 %eth-get-block-by-number
734 %eth-get-block-by-number
735 :- 'eth_getBlockByNumber'
735 :- 'eth_getBlockByNumber'
736− :~ (tape (num-to-hex-minimal bon.req))
736+ :~ (tape (num-to-hex bon.req))
737 b+txs.req
737 b+txs.req
738 ==
738 ==
739 ::
739 ::
@@ -942,12 +942,6 @@
942 %- render-hex-bytes
942 %- render-hex-bytes
943 (as-octs:mimes:html n)
943 (as-octs:mimes:html n)
944::
944::
945−++ num-to-hex-minimal
946− |= n=@
947− ^- tape
948− %- prefix-hex
949− ((x-co:co 1) n)
950−::
951++ address-to-hex
945++ address-to-hex
952 |= a=address
946 |= a=address
953 ^- tape
947 ^- tape
base-desk/lib/ethio.hoon+3−3
@@ -76,8 +76,8 @@
76 header-list=['Content-Type'^'application/json' ~]
76 header-list=['Content-Type'^'application/json' ~]
77 ::
77 ::
78 ^= body
78 ^= body
79− %- some %- as-octs:mimes:html
79+ %- some %- as-octt:mimes:html
80− %- en:json:html
80+ %- en-json:html
81 a+(turn reqs request-to-json:rpc:ethereum)
81 a+(turn reqs request-to-json:rpc:ethereum)
82 ==
82 ==
83 ;< ~ bind:m
83 ;< ~ bind:m
@@ -96,7 +96,7 @@
96 ?~ full-file.client-response
96 ?~ full-file.client-response
97 (pure:m ~)
97 (pure:m ~)
98 =/ body=@t q.data.u.full-file.client-response
98 =/ body=@t q.data.u.full-file.client-response
99− =/ jon=(unit json) (de:json:html body)
99+ =/ jon=(unit json) (de-json:html body)
100 ?~ jon
100 ?~ jon
101 (pure:m ~)
101 (pure:m ~)
102 =/ array=(unit (list response:rpc))
102 =/ array=(unit (list response:rpc))
base-desk/lib/jose.hoon+3−11
@@ -33,6 +33,7 @@
33 |^ |=([sor=$-(^ ?) val=json] (apex val sor ""))
33 |^ |=([sor=$-(^ ?) val=json] (apex val sor ""))
34 :: :: ++apex:en-json:html
34 :: :: ++apex:en-json:html
35 ++ apex
35 ++ apex
36+ =, en-json:html
36 |= [val=json sor=$-(^ ?) rez=tape]
37 |= [val=json sor=$-(^ ?) rez=tape]
37 ^- tape
38 ^- tape
38 ?~ val (weld "null" rez)
39 ?~ val (weld "null" rez)
@@ -45,7 +46,7 @@
45 |-
46 |-
46 ?~ t.p.val ^$(val i.p.val)
47 ?~ t.p.val ^$(val i.p.val)
47 ^$(val i.p.val, rez [',' $(p.val t.p.val)])
48 ^$(val i.p.val, rez [',' $(p.val t.p.val)])
48− ::
49+ ::
49 %b (weld ?:(p.val "true" "false") rez)
50 %b (weld ?:(p.val "true" "false") rez)
50 %n (weld (trip p.val) rez)
51 %n (weld (trip p.val) rez)
51 %s
52 %s
@@ -59,7 +60,7 @@
59 ?: ?=([@ ~] hed)
60 ?: ?=([@ ~] hed)
60 [i.hed $(viz t.viz)]
61 [i.hed $(viz t.viz)]
61 (weld hed $(viz t.viz))
62 (weld hed $(viz t.viz))
62− ::
63+ ::
63 %o
64 %o
64 :- '{'
65 :- '{'
65 =. rez ['}' rez]
66 =. rez ['}' rez]
@@ -73,15 +74,6 @@
73 =. rez [',' $(viz t.viz)]
74 =. rez [',' $(viz t.viz)]
74 ^$(val [%s p.i.viz], rez [':' ^$(val q.i.viz)])
75 ^$(val [%s p.i.viz], rez [':' ^$(val q.i.viz)])
75 ==
76 ==
76− ::
77− ++ jesc
78− =+ utf=|=(a=@ ['\\' 'u' ((x-co 4):co a)])
79− |= a=@ ^- tape
80− ?+ a ?:(&((gth a 0x1f) !=(a 0x7f)) [a ~] (utf a))
81− %10 "\\n"
82− %34 "\\\""
83− %92 "\\\\"
84− ==
85 --
77 --
86:: %/lib/jose
78:: %/lib/jose
87::
79::
base-desk/lib/keygen.hoon+1−1
@@ -94,7 +94,7 @@
94 |= seed=@
94 |= seed=@
95 ^- edkeys
95 ^- edkeys
96 =+ =< [pub=pub:ex sec=sec:ex]
96 =+ =< [pub=pub:ex sec=sec:ex]
97− (pit:nu:cric:crypto 256 seed %b ~)
97+ (pit:nu:crub:crypto 256 seed)
98 :- ^= auth
98 :- ^= auth
99 :- (rsh 3 (end [3 33] pub))
99 :- (rsh 3 (end [3 33] pub))
100 (rsh 3 (end [3 33] sec))
100 (rsh 3 (end [3 33] sec))
base-desk/lib/language-server/complete.hoon+2−2
@@ -43,7 +43,7 @@
43 %+ turn ~(tap by q.r.q.ty)
43 %+ turn ~(tap by q.r.q.ty)
44 |= [term =tome]
44 |= [term =tome]
45 %+ turn
45 %+ turn
46− ~(tap by tome)
46+ ~(tap by q.tome)
47 |= [name=term =hoon]
47 |= [name=term =hoon]
48 ^- (pair term type)
48 ^- (pair term type)
49 ~| term=term
49 ~| term=term
@@ -227,7 +227,7 @@
227 =* outer-loop $
227 =* outer-loop $
228 ?~ tomes
228 ?~ tomes
229 ~
229 ~
230− =/ arms ~(tap by q.i.tomes)
230+ =/ arms ~(tap by q.q.i.tomes)
231 |- ^- (unit [term type])
231 |- ^- (unit [term type])
232 =* inner-loop $
232 =* inner-loop $
233 ?~ arms
233 ?~ arms
base-desk/lib/language-server/easy-print.hoon+3−3
@@ -421,11 +421,11 @@
421 ?:(?=([%plot *] q.yon) [q.hin p.q.yon] [q.hin q.yon ~])
421 ?:(?=([%plot *] q.yon) [q.hin p.q.yon] [q.hin q.yon ~])
422 ::
422 ::
423 [%core *]
423 [%core *]
424− ?: ?=([[%$ [[%$ @ *] ~ ~]] ~ ~] q.r.q.sut)
424+ ?: ?=([[%$ * [[%$ @ *] ~ ~]] ~ ~] q.r.q.sut)
425 =/ dad $(sut p.sut)
425 =/ dad $(sut p.sut)
426 :- p.dad
426 :- p.dad
427 ~! q.r.q.sut
427 ~! q.r.q.sut
428− [%gate q.n.q.n.q.r.q.sut sut(r.p.q %gold) q.dad]
428+ [%gate q.n.q.q.n.q.r.q.sut sut(r.p.q %gold) q.dad]
429 =+ yad=$(sut p.sut)
429 =+ yad=$(sut p.sut)
430 :- p.yad
430 :- p.yad
431 =+ ^= doy ^- [p=(list @ta) q=wine]
431 =+ ^= doy ^- [p=(list @ta) q=wine]
@@ -438,7 +438,7 @@
438 %^ cat 3
438 %^ cat 3
439 %~ rent co
439 %~ rent co
440 :+ %$ %ud
440 :+ %$ %ud
441− %- ~(rep by (~(run by q.r.q.sut) |=(tome ~(wyt by +<))))
441+ %- ~(rep by (~(run by q.r.q.sut) |=(tome ~(wyt by q.+<))))
442 |=([[@ a=@u] b=@u] (add a b))
442 |=([[@ a=@u] b=@u] (add a b))
443 %^ cat 3
443 %^ cat 3
444 ?-(r.p.q.sut %gold '.', %iron '|', %lead '?', %zinc '&')
444 ?-(r.p.q.sut %gold '.', %iron '|', %lead '?', %zinc '&')
base-desk/lib/language-server/rune-snippet.hoon+2−2
@@ -509,8 +509,8 @@
509 :- '!@'
509 :- '!@'
510 """
510 """
511 $\{1:wing}
511 $\{1:wing}
512− $\{2:if-not-exists}
512+ $\{2:if-exists}
513− $\{3:if-exists}
513+ $\{3:if-not-exists}
514 """
514 """
515 :- '!?'
515 :- '!?'
516 """
516 """
base-desk/lib/noun-diff.hoondeleted−213
@@ -1,213 +0,0 @@
1−=<
2−|%
3−++ diff
4− |= [old=* new=*]
5− ^- patch
6− =/ del (extract-del (oracle old new) old)
7− =/ ins (extract-ins (oracle old new) new)
8− =/ allowed-holes (~(int in (find-del-holes del)) (find-ins-holes ins))
9− =. del (filter-del-holes allowed-holes del)
10− =/ ins (filter-ins-holes allowed-holes ins)
11− =/ closed-patch (closure (gcp [del ins]))
12− ?> =(& +.closed-patch)
13− -.closed-patch
14−++ apply
15− |= [patch=_id noun=*]
16− ?- -.patch
17− %diff
18− =/ var-map (del del.patch noun)
19− (ins ins.patch var-map)
20− ::
21− %cell
22− ?> ?=(^ noun)
23− [$(patch lhs.patch, noun -.noun) $(patch rhs.patch, noun +.noun)]
24− ==
25−++ id
26− ^- patch
27− [%diff [%hole ~] [%hole ~]]
28−+$ patch
29− $% [%cell lhs=patch rhs=patch]
30− [%diff ^diff]
31− ==
32−--
33−::
34−|%
35−+$ del-diff
36− $% [%hole @]
37− [%cell lhs=del-diff rhs=del-diff]
38− [%ignore ~]
39− ==
40−+$ ins-diff
41− $% [%hole @ original=*]
42− [%cell lhs=ins-diff rhs=ins-diff]
43− [%atom @]
44− ==
45−+$ final-ins-diff
46− $% [%hole @]
47− [%cell lhs=final-ins-diff rhs=final-ins-diff]
48− [%atom @]
49− ==
50−+$ diff [del=del-diff ins=final-ins-diff]
51−+$ patch
52− $% [%cell lhs=patch rhs=patch]
53− [%diff diff]
54− ==
55−++ insify-noun
56− |= noun=*
57− ^- final-ins-diff
58− ?- noun
59− ^ [%cell $(noun -.noun) $(noun +.noun)]
60− @ [%atom noun]
61− ==
62−++ empty-set (silt `(list @)`~)
63−++ find-del-holes
64− |= diff=del-diff
65− ~+
66− ^- (set @)
67− ?- -.diff
68− %hole (silt ~[+.diff])
69− %cell (~(uni in $(diff lhs.diff)) $(diff rhs.diff))
70− %ignore empty-set
71− ==
72−++ find-final-ins-holes
73− |= diff=final-ins-diff
74− ~+
75− ^- (set @)
76− ?- -.diff
77− %hole (silt ~[+.diff])
78− %cell (~(uni in $(diff lhs.diff)) $(diff rhs.diff))
79− %atom empty-set
80− ==
81−++ find-ins-holes
82− |= diff=ins-diff
83− ~+
84− ^- (set @)
85− ?- -.diff
86− %hole (silt ~[+<.diff])
87− %cell (~(uni in $(diff lhs.diff)) $(diff rhs.diff))
88− %atom empty-set
89− ==
90−++ filter-del-holes
91− |= [allowed-holes=(set @) diff=del-diff]
92− ^- del-diff
93− ?: ?=(%ignore -.diff) diff
94− ?- -.diff
95− %hole ?:((~(has in allowed-holes) +.diff) diff [%ignore ~])
96− %cell [%cell $(diff +<.diff) $(diff +>.diff)]
97− ==
98−++ filter-ins-holes
99− |= [allowed-holes=(set @) diff=ins-diff]
100− ^- final-ins-diff
101− ?- -.diff
102− %cell [%cell $(diff +<.diff) $(diff +>.diff)]
103− %atom diff
104− %hole
105− ?: (~(has in allowed-holes) +<.diff) [%hole +<.diff]
106− (insify-noun original:diff)
107− ==
108−++ gcp
109− |= diff=diff
110− ^- patch
111− ?- -.ins.diff
112− %atom [%diff diff]
113− %hole [%diff diff]
114− %cell
115− ?. ?=(%cell -.del.diff)
116− [%diff diff]
117− [%cell $(diff [+<.del.diff +<.ins.diff]) $(diff [+>.del.diff +>.ins.diff])]
118− ==
119−++ closure
120− |= =patch
121− ^- [^patch ?]
122− ?- -.patch
123− %diff
124− =/ del-holes (find-del-holes del:patch)
125− =/ ins-holes (find-final-ins-holes ins:patch)
126− =/ difference (~(dif in ins-holes) del-holes)
127− [patch =(difference empty-set)]
128− ::
129− %cell
130− =/ lhs $(patch lhs:patch)
131− =/ rhs $(patch rhs:patch)
132− ?: ?&(+.lhs +.rhs) [[%cell -.lhs -.rhs] &]
133− $(patch (pull-diff [%cell -.lhs -.rhs]))
134− ==
135−++ pull-diff
136− |= =patch
137− ^- [%diff del=del-diff ins=final-ins-diff]
138− ?- -.patch
139− %diff patch
140− %cell
141− =/ pulled-lhs $(patch lhs:patch)
142− =/ pulled-rhs $(patch rhs:patch)
143− :+ %diff
144− [%cell del:pulled-lhs del:pulled-rhs]
145− [%cell ins:pulled-lhs ins:pulled-rhs]
146− ==
147−++ is-subtree
148− |= [tree=* subtree=*]
149− ~+
150− ^- ?
151− ?: =(tree subtree) &
152− ?@ tree |
153− ?| (is-subtree -.tree subtree)
154− (is-subtree +.tree subtree)
155− ==
156−++ oracle
157− |= [a=* b=*]
158− |= subtree=*
159− ^- (unit @)
160− ?: ?& (is-subtree a subtree)
161− (is-subtree b subtree)
162− ==
163− `(mug subtree)
164− ~
165−++ extract-del
166− |= [oracle=$-(* (unit @)) subtree=*]
167− ~+
168− ^- del-diff
169− =/ hash (oracle subtree)
170− ?^ hash [%hole +.hash]
171− ?@ subtree [%ignore ~]
172− [%cell (extract-del oracle -.subtree) (extract-del oracle +.subtree)]
173−++ extract-ins
174− |= [oracle=$-(* (unit @)) subtree=*]
175− ~+
176− ^- ins-diff
177− =/ hash (oracle subtree)
178− ?^ hash [%hole +.hash subtree]
179− ?@ subtree [%atom subtree]
180− [%cell (extract-ins oracle -.subtree) (extract-ins oracle +.subtree)]
181−++ ins
182− |= [diff=final-ins-diff var-map=(map @ *)]
183− ^- *
184− ?- -.diff
185− %atom +.diff
186− %cell [$(diff +<.diff) $(diff +>.diff)]
187− %hole (~(got by var-map) +.diff)
188− ==
189−++ del
190− |= [diff=del-diff noun=*]
191− ^- (map @ *)
192− |^ (go diff noun ((map @ *) ~))
193− ++ go
194− |= [diff=del-diff noun=* var-map=(map @ *)]
195− ^- (map @ *)
196− ?- -.diff
197− %ignore
198− var-map
199− ::
200− %hole
201− =/ subtree (~(get by var-map) +.diff)
202− ?~ subtree (~(put by var-map) +.diff noun)
203− ?> =(+.subtree noun)
204− var-map
205− ::
206− %cell
207− ?> ?=(^ noun)
208− =/ lhs-var-map $(diff +<.diff, noun -.noun)
209− =/ rhs-var-map $(diff +>.diff, noun +.noun, var-map lhs-var-map)
210− rhs-var-map
211− ==
212− --
213−--
base-desk/lib/ph/io.hoon+4−226
@@ -1,5 +1,5 @@
1/- *aquarium, spider
1/- *aquarium, spider
2−/+ libstrand=strand, *strandio, util=ph-util, aqua-azimuth, vere
2+/+ libstrand=strand, *strandio, util=ph-util, aqua-azimuth
3=, strand=strand:libstrand
3=, strand=strand:libstrand
4|%
4|%
5++ send-events
5++ send-events
@@ -88,6 +88,7 @@
88 ^- form:m
88 ^- form:m
89 (pure:m ~)
89 (pure:m ~)
90::
90::
91+::
91++ init
92++ init
92 =/ m (strand ,~)
93 =/ m (strand ,~)
93 ^- form:m
94 ^- form:m
@@ -124,8 +125,6 @@
124 1
125 1
125 +(+.old-rut)
126 +(+.old-rut)
126 ;< ~ bind:m (send-azimuth-action %breach who)
127 ;< ~ bind:m (send-azimuth-action %breach who)
127− ;< ~ bind:m ?~ old-rut (sleep ~s20) :: XX don't wait if possible
128− (wait-for-sunk her who) :: wait only if previously talked
129 |- ^- form:m
128 |- ^- form:m
130 =* loop $
129 =* loop $
131 ;< ~ bind:m (sleep ~s10)
130 ;< ~ bind:m (sleep ~s10)
@@ -143,6 +142,7 @@
143 ?> ?=(%earl (clan:title moon))
142 ?> ?=(%earl (clan:title moon))
144 ?: fake (init-ship moon &)
143 ?: fake (init-ship moon &)
145 =/ m (strand ,~)
144 =/ m (strand ,~)
145+ ^- form:m
146 ;< ~ bind:m
146 ;< ~ bind:m
147 %+ dojo (^sein:title moon)
147 %+ dojo (^sein:title moon)
148 =/ =pass pub:ex:(get-keys:aqua-azimuth moon 1)
148 =/ =pass pub:ex:(get-keys:aqua-azimuth moon 1)
@@ -150,46 +150,13 @@
150 (init-ship moon |)
150 (init-ship moon |)
151::
151::
152++ init-ship
152++ init-ship
153− =| core=?(%mesa %ames) :: XX make %mesa the default core
154 |= [=ship fake=?]
153 |= [=ship fake=?]
155 =/ m (strand ,~)
154 =/ m (strand ,~)
156 ^- form:m
155 ^- form:m
157 ~& > "starting {<ship>}"
156 ~& > "starting {<ship>}"
158− ;< ~ bind:m (send-events (init:util ship fake ~ core))
157+ ;< ~ bind:m (send-events (init:util ship fake))
159 (check-ship-booted ship)
158 (check-ship-booted ship)
160::
159::
161−++ init-comet
162− =| core=?(%mesa %ames) :: XX make %mesa the default core
163− |= comet=ship
164− =/ m (strand ,~)
165− ^- form:m
166− :: hardcoded for:
167− :: ~londeg-tirlys-somlyd-poltus--pintyn-tarbyl-bicnux-marbud
168− ::
169− =/ =feed:jael
170− :* [%2 ~]
171− who=comet
172− ryf=0
173− :_ ~
174− :- lyf=1
175− key=0wfm.lBEWM.08gfy.AxYjy.8-tBQ.uq-aa.LZt9c.CVQqd.XBJIs.
176− CoG90.BNNGV.1ZmVi.ZbAhY.LuhwC.idNnU.lCVkt.Z4qug.7iY92
177− ==
178− ::
179− ?> ?=(^ (veri:dawn:vere comet feed *point:azimuth-types ~))
180− ~& > "mining comet under {<(^sein:title comet)>}"
181− ;< ~ bind:m (send-events (init:util comet fake=%.n `feed core))
182− (check-ship-booted comet)
183−::
184−:: Load network core protocol
185−::
186−++ load
187− |= [who=ship ore=?(%mesa %ames)]
188− =/ m (strand ,~)
189− ^- form:m
190− ;< ~ bind:m (send-events [%event who [/a/aqua/load %load ore]]~)
191− (pure:m ~)
192−::
193++ check-ship-booted
160++ check-ship-booted
194 |= =ship
161 |= =ship
195 =/ m (strand ,~)
162 =/ m (strand ,~)
@@ -226,129 +193,6 @@
226 (pure:m ~)
193 (pure:m ~)
227 loop
194 loop
228::
195::
229−++ wait-for-flub
230− |= [our=ship her=ship dap=term]
231− =/ m (strand ,~)
232− ^- form:m
233− ;< =bowl:spider bind:m get-bowl
234− |- ^- form:m
235− =* loop $
236− ;< [from=^ship =unix-effect] bind:m take-unix-effect
237− ;< now=@da bind:m get-time
238− ?. =(from our)
239− :: our sends the $boon with the halted flow number, at this point
240− :: gall has updated its state adding the app to gall's .halts map
241− :: XX search deeper in the .unix-effect?
242− ::
243− loop
244− =/ aqua-pax
245− :- %i
246− /(scot %p our)/gg/(scot %p our)//(scot %da now)/[%$]/noun
247− =+ ;; flubs=(unit (jug ship term))
248− (scry-aqua:util noun our.bowl now aqua-pax)
249− ?~ flubs loop
250− ?. (~(has ju u.flubs) her dap)
251− loop
252− (pure:m ~)
253−::
254−++ wait-for-spur
255− |= [our=ship her=ship dap=term]
256− =/ m (strand ,~)
257− ^- form:m
258− ;< =bowl:spider bind:m get-bowl
259− |- ^- form:m
260− =* loop $
261− ;< [from=ship =unix-effect] bind:m take-unix-effect
262− ;< now=@da bind:m get-time
263− ?. =(from our)
264− :: our ack to the %spur $boon is sent, at this point
265− :: gall has updated its state adding the app to gall's .flubs map
266− :: XX search deeper in the .unix-effect?
267− ::
268− loop
269− =/ aqua-pax
270− :- %i
271− /(scot %p our)/gg/(scot %p our)//(scot %da now)/[%$]/noun
272− =+ ;; flubs=(unit (jug ship term))
273− (scry-aqua:util noun our.bowl now aqua-pax)
274− ?~ flubs loop
275− ?: (~(has ju u.flubs) her dap)
276− loop
277− (pure:m ~)
278−::
279−++ wait-for-has-halt
280− |= [our=ship her=ship dap=term]
281− =/ m (strand ,~)
282− ^- form:m
283− ;< =bowl:spider bind:m get-bowl
284− |- ^- form:m
285− =* loop $
286− ;< [from=ship =unix-effect] bind:m take-unix-effect
287− ;< now=@da bind:m get-time
288− :: only %send or %push effects
289− ::
290− ?. ?=(?(%send %push) -.q.unix-effect)
291− loop
292− ~& >> from^unix-effect
293− ?. =(from our)
294− :: wait until our ack for the %flub $boon is sent, at this point
295− :: gall has updated its state adding the app to gall's .flubs map
296− :: XX search deeper in the .unix-effect?
297− ::
298− loop
299− =/ aqua-pax
300− :- %i
301− /(scot %p our)/gh/(scot %p our)//(scot %da now)/[%$]/noun
302− =+ ;; halts=(unit (jug app=term [ship =duct]))
303− (scry-aqua:util noun our.bowl now aqua-pax)
304− ?~ halts loop
305− ?. (~(has by u.halts) dap) :: XX check .her as well
306− loop
307− (pure:m ~)
308−::
309−++ wait-for-del-halt
310− |= [our=ship her=ship dap=term]
311− =/ m (strand ,~)
312− ^- form:m
313− ;< =bowl:spider bind:m get-bowl
314− |- ^- form:m
315− =* loop $
316− ;< [from=ship =unix-effect] bind:m take-unix-effect
317− ;< now=@da bind:m get-time
318− ?. =(from our)
319− :: when the %spur $boon has been sent, gall has updated its state deleting
320− :: the app from gall's .flubs map
321− :: XX search deeper in the .unix-effect?
322− ::
323− loop
324− =/ aqua-pax
325− :- %i
326− /(scot %p our)/gh/(scot %p our)//(scot %da now)/[%$]/noun
327− =+ ;; halts=(unit (jug app=term [ship =duct]))
328− (scry-aqua:util noun our.bowl now aqua-pax)
329− ?~ halts loop
330− ?: (~(has by u.halts) dap) :: XX check .her as well
331− loop
332− (pure:m ~)
333−::
334−++ wait-for-pac
335− |= [our=ship to=ship]
336− =/ m (strand ,~)
337− ^- form:m
338− ~& > "waiting for ack: {<[from=our to=to]>}"
339− |- ^- form:m
340− =* loop $
341− ;< [from=ship =unix-effect] bind:m take-unix-effect
342− ?. =(our from)
343− loop
344− :: only %send or %push effects
345− ::
346− ?. ?=(?(%send %push) -.q.unix-effect)
347− loop
348− :: XX check that this is an %ack?
349− :: XX check that this is for .to?
350− ::
351− (pure:m ~)
352:: Send "|hi" from one ship to another
196:: Send "|hi" from one ship to another
353::
197::
354++ send-hi
198++ send-hi
@@ -360,64 +204,6 @@
360::
204::
361:: Send "|hi" and wait for "not responding" message
205:: Send "|hi" and wait for "not responding" message
362::
206::
363−++ wait-for-sunk
364− |= [from=@p to=@p]
365− =/ m (strand ,~)
366− (wait-for-output from "{(scow %p to)} has sunk")
367−::
368−++ wait-for-fact
369− |= [=ship =mark =wire gate=$-([mark noun] ?)]
370− =/ m (strand ,noun)
371− ^- form:m
372− ~& > "waiting for fact: {<mark>}"
373− |- ^- form:m
374− =* loop $
375− ;< [her=^ship =unix-effect] bind:m take-unix-effect
376− ?. =(her ship)
377− loop
378− ?. ?& =(wire p.unix-effect)
379− ?=([%unto %raw-fact *] q.unix-effect)
380− =(mark mark.unto.q.unix-effect)
381− (gate mark noun.unto.q.unix-effect)
382− ==
383− loop
384− (pure:m noun.unto.q.unix-effect)
385−::
386−++ wait-for-cork
387− |= [our=ship her=ship flow=(each bone:ames side:ames)]
388− =/ m (strand ,~)
389− ^- form:m
390− ;< =bowl:spider bind:m get-bowl
391− |- ^- form:m
392− =* loop $
393− ;< [from=ship =unix-effect] bind:m take-unix-effect
394− ;< now=@da bind:m get-time
395− :: only %send or %push effects
396− ::
397− ?. ?=(?(%send %push) -.q.unix-effect)
398− loop
399− :: XX check that this is an %ack?
400− ::
401− ?. =(from our)
402− :: wait until the ack for the %cork $plea is sent, at this point
403− :: the publisher has already corked the flow
404− ::
405− loop
406− =/ aqua-pax
407− %+ weld /i/(scot %p our)/ax/(scot %p our)//(scot %da now)
408− ?: ?=(%& -.flow)
409− /corked/(scot %p her)/(scot %ud +.flow)/noun
410− =/ [=bone:ames =dire:ames] +.flow
411− /corked/(scot %p her)/[dire]/(scot %ud bone)/noun
412− =+ ;; corked=(unit ?) (scry-aqua:util noun our.bowl now aqua-pax)
413− ?~ corked loop
414− ?. u.corked :: XX check .her as well
415− loop
416− ~& >> flow-is-corked/flow
417− (pure:m ~)
418−::
419−:: Send "|hi" and wait for "not responding" message
420−::
421++ send-hi-not-responding
207++ send-hi-not-responding
422 |= [from=@p to=@p]
208 |= [from=@p to=@p]
423 ~& > 'sending hi not responding'
209 ~& > 'sending hi not responding'
@@ -470,14 +256,6 @@
470 ;< ~ bind:m (send-events (insert-files:util her desk [pax warped] ~))
256 ;< ~ bind:m (send-events (insert-files:util her desk [pax warped] ~))
471 (pure:m warped)
257 (pure:m warped)
472::
258::
473−++ copy-file
474− =/ m (strand ,~)
475− |= [her=ship pax=path file=@t]
476− ^- form:m
477− ;< ~ bind:m
478− (send-events (insert-files:util her %base [pax file] ~))
479− (sleep ~s1)
480−::
481:: Check /sur/aquarium/hoon on the given has the given contents.
259:: Check /sur/aquarium/hoon on the given has the given contents.
482::
260::
483++ check-file-touched
261++ check-file-touched
base-desk/lib/ph/util.hoon+11−24
@@ -16,11 +16,9 @@
16:: Start a ship (low-level; prefer +raw-ship)
16:: Start a ship (low-level; prefer +raw-ship)
17::
17::
18++ init
18++ init
19− |= [who=ship ake=? eed=(unit feed:jael) ore=?(%mesa %ames)]
19+ |= [who=ship fake=?]
20 ^- (list aqua-event)
20 ^- (list aqua-event)
21− :~ [%init-ship who ake eed]
21+ [%init-ship who fake]~
22− [%event who [/a/aqua/load %load ore]]
23− ==
24::
22::
25:: Send dojo command
23:: Send dojo command
26::
24::
@@ -30,8 +28,8 @@
30 %+ send-events-to who
28 %+ send-events-to who
31 ^- (list unix-event)
29 ^- (list unix-event)
32 :~
30 :~
33− [/d/term/1 %belt %mod %ctl `@c`%e]
31+ [/d/term/1 %belt %ctl `@c`%e]
34− [/d/term/1 %belt %mod %ctl `@c`%u]
32+ [/d/term/1 %belt %ctl `@c`%u]
35 [/d/term/1 %belt %txt ((list @c) what)]
33 [/d/term/1 %belt %txt ((list @c) what)]
36 [/d/term/1 %belt %ret ~]
34 [/d/term/1 %belt %ret ~]
37 ==
35 ==
@@ -42,7 +40,7 @@
42 |= [who=ship what=term]
40 |= [who=ship what=term]
43 ^- (list ph-event)
41 ^- (list ph-event)
44 %+ send-events-to who
42 %+ send-events-to who
45− :~ [/d/term/1 %belt %mod %ctl (,@c what)]
43+ :~ [/d/term/1 %belt %ctl (,@c what)]
46 ==
44 ==
47::
45::
48:: Inject a file into a ship
46:: Inject a file into a ship
@@ -64,26 +62,15 @@
64::TODO should be rename -dill-output
62::TODO should be rename -dill-output
65++ is-dojo-output
63++ is-dojo-output
66 |= [who=ship her=ship uf=unix-effect what=tape]
64 |= [who=ship her=ship uf=unix-effect what=tape]
67− |^
68 ?& =(who her)
65 ?& =(who her)
69 ?=(%blit -.q.uf)
66 ?=(%blit -.q.uf)
70− (lien p.q.uf handle-blit)
71− ==
72− ::
73− ++ handle-blit
74− |= =blit:dill
75− ^- ?
76− ?: ?=(%mor -.blit)
77− (lien p.blit handle-blit)
78− ?+ -.blit |
79− %put !=(~ (find what p.blit))
80 ::
67 ::
81− %klr
82− %+ lien p.blit
68+ %+ lien p.q.uf
83− |= [* q=(list @c)]
69+ |= =blit:dill
70+ ?. ?=(%lin -.blit)
71+ |
84− !=(~ (find what q))
72+ !=(~ (find what p.blit))
85− ==
73+ ==
86− --
87::
74::
88:: Test is successful if +is-dojo-output
75:: Test is successful if +is-dojo-output
89::
76::
base-desk/lib/pill.hoon+23−272
@@ -2,7 +2,6 @@
2::
2::
3/- dice
3/- dice
4^?
4^?
5−=<
6|%
5|%
7::
6::
8+$ pill
7+$ pill
@@ -12,14 +11,6 @@
12 boot-ova=(list)
11 boot-ova=(list)
13 kernel-ova=(list unix-event)
12 kernel-ova=(list unix-event)
14 userspace-ova=(list unix-event)
13 userspace-ova=(list unix-event)
15− ==
16− $: %cash
17− $: nam=term
18− boot-ova=(list)
19− kernel-ova=(list unix-event)
20− userspace-ova=(list unix-event)
21− ==
22− cache=(list)
23 == ==
14 == ==
24::
15::
25+$ unix-event
16+$ unix-event
@@ -42,14 +33,14 @@
42 [/sys/arvo hoon/arvo]
33 [/sys/arvo hoon/arvo]
43 ==
34 ==
44:: +dirs: filter for userspace directories to include
35:: +dirs: filter for userspace directories to include
45−::
36+::
46++ dirs
37++ dirs
47 |= [bas=path exc=(list spur)]
38 |= [bas=path exc=(list spur)]
48 ^- (list spur)
39 ^- (list spur)
49 ?~ exc ~(tap in dir:.^(arch %cy bas))
40 ?~ exc ~(tap in dir:.^(arch %cy bas))
50 %+ skim
41 %+ skim
51 ~(tap in dir:.^(arch %cy bas))
42 ~(tap in dir:.^(arch %cy bas))
52− |=(=spur =(~ (find ~[spur] exc)))
43+ |=(=spur =(~ (find ~[spur] exc)))
53:: +file-ovum: userspace filesystem load
44:: +file-ovum: userspace filesystem load
54::
45::
55:: bas: full path to / directory
46:: bas: full path to / directory
@@ -108,26 +99,6 @@
108::
99::
109++ file-ovum2 |=(z=[path (list spur)] `unix-event`[//arvo what/(user-files z)])
100++ file-ovum2 |=(z=[path (list spur)] `unix-event`[//arvo what/(user-files z)])
110::
101::
111−++ get-wynn
112− |= [sys=path new-wynn=?]
113− ^- wynn
114− ?. new-wynn
115− :~ zuse+zuse
116− lull+lull
117− arvo+arvo
118− hoon+hoon-version
119− ==
120− ~> %bout.[0 %get-wynn]
121− =+ .^(zus=vase %ca (welp sys /zuse/hoon))
122− =+ .^(lul=vase %ca (welp sys /lull/hoon))
123− =+ .^(arv=vase %ca (welp sys /arvo/hoon))
124− =+ .^(hun=vase %ca (welp sys /hoon/hoon))
125− :~ [%zuse ;;(@ud q:(slap zus limb+%zuse))]
126− [%lull ;;(@ud q:(slap lul limb+%lull))]
127− [%arvo ;;(@ud q:(slap arv limb+%arvo))]
128− [%hoon ;;(@ud q:(slap hun limb+%hoon-version))]
129− ==
130−::
131++ prep-ovum
102++ prep-ovum
132 |= dez=(list path)
103 |= dez=(list path)
133 ^- unix-event
104 ^- unix-event
@@ -229,30 +200,25 @@
229 :- (boot-ovum:pill compiler-src arvo-src)
200 :- (boot-ovum:pill compiler-src arvo-src)
230 %+ turn
201 %+ turn
231 (snoc (turn dez tail) bas)
202 (snoc (turn dez tail) bas)
232− |= =path
203+ |= =path
233 (file-ovum2 [path exc])
204 (file-ovum2 [path exc])
234 .*(0 arvo-formula)
205 .*(0 arvo-formula)
235 |= [ovo=ovum ken=*]
206 |= [ovo=ovum ken=*]
236 [~ (slum ken [now ovo])]
207 [~ (slum ken [now ovo])]
237 ::
208 ::
238− :: kernel-formula
209+ :: boot-two: startup formula
239 ::
210 ::
240 :: We evaluate :arvo-formula (for jet registration),
211 :: We evaluate :arvo-formula (for jet registration),
241 :: then ignore the result and produce .installed
212 :: then ignore the result and produce .installed
242 ::
213 ::
243− =/ kernel-formula
244− [%7 arvo-formula %1 installed]
245− ::
246− :: boot-two: startup formula
247− ::
248 =/ boot-two
214 =/ boot-two
249− => *[kernel-formula=^ tale=*]
215+ => *[arvo-formula=^ installed=^ tale=*]
250− != [.*(0 kernel-formula) tale]
216+ != =+(.*(0 arvo-formula) [installed tale])
251 ::
217 ::
252 :: boot-ova
218 :: boot-ova
253 ::
219 ::
254 =/ boot-ova=(list)
220 =/ boot-ova=(list)
255− [aeon:eden:part boot-two kernel-formula ~]
221+ [aeon:eden:part boot-two arvo-formula installed ~]
256 ::
222 ::
257 :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
223 :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
258 ::
224 ::
@@ -263,26 +229,19 @@
263 :+ %pill %solid
229 :+ %pill %solid
264 :+ boot-ova ~
230 :+ boot-ova ~
265 =. dez (snoc dez [%base bas])
231 =. dez (snoc dez [%base bas])
266− ;: weld
232+ %+ weld
267− %+ turn dez
233+ %+ turn dez
268− |= [dek=desk bas=path]
234+ |= [dek=desk bas=path]
269 (file-ovum [dek bas exc])
235 (file-ovum [dek bas exc])
270− ::
271− ?. prime ~
236+ ?. prime ~
272− [(prep-ovum (turn dez tail))]~
237+ [(prep-ovum (turn dez tail))]~
273− ::
274− %+ turn dez
275− |= [dek=desk *]
276− ^- unix-event
277− [/c/essential/[dek] %esse dek %.y]
278− ==
279::
238::
280++ brass
239++ brass
281 :: sys: root path to boot system, `/~me/[desk]/now/sys`
240 :: sys: root path to boot system, `/~me/[desk]/now/sys`
282 :: dez: secondary desks and their root paths
241 :: dez: secondary desks and their root paths
283 :: exc: list of desk folders to exclude
242 :: exc: list of desk folders to exclude
284 ::
243 ::
285− |= [sys=path dez=(list [desk path]) cache=? prime=? new-wynn=? exc=(list spur)]
244+ |= [sys=path dez=(list [desk path]) prime=? exc=(list spur)]
286 ^- pill
245 ^- pill
287 =/ bas=path (scag 3 sys)
246 =/ bas=path (scag 3 sys)
288 :: compiler-source: hoon source file producing compiler, `sys/hoon`
247 :: compiler-source: hoon source file producing compiler, `sys/hoon`
@@ -314,54 +273,20 @@
314 compiler-source
273 compiler-source
315 arvo-source
274 arvo-source
316 ==
275 ==
276+ :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
317 ::
277 ::
318− =/ kernel-ova=(list unix-event)
278+ :+ %pill %brass
279+ :+ boot-ova
319 :~ (boot-ovum compiler-source arvo-source)
280 :~ (boot-ovum compiler-source arvo-source)
320 (file-ovum2 [bas exc])
281 (file-ovum2 [bas exc])
321 ==
282 ==
322− ::
323− =/ userspace-ova
324− =. dez (snoc dez [%base bas])
283+ =. dez (snoc dez [%base bas])
325− ;: weld
284+ %+ weld
326− %+ turn dez
285+ %+ turn dez
327− |= [dek=desk bas=path]
286+ |= [dek=desk bas=path]
328− (file-ovum [dek bas exc])
287+ (file-ovum [dek bas exc])
329− ::
330− ?. prime ~
288+ ?. prime ~
331− [(prep-ovum (turn dez tail))]~
289+ [(prep-ovum (turn dez tail))]~
332− ::
333− %+ turn dez
334− |= [dek=desk *]
335− ^- unix-event
336− [/c/essential/[dek] %esse dek %.y]
337− ==
338− ::
339− =/ =wynn (get-wynn sys new-wynn)
340− ::
341− =/ cache=(list)
342− ?. cache ~
343− %~ tap by
344− =< +
345− %- mice
346− :_ [%2 [%0 3] %0 2]
347− ;: weld
348− boot-ova
349− ^- (list)
350− :~ [*@da //arvo %wack *@uvJ]
351− [*@da //arvo %whom *@p]
352− [*@da //arvo %wyrd [~.nonce /] wynn]
353− ==
354− `(list)`(turn kernel-ova (lead *@da))
355− `(list)`[*@da [/d/term/1 %boot & %fake *@p]]^~
356− `(list)`(turn userspace-ova (lead *@da))
357− `(list)`[*@da [/c/init-zest %zeal (turn dez |=([d=desk *] [d %live]))]]^~
358− ==
359− ::
360− ~> %slog.[0 leaf+"brass: cache entries: {<(lent cache)>}"]
361− ::
362− :- %cash
363− :_ cache
364− [%brass boot-ova kernel-ova userspace-ova]
365::
290::
366++ ivory
291++ ivory
367 |= sys=path
292 |= sys=path
@@ -444,177 +369,3 @@
444 ==
369 ==
445 --
370 --
446--
371--
447−::
448−~% %non ..part ~
449−:: +mice: %memo hint caching version of mink
450−::
451−|%
452−++ mice !.
453− ~/ %mice
454− |= [subject=* formula=*]
455− =| trace=(list [@ta *])
456− =| memo=(map)
457− =; [ton=tone mem=_memo]
458− ?. ?=(%0 -.ton)
459− [ton ~]
460− [ton mem]
461− |^ ^- [tone _memo]
462− ?+ formula [[%2 trace] memo]
463− [^ *]
464− =^ head memo $(formula -.formula)
465− ?. ?=(%0 -.head) [head memo]
466− =^ tail memo $(formula +.formula)
467− :_ memo
468− ?. ?=(%0 -.tail) tail
469− [%0 product.head product.tail]
470− ::
471− [%0 axis=@]
472− :_ memo
473− =/ part (frag axis.formula subject)
474− ?~ part [%2 trace]
475− [%0 u.part]
476− ::
477− [%1 constant=*]
478− [[%0 constant.formula] memo]
479− ::
480− [%2 subject=* formula=*]
481− =^ subject memo $(formula subject.formula)
482− ?. ?=(%0 -.subject) [subject memo]
483− =^ formula memo $(formula formula.formula)
484− ?. ?=(%0 -.formula) [formula memo]
485− %= $
486− subject product.subject
487− formula product.formula
488− ==
489− ::
490− [%3 argument=*]
491− =^ argument memo $(formula argument.formula)
492− :_ memo
493− ?. ?=(%0 -.argument) argument
494− [%0 .?(product.argument)]
495− ::
496− [%4 argument=*]
497− =^ argument memo $(formula argument.formula)
498− :_ memo
499− ?. ?=(%0 -.argument) argument
500− ?^ product.argument [%2 trace]
501− [%0 .+(product.argument)]
502− ::
503− [%5 a=* b=*]
504− =^ a memo $(formula a.formula)
505− ?. ?=(%0 -.a) [a memo]
506− =^ b memo $(formula b.formula)
507− :_ memo
508− ?. ?=(%0 -.b) b
509− [%0 =(product.a product.b)]
510− ::
511− [%6 test=* yes=* no=*]
512− =^ result memo $(formula test.formula)
513− ?. ?=(%0 -.result) [result memo]
514− ?+ product.result [[%2 trace] memo]
515− %& $(formula yes.formula)
516− %| $(formula no.formula)
517− ==
518− ::
519− [%7 subject=* next=*]
520− =^ subject memo $(formula subject.formula)
521− ?. ?=(%0 -.subject) [subject memo]
522− %= $
523− subject product.subject
524− formula next.formula
525− ==
526− ::
527− [%8 head=* next=*]
528− =^ head memo $(formula head.formula)
529− ?. ?=(%0 -.head) [head memo]
530− %= $
531− subject [product.head subject]
532− formula next.formula
533− ==
534− ::
535− [%9 axis=@ core=*]
536− =^ core memo
537− $(formula core.formula)
538− ?. ?=(%0 -.core) [core memo]
539− =/ arm (frag axis.formula product.core)
540− ?~ arm [[%2 trace] memo]
541− %= $
542− subject product.core
543− formula u.arm
544− ==
545− ::
546− [%10 [axis=@ value=*] target=*]
547− ?: =(0 axis.formula) [[%2 trace] memo]
548− =^ target memo $(formula target.formula)
549− ?. ?=(%0 -.target) [target memo]
550− =^ value memo $(formula value.formula)
551− :_ memo
552− ?. ?=(%0 -.value) value
553− =/ mutant=(unit *)
554− (edit axis.formula product.target product.value)
555− ?~ mutant [%2 trace]
556− [%0 u.mutant]
557− ::
558− [%11 tag=@ next=*]
559− =^ next memo $(formula next.formula)
560− :_ memo
561− ?. ?=(%0 -.next) next
562− :- %0
563− .* subject
564− [11 tag.formula 1 product.next]
565− ::
566− [%11 [tag=@ clue=*] next=*]
567− =^ clue memo $(formula clue.formula)
568− ?. ?=(%0 -.clue) [clue memo]
569− ?: ?=(%memo tag.formula)
570− ?^ hit=(~(get by memo) subject next.formula)
571− [[%0 u.hit] memo]
572− =^ ton memo $(formula next.formula)
573− ?. ?=(%0 -.ton)
574− [ton memo]
575− ?: ?=(?(@ [%clay %ford *]) product.clue)
576− [ton memo]
577− [ton (~(put by memo) [subject next.formula] product.ton)]
578− =^ next memo
579− =? trace
580− ?=(?(%hunk %hand %lose %mean %spot) tag.formula)
581− [[tag.formula product.clue] trace]
582− $(formula next.formula)
583− :_ memo
584− ?. ?=(%0 -.next) next
585− :- %0
586− .* subject
587− [11 [tag.formula 1 product.clue] 1 product.next]
588− ==
589− ::
590− ++ frag
591− |= [axis=@ noun=*]
592− ^- (unit)
593− ?: =(0 axis) ~
594− |- ^- (unit)
595− ?: =(1 axis) `noun
596− ?@ noun ~
597− =/ pick (cap axis)
598− %= $
599− axis (mas axis)
600− noun ?-(pick %2 -.noun, %3 +.noun)
601− ==
602− ::
603− ++ edit
604− |= [axis=@ target=* value=*]
605− ^- (unit)
606− ?: =(1 axis) `value
607− ?@ target ~
608− =/ pick (cap axis)
609− =/ mutant
610− %= $
611− axis (mas axis)
612− target ?-(pick %2 -.target, %3 +.target)
613− ==
614− ?~ mutant ~
615− ?- pick
616− %2 `[u.mutant +.target]
617− %3 `[-.target u.mutant]
618− ==
619− --
620−--
base-desk/lib/ring.hoon+36−36
@@ -18,10 +18,10 @@
18 ::
18 ::
19 ++ generate-public-linkage
19 ++ generate-public-linkage
20 |= link-scope=@
20 |= link-scope=@
21− ^- [data=@ h=@uxpoint]
21+ ^- [data=@ h=@udpoint]
22 ::
22 ::
23 =/ data=@ (mod link-scope l:ed:crypto)
23 =/ data=@ (mod link-scope l:ed:crypto)
24− =/ h=@uxpoint (scalarmult-base:ed:crypto data)
24+ =/ h=@udpoint (scalarmult-base:ed:crypto data)
25 [data h]
25 [data h]
26 :: +generate-linkage: linkage information from scope and private key
26 :: +generate-linkage: linkage information from scope and private key
27 ::
27 ::
@@ -30,13 +30,13 @@
30 :: y: y = [x] * h
30 :: y: y = [x] * h
31 ++ generate-linkage
31 ++ generate-linkage
32 |= [link-scope=(unit @) my-private-key=@]
32 |= [link-scope=(unit @) my-private-key=@]
33− ^- (unit [data=@ h=@uxpoint y=@uxpoint])
33+ ^- (unit [data=@ h=@udpoint y=@udpoint])
34 ::
34 ::
35 ?~ link-scope
35 ?~ link-scope
36 ~
36 ~
37 ::
37 ::
38− =+ [data=@ h=@uxpoint]=(generate-public-linkage u.link-scope)
38+ =+ [data=@ h=@udpoint]=(generate-public-linkage u.link-scope)
39− =/ y=@uxpoint (scalarmult:ed:crypto my-private-key h)
39+ =/ y=@udpoint (scalarmult:ed:crypto my-private-key h)
40 [~ data h y]
40 [~ data h y]
41 :: +generate-challenge: generate challenge from a given message
41 :: +generate-challenge: generate challenge from a given message
42 ::
42 ::
@@ -47,13 +47,13 @@
47 ++ generate-challenge
47 ++ generate-challenge
48 |= $: :: common to both linked and unlinked
48 |= $: :: common to both linked and unlinked
49 message=@
49 message=@
50− g=@uxpoint
50+ g=@udpoint
51 :: high level universal state
51 :: high level universal state
52 ::
52 ::
53− link-state=(unit [data=@ h=@uxpoint y=@uxpoint])
53+ link-state=(unit [data=@ h=@udpoint y=@udpoint])
54 :: point to include in challenge when link-state isn't ~
54 :: point to include in challenge when link-state isn't ~
55 ::
55 ::
56− h=(unit @uxpoint)
56+ h=(unit @udpoint)
57 ==
57 ==
58 ^- @
58 ^- @
59 :: concatenate and reduce our message down to a 512-bit hash
59 :: concatenate and reduce our message down to a 512-bit hash
@@ -74,9 +74,9 @@
74 :: +generate-challenges: generates the full list of challenges
74 :: +generate-challenges: generates the full list of challenges
75 ::
75 ::
76 ++ generate-challenges
76 ++ generate-challenges
77− |= $: link-state=(unit [data=@ h=@uxpoint y=@uxpoint])
77+ |= $: link-state=(unit [data=@ h=@udpoint y=@udpoint])
78 message=@
78 message=@
79− public-keys=(list @uxpoint)
79+ public-keys=(list @udpoint)
80 ss=(list @)
80 ss=(list @)
81 ::
81 ::
82 prev-k=@u
82 prev-k=@u
@@ -86,14 +86,14 @@
86 ==
86 ==
87 ^- (list @)
87 ^- (list @)
88 ::
88 ::
89− =/ gs=@uxpoint
89+ =/ gs=@udpoint
90 %- add-scalarmult-scalarmult-base:ed:crypto :*
90 %- add-scalarmult-scalarmult-base:ed:crypto :*
91 prev-ch
91 prev-ch
92 (snag prev-k public-keys)
92 (snag prev-k public-keys)
93 prev-s
93 prev-s
94 ==
94 ==
95 ::
95 ::
96− =/ hs=(unit @uxpoint)
96+ =/ hs=(unit @udpoint)
97 ?~ link-state
97 ?~ link-state
98 ~
98 ~
99 ::
99 ::
@@ -125,8 +125,8 @@
125 :: used to generate the (unit point) consumed by +generate-challenge.
125 :: used to generate the (unit point) consumed by +generate-challenge.
126 ::
126 ::
127 ++ scalarmult-h
127 ++ scalarmult-h
128− |= [u=@ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])]
128+ |= [u=@ linkage=(unit [data=@ h=@udpoint y=@udpoint])]
129− ^- (unit @uxpoint)
129+ ^- (unit @udpoint)
130 ?~ linkage
130 ?~ linkage
131 ~
131 ~
132 [~ (scalarmult:ed:crypto u h.u.linkage)]
132 [~ (scalarmult:ed:crypto u h.u.linkage)]
@@ -143,9 +143,9 @@
143 |= $: message=@
143 |= $: message=@
144 link-scope=(unit @)
144 link-scope=(unit @)
145 ::
145 ::
146− anonymity-set=(set @uxpoint)
146+ anonymity-set=(set @udpoint)
147− my-public-key=@uxpoint
147+ my-public-key=@udpoint
148− my-private-key=@uxscalar
148+ my-private-key=@udscalar
149 ::
149 ::
150 eny=@uvJ
150 eny=@uvJ
151 ==
151 ==
@@ -157,7 +157,7 @@
157 (need (find [my-public-key ~] anonymity-list))
157 (need (find [my-public-key ~] anonymity-list))
158 :: Generate linkage information if given
158 :: Generate linkage information if given
159 ::
159 ::
160− =/ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])
160+ =/ linkage=(unit [data=@ h=@udpoint y=@udpoint])
161 (generate-linkage link-scope my-private-key)
161 (generate-linkage link-scope my-private-key)
162 :: initialize our random number generator from entropy
162 :: initialize our random number generator from entropy
163 ::
163 ::
@@ -237,7 +237,7 @@
237 |= $: message=@
237 |= $: message=@
238 link-scope=(unit @)
238 link-scope=(unit @)
239 ::
239 ::
240− anonymity-set=(set @uxpoint)
240+ anonymity-set=(set @udpoint)
241 signature=raw-ring-signature
241 signature=raw-ring-signature
242 ==
242 ==
243 ^- ?
243 ^- ?
@@ -259,14 +259,14 @@
259 =/ s2-to-end=(list @) t.t.s.signature
259 =/ s2-to-end=(list @) t.t.s.signature
260 :: anonymity-list: set of public keys listified in ring order
260 :: anonymity-list: set of public keys listified in ring order
261 ::
261 ::
262− =/ anonymity-list=(list @uxpoint)
262+ =/ anonymity-list=(list @udpoint)
263 ~(tap in anonymity-set)
263 ~(tap in anonymity-set)
264 :: participants: length of :anonymity-list
264 :: participants: length of :anonymity-list
265 ::
265 ::
266 =/ participants=@u
266 =/ participants=@u
267 (lent anonymity-list)
267 (lent anonymity-list)
268 ::
268 ::
269− =/ z0p=@uxpoint
269+ =/ z0p=@udpoint
270 %- add-scalarmult-scalarmult-base:ed:crypto :*
270 %- add-scalarmult-scalarmult-base:ed:crypto :*
271 ch0.signature
271 ch0.signature
272 (head anonymity-list)
272 (head anonymity-list)
@@ -275,14 +275,14 @@
275 :: generate the linkage using public data, and the y point from the
275 :: generate the linkage using public data, and the y point from the
276 :: signature
276 :: signature
277 ::
277 ::
278− =/ linkage=(unit [data=@ h=@uxpoint y=@uxpoint])
278+ =/ linkage=(unit [data=@ h=@udpoint y=@udpoint])
279 ?~ link-scope
279 ?~ link-scope
280 ~
280 ~
281− =+ [data=@ h=@uxpoint]=(generate-public-linkage u.link-scope)
281+ =+ [data=@ h=@udpoint]=(generate-public-linkage u.link-scope)
282 :- ~
282 :- ~
283 [data h (need y.signature)]
283 [data h (need y.signature)]
284 ::
284 ::
285− =/ z0pp=(unit @uxpoint)
285+ =/ z0pp=(unit @udpoint)
286 ?~ linkage
286 ?~ linkage
287 ~
287 ~
288 :- ~
288 :- ~
@@ -319,7 +319,7 @@
319 :: +seed-to-private-key-scalar: keyfile form to scalar we can multiply with
319 :: +seed-to-private-key-scalar: keyfile form to scalar we can multiply with
320 ::
320 ::
321 ++ seed-to-private-key-scalar
321 ++ seed-to-private-key-scalar
322− |= sk=@I ^- @uxscalar
322+ |= sk=@I ^- @udscalar
323 ?: (gth (met 3 sk) 32) !!
323 ?: (gth (met 3 sk) 32) !!
324 =+ h=(shal (rsh [0 3] b:ed:crypto) sk)
324 =+ h=(shal (rsh [0 3] b:ed:crypto) sk)
325 %+ add
325 %+ add
@@ -347,7 +347,7 @@
347 ::
347 ::
348 ++ ship-life-to-pubid
348 ++ ship-life-to-pubid
349 |= [our=@p now=@da ship=@p =life]
349 |= [our=@p now=@da ship=@p =life]
350− ^- @uxpoint
350+ ^- @udpoint
351 ::
351 ::
352 =/ d=[=^life =pass *]
352 =/ d=[=^life =pass *]
353 =/ scry-path=path
353 =/ scry-path=path
@@ -364,14 +364,14 @@
364 ::
364 ::
365 =/ x=[crypt=@ auth=@] (get-public-key-from-pass pass.d)
365 =/ x=[crypt=@ auth=@] (get-public-key-from-pass pass.d)
366 ::
366 ::
367− `@uxpoint`auth.x
367+ `@udpoint`auth.x
368 ::
368 ::
369 ++ build-signing-participants
369 ++ build-signing-participants
370 |= [our=@p now=@da invited=(list @p)]
370 |= [our=@p now=@da invited=(list @p)]
371− ^- [(set [@p life]) (set @uxpoint)]
371+ ^- [(set [@p life]) (set @udpoint)]
372 ::
372 ::
373 =| participants=(set [@p life])
373 =| participants=(set [@p life])
374− =| keys=(set @uxpoint)
374+ =| keys=(set @udpoint)
375 ::
375 ::
376 |-
376 |-
377 ?~ invited
377 ?~ invited
@@ -383,7 +383,7 @@
383 ?~ lyfe
383 ?~ lyfe
384 $(invited t.invited)
384 $(invited t.invited)
385 ::
385 ::
386− =/ pubkey=@uxpoint (ship-life-to-pubid our now i.invited u.lyfe)
386+ =/ pubkey=@udpoint (ship-life-to-pubid our now i.invited u.lyfe)
387 ::
387 ::
388 =. participants (~(put in participants) [i.invited u.lyfe])
388 =. participants (~(put in participants) [i.invited u.lyfe])
389 =. keys (~(put in keys) pubkey)
389 =. keys (~(put in keys) pubkey)
@@ -393,15 +393,15 @@
393 ::
393 ::
394 ++ build-verifying-participants
394 ++ build-verifying-participants
395 |= [our=@p now=@da invited=(list [ship=@p =life])]
395 |= [our=@p now=@da invited=(list [ship=@p =life])]
396− ^- (set @uxpoint)
396+ ^- (set @udpoint)
397 ::
397 ::
398− =| keys=(set @uxpoint)
398+ =| keys=(set @udpoint)
399 ::
399 ::
400 |-
400 |-
401 ?~ invited
401 ?~ invited
402 keys
402 keys
403 ::
403 ::
404− =/ pubkey=@uxpoint
404+ =/ pubkey=@udpoint
405 (ship-life-to-pubid our now ship.i.invited life.i.invited)
405 (ship-life-to-pubid our now ship.i.invited life.i.invited)
406 =. keys
406 =. keys
407 (~(put in keys) pubkey)
407 (~(put in keys) pubkey)
@@ -432,7 +432,7 @@
432 =/ link-hash=(unit @) (bind link-scope |=(a=* (shaz (jam a))))
432 =/ link-hash=(unit @) (bind link-scope |=(a=* (shaz (jam a))))
433 :: get everyone's public keys
433 :: get everyone's public keys
434 ::
434 ::
435− =/ p=[participants=(set [ship=@p =life]) keys=(set @uxpoint)]
435+ =/ p=[participants=(set [ship=@p =life]) keys=(set @udpoint)]
436 (build-signing-participants:detail our now ~(tap in anonymity-set))
436 (build-signing-participants:detail our now ~(tap in anonymity-set))
437 :: get our ships' current life
437 :: get our ships' current life
438 ::
438 ::
@@ -448,7 +448,7 @@
448 +:(get-private-key-from-ring:detail secret-ring)
448 +:(get-private-key-from-ring:detail secret-ring)
449 :: get our ships' public key
449 :: get our ships' public key
450 ::
450 ::
451− =/ public-key=@uxpoint
451+ =/ public-key=@udpoint
452 (ship-life-to-pubid:detail our now our our-life)
452 (ship-life-to-pubid:detail our now our our-life)
453 ::
453 ::
454 :- participants.p
454 :- participants.p
@@ -467,7 +467,7 @@
467 |= [our=@p now=@da message=* =ring-signature]
467 |= [our=@p now=@da message=* =ring-signature]
468 ^- ?
468 ^- ?
469 ::
469 ::
470− =/ keys=(set @uxpoint)
470+ =/ keys=(set @udpoint)
471 %^ build-verifying-participants:detail our now
471 %^ build-verifying-participants:detail our now
472 ~(tap in participants.ring-signature)
472 ~(tap in participants.ring-signature)
473 ::
473 ::
base-desk/lib/server.hoon+2−2
@@ -19,7 +19,7 @@
19++ json-to-octs
19++ json-to-octs
20 |= jon=json
20 |= jon=json
21 ^- octs
21 ^- octs
22− (as-octs:mimes:html (en:json:html jon))
22+ (as-octt:mimes:html (en-json:html jon))
23::
23::
24++ app
24++ app
25 |%
25 |%
@@ -114,7 +114,7 @@
114 :_ `octs
114 :_ `octs
115 [200 [['content-type' 'image/svg+xml'] ?:(cache [max-1-wk ~] ~)]]
115 [200 [['content-type' 'image/svg+xml'] ?:(cache [max-1-wk ~] ~)]]
116 ::
116 ::
117− ++ ico-response
117+ ++ ico-response
118 |= =octs
118 |= =octs
119 ^- simple-payload:http
119 ^- simple-payload:http
120 [[200 [['content-type' 'image/x-icon'] max-1-wk ~]] `octs]
120 [[200 [['content-type' 'image/x-icon'] max-1-wk ~]] `octs]
base-desk/lib/shoe.hoon+26−37
@@ -13,8 +13,8 @@
13/- *sole
13/- *sole
14/+ sole, auto=language-server-complete
14/+ sole, auto=language-server-complete
15|%
15|%
16−+$ state-2
16++$ state-1
17− $: %2
17+ $: %1
18 soles=(map sole-id sole-share)
18 soles=(map sole-id sole-share)
19 ==
19 ==
20:: $card: standard gall cards plus shoe effects
20:: $card: standard gall cards plus shoe effects
@@ -147,7 +147,7 @@
147++ agent
147++ agent
148 |* command-type=mold
148 |* command-type=mold
149 |= =(shoe command-type)
149 |= =(shoe command-type)
150− =| state-2
150+ =| state-1
151 =* state -
151 =* state -
152 ^- agent:gall
152 ^- agent:gall
153 =>
153 =>
@@ -188,7 +188,7 @@
188 =^ cards shoe on-init:og
188 =^ cards shoe on-init:og
189 [(deal cards) this]
189 [(deal cards) this]
190 ::
190 ::
191− ++ on-save :(slop !>(%shoe-app) on-save:og !>(state))
191+ ++ on-save !>([%shoe-app on-save:og state])
192 ::
192 ::
193 ++ on-load
193 ++ on-load
194 |= old-state=vase
194 |= old-state=vase
@@ -201,32 +201,23 @@
201 ?. ?=([%shoe-app ^] q.old-state)
201 ?. ?=([%shoe-app ^] q.old-state)
202 =^ cards shoe (on-load:og old-state)
202 =^ cards shoe (on-load:og old-state)
203 [(deal cards) this]
203 [(deal cards) this]
204− |^ :: versions %0 and %1 stored the inner state double-vased.
205− :: fixing this coincided with the 408 type-of-type migration.
206− ::
207− ?: ?=([%shoe-app * ?(%0 %1) *] q.old-state)
208− =| old-outer=state-any
204+ |^ =| old-outer=state-any
209− =^ old-inner old-outer
205+ =^ old-inner old-outer
210− +:!<([%shoe-app vase:h136 state-any] old-state)
206+ +:!<([%shoe-app vase state-any] old-state)
207+ :: ~! q.old-state
208+ :: ?+ +>.q.old-state !!
209+ :: [%0 *] +:!<([%shoe-app vase state-0] old-state)
210+ :: [%1 *] +:!<([%shoe-app vase state-1] old-state)
211+ :: ==
211− =^ caz shoe (on-load:og (next-vase:h136 old-inner))
212+ =^ caz shoe (on-load:og old-inner)
212− =^ cuz old-outer
213+ =^ cuz old-outer
213− ?. ?=(%0 -.old-outer) [~ old-outer]
214+ ?. ?=(%0 -.old-outer) [~ old-outer]
214− (state-0-to-1 old-outer)
215+ (state-0-to-1 old-outer)
215− =? old-outer ?=(%1 -.old-outer) (state-1-to-2 old-outer)
216− ?> ?=(%2 -.old-outer)
216+ ?> ?=(%1 -.old-outer)
217− [(weld cuz (deal caz)) this(state old-outer)]
217+ [(weld cuz (deal caz)) this(state old-outer)]
218− ::
219− =+ !<(old=state-any (slot 7 old-state))
220− ?> ?=(%2 -.old)
221− =. state old
222− ::
223− =^ caz shoe (on-load:og (slot 6 old-state))
224− [(deal caz) this]
225 ::
218 ::
226− +$ state-any $%(state-2 state-1 state-0)
219+ +$ state-any $%(state-1 state-0)
227− +$ state-1 _%*(. *state-2 - %1)
228 +$ state-0 [%0 soles=(map @ta sole-share)]
220 +$ state-0 [%0 soles=(map @ta sole-share)]
229− ++ state-1-to-2 |=(old=state-1 old(- %2))
230 ++ state-0-to-1
221 ++ state-0-to-1
231 |= old=state-0
222 |= old=state-0
232 ^- (quip card:agent:gall state-1)
223 ^- (quip card:agent:gall state-1)
@@ -422,25 +413,23 @@
422 =/ cobs=(list [wid=@ud (list tape)])
413 =/ cobs=(list [wid=@ud (list tape)])
423 (turn cows col-as-lines)
414 (turn cows col-as-lines)
424 =+ [lin=0 any=|]
415 =+ [lin=0 any=|]
425− =+ len=(lent cobs)
426 =| fez=(list sole-effect)
416 =| fez=(list sole-effect)
427 |- ^+ fez
417 |- ^+ fez
428− =; [line=(list tape) end=@ud]
418+ =; out=tape
429 :: done when we're past the end of all columns
419 :: done when we're past the end of all columns
430 ::
420 ::
431− ?: =(len end)
421+ ?: (levy out (cury test ' '))
432 (flop fez)
422 (flop fez)
433 =; fec=sole-effect
423 =; fec=sole-effect
434 $(lin +(lin), fez [fec fez])
424 $(lin +(lin), fez [fec fez])
435− =/ out=tape
436− (zing (join " " line))
437 ?. bold txt+out
425 ?. bold txt+out
438 klr+[[`%br ~ ~]^[(crip out)]~]~
426 klr+[[`%br ~ ~]^[(crip out)]~]~
439− %^ spin cobs 0
427+ %+ roll cobs
440− |= [[wid=@ud lines=(list tape)] empty=@ud]
428+ |= [[wid=@ud lines=(list tape)] out=tape]
429+ %+ weld out
430+ %+ weld ?~(out "" " ")
441 =+ l=(swag [lin 1] lines)
431 =+ l=(swag [lin 1] lines)
442− ?^ l [i.l empty]
443− [(reap wid ' ') +(empty)]
432+ ?^(l i.l (reap wid ' '))
444 ::
433 ::
445 ++ col-as-lines
434 ++ col-as-lines
446 |= [wid=@ud col=dime]
435 |= [wid=@ud col=dime]
base-desk/lib/sink.hoondeleted−26
@@ -1,26 +0,0 @@
1−/+ noun-diff
2−|%
3−++ clog
4− |$ [stut]
5− $%
6− [%flush stut]
7− [%drain patch:noun-diff]
8− ==
9−++ sink
10− |* pats=(list path)
11− |* stat=*
12− |@
13− ++ sync
14− |= [stat=_stat]
15− ^- [card:agent:gall _..sync]
16− =/ dif
17− %+ diff:noun-diff ^stat stat
18− :-
19− [%give %fact pats %noun !>(^-((clog) [%drain dif]))]
20− ..sync(stat stat)
21− ++ paths pats
22− ++ flush
23− ^- card:agent:gall
24− [%give %fact pats %noun !>(^-((clog) [%flush stat]))]
25− --
26−--
base-desk/lib/sss.hoon+114−188
@@ -61,7 +61,7 @@
61 ?+ flow=(~(get by sub) which) `0/sub
61 ?+ flow=(~(get by sub) which) `0/sub
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
62 ~ [~[(pine which)] 0/(~(put by sub) which ~)]
63 [~ ~] [~[(pine which)] 0/sub]
63 [~ ~] [~[(pine which)] 0/sub]
64− [~ ~ [* %& * *]] [~[(pine which)] 0/sub]
64+ [~ ~ [* %& * *]] [~[(scry `+(aeon.u.u.flow) which)] 0/sub]
65 ==
65 ==
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
66 ++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
67 ++ read :: See current subscribed states.
67 ++ read :: See current subscribed states.
@@ -95,7 +95,7 @@
95 [~ ~ *]
95 [~ ~ *]
96 =. stale.u.u.flow &
96 =. stale.u.u.flow &
97 :_ 0/(~(put by sub) current u.flow)
97 :_ 0/(~(put by sub) current u.flow)
98− ~[(on-rock-poke fake=& current u.u.flow ~)]
98+ ~[(on-rock-poke current u.u.flow ~)]
99 ::
99 ::
100 [~ ~]
100 [~ ~]
101 :_ 0/(~(del by sub) current) :_ ~
101 :_ 0/(~(del by sub) current) :_ ~
@@ -105,53 +105,77 @@
105 [path ship dude]:current
105 [path ship dude]:current
106 ==
106 ==
107 ==
107 ==
108+ :: :: Check if we're still interested
109+ :: :: in a wave. If no, no-op.
110+ :: :: If yes, scry.
111+ ++ behn :: (See https://gist.github.com/belisarius222/7f8452bfea9b199c0ed717ab1778f35b)
112+ |= [ship=term =dude aeon=term path=paths]
113+ ^- (list card:agent:gall)
114+ %- fall :_ ~ %- mole |.
115+ =/ ship (slav %p ship)
116+ =/ aeon (slav %ud aeon)
117+ ?: (lte aeon aeon:(fall (~(got by sub) ship dude path) *flow)) ~
118+ ~[(scry `aeon ship dude path)]
119+ ::
108 ++ apply :: Handle response from publisher.
120 ++ apply :: Handle response from publisher.
109 |= res=(response:poke lake paths)
121 |= res=(response:poke lake paths)
110 ^- (quip card:agent:gall subs)
122 ^- (quip card:agent:gall subs)
123+ %- fall :_ `0/sub %- mole |.
111 =* current [src.bowl dude.res path.res]
124 =* current [src.bowl dude.res path.res]
112 =/ old=flow (fall (~(got by sub) current) *flow)
125 =/ old=flow (fall (~(got by sub) current) *flow)
126+ ?- type.res
113− ?: ?=(%tomb what.res)
127+ %tomb
114 =/ =flow old(stale &)
128 =/ =flow old(stale &)
115 :_ 0/(~(put by sub) current `flow) :_ ~
129 :_ 0/(~(put by sub) current `flow) :_ ~
116− (on-rock-poke fake=& current flow ~)
130+ (on-rock-poke current flow ~)
131+ ::
132+ %yore
133+ :_ 0/sub :_ ~
134+ (pine src.bowl dude.res path.res)
117 ::
135 ::
136+ %nigh
137+ :_ 0/sub :_ ~
138+ (behn-s25 [dude aeon path]:res)
139+ ::
140+ %scry
118− =/ [wave=(unit wave:lake) new=(unit flow)]
141+ =/ [wave=(unit wave:lake) =flow]
119− ?- what.res
142+ ?- what.res
120− %rock ?: (lte aeon.res aeon.old) [~ ~]
143+ %rock ?> (gte aeon.res aeon.old)
121− [~ `[aeon.res | | rock.res]]
144+ [~ [aeon.res | | rock.res]]
122− %wave ?: (lte aeon.res aeon.old) [~ ~]
123− ?> =(aeon.res +(aeon.old))
145+ %wave ?> =(aeon.res +(aeon.old))
124− [`wave.res `[aeon.res | | (wash:lake rock.old wave.res)]]
146+ [`wave.res [aeon.res | | (wash:lake rock.old wave.res)]]
147+ ==
148+ :_ 0/(~(put by sub) current `flow)
149+ :~ (on-rock-poke current flow wave)
150+ (scry `+(aeon.res) src.bowl dude.res path.res)
125 ==
151 ==
126− ?~ new `0/sub
152+ ==
127− :_ 0/(~(put by sub) current new) :_ ~
128− (on-rock-poke fake=& current u.new wave)
129− ::
130− ++ handle-fake-on-rock
131− |= =(on-rock:poke lake paths)
132− ^- (list card:agent:gall)
133− ?~ flow=(~(get by sub) [src from path]:on-rock) ~
134− ?~ u.flow ~
135− ?. =([stale fail rock]:u.u.flow [stale fail rock]:on-rock) ~
136− ~[(on-rock-poke fake=| [src from path]:on-rock u.u.flow wave.on-rock)]
137 ::
153 ::
138 :: Non-public facing arms below
154 :: Non-public facing arms below
139 ::
155 ::
140− ++ pine
156+ ++ behn-s25
157+ |= [=dude =aeon path=noun]
158+ ^- card:agent:gall
159+ :* %pass (zoom behn/(scot %p src.bowl)^dude^(scot %ud aeon)^path)
160+ %arvo %b %wait (add ~s25 now.bowl)
161+ ==
162+ ++ pine |= [ship dude paths] (scry ~ +<)
163+ ++ scry
141− |= [who=ship which=dude where=paths]
164+ |= [when=(unit aeon) who=ship which=dude where=paths]
142 ^- card:agent:gall
165 ^- card:agent:gall
166+ =/ when ?~ when ~ (scot %ud u.when)
143− :* %pass (zoom scry-request/(scot %p who)^which^where)
167+ :* %pass (zoom scry-request/(scot %p who)^which^when^where)
144 %agent [who which]
168 %agent [who which]
145− %poke sss-to-pub/[result-type `result`[where dap.bowl]]
169+ %poke %sss-to-pub :- result-type ^- result
170+ [where dap.bowl ^when]
146 ==
171 ==
147 ++ on-rock-poke
172 ++ on-rock-poke
148− |= [fake=? [=ship =dude path=paths] flow wave=(unit wave:lake)]
173+ |= [[=ship =dude path=paths] flow wave=(unit wave:lake)]
149 ^- card:agent:gall
174 ^- card:agent:gall
150− :* %pass %+ zoom ?:(fake %fake %on-rock)
151− (scot %ud aeon)^(scot %p ship)^dude^path
175+ :* %pass (zoom on-rock/(scot %ud aeon)^(scot %p ship)^dude^path)
152 %agent [our dap]:bowl
176 %agent [our dap]:bowl
153− %poke ?:(fake %sss-fake-on-rock %sss-on-rock)
177+ %poke %sss-on-rock on-rock-type ^- from
154− on-rock-type `from`[path ship dude stale fail rock wave]
178+ [path ship dude stale fail rock wave]
155 ==
179 ==
156 --
180 --
157++ du :: Manage publications.
181++ du :: Manage publications.
@@ -160,78 +184,28 @@
160 |%
184 |%
161 +$ into (request:poke paths)
185 +$ into (request:poke paths)
162 +$ result (response:poke lake paths)
186 +$ result (response:poke lake paths)
163− +$ rule $~ [`5 5]
164− [horizon=(unit @ud) frequency=@ud] :: Retention policy
187+ +$ rule [rocks=_1 waves=_5] :: Retention policy
165 +$ tide
188 +$ tide
166 $: rok=((mop aeon rock:lake) gte)
189 $: rok=((mop aeon rock:lake) gte)
167 wav=((mop aeon wave:lake) lte)
190 wav=((mop aeon wave:lake) lte)
168 rul=rule
191 rul=rule
169− mem=(jug ship dude)
192+ mem=(mip ship dude @da)
170 ==
193 ==
171 +$ buoy
194 +$ buoy
172 $: tid=$~(*tide $@(aeon tide))
195 $: tid=$~(*tide $@(aeon tide))
173 alo=(unit (set ship))
196 alo=(unit (set ship))
174 ==
197 ==
175− ++ pubs
176− =< $>(%1 versioned)
177− |%
178− ++ update
179− |= =versioned
180− ^- pubs
181− ?- -.versioned
182− %1 versioned
183− %0
184− :- %1
185− %- ~(run by +.versioned)
186− |= =buoy-0:^versioned
187− ^- buoy
188− %= buoy-0
189− tid
190− ?@ tid.buoy-0 tid.buoy-0
191− ^- tide
192− %= tid.buoy-0
193− rocks.rul
194− ?: =(waves.rul.tid.buoy-0 0) ~
195− `(mul [+(rocks) waves]:rul.tid.buoy-0)
196− ::
197− mem
198− ^- (jug ship dude)
199− %- ~(run by mem.tid.buoy-0)
200− |= =(map dude @da)
201− ^- (set dude)
202− ~(key by map)
203− ==
204− ==
205− ==
206− ++ versioned
207− =< $% [%0 (map paths buoy-0)]
198+ +$ pubs [%0 (map paths buoy)]
208− [%1 (map paths buoy)]
209− ==
210− |%
211− +$ buoy-0
212− $: tid=$~(*tide-0 $@(aeon tide-0))
213− alo=(unit (set ship))
214− ==
215− +$ tide-0
216− $: rok=((mop aeon rock:lake) gte)
217− wav=((mop aeon wave:lake) lte)
218− rul=[rocks=@ud waves=@ud]
219− mem=(mip ship dude @da)
220− ==
221− --
222− --
223 --
199 --
224− |= [pub=versioned:pubs =bowl:gall result-type=type]
200+ |= [pub=pubs =bowl:gall result-type=type]
225− => .(pub +:(update:pubs pub))
201+ => .(pub +.pub)
226 =* rok ((on aeon rock:lake) gte)
202 =* rok ((on aeon rock:lake) gte)
227 =* wav ((on aeon wave:lake) lte)
203 =* wav ((on aeon wave:lake) lte)
228 |%
204 |%
229 ++ rule :: Set new retention policy.
205 ++ rule :: Set new retention policy.
230 |= [path=paths =^rule]
206 |= [path=paths =^rule]
231 ^- pubs
207 ^- pubs
232− :- %1
208+ :- %0
233− %- fall :_ (~(put by pub) path %*(. *$<(aeon buoy) rul.tid rule))
234− %- mole |.
235 %+ ~(jab by pub) path
209 %+ ~(jab by pub) path
236 |= =buoy
210 |= =buoy
237 ?@ tid.buoy buoy
211 ?@ tid.buoy buoy
@@ -240,11 +214,11 @@
240 ++ wipe :: Create new rock and wipe rest.
214 ++ wipe :: Create new rock and wipe rest.
241 |= path=paths
215 |= path=paths
242 ^- pubs
216 ^- pubs
243− :- %1
217+ :- %0
244 %+ ~(jab by pub) path
218 %+ ~(jab by pub) path
245 |= =buoy
219 |= =buoy
246 ?@ tid.buoy buoy
220 ?@ tid.buoy buoy
247− %* . buoy(tid (form tid.buoy(rul [`0 1])))
221+ %* . buoy(tid (form tid.buoy(rul [0 1])))
248 rul.tid rul.tid.buoy
222 rul.tid rul.tid.buoy
249 wav.tid ~
223 wav.tid ~
250 ==
224 ==
@@ -253,45 +227,23 @@
253 ^- (quip card:agent:gall pubs)
227 ^- (quip card:agent:gall pubs)
254 ?~ ((soft ^path) path) ~| %need-path !!
228 ?~ ((soft ^path) path) ~| %need-path !!
255 =/ buoy (~(gut by pub) path *buoy)
229 =/ buoy (~(gut by pub) path *buoy)
256− =? buoy ?=(@ tid.buoy)
230+ ?@ tide=tid.buoy ~| %dead-path !! ::TODO is this good behavior?
257− %*(. buoy(tid *tide) rok.tid (put:rok ~ +(tid.buoy) *rock:lake))
258− ?> ?=(^ tid.buoy)
259− =* tide tid.buoy
260 =/ next=aeon +((latest tide))
231 =/ next=aeon +((latest tide))
261− :- %- zing
262− %+ turn ~(tap by mem.tide)
232+ :- %+ murn ~(tap bi mem.tide)
263− |= [=ship =(set dude)]
233+ |= [=ship =dude =@da]
264− %+ turn ~(tap in set)
234+ ?: (lth da now.bowl) ~
265− |= =dude
266− (send wave/[next wave] ship dude path)
235+ `(send scry/wave/wave ship dude next path)
267− :- %1
236+ :- %0
268 %+ ~(put by pub) path
237 %+ ~(put by pub) path
269 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
238 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
270 =. wav.tide (put:wav wav.tide next wave)
239 =. wav.tide (put:wav wav.tide next wave)
271− =. mem.tide ~
240+ =. mem.tide (~(del by mem.tide) next)
272− ?. =(next (add aeon.last frequency.rul.tide)) buoy
241+ ?. =(next (add aeon.last waves.rul.tide)) buoy
273 buoy(tid (form tide))
242 buoy(tid (form tide))
274 ::
243 ::
275− ++ fork :: Fork a pub into an empty path.
276− |= [from=paths to=paths]
277− ^- pubs
278− :- %1
279− ?< (~(has by pub) to)
280− (~(put by pub) to (~(got by pub) from))
281− ::
282− ++ copy :: Fork a sub into an empty path.
283− |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
284− ^- pubs
285− :- %1
286− ?< (~(has by pub) to)
287− %+ ~(put by pub) to
288− %* . *$<(aeon buoy)
289− rok.tid (put:rok ~ [aeon rock]:(need (~(got by +:sub) from)))
290− ==
291− ::
292 ++ perm :: Change permissions with gate.
244 ++ perm :: Change permissions with gate.
293 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
245 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
294− ^- (quip card:agent:gall pubs)
246+ ^- pubs
295 %+ edit where
247 %+ edit where
296 |= =buoy
248 |= =buoy
297 =/ new=_alo.buoy (diff alo.buoy)
249 =/ new=_alo.buoy (diff alo.buoy)
@@ -300,21 +252,21 @@
300 alo new
252 alo new
301 mem.tid ?~ new mem.tid.buoy
253 mem.tid ?~ new mem.tid.buoy
302 %. mem.tid.buoy
254 %. mem.tid.buoy
303− ~(int by (malt (turn ~(tap in u.new) (late *(set @)))))
255+ ~(int by (malt (turn ~(tap in u.new) (late *(map @ @)))))
304 ==
256 ==
305 ++ public (curr perm _~) :: Make list of paths public.
257 ++ public (curr perm _~) :: Make list of paths public.
306 ++ secret (curr perm _`~) :: Make list of paths secret.
258 ++ secret (curr perm _`~) :: Make list of paths secret.
307 :: :: Block ships from paths.
259 :: :: Block ships from paths.
308 ++ block :: No-ops on public paths.
260 ++ block :: No-ops on public paths.
309 |= [who=(list ship) whence=(list paths)]
261 |= [who=(list ship) whence=(list paths)]
310− ^- (quip card:agent:gall pubs)
262+ ^- pubs
311 %+ perm whence
263 %+ perm whence
312 |= old=(unit (set ship))
264 |= old=(unit (set ship))
313 ?~ old ~ `(~(dif in u.old) (sy who))
265 ?~ old ~ `(~(dif in u.old) (sy who))
314 :: :: Allow ships to paths.
266 :: :: Allow ships to paths.
315 ++ allow :: Any public paths will no-op.
267 ++ allow :: Any public paths will no-op.
316 |= [who=(list ship) where=(list paths)]
268 |= [who=(list ship) where=(list paths)]
317− ^- (quip card:agent:gall pubs)
269+ ^- pubs
318 %+ perm where
270 %+ perm where
319 |= old=(unit (set ship))
271 |= old=(unit (set ship))
320 ?~ old ~ `(~(gas in u.old) who)
272 ?~ old ~ `(~(gas in u.old) who)
@@ -322,6 +274,12 @@
322 ++ kill :: subs to not expect updates.
274 ++ kill :: subs to not expect updates.
323 (curr edit |=(=buoy buoy(tid (latest tid.buoy))))
275 (curr edit |=(=buoy buoy(tid (latest tid.buoy))))
324 :: :: Reopen list of killed paths.
276 :: :: Reopen list of killed paths.
277+ ++ live :: No-ops on live paths.
278+ %+ curr edit
279+ |= =buoy
280+ ?^ tid.buoy buoy
281+ %*(. buoy(tid *tide) rok.tid (put:rok ~ +(tid.buoy) *rock:lake))
282+ ::
325 ++ read :: See current published states.
283 ++ read :: See current published states.
326 ^- (map paths [allowed=(unit (set ship)) =rock:lake])
284 ^- (map paths [allowed=(unit (set ship)) =rock:lake])
327 %- malt %+ murn ~(tap by pub)
285 %- malt %+ murn ~(tap by pub)
@@ -341,51 +299,37 @@
341 =/ =buoy (~(gut by pub) path.req *buoy)
299 =/ =buoy (~(gut by pub) path.req *buoy)
342 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
300 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
343 ?@ tid.buoy
301 ?@ tid.buoy
344− :_ 1/pub :_ ~
302+ :_ 0/pub :_ ~
345− (send tomb/~ src.bowl dude.req path.req)
303+ (send tomb/~ src.bowl dude.req tid.buoy path.req)
346− :_ 1/pub :_ ~
304+ ?~ when.req
347− =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
305+ =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
348− (send rock/last src.bowl dude.req path.req)
349− ::
350− ++ tell
351− |= [[ship=term =dude aeon=term path=paths] =sign:agent:gall]
352− ^- (quip card:agent:gall pubs)
353− ?> ?=(%poke-ack -.sign)
354− ?^ p.sign `1/pub
355− =/ =buoy (~(gut by pub) path *buoy)
356− ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
357− ?@ tid.buoy
358− :_ 1/pub :_ ~
306+ :_ 0/pub :_ ~
359− (send tomb/~ src.bowl dude path)
307+ (send scry/rock/val.last src.bowl dude.req key.last path.req)
360− ::
361− => .(aeon +((slav %ud aeon)))
362− ?^ dat=(get:wav wav.tid.buoy aeon)
308+ ?^ dat=(get:wav wav.tid.buoy u.when.req)
363− :_ 1/pub :_ ~
309+ :_ 0/pub :_ ~
364− (send wave/[aeon u.dat] src.bowl dude path)
310+ (send scry/wave/u.dat src.bowl [dude u.when path]:req)
365− =/ last (fall (pry:rok rok.tid.buoy) [=key =val]:rok)
311+ ?: %+ lte u.when.req
366− ?: (lte aeon key.last)
312+ key::(fall (ram:wav wav.tid.buoy) (pry:rok rok.tid.buoy) [=key val]:wav)
367− :_ 1/pub :_ ~
313+ :_ 0/pub :_ ~
368− (send rock/last src.bowl dude path)
314+ (send yore/~ src.bowl [dude u.when path]:req)
369− :- ~
315+ ?> =(u.when.req +((latest tid.buoy)))
370− :- %1
316+ :- ~[(send nigh/~ src.bowl [dude u.when path]:req)]
317+ :- %0
371− %+ ~(put by pub) path
318+ %+ ~(put by pub) path.req
372 %= buoy
319 %= buoy
373− mem.tid (~(put ju mem.tid.buoy) src.bowl dude)
320+ mem.tid (~(put bi mem.tid.buoy) src.bowl dude.req (add ~s25 now.bowl))
374 ==
321 ==
375 ::
322 ::
376 :: Non-public facing arms below
323 :: Non-public facing arms below
377 ::
324 ::
378 ++ send
325 ++ send
379− |= [payload=_|2:*(response:poke lake paths) =ship =dude path=paths]
326+ |= [payload=_|3:*(response:poke lake paths) =ship =dude =aeon path=paths]
380 ^- card:agent:gall
327 ^- card:agent:gall
381 =* mark (cat 3 %sss- name:lake)
328 =* mark (cat 3 %sss- name:lake)
382− =/ callback=^path
329+ :* %pass (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon)^path)
383− ?: ?=(%tomb what.payload) (zoom tomb-response/(scot %p ship)^dude^path)
384− (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon.payload)^path)
385− :* %pass callback
386 %agent [ship dude]
330 %agent [ship dude]
387 %poke mark result-type ^- (response:poke lake paths)
331 %poke mark result-type ^- (response:poke lake paths)
388− [path dap.bowl payload]
332+ [path dap.bowl aeon payload]
389 ==
333 ==
390 ++ latest
334 ++ latest
391 |= =$@(aeon tide)
335 |= =$@(aeon tide)
@@ -396,49 +340,31 @@
396 ::
340 ::
397 ++ edit
341 ++ edit
398 |= [ps=(list paths) edit=$-(buoy buoy)]
342 |= [ps=(list paths) edit=$-(buoy buoy)]
399− ^- (quip card:agent:gall pubs)
343+ ^- pubs
344+ :- %0
400 %- ~(rep in (sy ps))
345 %- ~(rep in (sy ps))
401− |= [path=paths caz=(list card:agent:gall) %1 =_pub]
346+ |= [path=paths =_pub]
347+ %- fall :_ pub %- mole |.
402− ?~ old=(~(get by pub) path) [caz 1/pub]
348+ (~(jab by pub) path edit)
403− =/ new=buoy (edit u.old)
404− :_ 1/(~(put by pub) path new)
405− %- weld :_ caz
406− ^- (list card:agent:gall)
407− ?@ tid.u.old ~
408− ?@ tid.new
409− %- zing
410− %+ turn ~(tap by mem.tid.u.old)
411− |= [=ship =(set dude)]
412− (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
413− ?~ alo.new ~
414− =/ new-alo=(jug ship dude)
415− (malt (turn ~(tap in u.alo.new) (late *(set @))))
416− %- zing
417− %+ turn ~(tap by (~(dif by mem.tid.u.old) new-alo))
418− |= [=ship =(set dude)]
419− (turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
420 ::
349 ::
421 ++ form
350 ++ form
422 |= =tide
351 |= =tide
423 ^+ tide
352 ^+ tide
424 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
353 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
425 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
354 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
426− =? rok.tide :: Create new rock.
355+ =. rok.tide
356+ %+ gas:rok +<-:gas:rok
357+ %- tab:rok :_ [~ +(rocks.rul.tide)]
427− ?& !=(frequency.rul.tide 0)
358+ ?: ?| =(waves.rul.tide 0)
428− (gte max-wave (add aeon.max-rock frequency.rul.tide))
359+ (lth max-wave (add aeon.max-rock waves.rul.tide))
429− ==
360+ ==
361+ rok.tide
430 %+ put:rok rok.tide
362 %+ put:rok rok.tide
431 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
363 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
432 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
364 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
433 ~| %aeon-awry
365 ~| %aeon-awry
434 ?> =(now +(prev))
366 ?> =(now +(prev))
435 [now (wash:lake rock wave)]
367 [now (wash:lake rock wave)]
436− =. rok.tide
437− ?~ horizon.rul.tide :: Only keep genesis and latest.
438− (gas:rok ~ (murn ~[(ram:rok rok.tide) (pry:rok rok.tide)] same))
439− %^ lot:rok rok.tide :: Delete beyond horizon.
440− ~
441− (mole |.((sub max-wave (max [u.horizon frequency]:rul.tide))))
442 ~| %rock-zero
368 ~| %rock-zero
443 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
369 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
444 --
370 --
base-desk/lib/story.hoon+35−11
@@ -38,17 +38,41 @@
38::
38::
39:: Canonical textual representation
39:: Canonical textual representation
40::
40::
41−++ chapter-to-text
41+++ tako-to-text
42− |= [=tako:clay =proses]
42+ |= [=tako:clay]
43− ^- wain
43+ ^- tape
44− :- (crip "commit: {<`@uv`tako>}")
44+ "commit: {<`@uv`tako>}\0a"
45− %- zing
45+::
46− %+ join `wain`~['|||']
46+++ proses-to-text
47+ |= [=proses]
48+ ^- tape
47− %+ turn ~(tap in proses)
49+ =/ proses-list=(list prose) ~(tap in proses)
50+ ?: ?=(~ proses-list) ""
51+ ?: ?=([prose ~] proses-list)
52+ (prose-to-text i.proses-list)
53+ %- tail
54+ %^ spin `(list prose)`t.proses-list
55+ (prose-to-text i.proses-list)
48− |= prose
56+ |= [prz=prose state=tape]
49− ^- wain
57+ ^- [prose tape]
50− %- to-wain:format
58+ :- prz
51− (rap 3 title '\0a\0a' body ~)
59+ ;: welp
60+ state
61+ "|||"
62+ "\0a"
63+ (prose-to-text prz)
64+ ==
65+::
66+++ prose-to-text
67+ |= prz=prose
68+ =/ [title=@t body=@t] prz
69+ ^- tape
70+ ;: welp
71+ "{(trip title)}"
72+ "\0a\0a"
73+ "{(trip body)}"
74+ "\0a"
75+ ==
52::
76::
53:: Parsers
77:: Parsers
54::
78::
base-desk/lib/strandio.hoon+13−170
@@ -73,23 +73,21 @@
73 ^- form:m
73 ^- form:m
74 |= tin=strand-input:strand
74 |= tin=strand-input:strand
75 ?+ in.tin `[%skip ~]
75 ?+ in.tin `[%skip ~]
76− ~
77− `[%wait ~]
76+ ~ `[%wait ~]
78− ::
79 [~ %poke @ *]
77 [~ %poke @ *]
80 ?. =(mark p.cage.u.in.tin)
78 ?. =(mark p.cage.u.in.tin)
81 `[%skip ~]
79 `[%skip ~]
82 `[%done q.cage.u.in.tin]
80 `[%done q.cage.u.in.tin]
83 ==
81 ==
84::
82::
83+::
84+::
85++ take-sign-arvo
85++ take-sign-arvo
86 =/ m (strand ,[wire sign-arvo])
86 =/ m (strand ,[wire sign-arvo])
87 ^- form:m
87 ^- form:m
88 |= tin=strand-input:strand
88 |= tin=strand-input:strand
89 ?+ in.tin `[%skip ~]
89 ?+ in.tin `[%skip ~]
90− ~
91− `[%wait ~]
90+ ~ `[%wait ~]
92− ::
93 [~ %sign *]
91 [~ %sign *]
94 `[%done [wire sign-arvo]:u.in.tin]
92 `[%done [wire sign-arvo]:u.in.tin]
95 ==
93 ==
@@ -182,53 +180,6 @@
182 `[%done ~]
180 `[%done ~]
183 `[%fail %timer-error u.error.sign-arvo.u.in.tin]
181 `[%fail %timer-error u.error.sign-arvo.u.in.tin]
184 ==
182 ==
185−++ take-whey
186− |= =wire
187− =/ m (strand ,[spar:ames fragment-size=@ud num-fragments=@ud])
188− ^- form:m
189− |= tin=strand-input:strand
190− ?+ in.tin `[%skip ~]
191− ~ `[%wait ~]
192− ::
193− [~ %sign * %ames %sage sage=*]
194− ?. =(wire wire.u.in.tin)
195− `[%skip ~]
196− =/ =sage:mess:ames sage.sign-arvo.u.in.tin
197− :^ ~ %done spar=p.sage
198− ?~ q.sage
199− [boq=13 tot=0]
200− =< [boq tot]
201− ;;([%whey boq=@ud tot=@ud] q.sage)
202− ==
203−::
204−++ take-sage
205− |= =wire
206− =/ m (strand ,sage:mess:ames)
207− ^- form:m
208− |= tin=strand-input:strand
209− ?+ in.tin `[%skip ~]
210− ~ `[%wait ~]
211− ::
212− [~ %sign * %ames %sage sage=*]
213− ?. =(wire wire.u.in.tin)
214− `[%skip ~]
215− `[%done sage.sign-arvo.u.in.tin]
216− ==
217−:: XX deprecate in 409k
218−::
219−++ take-near
220− |= =wire
221− =/ m (strand ,[spar:ames (unit (unit page))])
222− ^- form:m
223− |= tin=strand-input:strand
224− ?+ in.tin `[%skip ~]
225− ~ `[%wait ~]
226− ::
227− [~ %sign * %ames %near ^ *]
228− ?. =(wire wire.u.in.tin)
229− `[%skip ~]
230− `[%done +>.sign-arvo.u.in.tin]
231− ==
232::
183::
233++ take-poke-ack
184++ take-poke-ack
234 |= =wire
185 |= =wire
@@ -364,78 +315,6 @@
364 ;< ~ bind:m (send-wait until)
315 ;< ~ bind:m (send-wait until)
365 (take-wake `until)
316 (take-wake `until)
366::
317::
367−++ mass
368− =/ m (strand ,(list quac:dill))
369− ^- form:m
370− =/ =card:agent:gall [%pass /mass %arvo %d %mass ~]
371− ;< ~ bind:m (send-raw-card card)
372− ;< quz=(list quac:dill) bind:m take-meme
373− (pure:m quz)
374−::
375−++ take-meme
376− =/ m (strand ,(list quac:dill))
377− ^- form:m
378− |= tin=strand-input:strand
379− ?+ in.tin `[%skip ~]
380− ~ `[%wait ~]
381− [~ %sign [%mass ~] %dill %meme *]
382− `[%done p.sign-arvo.u.in.tin]
383− ==
384−::
385−++ keen
386− |= [=wire =spar:ames sec=(unit [@ @])]
387− =/ m (strand ,~)
388− ^- form:m
389− (send-raw-card %pass wire %arvo %a %keen sec spar)
390−::
391−++ chum
392− |= [=wire =spar:ames]
393− =/ m (strand ,~)
394− ^- form:m
395− (send-raw-card %pass wire %arvo %a %chum spar)
396−::
397−++ keen-shut
398− |= [=wire =spar:ames]
399− =/ m (strand ,~)
400− ^- form:m
401− (send-raw-card %pass wire %keen & spar)
402−::
403−++ yawn
404− |= [=wire =spar:ames]
405− =/ m (strand ,~)
406− ^- form:m
407− (send-raw-card %pass wire %arvo %a %yawn spar)
408−::
409−++ whey
410− |= [=wire boq=@ud =spar:ames]
411− =/ m (strand ,~)
412− ^- form:m
413− :: encrypted using %chum namespace
414− ::
415− ;< our=@p bind:m get-our
416− =. path.spar
417− [%a %x '1' %$ %whey (scot %ud boq) (scot %p our) path.spar]
418− (chum wire spar)
419−::
420−++ meta
421− |= [=wire =spar:ames]
422− =/ m (strand ,~)
423− ^- form:m
424− ?+ path.spar !!
425− $% [%ames bone=@ %cork ~]
426− [%ames bone=@ %sent seq=@ ~]
427− [%flow bone=@ =dire:ames %cork ~]
428− [?(%ames %flow) bone=@ =dire:ames ?(%sent %loads %naxp %acked) seq=@ ~]
429− ==
430− :: encrypted using %chum namespace
431− ::
432− ;< our=@p bind:m get-our
433− %- send-raw-card
434− :* %pass wire %arvo %a %chum
435− spar(path [%a %x '1' %$ %meta (scot %p our) path.spar])
436− ==
437− ==
438−::
439++ sleep
318++ sleep
440 |= for=@dr
319 |= for=@dr
441 =/ m (strand ,~)
320 =/ m (strand ,~)
@@ -554,6 +433,7 @@
554 %- pure:m
433 %- pure:m
555 ?~ full-file.client-response ''
434 ?~ full-file.client-response ''
556 q.data.u.full-file.client-response
435 q.data.u.full-file.client-response
436+
557::
437::
558++ fetch-cord
438++ fetch-cord
559 |= url=tape
439 |= url=tape
@@ -569,7 +449,7 @@
569 =/ m (strand ,json)
449 =/ m (strand ,json)
570 ^- form:m
450 ^- form:m
571 ;< =cord bind:m (fetch-cord url)
451 ;< =cord bind:m (fetch-cord url)
572− =/ json=(unit json) (de:json:html cord)
452+ =/ json=(unit json) (de-json:html cord)
573 ?~ json
453 ?~ json
574 (strand-fail %json-parse-error ~)
454 (strand-fail %json-parse-error ~)
575 (pure:m u.json)
455 (pure:m u.json)
@@ -594,18 +474,6 @@
594 (pure:m ~)
474 (pure:m ~)
595 ?> =(%vase p.r.u.riot)
475 ?> =(%vase p.r.u.riot)
596 (pure:m (some !<(vase q.r.u.riot)))
476 (pure:m (some !<(vase q.r.u.riot)))
597−::
598−++ build-file-hard
599− |= [[=ship =desk =case] =spur]
600− =* arg +<
601− =/ m (strand ,vase)
602− ^- form:m
603− ;< =riot:clay
604− bind:m
605− (warp ship desk ~ %sing %a case spur)
606− ?> ?=(^ riot)
607− ?> ?=(%vase p.r.u.riot)
608− (pure:m !<(vase q.r.u.riot))
609:: +build-mark: build a mark definition to a $dais
477:: +build-mark: build a mark definition to a $dais
610::
478::
611++ build-mark
479++ build-mark
@@ -669,7 +537,7 @@
669 (take-writ /warp)
537 (take-writ /warp)
670::
538::
671++ read-file
539++ read-file
672− |= [[=ship =desk =case] =spur]
540+ |= [[=ship =desk =case:clay] =spur]
673 =* arg +<
541 =* arg +<
674 =/ m (strand ,cage)
542 =/ m (strand ,cage)
675 ;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
543 ;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
@@ -678,14 +546,13 @@
678 (pure:m r.u.riot)
546 (pure:m r.u.riot)
679::
547::
680++ check-for-file
548++ check-for-file
681− |= [[=ship =desk =case] =spur]
549+ |= [[=ship =desk =case:clay] =spur]
682 =/ m (strand ,?)
550 =/ m (strand ,?)
683− ;< =riot:clay bind:m (warp ship desk ~ %sing %u case spur)
551+ ;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
684− ?> ?=(^ riot)
552+ (pure:m ?=(^ riot))
685− (pure:m !<(? q.r.u.riot))
686::
553::
687++ list-tree
554++ list-tree
688− |= [[=ship =desk =case] =spur]
555+ |= [[=ship =desk =case:clay] =spur]
689 =* arg +<
556 =* arg +<
690 =/ m (strand ,(list path))
557 =/ m (strand ,(list path))
691 ;< =riot:clay bind:m (warp ship desk ~ %sing %t case spur)
558 ;< =riot:clay bind:m (warp ship desk ~ %sing %t case spur)
@@ -693,14 +560,6 @@
693 (strand-fail %list-tree >arg< ~)
560 (strand-fail %list-tree >arg< ~)
694 (pure:m !<((list path) q.r.u.riot))
561 (pure:m !<((list path) q.r.u.riot))
695::
562::
696−++ list-desk
697− |= [[=ship =desk =case] =spur]
698− =* arg +<
699− =/ m (strand arch)
700− ;< =riot:clay bind:m (warp ship desk ~ %sing %y case spur)
701− ?~ riot
702− (strand-fail %list-desk >arg< ~)
703− (pure:m !<(arch q.r.u.riot))
704:: Take Clay read result
563:: Take Clay read result
705::
564::
706++ take-writ
565++ take-writ
@@ -727,23 +586,6 @@
727 (poke [who %hood] %helm-hi !>(~))
586 (poke [who %hood] %helm-hi !>(~))
728 (pure:m ~)
587 (pure:m ~)
729::
588::
730−++ eval-hoon
731− |= [gen=hoon bez=(list beam)]
732− =/ m (strand ,vase)
733− ^- form:m
734− =/ sut=vase !>(..zuse)
735− |-
736− ?~ bez
737− (pure:m (slap sut gen))
738− ;< vax=vase bind:m (build-file-hard i.bez)
739− $(bez t.bez, sut (slop vax sut))
740−::
741−++ send-thread
742− |= [=bear:khan =shed:khan =wire]
743− =/ m (strand ,~)
744− ^- form:m
745− (send-raw-card %pass wire %arvo %k %lard bear shed)
746−::
747:: Queue on skip, try next on fail %ignore
589:: Queue on skip, try next on fail %ignore
748::
590::
749++ main-loop
591++ main-loop
@@ -909,10 +751,11 @@
909 =/ poke-vase !>(`start-args:spider`[`tid.bowl `tid byk.bowl file args])
751 =/ poke-vase !>(`start-args:spider`[`tid.bowl `tid byk.bowl file args])
910 ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid])
752 ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid])
911 ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
753 ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
754+ ;< ~ bind:m (sleep ~s0) :: wait for thread to start
912 ;< =cage bind:m (take-fact /awaiting/[tid])
755 ;< =cage bind:m (take-fact /awaiting/[tid])
913 ;< ~ bind:m (take-kick /awaiting/[tid])
756 ;< ~ bind:m (take-kick /awaiting/[tid])
914 ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!)
757 ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!)
915 %thread-done (pure:m %& q.cage)
758 %thread-done (pure:m %& q.cage)
916− %thread-fail (pure:m %| !<([term tang] q.cage))
759+ %thread-fail (pure:m %| ;;([term tang] q.q.cage))
917 ==
760 ==
918--
761--
base-desk/lib/test.hoon+1−54
@@ -38,60 +38,7 @@
38 =/ b (mule a)
38 =/ b (mule a)
39 ?- -.b
39 ?- -.b
40 %| ~
40 %| ~
41− %& ['expected failure - succeeded' ~]
42− ==
43−:: +expect-success: kicks a trap, expecting success; returns trace on failure
44−::
45−++ expect-success
46− |= a=(trap)
47− ^- tang
48− =/ b (mule a)
49− ?- -.b
50− %& ~
51− %| ['expected success - failed' p.b]
52− ==
53−::
54−:: +expect-fail-message: kicks a trap, expecting crash, compares the resulting error message
55−++ expect-fail-message
56− |= [msg=@t a=(trap)]
57− ^- tang
58− =/ b (mule a)
59− ?- -.b
60− %| |^
61− =/ =tang (flatten +.b)
62− ?: ?=(^ (find (trip msg) tang))
63− ~
64− ['expected error message - not found' ~]
65− ++ flatten
66− |= tang=(list tank)
67− =| res=tape
68− |- ^- tape
69− ?~ tang res
70− $(tang t.tang, res (weld ~(ram re i.tang) res))
71− --
72− %& ['expected failure - succeeded' ~]
41+ %& [leaf+"expected failure - succeeded" ~]
73− ==
74−:: $a-test-chain: a sequence of tests to be run
75−::
76−:: NB: arms shouldn't start with `test-` so that `-test % ~` runs
77−::
78−+$ a-test-chain
79− $_
80− |?
81− ?: =(0 0)
82− [%& p=*tang]
83− [%| p=[tang=*tang next=^?(..$)]]
84−:: +run-chain: run a sequence of tests, stopping at first failure
85−::
86−++ run-chain
87− |= seq=a-test-chain
88− ^- tang
89− =/ res $:seq
90− ?- -.res
91− %& p.res
92− %| ?. =(~ tang.p.res)
93− tang.p.res
94− $(seq next.p.res)
95 ==
42 ==
96:: +category: prepends a name to an error result; passes successes unchanged
43:: +category: prepends a name to an error result; passes successes unchanged
97::
44::
base-desk/lib/verb.hoon+11−88
@@ -1,6 +1,6 @@
1:: Print what your agent is doing.
1:: Print what your agent is doing.
2::
2::
3−/- *verb
3+/- verb
4::
4::
5|= [loud=? =agent:gall]
5|= [loud=? =agent:gall]
6=| bowl-print=_|
6=| bowl-print=_|
@@ -14,10 +14,7 @@
14 ^- (quip card:agent:gall agent:gall)
14 ^- (quip card:agent:gall agent:gall)
15 %- (print bowl |.("{<dap.bowl>}: on-init"))
15 %- (print bowl |.("{<dap.bowl>}: on-init"))
16 =^ cards agent on-init:ag
16 =^ cards agent on-init:ag
17− :_ this
17+ [[(emit-event %on-init ~) cards] this]
18− :_ :_ cards
19− (emit-event %on-init ~)
20− (emit-event-plus bowl [%on-init ~] cards)
21::
18::
22++ on-save
19++ on-save
23 ^- vase
20 ^- vase
@@ -29,10 +26,7 @@
29 ^- (quip card:agent:gall agent:gall)
26 ^- (quip card:agent:gall agent:gall)
30 %- (print bowl |.("{<dap.bowl>}: on-load"))
27 %- (print bowl |.("{<dap.bowl>}: on-load"))
31 =^ cards agent (on-load:ag old-state)
28 =^ cards agent (on-load:ag old-state)
32− :_ this
29+ [[(emit-event %on-load ~) cards] this]
33− :_ :_ cards
34− (emit-event %on-load ~)
35− (emit-event-plus bowl [%on-load ~] cards)
36::
30::
37++ on-poke
31++ on-poke
38 |= [=mark =vase]
32 |= [=mark =vase]
@@ -44,23 +38,17 @@
44 %bowl `this(bowl-print !bowl-print)
38 %bowl `this(bowl-print !bowl-print)
45 ==
39 ==
46 =^ cards agent (on-poke:ag mark vase)
40 =^ cards agent (on-poke:ag mark vase)
47− :_ this
41+ [[(emit-event %on-poke mark) cards] this]
48− :_ :_ cards
49− (emit-event %on-poke mark)
50− (emit-event-plus bowl [%on-poke mark (mug q.vase)] cards)
51::
42::
52++ on-watch
43++ on-watch
53 |= =path
44 |= =path
54 ^- (quip card:agent:gall agent:gall)
45 ^- (quip card:agent:gall agent:gall)
55 %- (print bowl |.("{<dap.bowl>}: on-watch on path {<path>}"))
46 %- (print bowl |.("{<dap.bowl>}: on-watch on path {<path>}"))
56 =^ cards agent
47 =^ cards agent
57− ?: ?=([%verb ?(%events %events-plus) ~] path)
48+ ?: ?=([%verb %events ~] path)
58 [~ agent]
49 [~ agent]
59 (on-watch:ag path)
50 (on-watch:ag path)
60− :_ this
51+ [[(emit-event %on-watch path) cards] this]
61− :_ :_ cards
62− (emit-event %on-watch path)
63− (emit-event-plus bowl [%on-watch path] cards)
64::
52::
65++ on-leave
53++ on-leave
66 |= =path
54 |= =path
@@ -69,10 +57,7 @@
69 ?: ?=([%verb %event ~] path)
57 ?: ?=([%verb %event ~] path)
70 [~ this]
58 [~ this]
71 =^ cards agent (on-leave:ag path)
59 =^ cards agent (on-leave:ag path)
72− :_ this
60+ [[(emit-event %on-leave path) cards] this]
73− :_ :_ cards
74− (emit-event %on-leave path)
75− (emit-event-plus bowl [%on-leave path] cards)
76::
61::
77++ on-peek
62++ on-peek
78 |= =path
63 |= =path
@@ -85,17 +70,7 @@
85 ^- (quip card:agent:gall agent:gall)
70 ^- (quip card:agent:gall agent:gall)
86 %- (print bowl |.("{<dap.bowl>}: on-agent on wire {<wire>}, {<-.sign>}"))
71 %- (print bowl |.("{<dap.bowl>}: on-agent on wire {<wire>}, {<-.sign>}"))
87 =^ cards agent (on-agent:ag wire sign)
72 =^ cards agent (on-agent:ag wire sign)
88− :_ this
73+ [[(emit-event %on-agent wire -.sign) cards] this]
89− :_ :_ cards
90− (emit-event %on-agent wire -.sign)
91− =; =^sign
92− (emit-event-plus bowl [%on-agent wire sign] cards)
93− ?- -.sign
94− %poke-ack [%poke-ack ?=(~ p.sign)]
95− %watch-ack [%watch-ack ?=(~ p.sign)]
96− %kick [%kick ~]
97− %fact [%fact p.cage.sign (mug q.q.cage.sign)]
98− ==
99::
74::
100++ on-arvo
75++ on-arvo
101 |= [=wire =sign-arvo]
76 |= [=wire =sign-arvo]
@@ -103,20 +78,14 @@
103 %- %+ print bowl |.
78 %- %+ print bowl |.
104 "{<dap.bowl>}: on-arvo on wire {<wire>}, {<[- +<]:sign-arvo>}"
79 "{<dap.bowl>}: on-arvo on wire {<wire>}, {<[- +<]:sign-arvo>}"
105 =^ cards agent (on-arvo:ag wire sign-arvo)
80 =^ cards agent (on-arvo:ag wire sign-arvo)
106− :_ this
81+ [[(emit-event %on-arvo wire [- +<]:sign-arvo) cards] this]
107− :_ :_ cards
108− (emit-event %on-arvo wire [- +<]:sign-arvo)
109− (emit-event-plus bowl [%on-arvo wire [- +<]:sign-arvo] cards)
110::
82::
111++ on-fail
83++ on-fail
112 |= [=term =tang]
84 |= [=term =tang]
113 ^- (quip card:agent:gall agent:gall)
85 ^- (quip card:agent:gall agent:gall)
114 %- (print bowl |.("{<dap.bowl>}: on-fail with term {<term>}"))
86 %- (print bowl |.("{<dap.bowl>}: on-fail with term {<term>}"))
115 =^ cards agent (on-fail:ag term tang)
87 =^ cards agent (on-fail:ag term tang)
116− :_ this
88+ [[(emit-event %on-fail term) cards] this]
117− :_ :_ cards
118− (emit-event %on-fail term)
119− (emit-event-plus bowl [%on-fail term] cards)
120--
89--
121::
90::
122++ print
91++ print
@@ -130,53 +99,7 @@
130 same
99 same
131::
100::
132++ emit-event
101++ emit-event
133− |= =event
102+ |= =event:verb
134 ^- card:agent:gall
103 ^- card:agent:gall
135 [%give %fact ~[/verb/events] %verb-event !>(event)]
104 [%give %fact ~[/verb/events] %verb-event !>(event)]
136−::
137−++ emit-event-plus
138− |= [=bowl:gall =cause cards=(list card:agent:gall)]
139− ^- card:agent:gall
140− =; event=event-plus
141− [%give %fact ~[/verb/events-plus] %verb-event-plus !>(event)]
142− =- [act.bowl now.bowl src.bowl sap.bowl cause -]
143− %+ turn cards
144− |= =card:agent:gall
145− ^- effect
146− ::TODO for %fact, %kick, could calculate how many ships affected
147− ?- card
148− [%pass * %agent * ?(%poke %poke-as) *]
149− =, q.card
150− =/ =cage ?-(-.task.q.card %poke cage.task, %poke-as [mark.task q.cage.task])
151− [%poke p.card [ship name] p.cage `@`(mug q.q.cage)]
152− ::
153− [%pass * %agent * ?(%watch %watch-as) *]
154− =, q.card
155− =/ =path ?-(-.task.q.card %watch path.task, %watch-as path.task)
156− [%watch p.card [ship name] path]
157− ::
158− [%pass * %agent * %leave *]
159− =, q.card
160− [%leave p.card [ship name]]
161− ::
162− [%give %fact *]
163− =, p.card
164− [%fact paths p.cage (mug q.q.cage)]
165− ::
166− [%give %kick *]
167− [%kick paths.p.card]
168− ::
169− [%give ?(%poke-ack %watch-ack) *]
170− ~| %explicit-ack
171− !! :: shouldn't be given explicitly
172− ::
173− [%pass * %arvo *]
174− [%arvo p.card -.q.card +<.q.card]
175− ::
176− [%pass *]
177− [%arvo p.card %$ -.q.card]
178− ::
179− [%slip *]
180− $(card [%pass //slip p.card])
181− ==
182--
105--
base-desk/mar/css.hoon+5−9
@@ -6,15 +6,11 @@
6=, mimes:html
6=, mimes:html
7|_ mud=@t
7|_ mud=@t
8++ grow :: convert to
8++ grow :: convert to
9− |%
10− ++ mime [/text/css (as-octs mud)] :: convert to %mime
9+ |% ++ mime [/text/css (as-octs mud)] :: convert to %mime
11− ++ hymn :: convert to %hymn
10+ ++ elem ;style :: convert to %hymn
12− |^ html
13− ++ style ;style
14− ;- (trip mud)
11+ ;- (trip mud)
15− ==
12+ ==
16− ++ html ;html:(head:"{style}" body)
13+ ++ hymn ;html:(head:"{elem}" body)
17− --
18 --
14 --
19++ grab
15++ grab
20 |% :: convert from
16 |% :: convert from
base-desk/mar/hoon.hoon+31−285
@@ -1,295 +1,41 @@
1+:::: /hoon/hoon/mar
2+ ::
3+/? 310
4+::
5+=, eyre
1|_ own=@t
6|_ own=@t
2::
7::
3++ grow :: convert to
8++ grow :: convert to
4 |%
9 |%
5 ++ mime `^mime`[/text/x-hoon (as-octs:mimes:html own)] :: convert to %mime
10 ++ mime `^mime`[/text/x-hoon (as-octs:mimes:html own)] :: convert to %mime
11+ ++ elem :: convert to %html
12+ ;div:pre(urb_codemirror "", mode "hoon"):"{(trip own)}"
13+ :: =+ gen-id="src-{<`@ui`(mug own)>}"
14+ :: ;div
15+ :: ;textarea(id "{gen-id}"):"{(trip own)}"
16+ :: ;script:"""
17+ :: CodeMirror.fromTextArea(
18+ :: window[{<gen-id>}],
19+ :: \{lineNumbers:true, readOnly:true}
20+ :: )
21+ :: """
22+ :: ==
6 ++ hymn
23 ++ hymn
7− ^- manx
24+ :: ;html:(head:title:"Source" "+{elem}")
8− =/ to-wall
25+ ;html
9− |= =tape
26+ ;head
10− ^- wall
27+ ;title:"Source"
11− %+ roll (flop tape)
28+ ;script@"//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js";
12− |= [char=@tD =wall]
29+ ;script@"/lib/syntax/hoon.js";
13− ?~ wall
30+ ;link(rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/".
14− [[char ~] ~]
31+ "codemirror/4.3.0/codemirror.min.css");
15− ?: =('\0a' char)
32+ ;link/"/lib/syntax/codemirror.css"(rel "stylesheet");
16− [~ wall]
33+ ==
17− [[char i.wall] t.wall]
34+ ;body
18− ::
19− =/ src=tape (trip own)
35+ ;textarea#src:"{(trip own)}"
20− =/ count=@ud (lent (to-wall src))
36+ ;script:'CodeMirror.fromTextArea(src, {lineNumbers:true, readOnly:true})'
21− =; [style=tape script=tape]
22− ;html
23− ;head
24− ;title: source
25− ;meta(charset "utf-8");
26− ;meta(name "viewport", content "width=device-width, initial-scale=1");
27− ;style: {style}
28− ==
29− ;body
30− ;div.viewer
31− :: ;div.viewer-bar
32− :: ;span.viewer-name: {(scow %ud count)} lines
33− :: ;button.copy-link(id "copy-link", hidden ""): copy link
34− :: ==
35− ;div.code
36− ;pre.gutter(id "gutter");
37− ;div.code-body
38− ;div(id "hl");
39− ;pre.code-pre(id "code"): {src}
40− ==
41− ==
42− ==
43− ;script: {script}
44− ==
45 ==
37 ==
46− ::
38+ ==
47− :-
48− ^~ ^= style
49− ^- tape
50− %- trip
51− '''
52− :root {
53− --bg: #fbfbf9;
54− --panel: #ffffff;
55− --gutter-bg: #f3f3ef;
56− --line: #e4e4dd;
57− --fg: #2b2b2b;
58− --fg-dim: #9a9a90;
59− --sel: #fff7d6;
60− --sel-edge: #f1e4a8;
61− --accent: #4a6da7;
62− --lh: 20px;
63− --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
64− "Liberation Mono", "Courier New", monospace;
65− }
66− * { box-sizing: border-box; }
67− html, body {
68− margin: 0;
69− height: 100%;
70− background: var(--bg);
71− color: var(--fg);
72− font-family: var(--mono);
73− -webkit-font-smoothing: antialiased;
74− }
75− .viewer {
76− height: 100vh;
77− display: flex;
78− flex-direction: column;
79− padding: 16px;
80− gap: 12px;
81− }
82− .viewer-bar {
83− flex: 0 0 auto;
84− display: flex;
85− align-items: center;
86− gap: 12px;
87− font-size: 13px;
88− color: var(--fg-dim);
89− }
90− .viewer-name {
91− flex: 1 1 auto;
92− min-width: 0;
93− overflow: hidden;
94− text-overflow: ellipsis;
95− white-space: nowrap;
96− color: var(--fg);
97− }
98− .copy-link {
99− flex: 0 0 auto;
100− padding: 4px 12px;
101− border: 1px solid var(--line);
102− border-radius: 6px;
103− background: var(--panel);
104− color: var(--fg-dim);
105− font: inherit;
106− font-size: 12px;
107− cursor: pointer;
108− transition: color .12s, border-color .12s;
109− }
110− .copy-link:hover { color: var(--accent); border-color: var(--accent); }
111− .copy-link[hidden] { display: none; }
112− .code {
113− flex: 1 1 auto;
114− min-height: 0;
115− display: flex;
116− align-items: flex-start;
117− overflow: auto;
118− background: var(--panel);
119− border: 1px solid var(--line);
120− border-radius: 8px;
121− }
122− .code-body {
123− position: relative;
124− flex: 1 1 auto;
125− min-width: 0;
126− width: max-content;
127− }
128− #gutter, #code {
129− margin: 0;
130− padding: 14px 0;
131− font-family: var(--mono);
132− font-size: 13px;
133− line-height: var(--lh);
134− white-space: pre;
135− tab-size: 2;
136− }
137− #gutter {
138− position: sticky;
139− left: 0;
140− z-index: 2;
141− flex: 0 0 auto;
142− padding-left: 16px;
143− padding-right: 12px;
144− text-align: right;
145− color: var(--fg-dim);
146− background: var(--gutter-bg);
147− border-right: 1px solid var(--line);
148− user-select: none;
149− -webkit-user-select: none;
150− cursor: pointer;
151− }
152− #code {
153− display: block;
154− padding-left: 14px;
155− padding-right: 18px;
156− color: var(--fg);
157− }
158− #hl {
159− position: absolute;
160− left: 0;
161− right: 0;
162− z-index: 0; /* under the text */
163− display: none;
164− background: var(--sel);
165− box-shadow: inset 2px 0 0 var(--sel-edge);
166− pointer-events: none;
167− }
168− #code { position: relative; z-index: 1; } /* text above the bar */
169− :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
170− '''
171− ^~ ^= code
172− ^- tape
173− %- trip
174− '''
175− (function () {
176− "use strict";
177− const panel = document.querySelector(".code"); // the scroll container
178− const code = document.getElementById("code");
179− const gutter = document.getElementById("gutter");
180− const hl = document.getElementById("hl");
181− if (!panel || !code || !gutter || !hl) return;
182− const text = code.textContent;
183− let lineCount = text.length ? text.split("\n").length : 1;
184− if (text.endsWith("\n")) lineCount -= 1;
185− if (lineCount < 1) lineCount = 1;
186− (function fillGutter() {
187− let s = "";
188− for (let i = 1; i <= lineCount; i++) s += i + "\n";
189− gutter.textContent = s;
190− })();
191− let lineH = 0;
192− let codeTop = 0; // code's content-box top padding, the y-origin of line 1
193− function measure() {
194− const cs = getComputedStyle(code);
195− const lh = parseFloat(cs.lineHeight);
196− lineH = isNaN(lh) ? parseFloat(cs.fontSize) * 1.55 : lh;
197− codeTop = parseFloat(cs.paddingTop) || 0;
198− positionHighlight(); // keep the bar correct after a re-measure
199− }
200− let anchor = null;
201− let selLo = 0;
202− let selHi = 0;
203− function positionHighlight() {
204− if (!selLo) { hl.style.display = "none"; return; }
205− hl.style.display = "block";
206− hl.style.top = (codeTop + (selLo - 1) * lineH) + "px";
207− hl.style.height = ((selHi - selLo + 1) * lineH) + "px";
208− }
209− function applySel(lo, hi) {
210− selLo = lo;
211− selHi = hi;
212− positionHighlight();
213− }
214− function deselect() {
215− selLo = selHi = 0;
216− anchor = null;
217− positionHighlight();
218− history.replaceState(null, "", location.pathname + location.search);
219− }
220− function parseHash(hash) {
221− const m = /^#L(\d+)(?:-L(\d+))?$/.exec(hash || "");
222− if (!m) return null;
223− let lo = parseInt(m[1], 10);
224− let hi = m[2] ? parseInt(m[2], 10) : lo;
225− if (hi < lo) { const t = lo; lo = hi; hi = t; }
226− lo = Math.max(1, Math.min(lo, lineCount));
227− hi = Math.max(1, Math.min(hi, lineCount));
228− return [lo, hi];
229− }
230− function setHash(lo, hi) {
231− const frag = lo === hi ? "L" + lo : "L" + lo + "-L" + hi;
232− history.replaceState(null, "", "#" + frag);
233− }
234− function scrollToLine(n) {
235− const y = codeTop + (n - 1) * lineH;
236− if (y < panel.scrollTop || y > panel.scrollTop + panel.clientHeight) {
237− panel.scrollTop = Math.max(0, y - panel.clientHeight / 2);
238− }
239− }
240− function selectFromHash(scroll) {
241− const r = parseHash(location.hash);
242− if (!r) return false;
243− anchor = r[0];
244− applySel(r[0], r[1]);
245− if (scroll) scrollToLine(r[0]);
246− return true;
247− }
248− function lineFromEvent(e) {
249− // y within the code content: pointer relative to the code pre's rendered
250− // top, which already accounts for scroll since getBoundingClientRect is
251− // viewport-relative and the pre moves as the panel scrolls.
252− const rect = code.getBoundingClientRect();
253− const y = e.clientY - rect.top - codeTop;
254− let n = Math.floor(y / lineH) + 1;
255− if (n < 1) n = 1;
256− if (n > lineCount) n = lineCount;
257− return n;
258− }
259− function onClick(e) {
260− const inGutter = e.target === gutter;
261− if (!inGutter && !e.shiftKey) return; // normal text interaction in code
262− const n = lineFromEvent(e);
263− if (!e.shiftKey && selLo === n && selHi === n) {
264− deselect();
265− return;
266− }
267− if (e.shiftKey && anchor !== null) {
268− applySel(Math.min(anchor, n), Math.max(anchor, n));
269− setHash(selLo, selHi);
270− } else {
271− anchor = n;
272− applySel(n, n);
273− setHash(n, n);
274− }
275− }
276− gutter.addEventListener("click", onClick);
277− code.addEventListener("click", onClick);
278− document.addEventListener("keydown", function (e) {
279− if (e.key === "Escape") deselect();
280− });
281− window.addEventListener("hashchange", function () {
282− if (!selectFromHash(true)) deselect();
283− });
284− let rz = null;
285− window.addEventListener("resize", function () {
286− clearTimeout(rz);
287− rz = setTimeout(measure, 100);
288− });
289− measure();
290− selectFromHash(true);
291− })();
292− '''
293 ++ txt
39 ++ txt
294 (to-wain:format own)
40 (to-wain:format own)
295 --
41 --
base-desk/mar/htm.hoon+11−2
@@ -2,5 +2,14 @@
2:::: /hoon/htm/mar
2:::: /hoon/htm/mar
3 ::
3 ::
4/? 310
4/? 310
5−/= htm /mar/html
5+|_ own=manx
6−htm
6+::
7+++ grad %noun
8+++ grow :: convert to
9+ |%
10+ ++ noun own
11+ ++ hymn own
12+ --
13+++ grab |% :: convert from
14+ ++ noun manx :: clam from %noun
15+-- --
base-desk/mar/httr.hoon+2−1
@@ -5,11 +5,12 @@
5::
5::
6=, eyre
6=, eyre
7=, format
7=, format
8+=, html
8|_ hit=httr
9|_ hit=httr
9++ grad %noun
10++ grad %noun
10++ grow |% ++ wall (turn wain trip)
11++ grow |% ++ wall (turn wain trip)
11 ++ wain (to-wain cord)
12 ++ wain (to-wain cord)
12− ++ json (need (de:json:html cord))
13+ ++ json (need (de-json cord))
13 ++ cord q:octs
14 ++ cord q:octs
14 ++ noun hit
15 ++ noun hit
15 ++ octs
16 ++ octs
base-desk/mar/js.hoon+4−7
@@ -8,13 +8,10 @@
8++ grow
8++ grow
9 |%
9 |%
10 ++ mime [/application/javascript (as-octs:mimes:html (@t mud))]
10 ++ mime [/application/javascript (as-octs:mimes:html (@t mud))]
11− ++ hymn :: convert to %hymn
12− |^ html
13− ++ script ;script
11+ ++ elem ;script
14− ;- (trip (@t mud))
12+ ;- (trip (@t mud))
15− ==
13+ ==
16− ++ html ;html:(head:"{script}" body)
14+ ++ hymn ;html:(head:"+{elem}" body)
17− --
18 --
15 --
19++ grab
16++ grab
20 |% :: convert from
17 |% :: convert from
base-desk/mar/json.hoon+4−4
@@ -8,17 +8,17 @@
8=, eyre
8=, eyre
9=, format
9=, format
10=, html
10=, html
11−|_ jon=^json
11+|_ jon=json
12::
12::
13++ grow :: convert to
13++ grow :: convert to
14 |%
14 |%
15 ++ mime [/application/json (as-octs:mimes -:txt)] :: convert to %mime
15 ++ mime [/application/json (as-octs:mimes -:txt)] :: convert to %mime
16− ++ txt [(en:json jon)]~
16+ ++ txt [(crip (en-json jon))]~
17 --
17 --
18++ grab
18++ grab
19 |% :: convert from
19 |% :: convert from
20− ++ mime |=([p=mite q=octs] (fall (de:json (@t q.q)) *^json))
20+ ++ mime |=([p=mite q=octs] (fall (rush (@t q.q) apex:de-json) *json))
21− ++ noun ^json :: clam from %noun
21+ ++ noun json :: clam from %noun
22 ++ numb numb:enjs
22 ++ numb numb:enjs
23 ++ time time:enjs
23 ++ time time:enjs
24 --
24 --
base-desk/mar/json/rpc/response.hoon+2−1
@@ -16,10 +16,11 @@
16 ^- response
16 ^- response
17 ~| hit
17 ~| hit
18 ?: ?=(%2 (div p.hit 100))
18 ?: ?=(%2 (div p.hit 100))
19+ =, html
19 %- json
20 %- json
20 ?~ r.hit
21 ?~ r.hit
21 a+~
22 a+~
22− (need (de:json:html q:u.r.hit))
23+ (need (de-json q:u.r.hit))
23 fail+hit
24 fail+hit
24 ++ json :: from json
25 ++ json :: from json
25 =, dejs-soft:format
26 =, dejs-soft:format
base-desk/mar/noun.hoon−3
@@ -8,9 +8,6 @@
8++ grab |%
8++ grab |%
9 ++ noun *
9 ++ noun *
10 --
10 --
11−++ grow |%
12− ++ mime [/application/x-urb-jam (as-octs:mimes:html (jam non))]
13− --
14++ grad
11++ grad
15 |%
12 |%
16 ++ form %noun
13 ++ form %noun
base-desk/mar/story.hoon+10−5
@@ -46,13 +46,18 @@
46 [/text/x-urb-story (as-octs:mimes:html (of-wain:format txt))]
46 [/text/x-urb-story (as-octs:mimes:html (of-wain:format txt))]
47 ++ txt
47 ++ txt
48 ^- wain
48 ^- wain
49− %- zing
49+ %- snoc :_ '' :: ensures terminating newline is present
50− %+ join `wain`~['---']
51 %+ murn ~(tap by tale)
50 %+ murn ~(tap by tale)
52− |= [=tako:clay =proses]
51+ |= [[=tako:clay =proses]]
53− ^- (unit wain)
52+ ^- (unit cord)
54 ?~ proses ~
53 ?~ proses ~
54+ %- some
55+ %- crip
56+ ;: welp
55− (some (chapter-to-text tako proses))
57+ (tako-to-text tako)
58+ (proses-to-text proses)
59+ "---"
60+ ==
56 --
61 --
57++ grab
62++ grab
58 |% :: convert from
63 |% :: convert from
base-desk/mar/tang.hoon+5−5
@@ -16,15 +16,15 @@
16 %& a+p.result
16 %& a+p.result
17 %| a+[a+[%s '[[output rendering error]]']~]~
17 %| a+[a+[%s '[[output rendering error]]']~]~
18 ==
18 ==
19− ++ txt
19+ ::
20− ^- wain
20+ ++ elem
21+ =- ;pre:code:"{(of-wall -)}"
22+ ^- wall %- zing ^- (list wall)
21− %+ turn (flop tan)
23+ (turn (flop tan) |=(a=tank (wash 0^160 a)))
22− |=(=tank (crip ~(ram re tank)))
23 --
24 --
24++ grab :: convert from
25++ grab :: convert from
25 |%
26 |%
26 ++ noun (list ^tank) :: clam from %noun
27 ++ noun (list ^tank) :: clam from %noun
27 ++ tank |=(a=^tank [a]~)
28 ++ tank |=(a=^tank [a]~)
28− ++ txt |=(=wain (flop (turn wain tank)))
29 --
29 --
30--
30--
base-desk/mar/thread-fail.hoon+1−1
@@ -1,4 +1,4 @@
1−|_ err=[term tang]
1+|_ err=*
2++ grab
2++ grab
3 |%
3 |%
4 ++ noun (pair term tang)
4 ++ noun (pair term tang)
base-desk/mar/txt.hoon+1
@@ -18,6 +18,7 @@
18 => v=.
18 => v=.
19 |%
19 |%
20 ++ mime => v [/text/plain (as-octs (of-wain txt))]
20 ++ mime => v [/text/plain (as-octs (of-wain txt))]
21+ ++ elem => v ;pre: {(trip (of-wain txt))}
21 --
22 --
22++ grad
23++ grad
23 |%
24 |%
base-desk/mar/udon.hoon+4
@@ -9,6 +9,10 @@
9 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
9 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
10 ++ txt
10 ++ txt
11 (to-wain:format mud)
11 (to-wain:format mud)
12+ ++ elem
13+ ^- manx
14+ =, cram
15+ elm:(static (ream mud))
12 ++ front :: XX performance, types
16 ++ front :: XX performance, types
13 ^- (map term knot)
17 ^- (map term knot)
14 %- ~(run by inf:(static:cram (ream mud)))
18 %- ~(run by inf:(static:cram (ream mud)))
base-desk/mar/umd.hoon+4
@@ -9,6 +9,10 @@
9 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
9 ++ mime [/text/x-unmark (as-octs:mimes:html mud)]
10 ++ txt
10 ++ txt
11 (to-wain:format mud)
11 (to-wain:format mud)
12+ ++ elem
13+ ^- manx
14+ =, cram
15+ elm:(static (ream mud))
12 ++ front :: XX performance, types
16 ++ front :: XX performance, types
13 ^- (map term knot)
17 ^- (map term knot)
14 %- ~(run by inf:(static:cram (ream mud)))
18 %- ~(run by inf:(static:cram (ream mud)))
base-desk/mar/urb.hoon+1−1
@@ -1,5 +1,5 @@
1::
1::
2−:::: /hoon/urb/mar
2+:::: /hoon/elem/urb/mar
3 ::
3 ::
4/? 310
4/? 310
5=, mimes:html
5=, mimes:html
base-desk/sources.txt+3−2
@@ -1,3 +1,4 @@
1urbit-src/pkg/base-dev
1urbit-src/pkg/base-dev
2−urbit-src/pkg/landscape
2+urbit-src/pkg/garden-dev
3+urbit-src/pkg/arvo/lib/naive
3−urbit-src/pkg/arvo
4+urbit-src/pkg/arvo/lib/tiny
base-desk/sur/aquarium.hoon+4−8
@@ -10,6 +10,8 @@
10:: Short names are simply the first letter of each word plus `s` if
10:: Short names are simply the first letter of each word plus `s` if
11:: it's a list.
11:: it's a list.
12::
12::
13+/+ pill
14+=, pill-lib=pill
13|%
15|%
14+$ az-log [topics=(lest @) data=@t]
16+$ az-log [topics=(lest @) data=@t]
15+$ az-state
17+$ az-state
@@ -32,13 +34,13 @@
32 [%verb p=(unit ?)]
34 [%verb p=(unit ?)]
33 task-arvo
35 task-arvo
34 ==
36 ==
37++$ pill pill:pill-lib
35::
38::
36+$ aqua-event
39+$ aqua-event
37− $% [%init-ship who=ship fake=? feed=(unit feed:jael)]
40+ $% [%init-ship who=ship fake=?]
38 [%pause-events who=ship]
41 [%pause-events who=ship]
39 [%snap-ships lab=term hers=(list ship)]
42 [%snap-ships lab=term hers=(list ship)]
40 [%restore-snap lab=term]
43 [%restore-snap lab=term]
41− [%read [from=[=ship life=@ubC] =path] for=[=lane:ames life=@ubC] num=@ud]
42 [%event who=ship ue=unix-event]
44 [%event who=ship ue=unix-event]
43 ==
45 ==
44::
46::
@@ -71,9 +73,6 @@
71 %+ pair wire
73 %+ pair wire
72 $% [%blit p=(list blit:dill)]
74 $% [%blit p=(list blit:dill)]
73 [%send p=lane:ames q=@]
75 [%send p=lane:ames q=@]
74− [%push p=(list lane:pact:ames) q=@]
75− [%saxo sponsors=(list ship)]
76− [%nail =ship lanes=(list lane:ames)]
77 [%doze p=(unit @da)]
76 [%doze p=(unit @da)]
78 [%thus p=@ud q=(unit hiss:eyre)]
77 [%thus p=@ud q=(unit hiss:eyre)]
79 [%ergo p=@tas q=mode:clay]
78 [%ergo p=@tas q=mode:clay]
@@ -82,8 +81,5 @@
82 [%kill ~]
81 [%kill ~]
83 [%init ~]
82 [%init ~]
84 [%request id=@ud request=request:http]
83 [%request id=@ud request=request:http]
85− [%turf p=(list turf)]
86− [%unto =unto:gall] :: internal gifts to host ships
87− :: (%facts are transformed to %raw-facts)
88 ==
84 ==
89--
85--
base-desk/sur/hood.hoon+134−287
@@ -1,4 +1,3 @@
1−/% kelvin %kelvin
2=, clay
1=, clay
3=* dude dude:gall
2=* dude dude:gall
4|%
3|%
@@ -10,303 +9,151 @@
10 ==
9 ==
11::
10::
12+$ pikes (map desk pike)
11+$ pikes (map desk pike)
13−:: $jump: changes to update source change requests
14::
12::
15−+$ jump
16− $% [%all all=(map dock dock)] :: pending requests
17− [%add old=dock new=dock] :: new request
18− [%yea old=dock new=dock] :: approved
19− [%nay old=dock new=dock] :: denied
20− ==
21:: $rung: reference to upstream commit
13:: $rung: reference to upstream commit
22::
14::
23+$ rung [=aeon =weft]
15+$ rung [=aeon =weft]
24−:: #sync-record: source and destination of a kiln sync
25−::
26−+$ sync-record ::
27− $: syd=desk :: local desk
28− her=ship :: foreign ship
29− sud=desk :: foreign desk
30− ==
31−::
32−+$ sync-state ::
33− $: nun=@ta :: nonce
34− kid=(unit desk) :: has kids desk too?
35− let=@ud :: next revision
36− nit=(unit ?) :: automerge or default
37− hav=(unit @ud) :: update available
38− yea=? :: update approved
39− ==
40−::
41−+$ sync-update
42− $% [%new for=sync-record rev=@ud]
43− [%done for=sync-record rev=@ud]
44− [%drop for=sync-record rev=@ud]
45− [%pending pending=(set [for=sync-record rev=@ud])]
46− ==
47::
16::
17++$ sync-state [nun=@ta kid=(unit desk) let=@ud]
48+$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
18+$ sink (unit [her=@p sud=desk kid=(unit desk) let=@ud])
49−:: +truncate-hash: get last 5 digits of hash and convert to tape
50−::
51−++ truncate-hash
52− |= hash=@uv
53− ^- tape
54− (slag 2 <`@uv`(mod hash 0v1.00000)>)
55−:: +report-prep: get data required for reports
56−::
57−++ report-prep
58− |= [our=@p now=@da]
59− =/ ego (scot %p our)
60− =/ wen (scot %da now)
61− :* .^(rock:tire %cx /[ego]//[wen]/tire)
62− .^(cone %cx /[ego]//[wen]/domes)
63− .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun)
64− .^ (map [desk ship desk] sync-state) %gx
65− /[ego]/hood/[wen]/kiln/syncs/noun
66− ==
67− ==
68−:: +report-vats: report on all desk installations
69−::
70++ report-vats
19++ report-vats
71− |= [our=@p now=@da desks=(list desk) filt=@tas verb=?]
20+ =| $: =cone
72− ^- tang
21+ sor=(map desk [ship desk])
73− =/ ego (scot %p our)
22+ zyn=(map [desk ship desk] sync-state)
74− =/ wen (scot %da now)
75− =+ prep=[tyr cone sor zyn]=(report-prep our now)
76− ?: =(%$ filt)
77− %- zing
78− %+ turn
79− ?^ desks
80− (flop desks)
81− %+ sort ~(tap in ~(key by tyr.prep))
82− |= [a=desk b=desk]
83− ?: |(=(a %kids) =(b %base)) &
84− ?: |(=(a %base) =(b %kids)) |
85− (aor b a)
86− |=(syd=@tas (report-vat prep our now syd verb))
87− =/ deks=(list [=desk =zest wic=(set weft)])
88− ?~ desks
89− %+ sort ~(tap by tyr.prep)
90− |= [[a=desk *] [b=desk *]]
91− ?: |(=(a %kids) =(b %base)) &
92− ?: |(=(a %base) =(b %kids)) |
93− (aor b a)
94− %+ murn (flop desks)
95− |= des=desk
96− ^- (unit [=desk =zest wic=(set weft)])
97− ?~ got=(~(get by tyr.prep) des)
98− ~
99− `[des u.got]
100− ?: =(filt %blocking)
101− =/ base-weft=(unit weft)
102− %- ~(rep in wic:(~(got by tyr.prep) %base))
103− |= [=weft out=(unit weft)]
104− ?~ out
105− `weft
106− ?: (lth num.weft num.u.out)
107− out
108− `weft
109− ?~ base-weft ~['%base already up-to-date']
110− =/ blockers=(list desk)
111− %+ sort
112− ^- (list desk)
113− %+ murn deks
114− |= [=desk =zest wic=(set weft)]
115− ^- (unit ^desk)
116− ?. =(%live zest)
117− ~
118− ?: (~(has in wic) u.base-weft)
119− ~
120− `desk
121− aor
122− ?~ blockers ~['No desks blocking upgrade']
123− %- zing
124− ^- (list tang)
125− :- :~ %+ rap 3
126− :~ 'These desks are blocking upgrade to [%zuse '
127− (scot %ud num.u.base-weft)
128− ']:'
129− == ==
130− %+ turn blockers
131− |=(syd=desk (report-vat prep our now syd verb))
132− ::
133− %- zing
134− %+ turn
135− ?+ filt !!
136− %exists
137− %+ skip deks
138− |= [syd=desk *]
23+ desks=(set desk)
139− ?~ got=(~(get by cone.prep) our syd)
24+ =pikes
140− &
25+ =rock:tire:clay
141− =(0 let.u.got)
26+ kel=weft
142− ::
143− %running
144− %+ skim deks
145− |=([* [zest=@tas *]] =(zest %live))
146− ::
147− %suspended
148− %+ skip deks
149− |= [syd=@tas [zest=@tas *]]
150− ?| =(syd %kids)
151− =(zest %live)
152− ?~ got=(~(get by cone.prep) our syd)
153− &
154− =(0 let.u.got)
155 ==
27 ==
156− ::
28+ |_ [our=@p now=@da]
157− %exists-not
29+ +* ego (scot %p our)
158− %+ skim deks
30+ wen (scot %da now)
159− |= [syd=desk *]
31+ ++ $
160− ?~ got=(~(get by cone.prep) our syd)
32+ |= [? ? ? ? ?]
161− |
33+ (report-vats:abed +<)
162− =(0 let.u.got)
34+ ++ abed
35+ %= ..abed
36+ cone .^(^cone %cx /[ego]//[wen]/domes)
37+ sor .^((map desk [ship desk]) %gx /[ego]/hood/[wen]/kiln/sources/noun)
38+ zyn .^ (map [desk ship desk] sync-state) %gx
39+ /[ego]/hood/[wen]/kiln/syncs/noun
40+ ==
41+ desks .^((set desk) %cd /[ego]/base/[wen])
42+ pikes .^(^pikes %gx /[ego]/hood/[wen]/kiln/pikes/kiln-pikes)
43+ rock .^(rock:tire:clay %cx /[ego]//[wen]/tire)
44+ kel (weft .^(* cx/(en-beam [our %base da+now] /sys/kelvin)))
163 ==
45 ==
164− |=([syd=desk *] (report-vat prep our now syd verb))
46+ ++ vat-info
165−:: +report-vat: report on a single desk installation
47+ |= desk=_`desk`%base
166−::
48+ =/ pike (~(got by pikes) desk)
167−++ report-vat
49+ =/ zest -:(~(got by rock) desk)
168− |= $: $: tyr=rock:tire =cone sor=(map desk (pair ship desk))
50+ =/ kel-path /[ego]/[desk]/[wen]/sys/kelvin
169− zyn=(map [desk ship desk] sync-state)
51+ =/ sink=sink
52+ ?~ s=(~(get by sor) desk)
53+ ~
54+ ?~ z=(~(get by zyn) desk u.s)
55+ ~
56+ `[-.u.s +.u.s +.u.z]
57+ =/ hash .^(@uv %cz /[ego]/[desk]/[wen])
58+ =/ dek (~(got by rock) desk)
59+ =/ =dome (~(got by cone) our desk)
60+ =+ .^(=waft %cx kel-path)
61+ :* &1 &2 &3 &4 &5 &6 &7 &8
62+ desk=desk
63+ ^= running =(%live zest)
64+ ^= suspended =(%dead zest)
65+ ^= exists !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen])
66+ ^= bad-desk ?!(.^(? %cu kel-path))
67+ ^= meb :: =(list @uv)
68+ ?~ sink [hash]~
69+ (mergebase-hashes our desk now her.u.sink sud.u.sink)
70+ ^- [on=(list [@tas ?]) of=(list [@tas ?])]
71+ (skid ~(tap by ren.dome) |=([* ?] +<+))
72+ ^= sat
73+ ?- zest.dek
74+ %live "running"
75+ %dead "suspended"
76+ %held "suspended until next update"
170 ==
77 ==
171− our=ship now=@da syd=desk verb=?
78+ ^- kul=tape
172− ==
79+ %+ roll
173− |^ ^- tang
80+ %+ sort
174− =/ ego (scot %p our)
81+ ~(tap in (waft-to-wefts:clay waft))
175− =/ wen (scot %da now)
82+ |= [a=weft b=weft]
176− ?. ((sane %tas) syd)
83+ ?: =(lal.a lal.b)
177− ~[(cat 3 'insane desk: %' syd)]
84+ (lte num.a num.b)
178− ?. (~(has by cone) our syd)
85+ (lte lal.a lal.b)
179− ~[(cat 3 'desk does not yet exist: %' syd)]
86+ |= [=weft =tape]
180− =/ hash .^(@uv %cz /[ego]/[syd]/[wen])
87+ (welp " {<[lal num]:weft>}" tape)
181− ?: =(%kids syd)
88+ ^= blocking
182− ~[(cat 3 '%kids %cz hash: ' (scot %uv hash))]
89+ ?& !=(%base desk)
183− =/ kel-path /[ego]/[syd]/[wen]/sys/kelvin
90+ !=(%live zest.pike)
184− ?. .^(? %cu kel-path)
91+ !(~(has in wic.pike) kel)
185− ~[(cat 3 'bad desk: %' syd)]
92+ == ==
186− =+ .^(=waft %cx kel-path)
93+ ++ report-vats
187− ^- tang
94+ |= $: verb=?
188− =/ =sink
95+ show-suspended=?
189− ?~ s=(~(get by sor) syd)
96+ show-running=?
190− ~
97+ show-blocking=?
191− ?~ z=(~(get by zyn) syd u.s)
98+ show-nonexistent=?
192− ~
99+ ==
193− `[p.u.s q.u.s [kid let]:u.z]
194− =/ meb=(list @uv)
195− ?~ sink ~[hash]
196 %+ turn
100 %+ turn
197− .^ (list tako) %cs
101+ %+ skim
198− /[ego]/[syd]/[wen]/base/(scot %p her.u.sink)/[sud.u.sink]
102+ %+ turn ~(tap in desks)
103+ |= =desk (vat-info desk)
104+ |= vat-info
105+ :: just unconditionally show "bad" desks, whatever that means
106+ ?| bad-desk
107+ &(suspended show-suspended)
108+ &(running show-running)
109+ &(blocking show-blocking)
110+ &(!exists show-nonexistent)
199 ==
111 ==
200− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
112+ |= =vat-info
201− =/ dek (~(got by tyr) syd)
113+ :+ %rose [" " " " "::"]
202− =/ sat
114+ :- leaf+"{<desk.vat-info>}"
203− ?- zest.dek
115+ %- flop
204− %live 'running'
116+ %- report-vat
205− %dead 'suspended'
117+ [verb vat-info]
206− %held 'suspended until next update'
118+ ++ report-vat
119+ |= [verb=? vat-info]
120+ ^- tang
121+ ?: !exists
122+ ~[leaf+"desk does not yet exist: {<desk>}"]
123+ ?: =(%kids desk)
124+ ~[leaf+"%kids %cz hash: {<hash>}"]
125+ ?: bad-desk
126+ ~[leaf+"bad desk: {<desk>}"]
127+ %- flop
128+ ?. verb
129+ :~ leaf/"/sys/kelvin: {kul}"
130+ leaf/"app status: {sat}"
131+ leaf/"publishing ship: {?~(sink <~> <(get-publisher our desk now)>)}"
132+ leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
207− ==
133+ ==
208− =/ kul=cord (print-wefts (waft-to-wefts waft))
134+ :~ leaf/"/sys/kelvin: {kul}"
209− =/ ese=cord
135+ leaf/"base hash: {?.(=(1 (lent meb)) <meb> <(head meb)>)}"
210− ?:(.^(? %cx /[ego]//[wen]/esse/[syd]) 'yes' 'no')
136+ leaf/"%cz hash: {<hash>}"
211− =/ pax=path /(scot %p our)/[syd]/(scot %da now)
212− ?. verb
213− :~ '::'
137+ ::
214− =+ .^(exist=? cu+(weld pax /desk/bill))
138+ leaf/"app status: {sat}"
215− ?. exist ' /desk/bill: missing'
139+ leaf/"force on: {?:(=(~ on) "~" <on>)}"
216− =+ .^(dudes=(list dude:gall) cx+(weld pax /desk/bill))
140+ leaf/"force off: {?:(=(~ of) "~" <of>)}"
217− (cat 3 ' /desk/bill: ' (crip "{<dudes>}"))
141+ ::
218− (cat 3 ' pending updates: ' (print-wefts wic.dek))
142+ leaf/"publishing ship: {?~(sink <~> <(get-publisher our desk now)>)}"
143+ leaf/"updates: {?~(sink "local" "remote")}"
219− (cat 3 ' source ship: ' ?~(sink '~' (scot %p her.u.sink)))
144+ leaf/"source ship: {?~(sink <~> <her.u.sink>)}"
220− (cat 3 ' app status: ' sat)
145+ leaf/"source desk: {?~(sink <~> <sud.u.sink>)}"
221− (cat 3 ' essential desk: ' ese)
146+ leaf/"source aeon: {?~(sink <~> <let.u.sink>)}"
222− (cat 3 ' %cz hash ends in: ' (print-shorthash hash))
147+ leaf/"kids desk: {?~(sink <~> ?~(kid.u.sink <~> <u.kid.u.sink>))}"
223− (cat 3 ' /sys/kelvin: ' (print-wefts (waft-to-wefts waft)))
148+ leaf/"pending updates: {<`(list [@tas @ud])`~(tap in wic.dek)>}"
224− (cat 3 '%' syd)
225 ==
149 ==
226− ::
150+ ++ report-kids
227− =/ [on=(list @tas) of=(list @tas)]
151+ ^- tank
228− =/ [on=(list @tas) of=(list @tas)]
152+ ?. (~(has in .^((set desk) %cd /[ego]//[wen])) %kids)
229− %- ~(rep by ren:(~(got by cone) our syd))
153+ leaf/"no %kids desk"
230− |= [[=dude:gall is-on=?] on=(list @tas) of=(list @tas)]
231− ?: is-on
232− [[dude on] of]
233− [on [dude of]]
234− [(sort on aor) (sort of aor)]
235− :~ '::'
236− (cat 3 ' pending updates: ' (print-wefts wic.dek))
237− %^ cat 3 ' kids desk: ' ?~ sink '~'
238− ?~ kid.u.sink '~'
239− (cat 3 '%' u.kid.u.sink)
240− (cat 3 ' source aeon: ' ?~(sink '~' (scot %ud let.u.sink)))
241− (cat 3 ' source desk: ' ?~(sink '~' (cat 3 '%' sud.u.sink)))
242− (cat 3 ' source ship: ' ?~(sink '~' (scot %p her.u.sink)))
243− (cat 3 ' updates: ' ?~(sink 'local' 'remote'))
244− %^ cat 3 ' publishing ship: ' ?~ got=(get-publisher our syd now)
245− '~'
246− (scot %p u.got)
247− ::
248− (cat 3 ' force off: ' (print-agents of))
249− (cat 3 ' force on: ' (print-agents on))
250− (cat 3 ' app status: ' sat)
251− (cat 3 ' essential desk: ' ese)
252− ::
253− (cat 3 ' %cz hash: ' (scot %uv hash))
254− (cat 3 ' base hash: ' (print-mergebases meb))
255− (cat 3 ' /sys/kelvin: ' (print-wefts (waft-to-wefts waft)))
256− (cat 3 '%' syd)
257− ==
258− ++ print-wefts
259− |= wefts=(set weft)
260− ^- @t
261− ?: =(~ wefts)
262− '~'
263− %+ roll (sort ~(tap in wefts) aor)
264− |= [=weft out=@t]
265− ?: =('' out)
266− (rap 3 '[%' lal.weft ' ' (scot %ud num.weft) ']' ~)
267− (rap 3 out ' [%' lal.weft ' ' (scot %ud num.weft) ']' ~)
268− ::
269− ++ print-shorthash
270− |= hash=@uv
271− ^- @t
272− (crip ((v-co:co 5) (end [0 25] hash)))
273− ::
274− ++ print-mergebases
275− |= hashes=(list @uv)
276− ^- @t
277− ?~ hashes
278− '~'
279− ?~ t.hashes
280− (scot %uv i.hashes)
281− %+ roll `(list @uv)`hashes
282− |= [hash=@uv out=@t]
154+ =+ .^(hash=@uv %cz /[ego]/kids/[wen])
283− ?: =('' out)
155+ leaf/"%kids %cz hash: {<hash>}"
284− (print-shorthash hash)
285− (rap 3 out ' ' (print-shorthash hash) ~)
286− ::
287− ++ print-agents
288− |= agents=(list @tas)
289− ^- @t
290− ?~ agents
291− '~'
292− %+ roll `(list @tas)`agents
293− |= [agent=@tas out=@tas]
294− ?: =('' out)
295− (cat 3 '%' agent)
296− (rap 3 out ' %' agent ~)
297 --
156 --
298−:: +report-kids: non-vat cz hash report for kids desk
299−::
300−++ report-kids
301− |= [our=ship now=@da]
302− ^- tank
303− =/ syd %kids
304− =/ ego (scot %p our)
305− =/ wen (scot %da now)
306− ?. (~(has in .^((set desk) %cd /[ego]//[wen])) syd)
307− 'no %kids desk'
308− =+ .^(hash=@uv %cz /[ego]/[syd]/[wen])
309− (cat 3 '%kids %cz hash: ' (scot %uv hash))
310:: +read-bill-foreign: read /desk/bill from a foreign desk
157:: +read-bill-foreign: read /desk/bill from a foreign desk
311::
158::
312++ read-bill-foreign
159++ read-bill-foreign
@@ -359,15 +206,15 @@
359 |= [our=ship =desk now=@da]
206 |= [our=ship =desk now=@da]
360 ^- (list [=dude live=?])
207 ^- (list [=dude live=?])
361 %~ tap in
208 %~ tap in
362− .^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now)/$)
209+ .^((set [=dude live=?]) ge+/(scot %p our)/[desk]/(scot %da now))
363::
210::
364++ mergebase-hashes
211++ mergebase-hashes
365 |= [our=@p syd=desk now=@da her=ship sud=desk]
212 |= [our=@p syd=desk now=@da her=ship sud=desk]
366 =/ her (scot %p her)
213 =/ her (scot %p her)
367 =/ ego (scot %p our)
214 =/ ego (scot %p our)
368 =/ wen (scot %da now)
215 =/ wen (scot %da now)
369− %+ turn .^((list tako) %cs /[ego]/[syd]/[wen]/base/[her]/[sud])
216+ %+ turn .^((list tako) %cs ~[ego syd wen %base her sud])
370− |=(=tako .^(@uv %cs /[ego]/[syd]/[wen]/hash/(scot %uv tako)))
217+ |=(=tako .^(@uv %cs ~[ego syd wen %hash (scot %uv tako)]))
371::
218::
372++ enjs
219++ enjs
373 =, enjs:format
220 =, enjs:format
base-desk/sur/ring.hoon+1−1
@@ -15,7 +15,7 @@
15 :: resistance...but if your private keys are compromised, your
15 :: resistance...but if your private keys are compromised, your
16 :: adversary can determine which signatures you made.
16 :: adversary can determine which signatures you made.
17 ::
17 ::
18− y=(unit @uxpoint)
18+ y=(unit @udpoint)
19 ==
19 ==
20:: +ring-signature: higher level ring signature type
20:: +ring-signature: higher level ring signature type
21::
21::
base-desk/sur/spider.hoon+1−7
@@ -1,7 +1,7 @@
1/+ libstrand=strand
1/+ libstrand=strand
2=, strand=strand:libstrand
2=, strand=strand:libstrand
3|%
3|%
4−+$ thread $-(vase shed:khan)
4++$ thread $-(vase _*form:(strand ,vase))
5+$ input [=tid =cage]
5+$ input [=tid =cage]
6+$ tid tid:strand
6+$ tid tid:strand
7+$ bowl bowl:strand
7+$ bowl bowl:strand
@@ -18,10 +18,4 @@
18 file=term
18 file=term
19 =vase
19 =vase
20 ==
20 ==
21−+$ inline-args
22− $: parent=(unit tid)
23− use=(unit tid)
24− =beak
25− =shed:khan
26− ==
27--
21--
base-desk/sur/sss.hoon+8−4
@@ -10,21 +10,25 @@
10 --
10 --
11+$ aeon @ud
11+$ aeon @ud
12+$ dude dude:agent:gall
12+$ dude dude:agent:gall
13++$ what ?(%rock %wave)
13++ poke
14++ poke
14 |%
15 |%
15 ++ request
16 ++ request
16 |* paths=mold
17 |* paths=mold
17 $: path=paths
18 $: path=paths
18 =dude
19 =dude
20+ when=(unit aeon)
19 ==
21 ==
20 ++ response
22 ++ response
21 |* [=(lake) paths=mold]
23 |* [=(lake) paths=mold]
22 $: path=paths
24 $: path=paths
23 =dude
25 =dude
24− $% [what=%tomb ~]
26+ =aeon
27+ $% [type=?(%nigh %yore %tomb) ~]
28+ $: type=%scry
25− [what=%rock =aeon =rock:lake]
29+ $% [what=%rock =rock:lake]
26− [what=%wave =aeon =wave:lake]
30+ [what=%wave =wave:lake]
27− == ==
31+ == == == ==
28 ++ on-rock
32 ++ on-rock
29 |* [=(lake) paths=mold]
33 |* [=(lake) paths=mold]
30 $: path=paths
34 $: path=paths
base-desk/sur/verb.hoon+1−37
@@ -9,40 +9,4 @@
9 [%on-arvo =wire vane=term sign=term]
9 [%on-arvo =wire vane=term sign=term]
10 [%on-fail =term]
10 [%on-fail =term]
11 ==
11 ==
12−::
13−+$ event-plus
14− $: act=@ud
15− now=@da
16− src=@p
17− sap=path
18− =cause
19− effects=(list effect)
20− ==
21−::
22−+$ cause
23− $% [%on-init ~]
24− [%on-load ~]
25− [%on-poke =mark mug=@ux]
26− [%on-watch =path]
27− [%on-leave =path]
28− [%on-agent =wire =sign]
29− [%on-arvo =wire vane=term sign=term]
30− [%on-fail =term]
31− ==
32−::
33−+$ sign
34− $% [%poke-ack ack=?]
35− [%watch-ack ack=?]
36− [%kick ~]
37− [%fact =mark mug=@ux]
38− ==
39−::
40−+$ effect
41− $% [%poke =wire =gill:gall =mark mug=@ux]
42− [%watch =wire =gill:gall =path]
43− [%leave =wire =gill:gall]
44− [%fact paths=(list path) =mark mug=@ux]
45− [%kick paths=(list path)]
46− [%arvo =wire vane=term task=term]
47− ==
48−--
12+--
bin/make_glob.pydeleted−208
@@ -1,208 +0,0 @@
1−#!/usr/bin/env python3
2−
3−import hashlib
4−import sys
5−from pathlib import Path
6−from urllib.parse import quote
7−
8−from noun import Cell, deep, intbytes, mug
9−
10−MIME_TYPES = {
11− "css": "text/css",
12− "gif": "image/gif",
13− "html": "text/html",
14− "ico": "image/x-icon",
15− "jpeg": "image/jpeg",
16− "jpg": "image/jpeg",
17− "js": "application/javascript",
18− "json": "application/json",
19− "png": "image/png",
20− "svg": "image/svg+xml",
21− "ttf": "font/ttf",
22− "webmanifest": "application/manifest+json",
23− "woff": "font/woff",
24− "woff2": "font/woff2",
25−}
26−BASE32 = "0123456789abcdefghijklmnopqrstuv"
27−
28−
29−class BitWriter:
30− def __init__(self):
31− self.output = bytearray()
32− self.buffer = 0
33− self.used = 0
34− self.cursor = 0
35−
36− def write(self, value, count):
37− if count == 0:
38− return
39− self.buffer |= value << self.used
40− self.used += count
41− self.cursor += count
42− byte_count = self.used // 8
43− if byte_count:
44− self.output.extend(self.buffer.to_bytes((self.used + 7) // 8, "little")[:byte_count])
45− self.buffer >>= byte_count * 8
46− self.used -= byte_count * 8
47−
48− def finish(self):
49− if self.used:
50− self.output.append(self.buffer)
51− self.buffer = 0
52− self.used = 0
53− return bytes(self.output)
54−
55−
56−def jam_bytes(value):
57− writer = BitWriter()
58− references = {}
59−
60− def save(noun):
61− references[noun] = writer.cursor
62−
63− def mat(atom):
64− if atom == 0:
65− writer.write(1, 1)
66− return
67− atom_length = atom.bit_length()
68− length_size = atom_length.bit_length()
69− writer.write(1 << length_size, length_size + 1)
70− writer.write(atom_length & ((1 << (length_size - 1)) - 1), length_size - 1)
71− writer.write(atom, atom_length)
72−
73− def back(reference):
74− writer.write(3, 2)
75− mat(reference)
76−
77− def serialize(noun):
78− duplicate = references.get(noun)
79− if deep(noun):
80− if duplicate is not None:
81− back(duplicate)
82− return
83− save(noun)
84− writer.write(1, 1)
85− writer.write(0, 1)
86− serialize(noun.head)
87− serialize(noun.tail)
88− return
89− if duplicate is not None:
90− atom_size = noun.bit_length()
91− reference_size = duplicate.bit_length()
92− if atom_size >= reference_size:
93− back(duplicate)
94− return
95− save(noun)
96− writer.write(0, 1)
97− mat(noun)
98−
99− serialize(value)
100− return writer.finish()
101−
102−
103−def cord(value):
104− return int.from_bytes(value.encode(), "little")
105−
106−
107−def path_noun(parts):
108− result = 0
109− for part in reversed(parts):
110− result = Cell(cord(part), result)
111− return result
112−
113−
114−def dor(a, b):
115− if a == b:
116− return True
117− if deep(a):
118− if not deep(b):
119− return False
120− if a.head == b.head:
121− return dor(a.tail, b.tail)
122− return dor(a.head, b.head)
123− if deep(b):
124− return True
125− return a < b
126−
127−
128−def gor(a, b):
129− a_mug = mug(a)
130− b_mug = mug(b)
131− return dor(a, b) if a_mug == b_mug else a_mug < b_mug
132−
133−
134−def map_put(tree, entry):
135− if tree == 0:
136− return Cell(entry, Cell(0, 0))
137− node = tree.head
138− if entry.head == node.head:
139− return Cell(entry, tree.tail)
140− left = tree.tail.head
141− right = tree.tail.tail
142− if gor(entry.head, node.head):
143− return Cell(node, Cell(map_put(left, entry), right))
144− return Cell(node, Cell(left, map_put(right, entry)))
145−
146−
147−def shas(salt, serialized):
148− value_hash = int.from_bytes(hashlib.sha256(serialized).digest(), "little")
149− length = max(32, len(intbytes(salt)))
150− digest = hashlib.sha256((salt ^ value_hash).to_bytes(length, "little")).digest()
151− return int.from_bytes(digest, "little")
152−
153−
154−def sham(serialized):
155− hashed = shas(cord("sham"), serialized)
156− mask = (1 << 128) - 1
157− return (hashed & mask) ^ (hashed >> 128)
158−
159−
160−def scow_uv(value):
161− if value == 0:
162− return "0v0"
163− digits = []
164− while value:
165− value, digit = divmod(value, 32)
166− digits.append(BASE32[digit])
167− digits = "".join(reversed(digits))
168− first_length = (len(digits) - 1) % 5 + 1
169− groups = [digits[:first_length]]
170− groups.extend(digits[i:i + 5] for i in range(first_length, len(digits), 5))
171− return "0v" + ".".join(groups)
172−
173−
174−def file_entry(root, file_path):
175− relative = file_path.relative_to(root)
176− parts = []
177− for part in relative.parts:
178− parts.extend(quote(segment, safe="-_~") for segment in part.split("."))
179− extension = relative.suffix.removeprefix(".").lower()
180− if extension not in MIME_TYPES:
181− raise ValueError(f"no MIME type configured for {relative}")
182− data = file_path.read_bytes()
183− mime = Cell(path_noun(MIME_TYPES[extension].split("/")), Cell(len(data), int.from_bytes(data, "little")))
184− return Cell(path_noun(parts), mime)
185−
186−
187−def make_glob(source, destination):
188− root = Path(source)
189− files = sorted((path for path in root.rglob("*") if path.is_file()), key=lambda path: path.as_posix())
190− if not (root / "index.html").is_file():
191− raise ValueError("glob source must contain index.html")
192− glob = 0
193− for file_path in files:
194− glob = map_put(glob, file_entry(root, file_path))
195− serialized = jam_bytes(glob)
196− glob_hash = scow_uv(sham(serialized))
197− output = Path(destination)
198− output.mkdir(parents=True, exist_ok=True)
199− filename = f"glob-{glob_hash}.glob"
200− (output / filename).write_bytes(serialized)
201− (output / "hash").write_text(glob_hash + "\n")
202− print(filename)
203−
204−
205−if __name__ == "__main__":
206− if len(sys.argv) != 3:
207− raise SystemExit(f"usage: {sys.argv[0]} SOURCE_DIRECTORY OUTPUT_DIRECTORY")
208− make_glob(sys.argv[1], sys.argv[2])
desk/app/astrolabe.hoon−8
@@ -20,7 +20,6 @@
20 :_ this
20 :_ this
21 :~ ug-handler-card:hc
21 :~ ug-handler-card:hc
22 groups-link-patch-card:hc
22 groups-link-patch-card:hc
23− talk-link-patch-card:hc
24 az-events-card:hc
23 az-events-card:hc
25 ==
24 ==
26::
25::
@@ -36,7 +35,6 @@
36 =/ cards=(list card)
35 =/ cards=(list card)
37 :~ ug-handler-card:hc
36 :~ ug-handler-card:hc
38 groups-link-patch-card:hc
37 groups-link-patch-card:hc
39− talk-link-patch-card:hc
40 ==
38 ==
41 =. cards (weld cards-01 cards)
39 =. cards (weld cards-01 cards)
42 [cards this(state new)]
40 [cards this(state new)]
@@ -324,12 +322,6 @@
324 =/ patch [/apps/groups catch hatch groups-link-thatch]
322 =/ patch [/apps/groups catch hatch groups-link-thatch]
325 =/ patch-kit-vase !>([/groups/astrolabe/link patch])
323 =/ patch-kit-vase !>([/groups/astrolabe/link patch])
326 [%pass /monkey/patch/groups/link %agent [our.bowl %monkey] %poke [%patch patch-kit-vase]]
324 [%pass /monkey/patch/groups/link %agent [our.bowl %monkey] %poke [%patch patch-kit-vase]]
327−++ talk-link-patch-card
328− =/ catch [%cord '/apps/talk/desk.js']
329− =/ hatch [%before "."]
330− =/ patch [/apps/talk catch hatch groups-link-thatch]
331− =/ patch-kit-vase !>([/talk/astrolabe/link patch])
332− [%pass /monkey/patch/talk/link %agent [our.bowl %monkey] %poke [%patch patch-kit-vase]]
333::
325::
334++ read-doc
326++ read-doc
335 |= =path
327 |= =path
desk/desk.docket-0+1−1
@@ -4,7 +4,7 @@
4 image+'https://raw.githubusercontent.com/johnhyde/astrolabe/main/ui/src/assets/astrolabe-tile.svg'
4 image+'https://raw.githubusercontent.com/johnhyde/astrolabe/main/ui/src/assets/astrolabe-tile.svg'
5 glob-http+['https://s3.us-east-2.amazonaws.com/warkgnall.com/urbit/astrolabe/globs/glob-0v4.88rt1.guqn5.nnatp.lca68.ej9aj.glob' 0v4.88rt1.guqn5.nnatp.lca68.ej9aj]
5 glob-http+['https://s3.us-east-2.amazonaws.com/warkgnall.com/urbit/astrolabe/globs/glob-0v4.88rt1.guqn5.nnatp.lca68.ej9aj.glob' 0v4.88rt1.guqn5.nnatp.lca68.ej9aj]
6 base+'astrolabe'
6 base+'astrolabe'
7− version+[1 0 7]
7+ version+[1 0 5]
8 website+'https://github.com/johnhyde/astrolabe'
8 website+'https://github.com/johnhyde/astrolabe'
9 license+'MIT'
9 license+'MIT'
10==
10==
desk/lib/astrolabe.hoon+6−12
@@ -207,27 +207,21 @@
207::
207::
208++ groups-link-thatch
208++ groups-link-thatch
209'''
209'''
210−const buttonText = 'View in Astrolabe';
211setInterval(() => {
210setInterval(() => {
212− const footer = document.querySelectorAll('section > div > footer')?.[0];
213− if (!footer) return;
214− if (footer.children[0].innerText === buttonText) return;
215 const spans = document.querySelectorAll('section > div > div > div > span > span:first-child');
211 const spans = document.querySelectorAll('section > div > div > div > span > span:first-child');
216 spans.forEach((span) => {
212 spans.forEach((span) => {
217 if (span.innerHTML !== '~') return;
213 if (span.innerHTML !== '~') return;
218− if (footer.children[0].innerText === buttonText) return;
219 let cspan = span.parentElement;
214 let cspan = span.parentElement;
215+ if (cspan.nextSibling) return;
216+ let c = cspan.parentElement;
220 let patp = cspan.innerText;
217 let patp = cspan.innerText;
221 let b = document.createElement('a');
218 let b = document.createElement('a');
222− b.innerHTML = buttonText;
219+ b.innerHTML = "View in Astrolabe";
223− b.className = 'button';
220+ b.className = 'button ml-4';
224− // b.href = 'web+urbitgraph://astrolabe/ship/' + patp;
221+ b.href = 'web+urbitgraph://astrolabe/ship/' + patp;
225− b.href = '/apps/astrolabe/#/ship/' + patp;
226 b.target = '_blank';
222 b.target = '_blank';
227 b.style.backgroundColor = "navy";
223 b.style.backgroundColor = "navy";
228− b.style.marginLeft = "1rem";
224+ c.appendChild(b);
229− b.style.color = "white";
230− footer.prepend(b);
231 });
225 });
232}, 100);
226}, 100);
233'''
227'''
desk/sys.kelvin+1−1
@@ -1 +1 @@
1−[%zuse 408]
1+[%zuse 414]
flake.lockdeleted−27
@@ -1,27 +0,0 @@
1−{
2− "nodes": {
3− "nixpkgs": {
4− "locked": {
5− "lastModified": 1793341285,
6− "narHash": "sha256-Y1CiZ4SoBUjLQyQM/pY+rS2dXD3CHLPstF0lmOc73D4=",
7− "owner": "NixOS",
8− "repo": "nixpkgs",
9− "rev": "1c89083e451e891152365b799595cf7790a43325",
10− "type": "github"
11− },
12− "original": {
13− "owner": "NixOS",
14− "ref": "nixos-unstable",
15− "repo": "nixpkgs",
16− "type": "github"
17− }
18− },
19− "root": {
20− "inputs": {
21− "nixpkgs": "nixpkgs"
22− }
23− }
24− },
25− "root": "root",
26− "version": 7
27−}
flake.nixdeleted−73
@@ -1,73 +0,0 @@
1−{
2− description = "Astrolabe Urbit desk";
3−
4− inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5−
6− outputs = { self, nixpkgs }:
7− let
8− systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
9− forAllSystems = nixpkgs.lib.genAttrs systems;
10− in
11− {
12− packages = forAllSystems (system:
13− let
14− pkgs = import nixpkgs { inherit system; };
15− nounPy = pkgs.fetchurl {
16− name = "noun.py";
17− url = "https://raw.githubusercontent.com/urbit/tools/f9cda82a7699cad0c1c0f8c031a59e93f028e548/pkg/pynoun/noun.py";
18− hash = "sha256-vSKQ/UuSmGTANfW5c3I9lQcUFycvqmu5gqysFuP5SAA=";
19− };
20− ui = pkgs.buildNpmPackage {
21− pname = "astrolabe-ui";
22− version = "0.3.0";
23− src = ./ui;
24− nodejs = pkgs.nodejs_22;
25− npmDepsHash = "sha256-jCkfgNgBmq0mKjmXBbPwdpzBR/E09OgS9XD6O9hRHfw=";
26− makeCacheWritable = true;
27− npmFlags = [ "--legacy-peer-deps" ];
28− npmBuildScript = "build";
29−
30− installPhase = ''
31− runHook preInstall
32− cp -r dist $out
33− runHook postInstall
34− '';
35− };
36− in
37− rec {
38− inherit ui;
39− desk = pkgs.stdenvNoCC.mkDerivation {
40− pname = "astrolabe-desk";
41− version = "1.0.7";
42− dontUnpack = true;
43− nativeBuildInputs = [ pkgs.rsync ];
44−
45− installPhase = ''
46− runHook preInstall
47− mkdir -p $out
48− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./base-desk}/ $out/
49− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./docs-dev-desk}/ $out/
50− rsync -r --copy-links --exclude-from=${./config/ignore_files_on_install.txt} ${./desk}/ $out/
51− runHook postInstall
52− '';
53− };
54− glob = pkgs.stdenvNoCC.mkDerivation {
55− pname = "astrolabe-glob";
56− version = "0.3.0";
57− dontUnpack = true;
58− nativeBuildInputs = [
59− (pkgs.python3.withPackages (ps: [ ps.mmh3 ps.bitstring ]))
60− ];
61−
62− installPhase = ''
63− runHook preInstall
64− mkdir -p $TMPDIR/pynoun
65− ln -s ${nounPy} $TMPDIR/pynoun/noun.py
66− PYTHONPATH=$TMPDIR/pynoun python ${./bin/make_glob.py} ${ui} $out
67− runHook postInstall
68− '';
69− };
70− default = desk;
71− });
72− };
73−}
ui/package-lock.json+1−1
@@ -3156,7 +3156,7 @@
3156 },
3156 },
3157 "@johnhyde/sigil-js": {
3157 "@johnhyde/sigil-js": {
3158 "version": "git+ssh://git@github.com/johnhyde/sigil-js.git#f89ce78c34b5811ea19ddea4a6964ea8360e7b4d",
3158 "version": "git+ssh://git@github.com/johnhyde/sigil-js.git#f89ce78c34b5811ea19ddea4a6964ea8360e7b4d",
3159− "from": "@johnhyde/sigil-js@github:johnhyde/sigil-js",
3159+ "from": "@johnhyde/sigil-js@git+ssh://git@github.com:johnhyde/sigil-js.git",
3160 "requires": {
3160 "requires": {
3161 "invariant": "^2.2.4",
3161 "invariant": "^2.2.4",
3162 "svgson": "^4.0.0",
3162 "svgson": "^4.0.0",
ui/vite.config.ts+1−1
@@ -7,7 +7,7 @@ import path from 'path';
7export default ({ mode }) => {
7export default ({ mode }) => {
8 Object.assign(process.env, loadEnv(mode, process.cwd()));
8 Object.assign(process.env, loadEnv(mode, process.cwd()));
9 const SHIP_URL = process.env.SHIP_URL || process.env.VITE_SHIP_URL || 'http://localhost:8080';
9 const SHIP_URL = process.env.SHIP_URL || process.env.VITE_SHIP_URL || 'http://localhost:8080';
10− console.log('SHIP_URL', SHIP_URL);
10+ console.log(SHIP_URL);
11
11
12 return defineConfig({
12 return defineConfig({
13 plugins: [
13 plugins: [