on main help sign in
upgrade to 412
7f41c41John Hyde
base-desk/lib/azimuthio.hoon+3−3
@@ -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-octt:mimes:html
46+ %- some %- as-octs: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/ethereum.hoon+9−3
@@ -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-octt (en-json:html jon)))
655+ (some (as-octs (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-octt (en-json:html jon)))
668+ (some (as-octs (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 bon.req))
736+ :~ (tape (num-to-hex-minimal bon.req))
737 b+txs.req
737 b+txs.req
738 ==
738 ==
739 ::
739 ::
@@ -942,6 +942,12 @@
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+::
945++ address-to-hex
951++ address-to-hex
946 |= a=address
952 |= a=address
947 ^- tape
953 ^- 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-octt:mimes:html
79+ %- some %- as-octs: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/noun-diff.hoonnew file+213
@@ -0,0 +1,213 @@
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/util.hoon+4−4
@@ -28,8 +28,8 @@
28 %+ send-events-to who
28 %+ send-events-to who
29 ^- (list unix-event)
29 ^- (list unix-event)
30 :~
30 :~
31− [/d/term/1 %belt %ctl `@c`%e]
31+ [/d/term/1 %belt %mod %ctl `@c`%e]
32− [/d/term/1 %belt %ctl `@c`%u]
32+ [/d/term/1 %belt %mod %ctl `@c`%u]
33 [/d/term/1 %belt %txt ((list @c) what)]
33 [/d/term/1 %belt %txt ((list @c) what)]
34 [/d/term/1 %belt %ret ~]
34 [/d/term/1 %belt %ret ~]
35 ==
35 ==
@@ -40,7 +40,7 @@
40 |= [who=ship what=term]
40 |= [who=ship what=term]
41 ^- (list ph-event)
41 ^- (list ph-event)
42 %+ send-events-to who
42 %+ send-events-to who
43− :~ [/d/term/1 %belt %ctl (,@c what)]
43+ :~ [/d/term/1 %belt %mod %ctl (,@c what)]
44 ==
44 ==
45::
45::
46:: Inject a file into a ship
46:: Inject a file into a ship
@@ -67,7 +67,7 @@
67 ::
67 ::
68 %+ lien p.q.uf
68 %+ lien p.q.uf
69 |= =blit:dill
69 |= =blit:dill
70− ?. ?=(%lin -.blit)
70+ ?. ?=(%put -.blit)
71 |
71 |
72 !=(~ (find what p.blit))
72 !=(~ (find what p.blit))
73 ==
73 ==
base-desk/lib/pill.hoon+9−4
@@ -206,19 +206,24 @@
206 |= [ovo=ovum ken=*]
206 |= [ovo=ovum ken=*]
207 [~ (slum ken [now ovo])]
207 [~ (slum ken [now ovo])]
208 ::
208 ::
209− :: boot-two: startup formula
209+ :: kernel-formula
210 ::
210 ::
211 :: We evaluate :arvo-formula (for jet registration),
211 :: We evaluate :arvo-formula (for jet registration),
212 :: then ignore the result and produce .installed
212 :: then ignore the result and produce .installed
213 ::
213 ::
214+ =/ kernel-formula
215+ [%7 arvo-formula %1 installed]
216+ ::
217+ :: boot-two: startup formula
218+ ::
214 =/ boot-two
219 =/ boot-two
215− => *[arvo-formula=^ installed=^ tale=*]
220+ => *[kernel-formula=^ tale=*]
216− != =+(.*(0 arvo-formula) [installed tale])
221+ != [.*(0 kernel-formula) tale]
217 ::
222 ::
218 :: boot-ova
223 :: boot-ova
219 ::
224 ::
220 =/ boot-ova=(list)
225 =/ boot-ova=(list)
221− [aeon:eden:part boot-two arvo-formula installed ~]
226+ [aeon:eden:part boot-two kernel-formula ~]
222 ::
227 ::
223 :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
228 :: a pill is a 3-tuple of event-lists: [boot kernel userspace]
224 ::
229 ::
base-desk/lib/server.hoon+1−1
@@ -19,7 +19,7 @@
19++ json-to-octs
19++ json-to-octs
20 |= jon=json
20 |= jon=json
21 ^- octs
21 ^- octs
22− (as-octt:mimes:html (en-json:html jon))
22+ (as-octs:mimes:html (en:json:html jon))
23::
23::
24++ app
24++ app
25 |%
25 |%
base-desk/lib/shoe.hoon+9−7
@@ -413,23 +413,25 @@
413 =/ cobs=(list [wid=@ud (list tape)])
413 =/ cobs=(list [wid=@ud (list tape)])
414 (turn cows col-as-lines)
414 (turn cows col-as-lines)
415 =+ [lin=0 any=|]
415 =+ [lin=0 any=|]
416+ =+ len=(lent cobs)
416 =| fez=(list sole-effect)
417 =| fez=(list sole-effect)
417 |- ^+ fez
418 |- ^+ fez
418− =; out=tape
419+ =; [line=(list tape) end=@ud]
419 :: done when we're past the end of all columns
420 :: done when we're past the end of all columns
420 ::
421 ::
421− ?: (levy out (cury test ' '))
422+ ?: =(len end)
422 (flop fez)
423 (flop fez)
423 =; fec=sole-effect
424 =; fec=sole-effect
424 $(lin +(lin), fez [fec fez])
425 $(lin +(lin), fez [fec fez])
426+ =/ out=tape
427+ (zing (join " " line))
425 ?. bold txt+out
428 ?. bold txt+out
426 klr+[[`%br ~ ~]^[(crip out)]~]~
429 klr+[[`%br ~ ~]^[(crip out)]~]~
427− %+ roll cobs
430+ %^ spin cobs 0
428− |= [[wid=@ud lines=(list tape)] out=tape]
431+ |= [[wid=@ud lines=(list tape)] empty=@ud]
429− %+ weld out
430− %+ weld ?~(out "" " ")
431 =+ l=(swag [lin 1] lines)
432 =+ l=(swag [lin 1] lines)
433+ ?^ l [i.l empty]
432− ?^(l i.l (reap wid ' '))
434+ [(reap wid ' ') +(empty)]
433 ::
435 ::
434 ++ col-as-lines
436 ++ col-as-lines
435 |= [wid=@ud col=dime]
437 |= [wid=@ud col=dime]
base-desk/lib/sink.hoonnew file+26
@@ -0,0 +1,26 @@
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+168−108
@@ -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− [~ ~ [* %& * *]] [~[(scry `+(aeon.u.u.flow) which)] 0/sub]
64+ [~ ~ [* %& * *]] [~[(pine 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 current u.u.flow ~)]
98+ ~[(on-rock-poke fake=& current u.u.flow ~)]
99 ::
99 ::
100 [~ ~]
100 [~ ~]
101 :_ 0/(~(del by sub) current) :_ ~
101 :_ 0/(~(del by sub) current) :_ ~
@@ -105,77 +105,53 @@
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− ::
120 ++ apply :: Handle response from publisher.
108 ++ apply :: Handle response from publisher.
121 |= res=(response:poke lake paths)
109 |= res=(response:poke lake paths)
122 ^- (quip card:agent:gall subs)
110 ^- (quip card:agent:gall subs)
123− %- fall :_ `0/sub %- mole |.
124 =* current [src.bowl dude.res path.res]
111 =* current [src.bowl dude.res path.res]
125 =/ old=flow (fall (~(got by sub) current) *flow)
112 =/ old=flow (fall (~(got by sub) current) *flow)
126− ?- type.res
113+ ?: ?=(%tomb what.res)
127− %tomb
128 =/ =flow old(stale &)
114 =/ =flow old(stale &)
129 :_ 0/(~(put by sub) current `flow) :_ ~
115 :_ 0/(~(put by sub) current `flow) :_ ~
130− (on-rock-poke current flow ~)
116+ (on-rock-poke fake=& current flow ~)
131− ::
132− %yore
133− :_ 0/sub :_ ~
134− (pine src.bowl dude.res path.res)
135 ::
117 ::
136− %nigh
137− :_ 0/sub :_ ~
138− (behn-s25 [dude aeon path]:res)
139− ::
140− %scry
141− =/ [wave=(unit wave:lake) =flow]
118+ =/ [wave=(unit wave:lake) new=(unit flow)]
142− ?- what.res
119+ ?- what.res
143− %rock ?> (gte aeon.res aeon.old)
120+ %rock ?: (lte aeon.res aeon.old) [~ ~]
144− [~ [aeon.res | | rock.res]]
121+ [~ `[aeon.res | | rock.res]]
122+ %wave ?: (lte aeon.res aeon.old) [~ ~]
145− %wave ?> =(aeon.res +(aeon.old))
123+ ?> =(aeon.res +(aeon.old))
146− [`wave.res [aeon.res | | (wash:lake rock.old wave.res)]]
124+ [`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)
151 ==
125 ==
152− ==
126+ ?~ new `0/sub
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)]
153 ::
137 ::
154 :: Non-public facing arms below
138 :: Non-public facing arms below
155 ::
139 ::
156− ++ behn-s25
140+ ++ pine
157− |= [=dude =aeon path=noun]
141+ |= [who=ship which=dude where=paths]
158 ^- card:agent:gall
142 ^- 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
164− |= [when=(unit aeon) who=ship which=dude where=paths]
165− ^- card:agent:gall
166− =/ when ?~ when ~ (scot %ud u.when)
167− :* %pass (zoom scry-request/(scot %p who)^which^when^where)
143+ :* %pass (zoom scry-request/(scot %p who)^which^where)
168 %agent [who which]
144 %agent [who which]
169− %poke %sss-to-pub :- result-type ^- result
145+ %poke sss-to-pub/[result-type `result`[where dap.bowl]]
170− [where dap.bowl ^when]
171 ==
146 ==
172 ++ on-rock-poke
147 ++ on-rock-poke
173− |= [[=ship =dude path=paths] flow wave=(unit wave:lake)]
148+ |= [fake=? [=ship =dude path=paths] flow wave=(unit wave:lake)]
174 ^- card:agent:gall
149 ^- card:agent:gall
150+ :* %pass %+ zoom ?:(fake %fake %on-rock)
175− :* %pass (zoom on-rock/(scot %ud aeon)^(scot %p ship)^dude^path)
151+ (scot %ud aeon)^(scot %p ship)^dude^path
176 %agent [our dap]:bowl
152 %agent [our dap]:bowl
177− %poke %sss-on-rock on-rock-type ^- from
153+ %poke ?:(fake %sss-fake-on-rock %sss-on-rock)
178− [path ship dude stale fail rock wave]
154+ on-rock-type `from`[path ship dude stale fail rock wave]
179 ==
155 ==
180 --
156 --
181++ du :: Manage publications.
157++ du :: Manage publications.
@@ -184,28 +160,78 @@
184 |%
160 |%
185 +$ into (request:poke paths)
161 +$ into (request:poke paths)
186 +$ result (response:poke lake paths)
162 +$ result (response:poke lake paths)
163+ +$ rule $~ [`5 5]
187− +$ rule [rocks=_1 waves=_5] :: Retention policy
164+ [horizon=(unit @ud) frequency=@ud] :: Retention policy
188 +$ tide
165 +$ tide
189 $: rok=((mop aeon rock:lake) gte)
166 $: rok=((mop aeon rock:lake) gte)
190 wav=((mop aeon wave:lake) lte)
167 wav=((mop aeon wave:lake) lte)
191 rul=rule
168 rul=rule
192− mem=(mip ship dude @da)
169+ mem=(jug ship dude)
193 ==
170 ==
194 +$ buoy
171 +$ buoy
195 $: tid=$~(*tide $@(aeon tide))
172 $: tid=$~(*tide $@(aeon tide))
196 alo=(unit (set ship))
173 alo=(unit (set ship))
197 ==
174 ==
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
198− +$ pubs [%0 (map paths buoy)]
207+ =< $% [%0 (map paths buoy-0)]
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+ --
199 --
223 --
200− |= [pub=pubs =bowl:gall result-type=type]
224+ |= [pub=versioned:pubs =bowl:gall result-type=type]
201− => .(pub +.pub)
225+ => .(pub +:(update:pubs pub))
202 =* rok ((on aeon rock:lake) gte)
226 =* rok ((on aeon rock:lake) gte)
203 =* wav ((on aeon wave:lake) lte)
227 =* wav ((on aeon wave:lake) lte)
204 |%
228 |%
205 ++ rule :: Set new retention policy.
229 ++ rule :: Set new retention policy.
206 |= [path=paths =^rule]
230 |= [path=paths =^rule]
207 ^- pubs
231 ^- pubs
208− :- %0
232+ :- %1
233+ %- fall :_ (~(put by pub) path %*(. *$<(aeon buoy) rul.tid rule))
234+ %- mole |.
209 %+ ~(jab by pub) path
235 %+ ~(jab by pub) path
210 |= =buoy
236 |= =buoy
211 ?@ tid.buoy buoy
237 ?@ tid.buoy buoy
@@ -214,11 +240,11 @@
214 ++ wipe :: Create new rock and wipe rest.
240 ++ wipe :: Create new rock and wipe rest.
215 |= path=paths
241 |= path=paths
216 ^- pubs
242 ^- pubs
217− :- %0
243+ :- %1
218 %+ ~(jab by pub) path
244 %+ ~(jab by pub) path
219 |= =buoy
245 |= =buoy
220 ?@ tid.buoy buoy
246 ?@ tid.buoy buoy
221− %* . buoy(tid (form tid.buoy(rul [0 1])))
247+ %* . buoy(tid (form tid.buoy(rul [`0 1])))
222 rul.tid rul.tid.buoy
248 rul.tid rul.tid.buoy
223 wav.tid ~
249 wav.tid ~
224 ==
250 ==
@@ -232,29 +258,31 @@
232 ?> ?=(^ tid.buoy)
258 ?> ?=(^ tid.buoy)
233 =* tide tid.buoy
259 =* tide tid.buoy
234 =/ next=aeon +((latest tide))
260 =/ next=aeon +((latest tide))
261+ :- %- zing
235− :- %+ murn ~(tap bi mem.tide)
262+ %+ turn ~(tap by mem.tide)
236− |= [=ship =dude =@da]
263+ |= [=ship =(set dude)]
237− ?: (lth da now.bowl) ~
264+ %+ turn ~(tap in set)
265+ |= =dude
238− `(send scry/wave/wave ship dude next path)
266+ (send wave/[next wave] ship dude path)
239− :- %0
267+ :- %1
240 %+ ~(put by pub) path
268 %+ ~(put by pub) path
241 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
269 =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
242 =. wav.tide (put:wav wav.tide next wave)
270 =. wav.tide (put:wav wav.tide next wave)
243 =. mem.tide ~
271 =. mem.tide ~
244− ?. =(next (add aeon.last waves.rul.tide)) buoy
272+ ?. =(next (add aeon.last frequency.rul.tide)) buoy
245 buoy(tid (form tide))
273 buoy(tid (form tide))
246 ::
274 ::
247 ++ fork :: Fork a pub into an empty path.
275 ++ fork :: Fork a pub into an empty path.
248 |= [from=paths to=paths]
276 |= [from=paths to=paths]
249 ^- pubs
277 ^- pubs
250− :- %0
278+ :- %1
251 ?< (~(has by pub) to)
279 ?< (~(has by pub) to)
252 (~(put by pub) to (~(got by pub) from))
280 (~(put by pub) to (~(got by pub) from))
253 ::
281 ::
254 ++ copy :: Fork a sub into an empty path.
282 ++ copy :: Fork a sub into an empty path.
255 |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
283 |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
256 ^- pubs
284 ^- pubs
257− :- %0
285+ :- %1
258 ?< (~(has by pub) to)
286 ?< (~(has by pub) to)
259 %+ ~(put by pub) to
287 %+ ~(put by pub) to
260 %* . *$<(aeon buoy)
288 %* . *$<(aeon buoy)
@@ -263,7 +291,7 @@
263 ::
291 ::
264 ++ perm :: Change permissions with gate.
292 ++ perm :: Change permissions with gate.
265 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
293 |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
266− ^- pubs
294+ ^- (quip card:agent:gall pubs)
267 %+ edit where
295 %+ edit where
268 |= =buoy
296 |= =buoy
269 =/ new=_alo.buoy (diff alo.buoy)
297 =/ new=_alo.buoy (diff alo.buoy)
@@ -272,21 +300,21 @@
272 alo new
300 alo new
273 mem.tid ?~ new mem.tid.buoy
301 mem.tid ?~ new mem.tid.buoy
274 %. mem.tid.buoy
302 %. mem.tid.buoy
275− ~(int by (malt (turn ~(tap in u.new) (late *(map @ @)))))
303+ ~(int by (malt (turn ~(tap in u.new) (late *(set @)))))
276 ==
304 ==
277 ++ public (curr perm _~) :: Make list of paths public.
305 ++ public (curr perm _~) :: Make list of paths public.
278 ++ secret (curr perm _`~) :: Make list of paths secret.
306 ++ secret (curr perm _`~) :: Make list of paths secret.
279 :: :: Block ships from paths.
307 :: :: Block ships from paths.
280 ++ block :: No-ops on public paths.
308 ++ block :: No-ops on public paths.
281 |= [who=(list ship) whence=(list paths)]
309 |= [who=(list ship) whence=(list paths)]
282− ^- pubs
310+ ^- (quip card:agent:gall pubs)
283 %+ perm whence
311 %+ perm whence
284 |= old=(unit (set ship))
312 |= old=(unit (set ship))
285 ?~ old ~ `(~(dif in u.old) (sy who))
313 ?~ old ~ `(~(dif in u.old) (sy who))
286 :: :: Allow ships to paths.
314 :: :: Allow ships to paths.
287 ++ allow :: Any public paths will no-op.
315 ++ allow :: Any public paths will no-op.
288 |= [who=(list ship) where=(list paths)]
316 |= [who=(list ship) where=(list paths)]
289− ^- pubs
317+ ^- (quip card:agent:gall pubs)
290 %+ perm where
318 %+ perm where
291 |= old=(unit (set ship))
319 |= old=(unit (set ship))
292 ?~ old ~ `(~(gas in u.old) who)
320 ?~ old ~ `(~(gas in u.old) who)
@@ -313,37 +341,51 @@
313 =/ =buoy (~(gut by pub) path.req *buoy)
341 =/ =buoy (~(gut by pub) path.req *buoy)
314 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
342 ?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
315 ?@ tid.buoy
343 ?@ tid.buoy
316− :_ 0/pub :_ ~
344+ :_ 1/pub :_ ~
317− (send tomb/~ src.bowl dude.req tid.buoy path.req)
345+ (send tomb/~ src.bowl dude.req path.req)
318− ?~ when.req
346+ :_ 1/pub :_ ~
319− =/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
347+ =/ 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
320− :_ 0/pub :_ ~
358+ :_ 1/pub :_ ~
321− (send scry/rock/val.last src.bowl dude.req key.last path.req)
359+ (send tomb/~ src.bowl dude path)
360+ ::
361+ => .(aeon +((slav %ud aeon)))
322− ?^ dat=(get:wav wav.tid.buoy u.when.req)
362+ ?^ dat=(get:wav wav.tid.buoy aeon)
323− :_ 0/pub :_ ~
363+ :_ 1/pub :_ ~
324− (send scry/wave/u.dat src.bowl [dude u.when path]:req)
364+ (send wave/[aeon u.dat] src.bowl dude path)
325− ?: %+ lte u.when.req
365+ =/ last (fall (pry:rok rok.tid.buoy) [=key =val]:rok)
326− key::(fall (ram:wav wav.tid.buoy) (pry:rok rok.tid.buoy) [=key val]:wav)
366+ ?: (lte aeon key.last)
327− :_ 0/pub :_ ~
367+ :_ 1/pub :_ ~
328− (send yore/~ src.bowl [dude u.when path]:req)
368+ (send rock/last src.bowl dude path)
329− ?> =(u.when.req +((latest tid.buoy)))
369+ :- ~
330− :- ~[(send nigh/~ src.bowl [dude u.when path]:req)]
370+ :- %1
331− :- %0
332− %+ ~(put by pub) path.req
371+ %+ ~(put by pub) path
333 %= buoy
372 %= buoy
334− mem.tid (~(put bi mem.tid.buoy) src.bowl dude.req (add ~s25 now.bowl))
373+ mem.tid (~(put ju mem.tid.buoy) src.bowl dude)
335 ==
374 ==
336 ::
375 ::
337 :: Non-public facing arms below
376 :: Non-public facing arms below
338 ::
377 ::
339 ++ send
378 ++ send
340− |= [payload=_|3:*(response:poke lake paths) =ship =dude =aeon path=paths]
379+ |= [payload=_|2:*(response:poke lake paths) =ship =dude path=paths]
341 ^- card:agent:gall
380 ^- card:agent:gall
342 =* mark (cat 3 %sss- name:lake)
381 =* mark (cat 3 %sss- name:lake)
382+ =/ callback=^path
383+ ?: ?=(%tomb what.payload) (zoom tomb-response/(scot %p ship)^dude^path)
343− :* %pass (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon)^path)
384+ (zoom scry-response/(scot %p ship)^dude^(scot %ud aeon.payload)^path)
385+ :* %pass callback
344 %agent [ship dude]
386 %agent [ship dude]
345 %poke mark result-type ^- (response:poke lake paths)
387 %poke mark result-type ^- (response:poke lake paths)
346− [path dap.bowl aeon payload]
388+ [path dap.bowl payload]
347 ==
389 ==
348 ++ latest
390 ++ latest
349 |= =$@(aeon tide)
391 |= =$@(aeon tide)
@@ -354,31 +396,49 @@
354 ::
396 ::
355 ++ edit
397 ++ edit
356 |= [ps=(list paths) edit=$-(buoy buoy)]
398 |= [ps=(list paths) edit=$-(buoy buoy)]
357− ^- pubs
399+ ^- (quip card:agent:gall pubs)
358− :- %0
359 %- ~(rep in (sy ps))
400 %- ~(rep in (sy ps))
360− |= [path=paths =_pub]
401+ |= [path=paths caz=(list card:agent:gall) %1 =_pub]
361− %- fall :_ pub %- mole |.
362− (~(jab by pub) path edit)
402+ ?~ old=(~(get by pub) path) [caz 1/pub]
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)))
363 ::
420 ::
364 ++ form
421 ++ form
365 |= =tide
422 |= =tide
366 ^+ tide
423 ^+ tide
367 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
424 =/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
368 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
425 =/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
369− =. rok.tide
426+ =? rok.tide :: Create new rock.
370− %+ gas:rok +<-:gas:rok
371− %- tab:rok :_ [~ +(rocks.rul.tide)]
372− ?: ?| =(waves.rul.tide 0)
427+ ?& !=(frequency.rul.tide 0)
373− (lth max-wave (add aeon.max-rock waves.rul.tide))
428+ (gte max-wave (add aeon.max-rock frequency.rul.tide))
374− ==
429+ ==
375− rok.tide
376 %+ put:rok rok.tide
430 %+ put:rok rok.tide
377 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
431 %+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
378 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
432 |: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
379 ~| %aeon-awry
433 ~| %aeon-awry
380 ?> =(now +(prev))
434 ?> =(now +(prev))
381 [now (wash:lake rock wave)]
435 [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))))
382 ~| %rock-zero
442 ~| %rock-zero
383 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
443 tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
384 --
444 --
base-desk/lib/story.hoon+11−35
@@ -38,41 +38,17 @@
38::
38::
39:: Canonical textual representation
39:: Canonical textual representation
40::
40::
41−++ tako-to-text
41+++ chapter-to-text
42− |= [=tako:clay]
42+ |= [=tako:clay =proses]
43− ^- tape
43+ ^- wain
44− "commit: {<`@uv`tako>}\0a"
44+ :- (crip "commit: {<`@uv`tako>}")
45−::
45+ %- zing
46−++ proses-to-text
46+ %+ join `wain`~['|||']
47− |= [=proses]
48− ^- tape
49− =/ proses-list=(list prose) ~(tap in proses)
47+ %+ turn ~(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)
56− |= [prz=prose state=tape]
48+ |= prose
57− ^- [prose tape]
49+ ^- wain
58− :- prz
50+ %- to-wain:format
59− ;: welp
51+ (rap 3 title '\0a\0a' body ~)
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− ==
76::
52::
77:: Parsers
53:: Parsers
78::
54::
base-desk/lib/strandio.hoon+4−3
@@ -470,7 +470,7 @@
470 =/ m (strand ,json)
470 =/ m (strand ,json)
471 ^- form:m
471 ^- form:m
472 ;< =cord bind:m (fetch-cord url)
472 ;< =cord bind:m (fetch-cord url)
473− =/ json=(unit json) (de-json:html cord)
473+ =/ json=(unit json) (de:json:html cord)
474 ?~ json
474 ?~ json
475 (strand-fail %json-parse-error ~)
475 (strand-fail %json-parse-error ~)
476 (pure:m u.json)
476 (pure:m u.json)
@@ -581,8 +581,9 @@
581++ check-for-file
581++ check-for-file
582 |= [[=ship =desk =case] =spur]
582 |= [[=ship =desk =case] =spur]
583 =/ m (strand ,?)
583 =/ m (strand ,?)
584− ;< =riot:clay bind:m (warp ship desk ~ %sing %x case spur)
584+ ;< =riot:clay bind:m (warp ship desk ~ %sing %u case spur)
585− (pure:m ?=(^ riot))
585+ ?> ?=(^ riot)
586+ (pure:m !<(? q.r.u.riot))
586::
587::
587++ list-tree
588++ list-tree
588 |= [[=ship =desk =case] =spur]
589 |= [[=ship =desk =case] =spur]
base-desk/lib/test.hoon+33−1
@@ -38,7 +38,39 @@
38 =/ b (mule a)
38 =/ b (mule a)
39 ?- -.b
39 ?- -.b
40 %| ~
40 %| ~
41− %& [leaf+"expected failure - succeeded" ~]
41+ %& ['expected failure - succeeded' ~]
42+ ==
43+:: +expect-runs: 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+:: $a-test-chain: a sequence of tests to be run
54+::
55+:: NB: arms shouldn't start with `test-` so that `-test % ~` runs
56+::
57++$ a-test-chain
58+ $_
59+ |?
60+ ?: =(0 0)
61+ [%& p=*tang]
62+ [%| p=[tang=*tang next=^?(..$)]]
63+:: +run-chain: run a sequence of tests, stopping at first failure
64+::
65+++ run-chain
66+ |= seq=a-test-chain
67+ ^- tang
68+ =/ res $:seq
69+ ?- -.res
70+ %& p.res
71+ %| ?. =(~ tang.p.res)
72+ tang.p.res
73+ $(seq next.p.res)
42 ==
74 ==
43:: +category: prepends a name to an error result; passes successes unchanged
75:: +category: prepends a name to an error result; passes successes unchanged
44::
76::
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 6]
7+ version+[1 0 7]
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+9−5
@@ -207,23 +207,27 @@
207::
207::
208++ groups-link-thatch
208++ groups-link-thatch
209'''
209'''
210+const buttonText = 'View in Astrolabe';
210setInterval(() => {
211setInterval(() => {
212+ const footer = document.querySelectorAll('section > div > footer')?.[0];
213+ if (!footer) return;
214+ if (footer.children[0].innerText === buttonText) return;
211 const spans = document.querySelectorAll('section > div > div > div > span > span:first-child');
215 const spans = document.querySelectorAll('section > div > div > div > span > span:first-child');
212 spans.forEach((span) => {
216 spans.forEach((span) => {
213 if (span.innerHTML !== '~') return;
217 if (span.innerHTML !== '~') return;
218+ if (footer.children[0].innerText === buttonText) return;
214 let cspan = span.parentElement;
219 let cspan = span.parentElement;
215− if (cspan.nextSibling) return;
216− let c = cspan.parentElement;
217 let patp = cspan.innerText;
220 let patp = cspan.innerText;
218 let b = document.createElement('a');
221 let b = document.createElement('a');
219− b.innerHTML = "View in Astrolabe";
222+ b.innerHTML = buttonText;
220 b.className = 'button';
223 b.className = 'button';
221− b.href = 'web+urbitgraph://astrolabe/ship/' + patp;
224+ // b.href = 'web+urbitgraph://astrolabe/ship/' + patp;
225+ b.href = '/apps/astrolabe/#/ship/' + patp;
222 b.target = '_blank';
226 b.target = '_blank';
223 b.style.backgroundColor = "navy";
227 b.style.backgroundColor = "navy";
224 b.style.marginLeft = "1rem";
228 b.style.marginLeft = "1rem";
225 b.style.color = "white";
229 b.style.color = "white";
226− c.appendChild(b);
230+ footer.prepend(b);
227 });
231 });
228}, 100);
232}, 100);
229'''
233'''
desk/sys.kelvin+2−1
@@ -1 +1,2 @@
1−[%zuse 413]
1+[%zuse 413]
2+[%zuse 412]