on main help sign in
update desks, add scripts for http globs, add
commit17678c014831b21b53fc58a1359b59e01a444a75 authorJohn Hyde <johnhydefour@gmail.com> dateMon 15 Aug 2022, 15:47 (4 years ago) parent262ca0e
35 files changed+560−127
.gitignore+1 README.md+29−21 base-desk/lib/bip/b173.hoon+1−1 base-desk/lib/bip/b174.hoon+2 base-desk/lib/cram.hoon−1 base-desk/lib/ethereum.hoon+19−1 base-desk/lib/hark-store.hoon+22 base-desk/lib/ph/io.hoon+14−2 base-desk/lib/ph/util.hoon+1−1 base-desk/lib/pill.hoon+3−3 base-desk/lib/ring.hoon+11−10 base-desk/lib/story.hoon+112 base-desk/lib/strandio.hoon+3−3 base-desk/lib/test.hoon+1−1 base-desk/mar/css.hoon+21 base-desk/mar/story-diff.hoon+16 base-desk/mar/story.hoon+70 base-desk/mar/thread-done.hoon+11 base-desk/mar/thread-fail.hoon+11 base-desk/mar/udon.hoon−1 base-desk/sur/aquarium.hoon+10−1 base-desk/sur/bitcoin.hoon+1−1 base-desk/sur/hood.hoon+4−14 base-desk/sur/spider.hoon+7 base-desk/sur/story.hoon+9 bin/get_glob.sh+22 bin/install.sh+51 desk/desk.docket-0+2−2 desk/mar/webmanifest.hoon+26 install.sh−44 ui/.env+3 ui/package-lock.json+58 ui/package.json+15−6 ui/src/components/search/sigil/SymbolInputModeSelectorButton.svelte+1−1 ui/src/styles/tailwind-output.css+3−13
.gitignore+1
@@ -1,3 +1,4 @@
11# OS X
22.DS_Store
33extras
4+globs
README.md+29−21
@@ -21,47 +21,55 @@ Astrolabe is built primarily using [Svelte], [Typescript], and [Tailwind CSS]. [
2121
2222To get started using Astrolabe first you need to run `npm install` inside the `ui` directory.
2323
24−To develop you'll need a running ship to point to. To do so you first need to add a `.env.local` file to the `ui` directory. This file will not be committed. Adding `VITE_SHIP_URL={URL}` where **{URL}** is the URL of the ship you would like to point to, will allow you to run `npm run dev`. This will proxy all requests to the ship except for those powering the interface, allowing you to see live data.
24+To develop you'll need a running ship to point to. If it's running somewhere other than `http://localhost:8081`, make a copy of `.env` in the `ui` directory and name it `.env.local`. This file will not be committed. Change `VITE_SHIP_URL` to the URL of the ship you would like to point to.
25+
26+Once your URL is correctly configured, you can run `npm run dev`. This will proxy all requests to the ship except for those powering the interface, allowing you to see live data.
2527
2628Regardless of what you run to develop, Vite will hot-reload code changes as you work so you don't have to constantly refresh.
2729
28−### Deploying with `glob-ames` glob
30+# Deploying
2931
30321. Spin up a comet or distribution ship.
31332. Mount an `%astrolabe` desk. In Dojo:
3234 1. `|merge %astrolabe our %base` to create a new desk.
33− 2. `|mount %work` to mount it.
35+ 2. `|mount %astrolabe` to mount it.
36+ 3. Set `ASTROLABE_DESK` in `.env.local` if the path to your desk is different.
37+3. Create and upload `glob-http`, if applicable (see below)
34383. Install the desk
35− 1. From the root of the project: `./install.sh path/to/pier/astrolabe`
39+ 1. From the `ui` folder: `npm run install:desk`
3640 2. From the distribution ship's dojo: `:treaty|unpublish %astrolabe`
3741 2. From middleman or distribution ship's dojo: `|commit %astrolabe`
3842 3. (if using a comet as a middleman) `|public %astrolabe`
3943 4. (if using a comet as a middleman) from the actual distribution ship: `|install ~comet-name %astrolabe` or `|resume %astrolabe`
4044 5. (if using a comet as a middleman) from the actual distribution ship: `|pause %astrolabe`
45+4. Build UI and upload `glob-ames`
46+5. Publish the desk from dojo: `:treaty|publish %astrolabe`
47+
48+### Deploying with `glob-ames` glob
49+1. Put the line `glob-ames+[~dister-midlev-mindyr 0v0]` in `desk.docket-0` if it's not there, where `~dister-midlevi-mindyr` is the `@p` of the distribution ship.
41504. Build the UI with `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder.
42515. Upload the `dist/` folder as a glob to your distribution ship. Example url: https://distribution.urbit-ship.com/docket/upload
43−6. Publish the desk from dojo: `:treaty|publish %astrolabe`
4452
4553### Deploying with `glob-http` glob
4654
4755To deploy, run `npm run build` in the `ui` directory which will bundle all the code and assets into the `dist/` folder. This can then be made into a glob by doing the following:
4856
49−1. Create or launch an urbit using the -F flag
50−2. On that urbit, if you don't already have a desk to run from, run `|merge %work our %base` to create a new desk and mount it with `|mount %work`.
51−3. Now the `%work` desk is accessible through the host OS's filesystem as a directory of that urbit's pier ie `~/zod/work`.
52−4. From the `ui` directory you can run `rsync -avL --delete dist/ ~/zod/work/astrolabe` where `~/zod` is your fake urbit's pier.
53−5. Once completed you can then run `|commit %work` on your urbit and you should see your files logged back out from the dojo.
54−6. Now run `=dir /=garden` to switch to the garden desk directory
55−7. You can now run `-make-glob %work /astrolabe` which will take the folder where you just added files and create a glob which can be thought of as a sort of bundle. It will be output to `~/zod/.urb/put`.
56−8. If you navigate to `~/zod/.urb/put` you should see a file that looks like this `glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob`. The characters between `glob-` and `.glob` are a hash of the glob's contents.
57−9. Now that we have the glob it can be uploaded to any publicly available HTTP endpoint that can serve files. This allows the glob to distributed over HTTP.
58−10. Once you've uploaded the glob, you should then update the corresponding entry in the docket file at `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
59−
60−```hoon
61− glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
62−```
63−
64−11. This can now be safely committed and deployed.
57+1. Spin up a globber ship (comet or fakezod) (or just reuse your dev ship for this).
58+2. Mount an `%globber` desk. In Dojo:
59+ 1. `|merge %globber our %base` to create a new desk.
60+ 2. `|mount %globber` to mount it.
61+ 3. Set `GLOBBER_DESK` in `.env.local` if the path to your globber desk is different.
62+4. From the `ui` directory, run `npm run release` to build the ui and copy it to your globber desk
63+5. From the globber ship: `|commit %globber` (create basic mark files (see `png.hoon`) for any files without mark files)
64+6. Now run `=dir /=garden=` to switch to the garden desk directory
65+7. `-make-glob %globber /astrolabe` which will take the folder where you just added files and create a glob which can be thought of as a sort of bundle. It will be output to `~/zod/.urb/put`.
66+8. From the `ui` directory, run `npm run get-glob` to place the latest glob in the `globs` folder.
67+9. Copy the string printed by the last step, and paste it into `desk.docket-0`.
68+8. Upload the glob in `/globs/` to any publicly available HTTP endpoint that can serve files. This allows the glob to distributed over HTTP.
69+10. Once you've uploaded the glob, paste the url into `desk/desk.docket-0`. Both the full URL and the hash should be updated to match the glob we just created, on the line that looks like this:
70+ ```hoon
71+ glob-http+['https://bootstrap.urbit.org/glob-0v5.fdf99.nph65.qecq3.ncpjn.q13mb.glob' 0v5.fdf99.nph65.qecq3.ncpjn.q13mb]
72+ ```
6573
6674[svelte]: https://svelte.dev/
6775[typescript]: https://www.typescriptlang.org/
base-desk/lib/bip/b173.hoon+1−1
@@ -11,7 +11,7 @@
1111|%
1212++ prefixes
1313 ^- (map network tape)
14− (my [[%main "bc"] [%testnet "tb"] ~])
14+ (my [[%main "bc"] [%testnet "tb"] [%regtest "bcrt"] ~])
1515++ charset "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
1616+$ raw-decoded [hrp=tape data=(list @) checksum=(list @)]
1717:: below is a port of: https://github.com/bitcoinjs/bech32/blob/master/index.js
base-desk/lib/bip/b174.hoon+2
@@ -56,6 +56,8 @@
5656 1^0x0
5757 %testnet
5858 1^0x1
59+ %regtest
60+ 1^0x1
5961 ==
6062 :- (cat:byt ~[1^typ pubkey.h])
6163 %- cat:byt
base-desk/lib/cram.hoon−1
@@ -31,7 +31,6 @@
3131 =- (weld - $(p.gen t.p.gen))
3232 ?^ -.i.p.gen $(gen [%xray i.p.gen])
3333 ~| [%shut-tuna -.i.p.gen]
34− ~| [%shut-slamon -.p.i.p.gen]
3534 ?+ -.i.p.gen !!
3635 %manx ?>(?=(%xray -.p.i.p.gen) $(gen p.i.p.gen))
3736 %marl ?>(?=(%mcts -.p.i.p.gen) $(gen p.i.p.gen))
base-desk/lib/ethereum.hoon+19−1
@@ -948,6 +948,21 @@
948948 %- prefix-hex
949949 (render-hex-bytes 20 `@`a)
950950::
951+++ address-to-checksum
952+ |= a=address
953+ ^- tape
954+ =/ hexed (render-hex-bytes 20 `@`a)
955+ =/ hash (keccak-256:keccak:crypto (as-octs:mimes:html (crip hexed)))
956+ =| ret=tape
957+ =/ pos 63
958+ |-
959+ ?~ hexed (prefix-hex (flop ret))
960+ =/ char i.hexed
961+ ?: (lth char 58) $(pos (dec pos), ret [char ret], hexed t.hexed)
962+ =/ nib (cut 2 [pos 1] hash)
963+ ?: (lth 7 nib) $(pos (dec pos), ret [(sub char 32) ret], hexed t.hexed)
964+ $(pos (dec pos), ret [char ret], hexed t.hexed)
965+::
951966++ transaction-to-hex
952967 |= h=@
953968 ^- tape
@@ -978,5 +993,8 @@
978993::
979994++ hex-to-num
980995 |= a=@t
981− (rash (rsh [3 2] a) hex)
996+ ~| %non-hex-cord
997+ ?> =((end [3 2] a) '0x')
998+ =< ?<(=(0 p) q) %- need
999+ (de:base16:mimes:html (rsh [3 2] a))
9821000--
base-desk/lib/hark-store.hoon+22
@@ -171,6 +171,7 @@
171171++ dejs
172172 =, dejs:format
173173 |%
174+ ++ ship (su ;~(pfix sig fed:ag))
174175 :: TODO: fix +stab
175176 ::
176177 ++ pa
@@ -218,6 +219,26 @@
218219 :~ lid+lid
219220 bin+bin
220221 ==
222+ ++ content
223+ %- of
224+ :~ text+so
225+ ship+ship
226+ ==
227+ ::
228+ ++ body
229+ %- ot
230+ :~ title+(ar content)
231+ content+(ar content)
232+ time+di
233+ binned+pa
234+ link+pa
235+ ==
236+ ::
237+ ++ add-note
238+ %- ot
239+ :~ bin+bin
240+ body+body
241+ ==
221242 ::
222243 ++ action
223244 ^- $-(json ^action)
@@ -228,6 +249,7 @@
228249 read-count+place
229250 read-each+read-each
230251 read-note+bin
252+ add-note+add-note
231253 ==
232254 --
233255--
base-desk/lib/ph/io.hoon+14−2
@@ -1,5 +1,5 @@
11/- *aquarium, spider
2−/+ libstrand=strand, *strandio, util=ph-util
2+/+ libstrand=strand, *strandio, util=ph-util, aqua-azimuth
33=, strand=strand:libstrand
44|%
55++ send-events
@@ -127,7 +127,7 @@
127127 ;< ~ bind:m (send-azimuth-action %breach who)
128128 |- ^- form:m
129129 =* loop $
130− ;< ~ bind:m (sleep ~s1)
130+ ;< ~ bind:m (sleep ~s10)
131131 ;< =bowl:spider bind:m get-bowl
132132 =/ aqua-pax
133133 :- %i
@@ -137,6 +137,18 @@
137137 (pure:m ~)
138138 loop
139139::
140+++ init-moon ::NOTE real moon always have the same keys
141+ |= [moon=ship fake=?]
142+ ?> ?=(%earl (clan:title moon))
143+ ?: fake (init-ship moon &)
144+ =/ m (strand ,~)
145+ ^- form:m
146+ ;< ~ bind:m
147+ %+ dojo (^sein:title moon)
148+ =/ =pass pub:ex:(get-keys:aqua-azimuth moon 1)
149+ "|moon {(scow %p moon)}, =public-key {(scow %uw pass)}"
150+ (init-ship moon |)
151+::
140152++ init-ship
141153 |= [=ship fake=?]
142154 =/ m (strand ,~)
base-desk/lib/ph/util.hoon+1−1
@@ -59,7 +59,7 @@
5959::
6060:: Checks whether the given event is a dojo output blit containing the
6161:: given tape
62−::
62+::TODO should be rename -dill-output
6363++ is-dojo-output
6464 |= [who=ship her=ship uf=unix-effect what=tape]
6565 ?& =(who her)
base-desk/lib/pill.hoon+3−3
@@ -61,10 +61,10 @@
6161 =; hav ~& user-files+(lent hav)
6262 =/ =yuki:clay
6363 :- *(list tako:clay)
64− %- ~(gas by *(map path (each page:clay lobe:clay)))
65− (turn hav |=([=path =page:clay] [path &+page]))
64+ %- ~(gas by *(map path (each page lobe:clay)))
65+ (turn hav |=([=path =page] [path &+page]))
6666 [/c/sync [%park des &+yuki *rang:clay]]
67− =| hav=(list [path page:clay])
67+ =| hav=(list [path page])
6868 |- ^+ hav
6969 ?~ sal ~
7070 =. hav $(sal t.sal)
base-desk/lib/ring.hoon+11−10
@@ -349,15 +349,16 @@
349349 |= [our=@p now=@da ship=@p =life]
350350 ^- @udpoint
351351 ::
352− =/ d=[=^life =pass]
352+ =/ d=[=^life =pass *]
353353 =/ scry-path=path
354− :~ %k
354+ :~ %j
355355 (scot %p our)
356+ %deed
356357 (scot %da now)
357358 (scot %p ship)
358359 (scot %ud life)
359360 ==
360− .^([^life pass] scry-path)
361+ .^([^life pass *] scry-path)
361362 :: we have the deed which has pass, which is several numbers +cat-ed
362363 :: together; pull out the keys
363364 ::
@@ -376,15 +377,15 @@
376377 ?~ invited
377378 [participants keys]
378379 ::
379− =/ =life
380− .^(life k+/(scot %p our)/life/(scot %da now)/(scot %p i.invited))
380+ =/ lyfe=(unit @ud)
381+ .^((unit @ud) j+/(scot %p our)/lyfe/(scot %da now)/(scot %p i.invited))
381382 ::
382− ?: =(life 0)
383+ ?~ lyfe
383384 $(invited t.invited)
384385 ::
385− =/ pubkey=@udpoint (ship-life-to-pubid our now i.invited life)
386+ =/ pubkey=@udpoint (ship-life-to-pubid our now i.invited u.lyfe)
386387 ::
387− =. participants (~(put in participants) [i.invited life])
388+ =. participants (~(put in participants) [i.invited u.lyfe])
388389 =. keys (~(put in keys) pubkey)
389390 ::
390391 $(invited t.invited)
@@ -436,11 +437,11 @@
436437 :: get our ships' current life
437438 ::
438439 =/ our-life=life
439− .^(life %k /(scot %p our)/life/(scot %da now)/(scot %p our))
440+ .^(life %j /(scot %p our)/life/(scot %da now)/(scot %p our))
440441 :: get our ships' secret keyfile ring
441442 ::
442443 =/ secret-ring=ring
443− .^(ring %k /(scot %p our)/vein/(scot %da now)/(scot %ud our-life))
444+ .^(ring %j /(scot %p our)/vein/(scot %da now)/(scot %ud our-life))
444445 :: fetch the encoded auth seed from the ring
445446 ::
446447 =/ secret-auth-seed=@
base-desk/lib/story.hoonnew file+112
@@ -0,0 +1,112 @@
1+/- *story
2+!:
3+^?
4+|%
5+:: XX generalize move to hoon.hoon
6+++ dif-ju
7+ |= [a=story b=story]
8+ ^- story
9+ :: if 0 is the empty set,
10+ :: a \ 0 = a
11+ :: 0 \ b = 0 :: anything in 0 but not in b is by definition 0
12+ ::
13+ ?: =(~ a) ~
14+ :: uno := (a-b) + (merged items in both a and b) + (b-a)
15+ :: ret := (a-b) + (merged items in both a and b)
16+ :: ret = (~(int by a) uno) :: preserve only the entries whose keys are in a
17+ =/ uno=story
18+ %- (~(uno by a) b)
19+ |= [k=tako:clay proses-a=proses proses-b=proses]
20+ ^- proses
21+ (~(dif in proses-a) proses-b)
22+ ::
23+ =/ ret=story (~(int by a) uno)
24+ :: normalizing step, remove any keys with null sets,
25+ :: which can occur if proses-a == proses-b above
26+ %- ~(gas by *story)
27+ (skip ~(tap by ret) |=([k=* v=proses] ?=(~ v)))
28+::
29+++ uni-ju
30+ |= [a=story b=story]
31+ ^- story
32+ :: 0 + b = b
33+ ?: =(~ a) b
34+ %- (~(uno by a) b)
35+ |= [k=tako:clay proses-a=proses proses-b=proses]
36+ ^- proses
37+ (~(uni in proses-a) proses-b)
38+::
39+:: Canonical textual representation
40+::
41+++ tako-to-text
42+ |= [=tako:clay]
43+ ^- tape
44+ "commit: {<`@uv`tako>}\0a"
45+::
46+++ proses-to-text
47+ |= [=proses]
48+ ^- tape
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)
56+ |= [prz=prose state=tape]
57+ ^- [prose tape]
58+ :- prz
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+ ==
76+::
77+:: Parsers
78+::
79+++ parse-commit-hash
80+ ;~ sfix
81+ ;~ pfix (jest 'commit: ')
82+ (cook @uv ;~(pfix (jest '0v') viz:ag))
83+ ==
84+ ::
85+ (just '\0a')
86+ ==
87+::
88+++ parse-title
89+ ;~ sfix
90+ (cook crip (star prn))
91+ (jest '\0a\0a')
92+ ==
93+::
94+++ parse-body
95+ %+ cook of-wain:format
96+ %- star
97+ ;~ less
98+ ;~(pose (jest '|||\0a') (jest '---\0a'))
99+ (cook crip ;~(sfix (star prn) (just '\0a')))
100+ ==
101+::
102+++ parse-prose ;~(plug parse-title parse-body)
103+++ parse-rest-proses (star ;~(pfix (jest '|||\0a') parse-prose))
104+++ parse-proses (cook silt ;~(plug parse-prose parse-rest-proses))
105+++ parse-chapter ;~(plug parse-commit-hash parse-proses)
106+++ parse-story
107+ (cook ~(gas by *story) (star ;~(sfix parse-chapter (jest '---\0a'))))
108+::
109+:: N.B: If conflicting messages are written individually,
110+:: instead of under the same commit, we will overwrite previous entries
111+:: with later ones due to the nature of gas:by.
112+--
base-desk/lib/strandio.hoon+3−3
@@ -734,7 +734,7 @@
734734 ;< =bowl:spider bind:m get-bowl
735735 =/ tid
736736 (scot %ta (cat 3 (cat 3 'strand_' file) (scot %uv (sham file eny.bowl))))
737− =/ poke-vase !>([`tid.bowl `tid beak file args])
737+ =/ poke-vase !>(`start-args:spider`[`tid.bowl `tid beak file args])
738738 ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
739739 ;< ~ bind:m (sleep ~s0) :: wait for thread to start
740740 (pure:m tid)
@@ -748,7 +748,7 @@
748748 ^- form:m
749749 ;< =bowl:spider bind:m get-bowl
750750 =/ tid (scot %ta (cat 3 'strand_' (scot %uv (sham file eny.bowl))))
751− =/ poke-vase !>([`tid.bowl `tid file args])
751+ =/ poke-vase !>(`start-args:spider`[`tid.bowl `tid byk.bowl file args])
752752 ;< ~ bind:m (watch-our /awaiting/[tid] %spider /thread-result/[tid])
753753 ;< ~ bind:m (poke-our %spider %spider-start poke-vase)
754754 ;< ~ bind:m (sleep ~s0) :: wait for thread to start
@@ -756,6 +756,6 @@
756756 ;< ~ bind:m (take-kick /awaiting/[tid])
757757 ?+ p.cage ~|([%strange-thread-result p.cage file tid] !!)
758758 %thread-done (pure:m %& q.cage)
759− %thread-fail (pure:m %| !<([term tang] q.cage))
759+ %thread-fail (pure:m %| ;;([term tang] q.q.cage))
760760 ==
761761--
base-desk/lib/test.hoon+1−1
@@ -13,7 +13,7 @@
1313 %+ weld result
1414 ^- tang
1515 :~ [%palm [": " ~ ~ ~] [leaf+"expected" (sell expected) ~]]
16− [%palm [": " ~ ~ ~] [leaf+"actual" (sell actual) ~]]
16+ [%palm [": " ~ ~ ~] [leaf+"actual " (sell actual) ~]]
1717 ==
1818 ::
1919 =? result !(~(nest ut p.actual) | p.expected)
base-desk/mar/css.hoonnew file+21
@@ -0,0 +1,21 @@
1+::
2+:::: /hoon/css/mar
3+ ::
4+/? 310
5+=, eyre
6+=, mimes:html
7+|_ mud=@t
8+++ grow :: convert to
9+ |% ++ mime [/text/css (as-octs mud)] :: convert to %mime
10+ ++ elem ;style :: convert to %hymn
11+ ;- (trip mud)
12+ ==
13+ ++ hymn ;html:(head:"{elem}" body)
14+ --
15+++ grab
16+ |% :: convert from
17+ ++ mime |=([p=mite q=octs] (@t q.q))
18+ ++ noun @t :: clam from %noun
19+ --
20+++ grad %mime
21+--
base-desk/mar/story-diff.hoonnew file+16
@@ -0,0 +1,16 @@
1+::
2+::::
3+ ::
4+/- *story
5+|_ =story-diff
6+::
7+++ grad %noun
8+++ grow
9+ |%
10+ ++ noun story-diff
11+ --
12+++ grab :: convert from
13+ |%
14+ ++ noun ^story-diff :: make from %noun
15+ --
16+--
base-desk/mar/story.hoonnew file+70
@@ -0,0 +1,70 @@
1+/- *story
2+/+ *story
3+|_ tale=story
4+++ grad
5+ |%
6+ ++ form %story-diff
7+ ++ diff
8+ |= tory=story
9+ ^- story-diff
10+ :: Given new story (tory), old story (tale), compute the diff
11+ :: additions = new - old
12+ :: deletions = old - new
13+ [(dif-ju tory tale) (dif-ju tale tory)]
14+ ++ pact
15+ |= dif=story-diff
16+ :: Compute the new story after applying dif to tale.
17+ ::
18+ ^- story
19+ =. tale (uni-ju tale additions.dif)
20+ =. tale (dif-ju tale deletions.dif)
21+ tale
22+ ++ join
23+ |= [ali=story-diff bob=story-diff]
24+ ^- (unit story-diff)
25+ =/ joined-additions (uni-ju additions.ali additions.bob)
26+ =/ joined-deletions (uni-ju deletions.ali deletions.bob)
27+ ::
28+ :: In a true join, we'd do a set intersection on the keys.
29+ :: If they're not equal, we have a conflict.
30+ :: In this case, we'd produce null and kick the flow to +mash
31+ ::
32+ %- some
33+ [joined-additions joined-deletions]
34+ ++ mash
35+ :: called by meld, force merge, annotating conflicts
36+ |= $: [als=ship ald=desk ali=story-diff]
37+ [bos=ship bod=desk bob=story-diff]
38+ ==
39+ ^- story-diff
40+ (need (join ali bob)) :: XX temporary, only because join doesn't fail
41+ --
42+::
43+++ grow :: convert to
44+ |% ::
45+ ++ mime :: to %mime
46+ [/text/x-urb-story (as-octs:mimes:html (of-wain:format txt))]
47+ ++ txt
48+ ^- wain
49+ %- snoc :_ '' :: ensures terminating newline is present
50+ %+ murn ~(tap by tale)
51+ |= [[=tako:clay =proses]]
52+ ^- (unit cord)
53+ ?~ proses ~
54+ %- some
55+ %- crip
56+ ;: welp
57+ (tako-to-text tako)
58+ (proses-to-text proses)
59+ "---"
60+ ==
61+ --
62+++ grab
63+ |% :: convert from
64+ ++ noun story :: clam from %noun
65+ ++ mime :: retrieve from %mime
66+ |= [p=mite q=octs]
67+ =/ story-text `@t`q.q
68+ `story`(rash story-text parse-story)
69+ --
70+--
base-desk/mar/thread-done.hoonnew file+11
@@ -0,0 +1,11 @@
1+|_ res=*
2+++ grab
3+ |%
4+ ++ noun *
5+ --
6+++ grow
7+ |%
8+ ++ noun res
9+ --
10+++ grad %noun
11+--
base-desk/mar/thread-fail.hoonnew file+11
@@ -0,0 +1,11 @@
1+|_ err=*
2+++ grab
3+ |%
4+ ++ noun (pair term tang)
5+ --
6+++ grow
7+ |%
8+ ++ noun err
9+ --
10+++ grad %noun
11+--
base-desk/mar/udon.hoon−1
@@ -28,5 +28,4 @@
2828 ++ txt of-wain:format
2929 --
3030++ grad %txt
31−++ garb /down
3231--
base-desk/sur/aquarium.hoon+10−1
@@ -24,7 +24,16 @@
2424 aqua-event
2525 ==
2626::
27−+$ unix-event unix-event:pill-lib
27++$ unix-event ::NOTE like unix-event:pill-lib but for all tasks
28+ %+ pair wire
29+ $% [%wack p=@]
30+ [%what p=(list (pair path (cask)))]
31+ [%whom p=ship]
32+ [%boot ? $%($>(%fake task:jael) $>(%dawn task:jael))]
33+ [%wyrd p=vere]
34+ [%verb p=(unit ?)]
35+ task-arvo
36+ ==
2837+$ pill pill:pill-lib
2938::
3039+$ aqua-event
base-desk/sur/bitcoin.hoon+1−1
@@ -4,7 +4,7 @@
44:: chyg: whether account is (non-)change. 0 or 1
55:: bytc: "btc-byts" with dat cast to @ux
66|%
7−+$ network ?(%main %testnet)
7++$ network ?(%main %testnet %regtest)
88+$ hexb [wid=@ dat=@ux] :: hex byts
99+$ bits [wid=@ dat=@ub]
1010+$ xpub @ta
base-desk/sur/hood.hoon+4−14
@@ -130,13 +130,8 @@
130130 =/ tak (scot %uv (~(got by hit.dom) let.dom))
131131 =/ yak .^(yaki cs/~[her syd yon %yaki tak])
132132 =/ lob (scot %uv (~(got by q.yak) /sys/kelvin))
133− =/ bob .^(blob cs/~[her syd yon %blob lob])
134− ::
135− ;; weft
136− ?- -.bob
137− %direct q.q.bob
138− %delta q.r.bob
139− ==
133+ =/ peg .^(page cs/~[her syd yon %blob lob])
134+ ;;(weft q.peg)
140135:: +read-kelvin-local: read /sys/kelvin from a local desk
141136::
142137++ read-kelvin-local
@@ -164,13 +159,8 @@
164159 =/ fil (~(get by q.yak) /desk/bill)
165160 ?~ fil ~
166161 =/ lob (scot %uv u.fil)
167− =/ bob .^(blob cs/~[her syd yon %blob lob])
168− ::
169− ;; (list dude)
170− ?- -.bob
171− %direct q.q.bob
172− %delta q.r.bob
173− ==
162+ =/ peg .^(page cs/~[her syd yon %blob lob])
163+ ;;((list dude) q.peg)
174164:: +read-bill: read contents of /desk/bill manifest
175165::
176166++ read-bill
base-desk/sur/spider.hoon+7
@@ -11,4 +11,11 @@
1111 %nonexistent :: 404
1212 %offline :: 504
1313 ==
14++$ start-args
15+ $: parent=(unit tid)
16+ use=(unit tid)
17+ =beak
18+ file=term
19+ =vase
20+ ==
1421--
base-desk/sur/story.hoonnew file+9
@@ -0,0 +1,9 @@
1+^?
2+|%
3++$ prose [title=@t body=@t]
4++$ proses (set prose)
5++$ story (jug tako:clay prose) :: set len > 1 means conflicting messages have been assigned
6++$ chapter [tako:clay proses] :: prose entry type
7++$ cash $%([%tako p=tako:clay] case) :: used in generators to accept a tako directly as well
8++$ story-diff [additions=story deletions=story]
9+--
bin/get_glob.shnew file+22
@@ -0,0 +1,22 @@
1+#!/bin/bash
2+#
3+# Taken from: https://github.com/timlucmiptev/btc-agents/blob/master/install.sh
4+# by ~timluc-miptev
5+#
6+usage() { printf "Usage: $0 URBIT_GLOBBER_DESK_DIRECTORY" 1>&2; exit 1; }
7+
8+cdir=$(dirname $0)
9+
10+if [ $# -eq 0 ]; then
11+ usage
12+ exit 2
13+fi
14+DESK="${1//\~/$HOME}"
15+GLOBS="$DESK/../.urb/put"
16+GLOB=$(ls -t $GLOBS | head -1)
17+TARGET_GLOBS="$cdir"/../globs/
18+mkdir -p $TARGET_GLOBS
19+cp "$GLOBS/$GLOB" $TARGET_GLOBS/
20+HASH="${GLOB//glob-/}"
21+HASH="${HASH//.glob/}"
22+echo $HASH
bin/install.shnew file+51
@@ -0,0 +1,51 @@
1+#!/bin/bash
2+#
3+# Taken from: https://github.com/timlucmiptev/btc-agents/blob/master/install.sh
4+# by ~timluc-miptev
5+#
6+usage() { printf "Usage: $0 [-w] [-g] URBIT_DESK_DIRECTORY\n(-w: flag to watch and live copy code)\n(-g: install built ui to globber desk)\n" 1>&2; exit 1; }
7+
8+cdir=$(dirname $0)
9+
10+if [ $# -eq 0 ]; then
11+ usage
12+ exit 2
13+fi
14+DESK=${@: -1}
15+EXCLUDE_FILE="${cdir}"/../config/ignore_files_on_install.txt
16+
17+while getopts "wg" opt; do
18+ case ${opt} in
19+ w) WATCH_MODE="true"
20+ ;;
21+ g) GLOBBER="true"
22+ ;;
23+ *) usage
24+ ;;
25+ esac
26+done
27+DESK="${DESK//\~/$HOME}"
28+if [ -z "$WATCH_MODE" ]; then
29+ echo "Installed %astrolabe to ${DESK}"
30+ rm -r $DESK/*
31+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../base-desk/* $DESK/
32+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../docs-dev-desk/* $DESK/
33+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../desk/* $DESK/
34+ if [ "$GLOBBER" ]; then
35+ rsync -r --copy-links "${cdir}"/../ui/dist/* $DESK/astrolabe
36+ fi
37+else
38+ echo "Watching for changes to copy to ${DESK}..."
39+ rm -r $DESK/*
40+ while [ 0 ]
41+ do
42+ sleep 0.8
43+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../base-desk/* $DESK/
44+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../docs-dev-desk/* $DESK/
45+ rsync -r --copy-links --exclude-from=$EXCLUDE_FILE "${cdir}"/../desk/* $DESK/
46+ if [ "$GLOBBER" ]; then
47+ echo "heheh"
48+ rsync -r --copy-links "${cdir}"/../ui/dist/* $DESK/astrolabe
49+ fi
50+ done
51+fi
desk/desk.docket-0+2−2
@@ -2,9 +2,9 @@
22 info+'Your guide to the Urbit constellations'
33 color+0x1f.243c
44 image+'https://raw.githubusercontent.com/johnhyde/astrolabe/main/ui/src/assets/astrolabe-tile.svg'
5− glob-ames+[~dister-midlev-mindyr 0v0]
5+ glob-http+['https://s3.us-east-2.amazonaws.com/warkgnall.com/urbit/astrolabe/globs/glob-0ve88fe.q5rn7.uh0da.ct886.b1jd4.glob' 0ve88fe.q5rn7.uh0da.ct886.b1jd4]
66 base+'astrolabe'
7− version+[0 2 2]
7+ version+[0 3 0]
88 website+'https://github.com/johnhyde/astrolabe'
99 license+'MIT'
1010==
desk/mar/webmanifest.hoonnew file+26
@@ -0,0 +1,26 @@
1+::
2+:::: /hoon/webmanifest/mar
3+ ::
4+/? 310
5+ ::
6+:::: compute
7+ ::
8+=, eyre
9+=, format
10+=, html
11+|_ jon=json
12+::
13+++ grow :: convert to
14+ |%
15+ ++ mime [/application/json (as-octs:mimes -:txt)] :: convert to %mime
16+ ++ txt [(crip (en-json jon))]~
17+ --
18+++ grab
19+ |% :: convert from
20+ ++ mime |=([p=mite q=octs] (fall (rush (@t q.q) apex:de-json) *json))
21+ ++ noun json :: clam from %noun
22+ ++ numb numb:enjs
23+ ++ time time:enjs
24+ --
25+++ grad %mime
26+--
install.shdeleted−44
@@ -1,44 +0,0 @@
1−#!/bin/bash
2−#
3−# Taken from: https://github.com/timlucmiptev/btc-agents/blob/master/install.sh
4−# by ~timluc-miptev
5−#
6−usage() { printf "Usage: $0 [-w] URBIT_DESK_DIRECTORY \n(-w: flag to watch and live copy code)\n" 1>&2; exit 1; }
7−
8−if [ $# -eq 0 ]; then
9− usage
10− exit 2
11−fi
12−DESK=$1
13−EXCLUDE_FILE=config/ignore_files_on_install.txt
14−
15−while getopts "w" opt; do
16− case ${opt} in
17− w) WATCH_MODE="true"
18− DESK=$2
19− ;;
20− *) usage
21− ;;
22− esac
23−done
24−
25−if [ -z "$WATCH_MODE" ]; then
26− echo "Installed %astrolabe"
27− rm -r $DESK/*
28− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./base-desk/* $DESK/
29− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./docs-dev-desk/* $DESK/
30− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./desk/* $DESK/
31−
32−else
33− echo "Watching for changes to copy to ${DESK}..."
34− rm -r $DESK/*
35− while [ 0 ]
36− do
37− sleep 0.8
38− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./base-desk/* $DESK/
39− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./docs-dev-desk/* $DESK/
40− rsync -r --copy-links --exclude-from=$EXCLUDE_FILE ./desk/* $DESK/
41−
42− done
43−fi
44−ls
ui/.envnew file+3
@@ -0,0 +1,3 @@
1+VITE_SHIP_URL=http://localhost:8081
2+ASTROLABE_DESK=~/urbit/zod/astrolabe
3+GLOBBER_DESK=~/urbit/zod/globber
ui/package-lock.json+58
@@ -28,6 +28,7 @@
2828 "autoprefixer": "^10.4.2",
2929 "concurrently": "^7.0.0",
3030 "cross-env": "^7.0.3",
31+ "dotenv-cli": "^6.0.0",
3132 "postcss-cli": "^9.1.0",
3233 "sass": "^1.50.0",
3334 "svelte": "^3.48.0",
@@ -875,6 +876,39 @@
875876 "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
876877 "dev": true
877878 },
879+ "node_modules/dotenv": {
880+ "version": "16.0.1",
881+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
882+ "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==",
883+ "dev": true,
884+ "engines": {
885+ "node": ">=12"
886+ }
887+ },
888+ "node_modules/dotenv-cli": {
889+ "version": "6.0.0",
890+ "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-6.0.0.tgz",
891+ "integrity": "sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg==",
892+ "dev": true,
893+ "dependencies": {
894+ "cross-spawn": "^7.0.3",
895+ "dotenv": "^16.0.0",
896+ "dotenv-expand": "^8.0.1",
897+ "minimist": "^1.2.5"
898+ },
899+ "bin": {
900+ "dotenv": "cli.js"
901+ }
902+ },
903+ "node_modules/dotenv-expand": {
904+ "version": "8.0.3",
905+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-8.0.3.tgz",
906+ "integrity": "sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==",
907+ "dev": true,
908+ "engines": {
909+ "node": ">=12"
910+ }
911+ },
878912 "node_modules/electron-to-chromium": {
879913 "version": "1.4.38",
880914 "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.38.tgz",
@@ -3608,6 +3642,30 @@
36083642 "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
36093643 "dev": true
36103644 },
3645+ "dotenv": {
3646+ "version": "16.0.1",
3647+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
3648+ "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==",
3649+ "dev": true
3650+ },
3651+ "dotenv-cli": {
3652+ "version": "6.0.0",
3653+ "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-6.0.0.tgz",
3654+ "integrity": "sha512-qXlCOi3UMDhCWFKe0yq5sg3X+pJAz+RQDiFN38AMSbUrnY3uZshSfDJUAge951OS7J9gwLZGfsBlWRSOYz/TRg==",
3655+ "dev": true,
3656+ "requires": {
3657+ "cross-spawn": "^7.0.3",
3658+ "dotenv": "^16.0.0",
3659+ "dotenv-expand": "^8.0.1",
3660+ "minimist": "^1.2.5"
3661+ }
3662+ },
3663+ "dotenv-expand": {
3664+ "version": "8.0.3",
3665+ "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-8.0.3.tgz",
3666+ "integrity": "sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==",
3667+ "dev": true
3668+ },
36113669 "electron-to-chromium": {
36123670 "version": "1.4.38",
36133671 "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.38.tgz",
ui/package.json+15−6
@@ -1,17 +1,25 @@
11{
22 "name": "urbit-astrolabe",
3− "version": "0.0.0",
43 "type": "module",
4+ "version": "0.3.0",
55 "scripts": {
6− "dev:only": "vite --port 4000 --host",
7− "build:only": "vite build",
6+ "dev:vite": "vite --port 4000 --host",
7+ "build:vite": "vite build",
88 "tailwind:watch": "cross-env TAILWIND_MODE=watch cross-env NODE_ENV=development postcss src/styles/tailwind.css -o src/styles/tailwind-output.css -w",
99 "tailwind:build": "cross-env TAILWIND_MODE=build cross-env NODE_ENV=production postcss src/styles/tailwind.css -o src/styles/tailwind-output.css",
10− "dev": "concurrently \"npm run dev:only\" \"npm run tailwind:watch\"",
11− "build": "npm run tailwind:build && npm run build:only",
10+ "dev": "concurrently \"npm run dev:vite\" \"npm run tailwind:watch\"",
11+ "build": "npm run tailwind:build && npm run build:vite",
1212 "preview": "vite preview",
1313 "check": "svelte-check --tsconfig ./tsconfig.json",
14− "release": "npm run build && ../install.sh "
14+ "_install:glob": "../bin/install.sh $GLOBBER_DESK -g",
15+ "_install:desk": "../bin/install.sh $ASTROLABE_DESK",
16+ "_install:desk:watch": "../bin/install.sh -w $ASTROLABE_DESK",
17+ "install:glob": "dotenv -c local npm run _install:glob",
18+ "install:desk": "dotenv -c local npm run _install:desk",
19+ "install:desk:watch": "dotenv -c local npm run _install:desk:watch",
20+ "release": "npm run build && npm run install:glob",
21+ "_get-glob": "../bin/get_glob.sh $GLOBBER_DESK",
22+ "get-glob": "dotenv -c local npm run _get-glob"
1523 },
1624 "devDependencies": {
1725 "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
@@ -20,6 +28,7 @@
2028 "autoprefixer": "^10.4.2",
2129 "concurrently": "^7.0.0",
2230 "cross-env": "^7.0.3",
31+ "dotenv-cli": "^6.0.0",
2332 "postcss-cli": "^9.1.0",
2433 "sass": "^1.50.0",
2534 "svelte": "^3.48.0",
ui/src/components/search/sigil/SymbolInputModeSelectorButton.svelte+1−1
@@ -17,7 +17,7 @@
1717 {:else if partType === 'line'}
1818 <Symbol components={['lvf', 'lvfl', 'lvfr', 'lhf', 'lhft', 'lhfb', 'lff', 'lbf']} {size} inverted />
1919 {:else if partType === 'arc'}
20− <Symbol components={['abl202', 'abl402', 'abl602', 'abl802' ]} {size} inverted />
20+ <Symbol components={['abl202', 'abl402', 'abl602', 'abl802', 'ar124', 'ar224', 'ar424' ]} {size} inverted />
2121 {:else if partType === 'ring'}
2222 <Symbol components={['rm1', 'rm2', 'rm3']} {size} inverted />
2323 {:else if partType === 'circle'}
ui/src/styles/tailwind-output.css+3−13
@@ -780,9 +780,6 @@ Ensure the default browser behavior of the `hidden` attribute.
780780.min-h-0 {
781781 min-height: 0px;
782782}
783−.min-h-\[20rem\] {
784− min-height: 20rem;
785−}
786783.w-full {
787784 width: 100%;
788785}
@@ -834,15 +831,12 @@ Ensure the default browser behavior of the `hidden` attribute.
834831.w-72 {
835832 width: 18rem;
836833}
837−.w-\[50\%\] {
838− width: 50%;
839−}
840−.w-\[18rem\] {
841− width: 18rem;
842−}
843834.w-16 {
844835 width: 4rem;
845836}
837+.w-\[50\%\] {
838+ width: 50%;
839+}
846840.w-\[48px\] {
847841 width: 48px;
848842}
@@ -1622,10 +1616,6 @@ Ensure the default browser behavior of the `hidden` attribute.
16221616 grid-template-columns: repeat(2, minmax(0, 1fr));
16231617 }
16241618
1625− .xs\:grid-rows-none {
1626− grid-template-rows: none;
1627− }
1628−
16291619 .xs\:flex-row {
16301620 flex-direction: row;
16311621 }