Bound faces to talk structures. Renamed stations to circles.

Communication structures get no new faces because their ideal implementation uses gates to process them.
This commit is contained in:
Fang 2017-04-24 20:17:56 +02:00
parent 0a4d5e9b3b
commit 23bdb637b2
3 changed files with 303 additions and 293 deletions

View File

@ -36,11 +36,11 @@
sources/(set partner) ::< our subscriptions sources/(set partner) ::< our subscriptions
:: partner details :: :: partner details ::
remotes/(map partner atlas) ::< remote presences remotes/(map partner atlas) ::< remote presences
mirrors/(map station config) ::< remote configs mirrors/(map circle config) ::< remote configs
:: ui state :: :: ui state ::
folks/(map ship human) ::< human identities folks/(map ship human) ::< human identities
nik/(map (set partner) char) ::< bound station glyphs nik/(map (set partner) char) ::< bound circle glyphs
nak/(jug char (set partner)) ::< station glyph lookup nak/(jug char (set partner)) ::< circle glyph lookup
cli/shell ::< interaction state cli/shell ::< interaction state
== :: == ::
++ shell ::> console session ++ shell ::> console session
@ -65,11 +65,11 @@
{$peer wire dock path} :: {$peer wire dock path} ::
== :: == ::
++ work ::> interface action ++ work ::> interface action
$% :: station management :: $% :: circle management ::
{$join p/where} ::< subscribe to {$join p/where} ::< subscribe to
{$leave p/where} ::< unsubscribe from {$leave p/where} ::< unsubscribe from
{$create p/posture q/knot r/cord} ::< create station {$create p/posture q/knot r/cord} ::< create circle
{$delete p/knot q/(unit cord)} ::< delete station {$delete p/knot q/(unit cord)} ::< delete circle
{$depict p/knot q/cord} ::< change description {$depict p/knot q/cord} ::< change description
{$source p/knot q/(set partner)} ::< add source {$source p/knot q/(set partner)} ::< add source
{$invite p/knot q/(set ship)} ::< give permission {$invite p/knot q/(set ship)} ::< give permission
@ -92,7 +92,7 @@
{$help $~} ::< print usage info {$help $~} ::< print usage info
== :: == ::
++ where (set partner) ::< non-empty audience ++ where (set partner) ::< non-empty audience
++ glyphs `wall`~[">=+-" "}),." "\"'`^" "$%&@"] ::< station char pool ' ++ glyphs `wall`~[">=+-" "}),." "\"'`^" "$%&@"] ::< circle char pool '
-- --
:: ::
::> || ::> ||
@ -124,8 +124,8 @@
our our
(sein our) (sein our)
:: ::
++ inbox ::< reader's station ++ inbox ::< reader's circle
::> produces the name of the station used by this ::> produces the name of the circle used by this
::> reader for all its operations ::> reader for all its operations
(main our.bol) (main our.bol)
:: ::
@ -266,38 +266,38 @@
== ==
:: ::
++ ta-low-confs ::< apply changed confs ++ ta-low-confs ::< apply changed confs
::> applies new station configurations. ::> applies new circle configurations.
::> because of how this reader only subscribes to ::> because of how this reader only subscribes to
::> the main mailbox, {coy} is always the mailbox's ::> the main mailbox, {coy} is always the mailbox's
::> config. ::> config.
:: ::
|= {coy/(unit config) cofs/(map station (unit config))} |= {coy/(unit config) cofs/(map circle (unit config))}
^+ +> ^+ +>
::> if possible, update {sources}. if we do, and we ::> if possible, update {sources}. if we do, and we
::> gain new ones, update the prompt. (this is to ::> gain new ones, update the prompt. (this is to
::> remove the mailbox from the audience after ::> remove the mailbox from the audience after
::> creating or joining a new station.) ::> creating or joining a new circle.)
?~ coy ~&(%mailbox-gone !!) ?~ coy ~&(%mailbox-gone !!)
=. +> ::TODO =? =. +> ::TODO =?
?~ (~(dif in sources.u.coy) sources) +>.$ ?~ (~(dif in src.u.coy) sources) +>.$
=< sh-done =< sh-done
%- ~(sh-pact sh(sources sources.u.coy) cli) %- ~(sh-pact sh(sources src.u.coy) cli)
(~(dif in sources.u.coy) sources) (~(dif in src.u.coy) sources)
=. sources sources.u.coy =. sources src.u.coy
=. cofs (~(put by cofs) [our.bol inbox] coy) =. cofs (~(put by cofs) [our.bol inbox] coy)
:: print changes for each config. :: print changes for each config.
=. +>.$ =. +>.$
=< sh-done =< sh-done
%+ roll (~(tap by cofs)) %+ roll (~(tap by cofs))
|= {{s/station c/(unit config)} core/_sh} |= {{s/circle c/(unit config)} core/_sh}
%^ ~(sh-low-config core cli) %^ ~(sh-low-config core cli)
s (~(get by mirrors) s) c s (~(get by mirrors) s) c
:: apply config changes to {mirrors}. :: apply config changes to {mirrors}.
=. mirrors =. mirrors
%- ~(gas by *_mirrors) %- ~(gas by *_mirrors)
%+ murn (~(tap by cofs)) %+ murn (~(tap by cofs))
|= {s/station c/(unit config)} |= {s/circle c/(unit config)}
^- (unit (pair station config)) ^- (unit (pair circle config))
?~(c ~ `[s u.c]) ?~(c ~ `[s u.c])
+>.$ +>.$
:: ::
@ -351,7 +351,7 @@
:: ::
|= gam/telegram |= gam/telegram
^+ +> ^+ +>
=+ old=(~(get by known) p.q.gam) =+ old=(~(get by known) uid.tot.gam)
?~ old ?~ old
(ta-append gam) ::< add (ta-append gam) ::< add
(ta-revise u.old gam) ::< modify (ta-revise u.old gam) ::< modify
@ -364,7 +364,7 @@
%= +> %= +>
grams [gam grams] grams [gam grams]
count +(count) count +(count)
known (~(put by known) p.q.gam count) known (~(put by known) uid.tot.gam count)
== ==
:: ::
++ ta-revise ::< revise message ++ ta-revise ::< revise message
@ -514,10 +514,10 @@
== ==
== ==
:: ::
++ stat ::< local station ++ stat ::< local circle
;~(pfix cen sym) ;~(pfix cen sym)
:: ::
++ stan ::< station ++ stan ::< circle
;~ pose ;~ pose
(cold [our.bol inbox] col) (cold [our.bol inbox] col)
;~(pfix cen (stag our.bol sym)) ;~(pfix cen (stag our.bol sym))
@ -589,7 +589,7 @@
:: ::
++ nick (cook crip (stun [1 14] low)) ::< nickname ++ nick (cook crip (stun [1 14] low)) ::< nickname
++ text (cook crip (plus (shim ' ' '~'))) ::< bullets separating ++ text (cook crip (plus (shim ' ' '~'))) ::< bullets separating
++ glyph (mask "/\\\{(<!?{(zing glyphs)}") ::< station postfix ++ glyph (mask "/\\\{(<!?{(zing glyphs)}") ::< circle postfix
++ setting ::< setting flag ++ setting ::< setting flag
%- perk :~ %- perk :~
%noob %noob
@ -601,7 +601,7 @@
=- ;~(pose ;~(pfix sem -) message) =- ;~(pose ;~(pfix sem -) message)
;~ pose ;~ pose
:: ::
:: station management :: circle management
:: ::
;~((glue ace) (perk %join ~) para) ;~((glue ace) (perk %join ~) para)
:: ::
@ -808,7 +808,7 @@
:: ::
++ work ::< call correct worker ++ work ::< call correct worker
?- -.job ?- -.job
:: station management :: circle management
$join (join +.job) $join (join +.job)
$leave (leave +.job) $leave (leave +.job)
$create (create +.job) $create (create +.job)
@ -903,8 +903,8 @@
^- (list ship) ^- (list ship)
%+ murn (~(tap by folks)) %+ murn (~(tap by folks))
|= {p/ship q/human} |= {p/ship q/human}
?~ hand.q ~ ?~ han.q ~
?. =(u.hand.q nym) ~ ?. =(u.han.q nym) ~
[~ u=p] [~ u=p]
:: ::
++ twig-head ::< eval data ++ twig-head ::< eval data
@ -916,7 +916,7 @@
[our.bol now.bol (shas %eny eny.bol)] [our.bol now.bol (shas %eny eny.bol)]
:: ::
::> || ::> ||
::> || %station-management ::> || %circle-management
::> || ::> ||
::+| ::+|
:: ::
@ -946,7 +946,7 @@
(sh-act %source inbox | pas) (sh-act %source inbox | pas)
:: ::
++ create ::< %create ++ create ::< %create
::> creates station {nom} with specified config. ::> creates circle {nom} with specified config.
:: ::
|= {por/posture nom/knot txt/cord} |= {por/posture nom/knot txt/cord}
^+ ..sh-work ^+ ..sh-work
@ -958,7 +958,7 @@
(join [[%& our.bol nom] ~ ~]) (join [[%& our.bol nom] ~ ~])
:: ::
++ delete ::< %delete ++ delete ::< %delete
::> deletes our station {nom}, after optionally ::> deletes our circle {nom}, after optionally
::> sending a last announce message {say}. ::> sending a last announce message {say}.
:: ::
|= {nom/knot say/(unit cord)} |= {nom/knot say/(unit cord)}
@ -973,21 +973,21 @@
(sh-act %depict nom txt) (sh-act %depict nom txt)
:: ::
++ source ::< %source ++ source ::< %source
::> adds {pas} to {nom}'s sources. ::> adds {pas} to {nom}'s src.
:: ::
|= {nom/knot pas/(set partner)} |= {nom/knot pas/(set partner)}
^+ ..sh-work ^+ ..sh-work
(sh-act %source nom & pas) (sh-act %source nom & pas)
:: ::
++ invite ::< %invite ++ invite ::< %invite
::> invites {sis} to our station {nom}. ::> invites {sis} to our circle {nom}.
:: ::
|= {nom/knot sis/(set ship)} |= {nom/knot sis/(set ship)}
^+ ..sh-work ^+ ..sh-work
(sh-act %permit nom & sis) (sh-act %permit nom & sis)
:: ::
++ banish ::< %banish ++ banish ::< %banish
::> banish {sis} from our station {nom}. ::> banish {sis} from our circle {nom}.
:: ::
|= {nom/knot sis/(set ship)} |= {nom/knot sis/(set ship)}
^+ ..sh-work ^+ ..sh-work
@ -1039,12 +1039,13 @@
=< (murn (sort (~(tap by alt)) aor) .) =< (murn (sort (~(tap by alt)) aor) .)
|= {a/ship b/presence c/human} ^- (unit tank) |= {a/ship b/presence c/human} ^- (unit tank)
=. c =. c
?. =(hand.c `(scot %p a)) c ?. =(han.c `(scot %p a)) c
[true.c ~] [tru.c ~]
?- b ?- b
$gone ~ $gone ~
$hear `leaf+:(weld "hear " (scow %p a) " " (trip (fall hand.c ''))) $idle `leaf+:(weld "idle " (scow %p a) " " (trip (fall han.c '')))
$talk `leaf+:(weld "talk " (scow %p a) " " (trip (fall hand.c ''))) $hear `leaf+:(weld "hear " (scow %p a) " " (trip (fall han.c '')))
$talk `leaf+:(weld "talk " (scow %p a) " " (trip (fall han.c '')))
== ==
:: ::
++ what ::< %what ++ what ::< %what
@ -1120,17 +1121,17 @@
%+ turn (~(tap by folks)) %+ turn (~(tap by folks))
|= {p/ship q/human} |= {p/ship q/human}
:- %txt :- %txt
?~ hand.q ?~ han.q
"{<p>}:" "{<p>}:"
"{<p>}: {<u.hand.q>}" "{<p>}: {<u.han.q>}"
::> show her nick ::> show her nick
?~ nym ?~ nym
?> ?=(^ her) ?> ?=(^ her)
=+ asc=(~(get by folks) u.her) =+ asc=(~(get by folks) u.her)
%+ sh-fact %txt %+ sh-fact %txt
?~ asc "{<u.her>} unbound" ?~ asc "{<u.her>} unbound"
?~ hand.u.asc "{<u.her>}:" ?~ han.u.asc "{<u.her>}:"
"{<u.her>}: {<u.hand.u.asc>}" "{<u.her>}: {<u.han.u.asc>}"
::> show nick ship ::> show nick ship
?~ her ?~ her
%+ sh-fact %mor %+ sh-fact %mor
@ -1225,7 +1226,7 @@
::> if partner is a passport, ignore. ::> if partner is a passport, ignore.
?. ?=($& -.tay) +> ?. ?=($& -.tay) +>
=+ cof=(~(get by mirrors) +.tay) =+ cof=(~(get by mirrors) +.tay)
?. |(?=($~ cof) !?=($white p.cordon.u.cof)) ?. |(?=($~ cof) !?=($white sec.con.u.cof))
+>.$ +>.$
(sh-pact [tay ~ ~]) (sh-pact [tay ~ ~])
:: ::
@ -1244,7 +1245,7 @@
|- ^- (unit (set partner)) |- ^- (unit (set partner))
?~ grams ~ ?~ grams ~
::> get first partner from a telegram's audience. ::> get first partner from a telegram's audience.
=+ pan=(silt (turn (~(tap by q.q.i.grams)) head)) =+ pan=(silt (turn (~(tap by aud.tot.i.grams)) head))
?: (~(has in lax) pan) `pan ?: (~(has in lax) pan) `pan
$(grams t.grams) $(grams t.grams)
:: ::
@ -1271,11 +1272,11 @@
|- ^+ ret |- ^+ ret
?~ eno ret ?~ eno ret
=. ret $(eno t.eno) =. ret $(eno t.eno)
?: =(%gone p.q.i.eno) ret ?: =(%gone pec.q.i.eno) ret
=+ unt=(~(get by two) p.i.eno) =+ unt=(~(get by two) p.i.eno)
?~ unt ?~ unt
ret(old [i.eno old.ret]) ret(old [i.eno old.ret])
?: =(%gone p.u.unt) ?: =(%gone pec.u.unt)
ret(old [i.eno old.ret]) ret(old [i.eno old.ret])
?: =(q.i.eno u.unt) ret ?: =(q.i.eno u.unt) ret
ret(cha [[p.i.eno u.unt] cha.ret]) ret(cha [[p.i.eno u.unt] cha.ret])
@ -1284,10 +1285,10 @@
|- ^+ ret |- ^+ ret
?~ owt ret ?~ owt ret
=. ret $(owt t.owt) =. ret $(owt t.owt)
?: =(%gone p.q.i.owt) ret ?: =(%gone pec.q.i.owt) ret
?. (~(has by one) p.i.owt) ?. (~(has by one) p.i.owt)
ret(new [i.owt new.ret]) ret(new [i.owt new.ret])
?: =(%gone p:(~(got by one) p.i.owt)) ?: =(%gone pec:(~(got by one) p.i.owt))
ret(new [i.owt new.ret]) ret(new [i.owt new.ret])
ret ret
ret ret
@ -1329,11 +1330,11 @@
::> maps, producing lists of removed, added and ::> maps, producing lists of removed, added and
::> changed configs. ::> changed configs.
:: ::
|= {one/(map station config) two/(map station config)} |= {one/(map circle config) two/(map circle config)}
=| $= ret =| $= ret
$: old/(list (pair station config)) $: old/(list (pair circle config))
new/(list (pair station config)) new/(list (pair circle config))
cha/(list (pair station config)) cha/(list (pair circle config))
== ==
^+ ret ^+ ret
=. ret =. ret
@ -1374,7 +1375,7 @@
::> renders a reaction to the cli. ::> renders a reaction to the cli.
:: ::
|= rac/reaction |= rac/reaction
(sh-lame (trip what.rac)) (sh-lame (trip wat.rac))
:: ::
++ sh-lame ::< send error ++ sh-lame ::< send error
::> just puts some text into the cli as-is. ::> just puts some text into the cli as-is.
@ -1435,9 +1436,9 @@
++ sh-spaz ::< render status ++ sh-spaz ::< render status
::> gets the presence of {saz} as a tape. ::> gets the presence of {saz} as a tape.
:: ::
|= saz/status |= sat/status
^- tape ^- tape
['%' (trip p.saz)] ['%' (trip pec.sat)]
:: ::
++ sh-show-precs ::< print atlas diff ++ sh-show-precs ::< print atlas diff
::> prints presence changes to the cli. ::> prints presence changes to the cli.
@ -1510,38 +1511,38 @@
|= {pre/tape laz/config loc/config} |= {pre/tape laz/config loc/config}
^+ +> ^+ +>
=. +>.$ =. +>.$
?: =(caption.loc caption.laz) +>.$ ?: =(cap.loc cap.laz) +>.$
(sh-note :(weld pre "cap " (trip caption.loc))) (sh-note :(weld pre "cap " (trip cap.loc)))
=. +>.$ =. +>.$
%+ sh-show-sources %+ sh-show-sources
(weld (trip inbox) ": ") (weld (trip inbox) ": ")
(sh-set-diff sources.laz sources.loc) (sh-set-diff src.laz src.loc)
?: !=(p.cordon.loc p.cordon.laz) ?: !=(sec.con.loc sec.con.laz)
=. +>.$ (sh-note :(weld pre "but " (sh-puss p.cordon.loc))) =. +>.$ (sh-note :(weld pre "but " (sh-puss sec.con.loc)))
%^ sh-show-permits %^ sh-show-permits
(weld (trip inbox) ": ") (weld (trip inbox) ": ")
p.cordon.loc sec.con.loc
[~ (~(tap in q.cordon.loc))] [~ (~(tap in ses.con.loc))]
%^ sh-show-permits %^ sh-show-permits
(weld (trip inbox) ": ") (weld (trip inbox) ": ")
p.cordon.loc sec.con.loc
(sh-set-diff q.cordon.laz q.cordon.loc) (sh-set-diff ses.con.laz ses.con.loc)
:: ::
++ sh-low-config ::< do show config ++ sh-low-config ::< do show config
::> prints a station's config changes to the cli. ::> prints a circle's config changes to the cli.
:: ::
|= {sat/station old/(unit config) new/(unit config)} |= {sat/circle old/(unit config) new/(unit config)}
^+ +> ^+ +>
?~ old ~&([%new-conf sat] +>) ?~ old ~&([%new-conf sat] +>)
?~ new ~&([%del-conf sat] +>) ::TODO tmp ?~ new ~&([%del-conf sat] +>) ::TODO tmp
%^ sh-show-config %^ sh-show-config
(weld ~(sr-phat sr sat) ": ") (weld ~(cr-phat cr sat) ": ")
u.old u.new u.old u.new
:: ::
++ sh-low-remco ::TODO delete me ++ sh-low-remco ::TODO delete me
::> prints changes to remote configs to the cli ::> prints changes to remote configs to the cli
:: ::
|= {ole/(map station config) neu/(map station config)} |= {ole/(map circle config) neu/(map circle config)}
^+ +> ^+ +>
=+ (sh-remco-diff ole neu) =+ (sh-remco-diff ole neu)
=. +>.$ =. +>.$
@ -1550,15 +1551,15 @@
=. +>.^$ $(new t.new) =. +>.^$ $(new t.new)
=. +>.^$ (sh-pest [%& p.i.new]) =. +>.^$ (sh-pest [%& p.i.new])
%+ sh-show-config %+ sh-show-config
(weld ~(sr-phat sr p.i.new) ": ") (weld ~(cr-phat cr p.i.new) ": ")
[*config q.i.new] [*config q.i.new]
=. +>.$ =. +>.$
|- ^+ +>.^$ |- ^+ +>.^$
?~ cha +>.^$ ?~ cha +>.^$
=. +>.^$ $(cha t.cha) =. +>.^$ $(cha t.cha)
%+ sh-show-config %+ sh-show-config
(weld ~(sr-phat sr p.i.cha) ": ") (weld ~(cr-phat cr p.i.cha) ": ")
[(~(got by ole) `station`p.i.cha) q.i.cha] [(~(got by ole) `circle`p.i.cha) q.i.cha]
+>.$ +>.$
:: ::
++ sh-low-rempe ::< show remotes ++ sh-low-rempe ::< show remotes
@ -1630,81 +1631,81 @@
::> rendering cores. ::> rendering cores.
::+| ::+|
:: ::
++ sr ::< station renderer ++ cr ::< circle renderer
::> used in both station and ship rendering. ::> used in both circle and ship rendering.
:: ::
|_ ::> one: the station. |_ ::> one: the circle.
:: ::
one/station one/circle
:: ::
++ sr-best ::< best to show ++ cr-best ::< best to show
::> returns true if one is better to show, false ::> returns true if one is better to show, false
::> otherwise. prioritizes: our > main > size. ::> otherwise. prioritizes: our > main > size.
::TODO maybe simplify. (lth (xeb (xeb p.one)) (xeb (xeb p.two))) ::TODO maybe simplify. (lth (xeb (xeb hos.one)) (xeb (xeb hos.two)))
:: ::
|= two/station |= two/circle
^- ? ^- ?
:: the station that's ours is better. :: the circle that's ours is better.
?: =(our.bol p.one) ?: =(our.bol hos.one)
?: =(our.bol p.two) ?: =(our.bol hos.two)
?< =(q.one q.two) ?< =(nom.one nom.two)
:: if both stations are ours, the main story is better. :: if both circles are ours, the main story is better.
?: =((main p.one) q.one) %& ?: =((main hos.one) nom.one) %&
?: =((main p.two) q.two) %| ?: =((main hos.two) nom.two) %|
:: if neither are, pick the "larger" one. :: if neither are, pick the "larger" one.
(lth q.one q.two) (lth nom.one nom.two)
%& %&
:: if one isn't ours but two is, two is better. :: if one isn't ours but two is, two is better.
?: =(our.bol p.two) ?: =(our.bol hos.two)
%| %|
?: =(p.one p.two) ?: =(hos.one hos.two)
:: if they're from the same ship, pick the "larger" one. :: if they're from the same ship, pick the "larger" one.
(lth q.one q.two) (lth nom.one nom.two)
:: when in doubt, pick one if its ship is "smaller" than its channel. :: when in doubt, pick one if its ship is "smaller" than its channel.
(lth p.one q.one) (lth hos.one nom.one)
:: ::
++ sr-curt ::< render name in 14 ++ cr-curt ::< render name in 14
::> prints a ship name in 14 characters. left-pads ::> prints a ship name in 14 characters. left-pads
::> with spaces. {mup} signifies "are there other ::> with spaces. {mup} signifies "are there other
::> targets besides this one?" ::> targets besides this one?"
:: ::
|= mup/? |= mup/?
^- tape ^- tape
=+ raw=(cite p.one) =+ raw=(cite hos.one)
(runt [(sub 14 (lent raw)) ' '] raw) (runt [(sub 14 (lent raw)) ' '] raw)
:: ::
++ sr-nick ::< nick or name in 14 ++ cr-nick ::< nick or name in 14
::> get nick for ship, or shortname if no nick. ::> get nick for ship, or shortname if no nick.
::> left-pads with spaces. ::> left-pads with spaces.
:: ::
|. ^- tape |. ^- tape
=+ nym=(~(get by folks) p.one) =+ nym=(~(get by folks) hos.one)
?~ nym ?~ nym
(sr-curt |) (cr-curt |)
?~ hand.u.nym ?~ han.u.nym
(sr-curt |) (cr-curt |)
=+ raw=(trip u.hand.u.nym) =+ raw=(trip u.han.u.nym)
=+ len=(sub 14 (lent raw)) =+ len=(sub 14 (lent raw))
(weld (reap len ' ') raw) (weld (reap len ' ') raw)
:: ::
++ sr-phat ::< render accurately ++ cr-phat ::< render accurately
::> prints a station fully, but still taking ::> prints a circle fully, but still taking
::> "shortcuts" where possible: ::> "shortcuts" where possible:
::> ":" for local mailbox, "~ship" for foreign ::> ":" for local mailbox, "~ship" for foreign
::> mailbox, "%channel" for local station, ::> mailbox, "%channel" for local circle,
::> "/channel" for parent station. ::> "/channel" for parent circle.
:: ::
^- tape ^- tape
?: =(p.one our.bol) ?: =(hos.one our.bol)
?: =(q.one inbox) ?: =(nom.one inbox)
":" ":"
['%' (trip q.one)] ['%' (trip nom.one)]
?: =(p.one (sein our.bol)) ?: =(hos.one (sein our.bol))
['/' (trip q.one)] ['/' (trip nom.one)]
=+ wun=(scow %p p.one) =+ wun=(scow %p hos.one)
?: =(q.one (main p.one)) ?: =(nom.one (main hos.one))
wun wun
:(welp wun "/" (trip q.one)) :(welp wun "/" (trip nom.one))
-- --
:: ::
++ pr ::< partner renderer ++ pr ::< partner renderer
@ -1716,8 +1717,8 @@
:: ::
++ pr-beat ::< more relevant ++ pr-beat ::< more relevant
::> returns true if one is better to show, false ::> returns true if one is better to show, false
::> otherwise. prefers stations over passports. ::> otherwise. prefers circles over passports.
::> if both are stations, ++sr-best. ::> if both are circles, ++cr-best.
::> if both are passports, pick the "larger" one. ::> if both are passports, pick the "larger" one.
::> if they're equal, content hash. ::> if they're equal, content hash.
:: ::
@ -1726,7 +1727,7 @@
$& $&
?- -.two ?- -.two
$| %& $| %&
$& (~(sr-best sr p.one) p.two) $& (~(cr-best cr p.one) p.two)
== ==
:: ::
$| $|
@ -1767,13 +1768,13 @@
|= moy/(unit ?) |= moy/(unit ?)
^- tape ^- tape
?- -.one ?- -.one
:: render station (as glyph if we can). :: render circle (as glyph if we can).
$& $&
?~ moy ?~ moy
=+ cha=(~(get by nik) one ~ ~) =+ cha=(~(get by nik) one ~ ~)
=- ?~(cha - "'{u.cha ~}' {-}") =- ?~(cha - "'{u.cha ~}' {-}")
~(sr-phat sr p.one) ~(cr-phat cr p.one)
(~(sr-curt sr p.one) u.moy) (~(cr-curt cr p.one) u.moy)
:: render passport. :: render passport.
$| $|
=/ pre ^- tape =/ pre ^- tape
@ -1850,9 +1851,9 @@
:: ::
|= pan/partner ^- ? |= pan/partner ^- ?
?& ?=($& -.pan) ?& ?=($& -.pan)
=(p.p.pan our.bol) =(hos.p.pan our.bol)
=+ sot=(~(get by mirrors) +.pan) =+ sot=(~(get by mirrors) +.pan)
&(?=(^ sot) ?=($brown p.cordon.u.sot)) &(?=(^ sot) ?=($brown sec.con.u.sot))
== ==
:: ::
++ ar-pref ::< audience glyph ++ ar-pref ::< audience glyph
@ -1915,8 +1916,8 @@
:: ?: oug :: ?: oug
:: ~(ar-whom ar tr-pals) :: ~(ar-whom ar tr-pals)
?. (~(has in sef) %noob) ?. (~(has in sef) %noob)
(~(sr-curt sr [who (main who)]) |) (~(cr-curt cr [who (main who)]) |)
(~(sr-nick sr [who (main who)])) (~(cr-nick cr [who (main who)]))
?: (~(has in sef) %showtime) ?: (~(has in sef) %showtime)
=+ dat=(yore now.bol) =+ dat=(yore now.bol)
=/ t =/ t
@ -1959,31 +1960,32 @@
tan+~ tan+~
:: ::
$lin $lin
tan+~[leaf+"{?:(p.sep "" "@ ")}{(trip q.sep)}"] tan+~[leaf+"{?:(pat.sep "" "@ ")}{(trip msg.sep)}"]
:: ::
$url $url
url+(crip (earf p.sep)) url+(crip (earf url.sep))
:: ::
$exp $exp
tan+~[leaf+"# {(trip p.sep)}"] tan+~[leaf+"# {(trip exp.sep)}"]
:: ::
$fat $fat
[%mor $(sep q.sep) tan+(tr-tors p.sep) ~] [%mor $(sep sep.sep) tan+(tr-tors tac.sep) ~]
:: ::
$inv $inv
:- %tan :- %tan
:_ ~ :_ ~
:- %leaf :- %leaf
%+ weld %+ weld
?: p.sep ?: inv.sep
"you have been invited to " "you have been invited to "
"you have been banished from " "you have been banished from "
~(sr-phat sr q.sep) ~(cr-phat cr sat.sep)
::
$mor $mor
mor+(turn p.sep |=(speech ^$(sep +<))) mor+(turn ses.sep |=(speech ^$(sep +<)))
:: ::
$app $app
tan+~[rose+[": " ~ ~]^~[leaf+"[{(trip p.sep)}]" leaf+(trip q.sep)]] tan+~[rose+[": " ~ ~]^~[leaf+"[{(trip app.sep)}]" leaf+(trip msg.sep)]]
:: ::
$api $api
:- %tan :- %tan
@ -2002,7 +2004,7 @@
|= a/torso |= a/torso
^- tang ^- tang
?- -.a ?- -.a
$name (welp $(a q.a) leaf+"={(trip p.a)}" ~) $name (welp $(a tac.a) leaf+"={(trip nom.a)}" ~)
$tank +.a $tank +.a
$text (turn (flop +.a) |=(b/cord leaf+(trip b))) $text (turn (flop +.a) |=(b/cord leaf+(trip b)))
== ==
@ -2050,25 +2052,25 @@
~&(tr-lost+sep "") ~&(tr-lost+sep "")
:: ::
$mor $mor
?~ p.sep ~&(%tr-mor-empty "") ?~ ses.sep ~&(%tr-mor-empty "")
|- ^- tape |- ^- tape
?~ t.p.sep ^$(sep i.p.sep) ?~ t.ses.sep ^$(sep i.ses.sep)
(tr-both ^$(sep i.p.sep) $(p.sep t.p.sep)) (tr-both ^$(sep i.ses.sep) $(ses.sep t.ses.sep))
:: ::
$fat $fat
%+ tr-both $(sep q.sep) %+ tr-both $(sep sep.sep)
?+ -.p.sep "..." ?+ -.tac.sep "..."
$tank ~(ram re %rose [" " `~] +.p.sep) $tank ~(ram re %rose [" " `~] +.tac.sep)
== ==
:: ::
$exp $exp
(tr-chow 66 '#' ' ' (trip p.sep)) (tr-chow 66 '#' ' ' (trip exp.sep))
:: ::
$url $url
=+ ful=(earf p.sep) =+ ful=(earf url.sep)
?: (gth 64 (lent ful)) ['/' ' ' ful] ?: (gth 64 (lent ful)) ['/' ' ' ful]
:+ '/' '_' :+ '/' '_'
=+ hok=r.p.p.p.sep =+ hok=r.p.p.url.sep
~! hok ~! hok
=- (swag [a=(sub (max 64 (lent -)) 64) b=64] -) =- (swag [a=(sub (max 64 (lent -)) 64) b=64] -)
^- tape ^- tape
@ -2080,8 +2082,8 @@
(welp b '.' (trip a)) (welp b '.' (trip a))
:: ::
$lin $lin
=+ txt=(trip q.sep) =+ txt=(trip msg.sep)
?: p.sep ?: pat.sep
=+ pal=tr-pals =+ pal=tr-pals
=. pal ?: =(who our.bol) pal ::TODO =? =. pal ?: =(who our.bol) pal ::TODO =?
(~(del in pal) [%& who (main who)]) (~(del in pal) [%& who (main who)])
@ -2090,13 +2092,13 @@
:: ::
$inv $inv
%+ weld %+ weld
?: p.sep ?: inv.sep
" invited you to " " invited you to "
" banished you from " " banished you from "
~(sr-phat sr q.sep) ~(cr-phat cr sat.sep)
:: ::
$app $app
(tr-chow 64 "[{(trip p.sep)}]: {(trip q.sep)}") (tr-chow 64 "[{(trip app.sep)}]: {(trip msg.sep)}")
:: ::
$api $api
%+ tr-chow 64 %+ tr-chow 64

View File

@ -3,8 +3,10 @@
:: :: :: :: :: ::
:: ::
::TODO master changes ::TODO master changes
::TODO char57 comments as line comments when regarding code.
::TODO avoid lark where possible ::TODO avoid lark where possible
::TODO maybe rename wires. repeat & friend -> message & follower ::TODO maybe rename wires. repeat & friend -> message & follower
::TODO put printfs properly through console/mailbox
::TODO think about what printfs we want to keep for the user to see. ::TODO think about what printfs we want to keep for the user to see.
::TODO document what user-facing printfs actually mean! ::TODO document what user-facing printfs actually mean!
::TODO ::> to :> etc. ::TODO ::> to :> etc.
@ -44,8 +46,8 @@
outbox/(pair @ud (map @ud thought)) ::< urbit outbox outbox/(pair @ud (map @ud thought)) ::< urbit outbox
log/(map knot @ud) ::< logged to clay log/(map knot @ud) ::< logged to clay
folks/(map ship human) ::< human identities folks/(map ship human) ::< human identities
nik/(map (set partner) char) ::< bound station glyphs nik/(map (set partner) char) ::< bound circle glyphs
nak/(jug char (set partner)) ::< station glyph lookup nak/(jug char (set partner)) ::< circle glyph lookup
== :: == ::
++ story ::> wire content ++ story ::> wire content
$: count/@ud ::< (lent grams) $: count/@ud ::< (lent grams)
@ -53,7 +55,7 @@
locals/atlas ::< local presence locals/atlas ::< local presence
remotes/(map partner atlas) ::< remote presence remotes/(map partner atlas) ::< remote presence
shape/config ::< configuration shape/config ::< configuration
mirrors/(map station config) ::< remote config mirrors/(map circle config) ::< remote config
::TODO never gets updated. :: ::TODO never gets updated. ::
sequence/(map partner @ud) ::< partners heard sequence/(map partner @ud) ::< partners heard
known/(map serial @ud) ::< messages heard known/(map serial @ud) ::< messages heard
@ -85,7 +87,7 @@
== :: == ::
++ weir ::> parsed wire ++ weir ::> parsed wire
$% {$repeat p/@ud q/@p r/knot} ::< messaging wire $% {$repeat p/@ud q/@p r/knot} ::< messaging wire
{$friend p/knot q/station} ::< subscription wire {$friend p/knot q/circle} ::< subscription wire
== :: == ::
-- --
:: ::
@ -197,7 +199,7 @@
::> a story core. if it doesn't, does nothing. ::> a story core. if it doesn't, does nothing.
:: ::
|= nom/knot |= nom/knot
|* fun/$-(_so _+>) |= fun/$-(_so _ta)
^+ +>+> ^+ +>+>
=+ pur=(~(get by stories) nom) =+ pur=(~(get by stories) nom)
?~ pur ?~ pur
@ -242,7 +244,7 @@
|= {src/ship cod/command} |= {src/ship cod/command}
^+ +> ^+ +>
?- -.cod ?- -.cod
::> %review commands prompt us (as a station host) ::> %review commands prompt us (as a circle host)
::> to verify and distribute messages. ::> to verify and distribute messages.
$review $review
(ta-think | src +.cod) (ta-think | src +.cod)
@ -268,7 +270,7 @@
++ work ::< perform action ++ work ::< perform action
^+ ..ta-action ^+ ..ta-action
?- -.act ?- -.act
:: station configuration :: circle configuration
$create (action-create +.act) $create (action-create +.act)
$source (action-source +.act) $source (action-source +.act)
$depict (action-depict +.act) $depict (action-depict +.act)
@ -291,7 +293,7 @@
::> if it doesn't, reacts accordingly. ::> if it doesn't, reacts accordingly.
:: ::
|= nom/knot |= nom/knot
|* fec/$-(_so _ta) |= fec/$-({_so story} _ta)
^+ ta ^+ ta
=+ pur=(~(get by stories) nom) =+ pur=(~(get by stories) nom)
?^ pur ?^ pur
@ -299,7 +301,7 @@
%+ ta-react red %+ ta-react red
[%fail (crip "no story {(trip nom)}") `act] [%fail (crip "no story {(trip nom)}") `act]
:: ::
::> || %station-configuration ::> || %circle-configuration
::+| ::+|
++ action-create ::< create story ++ action-create ::< create story
::> creates a story with the specified parameters. ::> creates a story with the specified parameters.
@ -316,11 +318,11 @@
|= {nom/knot sub/? pas/(set partner)} |= {nom/knot sub/? pas/(set partner)}
^+ ..ta-action ^+ ..ta-action
%- (affect nom) |= {sor/_so soy/story} %- (affect nom) |= {sor/_so soy/story}
=. sources.shape.soy =. src.shape.soy
%. pas %. pas
?: sub ?: sub
~(uni in sources.shape.soy) ~(uni in src.shape.soy)
~(dif in sources.shape.soy) ~(dif in src.shape.soy)
(ta-config nom shape.soy) (ta-config nom shape.soy)
:: ::
++ action-depict ::< change description ++ action-depict ::< change description
@ -329,7 +331,7 @@
|= {nom/knot des/cord} |= {nom/knot des/cord}
^+ ..ta-action ^+ ..ta-action
%- (affect nom) |= {sor/_so soy/story} %- (affect nom) |= {sor/_so soy/story}
=. caption.shape.soy des =. cap.shape.soy des
(ta-config nom shape.soy) (ta-config nom shape.soy)
:: ::
++ action-permit ::< invite/banish ++ action-permit ::< invite/banish
@ -403,12 +405,12 @@
^+ ..ta-action ^+ ..ta-action
?. =((~(get by folks) sip) `nic) ..ta-action ::< no change ?. =((~(get by folks) sip) `nic) ..ta-action ::< no change
=. folks =. folks
?~ hand.nic (~(del by folks) sip) ?~ han.nic (~(del by folks) sip)
(~(put by folks) sip nic) (~(put by folks) sip nic)
%+ ta-inform %names %+ ta-inform %names
::TODO think long and hard, do we need unit for delition or is a human ::TODO think long and hard, do we need unit for delition or is a human
:: with [~ ~] good enough? if the latter, agent's $names will change. :: with [~ ~] good enough? if the latter, agent's $names will change.
(strap sip ?~(hand.nic ~ `nic)) (strap sip ?~(han.nic ~ `nic))
:: ::
++ action-glyph ::< bind a glyph ++ action-glyph ::< bind a glyph
::> un/bind glyph {lif} to partners {pas}. ::> un/bind glyph {lif} to partners {pas}.
@ -440,7 +442,7 @@
++ ta-diff-report ::< subscription update ++ ta-diff-report ::< subscription update
::> process a talk report from {sat} into story {nom}. ::> process a talk report from {sat} into story {nom}.
:: ::
|= {nom/knot sat/station ret/report} |= {nom/knot sat/circle ret/report}
%- (ta-know nom) |= sor/_so =< so-done %- (ta-know nom) |= sor/_so =< so-done
(so-diff-report:sor sat ret) (so-diff-report:sor sat ret)
:: ::
@ -527,14 +529,14 @@
++ ta-retry ::< subscription resend ++ ta-retry ::< subscription resend
::> re-subscribes {sat} to story {nom}. ::> re-subscribes {sat} to story {nom}.
:: ::
|= {nom/knot sat/station} |= {nom/knot sat/circle}
%- (ta-know nom) |= sor/_so =< so-done %- (ta-know nom) |= sor/_so =< so-done
(so-acquire:sor [%& sat]~) (so-acquire:sor [%& sat]~)
:: ::
++ ta-quit ::< subscription failed ++ ta-quit ::< subscription failed
::> removes {sat} from story {nom}'s followers. ::> removes {sat} from story {nom}'s followers.
:: ::
|= {nom/knot sat/station} |= {nom/knot sat/circle}
%- (ta-know nom) |= sor/_so =< so-done %- (ta-know nom) |= sor/_so =< so-done
(so-quit:sor %& sat) (so-quit:sor %& sat)
:: ::
@ -674,17 +676,17 @@
:: ::
++ ta-sane ::< sanitize ++ ta-sane ::< sanitize
::> sanitize %lin speech, enforce lowercase and no special characters. ::> sanitize %lin speech, enforce lowercase and no special characters.
::TODO make configurable per-station. ::TODO make configurable per-circle.
:: ::
|= tot/thought |= tot/thought
^- thought ^- thought
?. ?=({$lin *} r.r.tot) tot ?. ?=({$lin *} sep.sam.tot) tot
%_ tot %_ tot
q.r.r msg.sep.sam
%- crip %- crip
%+ scag 64 %+ scag 64
%- tufa %- tufa
%+ turn (tuba (trip q.r.r.tot)) %+ turn (tuba (trip msg.sep.sam.tot))
|= a/@c |= a/@c
?: &((gte a 'A') (lte a 'Z')) ?: &((gte a 'A') (lte a 'Z'))
(add a 32) (add a 32)
@ -698,7 +700,7 @@
:: ::
|= {pub/? aut/ship tot/thought} |= {pub/? aut/ship tot/thought}
=. tot (ta-sane tot) =. tot (ta-sane tot)
=+ aud=(~(tap by q.tot)) =+ aud=(~(tap by aud.tot))
|- ^+ +>.^$ |- ^+ +>.^$
?~ aud +>.^$ ?~ aud +>.^$
$(aud t.aud, +>.^$ (ta-conduct pub aut p.i.aud tot)) $(aud t.aud, +>.^$ (ta-conduct pub aut p.i.aud tot))
@ -709,16 +711,16 @@
|= {pub/? aut/ship pan/partner tot/thought} |= {pub/? aut/ship pan/partner tot/thought}
^+ +> ^+ +>
?- -.pan ?- -.pan
$& ::< station partner $& ::< circle partner
?: pub ?: pub
?. (team our.bol aut) ?. (team our.bol aut)
~&([%talk-strange-author aut] +>) ~&([%talk-strange-author aut] +>)
=. aut our.bol =. aut our.bol
?: =(aut p.p.pan) ?: =(aut hos.p.pan)
(ta-record q.p.pan p.p.pan tot) (ta-record nom.p.pan hos.p.pan tot)
(ta-transmit p.pan tot) (ta-transmit p.pan tot)
?. =(our.bol p.p.pan) +> ?. =(our.bol hos.p.pan) +>
(ta-record q.p.pan aut tot) (ta-record nom.p.pan aut tot)
:: ::
$| !! ::< passport partner $| !! ::< passport partner
== ==
@ -734,13 +736,13 @@
::> sends thought {tot} to {sat}. ::> sends thought {tot} to {sat}.
::> stores it to the outbox to await confirmation. ::> stores it to the outbox to await confirmation.
:: ::
|= {sat/station tot/thought} |= {sat/circle tot/thought}
^+ +> ^+ +>
=. +> =. +>
%+ ta-emit ost.bol %+ ta-emit ost.bol
:* %poke :* %poke
/repeat/(scot %ud p.outbox)/(scot %p p.sat)/[q.sat] /repeat/(scot %ud p.outbox)/(scot %p hos.sat)/[nom.sat]
[p.sat %talk-guardian] [hos.sat %talk-guardian]
[%talk-command [%review tot ~]] [%talk-command [%review tot ~]]
== ==
+>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tot)) +>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tot))
@ -760,9 +762,9 @@
=+ oot=(~(get by q.outbox) num) =+ oot=(~(get by q.outbox) num)
?~ oot ~|([%ta-repeat-none num] !!) ?~ oot ~|([%ta-repeat-none num] !!)
=. q.outbox (~(del by q.outbox) num) =. q.outbox (~(del by q.outbox) num)
=. q.u.oot =. aud.u.oot
=+ olg=(~(got by q.u.oot) pan) =+ olg=(~(got by aud.u.oot) pan)
%+ ~(put by q.u.oot) pan %+ ~(put by aud.u.oot) pan
:- -.olg :- -.olg
?~ fal %received ?~ fal %received
~> %slog.[0 u.fal] ~> %slog.[0 u.fal]
@ -787,10 +789,10 @@
::> wyt: will be white ::> wyt: will be white
=+ :+ neu=!(~(has by stories) nom) =+ :+ neu=!(~(has by stories) nom)
pur=(fall (~(get by stories) nom) *story) pur=(fall (~(get by stories) nom) *story)
wyt=?=(?($white $green) p.cordon.con) wyt=?=(?($white $green) sec.con.con)
=. q.cordon.con ::TODO =? =. ses.con.con ::TODO =?
?: &(neu wyt) [our.bol ~ ~] ?: &(neu wyt) [our.bol ~ ~]
q.cordon.con ses.con.con
so-done:(~(so-reform so nom ~ pur) con) so-done:(~(so-reform so nom ~ pur) con)
:: ::
++ ta-unconfig ::< delete story ++ ta-unconfig ::< delete story
@ -922,8 +924,8 @@
%- ~(urn by remotes) :: XX performance %- ~(urn by remotes) :: XX performance
|= {pan/partner atl/atlas} |= {pan/partner atl/atlas}
^- atlas ^- atlas
?. &(?=($& -.pan) =(our.bol p.p.pan)) atl ?. &(?=($& -.pan) =(our.bol hos.p.pan)) atl
=+ soy=(~(get by stories) q.p.pan) =+ soy=(~(get by stories) nom.p.pan)
?~ soy atl ?~ soy atl
locals.u.soy locals.u.soy
:: ::
@ -937,22 +939,22 @@
::> process a talk report from {sat}. ::> process a talk report from {sat}.
::> if we didn't expect it, ignore. ::> if we didn't expect it, ignore.
:: ::
|= {sat/station ret/report} |= {sat/circle ret/report}
^+ +> ^+ +>
?. (~(has in sources.shape) [%& sat]) ?. (~(has in src.shape) [%& sat])
~& [%talk-so-diff-unexpected sat -.ret] ~& [%talk-so-diff-unexpected sat -.ret]
+> +>
?- -.ret ?- -.ret
$cabal (so-cabal sat +.ret) $cabal (so-cabal sat +.ret)
$group (so-remind [%& sat] +.ret) $group (so-remind [%& sat] +.ret)
$grams (so-lesson q.+.ret) $grams (so-lesson gaz.ret)
== ==
:: ::
++ so-cabal ::< update config ++ so-cabal ::< update config
::> add station's config to our remote config map. ::> add circle's config to our remote config map.
:: ::
::TODO when do we care about ham? ::TODO when do we care about rem?
|= {sat/station con/config ham/(map station config)} |= {sat/circle con/config rem/(map circle config)}
^+ +> ^+ +>
=+ old=mirrors =+ old=mirrors
=. mirrors (~(put by mirrors) sat con) =. mirrors (~(put by mirrors) sat con)
@ -986,7 +988,7 @@
::+| ::+|
:: ::
++ so-reform ::< reconfigure ++ so-reform ::< reconfigure
::> changes the config of this story and notify ::> changes the config of this story and notify::
::> our followers. ::> our followers.
::> subscribes to new sources, unsubs from removed ::> subscribes to new sources, unsubs from removed
::> ones. ::> ones.
@ -994,10 +996,10 @@
|= cof/config |= cof/config
=. +>.$ (so-inform %confs `cof ~) =. +>.$ (so-inform %confs `cof ~)
=/ dif/(pair (list partner) (list partner)) =/ dif/(pair (list partner) (list partner))
=+ old=`(list partner)`(~(tap in sources.shape) ~) =+ old=`(list partner)`(~(tap in src.shape) ~)
=+ new=`(list partner)`(~(tap in sources.cof) ~) =+ new=`(list partner)`(~(tap in src.cof) ~)
:- (skip new |=(a/partner (~(has in sources.shape) a))) :- (skip new |=(a/partner (~(has in src.shape) a)))
(skip old |=(a/partner (~(has in sources.cof) a))) (skip old |=(a/partner (~(has in src.cof) a)))
=. +>.$ (so-acquire p.dif) =. +>.$ (so-acquire p.dif)
=. +>.$ (so-abjure q.dif) =. +>.$ (so-abjure q.dif)
=. shape cof =. shape cof
@ -1005,22 +1007,22 @@
:: ::
++ so-reform-gone ::< delete story ++ so-reform-gone ::< delete story
::> deletes this story. removes it from {stories} ::> deletes this story. removes it from {stories}
::> and unsubscribes from all sources. ::> and unsubscribes from all src.
:: ::
=. stories (~(del by stories) nom) =. stories (~(del by stories) nom)
=. . (so-inform %confs ~ ~) =. . (so-inform %confs ~ ~)
=. . (so-report-cabal so-followers) =. . (so-report-cabal so-followers)
(so-abjure (~(tap in sources.shape))) (so-abjure (~(tap in src.shape)))
:: ::
++ so-notify ::< local presence ++ so-notify ::< local presence
::> add {her} status to this story's presence map. ::> add {her} status to this story's presence map.
::> if this changes it, send a report. ::> if this changes it, send a report.
:: ::
|= {her/ship sas/status} |= {her/ship sat/status}
^+ +> ^+ +>
=/ nol (~(put by locals) her sas) =/ nol (~(put by locals) her sat)
?: =(nol locals) +>.$ ?: =(nol locals) +>.$
=. +>.$ (so-inform %precs (strap her sas) ~) =. +>.$ (so-inform %precs (strap her sat) ~)
(so-report-group(locals nol) so-followers) (so-report-group(locals nol) so-followers)
:: ::
::> || ::> ||
@ -1047,12 +1049,12 @@
?- -.pan ?- -.pan
$| !! ::< passport partner $| !! ::< passport partner
:: ::
$& ::< station partner $& ::< circle partner
:_ ~ :_ ~
:* %peer :* %peer
/friend/show/[nom]/(scot %p p.p.pan)/[q.p.pan] /friend/show/[nom]/(scot %p hos.p.pan)/[nom.p.pan]
[p.p.pan %talk-guardian] [hos.p.pan %talk-guardian]
/[q.p.pan]/[ini] /[nom.p.pan]/[ini]
== ==
== ==
:: ::
@ -1068,11 +1070,11 @@
?- -.pan ?- -.pan
$| !! ::< passport partner $| !! ::< passport partner
:: ::
$& ::< station partner $& ::< circle partner
:_ ~ :_ ~
:* %pull :* %pull
/friend/show/[nom]/(scot %p p.p.pan)/[q.p.pan] /friend/show/[nom]/(scot %p hos.p.pan)/[nom.p.pan]
[p.p.pan %talk-guardian] [hos.p.pan %talk-guardian]
~ ~
== ==
== ==
@ -1083,8 +1085,8 @@
:: ::
|= pan/partner |= pan/partner
^+ +> ^+ +>
?. (~(has in sources.shape) pan) +> ?. (~(has in src.shape) pan) +>
=. sources.shape (~(del in sources.shape) pan) =. src.shape (~(del in src.shape) pan)
=. +> (so-inform %confs `shape ~) =. +> (so-inform %confs `shape ~)
(so-report-cabal so-followers) (so-report-cabal so-followers)
:: ::
@ -1131,13 +1133,13 @@
?~ gaz [dun end zeg] ?~ gaz [dun end zeg]
?: ?- -.q.riv :: after the end ?: ?- -.q.riv :: after the end
$ud (lte p.q.riv end) $ud (lte p.q.riv end)
$da (lte p.q.riv p.r.q.i.gaz) $da (lte p.q.riv wen.sam.tot.i.gaz)
== ==
:: if past the river, continue back, mark as done. :: if past the river, continue back, mark as done.
$(end (dec end), gaz t.gaz, dun &) $(end (dec end), gaz t.gaz, dun &)
?: ?- -.p.riv :: before the start ?: ?- -.p.riv :: before the start
$ud (lth end p.p.riv) $ud (lth end p.p.riv)
$da (lth p.r.q.i.gaz p.p.riv) $da (lth wen.sam.tot.i.gaz p.p.riv)
== ==
:: if before the river, we're done searching. :: if before the river, we're done searching.
[dun end zeg] [dun end zeg]
@ -1188,12 +1190,12 @@
=+ old=[p=(welp p.lef p.rit) q=(welp q.lef q.rit)] =+ old=[p=(welp p.lef p.rit) q=(welp q.lef q.rit)]
?: ?- -.q.q.n.followers :: after the end ?: ?- -.q.q.n.followers :: after the end
$ud (lte p.q.q.n.followers num) $ud (lte p.q.q.n.followers num)
$da (lte p.q.q.n.followers p.r.q.gam) $da (lte p.q.q.n.followers wen.sam.tot.gam)
== ==
[[p.n.followers p.old] [[p.n.followers %quit ~] q.old]] [[p.n.followers p.old] [[p.n.followers %quit ~] q.old]]
?: ?- -.p.q.n.followers :: before the start ?: ?- -.p.q.n.followers :: before the start
$ud (gth p.p.q.n.followers num) $ud (gth p.p.q.n.followers num)
$da (gth p.p.q.n.followers p.r.q.gam) $da (gth p.p.q.n.followers wen.sam.tot.gam)
== ==
old old
:- p.old :- p.old
@ -1217,22 +1219,22 @@
:: ::
|= gam/telegram |= gam/telegram
^+ +> ^+ +>
?. (so-admire p.gam) ::< write permissions ?. (so-admire aut.gam) ::< write permissions
+>.$ +>.$
=. q.q.gam =. aud.tot.gam
::> if we are in the audience, mark as received. ::> if we are in the audience, mark as received.
=+ ole=(~(get by q.q.gam) [%& our.bol nom]) =+ ole=(~(get by aud.tot.gam) [%& our.bol nom])
?^ ole (~(put by q.q.gam) [%& our.bol nom] -.u.ole %received) ?^ ole (~(put by aud.tot.gam) [%& our.bol nom] -.u.ole %received)
::> federated stations need to pretend ~src/nom ::> federated circles need to pretend ~src/nom
::> is also ~our/nom. ::> is also ~our/nom.
::TODO pass src through explicitly instead of ::TODO pass src through explicitly instead of
:: relying on src.bol. :: relying on src.bol. :
=+ ole=(~(get by q.q.gam) [%& src.bol nom]) =+ ole=(~(get by aud.tot.gam) [%& src.bol nom])
?~ ole q.q.gam ?~ ole aud.tot.gam
::> as described above, fake src into our. ::> as described above, fake src into our.
=. q.q.gam (~(del by q.q.gam) [%& src.bol nom]) =. aud.tot.gam (~(del by aud.tot.gam) [%& src.bol nom])
(~(put by q.q.gam) [%& our.bol nom] -.u.ole %received) (~(put by aud.tot.gam) [%& our.bol nom] -.u.ole %received)
=+ old=(~(get by known) p.q.gam) =+ old=(~(get by known) uid.tot.gam)
?~ old ?~ old
(so-append gam) ::< add (so-append gam) ::< add
(so-revise u.old gam) ::< modify (so-revise u.old gam) ::< modify
@ -1245,7 +1247,7 @@
%+ %= so-refresh %+ %= so-refresh
grams [gam grams] grams [gam grams]
count +(count) count +(count)
known (~(put by known) p.q.gam count) known (~(put by known) uid.tot.gam count)
== ==
count count
gam gam
@ -1276,7 +1278,7 @@
^+ +> ^+ +>
::> wyt: whitelist? ::> wyt: whitelist?
::> add: add to list? ::> add: add to list?
=/ wyt/? ?=(?($white $green) p.cordon.shape) =/ wyt/? ?=(?($white $green) sec.con.shape)
=/ add/? =(inv wyt) =/ add/? =(inv wyt)
=. +>.$ ::TODO =? =. +>.$ ::TODO =?
?: inv +>.$ ?: inv +>.$
@ -1290,11 +1292,11 @@
[[%inv inv [our.bol nom]] t] [[%inv inv [our.bol nom]] t]
%- so-reform %- so-reform
%= shape %= shape
q.cordon ses.con
%. sis %. sis
?: add ?: add
~(uni in q.cordon.shape) ~(uni in ses.con.shape)
~(dif in q.cordon.shape) ~(dif in ses.con.shape)
== ==
:: ::
++ so-admire ::< accept from ++ so-admire ::< accept from
@ -1302,11 +1304,11 @@
:: ::
|= her/ship |= her/ship
^- ? ^- ?
?- p.cordon.shape ?- sec.con.shape
$black !(~(has in q.cordon.shape) her) ::< channel, blacklist $black !(~(has in ses.con.shape) her) ::< channel, blacklist
$white (~(has in q.cordon.shape) her) ::< village, whitelist $white (~(has in ses.con.shape) her) ::< village, whitelist
$green (~(has in q.cordon.shape) her) ::< journal, whitelist $green (~(has in ses.con.shape) her) ::< journal, whitelist
$brown !(~(has in q.cordon.shape) her) ::< mailbox, blacklist $brown !(~(has in ses.con.shape) her) ::< mailbox, blacklist
== ==
:: ::
++ so-visible ::< display to ++ so-visible ::< display to
@ -1314,9 +1316,9 @@
:: ::
|= her/ship |= her/ship
^- ? ^- ?
?- p.cordon.shape ?- sec.con.shape
$black !(~(has in q.cordon.shape) her) ::< channel, blacklist $black !(~(has in ses.con.shape) her) ::< channel, blacklist
$white (~(has in q.cordon.shape) her) ::< village, whitelist $white (~(has in ses.con.shape) her) ::< village, whitelist
$green & ::< journal, all $green & ::< journal, all
$brown (team our.bol her) ::< mailbox, our team $brown (team our.bol her) ::< mailbox, our team
== ==
@ -1330,7 +1332,7 @@
:: ::
++ etch ::< parse wire ++ etch ::< parse wire
::> parses {wir}} to obtain either %friend with story ::> parses {wir}} to obtain either %friend with story
::> and station or %repeat with message number, ::> and circle or %repeat with message number,
::> source ship and story. ::> source ship and story.
:: ::
|= wir/wire |= wir/wire
@ -1356,7 +1358,7 @@
:: ::
|= $: wir/wire |= $: wir/wire
$= fun $= fun
$- {nom/knot sat/station} $- {nom/knot sat/circle}
{(list move) _.} {(list move) _.}
== ==
=+ wer=(etch wir) =+ wer=(etch wir)
@ -1425,7 +1427,7 @@
^- (quip move +>) ^- (quip move +>)
=^ mos +>.$ =^ mos +>.$
%+ etch-friend wir %+ etch-friend wir
|= {nom/knot sat/station} |= {nom/knot sat/circle}
ta-done:(ta-diff-report:ta nom sat ret) ta-done:(ta-diff-report:ta nom sat ret)
=^ mow +>.$ =^ mow +>.$
log-all-to-file log-all-to-file
@ -1456,7 +1458,7 @@
^- (quip move +>) ^- (quip move +>)
?~ fal [~ +>] ?~ fal [~ +>]
%+ etch-friend [%friend wir] %+ etch-friend [%friend wir]
|= {nom/knot sat/station} |= {nom/knot sat/circle}
=. u.fal [>%reap-friend-fail nom sat< u.fal] =. u.fal [>%reap-friend-fail nom sat< u.fal]
%- (slog (flop u.fal)) %- (slog (flop u.fal))
ta-done:(ta-quit:ta nom sat) ta-done:(ta-quit:ta nom sat)
@ -1467,7 +1469,7 @@
|= wir/wire |= wir/wire
^- (quip move +>) ^- (quip move +>)
%+ etch-friend [%friend wir] %+ etch-friend [%friend wir]
|= {nom/knot sat/station} |= {nom/knot sat/circle}
ta-done:(ta-retry:ta nom sat) ta-done:(ta-retry:ta nom sat)
:: ::
++ coup-repeat ::< message n/ack ++ coup-repeat ::< message n/ack

View File

@ -3,8 +3,6 @@
!: !:
|% |%
:: ::
::TODO station -> circle
::
::> || ::> ||
::> || %reader-communication ::> || %reader-communication
::> || ::> ||
@ -12,32 +10,35 @@
::+| ::+|
:: ::
++ action ::> user action ++ action ::> user action
$% :: station configuration :: $% :: circle configuration ::
{$create (trel knot cord posture)} ::< create station {$create nom/knot des/cord sec/posture} ::< create circle
{$source (trel knot ? (set partner))} ::< un/sub p to/from r {$source nom/knot sub/? src/(set partner)} ::< un/sub p to/from r
{$depict (pair knot cord)} ::< change description {$depict nom/knot des/cord} ::< change description
{$permit (trel knot ? (set ship))} ::< invite/banish {$permit nom/knot inv/? sis/(set ship)} ::< invite/banish
{$delete (pair knot (unit cord))} ::< delete + announce {$delete nom/knot ano/(unit cord)} ::< delete + announce
:: messaging :: :: messaging ::
{$convey (list thought)} ::< post exact {$convey tos/(list thought)} ::< post exact
{$phrase (pair (set partner) (list speech))} ::< post easy {$phrase aud/(set partner) ses/(list speech)} ::< post easy
:: personal metadata :: :: personal metadata ::
::TODO change to target partners, not only our stations. ::TODO change to target partners, not only our circles.
{$status (pair (set knot) status)} ::< our status update {$status nos/(set knot) sat/status} ::< our status update
:: changing shared ui :: :: changing shared ui ::
{$human (pair ship human)} ::< new identity {$human sip/ship man/human} ::< new identity
{$glyph (trel char (set partner) ?)} ::< un/bind a glyph {$glyph gyf/char pas/(set partner) bin/?} ::< un/bind a glyph
== :: == ::
++ reaction ::> user information ++ reaction ::> user information
$: kind/?($info $fail) ::< result $: res/?($info $fail) ::< result
what/@t ::< explain wat/@t ::< explain
why/(unit action) ::< cause why/(unit action) ::< cause
== :: == ::
++ lowdown ::> new/changed state ++ lowdown ::> new/changed state
$% :: story state :: $% :: story state ::
{$confs (unit config) (map station (unit config))}::< configs $: $confs ::< configs
{$precs register} ::< presences loc/(unit config) ::< local config
{$grams (pair @ud (list telegram))} ::< messages rem/(map circle (unit config)) ::< remote configs
== ::
{$precs reg/register} ::< presences
{$grams num/@ud gaz/(list telegram)} ::< messages
:: ui state :: :: ui state ::
{$glyph (jug char (set partner))} ::< glyph bindings {$glyph (jug char (set partner))} ::< glyph bindings
{$names (map ship (unit human))} ::< nicknames {$names (map ship (unit human))} ::< nicknames
@ -50,12 +51,12 @@
::+| ::+|
:: ::
++ command ::> effect on story ++ command ::> effect on story
$% {$review (list thought)} ::< deliver $% {$review tos/(list thought)} ::< deliver
== :: == ::
++ report ::> update ++ report ::> update
$% {$cabal cabal} ::< config neighborhood $% {$cabal cab/cabal} ::< config neighborhood
{$group register} ::< presence {$group reg/register} ::< presence
{$grams (pair @ud (list telegram))} ::< thoughts {$grams num/@ud gaz/(list telegram)} ::< thoughts
== :: == ::
:: ::
::> || ::> ||
@ -64,22 +65,22 @@
::> messaging targets and their metadata. ::> messaging targets and their metadata.
::+| ::+|
:: ::
++ partner (each station passport) ::< message target ++ partner (each circle passport) ::< message target
++ station (pair ship knot) ::< native target ++ circle {hos/ship nom/knot} ::< native target
++ passport ::> foreign target ++ passport ::> foreign target
$% {$twitter p/@t} ::< twitter handle $% {$twitter p/@t} ::< twitter handle
== :: == ::
::> circle configurations. ::> circle configurations.
++ cabal ::> metaconfiguration ++ cabal ::> metaconfiguration
$: loc/config ::< local config $: loc/config ::< local config
ham/(map station config) ::< neighborhood configs rem/(map circle config) ::< neighborhood configs
== :: == ::
++ config ::> station config ++ config ::> circle config
$: sources/(set partner) ::< pulls from $: src/(set partner) ::< pulls from
caption/cord ::< description cap/cord ::< description
cordon/control ::< restrictions con/control ::< restrictions
== :: == ::
++ control (pair posture (set ship)) ::< access control ++ control {sec/posture ses/(set ship)} ::< access control
++ posture ::> security kind ++ posture ::> security kind
$? $black ::< channel, blacklist $? $black ::< channel, blacklist
$white ::< village, whitelist $white ::< village, whitelist
@ -87,13 +88,18 @@
$brown ::< mailbox, our r, bl w $brown ::< mailbox, our r, bl w
== :: == ::
::> participant metadata. ::> participant metadata.
++ register (pair atlas (map partner atlas)) ::< our & srcs presences ++ register {loc/atlas rem/(map partner atlas)} ::< our & srcs presences
++ atlas (map ship status) ::< presence map ++ atlas (map ship status) ::< presence map
++ status (pair presence human) ::< participant ++ status {pec/presence man/human} ::< participant
++ presence ?($gone $hear $talk) ::< status type ++ presence ::> status type
$? $gone ::< left
$idle ::< idle
$hear ::< present
$talk ::< typing
==
++ human ::> human identifier ++ human ::> human identifier
$: true/(unit (trel @t (unit @t) @t)) ::<TODO unused true name $: tru/(unit (trel @t (unit @t) @t)) ::<TODO unused true name
hand/(unit @t) ::< handle han/(unit @t) ::< handle
== :: == ::
:: ::
::> || ::> ||
@ -102,21 +108,21 @@
::> structures for containing main message data. ::> structures for containing main message data.
::+| ::+|
:: ::
++ telegram (pair ship thought) ::< who thought ++ telegram {aut/ship tot/thought} ::< who thought
++ thought (trel serial audience statement) ::< which whom what ++ thought {uid/serial aud/audience sam/statement} ::< which whom what
++ statement (trel @da bouquet speech) ::< when this ++ statement {wen/@da boq/bouquet sep/speech} ::< when this
++ speech ::> narrative action ++ speech ::> narrative action
$% {$non $~} ::< no content (yo) $% {$non $~} ::< no content (yo)
{$lin p/? q/@t} ::< no/@ text line {$lin pat/? msg/@t} ::< no/@ text line
{$ire p/serial q/speech} ::< in-reply-to {$ire tos/serial sep/speech} ::< in-reply-to
{$url p/purf} ::< parsed url {$url url/purf} ::< parsed url
{$exp p/@t} ::< hoon line {$exp exp/@t} ::< hoon line
{$fat p/torso q/speech} ::< attachment {$fat tac/torso sep/speech} ::< attachment
{$lan p/knot q/@t} ::< local announce {$lan nom/knot msg/@t} ::< local announce
{$inv p/? q/station} ::< inv/ban for station {$inv inv/? sat/circle} ::< inv/ban for circle
{$mor p/(list speech)} ::< multiplex {$mor ses/(list speech)} ::< multiplex
{$ext p/@tas q/*} ::< extended action {$ext nom/@tas dat/*} ::< extended action
{$app p/@tas q/@t} ::< app message {$app app/@tas msg/@t} ::< app message
$: $api ::< api message $: $api ::< api message
service/@tas ::< service name service/@tas ::< service name
id/@t ::< id on the service id/@t ::< id on the service
@ -128,7 +134,7 @@
== :: == ::
== :: == ::
++ torso ::> attachment ++ torso ::> attachment
$% {$name (pair @t torso)} ::< named attachment $% {$name nom/@t tac/torso} ::< named attachment
{$text (list @t)} ::< text lines {$text (list @t)} ::< text lines
{$tank (list tank)} ::< tank list {$tank (list tank)} ::< tank list
== :: == ::
@ -141,7 +147,7 @@
:: ::
++ serial @uvH ::< unique identifier ++ serial @uvH ::< unique identifier
++ audience (map partner (pair envelope delivery)) ::< destination + state ++ audience (map partner (pair envelope delivery)) ::< destination + state
++ envelope (pair ? (unit partner)) ::< visible sender ++ envelope {vis/? sen/(unit partner)} ::< visible sender
++ delivery ::> delivery state ++ delivery ::> delivery state
$? $pending ::< undelivered $? $pending ::< undelivered
$received ::< delivered $received ::< delivered