Mostly functional federation & delta model.

This commit is contained in:
Fang 2017-06-12 15:19:45 -07:00
parent 23cd3ad758
commit 563aa0102e
8 changed files with 855 additions and 3601 deletions

View File

@ -2,15 +2,19 @@
:::: /hoon/talk-agent/app :: :: :::: /hoon/talk-agent/app :: ::
:: :: :: :: :: ::
:: ::
::TODO master changes, incl %notify
::TODO guardian's todo's apply here too ::TODO guardian's todo's apply here too
::TODO make sure glyphs only get bound when joins succeed ::TODO make sure glyphs only get bound when joins succeed
:: ...this is a bit troublesome, because failed joins don't actually :: ...this is a bit troublesome, because failed joins don't actually
:: unsubscribe us. :: unsubscribe us.
::TODO maybe keep track of received grams per partner, too? ::TODO maybe keep track of received grams per partner, too?
:: ::
::TODO for delta model:
:: 3) split into delta creation and application, as with hall.
::
::> This reader implementation makes use of the mailbox ::> This reader implementation makes use of the mailbox
::> for all its subscriptions and messaging. All ::> for all its subscriptions and messaging. All
::> lowdowns received are exclusively about the mailbox, ::> rumors received are exclusively about the mailbox,
::> since that's the only thing the reader ever ::> since that's the only thing the reader ever
::> subscribes to. ::> subscribes to.
:: ::
@ -38,22 +42,21 @@
remotes/(map partner group) ::< remote presences remotes/(map partner group) ::< remote presences
mirrors/(map circle config) ::< remote configs mirrors/(map circle config) ::< remote configs
:: ui state :: :: ui state ::
folks/(map ship human) ::< human identities nicks/(map ship cord) ::< human identities
nik/(map (set partner) char) ::< bound circle glyphs nik/(map (set partner) char) ::< bound circle glyphs
nak/(jug char (set partner)) ::< circle glyph lookup nak/(jug char (set partner)) ::< circle glyph lookup
cli/shell ::< interaction state cli/shell ::< interaction state
== :: == ::
++ shell ::> console session ++ shell ::> console session
$: id/bone ::< identifier $: id/bone ::< identifier
count/@ud ::< messages shown latest/@ud ::< latest shown msg num
say/sole-share ::< console state say/sole-share ::< console state
active/(set partner) ::< active targets active/(set partner) ::< active targets
settings/(set knot) ::< frontend settings settings/(set knot) ::< frontend settings
== :: == ::
++ move (pair bone card) ::< all actions ++ move (pair bone card) ::< all actions
++ lime ::> diff fruit ++ lime ::> diff fruit
$% {$talk-report report} :: $% {$sole-effect sole-effect} ::
{$sole-effect sole-effect} ::
== :: == ::
++ pear ::> poke fruit ++ pear ::> poke fruit
$% {$talk-command command} :: $% {$talk-command command} ::
@ -75,9 +78,8 @@
{$invite p/knot q/(set ship)} ::< give permission {$invite p/knot q/(set ship)} ::< give permission
{$banish p/knot q/(set ship)} ::< deny permission {$banish p/knot q/(set ship)} ::< deny permission
{$source p/knot q/(set partner)} ::< add source {$source p/knot q/(set partner)} ::< add source
{$enlist p/knot q/(set ship)} ::< allow federation :: personal metadata
{$retire p/knot q/(set ship)} ::< deny federation {$status p/knot q/presence} ::TODO better interface ::< set status
{$burden p/circle} ::< help federate
:: messaging :: :: messaging ::
{$say p/(list speech)} ::< send message {$say p/(list speech)} ::< send message
{$eval p/cord q/twig} ::< send #-message {$eval p/cord q/twig} ::< send #-message
@ -123,17 +125,39 @@
::+| ::+|
:: ::
++ broker ::< broker ship + name ++ broker ::< broker ship + name
|= our/ship ^- dock
:_ %talk-guardian :_ %talk-guardian
?. =((clan our) %earl) (true-self our.bol)
our
(sein our)
:: ::
++ inbox ::< reader's circle ++ inbox ::< reader's circle name
::> produces the name of the circle used by this ::> produces the name of the circle used by this
::> reader for all its operations ::> reader for all its operations
^- knot
(main our.bol) (main our.bol)
:: ::
++ incir ::< reader's circle
::> ++inbox, except a full circle.
^- circle
:_ inbox
(true-self our.bol)
::
++ inpan ::< reader's partner
::> ++inbox, except a full partner.
^- partner
[%& incir]
::
++ nik-from-nak ::< nik from nak
::>
::
::TODO ...we really should rename these.
|= nek/_nak
^+ nik
%- ~(gas by *(map (set partner) char))
=- (zing -)
%+ turn (~(tap by nek))
|= {a/char b/(set (set partner))}
(turn (~(tap by b)) |=(c/(set partner) [c a]))
::
::> || ::> ||
::> || %engines ::> || %engines
::> || ::> ||
@ -209,12 +233,20 @@
++ ta-init ::< initialize app ++ ta-init ::< initialize app
::> subscribes to our broker. ::> subscribes to our broker.
:: ::
%- ta-emit %- ta-emil
^- (list move)
:~ :* ost.bol
%peer
/
broker
/reader
==
:* ost.bol :* ost.bol
%peer %peer
/ ::< return/diff path /
(broker our.bol) broker
/reader/[inbox] ::< peer path /circle/[inbox]
==
== ==
:: ::
++ ta-reaction ::< apply reaction ++ ta-reaction ::< apply reaction
@ -224,148 +256,115 @@
^+ +> ^+ +>
sh-done:(~(sh-reaction sh cli) rac) sh-done:(~(sh-reaction sh cli) rac)
:: ::
++ ta-change ::< apply change ++ ta-take ::< accept prize
::> ::>
:: ::
|= dif/delta |= piz/prize
^+ +>
?+ -.piz
~&([%ignoring-prize -.piz] +>)
::
$reader
%= +>
nak gys.piz
nik (nik-from-nak gys.piz)
nicks nis.piz
==
::
$circle
%. gaz.piz
%= ta-change-grams
sources sre.loc.cos.piz
mirrors (~(put by rem.cos.piz) incir loc.cos.piz)
remotes (~(put by rem.pes.piz) inpan loc.pes.piz)
==
==
::
++ ta-hear ::< apply change
::>
::
|= dif/rumor
^+ +> ^+ +>
?+ -.dif ?+ -.dif
~& [%ignoring-delta -.dif] ~&([%ignoring-rumor -.dif] +>)
+>
:: ::
$mor $reader
|- ^+ +>.^$ ?- -.dif.dif
?~ mor.dif +>.^$ $glyph
$(+>.^$ ^$(dif i.mor.dif), mor.dif t.mor.dif) (ta-change-glyph +.dif.dif)
:: ::
$cir $nick
(ta-change-circle +.dif) +>(nicks (change-nicks nicks who.dif.dif nic.dif.dif))
==
::
$circle
(ta-change-circle dif.dif)
== ==
:: ::
++ ta-change-circle ::< apply circle change ++ ta-change-circle ::< apply circle change
::> ::>
:: ::
|= {cir/circle dif/delta-circle} |= dif/diff-story
^+ +> ^+ +>
?+ -.dif ?+ -.dif
~& [%ignoring-delta-circle -.dif] ~&([%unexpected-circle-rumor -.dif] +>)
+>
:: ::
$put $grams
(ta-low-grams count.cli gaz.dif) (ta-change-grams gaz.dif)
::
$config
%= +>
sources
?. ?& ?=($sourcee -.dif.dif)
=(cir.dif incir)
==
sources
%. pas.dif.dif
?: add.dif.dif
~(uni in sources)
~(dif in sources)
::
mirrors
?: ?=($remove -.dif.dif) (~(del by mirrors) cir.dif)
%+ ~(put by mirrors) cir.dif
%+ change-config
(fall (~(get by mirrors) cir.dif) *config)
dif.dif
== ==
:: ::
++ ta-low ::< apply lowdown $status
::> processes a talk lowdown %= +>
:: remotes
|= low/lowdown %+ ~(put by remotes) pan.dif
^+ +> =+ rem=(fall (~(get by remotes) pan.dif) *group)
?- -.low ?: ?=($remove -.dif.dif) (~(del by rem) who.dif)
$glyph (ta-low-glyph +.low) %+ ~(put by rem) who.dif
$names (ta-low-names +.low) %+ change-status
$confs (ta-low-confs +.low) (fall (~(get by rem) who.dif) *status)
$precs (ta-low-precs +.low) dif.dif
$grams (ta-low-grams +.low) ==
== ==
:: ::
++ ta-low-glyph ::< apply changed glyphs ++ ta-change-glyph ::< apply changed glyphs
::> applies new set of glyph bindings. ::> applies new set of glyph bindings.
:: ::
|= nek/_nak |= {bin/? gyf/char pas/(set partner)}
^+ +> ^+ +>
?: =(nek nak) +> :: no change =+ nek=(change-glyphs nak bin gyf pas)
?: =(nek nak) +>.$ :: no change
=. nak nek =. nak nek
=. nik =. nik (nik-from-nak nek)
%- ~(gas by *(map (set partner) char))
=- (zing -)
%+ turn (~(tap by nek))
|= {a/char b/(set (set partner))}
(turn (~(tap by b)) |=(c/(set partner) [c a]))
sh-done:~(sh-prod sh cli) sh-done:~(sh-prod sh cli)
:: ::
++ ta-low-names ::< apply changed names ++ ta-change-grams ::< apply messages
::> applies new local identities.
::
|= nas/(map ship (unit human))
^+ +>
%= +>
folks
%- ~(gas by *(map ship human))
%+ murn
=< $
%~ tap by
%. nas
~(uni by `_nas`(~(run by folks) some))
==
|= {s/ship h/(unit human)}
?~(h ~ (some [s u.h]))
==
::
++ ta-low-confs ::< apply changed confs
::> applies new circle configurations.
::> because of how this reader only subscribes to
::> the main mailbox, {coy} is always the mailbox's
::> config.
::
|= {coy/(unit config) cofs/(map circle (unit config))}
^+ +>
::> if possible, update {sources}. if we do, and we
::> gain new ones, update the prompt. (this is to
::> remove the mailbox from the audience after
::> creating or joining a new circle.)
?~ coy ~&(%mailbox-gone !!)
=. +> ::TODO =?
?~ (~(dif in src.u.coy) sources) +>.$
=< sh-done
%- ~(sh-pact sh(sources src.u.coy) cli)
(~(dif in src.u.coy) sources)
=. sources src.u.coy
=. cofs (~(put by cofs) [our.bol inbox] coy)
:: print changes for each config.
=. +>.$
=< sh-done
%+ roll (~(tap by cofs))
|= {{s/circle c/(unit config)} cil/_sh}
%^ ~(sh-low-config cil cli)
s (~(get by mirrors) s) c
:: apply config changes to {mirrors}.
=. mirrors
%- ~(gas by *_mirrors)
%+ murn (~(tap by cofs))
|= {s/circle c/(unit config)}
^- (unit (pair circle config))
?~(c ~ `[s u.c])
+>.$
::
++ ta-low-precs ::< apply changed precs
::> applies new presences.
::> other clients might care for {gop}, but we're
::> only ever getting this for the mailbox, where
::> we're the only ones present.
::
|= {gop/group pas/(map partner group)}
^+ +>
=/ ner/_remotes :: per-partner uni
%- ~(urn by pas)
|= {p/partner g/group}
=+ o=(~(get by remotes) p)
?~(o g (~(uni by u.o) g))
=. ner (~(uni by remotes) ner) :: fill in the gaps
?: =(remotes ner) +>.$ :: no change
=. +>.$
=< sh-done
%+ ~(sh-low-rempe sh cli)
remotes ner
+>.$(remotes ner)
::
++ ta-low-grams ::< apply messages
::> applies new or changed telegrams. ::> applies new or changed telegrams.
:: ::
|= {num/@ud gams/(list telegram)} |= gaz/(list telegram)
^+ +> ^+ +>
=. +>.$ (ta-lesson gams) =. +>.$ (ta-lesson gaz)
::TODO maybe move to ta-learn and pass num?
=< sh-done =< sh-done
(~(sh-low-grams sh cli) num gams) (~(sh-grams sh cli) gaz)
:: ::
::> || ::> ||
::> || %messages ::> || %messages
@ -424,7 +423,7 @@
:: ::
^+ . ^+ .
=/ she/shell =/ she/shell
%*(. *shell id ost.bol, active (sy [%& our.bol inbox] ~)) %*(. *shell id ost.bol, active (sy inpan ~))
sh-done:~(sh-prod sh she) sh-done:~(sh-prod sh she)
:: ::
++ ta-sole ::< apply sole input ++ ta-sole ::< apply sole input
@ -477,7 +476,7 @@
:* ost.bol :* ost.bol
%poke %poke
/reader/action /reader/action
(broker our.bol) broker
[%talk-action act] [%talk-action act]
== ==
== ==
@ -555,7 +554,7 @@
:: ::
++ circ ::< circle ++ circ ::< circle
;~ pose ;~ pose
(cold [our.bol inbox] col) (cold incir col)
;~(pfix cen (stag our.bol sym)) ;~(pfix cen (stag our.bol sym))
;~(pfix fas (stag (sein our.bol) sym)) ;~(pfix fas (stag (sein our.bol) sym))
:: ::
@ -621,9 +620,10 @@
;~(plug (cold %eval hax) expr) ;~(plug (cold %eval hax) expr)
:: ::
%+ stag %say %+ stag %say
%+ most (jest '•') %+ most (jest '•') ::TODO why is this not breaking msgs up?
;~ pose ;~ pose
(stag %url aurf:urlp) (stag %url aurf:urlp)
::TODO maybe reverse loobs. at least document properly! confusing.
:(stag %lin | ;~(pfix pat text)) :(stag %lin | ;~(pfix pat text))
:(stag %lin & ;~(less sem hax text)) :(stag %lin & ;~(less sem hax text))
== ==
@ -634,7 +634,7 @@
++ glyph (mask "/\\\{(<!?{(zing glyphs)}") ::< circle postfix ++ glyph (mask "/\\\{(<!?{(zing glyphs)}") ::< circle postfix
++ setting ::< setting flag ++ setting ::< setting flag
%- perk :~ %- perk :~
%noob %noob ::TODO rename to nick
%quiet %quiet
%showtime %showtime
== ==
@ -673,11 +673,9 @@
:: ::
;~((glue ace) (perk %source ~) cire parz) ;~((glue ace) (perk %source ~) cire parz)
:: ::
;~((glue ace) (perk %enlist ~) cire shiz) :: personal metadata
:: ::
;~((glue ace) (perk %retire ~) cire shiz) ;~((glue ace) (perk %status ~) cire (perk %gone %idle %hear %talk ~))
::
;~((glue ace) (perk %burden ~) circ)
:: ::
:: displaying info :: displaying info
:: ::
@ -808,6 +806,7 @@
:: ::
++ work ::< call correct worker ++ work ::< call correct worker
?- -.job ?- -.job
::TODO for inv/ban, enl/ret etc, set bools here?
:: circle management :: circle management
$join (join +.job) $join (join +.job)
$leave (leave +.job) $leave (leave +.job)
@ -818,9 +817,8 @@
$invite (invite +.job) $invite (invite +.job)
$banish (banish +.job) $banish (banish +.job)
$source (source +.job) $source (source +.job)
$enlist (enlist +.job) :: personal metadata
$retire (retire +.job) $status (status +.job)
$burden (burden +.job)
:: messaging :: messaging
$say (say +.job) $say (say +.job)
$eval (eval +.job) $eval (eval +.job)
@ -900,15 +898,14 @@
nak (~(del ju nak) cha n.ole) nak (~(del ju nak) cha n.ole)
== ==
:: ::
++ reverse-folks ::< find by handle ++ reverse-nicks ::< find by handle
::> finds all ships whose handle matches {nym}. ::> finds all ships whose handle matches {nym}.
:: ::
|= nym/knot |= nym/knot
^- (list ship) ^- (list ship)
%+ murn (~(tap by folks)) %+ murn (~(tap by nicks))
|= {p/ship q/human} |= {p/ship q/knot}
?~ han.q ~ ?. =(q nym) ~
?. =(u.han.q nym) ~
[~ u=p] [~ u=p]
:: ::
++ twig-head ::< eval data ++ twig-head ::< eval data
@ -997,26 +994,17 @@
^+ ..sh-work ^+ ..sh-work
(sh-act %source nom & pas) (sh-act %source nom & pas)
:: ::
++ enlist ::> ||
::> || %personal-metadata
::> ||
::+|
::
++ status ::< set status
::> ::>
:: ::
|= {nom/knot sis/(set ship)} |= {nom/knot pec/presence}
^+ ..sh-work ^+ ..sh-work
(sh-act %enlist nom & sis) (sh-act %status [nom ~ ~] [pec [~ ~]])
::
++ retire
::>
::
|= {nom/knot sis/(set ship)}
^+ ..sh-work
(sh-act %enlist nom | sis)
::
++ burden
::>
::
|= cir/circle
^+ ..sh-work
(sh-act %burden cir)
:: ::
::> || ::> ||
::> || %messaging ::> || %messaging
@ -1141,34 +1129,31 @@
::> no arguments, show all ::> no arguments, show all
?: ?=({$~ $~} +<) ?: ?=({$~ $~} +<)
%+ sh-fact %mor %+ sh-fact %mor
%+ turn (~(tap by folks)) %+ turn (~(tap by nicks))
|= {p/ship q/human} |= {p/ship q/knot}
:- %txt :- %txt
?~ han.q "{<p>}: {<q>}"
"{<p>}:"
"{<p>}: {<u.han.q>}"
::> show her nick ::> show her nick
?~ nym ?~ nym
?> ?=(^ her) ?> ?=(^ her)
=+ asc=(~(get by folks) u.her) =+ asc=(~(get by nicks) u.her)
%+ sh-fact %txt %+ sh-fact %txt
?~ asc "{<u.her>} unbound" ?~ asc "{<u.her>} unbound"
?~ han.u.asc "{<u.her>}:" "{<u.her>}: {<u.asc>}"
"{<u.her>}: {<u.han.u.asc>}"
::> show nick ship ::> show nick ship
?~ her ?~ her
%+ sh-fact %mor %+ sh-fact %mor
%+ turn (reverse-folks u.nym) %+ turn (reverse-nicks u.nym)
|= p/ship |= p/ship
[%txt "{<p>}: {<u.nym>}"] [%txt "{<p>}: {<u.nym>}"]
%. [%human u.her [true=~ hand=nym]] %. [%nick u.her (fall nym '')]
%= sh-act %= sh-act
folks nicks
?~ u.nym ?~ u.nym
::> unset nickname ::> unset nickname
(~(del by folks) u.her) (~(del by nicks) u.her)
::> set nickname ::> set nickname
(~(put by folks) u.her [true=~ hand=nym]) (~(put by nicks) u.her u.nym)
== ==
:: ::
++ wo-set ::< %set ++ wo-set ::< %set
@ -1224,7 +1209,7 @@
:: ::
|= paz/(set partner) |= paz/(set partner)
?: (sh-pear paz) paz ?: (sh-pear paz) paz
(~(put in paz) [%& our.bol inbox]) (~(put in paz) inpan)
:: ::
++ sh-pear ::< hearback ++ sh-pear ::< hearback
::> produces true if any partner is included in ::> produces true if any partner is included in
@ -1528,7 +1513,7 @@
=. +>.$ =. +>.$
%+ sh-show-sources %+ sh-show-sources
(weld (trip inbox) ": ") (weld (trip inbox) ": ")
(sh-set-diff src.laz src.loc) (sh-set-diff sre.laz sre.loc)
?: !=(sec.con.loc sec.con.laz) ?: !=(sec.con.loc sec.con.laz)
=. +>.$ (sh-note :(weld pre "but " (sh-cure sec.con.loc))) =. +>.$ (sh-note :(weld pre "but " (sh-cure sec.con.loc)))
%^ sh-show-permits %^ sh-show-permits
@ -1540,14 +1525,14 @@
sec.con.loc sec.con.loc
(sh-set-diff ses.con.laz ses.con.loc) (sh-set-diff ses.con.laz ses.con.loc)
:: ::
++ sh-low-config ::< do show config ++ sh-config ::< do show config
::> prints a circle's config changes to the cli. ::> prints a circle's config changes to the cli.
:: ::
|= {cir/circle old/(unit config) new/(unit config)} |= {cir/circle old/(unit config) new/(unit config)}
^+ +> ^+ +>
:: new circle :: new circle
?~ old ?~ old
:: ++sh-low-rempe will notice a new partner. :: ++sh-show-rempe will notice a new partner.
+> +>
:: removed circle :: removed circle
?~ new ?~ new
@ -1556,65 +1541,30 @@
(weld ~(cr-phat cr cir) ": ") (weld ~(cr-phat cr cir) ": ")
u.old u.new u.old u.new
:: ::
++ sh-low-rempe ::< show remotes ++ sh-gram ::< show telegram
::> prints remote presence changes to the cli.
::
|= {old/(map partner group) new/(map partner group)}
?: (~(has in settings.she) %quiet)
+>.$
=+ day=(sh-rempe-diff old new)
=. +>.$
|- ^+ +>.^$
?~ old.day +>.^$
=. +>.^$ $(old.day t.old.day)
(sh-note (weld "not " (~(pr-show pr p.i.old.day) ~)))
=. +>.$
|- ^+ +>.^$
?~ new.day +>.^$
=. +>.^$ $(new.day t.new.day)
=. +>.^$
(sh-note (weld "new " (~(pr-show pr p.i.new.day) ~)))
(sh-show-precs "--" ~ (~(tap by q.i.new.day)) ~)
=. +>.$
|- ^+ +>.^$
?~ cha.day +>.^$
=. +>.^$ $(cha.day t.cha.day)
=. +>.^$
(sh-note (weld "for " (~(pr-show pr p.i.cha.day) ~)))
=+ yez=(~(got by old) p.i.cha.day)
%+ sh-show-precs "--"
(sh-group-diff yez q.i.cha.day)
+>.$
::
++ sh-low-precs ::< show presence
::> prints presence changes to the cli.
::
|= {old/group new/group}
^+ +>
=+ dif=(sh-group-diff old new)
(sh-show-precs "" dif)
::
++ sh-low-gram ::< show telegram
::> prints the telegram. every fifth message, ::> prints the telegram. every fifth message,
::> print the message number also. ::> print the message number also.
:: ::
|= {num/@ud gam/telegram} |= gam/telegram
^+ +> ^+ +>
?: =(num count.she) ::TODO is it cool to just assume all messages we print are already stored?
=. +> ?:(=(0 (mod num 5)) (sh-numb num) +>) =+ num=(~(got by known) uid.tot.gam)
(sh-rend(count.she +(num)) gam) =. +>.$
?: (gth num count.she) :: if the number isn't directly after latest, print it always.
=. +> (sh-numb num) ?. =(num +(latest.she))
(sh-rend(count.she +(num)) gam) (sh-numb num)
+> :: if the number is directly after latest, print every fifth.
?. =(0 (mod num 5)) +>.$
(sh-numb num)
(sh-rend(latest.she num) gam)
:: ::
++ sh-low-grams ::< do show telegrams ++ sh-grams ::< do show telegrams
::> prints multiple telegrams. ::> prints multiple telegrams.
:: ::
|= {num/@ud gaz/(list telegram)} |= gaz/(list telegram)
^+ +> ^+ +>
?~ gaz +> ?~ gaz +>
$(gaz t.gaz, num +(num), +> (sh-low-gram num i.gaz)) $(gaz t.gaz, +> (sh-gram i.gaz))
:: ::
-- --
-- --
@ -1670,12 +1620,10 @@
::> left-pads with spaces. ::> left-pads with spaces.
:: ::
|. ^- tape |. ^- tape
=+ nym=(~(get by folks) hos.one) =+ nym=(~(get by nicks) hos.one)
?~ nym ?~ nym
(cr-curt |) (cr-curt |)
?~ han.u.nym =+ raw=(trip u.nym)
(cr-curt |)
=+ raw=(trip u.han.u.nym)
=+ len=(sub 14 (lent raw)) =+ len=(sub 14 (lent raw))
(weld (reap len ' ') raw) (weld (reap len ' ') raw)
:: ::
@ -1691,11 +1639,11 @@
?: =(nom.one inbox) ?: =(nom.one inbox)
":" ":"
['%' (trip nom.one)] ['%' (trip nom.one)]
?: =(hos.one (sein our.bol))
['/' (trip nom.one)]
=+ wun=(scow %p hos.one) =+ wun=(scow %p hos.one)
?: =(nom.one (main hos.one)) ?: =(nom.one (main hos.one))
wun wun
?: =(hos.one (sein our.bol))
['/' (trip nom.one)]
:(welp wun "/" (trip nom.one)) :(welp wun "/" (trip nom.one))
-- --
:: ::
@ -1756,6 +1704,7 @@
++ pr-show ::< render partner ++ pr-show ::< render partner
::> renders a partner as text. ::> renders a partner as text.
:: ::
::> moy: multiple partners in audience?
|= moy/(unit ?) |= moy/(unit ?)
^- tape ^- tape
?- -.one ?- -.one
@ -1804,7 +1753,7 @@
::> remove ourselves from the audience. ::> remove ourselves from the audience.
:: ::
^+ . ^+ .
.(lix (~(del in lix) `partner`[%& our.bol inbox])) .(lix (~(del in lix) `partner`inpan))
:: ::
++ ar-maud ::< multiple audience ++ ar-maud ::< multiple audience
::> checks if there's multiple partners in the ::> checks if there's multiple partners in the
@ -2109,7 +2058,7 @@
?~ ace wyd ?~ ace wyd
(sub wyd u.ace) (sub wyd u.ace)
:- (weld pef (scag end `tape`txt)) :- (weld pef (scag end `tape`txt))
$(txt (slag +(end) `tape`txt), pef (reap (lent pef) ' ')) ::TODO why do we need to cast? $(txt (slag +(end) `tape`txt), pef (reap (lent pef) ' ')) ::TODO? why do we need to cast?
:: ::
$inv $inv
:_ ~ :_ ~
@ -2151,29 +2100,25 @@
[~ +>] [~ +>]
ta-done:ta-console:ta ta-done:ta-console:ta
:: ::
++ diff-talk-delta ::< accept change ++ diff-talk-prize ::< accept query answer
::> ::>
::TODO ++feel
:: ::
|= {way/wire dif/delta} |= {way/wire piz/prize}
^- (quip move +>) ^- (quip move +>)
ta-done:(ta-change:ta dif) ta-done:(ta-take:ta piz)
:: ::
++ diff-talk-lowdown ::< accept lowdown ++ diff-talk-rumor ::< accept query change
::> incoming talk-lowdown. process it. ::>
::> we *could* use the wire to identify what story
::> subscription our lowdown is coming from, but
::> since we only ever subscribe to a single story,
::> we don't bother.
:: ::
|= {way/wire low/lowdown} |= {way/wire dif/rumor}
ta-done:(ta-low:ta low) ^- (quip move +>)
ta-done:(ta-hear:ta dif)
:: ::
++ diff-talk-reaction ::< accept reaction ++ diff-talk-reaction ::< accept reaction
::> incoming talk reaction. process it. ::> incoming talk reaction. process it.
:: ::
|= {way/wire rac/reaction} |= {way/wire rac/reaction}
?. =(src.bol -:(broker our.bol)) ?. =(src.bol -:broker)
~& [%diff-reaction-stranger src.bol] ~& [%diff-reaction-stranger src.bol]
[~ +>] [~ +>]
ta-done:(ta-reaction:ta rac) ta-done:(ta-reaction:ta rac)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,19 @@
[. ^talk] [. ^talk]
|_ bol/bowl |_ bol/bowl
++ main :: main story ++ main :: main story
|= our/ship ^- cord |= who/ship ^- cord
=+ can=(clan our) =+ can=(clan who)
?+ can %porch ?+ can %porch
$czar %court $czar %court
$king %floor $king %floor
== ==
:: ::
::TODO add to zuse?
++ true-self
|= who/ship
?. ?=($earl (clan who)) who
(sein who)
::
++ said-url :: app url ++ said-url :: app url
|= url/purl |= url/purl
:^ ost.bol %poke /said-url :^ ost.bol %poke /said-url
@ -87,13 +93,14 @@
$filter cof(fit fit.dif) $filter cof(fit fit.dif)
$remove cof $remove cof
:: ::
$source $sourcee
%= cof %= cof
src sre
%. `(set partner)`pas.dif ::TODO? why do we *need* to cast? %. `(set partner)`pas.dif ::TODO? why do we *need* to cast?
~& [%doing-sourcee add.dif pas.dif]
?: add.dif ?: add.dif
~(uni in src.cof) ~(uni in sre.cof)
~(dif in src.cof) ~(dif in sre.cof)
== ==
:: ::
$permit $permit
@ -116,23 +123,6 @@
~ ~
ses.con.cof ses.con.cof
== ==
::
$federal
%= cof
fes.fed
?. fed.dif fes.fed.cof
%. sis.dif
?: add.dif
~(uni in fes.fed.cof)
~(dif in fes.fed.cof)
::
may.fed
?: fed.dif may.fed.cof
%. sis.dif
?: add.dif
~(uni in may.fed.cof)
~(dif in may.fed.cof)
==
== ==
:: ::
++ change-status ::< ... ++ change-status ::< ...
@ -155,4 +145,77 @@
== ==
== ==
== ==
::
++ depa :: de-pathing core
=> |% ++ grub * :: result
++ weir (list coin) :: parsed wire
++ fist $-(weir grub) :: reparser instance
--
|%
::
++ al
|* {hed/$-(coin *) tal/fist}
|= wir/weir ^+ [*hed *tal]
?~ wir !!
[(hed i.wir) (tal t.wir)]
::
++ at
|* typ/{@tas (pole @tas)}
=+ [i-typ t-typ]=typ
|= wer/weir
^- (tup:dray i-typ t-typ) ::< ie, (tup %p %tas ~) is {@p @tas}
?~ wer !!
?~ t-typ
?^ t.wer !!
((do i-typ) i.wer)
:- ((do i-typ) i.wer)
(^$(typ t-typ) t.wer)
::
++ mu :: true unit
|* wit/fist
|= wer/weir
?~(wer ~ (some (wit wer)))
::
++ af :: object as frond
|* buk/(pole {cord fist})
|= wer/weir
?> ?=({{$$ $tas @tas} *} wer)
?~ buk !!
=+ [[tag wit] t-buk]=buk
?: =(tag q.p.i.wer)
[tag ~|(tag+`@tas`tag (wit t.wer))]
?~ t-buk ~|(bad-tag+q.p.i.wer !!)
(^$(buk t-buk) wer)
::
++ or
|* typ/|-($@(@tas {@tas $}))
|= con/coin
::^- _(snag *@ (turn (limo typ) |*(a/@tas [a (odo:raid a)])))
?> ?=($$ -.con)
=/ i-typ ?@(typ typ -.typ)
?: =(i-typ p.p.con)
:- i-typ
^- (odo:raid i-typ)
q.p.con
?@ typ ~|(%bad-odor !!)
(^$(typ +.typ) con)
::
++ do
|* typ/@tas
|= con/coin
^- (odo:raid typ)
?. ?=($$ -.con) ~|(%not-dime !!)
?. =(typ p.p.con) ~|(bad-odor+`@tas`p.p.con !!)
q.p.con
::
++ ul :: null
|=(wer/weir ?~(wer ~ !!))
::
++ un
|* wit/$-(coin *)
|= wir/weir ^+ *wit
?~ wir !!
?^ t.wir !!
(wit i.wir)
--
-- --

View File

@ -14,7 +14,8 @@
=> [jo ..command] => [jo ..command]
|= a/json ^- command |= a/json ^- command
=- (need ((of -) a)) =- (need ((of -) a))
=< :~ review+(ar thot) =< :~ publish+(ar thot)
bearing+ul
== ==
|% |%
++ op :: parse keys of map ++ op :: parse keys of map

14
mar/talk/prize.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/prize/talk/mar
::
/? 310
/- talk
!:
[talk .]
|_ piz/prize
::
++ grab :: convert from
|%
++ noun prize :: clam from %noun
--
--

14
mar/talk/rumor.hoon Normal file
View File

@ -0,0 +1,14 @@
::
:::: /hoon/rumor/talk/mar
::
/? 310
/- talk
!:
[talk .]
|_ dif/rumor
::
++ grab :: convert from
|%
++ noun rumor :: clam from %noun
--
--

View File

@ -9,26 +9,23 @@
::> models relating to queries, their results and updates. ::> models relating to queries, their results and updates.
::+| ::+|
:: ::
::TODO path parsing/casting: ;;(query pax) or ((hard query) pax)
:: or (raid /~zod/5 /[%p]/[%ud])
:: ...but it's still shit.
++ query ::> query paths ++ query ::> query paths
$% {$reader $~} ::< shared ui state $% {$reader $~} ::< shared ui state
{$friend $~} ::< publicly joined {$friend $~} ::< publicly joined
{$burden $~} ::< duties to share
{$report $~} ::< duty reports
{$circle nom/knot ran/range} ::< story query {$circle nom/knot ran/range} ::< story query
== :: == ::
++ range (unit {hed/@ t/(unit {tal/@ $~})}) ::< msg range, @ud/@da ++ range (unit {hed/place tal/(unit place)}) ::< msg range, @ud/@da
++ place $%({$da @da} {$ud @ud}) ::< point for range
++ prize ::> query result ++ prize ::> query result
$% $: $reader ::< /reader $% $: $reader ::< /reader
gys/(jug char (set partner)) ::< glyph bindings gys/(jug char (set partner)) ::< glyph bindings
nis/(map ship cord) ::< nicknames nis/(map ship cord) ::< nicknames
== :: == ::
{$friend cis/(set circle)} ::< /friend {$friend cis/(set circle)} ::< /friend
$: $circle ::< /circle {$burden sos/(map knot burden)} ::< /burden
gaz/(list telegram) ::< queried messages {$circle burden} ::< /circle
cos/lobby ::< configs
pes/crowd ::< presences
== ::
== :: == ::
++ rumor ::< query result change ++ rumor ::< query result change
$% $: $reader ::< /reader $% $: $reader ::< /reader
@ -38,22 +35,29 @@
== :: == ::
== :: == ::
{$friend add/? cir/circle} ::< /friend {$friend add/? cir/circle} ::< /friend
{$burden nom/knot dif/diff-story} ::< /burden
{$circle dif/diff-story} ::< /circle {$circle dif/diff-story} ::< /circle
== :: == ::
++ burden ::< full story state
$: gaz/(list telegram) ::< all messages
cos/lobby ::< loc & rem configs
pes/crowd ::< loc & rem presences
== ::
::TODO deltas into app ::TODO deltas into app
++ delta :: ++ delta ::
$% ::TODO no more %more, just produce/take list instead! $% ::TODO no more %more, just produce/take list instead!
{$more mor/(list delta)} ::< multiple changes {$more mor/(list delta)} ::< multiple changes
:: messaging state :: :: messaging state ::
{$out cir/circle out/(list thought)} ::< msgs into outbox {$out cir/circle out/(list thought)} ::< msgs into outbox
{$done don/(map @ud {partner ?})} ::< msgs delivered {$done don/(map @ud {partner (unit tang)})} ::< msgs delivered
:: shared ui state :: :: shared ui state ::
{$glyph diff-glyph} ::< un/bound glyph {$glyph diff-glyph} ::< un/bound glyph
{$nick diff-nick} ::< changed nickname {$nick diff-nick} ::< changed nickname
:: story state :: :: story state ::
{$story nom/knot dif/diff-story} ::< change to story {$story nom/knot dif/diff-story} ::< change to story
:: side-effects :: :: side-effects ::
{$bear cir/circle} ::< %burden command {$init $~} ::< initialize
{$observe who/ship} ::< watch burden bearer
{$react ost/bone rac/reaction} ::TODO ost.bol? ::< reaction to action {$react ost/bone rac/reaction} ::TODO ost.bol? ::< reaction to action
{$quit ost/bone} ::< force unsubscribe {$quit ost/bone} ::< force unsubscribe
== :: == ::
@ -61,19 +65,21 @@
++ diff-nick {who/ship nic/cord} ::< changed nickname ++ diff-nick {who/ship nic/cord} ::< changed nickname
++ diff-story :: ++ diff-story ::
$% {$new con/config} ::< new story $% {$new con/config} ::< new story
{$bear bur/burden} ::< new inherited story
{$grams gaz/(list telegram)} ::< new/changed msgs {$grams gaz/(list telegram)} ::< new/changed msgs
{$config cir/circle dif/diff-config} ::< new/changed config {$config cir/circle dif/diff-config} ::< new/changed config
{$status pan/partner who/ship dif/diff-status} ::< new/changed status {$status pan/partner who/ship dif/diff-status} ::< new/changed status
{$follow sub/? pas/(set partner)} ::TODO range ::< un/subscribe
{$remove $~} ::< removed story {$remove $~} ::< removed story
== :: == ::
++ diff-config ::> config change ++ diff-config ::> config change
$% {$full cof/config} ::< fully changed config $% {$full cof/config} ::< fully changed config
{$source add/? pas/(set partner)} ::< add/rem sources ::TODO maybe just single partner, since we prob always do that
{$sourcee add/? pas/(set partner)} ::< add/rem sources
{$caption cap/cord} ::< changed description {$caption cap/cord} ::< changed description
{$filter fit/filter} ::< changed filter {$filter fit/filter} ::< changed filter
{$permit add/? sis/(set ship)} ::< add/rem to b/w-list {$permit add/? sis/(set ship)} ::< add/rem to b/w-list
{$secure sec/security} ::< changed security {$secure sec/security} ::< changed security
{$federal add/? fed/? sis/(set ship)} ::< add/rem may/fes
{$remove $~} ::< removed config {$remove $~} ::< removed config
== :: == ::
++ diff-status ::> status change ++ diff-status ::> status change
@ -102,8 +108,6 @@
{$filter nom/knot fit/filter} ::< change message rules {$filter nom/knot fit/filter} ::< change message rules
{$permit nom/knot inv/? sis/(set ship)} ::< invite/banish {$permit nom/knot inv/? sis/(set ship)} ::< invite/banish
{$source nom/knot sub/? src/(set partner)} ::< un/sub to/from src {$source nom/knot sub/? src/(set partner)} ::< un/sub to/from src
{$enlist nom/knot fed/? sis/(set ship)} ::< dis/allow federation
{$burden circle} ::< help federate
:: messaging :: :: messaging ::
{$convey tos/(list thought)} ::< post exact {$convey tos/(list thought)} ::< post exact
{$phrase aud/(set partner) ses/(list speech)} ::< post easy {$phrase aud/(set partner) ses/(list speech)} ::< post easy
@ -119,18 +123,6 @@
wat/cord ::< explain wat/cord ::< explain
why/(unit action) ::< cause why/(unit action) ::< cause
== :: == ::
++ lowdown ::> new/changed state
$% :: story state ::
$: $confs ::< configs
loc/(unit config) ::< local config
rem/(map circle (unit config)) ::< remote configs
== ::
{$precs reg/crowd} ::< presences
{$grams num/@ud gaz/(list telegram)} ::< messages
:: ui state ::
{$glyph (jug char (set partner))} ::< glyph bindings
{$names (map ship (unit human))} ::< nicknames
== ::
:: ::
::> || ::> ||
::> || %broker-communication ::> || %broker-communication
@ -139,19 +131,8 @@
::+| ::+|
:: ::
++ command ::> effect on story ++ command ::> effect on story
$% {$review tos/(list thought)} ::< deliver $% {$publish tos/(list thought)} ::< deliver
$: $burden ::< starting fed state {$bearing $~} ::< prompt to listen
nom/knot
cof/lobby
pes/crowd
gaz/(list telegram)
==
{$relief nom/knot who/(set ship)} ::< federation ended
== ::
++ report ::> update
$% {$lobby cab/lobby} ::< config neighborhood
{$crowd reg/crowd} ::< presence
{$grams num/@ud gaz/(list telegram)} ::< thoughts
== :: == ::
:: ::
::> || ::> ||
@ -168,24 +149,25 @@
:: circle configurations. :: :: circle configurations. ::
++ lobby {loc/config rem/(map circle config)} ::< our & srcs configs ++ lobby {loc/config rem/(map circle config)} ::< our & srcs configs
++ config ::> circle config ++ config ::> circle config
$: src/(set partner) ::< pulls from $: sre/(set partner) ::< active sources
cap/cord ::< description cap/cord ::< description
fit/filter ::< message rules fit/filter ::< message rules
con/control ::< restrictions con/control ::< restrictions
fed/federal ::< federators :: so: only change src on success of peer/pull (√)
:: and: when gaining a fed, do a %peer (√)
== :: == ::
++ filter ::> content filters ++ filter ::> content filters
$: cus/? ::< dis/allow capitals $: cus/? ::< dis/allow capitals
::TODO rename cus to cas? (capitals/case instead of cuss)
utf/? ::< dis/allow non-ascii utf/? ::< dis/allow non-ascii
== :: == ::
++ control {sec/security ses/(set ship)} ::< access control ++ control {sec/security ses/(set ship)} ::< access control
++ security ::> security kind ++ security ::> security mode
$? $black ::< channel, blacklist $? $black ::< channel, blacklist
$white ::< village, whitelist $white ::< village, whitelist
$green ::< journal, author list $green ::< journal, author list
$brown ::< mailbox, our r, bl w $brown ::< mailbox, our r, bl w
== :: == ::
++ federal {may/(set ship) fes/(set ship)} ::< federation control
:: participant metadata. :: :: participant metadata. ::
++ crowd {loc/group rem/(map partner group)} ::< our & srcs presences ++ crowd {loc/group rem/(map partner group)} ::< our & srcs presences
++ group (map ship status) ::< presence map ++ group (map ship status) ::< presence map
@ -254,7 +236,6 @@
$released ::< sent one-way $released ::< sent one-way
$accepted ::< fully processed $accepted ::< fully processed
== :: == ::
::TODO what is ++bouquet even for? not yet used...
++ bouquet (set flavor) ::< complete aroma ++ bouquet (set flavor) ::< complete aroma
++ flavor path ::< content flavor ++ flavor path ::< content flavor
-- --