diff --git a/pkg/arvo/app/hark-chat-hook.hoon b/pkg/arvo/app/hark-chat-hook.hoon index 8810d7c5e..472bcb7dc 100644 --- a/pkg/arvo/app/hark-chat-hook.hoon +++ b/pkg/arvo/app/hark-chat-hook.hoon @@ -21,7 +21,18 @@ =| state-0 =* state - :: -=< +=> + |_ =bowl:gall + :: + ++ give + |= [paths=(list path) =update:hook] + ^- (list card) + [%give %fact paths hark-chat-hook-update+!>(update)]~ + :: + ++ watch-chat + ^- card + [%pass /chat %agent [our.bowl %chat-store] %watch /updates] + -- %- agent:dbug ^- agent:gall ~% %hark-chat-hook-agent ..card ~ @@ -73,6 +84,7 @@ |= =action:hook ^- (quip card _state) |^ + :- (give:ha ~[/updates] action) ?- -.action %listen (listen +.action) %ignore (ignore +.action) @@ -80,20 +92,17 @@ == ++ listen |= chat=path - ^- (quip card _state) - :- (give:ha ~[/updates] [%listen chat]) + ^+ state state(watching (~(put in watching) chat)) :: ++ ignore |= chat=path - ^- (quip card _state) - :- (give:ha ~[/updates] [%ignore chat]) + ^+ state state(watching (~(del in watching) chat)) :: ++ set-mentions |= ment=? - ^- (quip card _state) - :- (give:ha ~[/updates] [%set-mentions ment]) + ^+ state state(mentions ment) -- -- @@ -130,7 +139,7 @@ (turn envelopes.update (cury process-envelope path.update)) == ++ is-mention - |= [=path =envelope:chat-store] + |= =envelope:chat-store ?. ?=(%text -.letter.envelope) %.n ?& mentions ?= ^ @@ -147,7 +156,7 @@ |= [=path =envelope:chat-store] ^- (list card) =/ mention=? - (is-mention path envelope) + (is-mention envelope) ?. ?|(mention (is-notification path envelope)) ~ =/ =index:store @@ -159,9 +168,8 @@ ++ poke-store |= =action:store ^- card - =/ =cage - hark-action+!>(action) - [%pass /store %agent [our.bowl %hark-store] %poke cage] + =- [%pass /store %agent [our.bowl %hark-store] %poke -] + hark-action+!>(action) -- :: ++ on-peek on-peek:def @@ -170,15 +178,3 @@ ++ on-arvo on-arvo:def ++ on-fail on-fail:def -- -|_ =bowl:gall -:: -:: -++ give - |= [paths=(list path) =update:hook] - ^- (list card) - [%give %fact paths hark-chat-hook-update+!>(update)]~ -:: -++ watch-chat - ^- card - [%pass /chat %agent [our.bowl %chat-store] %watch /updates] --- diff --git a/pkg/arvo/app/hark-graph-hook.hoon b/pkg/arvo/app/hark-graph-hook.hoon index 1f0bf1d51..d9d1b7f71 100644 --- a/pkg/arvo/app/hark-graph-hook.hoon +++ b/pkg/arvo/app/hark-graph-hook.hoon @@ -22,7 +22,24 @@ =| state-0 =* state - :: -=< +=> + |_ =bowl:gall + :: + ++ scry + |* [=mold p=path] + ?> ?=(^ p) + ?> ?=(^ t.p) + .^(mold i.p (scot %p our.bowl) i.t.p (scot %da now.bowl) t.t.p) + :: + ++ give + |= [paths=(list path) =update:hook] + ^- (list card) + [%give %fact paths hark-graph-hook-update+!>(update)]~ + :: + ++ watch-graph + ^- card + [%pass /graph %agent [our.bowl %graph-store] %watch /updates] + -- %- agent:dbug ^- agent:gall ~% %hark-graph-hook-agent ..card ~ @@ -76,6 +93,7 @@ |= =action:hook ^- (quip card _state) |^ + :- (give:ha ~[/updates] action) ?- -.action %listen (listen +.action) %ignore (ignore +.action) @@ -84,26 +102,22 @@ == ++ listen |= graph=resource - ^- (quip card _state) - :- (give:ha ~[/updates] [%listen graph]) + ^+ state state(watching (~(put in watching) graph)) :: ++ ignore |= graph=resource - ^- (quip card _state) - :- (give:ha ~[/updates] [%ignore graph]) + ^+ state state(watching (~(del in watching) graph)) :: ++ set-mentions |= ment=? - ^- (quip card _state) - :- (give:ha ~[/updates] %set-mentions ment) + ^+ state state(mentions ment) :: ++ set-watch-on-self |= self=? - ^- (quip card _state) - :- (give:ha ~[/updates] %set-watch-on-self self) + ^+ state state(watch-on-self self) -- -- @@ -239,20 +253,4 @@ ++ on-arvo on-arvo:def ++ on-fail on-fail:def -- -|_ =bowl:gall -:: -++ scry - |* [=mold p=path] - ?> ?=(^ p) - ?> ?=(^ t.p) - .^(mold i.p (scot %p our.bowl) i.t.p (scot %da now.bowl) t.t.p) -:: -++ give - |= [paths=(list path) =update:hook] - ^- (list card) - [%give %fact paths hark-graph-hook-update+!>(update)]~ -:: -++ watch-graph - ^- card - [%pass /graph %agent [our.bowl %graph-store] %watch /updates] --- + diff --git a/pkg/arvo/app/hark-store.hoon b/pkg/arvo/app/hark-store.hoon index 137b80d50..f1d3905ac 100644 --- a/pkg/arvo/app/hark-store.hoon +++ b/pkg/arvo/app/hark-store.hoon @@ -27,7 +27,6 @@ $: unread-count=@ud ~ == - :: ++ orm ((ordered-map @da timebox:store) lth) -- @@ -67,6 +66,7 @@ :_ this [%give %fact ~ hark-update+!>(initial-updates)]~ == + :: ++ initial-updates ^- update:store :- %more @@ -113,8 +113,8 @@ ^- update:store :^ %timebox time %.n ~(tap by timebox) - :: == +:: ++ on-poke ~/ %hark-store-poke |= [=mark =vase] @@ -211,7 +211,6 @@ ^- (quip card _state) :_ state(dnd d) (give:ha [/updates]~ %set-dnd d) - :: -- -- :: diff --git a/pkg/arvo/app/hood.hoon b/pkg/arvo/app/hood.hoon index 433ccb2e4..7ea33fe6b 100644 --- a/pkg/arvo/app/hood.hoon +++ b/pkg/arvo/app/hood.hoon @@ -2,7 +2,7 @@ /+ drum=hood-drum, helm=hood-helm, kiln=hood-kiln |% +$ state - $: %10 + $: %11 drum=state:drum helm=state:helm kiln=state:kiln @@ -13,6 +13,7 @@ [%7 drum=state:drum helm=state:helm kiln=state:kiln] [%8 drum=state:drum helm=state:helm kiln=state:kiln] [%9 drum=state:drum helm=state:helm kiln=state:kiln] + [%10 drum=state:drum helm=state:helm kiln=state:kiln] == +$ any-state-tuple $: drum=any-state:drum diff --git a/pkg/arvo/lib/hark/chat-hook.hoon b/pkg/arvo/lib/hark/chat-hook.hoon index db62ff563..1bdd167f5 100644 --- a/pkg/arvo/lib/hark/chat-hook.hoon +++ b/pkg/arvo/lib/hark/chat-hook.hoon @@ -3,11 +3,9 @@ =< [. sur] =, sur |% -:: ++ dejs =, dejs:format |% - :: ++ action %- of :~ listen+pa @@ -19,7 +17,6 @@ ++ enjs =, enjs:format |% - :: ++ update |= upd=^update %+ frond -.upd diff --git a/pkg/arvo/lib/hark/graph-hook.hoon b/pkg/arvo/lib/hark/graph-hook.hoon index 260773340..83995e2df 100644 --- a/pkg/arvo/lib/hark/graph-hook.hoon +++ b/pkg/arvo/lib/hark/graph-hook.hoon @@ -4,11 +4,9 @@ =< [. sur] =, sur |% -:: ++ dejs =, dejs:format |% - :: ++ graph-indices %- ot :~ graph+dejs-path:resource @@ -27,10 +25,10 @@ set-watch-on-self+bo == -- +:: ++ enjs =, enjs:format |% - :: ++ graph-indices |= [graph=resource indices=(set index:graph-store)] %- pairs diff --git a/pkg/arvo/lib/hark/group-hook.hoon b/pkg/arvo/lib/hark/group-hook.hoon index 304366138..e32ee8bd7 100644 --- a/pkg/arvo/lib/hark/group-hook.hoon +++ b/pkg/arvo/lib/hark/group-hook.hoon @@ -4,11 +4,9 @@ =< [. sur] =, sur |% -:: ++ dejs =, dejs:format |% - :: ++ action %- of :~ listen+dejs-path:resource @@ -19,18 +17,18 @@ ++ enjs =, enjs:format |% - :: ++ res (cork enjs-path:resource (lead %s)) + :: ++ update |= upd=^update %+ frond -.upd ?- -.upd + ?(%listen %ignore) (res group.upd) + :: %initial :- %a (turn ~(tap in watching.upd) res) - :: - ?(%listen %ignore) (res group.upd) == -- -- diff --git a/pkg/arvo/lib/hark/store.hoon b/pkg/arvo/lib/hark/store.hoon index 54fb37817..214d42de7 100644 --- a/pkg/arvo/lib/hark/store.hoon +++ b/pkg/arvo/lib/hark/store.hoon @@ -68,7 +68,6 @@ ++ enjs =, enjs:format |% - :: ++ update |= upd=^update ^- json @@ -80,6 +79,7 @@ %set-dnd b+dnd.upd %count (numb count.upd) %more (more +.upd) + :: ?(%archive %read %unread) (notif-ref +.upd) == @@ -210,11 +210,3 @@ -- -- -- - - - - - - - - diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index a41c917a7..c46212858 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -107,6 +107,10 @@ %graph-store %graph-pull-hook %graph-push-hook + %hark-store + %hark-graph-hook + %hark-group-hook + %hark-chat-hook == :: ++ deft-fish :: default connects @@ -209,7 +213,7 @@ == :: ++ on-load - |= [hood-version=?(%1 %2 %3 %4 %5 %6 %7 %8 %9 %10) old=any-state] + |= [hood-version=@ud old=any-state] =< se-abet =< se-view =. sat old =. dev (~(gut by bin) ost *source) @@ -241,6 +245,11 @@ =? ..on-load (lte hood-version %10) => (se-born | %home %graph-push-hook) (se-born | %home %graph-pull-hook) + =? ..on-load (lte hood-version %11) + => (se-born | %home %hark-graph-hook) + => (se-born | %home %hark-group-hook) + => (se-born | %home %hark-chat-hook) + (se-born | %home %hark-store) ..on-load :: ++ reap-phat :: ack connect diff --git a/pkg/arvo/sur/hark-chat-hook.hoon b/pkg/arvo/sur/hark-chat-hook.hoon index 07762baa8..a5e9bf875 100644 --- a/pkg/arvo/sur/hark-chat-hook.hoon +++ b/pkg/arvo/sur/hark-chat-hook.hoon @@ -1,6 +1,5 @@ ^? |% -:: +$ action $% [?(%listen %ignore) chat=path] [%set-mentions mentions=?] diff --git a/pkg/arvo/sur/hark-graph-hook.hoon b/pkg/arvo/sur/hark-graph-hook.hoon index bad5e7c9e..95deb322a 100644 --- a/pkg/arvo/sur/hark-graph-hook.hoon +++ b/pkg/arvo/sur/hark-graph-hook.hoon @@ -1,7 +1,6 @@ /- *resource, graph-store ^? |% -:: +$ action $% [?(%listen %ignore) graph=resource] @@ -19,4 +18,3 @@ == == -- - diff --git a/pkg/arvo/sur/hark-group-hook.hoon b/pkg/arvo/sur/hark-group-hook.hoon index 4eb49038f..f44ed63bc 100644 --- a/pkg/arvo/sur/hark-group-hook.hoon +++ b/pkg/arvo/sur/hark-group-hook.hoon @@ -1,7 +1,6 @@ /- *resource ^? |% -:: +$ action [?(%listen %ignore) group=resource] :: @@ -9,6 +8,4 @@ $% action [%initial watching=(set resource)] == -:: -- - diff --git a/pkg/arvo/sur/hark-store.hoon b/pkg/arvo/sur/hark-store.hoon index 3463bb5a2..4379612eb 100644 --- a/pkg/arvo/sur/hark-store.hoon +++ b/pkg/arvo/sur/hark-store.hoon @@ -1,7 +1,6 @@ /- *resource, graph-store, post, group-store, metadata-store, chat-store ^? |% -:: +$ index $% [%graph group=resource graph=resource module=@t description=@t] [%group group=resource description=@t] diff --git a/pkg/arvo/ted/graph/create.hoon b/pkg/arvo/ted/graph/create.hoon index 81b955aee..287121832 100644 --- a/pkg/arvo/ted/graph/create.hoon +++ b/pkg/arvo/ted/graph/create.hoon @@ -22,7 +22,6 @@ ;< ~ bind:m (poke-our %group-push-hook %push-hook-action !>([%add rid])) (pure:m rid) -:: -- :: =, strand=strand:spider