2023-02-01 19:05:18 +03:00
|
|
|
/- *sss
|
2023-02-15 17:54:06 +03:00
|
|
|
/+ *mip
|
2023-02-01 19:05:18 +03:00
|
|
|
::
|
|
|
|
|%
|
2023-02-16 16:49:25 +03:00
|
|
|
++ mk-subs :: Create sub-map.
|
|
|
|
|* [=(lake) paths=mold]
|
|
|
|
-:+6:(da lake paths)
|
|
|
|
::
|
|
|
|
++ mk-pubs :: Create pub-map.
|
|
|
|
|* [=(lake) paths=mold]
|
|
|
|
-:+6:(du lake paths)
|
|
|
|
::
|
|
|
|
++ mk-mar :: Create mar.
|
2023-02-01 19:05:18 +03:00
|
|
|
|* =(lake)
|
|
|
|
|_ =(response:poke lake *)
|
|
|
|
++ grow
|
|
|
|
|%
|
|
|
|
++ noun response
|
|
|
|
--
|
|
|
|
++ grab
|
|
|
|
|%
|
|
|
|
++ noun (response:poke lake *)
|
|
|
|
--
|
|
|
|
++ grad %noun
|
|
|
|
--
|
|
|
|
++ fled :: Like +sped but head is a path.
|
|
|
|
|= vax=vase
|
|
|
|
^- vase
|
|
|
|
:_ q.vax
|
|
|
|
%- ~(play ut p.vax)
|
|
|
|
=- [%wtgr [%wtts - [%& 2]~] [%$ 1]]
|
2023-02-15 17:54:06 +03:00
|
|
|
=/ pax ~| %path-none ;;(path -.q.vax)
|
2023-02-01 19:05:18 +03:00
|
|
|
|- ^- spec
|
|
|
|
?~ pax [%base %null]
|
|
|
|
[%bccl ~[[%leaf %ta -.pax] $(pax +.pax)]]
|
|
|
|
::
|
2023-02-15 17:54:06 +03:00
|
|
|
++ zoom |= =noun ~| %need-path $/sss/;;(path noun)
|
2023-02-16 16:49:25 +03:00
|
|
|
::
|
|
|
|
++ da :: Manage subscriptions.
|
2023-02-01 19:05:18 +03:00
|
|
|
|* [=(lake) paths=mold]
|
|
|
|
=>
|
|
|
|
|%
|
2023-03-27 20:21:19 +03:00
|
|
|
+$ from (on-rock:poke lake paths)
|
|
|
|
+$ into (response:poke lake paths)
|
|
|
|
+$ result (request:poke paths)
|
|
|
|
+$ fail [paths ship dude]
|
|
|
|
+$ flow [=aeon stale=_| fail=_| =rock:lake]
|
|
|
|
+$ subs [%0 (map [ship dude paths] (unit flow))]
|
2023-02-01 19:05:18 +03:00
|
|
|
--
|
2023-03-27 20:21:19 +03:00
|
|
|
|= $: sub=subs
|
|
|
|
=bowl:gall
|
|
|
|
result-type=type
|
|
|
|
on-rock-type=type
|
|
|
|
fail-type=type
|
|
|
|
==
|
|
|
|
=> .(sub +.sub)
|
|
|
|
|%
|
|
|
|
++ surf :: Subscribe to [ship dude path].
|
|
|
|
|= which=[ship dude paths]
|
|
|
|
^- (quip card:agent:gall subs)
|
|
|
|
?+ flow=(~(get by sub) which) `0/sub
|
|
|
|
~ [~[(pine which)] 0/(~(put by sub) which ~)]
|
|
|
|
[~ ~] [~[(pine which)] 0/sub]
|
2023-06-22 19:53:04 +03:00
|
|
|
[~ ~ [* %& * *]] [~[(pine which)] 0/sub]
|
2023-03-27 20:21:19 +03:00
|
|
|
==
|
|
|
|
++ quit (corl (lead %0) ~(del by sub)) :: Unsub from [ship dude path].
|
2023-02-16 16:49:25 +03:00
|
|
|
++ read :: See current subscribed states.
|
2023-03-27 20:21:19 +03:00
|
|
|
^- (map [ship dude paths] [stale=? fail=? =rock:lake])
|
|
|
|
%- malt %+ murn ~(tap by sub)
|
|
|
|
|= [key=[ship dude paths] val=(unit flow)]
|
|
|
|
?~ val ~
|
|
|
|
`[key +.u.val]
|
|
|
|
:: :: Check poke-ack for errors.
|
2023-02-16 16:49:25 +03:00
|
|
|
:: :: If an %sss-on-rock poke nacks,
|
|
|
|
++ chit :: that state is flagged as failed.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= [[aeon=term ship=term dude=term path=paths] =sign:agent:gall]
|
2023-03-27 20:21:19 +03:00
|
|
|
^- subs
|
|
|
|
:- %0
|
2023-02-01 19:05:18 +03:00
|
|
|
?> ?=(%poke-ack -.sign)
|
|
|
|
?~ p.sign sub
|
|
|
|
%+ ~(jab by sub) [(slav %p ship) dude path]
|
2023-03-27 20:21:19 +03:00
|
|
|
|= (unit flow)
|
|
|
|
=/ =flow (need +<)
|
2023-02-15 17:54:06 +03:00
|
|
|
?> =(aeon.flow (slav %ud aeon))
|
2023-03-27 20:21:19 +03:00
|
|
|
`flow(fail &)
|
|
|
|
:: :: Check poke-ack for errors.
|
|
|
|
:: :: If a scry request nacks,
|
|
|
|
++ tell :: that state is flagged as stale.
|
|
|
|
|= [[ship=term =dude aeon=term path=paths] =sign:agent:gall]
|
|
|
|
^- (quip card:agent:gall subs)
|
|
|
|
?> ?=(%poke-ack -.sign)
|
|
|
|
?~ p.sign `0/sub
|
|
|
|
=/ current [ship=(slav %p ship) dude=dude path=path]
|
|
|
|
?+ flow=(~(get by sub) current) `0/sub
|
|
|
|
[~ ~ *]
|
|
|
|
=. stale.u.u.flow &
|
|
|
|
:_ 0/(~(put by sub) current u.flow)
|
2023-06-26 17:51:57 +03:00
|
|
|
~[(on-rock-poke fake=& current u.u.flow ~)]
|
2023-03-27 20:21:19 +03:00
|
|
|
::
|
|
|
|
[~ ~]
|
|
|
|
:_ 0/(~(del by sub) current) :_ ~
|
|
|
|
:* %pass (zoom surf-fail/aeon/ship/dude/path)
|
|
|
|
%agent [our dap]:bowl
|
|
|
|
%poke %sss-surf-fail fail-type ^- fail
|
|
|
|
[path ship dude]:current
|
|
|
|
==
|
|
|
|
==
|
2023-02-16 16:49:25 +03:00
|
|
|
++ apply :: Handle response from publisher.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= res=(response:poke lake paths)
|
2023-03-27 20:21:19 +03:00
|
|
|
^- (quip card:agent:gall subs)
|
|
|
|
=* current [src.bowl dude.res path.res]
|
|
|
|
=/ old=flow (fall (~(got by sub) current) *flow)
|
2023-06-22 19:53:04 +03:00
|
|
|
?: ?=(%tomb what.res)
|
2023-03-27 20:21:19 +03:00
|
|
|
=/ =flow old(stale &)
|
|
|
|
:_ 0/(~(put by sub) current `flow) :_ ~
|
2023-06-26 17:51:57 +03:00
|
|
|
(on-rock-poke fake=& current flow ~)
|
2023-03-27 20:21:19 +03:00
|
|
|
::
|
2023-06-26 15:57:03 +03:00
|
|
|
=/ [wave=(unit wave:lake) new=(unit flow)]
|
2023-06-22 19:53:04 +03:00
|
|
|
?- what.res
|
2023-06-26 15:57:03 +03:00
|
|
|
%rock ?: (lte aeon.res aeon.old) [~ ~]
|
2023-06-26 17:51:57 +03:00
|
|
|
[~ `[aeon.res | | rock.res]]
|
2023-06-26 15:57:03 +03:00
|
|
|
%wave ?: (lte aeon.res aeon.old) [~ ~]
|
|
|
|
?> =(aeon.res +(aeon.old))
|
2023-06-26 17:51:57 +03:00
|
|
|
[`wave.res `[aeon.res | | (wash:lake rock.old wave.res)]]
|
2023-03-27 20:21:19 +03:00
|
|
|
==
|
2023-06-26 15:57:03 +03:00
|
|
|
?~ new `0/sub
|
|
|
|
:_ 0/(~(put by sub) current new) :_ ~
|
2023-06-26 17:51:57 +03:00
|
|
|
(on-rock-poke fake=& current u.new wave)
|
|
|
|
::
|
|
|
|
++ handle-fake-on-rock
|
|
|
|
|= =(on-rock:poke lake paths)
|
|
|
|
^- (list card:agent:gall)
|
|
|
|
?~ flow=(~(get by sub) [src from path]:on-rock) ~
|
|
|
|
?~ u.flow ~
|
|
|
|
?. =([stale fail rock]:u.u.flow [stale fail rock]:on-rock) ~
|
|
|
|
~[(on-rock-poke fake=| [src from path]:on-rock u.u.flow wave.on-rock)]
|
2023-02-16 16:49:25 +03:00
|
|
|
::
|
|
|
|
:: Non-public facing arms below
|
|
|
|
::
|
2023-06-22 19:53:04 +03:00
|
|
|
++ pine
|
|
|
|
|= [who=ship which=dude where=paths]
|
2023-02-16 16:49:25 +03:00
|
|
|
^- card:agent:gall
|
2023-06-22 19:53:04 +03:00
|
|
|
:* %pass (zoom scry-request/(scot %p who)^which^where)
|
2023-02-16 16:49:25 +03:00
|
|
|
%agent [who which]
|
2023-06-22 19:53:04 +03:00
|
|
|
%poke sss-to-pub/[result-type `result`[where dap.bowl]]
|
2023-03-27 20:21:19 +03:00
|
|
|
==
|
|
|
|
++ on-rock-poke
|
2023-06-26 17:51:57 +03:00
|
|
|
|= [fake=? [=ship =dude path=paths] flow wave=(unit wave:lake)]
|
2023-03-27 20:21:19 +03:00
|
|
|
^- card:agent:gall
|
2023-06-26 17:51:57 +03:00
|
|
|
:* %pass %+ zoom ?:(fake %fake %on-rock)
|
|
|
|
(scot %ud aeon)^(scot %p ship)^dude^path
|
2023-03-27 20:21:19 +03:00
|
|
|
%agent [our dap]:bowl
|
2023-06-26 17:51:57 +03:00
|
|
|
%poke ?:(fake %sss-fake-on-rock %sss-on-rock)
|
|
|
|
on-rock-type `from`[path ship dude stale fail rock wave]
|
2023-02-16 16:49:25 +03:00
|
|
|
==
|
2023-02-01 19:05:18 +03:00
|
|
|
--
|
2023-02-16 16:49:25 +03:00
|
|
|
++ du :: Manage publications.
|
2023-02-01 19:05:18 +03:00
|
|
|
|* [=(lake) paths=mold]
|
|
|
|
=>
|
|
|
|
|%
|
2023-03-27 20:21:19 +03:00
|
|
|
+$ into (request:poke paths)
|
|
|
|
+$ result (response:poke lake paths)
|
2023-07-03 16:53:42 +03:00
|
|
|
+$ rule $~ [`5 5]
|
|
|
|
[horizon=(unit @ud) frequency=@ud] :: Retention policy
|
2023-02-01 19:05:18 +03:00
|
|
|
+$ tide
|
|
|
|
$: rok=((mop aeon rock:lake) gte)
|
|
|
|
wav=((mop aeon wave:lake) lte)
|
|
|
|
rul=rule
|
2023-06-22 19:53:04 +03:00
|
|
|
mem=(jug ship dude)
|
2023-03-27 20:21:19 +03:00
|
|
|
==
|
|
|
|
+$ buoy
|
|
|
|
$: tid=$~(*tide $@(aeon tide))
|
|
|
|
alo=(unit (set ship))
|
2023-02-01 19:05:18 +03:00
|
|
|
==
|
2023-06-22 19:53:04 +03:00
|
|
|
++ pubs
|
|
|
|
=< $>(%1 versioned)
|
|
|
|
|%
|
|
|
|
++ update
|
|
|
|
|= =versioned
|
|
|
|
^- pubs
|
|
|
|
?- -.versioned
|
|
|
|
%1 versioned
|
|
|
|
%0
|
|
|
|
:- %1
|
|
|
|
%- ~(run by +.versioned)
|
|
|
|
|= =buoy-0:^versioned
|
|
|
|
^- buoy
|
|
|
|
%= buoy-0
|
|
|
|
tid
|
|
|
|
?@ tid.buoy-0 tid.buoy-0
|
|
|
|
^- tide
|
|
|
|
%= tid.buoy-0
|
2023-07-03 16:53:42 +03:00
|
|
|
rocks.rul
|
|
|
|
?: =(waves.rul.tid.buoy-0 0) ~
|
|
|
|
`(mul [+(rocks) waves]:rul.tid.buoy-0)
|
|
|
|
::
|
2023-06-22 19:53:04 +03:00
|
|
|
mem
|
|
|
|
^- (jug ship dude)
|
|
|
|
%- ~(run by mem.tid.buoy-0)
|
|
|
|
|= =(map dude @da)
|
|
|
|
^- (set dude)
|
|
|
|
~(key by map)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
==
|
|
|
|
++ versioned
|
|
|
|
=< $% [%0 (map paths buoy-0)]
|
|
|
|
[%1 (map paths buoy)]
|
|
|
|
==
|
|
|
|
|%
|
|
|
|
+$ buoy-0
|
|
|
|
$: tid=$~(*tide-0 $@(aeon tide-0))
|
|
|
|
alo=(unit (set ship))
|
|
|
|
==
|
|
|
|
+$ tide-0
|
|
|
|
$: rok=((mop aeon rock:lake) gte)
|
|
|
|
wav=((mop aeon wave:lake) lte)
|
2023-07-03 16:53:42 +03:00
|
|
|
rul=[rocks=@ud waves=@ud]
|
2023-06-22 19:53:04 +03:00
|
|
|
mem=(mip ship dude @da)
|
|
|
|
==
|
|
|
|
--
|
|
|
|
--
|
2023-02-01 19:05:18 +03:00
|
|
|
--
|
2023-06-22 19:53:04 +03:00
|
|
|
|= [pub=versioned:pubs =bowl:gall result-type=type]
|
|
|
|
=> .(pub +:(update:pubs pub))
|
2023-03-27 20:21:19 +03:00
|
|
|
=* rok ((on aeon rock:lake) gte)
|
|
|
|
=* wav ((on aeon wave:lake) lte)
|
|
|
|
|%
|
2023-02-16 16:49:25 +03:00
|
|
|
++ rule :: Set new retention policy.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= [path=paths =^rule]
|
2023-03-27 20:21:19 +03:00
|
|
|
^- pubs
|
2023-06-22 19:53:04 +03:00
|
|
|
:- %1
|
2023-07-03 16:53:42 +03:00
|
|
|
%- fall :_ (~(put by pub) path %*(. *$<(aeon buoy) rul.tid rule))
|
|
|
|
%- mole |.
|
2023-02-01 19:05:18 +03:00
|
|
|
%+ ~(jab by pub) path
|
2023-03-27 20:21:19 +03:00
|
|
|
|= =buoy
|
|
|
|
?@ tid.buoy buoy
|
|
|
|
buoy(tid (form tid.buoy(rul rule)))
|
2023-02-01 19:05:18 +03:00
|
|
|
::
|
2023-02-16 16:49:25 +03:00
|
|
|
++ wipe :: Create new rock and wipe rest.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= path=paths
|
2023-03-27 20:21:19 +03:00
|
|
|
^- pubs
|
2023-06-22 19:53:04 +03:00
|
|
|
:- %1
|
2023-02-01 19:05:18 +03:00
|
|
|
%+ ~(jab by pub) path
|
2023-03-27 20:21:19 +03:00
|
|
|
|= =buoy
|
|
|
|
?@ tid.buoy buoy
|
2023-07-03 16:53:42 +03:00
|
|
|
%* . buoy(tid (form tid.buoy(rul [`0 1])))
|
2023-03-27 20:21:19 +03:00
|
|
|
rul.tid rul.tid.buoy
|
|
|
|
wav.tid ~
|
2023-02-01 19:05:18 +03:00
|
|
|
==
|
2023-02-16 16:49:25 +03:00
|
|
|
++ give :: Give a wave on a path.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= [path=paths =wave:lake]
|
2023-03-27 20:21:19 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
|
|
|
?~ ((soft ^path) path) ~| %need-path !!
|
|
|
|
=/ buoy (~(gut by pub) path *buoy)
|
2023-04-24 17:49:17 +03:00
|
|
|
=? buoy ?=(@ tid.buoy)
|
|
|
|
%*(. buoy(tid *tide) rok.tid (put:rok ~ +(tid.buoy) *rock:lake))
|
|
|
|
?> ?=(^ tid.buoy)
|
|
|
|
=* tide tid.buoy
|
2023-03-27 20:21:19 +03:00
|
|
|
=/ next=aeon +((latest tide))
|
2023-06-22 19:53:04 +03:00
|
|
|
:- %- zing
|
|
|
|
%+ turn ~(tap by mem.tide)
|
|
|
|
|= [=ship =(set dude)]
|
|
|
|
%+ turn ~(tap in set)
|
|
|
|
|= =dude
|
|
|
|
(send wave/[next wave] ship dude path)
|
|
|
|
:- %1
|
2023-03-27 20:21:19 +03:00
|
|
|
%+ ~(put by pub) path
|
|
|
|
=/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
|
|
|
|
=. wav.tide (put:wav wav.tide next wave)
|
2023-04-14 11:08:32 +03:00
|
|
|
=. mem.tide ~
|
2023-07-03 16:53:42 +03:00
|
|
|
?. =(next (add aeon.last frequency.rul.tide)) buoy
|
2023-03-27 20:21:19 +03:00
|
|
|
buoy(tid (form tide))
|
|
|
|
::
|
2023-04-18 22:54:17 +03:00
|
|
|
++ fork :: Fork a pub into an empty path.
|
|
|
|
|= [from=paths to=paths]
|
|
|
|
^- pubs
|
2023-06-22 19:53:04 +03:00
|
|
|
:- %1
|
2023-04-18 22:54:17 +03:00
|
|
|
?< (~(has by pub) to)
|
|
|
|
(~(put by pub) to (~(got by pub) from))
|
|
|
|
::
|
|
|
|
++ copy :: Fork a sub into an empty path.
|
|
|
|
|= [sub=_(mk-subs lake *) from=[ship dude *] to=paths]
|
|
|
|
^- pubs
|
2023-06-22 19:53:04 +03:00
|
|
|
:- %1
|
2023-04-18 22:54:17 +03:00
|
|
|
?< (~(has by pub) to)
|
|
|
|
%+ ~(put by pub) to
|
|
|
|
%* . *$<(aeon buoy)
|
|
|
|
rok.tid (put:rok ~ [aeon rock]:(need (~(got by +:sub) from)))
|
|
|
|
==
|
|
|
|
::
|
2023-03-27 20:21:19 +03:00
|
|
|
++ perm :: Change permissions with gate.
|
|
|
|
|= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))]
|
2023-06-23 23:31:38 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
2023-03-27 20:21:19 +03:00
|
|
|
%+ edit where
|
|
|
|
|= =buoy
|
|
|
|
=/ new=_alo.buoy (diff alo.buoy)
|
|
|
|
?@ tid.buoy buoy(alo new)
|
|
|
|
%= buoy
|
|
|
|
alo new
|
|
|
|
mem.tid ?~ new mem.tid.buoy
|
|
|
|
%. mem.tid.buoy
|
2023-06-22 19:53:04 +03:00
|
|
|
~(int by (malt (turn ~(tap in u.new) (late *(set @)))))
|
2023-03-27 20:21:19 +03:00
|
|
|
==
|
|
|
|
++ public (curr perm _~) :: Make list of paths public.
|
|
|
|
++ secret (curr perm _`~) :: Make list of paths secret.
|
|
|
|
:: :: Block ships from paths.
|
|
|
|
++ block :: No-ops on public paths.
|
|
|
|
|= [who=(list ship) whence=(list paths)]
|
2023-06-23 23:31:38 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
2023-03-27 23:03:24 +03:00
|
|
|
%+ perm whence
|
|
|
|
|= old=(unit (set ship))
|
|
|
|
?~ old ~ `(~(dif in u.old) (sy who))
|
2023-03-27 20:21:19 +03:00
|
|
|
:: :: Allow ships to paths.
|
|
|
|
++ allow :: Any public paths will no-op.
|
|
|
|
|= [who=(list ship) where=(list paths)]
|
2023-06-23 23:31:38 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
2023-03-27 23:03:24 +03:00
|
|
|
%+ perm where
|
|
|
|
|= old=(unit (set ship))
|
|
|
|
?~ old ~ `(~(gas in u.old) who)
|
2023-03-27 20:21:19 +03:00
|
|
|
:: :: Kill a list of paths, i.e. tell
|
|
|
|
++ kill :: subs to not expect updates.
|
|
|
|
(curr edit |=(=buoy buoy(tid (latest tid.buoy))))
|
|
|
|
:: :: Reopen list of killed paths.
|
2023-02-16 16:49:25 +03:00
|
|
|
++ read :: See current published states.
|
2023-03-27 20:21:19 +03:00
|
|
|
^- (map paths [allowed=(unit (set ship)) =rock:lake])
|
|
|
|
%- malt %+ murn ~(tap by pub)
|
|
|
|
|= [path=paths =buoy]
|
|
|
|
^- (unit [paths (unit (set ship)) rock:lake])
|
|
|
|
?@ tide=tid.buoy ~
|
|
|
|
:^ ~ path alo.buoy =< rock
|
2023-02-01 19:05:18 +03:00
|
|
|
=/ snap=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
|
|
|
|
%+ roll (tap:wav (lot:wav wav.tide `aeon.snap ~))
|
|
|
|
|= [[=aeon =wave:lake] =_snap]
|
|
|
|
?. =(aeon +(aeon.snap)) snap
|
|
|
|
[aeon (wash:lake rock.snap wave)]
|
|
|
|
::
|
2023-02-16 16:49:25 +03:00
|
|
|
++ apply :: Handle request from subscriber.
|
2023-02-01 19:05:18 +03:00
|
|
|
|= req=(request:poke paths)
|
2023-03-27 20:21:19 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
|
|
|
=/ =buoy (~(gut by pub) path.req *buoy)
|
|
|
|
?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
|
|
|
|
?@ tid.buoy
|
2023-06-22 19:53:04 +03:00
|
|
|
:_ 1/pub :_ ~
|
|
|
|
(send tomb/~ src.bowl dude.req path.req)
|
|
|
|
:_ 1/pub :_ ~
|
|
|
|
=/ last (fall (pry:rok rok.tid.buoy) *[=key =val]:rok)
|
|
|
|
(send rock/last src.bowl dude.req path.req)
|
|
|
|
::
|
|
|
|
++ tell
|
|
|
|
|= [[ship=term =dude aeon=term path=paths] =sign:agent:gall]
|
|
|
|
^- (quip card:agent:gall pubs)
|
|
|
|
?> ?=(%poke-ack -.sign)
|
|
|
|
?^ p.sign `1/pub
|
|
|
|
=/ =buoy (~(gut by pub) path *buoy)
|
|
|
|
?< &(?=(^ alo.buoy) !(~(has in u.alo.buoy) src.bowl))
|
|
|
|
?@ tid.buoy
|
|
|
|
:_ 1/pub :_ ~
|
|
|
|
(send tomb/~ src.bowl dude path)
|
|
|
|
::
|
|
|
|
=> .(aeon +((slav %ud aeon)))
|
|
|
|
?^ dat=(get:wav wav.tid.buoy aeon)
|
|
|
|
:_ 1/pub :_ ~
|
|
|
|
(send wave/[aeon u.dat] src.bowl dude path)
|
|
|
|
=/ last (fall (pry:rok rok.tid.buoy) [=key =val]:rok)
|
|
|
|
?: (lte aeon key.last)
|
|
|
|
:_ 1/pub :_ ~
|
|
|
|
(send rock/last src.bowl dude path)
|
|
|
|
:- ~
|
|
|
|
:- %1
|
|
|
|
%+ ~(put by pub) path
|
2023-03-27 20:21:19 +03:00
|
|
|
%= buoy
|
2023-06-22 19:53:04 +03:00
|
|
|
mem.tid (~(put ju mem.tid.buoy) src.bowl dude)
|
2023-02-15 17:54:06 +03:00
|
|
|
==
|
2023-02-16 16:49:25 +03:00
|
|
|
::
|
|
|
|
:: Non-public facing arms below
|
|
|
|
::
|
|
|
|
++ send
|
2023-06-22 19:53:04 +03:00
|
|
|
|= [payload=_|2:*(response:poke lake paths) =ship =dude path=paths]
|
2023-02-16 16:49:25 +03:00
|
|
|
^- card:agent:gall
|
|
|
|
=* mark (cat 3 %sss- name:lake)
|
2023-06-22 19:53:04 +03:00
|
|
|
=/ callback=^path
|
|
|
|
?: ?=(%tomb what.payload) (zoom tomb-response/(scot %p ship)^dude^path)
|
|
|
|
(zoom scry-response/(scot %p ship)^dude^(scot %ud aeon.payload)^path)
|
|
|
|
:* %pass callback
|
2023-02-16 16:49:25 +03:00
|
|
|
%agent [ship dude]
|
|
|
|
%poke mark result-type ^- (response:poke lake paths)
|
2023-06-22 19:53:04 +03:00
|
|
|
[path dap.bowl payload]
|
2023-02-16 16:49:25 +03:00
|
|
|
==
|
2023-03-27 20:21:19 +03:00
|
|
|
++ latest
|
|
|
|
|= =$@(aeon tide)
|
|
|
|
^- aeon
|
|
|
|
?@ tide tide
|
|
|
|
%+ max (fall (bind (pry:rok rok.tide) head) 0)
|
|
|
|
(fall (bind (ram:wav wav.tide) head) 0)
|
|
|
|
::
|
|
|
|
++ edit
|
|
|
|
|= [ps=(list paths) edit=$-(buoy buoy)]
|
2023-06-23 23:31:38 +03:00
|
|
|
^- (quip card:agent:gall pubs)
|
2023-03-27 20:21:19 +03:00
|
|
|
%- ~(rep in (sy ps))
|
2023-06-23 23:31:38 +03:00
|
|
|
|= [path=paths caz=(list card:agent:gall) %1 =_pub]
|
|
|
|
?~ old=(~(get by pub) path) [caz 1/pub]
|
|
|
|
=/ new=buoy (edit u.old)
|
|
|
|
:_ 1/(~(put by pub) path new)
|
|
|
|
%- weld :_ caz
|
|
|
|
^- (list card:agent:gall)
|
|
|
|
?@ tid.u.old ~
|
|
|
|
?@ tid.new
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap by mem.tid.u.old)
|
|
|
|
|= [=ship =(set dude)]
|
|
|
|
(turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
|
|
|
|
?~ alo.new ~
|
|
|
|
=/ new-alo=(jug ship dude)
|
|
|
|
(malt (turn ~(tap in u.alo.new) (late *(set @))))
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap by (~(dif by mem.tid.u.old) new-alo))
|
|
|
|
|= [=ship =(set dude)]
|
|
|
|
(turn ~(tap in set) |=(=dude (send tomb/~ ship dude path)))
|
2023-03-27 20:21:19 +03:00
|
|
|
::
|
2023-02-16 16:49:25 +03:00
|
|
|
++ form
|
|
|
|
|= =tide
|
|
|
|
^+ tide
|
|
|
|
=/ max-rock=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok)
|
|
|
|
=/ max-wave (fall (bind (ram:wav wav.tide) head) 0)
|
2023-07-03 16:53:42 +03:00
|
|
|
=? rok.tide :: Create new rock.
|
|
|
|
?& !=(frequency.rul.tide 0)
|
|
|
|
(gte max-wave (add aeon.max-rock frequency.rul.tide))
|
|
|
|
==
|
2023-02-16 16:49:25 +03:00
|
|
|
%+ put:rok rok.tide
|
|
|
|
%+ roll (tab:wav wav.tide `aeon.max-rock max-wave)
|
|
|
|
|: [*[now=aeon =wave:lake] `[prev=aeon =rock:lake]`max-rock]
|
|
|
|
~| %aeon-awry
|
|
|
|
?> =(now +(prev))
|
|
|
|
[now (wash:lake rock wave)]
|
2023-07-03 16:53:42 +03:00
|
|
|
=. rok.tide
|
|
|
|
?~ horizon.rul.tide :: Only keep genesis and latest.
|
|
|
|
(gas:rok ~ (murn ~[(ram:rok rok.tide) (pry:rok rok.tide)] same))
|
|
|
|
%^ lot:rok rok.tide :: Delete beyond horizon.
|
|
|
|
~
|
|
|
|
(mole |.((sub max-wave (max [u.horizon frequency]:rul.tide))))
|
2023-02-16 16:49:25 +03:00
|
|
|
~| %rock-zero
|
|
|
|
tide(wav (lot:wav wav.tide (bind (ram:rok rok.tide) |=([r=@ *] (dec r))) ~))
|
2023-02-01 19:05:18 +03:00
|
|
|
--
|
|
|
|
--
|