on master help sign in
Added %journal backend code
commit39ecaf6a142ad539e615eb715abf179c83923b26 authoriko <mail@iko.soy> dateFri 16 Jun 2023, 21:10 (3 years ago) parentf224d6c
25 files changed+1533
example/journal/app/journal.hoon+126 example/journal/desk.bill+2 example/journal/desk.docket-0+12 example/journal/gen/journal/add.hoon+37 example/journal/lib/agentio.hoon+139 example/journal/lib/dbug.hoon+155 example/journal/lib/default-agent.hoon+69 example/journal/lib/docket.hoon+223 example/journal/lib/journal.hoon+66 example/journal/lib/skeleton.hoon+51 example/journal/mar/bill.hoon+34 example/journal/mar/docket-0.hoon+25 example/journal/mar/hoon.hoon+49 example/journal/mar/jam.hoon+17 example/journal/mar/journal/action.hoon+14 example/journal/mar/journal/update.hoon+16 example/journal/mar/json.hoon+26 example/journal/mar/kelvin.hoon+28 example/journal/mar/mime.hoon+32 example/journal/mar/noun.hoon+19 example/journal/mar/txt-diff.hoon+16 example/journal/mar/txt.hoon+275 example/journal/sur/docket.hoon+82 example/journal/sur/journal.hoon+19 example/journal/sys.kelvin+1
example/journal/app/journal.hoonnew file+126
@@ -0,0 +1,126 @@
1+/- *journal
2+/+ default-agent, dbug, agentio
3+|%
4++$ versioned-state
5+ $% state-0
6+ ==
7++$ state-0 [%0 =journal =log]
8++$ card card:agent:gall
9+++ j-orm ((on id txt) gth)
10+++ log-orm ((on @ action) lth)
11+++ unique-time
12+ |= [=time =log]
13+ ^- @
14+ =/ unix-ms=@
15+ (unm:chrono:userlib time)
16+ |-
17+ ?. (has:log-orm log unix-ms)
18+ unix-ms
19+ $(time (add unix-ms 1))
20+--
21+%- agent:dbug
22+=| state-0
23+=* state -
24+^- agent:gall
25+|_ =bowl:gall
26++* this .
27+ def ~(. (default-agent this %|) bowl)
28+ io ~(. agentio bowl)
29+++ on-init on-init:def
30+++ on-save
31+ ^- vase
32+ !>(state)
33+::
34+++ on-load
35+ |= old-vase=vase
36+ ^- (quip card _this)
37+ `this(state !<(versioned-state old-vase))
38+::
39+++ on-poke
40+ |= [=mark =vase]
41+ ^- (quip card _this)
42+ |^
43+ ?> (team:title our.bowl src.bowl)
44+ ?. ?=(%journal-action mark) (on-poke:def mark vase)
45+ =/ now=@ (unique-time now.bowl log)
46+ =/ act !<(action vase)
47+ =. state (poke-action act)
48+ :_ this(log (put:log-orm log now act))
49+ ~[(fact:io journal-update+!>(`update`[now act]) ~[/updates])]
50+ ::
51+ ++ poke-action
52+ |= act=action
53+ ^- _state
54+ ?- -.act
55+ %add
56+ ?< (has:j-orm journal id.act)
57+ state(journal (put:j-orm journal id.act txt.act))
58+ ::
59+ %edit
60+ ?> (has:j-orm journal id.act)
61+ state(journal (put:j-orm journal id.act txt.act))
62+ ::
63+ %del
64+ ?> (has:j-orm journal id.act)
65+ state(journal +:(del:j-orm journal id.act))
66+ ==
67+ --
68+::
69+++ on-watch
70+ |= =path
71+ ^- (quip card _this)
72+ ?> (team:title our.bowl src.bowl)
73+ ?+ path (on-watch:def path)
74+ [%updates ~] `this
75+ ==
76+::
77+++ on-peek
78+ |= =path
79+ ^- (unit (unit cage))
80+ ?> (team:title our.bowl src.bowl)
81+ =/ now=@ (unm:chrono:userlib now.bowl)
82+ ?+ path (on-peek:def path)
83+ [%x %entries *]
84+ ?+ t.t.path (on-peek:def path)
85+ [%all ~]
86+ :^ ~ ~ %journal-update
87+ !> ^- update
88+ [now %jrnl (tap:j-orm journal)]
89+ ::
90+ [%before @ @ ~]
91+ =/ before=@ (rash i.t.t.t.path dem)
92+ =/ max=@ (rash i.t.t.t.t.path dem)
93+ :^ ~ ~ %journal-update
94+ !> ^- update
95+ [now %jrnl (tab:j-orm journal `before max)]
96+ ::
97+ [%between @ @ ~]
98+ =/ start=@
99+ =+ (rash i.t.t.t.path dem)
100+ ?:(=(0 -) - (sub - 1))
101+ =/ end=@ (add 1 (rash i.t.t.t.t.path dem))
102+ :^ ~ ~ %journal-update
103+ !> ^- update
104+ [now %jrnl (tap:j-orm (lot:j-orm journal `end `start))]
105+ ==
106+ ::
107+ [%x %updates *]
108+ ?+ t.t.path (on-peek:def path)
109+ [%all ~]
110+ :^ ~ ~ %journal-update
111+ !> ^- update
112+ [now %logs (tap:log-orm log)]
113+ ::
114+ [%since @ ~]
115+ =/ since=@ (rash i.t.t.t.path dem)
116+ :^ ~ ~ %journal-update
117+ !> ^- update
118+ [now %logs (tap:log-orm (lot:log-orm log `since ~))]
119+ ==
120+ ==
121+::
122+++ on-leave on-leave:def
123+++ on-agent on-agent:def
124+++ on-arvo on-arvo:def
125+++ on-fail on-fail:def
126+--
example/journal/desk.billnew file+2
@@ -0,0 +1,2 @@
1+:~ %journal
2+==
example/journal/desk.docket-0new file+12
@@ -0,0 +1,12 @@
1+:~
2+ title+'Journal'
3+ info+'Dear diary...'
4+ color+0xd9.b06d
5+ version+[0 1 1]
6+ website+'https://urbit.org'
7+ license+'MIT'
8+ base+'journal'
9+ :+ %glob-http
10+ 'https://m.tinnus-napbus.xyz/pub/journal-glob-0v3.gjphm.jp4u3.59f0f.a67bf.446k4.glob'
11+ 0v3.gjphm.jp4u3.59f0f.a67bf.446k4
12+==
example/journal/gen/journal/add.hoonnew file+37
@@ -0,0 +1,37 @@
1+/- *journal, *sole
2+/+ *generators
3+:- %ask
4+|= [[now=@da * bek=beak] *]
5+^- (sole-product (cask action))
6+=| acc=wain
7+=/ off=tape
8+ =/ blit
9+ =+ [our=(scot %p p.bek) now=(scot %da p.r.bek)]
10+ .^(blit:dill %dx /[our]//[now]/sessions//line)
11+ ?. ?=(%lin -.blit) !!
12+ %+ scan (tufa p.blit)
13+ ;~ sfix
14+ %+ cook
15+ |=(t=tape (reap (add 2 (lent t)) ' '))
16+ (star ;~(less gar next))
17+ (star next)
18+ ==
19+|^
20+%+ print leaf+"{off}-------------------------------------\0a"
21+%+ print leaf+"{off}| |"
22+%+ print leaf+"{off}| (\\\\\\ to submit, <BKSP> to cancel) |"
23+%+ print leaf+"{off}| New Journal Entry |"
24+%+ print leaf+"{off}| |"
25+%+ print leaf+"\0a{off}-------------------------------------"
26+line
27+++ line
28+ %+ prompt [%& %prompt ""]
29+ |= t=tape
30+ ?: =(t "\\\\\\")
31+ %+ produce %journal-action
32+ :+ %add
33+ (unm:chrono:userlib now)
34+ (of-wain:format (flop acc))
35+ %+ print leaf+"{off}{t}"
36+ line(acc [(crip t) acc])
37+--
example/journal/lib/agentio.hoonnew file+139
@@ -0,0 +1,139 @@
1+=>
2+ |%
3+ ++ card card:agent:gall
4+ --
5+::
6+|_ =bowl:gall
7+++ scry
8+ |= [desk=@tas =path]
9+ %+ weld
10+ /(scot %p our.bowl)/[desk]/(scot %da now.bowl)
11+ path
12+::
13+++ pass
14+ |_ =wire
15+ ++ poke
16+ |= [=dock =cage]
17+ [%pass wire %agent dock %poke cage]
18+ ::
19+ ++ poke-our
20+ |= [app=term =cage]
21+ ^- card
22+ (poke [our.bowl app] cage)
23+ ::
24+ ++ poke-self
25+ |= =cage
26+ ^- card
27+ (poke-our dap.bowl cage)
28+ ::
29+ ++ arvo
30+ |= =note-arvo
31+ ^- card
32+ [%pass wire %arvo note-arvo]
33+ ::
34+ ++ watch
35+ |= [=dock =path]
36+ [%pass (watch-wire path) %agent dock %watch path]
37+ ::
38+ ++ watch-our
39+ |= [app=term =path]
40+ (watch [our.bowl app] path)
41+ ::
42+ ++ watch-wire
43+ |= =path
44+ ^+ wire
45+ ?. ?=(~ wire)
46+ wire
47+ agentio-watch+path
48+ ::
49+ ++ leave
50+ |= =dock
51+ [%pass wire %agent dock %leave ~]
52+ ::
53+ ++ leave-our
54+ |= app=term
55+ (leave our.bowl app)
56+ ::
57+ ++ leave-path
58+ |= [=dock =path]
59+ =. wire
60+ (watch-wire path)
61+ (leave dock)
62+ ::
63+ ++ wait
64+ |= p=@da
65+ (arvo %b %wait p)
66+ ::
67+ ++ rest
68+ |= p=@da
69+ (arvo %b %wait p)
70+ ::
71+ ++ warp
72+ |= [wer=ship =riff:clay]
73+ (arvo %c %warp wer riff)
74+ ::
75+ ++ warp-our
76+ |= =riff:clay
77+ (warp our.bowl riff)
78+ ::
79+ :: right here, right now
80+ ++ warp-slim
81+ |= [genre=?(%sing %next) =care:clay =path]
82+ =/ =mood:clay
83+ [care r.byk.bowl path]
84+ =/ =rave:clay
85+ ?:(?=(%sing genre) [genre mood] [genre mood])
86+ (warp-our q.byk.bowl `rave)
87+ ::
88+ ++ connect
89+ |= [=binding:eyre app=term]
90+ (arvo %e %connect binding app)
91+ --
92+::
93+++ fact-curry
94+ |* [=mark =mold]
95+ |= [paths=(list path) fac=mold]
96+ (fact mark^!>(fac) paths)
97+::
98+++ fact-kick
99+ |= [=path =cage]
100+ ^- (list card)
101+ :~ (fact cage ~[path])
102+ (kick ~[path])
103+ ==
104+::
105+++ fact-init
106+ |= =cage
107+ ^- card
108+ [%give %fact ~ cage]
109+::
110+++ fact-init-kick
111+ |= =cage
112+ ^- (list card)
113+ :~ (fact cage ~)
114+ (kick ~)
115+ ==
116+::
117+++ fact
118+ |= [=cage paths=(list path)]
119+ ^- card
120+ [%give %fact paths cage]
121+::
122+++ fact-all
123+ |= =cage
124+ ^- (unit card)
125+ =/ paths=(set path)
126+ %- ~(gas in *(set path))
127+ %+ turn ~(tap by sup.bowl)
128+ |=([duct ship =path] path)
129+ ?: =(~ paths) ~
130+ `(fact cage ~(tap in paths))
131+::
132+++ kick
133+ |= paths=(list path)
134+ [%give %kick paths ~]
135+::
136+++ kick-only
137+ |= [=ship paths=(list path)]
138+ [%give %kick paths `ship]
139+--
example/journal/lib/dbug.hoonnew file+155
@@ -0,0 +1,155 @@
1+:: dbug: agent wrapper for generic debugging tools
2+::
3+:: usage: %-(agent:dbug your-agent)
4+::
5+|%
6++$ poke
7+ $% [%bowl ~]
8+ [%state grab=cord]
9+ [%incoming =about]
10+ [%outgoing =about]
11+ ==
12+::
13++$ about
14+ $@ ~
15+ $% [%ship =ship]
16+ [%path =path]
17+ [%wire =wire]
18+ [%term =term]
19+ ==
20+::
21+++ agent
22+ |= =agent:gall
23+ ^- agent:gall
24+ !.
25+ |_ =bowl:gall
26+ +* this .
27+ ag ~(. agent bowl)
28+ ::
29+ ++ on-poke
30+ |= [=mark =vase]
31+ ^- (quip card:agent:gall agent:gall)
32+ ?. ?=(%dbug mark)
33+ =^ cards agent (on-poke:ag mark vase)
34+ [cards this]
35+ =/ dbug
36+ !<(poke vase)
37+ =; =tang
38+ ((%*(. slog pri 1) tang) [~ this])
39+ ?- -.dbug
40+ %bowl [(sell !>(bowl))]~
41+ ::
42+ %state
43+ =? grab.dbug =('' grab.dbug) '-'
44+ =; product=^vase
45+ [(sell product)]~
46+ =/ state=^vase
47+ :: if the underlying app has implemented a /dbug/state scry endpoint,
48+ :: use that vase in place of +on-save's.
49+ ::
50+ =/ result=(each ^vase tang)
51+ (mule |.(q:(need (need (on-peek:ag /x/dbug/state)))))
52+ ?:(?=(%& -.result) p.result on-save:ag)
53+ %+ slap
54+ (slop state !>([bowl=bowl ..zuse]))
55+ (ream grab.dbug)
56+ ::
57+ %incoming
58+ =; =tang
59+ ?^ tang tang
60+ [%leaf "no matching subscriptions"]~
61+ %+ murn
62+ %+ sort ~(tap by sup.bowl)
63+ |= [[* a=[=ship =path]] [* b=[=ship =path]]]
64+ (aor [path ship]:a [path ship]:b)
65+ |= [=duct [=ship =path]]
66+ ^- (unit tank)
67+ =; relevant=?
68+ ?. relevant ~
69+ `>[path=path from=ship duct=duct]<
70+ ?: ?=(~ about.dbug) &
71+ ?- -.about.dbug
72+ %ship =(ship ship.about.dbug)
73+ %path ?=(^ (find path.about.dbug path))
74+ %wire %+ lien duct
75+ |=(=wire ?=(^ (find wire.about.dbug wire)))
76+ %term !!
77+ ==
78+ ::
79+ %outgoing
80+ =; =tang
81+ ?^ tang tang
82+ [%leaf "no matching subscriptions"]~
83+ %+ murn
84+ %+ sort ~(tap by wex.bowl)
85+ |= [[[a=wire *] *] [[b=wire *] *]]
86+ (aor a b)
87+ |= [[=wire =ship =term] [acked=? =path]]
88+ ^- (unit tank)
89+ =; relevant=?
90+ ?. relevant ~
91+ `>[wire=wire agnt=[ship term] path=path ackd=acked]<
92+ ?: ?=(~ about.dbug) &
93+ ?- -.about.dbug
94+ %ship =(ship ship.about.dbug)
95+ %path ?=(^ (find path.about.dbug path))
96+ %wire ?=(^ (find wire.about.dbug wire))
97+ %term =(term term.about.dbug)
98+ ==
99+ ==
100+ ::
101+ ++ on-peek
102+ |= =path
103+ ^- (unit (unit cage))
104+ ?. ?=([@ %dbug *] path)
105+ (on-peek:ag path)
106+ ?+ path [~ ~]
107+ [%u %dbug ~] ``noun+!>(&)
108+ [%x %dbug %state ~] ``noun+!>(on-save:ag)
109+ [%x %dbug %subscriptions ~] ``noun+!>([wex sup]:bowl)
110+ ==
111+ ::
112+ ++ on-init
113+ ^- (quip card:agent:gall agent:gall)
114+ =^ cards agent on-init:ag
115+ [cards this]
116+ ::
117+ ++ on-save on-save:ag
118+ ::
119+ ++ on-load
120+ |= old-state=vase
121+ ^- (quip card:agent:gall agent:gall)
122+ =^ cards agent (on-load:ag old-state)
123+ [cards this]
124+ ::
125+ ++ on-watch
126+ |= =path
127+ ^- (quip card:agent:gall agent:gall)
128+ =^ cards agent (on-watch:ag path)
129+ [cards this]
130+ ::
131+ ++ on-leave
132+ |= =path
133+ ^- (quip card:agent:gall agent:gall)
134+ =^ cards agent (on-leave:ag path)
135+ [cards this]
136+ ::
137+ ++ on-agent
138+ |= [=wire =sign:agent:gall]
139+ ^- (quip card:agent:gall agent:gall)
140+ =^ cards agent (on-agent:ag wire sign)
141+ [cards this]
142+ ::
143+ ++ on-arvo
144+ |= [=wire =sign-arvo]
145+ ^- (quip card:agent:gall agent:gall)
146+ =^ cards agent (on-arvo:ag wire sign-arvo)
147+ [cards this]
148+ ::
149+ ++ on-fail
150+ |= [=term =tang]
151+ ^- (quip card:agent:gall agent:gall)
152+ =^ cards agent (on-fail:ag term tang)
153+ [cards this]
154+ --
155+--
example/journal/lib/default-agent.hoonnew file+69
@@ -0,0 +1,69 @@
1+/+ skeleton
2+|* [agent=* help=*]
3+?: ?=(%& help)
4+ ~| %default-agent-helpfully-crashing
5+ skeleton
6+|_ =bowl:gall
7+++ on-init
8+ `agent
9+::
10+++ on-save
11+ !>(~)
12+::
13+++ on-load
14+ |= old-state=vase
15+ `agent
16+::
17+++ on-poke
18+ |= =cage
19+ ~| "unexpected poke to {<dap.bowl>} with mark {<p.cage>}"
20+ !!
21+::
22+++ on-watch
23+ |= =path
24+ ~| "unexpected subscription to {<dap.bowl>} on path {<path>}"
25+ !!
26+::
27+++ on-leave
28+ |= path
29+ `agent
30+::
31+++ on-peek
32+ |= =path
33+ ~| "unexpected scry into {<dap.bowl>} on path {<path>}"
34+ !!
35+::
36+++ on-agent
37+ |= [=wire =sign:agent:gall]
38+ ^- (quip card:agent:gall _agent)
39+ ?- -.sign
40+ %poke-ack
41+ ?~ p.sign
42+ `agent
43+ %- (slog leaf+"poke failed from {<dap.bowl>} on wire {<wire>}" u.p.sign)
44+ `agent
45+ ::
46+ %watch-ack
47+ ?~ p.sign
48+ `agent
49+ =/ =tank leaf+"subscribe failed from {<dap.bowl>} on wire {<wire>}"
50+ %- (slog tank u.p.sign)
51+ `agent
52+ ::
53+ %kick `agent
54+ %fact
55+ ~| "unexpected subscription update to {<dap.bowl>} on wire {<wire>}"
56+ ~| "with mark {<p.cage.sign>}"
57+ !!
58+ ==
59+::
60+++ on-arvo
61+ |= [=wire =sign-arvo]
62+ ~| "unexpected system response {<-.sign-arvo>} to {<dap.bowl>} on wire {<wire>}"
63+ !!
64+::
65+++ on-fail
66+ |= [=term =tang]
67+ %- (slog leaf+"error in {<dap.bowl>}" >term< tang)
68+ `agent
69+--
example/journal/lib/docket.hoonnew file+223
@@ -0,0 +1,223 @@
1+/- *docket
2+|%
3+::
4+++ mime
5+ |%
6+ +$ draft
7+ $: title=(unit @t)
8+ info=(unit @t)
9+ color=(unit @ux)
10+ glob-http=(unit [=url hash=@uvH])
11+ glob-ames=(unit [=ship hash=@uvH])
12+ base=(unit term)
13+ site=(unit path)
14+ image=(unit url)
15+ version=(unit version)
16+ website=(unit url)
17+ license=(unit cord)
18+ ==
19+ ::
20+ ++ finalize
21+ |= =draft
22+ ^- (unit docket)
23+ ?~ title.draft ~
24+ ?~ info.draft ~
25+ ?~ color.draft ~
26+ ?~ version.draft ~
27+ ?~ website.draft ~
28+ ?~ license.draft ~
29+ =/ href=(unit href)
30+ ?^ site.draft `[%site u.site.draft]
31+ ?~ base.draft ~
32+ ?^ glob-http.draft
33+ `[%glob u.base hash.u.glob-http %http url.u.glob-http]:draft
34+ ?~ glob-ames.draft
35+ ~
36+ `[%glob u.base hash.u.glob-ames %ames ship.u.glob-ames]:draft
37+ ?~ href ~
38+ =, draft
39+ :- ~
40+ :* %1
41+ u.title
42+ u.info
43+ u.color
44+ u.href
45+ image
46+ u.version
47+ u.website
48+ u.license
49+ ==
50+ ::
51+ ++ from-clauses
52+ =| =draft
53+ |= cls=(list clause)
54+ ^- (unit docket)
55+ =* loop $
56+ ?~ cls (finalize draft)
57+ =* clause i.cls
58+ =. draft
59+ ?- -.clause
60+ %title draft(title `title.clause)
61+ %info draft(info `info.clause)
62+ %color draft(color `color.clause)
63+ %glob-http draft(glob-http `[url hash]:clause)
64+ %glob-ames draft(glob-ames `[ship hash]:clause)
65+ %base draft(base `base.clause)
66+ %site draft(site `path.clause)
67+ %image draft(image `url.clause)
68+ %version draft(version `version.clause)
69+ %website draft(website `website.clause)
70+ %license draft(license `license.clause)
71+ ==
72+ loop(cls t.cls)
73+ ::
74+ ++ to-clauses
75+ |= d=docket
76+ ^- (list clause)
77+ %- zing
78+ :~ :~ title+title.d
79+ info+info.d
80+ color+color.d
81+ version+version.d
82+ website+website.d
83+ license+license.d
84+ ==
85+ ?~ image.d ~ ~[image+u.image.d]
86+ ?: ?=(%site -.href.d) ~[site+path.href.d]
87+ =/ ref=glob-reference glob-reference.href.d
88+ :~ base+base.href.d
89+ ?- -.location.ref
90+ %http [%glob-http url.location.ref hash.ref]
91+ %ames [%glob-ames ship.location.ref hash.ref]
92+ == == ==
93+ ::
94+ ++ spit-clause
95+ |= =clause
96+ ^- tape
97+ %+ weld " {(trip -.clause)}+"
98+ ?+ -.clause "'{(trip +.clause)}'"
99+ %color (scow %ux color.clause)
100+ %site (spud path.clause)
101+ ::
102+ %glob-http
103+ "['{(trip url.clause)}' {(scow %uv hash.clause)}]"
104+ ::
105+ %glob-ames
106+ "[{(scow %p ship.clause)} {(scow %uv hash.clause)}]"
107+ ::
108+ %version
109+ =, version.clause
110+ "[{(scow %ud major)} {(scow %ud minor)} {(scow %ud patch)}]"
111+ ==
112+ ::
113+ ++ spit-docket
114+ |= dock=docket
115+ ^- tape
116+ ;: welp
117+ ":~\0a"
118+ `tape`(zing (join "\0a" (turn (to-clauses dock) spit-clause)))
119+ "\0a=="
120+ ==
121+ --
122+::
123+++ enjs
124+ =, enjs:format
125+ |%
126+ ::
127+ ++ charge-update
128+ |= u=^charge-update
129+ ^- json
130+ %+ frond -.u
131+ ^- json
132+ ?- -.u
133+ %del-charge s+desk.u
134+ ::
135+ %initial
136+ %- pairs
137+ %+ turn ~(tap by initial.u)
138+ |=([=desk c=^charge] [desk (charge c)])
139+ ::
140+ %add-charge
141+ %- pairs
142+ :~ desk+s+desk.u
143+ charge+(charge charge.u)
144+ ==
145+ ==
146+ ::
147+ ++ num
148+ |= a=@u
149+ ^- ^tape
150+ =/ p=json (numb a)
151+ ?> ?=(%n -.p)
152+ (trip p.p)
153+ ::
154+ ++ version
155+ |= v=^version
156+ ^- json
157+ :- %s
158+ %- crip
159+ "{(num major.v)}.{(num minor.v)}.{(num patch.v)}"
160+ ::
161+ ++ merge
162+ |= [a=json b=json]
163+ ^- json
164+ ?> &(?=(%o -.a) ?=(%o -.b))
165+ [%o (~(uni by p.a) p.b)]
166+ ::
167+ ++ href
168+ |= h=^href
169+ %+ frond -.h
170+ ?- -.h
171+ %site s+(spat path.h)
172+ %glob
173+ %- pairs
174+ :~ base+s+base.h
175+ glob-reference+(glob-reference glob-reference.h)
176+ ==
177+ ==
178+ ::
179+ ++ glob-reference
180+ |= ref=^glob-reference
181+ %- pairs
182+ :~ hash+s+(scot %uv hash.ref)
183+ location+(glob-location location.ref)
184+ ==
185+ ::
186+ ++ glob-location
187+ |= loc=^glob-location
188+ ^- json
189+ %+ frond -.loc
190+ ?- -.loc
191+ %http s+url.loc
192+ %ames s+(scot %p ship.loc)
193+ ==
194+ ::
195+ ++ charge
196+ |= c=^charge
197+ %+ merge (docket docket.c)
198+ %- pairs
199+ :~ chad+(chad chad.c)
200+ ==
201+ ::
202+ ++ docket
203+ |= d=^docket
204+ ^- json
205+ %- pairs
206+ :~ title+s+title.d
207+ info+s+info.d
208+ color+s+(scot %ux color.d)
209+ href+(href href.d)
210+ image+?~(image.d ~ s+u.image.d)
211+ version+(version version.d)
212+ license+s+license.d
213+ website+s+website.d
214+ ==
215+ ::
216+ ++ chad
217+ |= c=^chad
218+ %+ frond -.c
219+ ?+ -.c ~
220+ %hung s+err.c
221+ ==
222+ --
223+--
example/journal/lib/journal.hoonnew file+66
@@ -0,0 +1,66 @@
1+/- *journal
2+|%
3+++ dejs-action
4+ =, dejs:format
5+ |= jon=json
6+ ^- action
7+ %. jon
8+ %- of
9+ :~ [%add (ot ~[id+ni txt+so])]
10+ [%edit (ot ~[id+ni txt+so])]
11+ [%del (ot ~[id+ni])]
12+ ==
13+++ enjs-update
14+ =, enjs:format
15+ |= upd=update
16+ ^- json
17+ |^
18+ ?+ -.q.upd (logged upd)
19+ %jrnl
20+ %- pairs
21+ :~ ['time' (numb p.upd)]
22+ ['entries' a+(turn list.q.upd entry)]
23+ ==
24+ ::
25+ %logs
26+ %- pairs
27+ :~ ['time' (numb p.upd)]
28+ ['logs' a+(turn list.q.upd logged)]
29+ ==
30+ ==
31+ ++ entry
32+ |= ent=^entry
33+ ^- json
34+ %- pairs
35+ :~ ['id' (numb id.ent)]
36+ ['txt' s+txt.ent]
37+ ==
38+ ++ logged
39+ |= lgd=^logged
40+ ^- json
41+ ?- -.q.lgd
42+ %add
43+ %- pairs
44+ :~ ['time' (numb p.lgd)]
45+ :- 'add'
46+ %- pairs
47+ :~ ['id' (numb id.q.lgd)]
48+ ['txt' s+txt.q.lgd]
49+ == ==
50+ %edit
51+ %- pairs
52+ :~ ['time' (numb p.lgd)]
53+ :- 'edit'
54+ %- pairs
55+ :~ ['id' (numb id.q.lgd)]
56+ ['txt' s+txt.q.lgd]
57+ == ==
58+ %del
59+ %- pairs
60+ :~ ['time' (numb p.lgd)]
61+ :- 'del'
62+ (frond 'id' (numb id.q.lgd))
63+ ==
64+ ==
65+ --
66+--
example/journal/lib/skeleton.hoonnew file+51
@@ -0,0 +1,51 @@
1+:: Similar to default-agent except crashes everywhere
2+^- agent:gall
3+|_ bowl:gall
4+++ on-init
5+ ^- (quip card:agent:gall agent:gall)
6+ !!
7+::
8+++ on-save
9+ ^- vase
10+ !!
11+::
12+++ on-load
13+ |~ old-state=vase
14+ ^- (quip card:agent:gall agent:gall)
15+ !!
16+::
17+++ on-poke
18+ |~ in-poke-data=cage
19+ ^- (quip card:agent:gall agent:gall)
20+ !!
21+::
22+++ on-watch
23+ |~ path
24+ ^- (quip card:agent:gall agent:gall)
25+ !!
26+::
27+++ on-leave
28+ |~ path
29+ ^- (quip card:agent:gall agent:gall)
30+ !!
31+::
32+++ on-peek
33+ |~ path
34+ ^- (unit (unit cage))
35+ !!
36+::
37+++ on-agent
38+ |~ [wire sign:agent:gall]
39+ ^- (quip card:agent:gall agent:gall)
40+ !!
41+::
42+++ on-arvo
43+ |~ [wire =sign-arvo]
44+ ^- (quip card:agent:gall agent:gall)
45+ !!
46+::
47+++ on-fail
48+ |~ [term tang]
49+ ^- (quip card:agent:gall agent:gall)
50+ !!
51+--
example/journal/mar/bill.hoonnew file+34
@@ -0,0 +1,34 @@
1+|_ bil=(list dude:gall)
2+++ grow
3+ |%
4+ ++ mime `^mime`[/text/x-bill (as-octs:mimes:html hoon)]
5+ ++ noun bil
6+ ++ hoon
7+ ^- @t
8+ |^ (crip (of-wall:format (wrap-lines (spit-duz bil))))
9+ ::
10+ ++ wrap-lines
11+ |= taz=wall
12+ ^- wall
13+ ?~ taz ["~"]~
14+ :- (weld ":~ " i.taz)
15+ %- snoc :_ "=="
16+ (turn t.taz |=(t=tape (weld " " t)))
17+ ::
18+ ++ spit-duz
19+ |= duz=(list dude:gall)
20+ ^- wall
21+ (turn duz |=(=dude:gall ['%' (trip dude)]))
22+ --
23+ ++ txt (to-wain:format hoon)
24+ --
25+++ grab
26+ |%
27+ ++ noun (list dude:gall)
28+ ++ mime
29+ |= [=mite len=@ud tex=@]
30+ ~_ tex
31+ !<((list dude:gall) (slap !>(~) (ream tex)))
32+ --
33+++ grad %noun
34+--
example/journal/mar/docket-0.hoonnew file+25
@@ -0,0 +1,25 @@
1+/+ dock=docket
2+|_ =docket:dock
3+++ grow
4+ |%
5+ ++ mime
6+ ^- ^mime
7+ [/text/x-docket (as-octt:mimes:html (spit-docket:mime:dock docket))]
8+ ++ noun docket
9+ ++ json (docket:enjs:dock docket)
10+ --
11+++ grab
12+ |%
13+ ::
14+ ++ mime
15+ |= [=mite len=@ud tex=@]
16+ ^- docket:dock
17+ %- need
18+ %- from-clauses:mime:dock
19+ !<((list clause:dock) (slap !>(~) (ream tex)))
20+
21+ ::
22+ ++ noun docket:dock
23+ --
24+++ grad %noun
25+--
example/journal/mar/hoon.hoonnew file+49
@@ -0,0 +1,49 @@
1+:::: /hoon/hoon/mar
2+ ::
3+/? 310
4+::
5+=, eyre
6+|_ own=@t
7+::
8+++ grow :: convert to
9+ |%
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+ :: ==
23+ ++ hymn
24+ :: ;html:(head:title:"Source" "+{elem}")
25+ ;html
26+ ;head
27+ ;title:"Source"
28+ ;script@"//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js";
29+ ;script@"/lib/syntax/hoon.js";
30+ ;link(rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/".
31+ "codemirror/4.3.0/codemirror.min.css");
32+ ;link/"/lib/syntax/codemirror.css"(rel "stylesheet");
33+ ==
34+ ;body
35+ ;textarea#src:"{(trip own)}"
36+ ;script:'CodeMirror.fromTextArea(src, {lineNumbers:true, readOnly:true})'
37+ ==
38+ ==
39+ ++ txt
40+ (to-wain:format own)
41+ --
42+++ grab
43+ |% :: convert from
44+ ++ mime |=([p=mite q=octs] q.q)
45+ ++ noun @t :: clam from %noun
46+ ++ txt of-wain:format
47+ --
48+++ grad %txt
49+--
example/journal/mar/jam.hoonnew file+17
@@ -0,0 +1,17 @@
1+::
2+:::: /hoon/jam/mar
3+ ::
4+/? 310
5+::
6+=, mimes:html
7+|_ mud=@
8+++ grow
9+ |%
10+ ++ mime [/application/octet-stream (as-octs mud)]
11+ --
12+++ grab
13+ |% :: convert from
14+ ++ noun @ :: clam from %noun
15+ --
16+++ grad %mime
17+--
example/journal/mar/journal/action.hoonnew file+14
@@ -0,0 +1,14 @@
1+/- *journal
2+/+ *journal
3+|_ act=action
4+++ grow
5+ |%
6+ ++ noun act
7+ --
8+++ grab
9+ |%
10+ ++ noun action
11+ ++ json dejs-action
12+ --
13+++ grad %noun
14+--
example/journal/mar/journal/update.hoonnew file+16
@@ -0,0 +1,16 @@
1+/- *journal
2+/+ *journal
3+|_ upd=update
4+++ grow
5+ |%
6+ ++ noun upd
7+ ++ json (enjs-update upd)
8+ ++ jam (^jam upd)
9+ --
10+++ grab
11+ |%
12+ ++ noun update
13+ ++ jam cue
14+ --
15+++ grad %noun
16+--
example/journal/mar/json.hoonnew file+26
@@ -0,0 +1,26 @@
1+::
2+:::: /hoon/json/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 [(en:json jon)]~
17+ --
18+++ grab
19+ |% :: convert from
20+ ++ mime |=([p=mite q=octs] (fall (de:json (@t q.q)) *^json))
21+ ++ noun ^json :: clam from %noun
22+ ++ numb numb:enjs
23+ ++ time time:enjs
24+ --
25+++ grad %mime
26+--
example/journal/mar/kelvin.hoonnew file+28
@@ -0,0 +1,28 @@
1+|_ kal=waft:clay
2+++ grow
3+ |%
4+ ++ mime `^mime`[/text/x-kelvin (as-octs:mimes:html hoon)]
5+ ++ noun kal
6+ ++ hoon
7+ %+ rap 3
8+ %+ turn
9+ %+ sort
10+ ~(tap in (waft-to-wefts:clay kal))
11+ |= [a=weft b=weft]
12+ ?: =(lal.a lal.b)
13+ (gte num.a num.b)
14+ (gte lal.a lal.b)
15+ |= =weft
16+ (rap 3 '[%' (scot %tas lal.weft) ' ' (scot %ud num.weft) ']\0a' ~)
17+ ::
18+ ++ txt (to-wain:format hoon)
19+ --
20+++ grab
21+ |%
22+ ++ noun waft:clay
23+ ++ mime
24+ |= [=mite len=@ud tex=@]
25+ (cord-to-waft:clay tex)
26+ --
27+++ grad %noun
28+--
example/journal/mar/mime.hoonnew file+32
@@ -0,0 +1,32 @@
1+::
2+:::: /hoon/mime/mar
3+ ::
4+/? 310
5+::
6+|_ own=mime
7+++ grow
8+ ^?
9+ |%
10+ ++ jam `@`q.q.own
11+ --
12+::
13+++ grab :: convert from
14+ ^?
15+ |%
16+ ++ noun mime :: clam from %noun
17+ ++ tape
18+ |=(a=_"" [/application/x-urb-unknown (as-octt:mimes:html a)])
19+ --
20+++ grad
21+ ^?
22+ |%
23+ ++ form %mime
24+ ++ diff |=(mime +<)
25+ ++ pact |=(mime +<)
26+ ++ join |=([mime mime] `(unit mime)`~)
27+ ++ mash
28+ |= [[ship desk mime] [ship desk mime]]
29+ ^- mime
30+ ~|(%mime-mash !!)
31+ --
32+--
example/journal/mar/noun.hoonnew file+19
@@ -0,0 +1,19 @@
1+::
2+:::: /hoon/noun/mar
3+ ::
4+/? 310
5+!:
6+:::: A minimal noun mark
7+|_ non=*
8+++ grab |%
9+ ++ noun *
10+ --
11+++ grad
12+ |%
13+ ++ form %noun
14+ ++ diff |=(* +<)
15+ ++ pact |=(* +<)
16+ ++ join |=([* *] *(unit *))
17+ ++ mash |=([[ship desk *] [ship desk *]] `*`~|(%noun-mash !!))
18+ --
19+--
example/journal/mar/txt-diff.hoonnew file+16
@@ -0,0 +1,16 @@
1+::
2+:::: /hoon/txt-diff/mar
3+ ::
4+/? 310
5+|_ txt-diff=(urge:clay cord)
6+::
7+++ grad %noun
8+++ grow
9+ |%
10+ ++ noun txt-diff
11+ --
12+++ grab :: convert from
13+ |%
14+ ++ noun (urge:clay cord) :: make from %noun
15+ --
16+--
example/journal/mar/txt.hoonnew file+275
@@ -0,0 +1,275 @@
1+::
2+:::: /hoon/txt/mar
3+ ::
4+/? 310
5+::
6+=, clay
7+=, differ
8+=, format
9+=, mimes:html
10+|_ txt=wain
11+::
12+++ grab :: convert from
13+ |%
14+ ++ mime |=((pair mite octs) (to-wain q.q))
15+ ++ noun wain :: clam from %noun
16+ --
17+++ grow
18+ => v=.
19+ |%
20+ ++ mime => v [/text/plain (as-octs (of-wain txt))]
21+ ++ elem => v ;pre: {(trip (of-wain txt))}
22+ --
23+++ grad
24+ |%
25+ ++ form %txt-diff
26+ ++ diff
27+ |= tyt=wain
28+ ^- (urge cord)
29+ (lusk txt tyt (loss txt tyt))
30+ ::
31+ ++ pact
32+ |= dif=(urge cord)
33+ ~| [%pacting dif]
34+ ^- wain
35+ (lurk txt dif)
36+ ::
37+ ++ join
38+ |= [ali=(urge cord) bob=(urge cord)]
39+ ^- (unit (urge cord))
40+ |^
41+ =. ali (clean ali)
42+ =. bob (clean bob)
43+ |- ^- (unit (urge cord))
44+ ?~ ali `bob
45+ ?~ bob `ali
46+ ?- -.i.ali
47+ %&
48+ ?- -.i.bob
49+ %&
50+ ?: =(p.i.ali p.i.bob)
51+ %+ bind $(ali t.ali, bob t.bob)
52+ |=(cud=(urge cord) [i.ali cud])
53+ ?: (gth p.i.ali p.i.bob)
54+ %+ bind $(p.i.ali (sub p.i.ali p.i.bob), bob t.bob)
55+ |=(cud=(urge cord) [i.bob cud])
56+ %+ bind $(ali t.ali, p.i.bob (sub p.i.bob p.i.ali))
57+ |=(cud=(urge cord) [i.ali cud])
58+ ::
59+ %|
60+ ?: =(p.i.ali (lent p.i.bob))
61+ %+ bind $(ali t.ali, bob t.bob)
62+ |=(cud=(urge cord) [i.bob cud])
63+ ?: (gth p.i.ali (lent p.i.bob))
64+ %+ bind $(p.i.ali (sub p.i.ali (lent p.i.bob)), bob t.bob)
65+ |=(cud=(urge cord) [i.bob cud])
66+ ~
67+ ==
68+ ::
69+ %|
70+ ?- -.i.bob
71+ %|
72+ ?. =(i.ali i.bob)
73+ ~
74+ %+ bind $(ali t.ali, bob t.bob)
75+ |=(cud=(urge cord) [i.ali cud])
76+ ::
77+ %&
78+ ?: =(p.i.bob (lent p.i.ali))
79+ %+ bind $(ali t.ali, bob t.bob)
80+ |=(cud=(urge cord) [i.ali cud])
81+ ?: (gth p.i.bob (lent p.i.ali))
82+ %+ bind $(ali t.ali, p.i.bob (sub p.i.bob (lent p.i.ali)))
83+ |=(cud=(urge cord) [i.ali cud])
84+ ~
85+ ==
86+ ==
87+ ++ clean :: clean
88+ |= wig=(urge cord)
89+ ^- (urge cord)
90+ ?~ wig ~
91+ ?~ t.wig wig
92+ ?: ?=(%& -.i.wig)
93+ ?: ?=(%& -.i.t.wig)
94+ $(wig [[%& (add p.i.wig p.i.t.wig)] t.t.wig])
95+ [i.wig $(wig t.wig)]
96+ ?: ?=(%| -.i.t.wig)
97+ $(wig [[%| (welp p.i.wig p.i.t.wig) (welp q.i.wig q.i.t.wig)] t.t.wig])
98+ [i.wig $(wig t.wig)]
99+ --
100+ ::
101+ ++ mash
102+ |= $: [als=ship ald=desk ali=(urge cord)]
103+ [bos=ship bod=desk bob=(urge cord)]
104+ ==
105+ ^- (urge cord)
106+ |^
107+ =. ali (clean ali)
108+ =. bob (clean bob)
109+ |- ^- (urge cord)
110+ ?~ ali bob
111+ ?~ bob ali
112+ ?- -.i.ali
113+ %&
114+ ?- -.i.bob
115+ %&
116+ ?: =(p.i.ali p.i.bob)
117+ [i.ali $(ali t.ali, bob t.bob)]
118+ ?: (gth p.i.ali p.i.bob)
119+ [i.bob $(p.i.ali (sub p.i.ali p.i.bob), bob t.bob)]
120+ [i.ali $(ali t.ali, p.i.bob (sub p.i.bob p.i.ali))]
121+ ::
122+ %|
123+ ?: =(p.i.ali (lent p.i.bob))
124+ [i.bob $(ali t.ali, bob t.bob)]
125+ ?: (gth p.i.ali (lent p.i.bob))
126+ [i.bob $(p.i.ali (sub p.i.ali (lent p.i.bob)), bob t.bob)]
127+ =/ [fic=(unce cord) ali=(urge cord) bob=(urge cord)]
128+ (resolve ali bob)
129+ [fic $(ali ali, bob bob)]
130+ :: ~ :: here, alice is good for a while, but not for the whole
131+ == :: length of bob's changes
132+ ::
133+ %|
134+ ?- -.i.bob
135+ %|
136+ =/ [fic=(unce cord) ali=(urge cord) bob=(urge cord)]
137+ (resolve ali bob)
138+ [fic $(ali ali, bob bob)]
139+ ::
140+ %&
141+ ?: =(p.i.bob (lent p.i.ali))
142+ [i.ali $(ali t.ali, bob t.bob)]
143+ ?: (gth p.i.bob (lent p.i.ali))
144+ [i.ali $(ali t.ali, p.i.bob (sub p.i.bob (lent p.i.ali)))]
145+ =/ [fic=(unce cord) ali=(urge cord) bob=(urge cord)]
146+ (resolve ali bob)
147+ [fic $(ali ali, bob bob)]
148+ ==
149+ ==
150+ ::
151+ ++ annotate :: annotate conflict
152+ |= $: ali=(list @t)
153+ bob=(list @t)
154+ bas=(list @t)
155+ ==
156+ ^- (list @t)
157+ %- zing
158+ ^- (list (list @t))
159+ %- flop
160+ ^- (list (list @t))
161+ :- :_ ~
162+ %^ cat 3 '<<<<<<<<<<<<'
163+ %^ cat 3 ' '
164+ %^ cat 3 `@t`(scot %p bos)
165+ %^ cat 3 '/'
166+ bod
167+
168+ :- bob
169+ :- ~['------------']
170+ :- bas
171+ :- ~['++++++++++++']
172+ :- ali
173+ :- :_ ~
174+ %^ cat 3 '>>>>>>>>>>>>'
175+ %^ cat 3 ' '
176+ %^ cat 3 `@t`(scot %p als)
177+ %^ cat 3 '/'
178+ ald
179+ ~
180+ ::
181+ ++ clean :: clean
182+ |= wig=(urge cord)
183+ ^- (urge cord)
184+ ?~ wig ~
185+ ?~ t.wig wig
186+ ?: ?=(%& -.i.wig)
187+ ?: ?=(%& -.i.t.wig)
188+ $(wig [[%& (add p.i.wig p.i.t.wig)] t.t.wig])
189+ [i.wig $(wig t.wig)]
190+ ?: ?=(%| -.i.t.wig)
191+ $(wig [[%| (welp p.i.wig p.i.t.wig) (welp q.i.wig q.i.t.wig)] t.t.wig])
192+ [i.wig $(wig t.wig)]
193+ ::
194+ ++ resolve
195+ |= [ali=(urge cord) bob=(urge cord)]
196+ ^- [fic=[%| p=(list cord) q=(list cord)] ali=(urge cord) bob=(urge cord)]
197+ =- [[%| bac (annotate alc boc bac)] ali bob]
198+ |- ^- $: $: bac=(list cord)
199+ alc=(list cord)
200+ boc=(list cord)
201+ ==
202+ ali=(urge cord)
203+ bob=(urge cord)
204+ ==
205+ ?~ ali [[~ ~ ~] ali bob]
206+ ?~ bob [[~ ~ ~] ali bob]
207+ ?- -.i.ali
208+ %&
209+ ?- -.i.bob
210+ %& [[~ ~ ~] ali bob] :: no conflict
211+ %|
212+ =+ lob=(lent p.i.bob)
213+ ?: =(lob p.i.ali)
214+ [[p.i.bob p.i.bob q.i.bob] t.ali t.bob]
215+ ?: (lth lob p.i.ali)
216+ [[p.i.bob p.i.bob q.i.bob] [[%& (sub p.i.ali lob)] t.ali] t.bob]
217+ =+ wat=(scag (sub lob p.i.ali) p.i.bob)
218+ =+ ^= res
219+ %= $
220+ ali t.ali
221+ bob [[%| (scag (sub lob p.i.ali) p.i.bob) ~] t.bob]
222+ ==
223+ :* :* (welp bac.res wat)
224+ (welp alc.res wat)
225+ (welp boc.res q.i.bob)
226+ ==
227+ ali.res
228+ bob.res
229+ ==
230+ ==
231+ ::
232+ %|
233+ ?- -.i.bob
234+ %&
235+ =+ loa=(lent p.i.ali)
236+ ?: =(loa p.i.bob)
237+ [[p.i.ali q.i.ali p.i.ali] t.ali t.bob]
238+ ?: (lth loa p.i.bob)
239+ [[p.i.ali q.i.ali p.i.ali] t.ali [[%& (sub p.i.bob loa)] t.bob]]
240+ =+ wat=(slag (sub loa p.i.bob) p.i.ali)
241+ =+ ^= res
242+ %= $
243+ ali [[%| (scag (sub loa p.i.bob) p.i.ali) ~] t.ali]
244+ bob t.bob
245+ ==
246+ :* :* (welp bac.res wat)
247+ (welp alc.res q.i.ali)
248+ (welp boc.res wat)
249+ ==
250+ ali.res
251+ bob.res
252+ ==
253+ ::
254+ %|
255+ =+ loa=(lent p.i.ali)
256+ =+ lob=(lent p.i.bob)
257+ ?: =(loa lob)
258+ [[p.i.ali q.i.ali q.i.bob] t.ali t.bob]
259+ =+ ^= res
260+ ?: (gth loa lob)
261+ $(ali [[%| (scag (sub loa lob) p.i.ali) ~] t.ali], bob t.bob)
262+ ~& [%scagging loa=loa pibob=p.i.bob slag=(scag loa p.i.bob)]
263+ $(ali t.ali, bob [[%| (scag (sub lob loa) p.i.bob) ~] t.bob])
264+ :* :* (welp bac.res ?:((gth loa lob) p.i.bob p.i.ali))
265+ (welp alc.res q.i.ali)
266+ (welp boc.res q.i.bob)
267+ ==
268+ ali.res
269+ bob.res
270+ ==
271+ ==
272+ ==
273+ --
274+ --
275+--
example/journal/sur/docket.hoonnew file+82
@@ -0,0 +1,82 @@
1+|%
2+::
3++$ version
4+ [major=@ud minor=@ud patch=@ud]
5+::
6++$ glob (map path mime)
7+::
8++$ url cord
9+:: $glob-location: How to retrieve a glob
10+::
11++$ glob-reference
12+ [hash=@uvH location=glob-location]
13+::
14++$ glob-location
15+ $% [%http =url]
16+ [%ames =ship]
17+ ==
18+:: $href: Where a tile links to
19+::
20++$ href
21+ $% [%glob base=term =glob-reference]
22+ [%site =path]
23+ ==
24+:: $chad: State of a docket
25+::
26++$ chad
27+ $~ [%install ~]
28+ $% :: Done
29+ [%glob =glob]
30+ [%site ~]
31+ :: Waiting
32+ [%install ~]
33+ [%suspend glob=(unit glob)]
34+ :: Error
35+ [%hung err=cord]
36+ ==
37+::
38+:: $charge: A realized $docket
39+::
40++$ charge
41+ $: =docket
42+ =chad
43+ ==
44+::
45+:: $clause: A key and value, as part of a docket
46+::
47+:: Only used to parse $docket
48+::
49++$ clause
50+ $% [%title title=@t]
51+ [%info info=@t]
52+ [%color color=@ux]
53+ [%glob-http url=cord hash=@uvH]
54+ [%glob-ames =ship hash=@uvH]
55+ [%image =url]
56+ [%site =path]
57+ [%base base=term]
58+ [%version =version]
59+ [%website website=url]
60+ [%license license=cord]
61+ ==
62+::
63+:: $docket: A description of JS bundles for a desk
64+::
65++$ docket
66+ $: %1
67+ title=@t
68+ info=@t
69+ color=@ux
70+ =href
71+ image=(unit url)
72+ =version
73+ website=url
74+ license=cord
75+ ==
76+::
77++$ charge-update
78+ $% [%initial initial=(map desk charge)]
79+ [%add-charge =desk =charge]
80+ [%del-charge =desk]
81+ ==
82+--
example/journal/sur/journal.hoonnew file+19
@@ -0,0 +1,19 @@
1+|%
2++$ id @
3++$ txt @t
4++$ action
5+ $% [%add =id =txt]
6+ [%edit =id =txt]
7+ [%del =id]
8+ ==
9++$ entry [=id =txt]
10++$ logged (pair @ action)
11++$ update
12+ %+ pair @
13+ $% action
14+ [%jrnl list=(list entry)]
15+ [%logs list=(list logged)]
16+ ==
17++$ journal ((mop id txt) gth)
18++$ log ((mop @ action) lth)
19+--
example/journal/sys.kelvinnew file+1
@@ -0,0 +1 @@
1+[%zuse 413]