2017-03-23 03:34:56 +03:00
|
|
|
:: :: ::
|
|
|
|
:::: /hoon/talk-agent/app :: ::
|
|
|
|
:: :: ::
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
|
|
|
::TODO guardian's todo's apply here too
|
2017-04-12 21:09:23 +03:00
|
|
|
::TODO make sure glyphs get unbound when joins etc don't succeed.
|
|
|
|
::TODO correct/clean up presence/config change notifications
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
::TODO maybe keep track of received grams per partner, too?
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> This reader implementation makes use of the mailbox
|
|
|
|
::> for all its subscriptions and messaging. All
|
|
|
|
::> lowdowns received are exclusively about the mailbox,
|
|
|
|
::> since that's the only thing the reader ever
|
|
|
|
::> subscribes to.
|
2017-04-12 14:14:09 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
/? 310 ::< hoon version
|
|
|
|
/- talk, sole ::< structures
|
|
|
|
/+ talk, sole ::< libraries
|
2017-03-23 03:34:56 +03:00
|
|
|
/= seed /~ !>(.)
|
2017-03-30 15:17:37 +03:00
|
|
|
!:
|
2017-03-23 03:34:56 +03:00
|
|
|
::::
|
|
|
|
::
|
2017-03-27 16:27:08 +03:00
|
|
|
[. talk sole]
|
2017-04-21 18:37:10 +03:00
|
|
|
=> ::> ||
|
|
|
|
::> || %arch
|
|
|
|
::> ||
|
|
|
|
::> data structures
|
|
|
|
::
|
|
|
|
|%
|
|
|
|
++ chattel ::> reader state
|
2017-04-11 23:36:11 +03:00
|
|
|
$: :: messaging state ::
|
2017-04-21 18:37:10 +03:00
|
|
|
count/@ud ::< (lent grams)
|
|
|
|
grams/(list telegram) ::< all history
|
|
|
|
known/(map serial @ud) ::< messages heard
|
|
|
|
sources/(set partner) ::< our subscriptions
|
2017-04-11 23:36:11 +03:00
|
|
|
:: partner details ::
|
2017-04-21 18:37:10 +03:00
|
|
|
remotes/(map partner atlas) ::< remote presences
|
2017-04-24 21:17:56 +03:00
|
|
|
mirrors/(map circle config) ::< remote configs
|
2017-04-11 23:36:11 +03:00
|
|
|
:: ui state ::
|
2017-04-21 18:37:10 +03:00
|
|
|
folks/(map ship human) ::< human identities
|
2017-04-24 21:17:56 +03:00
|
|
|
nik/(map (set partner) char) ::< bound circle glyphs
|
|
|
|
nak/(jug char (set partner)) ::< circle glyph lookup
|
2017-04-21 18:37:10 +03:00
|
|
|
cli/shell ::< interaction state
|
2017-03-24 01:10:28 +03:00
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ shell ::> console session
|
|
|
|
$: id/bone ::< identifier
|
|
|
|
count/@ud ::< messages shown
|
|
|
|
say/sole-share ::< console state
|
|
|
|
active/(set partner) ::< active targets
|
|
|
|
settings/(set knot) ::< frontend settings
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ move (pair bone card) ::< all actions
|
|
|
|
++ lime ::> diff fruit
|
2017-03-27 16:27:08 +03:00
|
|
|
$% {$talk-report report} ::
|
|
|
|
{$sole-effect sole-effect} ::
|
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ pear ::> poke fruit
|
2017-03-24 23:10:27 +03:00
|
|
|
$% {$talk-command command} ::
|
2017-04-10 23:24:25 +03:00
|
|
|
{$talk-action action} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ card ::> general card
|
2017-03-24 23:10:27 +03:00
|
|
|
$% {$diff lime} ::
|
|
|
|
{$poke wire dock pear} ::
|
2017-03-28 00:17:09 +03:00
|
|
|
{$peer wire dock path} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ work ::> interface action
|
2017-04-24 21:17:56 +03:00
|
|
|
$% :: circle management ::
|
2017-04-21 18:37:10 +03:00
|
|
|
{$join p/where} ::< subscribe to
|
|
|
|
{$leave p/where} ::< unsubscribe from
|
2017-04-24 21:17:56 +03:00
|
|
|
{$create p/posture q/knot r/cord} ::< create circle
|
|
|
|
{$delete p/knot q/(unit cord)} ::< delete circle
|
2017-04-21 18:37:10 +03:00
|
|
|
{$depict p/knot q/cord} ::< change description
|
|
|
|
{$source p/knot q/(set partner)} ::< add source
|
|
|
|
{$invite p/knot q/(set ship)} ::< give permission
|
|
|
|
{$banish p/knot q/(set ship)} ::< deny permission
|
|
|
|
:: messaging ::
|
|
|
|
{$say p/(list speech)} ::< send message
|
|
|
|
{$eval p/cord q/twig} ::< send #-message
|
|
|
|
{$target p/where q/(unit work)} ::< set active targets
|
|
|
|
:: displaying info ::
|
|
|
|
{$number p/$@(@ud {@u @ud})} ::< relative/absolute
|
|
|
|
{$who p/where} ::< presence
|
|
|
|
{$what p/$@(char (set partner))} ::< show bound glyph
|
|
|
|
:: ui settings ::
|
|
|
|
{$bind p/char q/(unit where)} ::< bind glyph
|
|
|
|
{$unbind p/char q/(unit where)} ::< unbind glyph
|
|
|
|
{$nick p/(unit ship) q/(unit cord)} ::< un/set/show nick
|
|
|
|
{$set p/knot} ::< enable setting
|
|
|
|
{$unset p/knot} ::< disable setting
|
2017-04-24 21:17:56 +03:00
|
|
|
:: miscellaneous ::
|
2017-04-21 18:37:10 +03:00
|
|
|
{$help $~} ::< print usage info
|
2017-03-27 16:27:08 +03:00
|
|
|
== ::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ where (set partner) ::< non-empty audience
|
2017-04-24 21:17:56 +03:00
|
|
|
++ glyphs `wall`~[">=+-" "}),." "\"'`^" "$%&@"] ::< circle char pool '
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
::> ||
|
|
|
|
::> || %work
|
|
|
|
::> ||
|
|
|
|
::> functional cores and arms.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
|_ {bol/bowl chattel}
|
|
|
|
::
|
|
|
|
++ prep ::< prepare state
|
|
|
|
::> adapts state.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
|= old/(unit chattel)
|
|
|
|
^- (quip move ..prep)
|
|
|
|
?~ old
|
|
|
|
ta-done:ta-init:ta
|
|
|
|
[~ ..prep(+<+ u.old)]
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %utility
|
|
|
|
::> ||
|
|
|
|
::> small utility functions.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ broker ::< broker ship + name
|
|
|
|
|= our/ship
|
|
|
|
:_ %talk-guardian
|
|
|
|
?. =((clan our) %earl)
|
|
|
|
our
|
|
|
|
(sein our)
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ inbox ::< reader's circle
|
|
|
|
::> produces the name of the circle used by this
|
2017-04-24 18:30:01 +03:00
|
|
|
::> reader for all its operations
|
|
|
|
(main our.bol)
|
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
::> ||
|
|
|
|
::> || %engines
|
|
|
|
::> ||
|
|
|
|
::> main cores.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta :: per transaction
|
|
|
|
::> for every transaction/event (poke, peer etc.)
|
|
|
|
::> talk-agent receives, the ++ta transaction core is
|
|
|
|
::> called.
|
|
|
|
::> in processing transactions, ++ta may modify app
|
|
|
|
::> state, or create moves. these moves get produced
|
|
|
|
::> upon finalizing the core's with with ++ta-done.
|
|
|
|
::> when making changes to the shell, the ++sh core is
|
|
|
|
::> used.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
|_ ::> moves: moves created by core operations.
|
|
|
|
::
|
|
|
|
moves/(list move)
|
|
|
|
::
|
|
|
|
++ ta-done ::< resolve core
|
|
|
|
::> produces the moves stored in ++ta's moves.
|
|
|
|
::> %sole-effect moves get squashed into a %mor.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
^+ [*(list move) +>]
|
|
|
|
:_ +>
|
2017-04-21 18:37:10 +03:00
|
|
|
:: seperate our sole-effects from other moves.
|
|
|
|
=/ yop
|
|
|
|
|- ^- (pair (list move) (list sole-effect))
|
|
|
|
?~ moves [~ ~]
|
|
|
|
=+ mor=$(moves t.moves)
|
|
|
|
?: ?& =(id.cli p.i.moves)
|
|
|
|
?=({$diff $sole-effect *} q.i.moves)
|
|
|
|
==
|
|
|
|
[p.mor [+>.q.i.moves q.mor]]
|
|
|
|
[[i.moves p.mor] q.mor]
|
|
|
|
:: flop moves, flop and squash sole-effects into a %mor.
|
|
|
|
=+ moz=(flop p.yop)
|
|
|
|
=/ foc/(unit sole-effect)
|
|
|
|
?~ q.yop ~
|
|
|
|
?~ t.q.yop `i.q.yop ::< single sole-effect
|
|
|
|
`[%mor (flop q.yop)] ::< more sole-effects
|
|
|
|
:: produce moves or sole-effects and moves.
|
|
|
|
?~ foc moz
|
|
|
|
?~ id.cli ~&(%reader-no-sole moz)
|
2017-03-29 14:00:44 +03:00
|
|
|
[[id.cli %diff %sole-effect u.foc] moz]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-emil ::< emit move list
|
|
|
|
::> adds multiple moves to the core's list.
|
|
|
|
::> flops to emulate ++ta-emit.
|
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
|
|
|
++ ta-emit ::< emit a move
|
|
|
|
::> adds a move to the core's list.
|
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %interaction-events
|
|
|
|
::> ||
|
|
|
|
::> arms that apply events we received.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-init ::< initialize app
|
|
|
|
::> subscribes to our broker.
|
|
|
|
::
|
|
|
|
%- ta-emit
|
|
|
|
:* ost.bol
|
|
|
|
%peer
|
|
|
|
/ ::< return/diff path
|
|
|
|
(broker our.bol)
|
|
|
|
/reader/[inbox] ::< peer path
|
|
|
|
==
|
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-reaction ::< apply reaction
|
|
|
|
::> processes a talk reaction.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
|
|
|
|= rac/reaction
|
|
|
|
^+ +>
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-done:(~(sh-reaction sh cli) rac)
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low ::< apply lowdown
|
|
|
|
::> processes a talk lowdown
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-03-29 01:11:12 +03:00
|
|
|
|= low/lowdown
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-03-29 01:11:12 +03:00
|
|
|
?- -.low
|
2017-04-21 18:37:10 +03:00
|
|
|
$glyph (ta-low-glyph +.low)
|
|
|
|
$names (ta-low-names +.low)
|
|
|
|
$confs (ta-low-confs +.low)
|
|
|
|
$precs (ta-low-precs +.low)
|
|
|
|
$grams (ta-low-grams +.low)
|
2017-03-29 01:11:12 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low-glyph ::< apply changed glyphs
|
2017-04-24 18:30:01 +03:00
|
|
|
::> applies new set of glyph bindings.
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
|
|
|
|= nek/_nak
|
|
|
|
^+ +>
|
2017-04-21 18:37:10 +03:00
|
|
|
?: =(nek nak) +> :: no change
|
2017-03-29 01:11:12 +03:00
|
|
|
=. nak nek
|
2017-04-21 18:37:10 +03:00
|
|
|
=. 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]))
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-done:~(sh-prod sh cli)
|
2017-03-27 15:52:53 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low-names ::< apply changed names
|
|
|
|
::> applies new local identities.
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-03-29 01:11:12 +03:00
|
|
|
|= nas/(map ship (unit human))
|
2017-03-28 00:17:09 +03:00
|
|
|
^+ +>
|
2017-04-21 18:37:10 +03:00
|
|
|
%= +>
|
|
|
|
folks
|
2017-03-29 01:11:12 +03:00
|
|
|
%- ~(gas by *(map ship human))
|
|
|
|
%+ murn
|
2017-04-04 14:33:38 +03:00
|
|
|
=< $
|
|
|
|
%~ tap by
|
|
|
|
%. nas
|
|
|
|
~(uni by `_nas`(~(run by folks) some))
|
|
|
|
==
|
2017-03-29 01:11:12 +03:00
|
|
|
|= {s/ship h/(unit human)}
|
2017-04-21 18:37:10 +03:00
|
|
|
?~(h ~ (some [s u.h]))
|
2017-03-29 01:11:12 +03:00
|
|
|
==
|
2017-04-04 01:14:06 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low-confs ::< apply changed confs
|
2017-04-24 21:17:56 +03:00
|
|
|
::> applies new circle configurations.
|
2017-04-21 18:37:10 +03:00
|
|
|
::> because of how this reader only subscribes to
|
|
|
|
::> the main mailbox, {coy} is always the mailbox's
|
|
|
|
::> config.
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {coy/(unit config) cofs/(map circle (unit config))}
|
2017-04-04 01:14:06 +03:00
|
|
|
^+ +>
|
2017-04-21 18:37:10 +03:00
|
|
|
::> 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
|
2017-04-24 21:17:56 +03:00
|
|
|
::> creating or joining a new circle.)
|
2017-04-19 12:33:00 +03:00
|
|
|
?~ coy ~&(%mailbox-gone !!)
|
2017-04-12 23:37:37 +03:00
|
|
|
=. +> ::TODO =?
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ (~(dif in src.u.coy) sources) +>.$
|
2017-04-21 18:37:10 +03:00
|
|
|
=< sh-done
|
2017-04-24 21:17:56 +03:00
|
|
|
%- ~(sh-pact sh(sources src.u.coy) cli)
|
|
|
|
(~(dif in src.u.coy) sources)
|
|
|
|
=. sources src.u.coy
|
2017-04-24 18:30:01 +03:00
|
|
|
=. cofs (~(put by cofs) [our.bol inbox] coy)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: print changes for each config.
|
2017-04-12 23:37:37 +03:00
|
|
|
=. +>.$
|
2017-04-21 18:37:10 +03:00
|
|
|
=< sh-done
|
2017-04-12 21:09:23 +03:00
|
|
|
%+ roll (~(tap by cofs))
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {{s/circle c/(unit config)} core/_sh}
|
2017-04-24 18:30:01 +03:00
|
|
|
%^ ~(sh-low-config core cli)
|
2017-04-21 18:37:10 +03:00
|
|
|
s (~(get by mirrors) s) c
|
|
|
|
:: apply config changes to {mirrors}.
|
2017-04-12 21:09:23 +03:00
|
|
|
=. mirrors
|
|
|
|
%- ~(gas by *_mirrors)
|
|
|
|
%+ murn (~(tap by cofs))
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {s/circle c/(unit config)}
|
|
|
|
^- (unit (pair circle config))
|
2017-04-12 21:09:23 +03:00
|
|
|
?~(c ~ `[s u.c])
|
2017-04-11 18:01:25 +03:00
|
|
|
+>.$
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low-precs ::< apply changed precs
|
|
|
|
::> applies new presences.
|
|
|
|
::> other clients might care for {tas}, but we're
|
|
|
|
::> only ever getting this for the mailbox, where
|
|
|
|
::> we're the only ones present.
|
2017-04-18 15:29:58 +03:00
|
|
|
::
|
2017-04-12 23:37:37 +03:00
|
|
|
|= {tas/atlas pas/(map partner atlas)}
|
2017-04-04 01:14:06 +03:00
|
|
|
^+ +>
|
2017-04-21 18:37:10 +03:00
|
|
|
=/ ner/_remotes :: per-partner uni
|
2017-04-18 15:29:58 +03:00
|
|
|
%- ~(urn by pas)
|
|
|
|
|= {p/partner a/atlas}
|
|
|
|
=+ o=(~(get by remotes) p)
|
|
|
|
?~(o a (~(uni by u.o) a))
|
2017-04-21 18:37:10 +03:00
|
|
|
=. ner (~(uni by remotes) ner) :: fill in the gaps
|
|
|
|
?: =(remotes ner) +>.$ :: no change
|
|
|
|
=. +>.$
|
|
|
|
=< sh-done
|
2017-04-24 18:30:01 +03:00
|
|
|
%+ ~(sh-low-rempe sh cli)
|
2017-04-21 18:37:10 +03:00
|
|
|
remotes ner
|
2017-04-12 23:37:37 +03:00
|
|
|
+>.$(remotes ner)
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
++ ta-low-grams ::< apply messages
|
|
|
|
::> applies new or changed telegrams.
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-12 23:37:37 +03:00
|
|
|
|= {num/@ud gams/(list telegram)}
|
2017-03-30 15:14:30 +03:00
|
|
|
^+ +>
|
2017-04-24 18:30:01 +03:00
|
|
|
=. +>.$ (ta-lesson gams)
|
|
|
|
=< sh-done
|
|
|
|
(~(sh-low-grams sh cli) num gams)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %messages
|
|
|
|
::> ||
|
|
|
|
::> storing and updating messages.
|
|
|
|
::+|
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ta-lesson ::< learn messages
|
|
|
|
::> learn all telegrams in a list.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gaz/(list telegram)
|
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
2017-04-21 18:37:10 +03:00
|
|
|
$(gaz t.gaz, +> (ta-learn i.gaz))
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ta-learn ::< save/update message
|
|
|
|
::> store an incoming telegram, updating if it
|
|
|
|
::> already exists.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ old=(~(get by known) uid.tot.gam)
|
2017-04-11 23:36:11 +03:00
|
|
|
?~ old
|
2017-04-24 18:30:01 +03:00
|
|
|
(ta-append gam) ::< add
|
|
|
|
(ta-revise u.old gam) ::< modify
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ta-append ::< append message
|
|
|
|
::> store a new telegram.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
|
|
|
%= +>
|
|
|
|
grams [gam grams]
|
|
|
|
count +(count)
|
2017-04-24 21:17:56 +03:00
|
|
|
known (~(put by known) uid.tot.gam count)
|
2017-04-11 23:36:11 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ta-revise ::< revise message
|
|
|
|
::> modify a telegram we know.
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
|
|
|
|= {num/@ud gam/telegram}
|
|
|
|
=+ way=(sub count num)
|
|
|
|
?: =(gam (snag (dec way) grams))
|
|
|
|
+>.$ :: no change
|
|
|
|
=. grams (welp (scag (dec way) grams) [gam (slag way grams)])
|
|
|
|
+>.$
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %console
|
|
|
|
::> ||
|
|
|
|
::> arms for shell functionality.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-console ::< initialize shell
|
|
|
|
::> initialize the shell of this reader.
|
|
|
|
::
|
|
|
|
^+ .
|
|
|
|
=/ she/shell
|
|
|
|
%*(. *shell id ost.bol, active (sy [%& our.bol inbox] ~))
|
|
|
|
sh-done:~(sh-prod sh she)
|
|
|
|
::
|
|
|
|
++ ta-sole ::< apply sole input
|
|
|
|
::> applies sole-action.
|
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
|
|
|
?. =(id.cli ost.bol)
|
|
|
|
~&(%strange-sole !!)
|
|
|
|
sh-done:(~(sh-sole sh cli) act)
|
|
|
|
::
|
|
|
|
++ sh ::< per console
|
|
|
|
::> shell core, responsible for handling user input
|
|
|
|
::> and the related actions, and outputting changes
|
|
|
|
::> to the cli.
|
|
|
|
::
|
|
|
|
|_ $: ::> she: console state.
|
|
|
|
::> man: our mailbox
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
she/shell
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ sh-done ::< resolve core
|
|
|
|
::> stores changes to the cli.
|
|
|
|
::
|
|
|
|
^+ +>
|
|
|
|
+>(cli she)
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sh-fact ::< send console effect
|
|
|
|
::> adds a console effect to ++ta's moves.
|
|
|
|
::
|
|
|
|
|= fec/sole-effect
|
|
|
|
^+ +>
|
|
|
|
+>(moves [[id.she %diff %sole-effect fec] moves])
|
|
|
|
::
|
|
|
|
++ sh-act ::< send action
|
|
|
|
::> adds an aaction to ++ta's moves.
|
|
|
|
::
|
|
|
|
|= act/action
|
|
|
|
^+ +>
|
|
|
|
%= +>
|
|
|
|
moves
|
|
|
|
:_ moves
|
|
|
|
:* ost.bol
|
|
|
|
%poke
|
|
|
|
/reader/action
|
|
|
|
(broker our.bol)
|
|
|
|
[%talk-action act]
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %cli-interaction
|
|
|
|
::> ||
|
|
|
|
::> processing user input as it happens.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sh-sole ::< apply edit
|
|
|
|
::> applies sole action.
|
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
|
|
|
?- -.act
|
|
|
|
$det (sh-edit +.act)
|
|
|
|
$clr ..sh-sole :: (sh-pact ~) :: XX clear to PM-to-self?
|
|
|
|
$ret sh-obey
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sh-edit ::< apply sole edit
|
|
|
|
::> called when typing into the cli prompt.
|
|
|
|
::> applies the change and does sanitizing.
|
|
|
|
::
|
|
|
|
|= cal/sole-change
|
|
|
|
^+ +>
|
|
|
|
=^ inv say.she (~(transceive sole say.she) cal)
|
|
|
|
=+ fix=(sh-sane inv buf.say.she)
|
|
|
|
?~ lit.fix
|
|
|
|
+>.$
|
|
|
|
:: just capital correction
|
|
|
|
?~ err.fix
|
|
|
|
(sh-slug fix)
|
|
|
|
:: allow interior edits and deletes
|
|
|
|
?. &(?=($del -.inv) =(+(p.inv) (lent buf.say.she)))
|
|
|
|
+>.$
|
|
|
|
(sh-slug fix)
|
|
|
|
::
|
|
|
|
++ sh-read ::< command parser
|
|
|
|
::> parses the command line buffer. produces work
|
|
|
|
::> items which can be executed by ++sh-work.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
=< work
|
2017-04-24 18:30:01 +03:00
|
|
|
::> || %parsers
|
|
|
|
::> various parsers for command line input.
|
2017-03-24 23:10:27 +03:00
|
|
|
|%
|
2017-04-24 18:30:01 +03:00
|
|
|
++ expr ::< [cord twig]
|
2017-03-24 23:10:27 +03:00
|
|
|
|= tub/nail %. tub
|
|
|
|
%+ stag (crip q.tub)
|
2017-04-21 18:37:10 +03:00
|
|
|
wide:(vang & [&1:% &2:% (scot %da now.bol) |3:%])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ dare ::< @dr
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ sear
|
|
|
|
|= a/coin
|
|
|
|
?. ?=({$$ $dr @} a) ~
|
|
|
|
(some `@dr`+>.a)
|
|
|
|
nuck:so
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ship ;~(pfix sig fed:ag) ::< ship
|
|
|
|
++ shiz ::< ship set
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ cook
|
|
|
|
|=(a/(list ^ship) (~(gas in *(set ^ship)) a))
|
|
|
|
(most ;~(plug com (star ace)) ship)
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pasp ::< passport
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pfix pat
|
|
|
|
;~ pose
|
|
|
|
(stag %twitter ;~(pfix (jest 't') col urs:ab))
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ stat ::< local circle
|
2017-04-17 14:14:04 +03:00
|
|
|
;~(pfix cen sym)
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ stan ::< circle
|
2017-03-23 03:34:56 +03:00
|
|
|
;~ pose
|
2017-04-24 18:30:01 +03:00
|
|
|
(cold [our.bol inbox] col)
|
2017-04-21 18:37:10 +03:00
|
|
|
;~(pfix cen (stag our.bol sym))
|
|
|
|
;~(pfix fas (stag (sein our.bol) sym))
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
%+ cook
|
|
|
|
|= {a/@p b/(unit term)}
|
|
|
|
[a ?^(b u.b (main a))]
|
|
|
|
;~ plug
|
|
|
|
ship
|
|
|
|
(punt ;~(pfix fas urs:ab))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ parn ::< partner
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pose
|
|
|
|
(stag %& stan)
|
|
|
|
(stag %| pasp)
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ partners-flat ::< collapse mixed list
|
2017-03-24 23:10:27 +03:00
|
|
|
|= a/(list (each partner (set partner)))
|
|
|
|
^- (set partner)
|
|
|
|
?~ a ~
|
|
|
|
?- -.i.a
|
|
|
|
$& (~(put in $(a t.a)) p.i.a)
|
|
|
|
$| (~(uni in $(a t.a)) p.i.a)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ para ::< partners alias
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ cook partners-flat
|
|
|
|
%+ most ;~(plug com (star ace))
|
|
|
|
(pick parn (sear sh-glyf glyph))
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ parz ::< non-empty partners
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ cook ~(gas in *(set partner))
|
|
|
|
(most ;~(plug com (star ace)) parn)
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ nump ::< number reference
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pose
|
|
|
|
;~(pfix hep dem:ag)
|
|
|
|
;~ plug
|
|
|
|
(cook lent (plus (just '0')))
|
|
|
|
;~(pose dem:ag (easy 0))
|
|
|
|
==
|
|
|
|
(stag 0 dem:ag)
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pore ::< posture
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pose
|
|
|
|
(cold %black (jest %channel))
|
|
|
|
(cold %white (jest %village))
|
|
|
|
(cold %green (jest %journal))
|
|
|
|
(cold %brown (jest %mailbox))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ message ::< exp, lin or url msg
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pose
|
|
|
|
;~(plug (cold %eval hax) expr)
|
|
|
|
::
|
|
|
|
%+ stag %say
|
|
|
|
%+ most (jest '•')
|
2017-03-23 03:34:56 +03:00
|
|
|
;~ pose
|
2017-03-24 23:10:27 +03:00
|
|
|
(stag %url aurf:urlp)
|
|
|
|
:(stag %lin | ;~(pfix pat text))
|
|
|
|
:(stag %lin & ;~(less sem hax text))
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ nick (cook crip (stun [1 14] low)) ::< nickname
|
|
|
|
++ text (cook crip (plus (shim ' ' '~'))) ::< bullets separating
|
2017-04-24 21:17:56 +03:00
|
|
|
++ glyph (mask "/\\\{(<!?{(zing glyphs)}") ::< circle postfix
|
2017-04-24 18:30:01 +03:00
|
|
|
++ setting ::< setting flag
|
2017-03-24 23:10:27 +03:00
|
|
|
%- perk :~
|
|
|
|
%noob
|
|
|
|
%quiet
|
|
|
|
%showtime
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
++ work ::< full input
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ knee *^work |. ~+
|
|
|
|
=- ;~(pose ;~(pfix sem -) message)
|
|
|
|
;~ pose
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
:: circle management
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
;~((glue ace) (perk %join ~) para)
|
|
|
|
::
|
|
|
|
;~((glue ace) (perk %leave ~) para)
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ (glue ace) (perk %create ~)
|
|
|
|
pore
|
2017-04-17 14:14:04 +03:00
|
|
|
stat
|
2017-03-24 23:10:27 +03:00
|
|
|
qut
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-14 17:16:36 +03:00
|
|
|
;~ plug (perk %delete ~)
|
|
|
|
;~(pfix ;~(plug ace cen) sym)
|
|
|
|
;~ pose
|
|
|
|
(cook some ;~(pfix ace qut))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
;~((glue ace) (perk %depict ~) stat qut)
|
|
|
|
::
|
|
|
|
;~((glue ace) (perk %source ~) stat parz)
|
|
|
|
::
|
|
|
|
;~((glue ace) (perk %invite ~) stat shiz)
|
|
|
|
::
|
|
|
|
;~((glue ace) (perk %banish ~) stat shiz)
|
|
|
|
::
|
|
|
|
:: displaying info
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %who ~) ;~(pose ;~(pfix ace para) (easy ~)))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
;~((glue ace) (perk %what ~) ;~(pose parz glyph))
|
|
|
|
::
|
|
|
|
:: ui settings
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %bind ~) ;~(pfix ace glyph) (punt ;~(pfix ace para)))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-18 15:29:17 +03:00
|
|
|
;~(plug (perk %unbind ~) ;~(pfix ace glyph) (punt ;~(pfix ace para)))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ plug (perk %nick ~)
|
|
|
|
;~ pose
|
|
|
|
;~ plug
|
2017-03-23 03:34:56 +03:00
|
|
|
(cook some ;~(pfix ace ship))
|
2017-03-24 23:10:27 +03:00
|
|
|
(cold (some '') ;~(pfix ace sig))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ plug
|
|
|
|
;~ pose
|
|
|
|
(cook some ;~(pfix ace ship))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
;~ pose
|
|
|
|
(cook some ;~(pfix ace nick))
|
|
|
|
(easy ~)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %set ~) ;~(pose ;~(pfix ace setting) (easy %$)))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %unset ~) ;~(pfix ace setting))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
:: miscellaneous
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %help ~) (easy ~))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
:: (parsers below come last because they're easy to match)
|
|
|
|
::
|
|
|
|
:: messaging
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
(stag %target ;~(plug para (punt ;~(pfix ace message))))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
:: displaying info
|
|
|
|
::
|
|
|
|
(stag %number nump)
|
2017-03-24 23:10:27 +03:00
|
|
|
(stag %number (cook lent (star sem)))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-sane-chat ::< sanitize chatter
|
|
|
|
::> (for chat messages) sanitizes the input buffer
|
|
|
|
::> and splits it into multiple lines (by '•').
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= buf/(list @c)
|
|
|
|
^- (list sole-edit)
|
|
|
|
?~ buf ~
|
|
|
|
=+ isa==(i.buf (turf '@'))
|
|
|
|
=+ [[pre=*@c cur=i.buf buf=t.buf] inx=0 brk=0 len=0 new=|]
|
|
|
|
=* txt -<
|
|
|
|
|^ ^- (list sole-edit)
|
|
|
|
?: =(cur (turf '•'))
|
|
|
|
?: =(pre (turf '•'))
|
|
|
|
[[%del inx] ?~(buf ~ $(txt +.txt))]
|
|
|
|
?: new
|
|
|
|
[(fix ' ') $(cur `@c`' ')]
|
|
|
|
newline
|
|
|
|
?: =(cur `@`' ')
|
|
|
|
=. brk ?:(=(pre `@`' ') brk inx)
|
|
|
|
?. =(64 len) advance
|
|
|
|
:- (fix(inx brk) (turf '•'))
|
|
|
|
?: isa
|
|
|
|
[[%ins +(brk) (turf '@')] newline(new &)]
|
|
|
|
newline(new &)
|
|
|
|
?: =(64 len)
|
|
|
|
=+ dif=(sub inx brk)
|
|
|
|
?: (lth dif 64)
|
|
|
|
:- (fix(inx brk) (turf '•'))
|
|
|
|
?: isa
|
|
|
|
[[%ins +(brk) (turf '@')] $(len dif, new &)]
|
|
|
|
$(len dif, new &)
|
|
|
|
[[%ins inx (turf '•')] $(len 0, inx +(inx), new &)]
|
|
|
|
?: |((lth cur 32) (gth cur 126))
|
|
|
|
[(fix '?') advance]
|
|
|
|
?: &((gte cur 'A') (lte cur 'Z'))
|
|
|
|
[(fix (add 32 cur)) advance]
|
|
|
|
advance
|
2017-03-25 02:24:55 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ advance ?~(buf ~ $(len +(len), inx +(inx), txt +.txt))
|
|
|
|
++ newline ?~(buf ~ $(len 0, inx +(inx), txt +.txt))
|
|
|
|
++ fix |=(cha/@ [%mor [%del inx] [%ins inx `@c`cha] ~])
|
|
|
|
--
|
2017-03-25 02:24:55 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-sane ::< sanitize input
|
|
|
|
::> parses cli prompt input using ++sh-read and
|
|
|
|
::> sanitizes when invalid.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {inv/sole-edit buf/(list @c)}
|
|
|
|
^- {lit/(list sole-edit) err/(unit @u)}
|
|
|
|
=+ res=(rose (tufa buf) sh-read)
|
|
|
|
?: ?=($| -.res) [[inv]~ `p.res]
|
|
|
|
:_ ~
|
|
|
|
?~ p.res ~
|
|
|
|
=+ wok=u.p.res
|
|
|
|
|- ^- (list sole-edit)
|
|
|
|
?+ -.wok
|
|
|
|
~
|
|
|
|
::
|
|
|
|
$target
|
|
|
|
?~(q.wok ~ $(wok u.q.wok))
|
|
|
|
::
|
|
|
|
$say
|
|
|
|
|- :: XX per line
|
|
|
|
?~ p.wok ~
|
|
|
|
?: ?=($lin -.i.p.wok)
|
|
|
|
(sh-sane-chat buf)
|
|
|
|
$(p.wok t.p.wok)
|
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-slug ::< edit to sanity
|
|
|
|
::> corrects invalid prompt input.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {lit/(list sole-edit) err/(unit @u)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-04-24 18:30:01 +03:00
|
|
|
?~ lit +>
|
|
|
|
=^ lic say.she
|
|
|
|
(~(transmit sole say.she) `sole-edit`?~(t.lit i.lit [%mor lit]))
|
|
|
|
(sh-fact [%mor [%det lic] ?~(err ~ [%err u.err]~)])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-obey ::< apply result
|
|
|
|
::> called upon hitting return in the prompt. if
|
|
|
|
::> input is invalid, ++sh-slug is called.
|
|
|
|
::> otherwise, the appropriate work is done and
|
|
|
|
::> the entered command (if any) gets displayed
|
|
|
|
::> to the user.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ fix=(sh-sane [%nop ~] buf.say.she)
|
|
|
|
?^ lit.fix
|
|
|
|
(sh-slug fix)
|
|
|
|
=+ jub=(rust (tufa buf.say.she) sh-read)
|
|
|
|
?~ jub (sh-fact %bel ~)
|
|
|
|
%. u.jub
|
|
|
|
=< sh-work
|
|
|
|
=+ buf=buf.say.she
|
|
|
|
=^ cal say.she (~(transmit sole say.she) [%set ~])
|
|
|
|
%- sh-fact
|
|
|
|
:* %mor
|
|
|
|
[%nex ~]
|
|
|
|
[%det cal]
|
|
|
|
?. ?=({$';' *} buf) ~
|
|
|
|
:_ ~
|
|
|
|
[%txt (runt [14 '-'] `tape`['|' ' ' (tufa `(list @)`buf)])]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %user-action
|
|
|
|
::> ||
|
|
|
|
::> processing user actions.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-work ::< do work
|
|
|
|
::> implements worker arms for different talk
|
|
|
|
::> commands.
|
|
|
|
::> worker arms must produce updated state.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
|= job/work
|
|
|
|
^+ +>
|
|
|
|
=< work
|
|
|
|
|%
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %helpers
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ work ::< call correct worker
|
2017-03-24 23:10:27 +03:00
|
|
|
?- -.job
|
2017-04-24 21:17:56 +03:00
|
|
|
:: circle management
|
2017-03-24 23:10:27 +03:00
|
|
|
$join (join +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
$leave (leave +.job)
|
|
|
|
$create (create +.job)
|
|
|
|
$delete (delete +.job)
|
|
|
|
$depict (depict +.job)
|
|
|
|
$source (source +.job)
|
|
|
|
$invite (invite +.job)
|
|
|
|
$banish (banish +.job)
|
|
|
|
:: messaging
|
|
|
|
$say (say +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$eval (eval +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
$target (target +.job)
|
|
|
|
:: displaying info
|
|
|
|
$number (number +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$who (who +.job)
|
|
|
|
$what (what +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: ui settings
|
2017-03-24 23:10:27 +03:00
|
|
|
$bind (bind +.job)
|
2017-04-18 15:29:17 +03:00
|
|
|
$unbind (unbind +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$nick (nick +.job)
|
|
|
|
$set (wo-set +.job)
|
|
|
|
$unset (unset +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: miscelaneous
|
2017-03-24 23:10:27 +03:00
|
|
|
$help help
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ activate ::< from %number
|
|
|
|
::> prints message details.
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ tay=~(. tr settings.she gam)
|
2017-03-24 23:10:27 +03:00
|
|
|
=. ..sh-work (sh-fact tr-fact:tay)
|
2017-03-27 13:52:30 +03:00
|
|
|
sh-prod(active.she tr-pals:tay)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ deli ::< find number
|
|
|
|
::> gets absolute message number from relative.
|
|
|
|
::
|
|
|
|
|= {max/@ud nul/@u fin/@ud}
|
|
|
|
^- @ud
|
|
|
|
=+ dog=|-(?:(=(0 fin) 1 (mul 10 $(fin (div fin 10)))))
|
|
|
|
=. dog (mul dog (pow 10 nul))
|
|
|
|
=- ?:((lte - max) - (sub - dog))
|
|
|
|
(add fin (sub max (mod max dog)))
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ glyph ::< grab a glyph
|
|
|
|
::> finds a new glyph for assignment.
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
|= idx/@
|
|
|
|
=< cha
|
|
|
|
%+ reel glyphs
|
|
|
|
|= {all/tape ole/{cha/char num/@}}
|
|
|
|
=+ new=(snag (mod idx (lent all)) all)
|
|
|
|
=+ num=~(wyt in (~(get ju nak) new))
|
|
|
|
?~ cha.ole [new num]
|
|
|
|
?: (lth num.ole num)
|
|
|
|
ole
|
|
|
|
[new num]
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ set-glyph ::< new glyph binding
|
|
|
|
::> applies glyph binding to our state and sends
|
|
|
|
::> an action.
|
|
|
|
::
|
|
|
|
|= {cha/char pas/(set partner)}
|
|
|
|
=: nik (~(put by nik) pas cha)
|
|
|
|
nak (~(put ju nak) cha pas)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
(sh-act %glyph cha pas &)
|
2017-04-18 15:29:17 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ unset-glyph ::< old glyph binding
|
|
|
|
::> removes either {pas} or all bindings on a
|
|
|
|
::> glyph and sends an action.
|
|
|
|
::
|
|
|
|
|= {cha/char pas/(unit (set partner))}
|
2017-04-18 15:29:17 +03:00
|
|
|
=/ ole/(set (set partner))
|
2017-04-24 18:30:01 +03:00
|
|
|
?^ pas [u.pas ~ ~]
|
2017-04-18 15:29:17 +03:00
|
|
|
(~(get ju nak) cha)
|
2017-04-24 18:30:01 +03:00
|
|
|
=. ..sh-work (sh-act %glyph cha (fall pas ~) |)
|
2017-04-18 15:29:17 +03:00
|
|
|
|- ^+ ..sh-work
|
|
|
|
?~ ole ..sh-work
|
|
|
|
=. ..sh-work $(ole l.ole)
|
|
|
|
=. ..sh-work $(ole r.ole)
|
|
|
|
%= ..sh-work
|
|
|
|
nik (~(del by nik) n.ole)
|
|
|
|
nak (~(del ju nak) cha n.ole)
|
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ reverse-folks ::< find by handle
|
|
|
|
::> finds all ships whose handle matches {nym}.
|
|
|
|
::
|
|
|
|
|= nym/knot
|
|
|
|
^- (list ship)
|
|
|
|
%+ murn (~(tap by folks))
|
|
|
|
|= {p/ship q/human}
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ han.q ~
|
|
|
|
?. =(u.han.q nym) ~
|
2017-04-24 18:30:01 +03:00
|
|
|
[~ u=p]
|
|
|
|
::
|
|
|
|
++ twig-head ::< eval data
|
|
|
|
::> makes a vase of environment data to evaluate
|
|
|
|
::> against (for #-messages).
|
|
|
|
::
|
|
|
|
^- vase
|
|
|
|
!> ^- {our/@p now/@da eny/@uvI}
|
|
|
|
[our.bol now.bol (shas %eny eny.bol)]
|
|
|
|
::
|
|
|
|
::> ||
|
2017-04-24 21:17:56 +03:00
|
|
|
::> || %circle-management
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ join ::< %join
|
|
|
|
::> change local mailbox config to include
|
|
|
|
::> subscriptions to {pas}.
|
|
|
|
::TODO only bind glyph *after* we've
|
|
|
|
:: successfully joined.
|
|
|
|
::
|
|
|
|
|= pas/(set partner)
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
=. ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ (~(get by nik) pas)
|
2017-03-24 23:10:27 +03:00
|
|
|
?^ - (sh-note "has glyph {<u>}")
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ cha=(glyph (mug pas))
|
|
|
|
(sh-note:(set-glyph cha pas) "new glyph {<cha>}")
|
2017-03-31 13:46:40 +03:00
|
|
|
=. ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-prod(active.she pas)
|
|
|
|
(sh-act %source inbox & pas)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ leave ::< %leave
|
|
|
|
::> change local mailbox config to exclude
|
|
|
|
::> subscriptions to {pas}.
|
|
|
|
::
|
|
|
|
|= pas/(set partner)
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
(sh-act %source inbox | pas)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ create ::< %create
|
2017-04-24 21:17:56 +03:00
|
|
|
::> creates circle {nom} with specified config.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= {por/posture nom/knot txt/cord}
|
|
|
|
^+ ..sh-work
|
|
|
|
::TODO simplify?
|
|
|
|
?: (~(has in mirrors) [our.bol nom])
|
|
|
|
(sh-lame "{(trip nom)}: already exists")
|
|
|
|
=. ..sh-work
|
|
|
|
(sh-act %create nom txt por)
|
|
|
|
(join [[%& our.bol nom] ~ ~])
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ delete ::< %delete
|
2017-04-24 21:17:56 +03:00
|
|
|
::> deletes our circle {nom}, after optionally
|
2017-04-24 18:30:01 +03:00
|
|
|
::> sending a last announce message {say}.
|
|
|
|
::
|
|
|
|
|= {nom/knot say/(unit cord)}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %delete nom say)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ depict ::< %depict
|
|
|
|
::> changes the description of {nom} to {txt}.
|
|
|
|
::
|
|
|
|
|= {nom/knot txt/cord}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %depict nom txt)
|
2017-04-18 15:29:17 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ source ::< %source
|
2017-04-24 21:17:56 +03:00
|
|
|
::> adds {pas} to {nom}'s src.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= {nom/knot pas/(set partner)}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %source nom & pas)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ invite ::< %invite
|
2017-04-24 21:17:56 +03:00
|
|
|
::> invites {sis} to our circle {nom}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-10 23:35:25 +03:00
|
|
|
|= {nom/knot sis/(set ship)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-04-21 18:37:10 +03:00
|
|
|
(sh-act %permit nom & sis)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ banish ::< %banish
|
2017-04-24 21:17:56 +03:00
|
|
|
::> banish {sis} from our circle {nom}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-10 23:35:25 +03:00
|
|
|
|= {nom/knot sis/(set ship)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-04-21 18:37:10 +03:00
|
|
|
(sh-act %permit nom | sis)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %messaging
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ say ::< publish
|
|
|
|
::> sends message.
|
|
|
|
::
|
|
|
|
|= sep/(list speech)
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
(sh-act %phrase active.she sep)
|
|
|
|
::
|
|
|
|
++ eval ::< run
|
|
|
|
::> executes {exe} and sends both its code and
|
|
|
|
::> result.
|
|
|
|
::
|
|
|
|
|= {txt/cord exe/twig}
|
|
|
|
=> |.([(sell (slap (slop twig-head seed) exe))]~)
|
|
|
|
=+ tan=p:(mule .)
|
|
|
|
(say [%fat tank+tan exp+txt] ~)
|
|
|
|
::
|
|
|
|
++ target ::< %target
|
|
|
|
::> sets messaging target, then execute {woe}.
|
|
|
|
::
|
|
|
|
|= {pan/(set partner) woe/(unit ^work)}
|
|
|
|
^+ ..sh-work
|
|
|
|
=. ..sh-pact (sh-pact pan)
|
|
|
|
?~(woe ..sh-work work(job u.woe))
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %displaying-info
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ who ::< %who
|
|
|
|
::> prints presence lists for {pas} or all.
|
|
|
|
::
|
|
|
|
|= pas/(set partner) ^+ ..sh-work
|
|
|
|
::TODO clever use of =< and . take note!
|
|
|
|
=< (sh-fact %mor (murn (sort (~(tap by remotes) ~) aor) .))
|
|
|
|
|= {pon/partner alt/atlas} ^- (unit sole-effect)
|
|
|
|
?. |(=(~ pas) (~(has in pas) pon)) ~
|
|
|
|
=- `[%tan rose+[", " `~]^- leaf+~(pr-full pr pon) ~]
|
|
|
|
=< (murn (sort (~(tap by alt)) aor) .)
|
|
|
|
|= {a/ship b/presence c/human} ^- (unit tank)
|
|
|
|
=. c
|
2017-04-24 21:17:56 +03:00
|
|
|
?. =(han.c `(scot %p a)) c
|
|
|
|
[tru.c ~]
|
2017-04-24 18:30:01 +03:00
|
|
|
?- b
|
|
|
|
$gone ~
|
2017-04-24 21:17:56 +03:00
|
|
|
$idle `leaf+:(weld "idle " (scow %p a) " " (trip (fall han.c '')))
|
|
|
|
$hear `leaf+:(weld "hear " (scow %p a) " " (trip (fall han.c '')))
|
|
|
|
$talk `leaf+:(weld "talk " (scow %p a) " " (trip (fall han.c '')))
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ what ::< %what
|
|
|
|
::> prints binding details. goes both ways.
|
|
|
|
::TODO pretty-print
|
|
|
|
::
|
|
|
|
|= qur/$@(char (set partner))
|
2017-04-14 17:16:36 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
?^ qur
|
|
|
|
=+ cha=(~(get by nik) qur)
|
|
|
|
(sh-fact %txt ?~(cha "none" [u.cha]~))
|
|
|
|
=+ pan=(~(tap in (~(get ju nak) qur)))
|
|
|
|
?: =(~ pan) (sh-fact %txt "~")
|
|
|
|
=< (sh-fact %mor (turn pan .))
|
|
|
|
|=(a/(set partner) [%txt <a>]) :: XX ~(ar-whom ar a)
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ number ::< %number
|
|
|
|
::> finds selected message, expand it.
|
|
|
|
::
|
|
|
|
|= num/$@(@ud {p/@u q/@ud})
|
2017-04-14 17:16:36 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
|-
|
|
|
|
?@ num
|
|
|
|
?: (gte num count)
|
|
|
|
(sh-lame "{(scow %s (new:si | +(num)))}: no such telegram")
|
|
|
|
=. ..sh-fact (sh-fact %txt "? {(scow %s (new:si | +(num)))}")
|
|
|
|
(activate (snag num grams))
|
|
|
|
?. (gth q.num count)
|
|
|
|
?: =(count 0)
|
|
|
|
(sh-lame "0: no messages")
|
|
|
|
=+ msg=(deli (dec count) num)
|
|
|
|
=. ..sh-fact (sh-fact %txt "? {(scow %ud msg)}")
|
|
|
|
(activate (snag (sub count +(msg)) grams))
|
|
|
|
(sh-lame "…{(reap p.num '0')}{(scow %ud q.num)}: no such telegram")
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %ui-settings
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ bind ::< %bind
|
|
|
|
::> binds targets {pas} to the glyph {cha}.
|
|
|
|
::
|
|
|
|
|= {cha/char pas/(unit (set partner))}
|
2017-04-14 17:16:36 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
?~ pas $(pas `active.she)
|
|
|
|
=+ ole=(~(get by nik) u.pas)
|
|
|
|
?: =(ole [~ cha]) ..sh-work
|
|
|
|
%. "bound {<cha>} {<u.pas>}"
|
|
|
|
sh-note:sh-prod:(set-glyph cha u.pas)
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ unbind ::< %unbind
|
|
|
|
::> unbinds targets {pas} to glyph {cha}.
|
|
|
|
::
|
|
|
|
|= {cha/char pan/(unit (set partner))}
|
|
|
|
^+ ..sh-work
|
|
|
|
?. ?| &(?=(^ pan) (~(has by nik) u.pan))
|
|
|
|
&(?=($~ pan) (~(has by nak) cha))
|
|
|
|
==
|
|
|
|
..sh-work
|
|
|
|
%. "unbound {<cha>}"
|
|
|
|
sh-note:sh-prod:(unset-glyph cha pan)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ nick ::< %nick
|
|
|
|
::> either shows, sets or unsets nicknames
|
|
|
|
::> depending on arguments.
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
|= {her/(unit ship) nym/(unit cord)}
|
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
::> no arguments, show all
|
2017-03-24 23:10:27 +03:00
|
|
|
?: ?=({$~ $~} +<)
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn (~(tap by folks))
|
|
|
|
|= {p/ship q/human}
|
|
|
|
:- %txt
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ han.q
|
2017-03-24 23:10:27 +03:00
|
|
|
"{<p>}:"
|
2017-04-24 21:17:56 +03:00
|
|
|
"{<p>}: {<u.han.q>}"
|
2017-04-24 18:30:01 +03:00
|
|
|
::> show her nick
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ nym
|
|
|
|
?> ?=(^ her)
|
|
|
|
=+ asc=(~(get by folks) u.her)
|
|
|
|
%+ sh-fact %txt
|
|
|
|
?~ asc "{<u.her>} unbound"
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ han.u.asc "{<u.her>}:"
|
|
|
|
"{<u.her>}: {<u.han.u.asc>}"
|
2017-04-24 18:30:01 +03:00
|
|
|
::> show nick ship
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ her
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn (reverse-folks u.nym)
|
|
|
|
|= p/ship
|
|
|
|
[%txt "{<p>}: {<u.nym>}"]
|
2017-03-27 13:50:39 +03:00
|
|
|
%. [%human u.her [true=~ hand=nym]]
|
2017-04-21 18:37:10 +03:00
|
|
|
%= sh-act
|
2017-04-24 18:30:01 +03:00
|
|
|
folks
|
|
|
|
?~ u.nym
|
|
|
|
::> unset nickname
|
|
|
|
(~(del by folks) u.her)
|
|
|
|
::> set nickname
|
|
|
|
(~(put by folks) u.her [true=~ hand=nym])
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ wo-set ::< %set
|
|
|
|
::> enables ui setting flag.
|
|
|
|
::
|
|
|
|
|= seg/knot
|
|
|
|
^+ ..sh-work
|
|
|
|
?~ seg
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn (~(tap in settings.she))
|
|
|
|
|= s/knot
|
|
|
|
[%txt (trip s)]
|
|
|
|
%= ..sh-work
|
|
|
|
settings.she (~(put in settings.she) seg)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ unset ::< %unset
|
|
|
|
::> disables ui setting flag.
|
|
|
|
::
|
|
|
|
|= neg/knot
|
|
|
|
^+ ..sh-work
|
|
|
|
%= ..sh-work
|
|
|
|
settings.she (~(del in settings.she) neg)
|
2017-03-24 23:10:27 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %miscellaneous
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ help ::< %help
|
|
|
|
::> prints help message
|
|
|
|
::
|
|
|
|
(sh-fact %txt "see http://urbit.org/docs/using/messaging/")
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ sh-pact ::< update active aud
|
|
|
|
::> change currently selected audience to {lix}
|
|
|
|
::> and update the prompt.
|
|
|
|
::
|
|
|
|
|= lix/(set partner)
|
|
|
|
^+ +>
|
|
|
|
::> ensure we can see what we send.
|
|
|
|
=+ act=(sh-pare lix)
|
|
|
|
?: =(active.she act) +>.$
|
|
|
|
sh-prod(active.she act)
|
|
|
|
::
|
|
|
|
++ sh-pare ::< adjust target list
|
|
|
|
::> if the audience {paz} does not contain a
|
|
|
|
::> partner we're subscribed to, add our mailbox
|
|
|
|
::> to the audience (so that we can see our own
|
|
|
|
::> message).
|
|
|
|
::
|
|
|
|
|= paz/(set partner)
|
|
|
|
?: (sh-pear paz) paz
|
|
|
|
(~(put in paz) [%& our.bol inbox])
|
|
|
|
::
|
|
|
|
++ sh-pear ::< hearback
|
|
|
|
::> produces true if any partner is included in
|
|
|
|
::> our subscriptions, meaning, we hear messages
|
|
|
|
::> sent to {paz}.
|
|
|
|
::
|
|
|
|
|= paz/(set partner)
|
|
|
|
?~ paz |
|
|
|
|
?| (~(has in sources) `partner`n.paz)
|
|
|
|
$(paz l.paz)
|
|
|
|
$(paz r.paz)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sh-pest ::< report listen
|
|
|
|
::> updates audience to be {tay}, only if {tay} is
|
|
|
|
::> not a village/%white.
|
|
|
|
::TODO why exclude village (invite-only?) audiences from this?
|
|
|
|
::TODO only used in config change printing, maybe delete.
|
|
|
|
::
|
|
|
|
|= tay/partner
|
|
|
|
^+ +>
|
|
|
|
::> if partner is a passport, ignore.
|
|
|
|
?. ?=($& -.tay) +>
|
|
|
|
=+ cof=(~(get by mirrors) +.tay)
|
2017-04-24 21:17:56 +03:00
|
|
|
?. |(?=($~ cof) !?=($white sec.con.u.cof))
|
2017-04-24 18:30:01 +03:00
|
|
|
+>.$
|
|
|
|
(sh-pact [tay ~ ~])
|
|
|
|
::
|
|
|
|
++ sh-glyf ::< decode glyph
|
|
|
|
::> finds the partner(s) that match a glyph.
|
|
|
|
::TODO should maybe return full set, not latest,
|
|
|
|
:: if ambiguous.
|
|
|
|
::
|
|
|
|
|= cha/char ^- (unit (set partner))
|
|
|
|
=+ lax=(~(get ju nak) cha)
|
|
|
|
::> no partner.
|
|
|
|
?: =(~ lax) ~
|
|
|
|
::> single partner.
|
|
|
|
?: ?=({* $~ $~} lax) `n.lax
|
|
|
|
::> in case of multiple partners, pick the most recently active one.
|
|
|
|
|- ^- (unit (set partner))
|
|
|
|
?~ grams ~
|
|
|
|
::> get first partner from a telegram's audience.
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ pan=(silt (turn (~(tap by aud.tot.i.grams)) head))
|
2017-04-24 18:30:01 +03:00
|
|
|
?: (~(has in lax) pan) `pan
|
|
|
|
$(grams t.grams)
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %differs
|
|
|
|
::> ||
|
|
|
|
::> arms that calculate differences between datasets.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sh-atlas-diff ::< atlas diff parts
|
|
|
|
::> calculates the difference between two presence
|
|
|
|
::> lists, producing lists of removed, added and
|
|
|
|
::> changed presences.
|
|
|
|
::
|
|
|
|
|= {one/atlas two/atlas}
|
|
|
|
=| $= ret
|
|
|
|
$: old/(list (pair ship status))
|
|
|
|
new/(list (pair ship status))
|
|
|
|
cha/(list (pair ship status))
|
|
|
|
==
|
|
|
|
^+ ret
|
|
|
|
=. ret
|
|
|
|
=+ eno=(~(tap by one))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ eno ret
|
|
|
|
=. ret $(eno t.eno)
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(%gone pec.q.i.eno) ret
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ unt=(~(get by two) p.i.eno)
|
|
|
|
?~ unt
|
|
|
|
ret(old [i.eno old.ret])
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(%gone pec.u.unt)
|
2017-04-24 18:30:01 +03:00
|
|
|
ret(old [i.eno old.ret])
|
|
|
|
?: =(q.i.eno u.unt) ret
|
|
|
|
ret(cha [[p.i.eno u.unt] cha.ret])
|
|
|
|
=. ret
|
|
|
|
=+ owt=(~(tap by two))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ owt ret
|
|
|
|
=. ret $(owt t.owt)
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(%gone pec.q.i.owt) ret
|
2017-04-24 18:30:01 +03:00
|
|
|
?. (~(has by one) p.i.owt)
|
|
|
|
ret(new [i.owt new.ret])
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(%gone pec:(~(got by one) p.i.owt))
|
2017-04-24 18:30:01 +03:00
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
ret
|
|
|
|
ret
|
|
|
|
::
|
|
|
|
++ sh-rempe-diff ::< remotes diff
|
|
|
|
::> calculates the difference between two remote
|
|
|
|
::> presence maps, producing a list of removed,
|
|
|
|
::> added and changed presences maps.
|
|
|
|
::
|
|
|
|
|= {one/(map partner atlas) two/(map partner atlas)}
|
|
|
|
=| $= ret
|
|
|
|
$: old/(list (pair partner atlas))
|
|
|
|
new/(list (pair partner atlas))
|
|
|
|
cha/(list (pair partner atlas))
|
|
|
|
==
|
|
|
|
^+ ret
|
|
|
|
=. ret
|
|
|
|
=+ eno=(~(tap by one))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ eno ret
|
|
|
|
=. ret $(eno t.eno)
|
|
|
|
=+ unt=(~(get by two) p.i.eno)
|
|
|
|
?~ unt
|
|
|
|
ret(old [i.eno old.ret])
|
|
|
|
?: =(q.i.eno u.unt) ret
|
|
|
|
ret(cha [[p.i.eno u.unt] cha.ret])
|
|
|
|
=. ret
|
|
|
|
=+ owt=(~(tap by two))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ owt ret
|
|
|
|
=. ret $(owt t.owt)
|
|
|
|
?: (~(has by one) p.i.owt)
|
|
|
|
ret
|
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
ret
|
|
|
|
::
|
|
|
|
++ sh-remco-diff ::< config diff parts
|
|
|
|
::> calculates the difference between two config
|
|
|
|
::> maps, producing lists of removed, added and
|
|
|
|
::> changed configs.
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {one/(map circle config) two/(map circle config)}
|
2017-04-24 18:30:01 +03:00
|
|
|
=| $= ret
|
2017-04-24 21:17:56 +03:00
|
|
|
$: old/(list (pair circle config))
|
|
|
|
new/(list (pair circle config))
|
|
|
|
cha/(list (pair circle config))
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
^+ ret
|
|
|
|
=. ret
|
|
|
|
=+ eno=(~(tap by one))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ eno ret
|
|
|
|
=. ret $(eno t.eno)
|
|
|
|
=+ unt=(~(get by two) p.i.eno)
|
|
|
|
?~ unt
|
|
|
|
ret(old [i.eno old.ret])
|
|
|
|
?: =(q.i.eno u.unt) ret
|
|
|
|
ret(cha [[p.i.eno u.unt] cha.ret])
|
|
|
|
=. ret
|
|
|
|
=+ owt=(~(tap by two))
|
|
|
|
|- ^+ ret
|
|
|
|
?~ owt ret
|
|
|
|
=. ret $(owt t.owt)
|
|
|
|
?: (~(has by one) p.i.owt)
|
|
|
|
ret
|
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
ret
|
|
|
|
::
|
|
|
|
++ sh-set-diff ::< set diff
|
|
|
|
::> calculates the difference between two sets,
|
|
|
|
::> procuding lists of removed and added items.
|
|
|
|
::
|
|
|
|
|* {one/(set *) two/(set *)}
|
|
|
|
:- ^= old (~(tap in (~(dif in one) two)))
|
|
|
|
^= new (~(tap in (~(dif in two) one)))
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %printers
|
|
|
|
::> ||
|
|
|
|
::> arms for printing data to the cli.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sh-reaction ::< apply reaction
|
|
|
|
::> renders a reaction to the cli.
|
|
|
|
::
|
|
|
|
|= rac/reaction
|
2017-04-24 21:17:56 +03:00
|
|
|
(sh-lame (trip wat.rac))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ sh-lame ::< send error
|
|
|
|
::> just puts some text into the cli as-is.
|
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
(sh-fact [%txt txt])
|
|
|
|
::
|
|
|
|
++ sh-note ::< shell message
|
|
|
|
::> left-pads {txt} with heps and prints it.
|
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
^+ +>
|
|
|
|
(sh-fact %txt (runt [14 '-'] `tape`['|' ' ' (scag 64 txt)]))
|
|
|
|
::
|
|
|
|
++ sh-prod ::< show prompt
|
|
|
|
::> makes and stores a move to modify the cli
|
|
|
|
::> prompt to display the current audience.
|
|
|
|
::
|
|
|
|
^+ .
|
|
|
|
%+ sh-fact %pro
|
|
|
|
:+ & %talk-line
|
|
|
|
^- tape
|
|
|
|
=/ rew/(pair (pair @t @t) (set partner))
|
|
|
|
[['[' ']'] active.she]
|
|
|
|
=+ cha=(~(get by nik) q.rew)
|
|
|
|
?^ cha ~[u.cha ' ']
|
|
|
|
=+ por=~(ar-prom ar q.rew)
|
|
|
|
(weld `tape`[p.p.rew por] `tape`[q.p.rew ' ' ~])
|
|
|
|
::
|
|
|
|
++ sh-rend ::< print on one line
|
|
|
|
::> renders a telegram as a single line, adds it
|
|
|
|
::> as a console move.
|
|
|
|
::
|
|
|
|
|= gam/telegram
|
|
|
|
=+ lin=~(tr-line tr settings.she gam)
|
|
|
|
(sh-fact %txt lin)
|
|
|
|
::
|
|
|
|
++ sh-numb ::< print msg number
|
|
|
|
::> prints a message number, left-padded by heps.
|
|
|
|
::
|
|
|
|
|= num/@ud
|
|
|
|
^+ +>
|
|
|
|
=+ bun=(scow %ud num)
|
|
|
|
%+ sh-fact %txt
|
|
|
|
(runt [(sub 13 (lent bun)) '-'] "[{bun}]")
|
|
|
|
::
|
|
|
|
++ sh-puss ::< readable posture
|
|
|
|
::> renders a security posture.
|
|
|
|
::
|
|
|
|
|= a/posture ^- tape
|
|
|
|
?- a
|
|
|
|
$black "channel"
|
|
|
|
$brown "mailbox"
|
|
|
|
$white "village"
|
|
|
|
$green "journal"
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sh-spaz ::< render status
|
|
|
|
::> gets the presence of {saz} as a tape.
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= sat/status
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tape
|
2017-04-24 21:17:56 +03:00
|
|
|
['%' (trip pec.sat)]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ sh-show-precs ::< print atlas diff
|
|
|
|
::> prints presence changes to the cli.
|
|
|
|
::
|
|
|
|
|= $: pre/tape
|
|
|
|
$= cul
|
|
|
|
$: old/(list (pair ship status))
|
|
|
|
new/(list (pair ship status))
|
|
|
|
cha/(list (pair ship status))
|
|
|
|
==
|
|
|
|
==
|
|
|
|
?: (~(has in settings.she) %quiet)
|
|
|
|
+>.$
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ old.cul +>.^$
|
|
|
|
=. +>.^$ $(old.cul t.old.cul)
|
|
|
|
(sh-note (weld pre "bye {(scow %p p.i.old.cul)}"))
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new.cul +>.^$
|
|
|
|
=. +>.^$ $(new.cul t.new.cul)
|
|
|
|
%- sh-note
|
|
|
|
(weld pre "met {(scow %p p.i.new.cul)} {(sh-spaz q.i.new.cul)}")
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ cha.cul +>.^$
|
|
|
|
%- sh-note
|
|
|
|
(weld pre "set {(scow %p p.i.cha.cul)} {(sh-spaz q.i.cha.cul)}")
|
|
|
|
+>.$
|
|
|
|
::
|
|
|
|
++ sh-show-permits ::< show permits
|
|
|
|
::> prints invite/banish effects to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {pre/tape por/posture old/(list ship) new/(list ship)}
|
|
|
|
=+ out=?:(?=(?($black $brown) por) "try " "cut ")
|
|
|
|
=+ inn=?:(?=(?($black $brown) por) "ban " "add ")
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ old +>.^$
|
|
|
|
=. +>.^$ $(old t.old)
|
|
|
|
(sh-note :(weld pre out " " (scow %p i.old)))
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new +>.^$
|
|
|
|
=. +>.^$ $(new t.new)
|
|
|
|
(sh-note :(weld pre out " " (scow %p i.new)))
|
|
|
|
+>.$
|
|
|
|
::
|
|
|
|
++ sh-show-sources ::< show sources
|
|
|
|
::> prints subscription changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {pre/tape old/(list partner) new/(list partner)}
|
|
|
|
^+ +>
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ old +>.^$
|
|
|
|
=. +>.^$ $(old t.old)
|
|
|
|
(sh-note (weld pre "off {~(pr-full pr i.old)}"))
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new +>.^$
|
|
|
|
=. +>.^$ $(new t.new)
|
|
|
|
(sh-note (weld pre "hey {~(pr-full pr i.new)}"))
|
|
|
|
+>.$
|
|
|
|
::
|
|
|
|
++ sh-show-config ::< show config
|
|
|
|
::> prints config changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {pre/tape laz/config loc/config}
|
|
|
|
^+ +>
|
|
|
|
=. +>.$
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(cap.loc cap.laz) +>.$
|
|
|
|
(sh-note :(weld pre "cap " (trip cap.loc)))
|
2017-04-24 18:30:01 +03:00
|
|
|
=. +>.$
|
|
|
|
%+ sh-show-sources
|
|
|
|
(weld (trip inbox) ": ")
|
2017-04-24 21:17:56 +03:00
|
|
|
(sh-set-diff src.laz src.loc)
|
|
|
|
?: !=(sec.con.loc sec.con.laz)
|
|
|
|
=. +>.$ (sh-note :(weld pre "but " (sh-puss sec.con.loc)))
|
2017-04-24 18:30:01 +03:00
|
|
|
%^ sh-show-permits
|
|
|
|
(weld (trip inbox) ": ")
|
2017-04-24 21:17:56 +03:00
|
|
|
sec.con.loc
|
|
|
|
[~ (~(tap in ses.con.loc))]
|
2017-04-24 18:30:01 +03:00
|
|
|
%^ sh-show-permits
|
|
|
|
(weld (trip inbox) ": ")
|
2017-04-24 21:17:56 +03:00
|
|
|
sec.con.loc
|
|
|
|
(sh-set-diff ses.con.laz ses.con.loc)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ sh-low-config ::< do show config
|
2017-04-24 21:17:56 +03:00
|
|
|
::> prints a circle's config changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {sat/circle old/(unit config) new/(unit config)}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ +>
|
|
|
|
?~ old ~&([%new-conf sat] +>)
|
|
|
|
?~ new ~&([%del-conf sat] +>) ::TODO tmp
|
|
|
|
%^ sh-show-config
|
2017-04-24 21:17:56 +03:00
|
|
|
(weld ~(cr-phat cr sat) ": ")
|
2017-04-24 18:30:01 +03:00
|
|
|
u.old u.new
|
|
|
|
::
|
|
|
|
++ sh-low-remco ::TODO delete me
|
|
|
|
::> prints changes to remote configs to the cli
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= {ole/(map circle config) neu/(map circle config)}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ +>
|
|
|
|
=+ (sh-remco-diff ole neu)
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new +>.^$
|
|
|
|
=. +>.^$ $(new t.new)
|
|
|
|
=. +>.^$ (sh-pest [%& p.i.new])
|
|
|
|
%+ sh-show-config
|
2017-04-24 21:17:56 +03:00
|
|
|
(weld ~(cr-phat cr p.i.new) ": ")
|
2017-04-24 18:30:01 +03:00
|
|
|
[*config q.i.new]
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ cha +>.^$
|
|
|
|
=. +>.^$ $(cha t.cha)
|
|
|
|
%+ sh-show-config
|
2017-04-24 21:17:56 +03:00
|
|
|
(weld ~(cr-phat cr p.i.cha) ": ")
|
|
|
|
[(~(got by ole) `circle`p.i.cha) q.i.cha]
|
2017-04-24 18:30:01 +03:00
|
|
|
+>.$
|
|
|
|
::
|
|
|
|
++ sh-low-rempe ::< show remotes
|
|
|
|
::> prints remote presence changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {old/(map partner atlas) new/(map partner atlas)}
|
|
|
|
=+ day=(sh-rempe-diff old new)
|
|
|
|
?: (~(has in settings.she) %quiet)
|
|
|
|
+>.$
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ 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-atlas-diff yez q.i.cha.day)
|
|
|
|
+>.$
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-low-precs ::< show presence
|
|
|
|
::> prints presence changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {old/atlas new/atlas}
|
|
|
|
^+ +>
|
|
|
|
=+ dif=(sh-atlas-diff old new)
|
|
|
|
(sh-show-precs "" dif)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-low-gram ::< show telegram
|
|
|
|
::> prints the telegram. every fifth message,
|
|
|
|
::> print the message number also.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {num/@ud gam/telegram}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-04-24 18:30:01 +03:00
|
|
|
?: =(num count.she)
|
|
|
|
=. +> ?:(=(0 (mod num 5)) (sh-numb num) +>)
|
|
|
|
(sh-rend(count.she +(num)) gam)
|
|
|
|
?: (gth num count.she)
|
|
|
|
=. +> (sh-numb num)
|
|
|
|
(sh-rend(count.she +(num)) gam)
|
|
|
|
+>
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ sh-low-grams ::< do show telegrams
|
|
|
|
::> prints multiple telegrams.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {num/@ud gaz/(list telegram)}
|
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
|
|
|
$(gaz t.gaz, num +(num), +> (sh-low-gram num i.gaz))
|
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %renderers
|
|
|
|
::> ||
|
|
|
|
::> rendering cores.
|
|
|
|
::+|
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ cr ::< circle renderer
|
|
|
|
::> used in both circle and ship rendering.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|_ ::> one: the circle.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
one/circle
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ cr-best ::< best to show
|
2017-04-24 18:30:01 +03:00
|
|
|
::> returns true if one is better to show, false
|
|
|
|
::> otherwise. prioritizes: our > main > size.
|
2017-04-24 21:17:56 +03:00
|
|
|
::TODO maybe simplify. (lth (xeb (xeb hos.one)) (xeb (xeb hos.two)))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
|= two/circle
|
2017-03-23 03:34:56 +03:00
|
|
|
^- ?
|
2017-04-24 21:17:56 +03:00
|
|
|
:: the circle that's ours is better.
|
|
|
|
?: =(our.bol hos.one)
|
|
|
|
?: =(our.bol hos.two)
|
|
|
|
?< =(nom.one nom.two)
|
|
|
|
:: if both circles are ours, the main story is better.
|
|
|
|
?: =((main hos.one) nom.one) %&
|
|
|
|
?: =((main hos.two) nom.two) %|
|
2017-04-24 18:30:01 +03:00
|
|
|
:: if neither are, pick the "larger" one.
|
2017-04-24 21:17:56 +03:00
|
|
|
(lth nom.one nom.two)
|
2017-03-23 03:34:56 +03:00
|
|
|
%&
|
2017-04-24 18:30:01 +03:00
|
|
|
:: if one isn't ours but two is, two is better.
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(our.bol hos.two)
|
2017-03-23 03:34:56 +03:00
|
|
|
%|
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(hos.one hos.two)
|
2017-04-24 18:30:01 +03:00
|
|
|
:: if they're from the same ship, pick the "larger" one.
|
2017-04-24 21:17:56 +03:00
|
|
|
(lth nom.one nom.two)
|
2017-04-24 18:30:01 +03:00
|
|
|
:: when in doubt, pick one if its ship is "smaller" than its channel.
|
2017-04-24 21:17:56 +03:00
|
|
|
(lth hos.one nom.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ cr-curt ::< render name in 14
|
2017-04-24 18:30:01 +03:00
|
|
|
::> prints a ship name in 14 characters. left-pads
|
|
|
|
::> with spaces. {mup} signifies "are there other
|
|
|
|
::> targets besides this one?"
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= mup/?
|
|
|
|
^- tape
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ raw=(cite hos.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
(runt [(sub 14 (lent raw)) ' '] raw)
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ cr-nick ::< nick or name in 14
|
2017-04-24 18:30:01 +03:00
|
|
|
::> get nick for ship, or shortname if no nick.
|
|
|
|
::> left-pads with spaces.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|. ^- tape
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ nym=(~(get by folks) hos.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
?~ nym
|
2017-04-24 21:17:56 +03:00
|
|
|
(cr-curt |)
|
|
|
|
?~ han.u.nym
|
|
|
|
(cr-curt |)
|
|
|
|
=+ raw=(trip u.han.u.nym)
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ len=(sub 14 (lent raw))
|
|
|
|
(weld (reap len ' ') raw)
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
++ cr-phat ::< render accurately
|
|
|
|
::> prints a circle fully, but still taking
|
2017-04-24 18:30:01 +03:00
|
|
|
::> "shortcuts" where possible:
|
|
|
|
::> ":" for local mailbox, "~ship" for foreign
|
2017-04-24 21:17:56 +03:00
|
|
|
::> mailbox, "%channel" for local circle,
|
|
|
|
::> "/channel" for parent circle.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^- tape
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(hos.one our.bol)
|
|
|
|
?: =(nom.one inbox)
|
2017-03-23 03:34:56 +03:00
|
|
|
":"
|
2017-04-24 21:17:56 +03:00
|
|
|
['%' (trip nom.one)]
|
|
|
|
?: =(hos.one (sein our.bol))
|
|
|
|
['/' (trip nom.one)]
|
|
|
|
=+ wun=(scow %p hos.one)
|
|
|
|
?: =(nom.one (main hos.one))
|
2017-03-23 03:34:56 +03:00
|
|
|
wun
|
2017-04-24 21:17:56 +03:00
|
|
|
:(welp wun "/" (trip nom.one))
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pr ::< partner renderer
|
|
|
|
::> used primarily for printing partners.
|
|
|
|
::
|
|
|
|
|_ ::> one: the partner
|
|
|
|
::
|
|
|
|
one/partner
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pr-beat ::< more relevant
|
|
|
|
::> returns true if one is better to show, false
|
2017-04-24 21:17:56 +03:00
|
|
|
::> otherwise. prefers circles over passports.
|
|
|
|
::> if both are circles, ++cr-best.
|
2017-04-24 18:30:01 +03:00
|
|
|
::> if both are passports, pick the "larger" one.
|
|
|
|
::> if they're equal, content hash.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= two/partner ^- ?
|
2017-04-24 18:30:01 +03:00
|
|
|
?- -.one
|
2017-03-23 03:34:56 +03:00
|
|
|
$&
|
|
|
|
?- -.two
|
|
|
|
$| %&
|
2017-04-24 21:17:56 +03:00
|
|
|
$& (~(cr-best cr p.one) p.two)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
$|
|
|
|
|
?- -.two
|
|
|
|
$& %|
|
|
|
|
$| ?: =(-.p.two -.p.one)
|
|
|
|
(lth (mug +.p.one) (mug +.p.two))
|
|
|
|
(lth -.p.two -.p.one)
|
|
|
|
==
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ pr-best ::< most relevant
|
|
|
|
::> picks the most relevant partner.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 18:37:10 +03:00
|
|
|
|=(two/partner ?:((pr-beat two) two one))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pr-sigh ::< assemble label
|
|
|
|
::> prepend {pre} to {yiz}, omitting characters of
|
|
|
|
::> {yiz} to stay within {len} characters.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
|= {len/@ud pre/tape yiz/cord}
|
|
|
|
^- tape
|
|
|
|
=+ nez=(trip yiz)
|
|
|
|
=+ lez=(lent nez)
|
|
|
|
?> (gth len (lent pre))
|
|
|
|
=. len (sub len (lent pre))
|
|
|
|
?. (gth lez len)
|
|
|
|
=. nez (welp pre nez)
|
|
|
|
?. (lth lez len) nez
|
|
|
|
(runt [(sub len lez) '-'] nez)
|
|
|
|
:(welp pre (scag (dec len) nez) "+")
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ pr-full (pr-show ~) ::< render full width
|
|
|
|
::
|
|
|
|
++ pr-show ::< render partner
|
|
|
|
::> renders a partner as text.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= moy/(unit ?)
|
|
|
|
^- tape
|
2017-04-24 18:30:01 +03:00
|
|
|
?- -.one
|
2017-04-24 21:17:56 +03:00
|
|
|
:: render circle (as glyph if we can).
|
2017-03-23 03:34:56 +03:00
|
|
|
$&
|
|
|
|
?~ moy
|
|
|
|
=+ cha=(~(get by nik) one ~ ~)
|
|
|
|
=- ?~(cha - "'{u.cha ~}' {-}")
|
2017-04-24 21:17:56 +03:00
|
|
|
~(cr-phat cr p.one)
|
|
|
|
(~(cr-curt cr p.one) u.moy)
|
2017-04-24 18:30:01 +03:00
|
|
|
:: render passport.
|
2017-03-23 03:34:56 +03:00
|
|
|
$|
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ pre ^- tape
|
|
|
|
?- -.p.one
|
|
|
|
$twitter "@t:"
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
?~ moy
|
|
|
|
(weld pre (trip p.p.one))
|
2017-04-24 18:30:01 +03:00
|
|
|
=. pre ?.(u.moy pre ['*' pre])
|
2017-04-21 18:37:10 +03:00
|
|
|
(pr-sigh 14 pre p.p.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
--
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar ::< audience renderer
|
|
|
|
::> used for representing audiences (sets of partners)
|
|
|
|
::> as tapes.
|
|
|
|
::
|
|
|
|
|_ ::> lix: members of the audience.
|
|
|
|
::
|
|
|
|
lix/(set partner)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-best ::< most relevant
|
|
|
|
::> find the most relevant partner in the set.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- (unit partner)
|
2017-03-23 03:34:56 +03:00
|
|
|
?~ lix ~
|
|
|
|
:- ~
|
|
|
|
|- ^- partner
|
2017-04-21 18:37:10 +03:00
|
|
|
=+ lef=`(unit partner)`ar-best(lix l.lix)
|
|
|
|
=+ rit=`(unit partner)`ar-best(lix r.lix)
|
2017-04-24 18:30:01 +03:00
|
|
|
=. n.lix ?~(lef n.lix (~(pr-best pr n.lix) u.lef))
|
|
|
|
=. n.lix ?~(rit n.lix (~(pr-best pr n.lix) u.rit))
|
2017-03-23 03:34:56 +03:00
|
|
|
n.lix
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-deaf ::< except for self
|
|
|
|
::> remove ourselves from the audience.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ .
|
|
|
|
.(lix (~(del in lix) `partner`[%& our.bol inbox]))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-maud ::< multiple audience
|
|
|
|
::> checks if there's multiple partners in the
|
|
|
|
::> audience via pattern matching.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- ?
|
2017-04-21 18:37:10 +03:00
|
|
|
=. . ar-deaf
|
2017-03-23 03:34:56 +03:00
|
|
|
!?=($@($~ {* $~ $~}) lix)
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-prom ::< render targets
|
|
|
|
::> render all partners, ordered by relevance.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tape
|
2017-04-21 18:37:10 +03:00
|
|
|
=. . ar-deaf
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ all
|
|
|
|
%+ sort `(list partner)`(~(tap in lix))
|
|
|
|
|= {a/partner b/partner}
|
|
|
|
(~(pr-beat pr a) b)
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ fir=&
|
|
|
|
|- ^- tape
|
|
|
|
?~ all ~
|
|
|
|
;: welp
|
|
|
|
?:(fir "" " ")
|
2017-04-24 18:30:01 +03:00
|
|
|
(~(pr-show pr i.all) ~)
|
2017-03-23 03:34:56 +03:00
|
|
|
$(all t.all, fir |)
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-whom ::< render sender
|
|
|
|
::> render sender as the most relevant partner.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
(~(pr-show pr (need ar-best)) ~ ar-maud)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-dire ::< direct message
|
|
|
|
::> returns true if partner is a mailbox of ours.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= pan/partner ^- ?
|
|
|
|
?& ?=($& -.pan)
|
2017-04-24 21:17:56 +03:00
|
|
|
=(hos.p.pan our.bol)
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ sot=(~(get by mirrors) +.pan)
|
2017-04-24 21:17:56 +03:00
|
|
|
&(?=(^ sot) ?=($brown sec.con.u.sot))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ ar-pref ::< audience glyph
|
|
|
|
::> get the glyph that corresponds to the audience,
|
|
|
|
::> with a space appended. for mailbox messages and
|
|
|
|
::> complex audiences, use reserved "glyphs".
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^- tape
|
|
|
|
=+ cha=(~(get by nik) lix)
|
|
|
|
?^ cha ~[u.cha ' ']
|
2017-04-24 18:30:01 +03:00
|
|
|
?. (lien (~(tap by lix)) ar-dire)
|
2017-03-23 03:34:56 +03:00
|
|
|
"* "
|
|
|
|
?: ?=({{$& ^} $~ $~} lix)
|
|
|
|
": "
|
|
|
|
"; "
|
|
|
|
--
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr ::< telegram renderer
|
|
|
|
::> responsible for converting telegrams and
|
|
|
|
::> everything relating to them to text to be
|
|
|
|
::> displayed in the cli.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|_ $: ::> sef: settings flags.
|
|
|
|
::> \ telegram
|
|
|
|
::> who: author.
|
|
|
|
::> \ thought
|
|
|
|
::> sen: unique identifier.
|
|
|
|
::> aud: audience.
|
|
|
|
::> \ statement
|
|
|
|
::> wen: timestamp.
|
|
|
|
::> bou: complete aroma.
|
|
|
|
::> sep: message contents.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
sef/(set knot)
|
|
|
|
who/ship
|
|
|
|
sen/serial
|
|
|
|
aud/audience
|
|
|
|
wen/@da
|
|
|
|
bou/bouquet
|
|
|
|
sep/speech
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
++ tr-fact ::< activate effect
|
|
|
|
::> produces sole-effect for printing message
|
|
|
|
::> details.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- sole-effect
|
2017-03-23 03:34:56 +03:00
|
|
|
~[%mor [%tan tr-meta] tr-body]
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-line ::< one-line print
|
|
|
|
::> crams a telegram into a single line by
|
|
|
|
::> displaying a short ship name, a short
|
|
|
|
::> representation of the gram, and an optional
|
|
|
|
::> timestamp.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tape
|
2017-04-21 18:37:10 +03:00
|
|
|
=+ txt=(tr-text =(who our.bol))
|
2017-03-23 03:34:56 +03:00
|
|
|
?: =(~ txt) ""
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ baw
|
|
|
|
:: ?: oug
|
|
|
|
:: ~(ar-whom ar tr-pals)
|
|
|
|
?. (~(has in sef) %noob)
|
2017-04-24 21:17:56 +03:00
|
|
|
(~(cr-curt cr [who (main who)]) |)
|
|
|
|
(~(cr-nick cr [who (main who)]))
|
2017-03-23 03:34:56 +03:00
|
|
|
?: (~(has in sef) %showtime)
|
2017-04-21 18:37:10 +03:00
|
|
|
=+ dat=(yore now.bol)
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ t
|
|
|
|
|= a/@
|
2017-03-23 03:34:56 +03:00
|
|
|
%+ weld
|
2017-04-24 18:30:01 +03:00
|
|
|
?: (lth a 10) "0" ~
|
|
|
|
(scow %ud a)
|
|
|
|
=/ time
|
|
|
|
;: weld
|
|
|
|
"~" (t h.t.dat)
|
|
|
|
"." (t m.t.dat)
|
|
|
|
"." (t s.t.dat)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
:(weld baw txt (reap (sub 67 (lent txt)) ' ') time)
|
|
|
|
(weld baw txt)
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-meta ::< metadata
|
|
|
|
::> builds string that display metadata, including
|
|
|
|
::> message serial, timestamp, author and audience.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tang
|
|
|
|
=. wen (sub wen (mod wen (div wen ~s0..0001))) :: round
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ hed=leaf+"{(scow %uv sen)} at {(scow %da wen)}"
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ paz
|
|
|
|
%+ turn (~(tap by aud))
|
|
|
|
|= {a/partner *}
|
|
|
|
leaf+~(pr-full pr a)
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ bok=(turn (sort (~(tap in bou)) aor) smyt)
|
|
|
|
[%rose [" " ~ ~] [hed >who< [%rose [", " "to " ~] paz] bok]]~
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-body ::< message content
|
|
|
|
::> long-form display of message contents, specific
|
|
|
|
::> to each speech type.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|- ^- sole-effect
|
2017-04-24 18:30:01 +03:00
|
|
|
?+ -.sep
|
|
|
|
tan+[>sep<]~
|
|
|
|
::
|
|
|
|
$non
|
|
|
|
tan+~
|
|
|
|
::
|
|
|
|
$lin
|
2017-04-24 21:17:56 +03:00
|
|
|
tan+~[leaf+"{?:(pat.sep "" "@ ")}{(trip msg.sep)}"]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$url
|
2017-04-24 21:17:56 +03:00
|
|
|
url+(crip (earf url.sep))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$exp
|
2017-04-24 21:17:56 +03:00
|
|
|
tan+~[leaf+"# {(trip exp.sep)}"]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$fat
|
2017-04-24 21:17:56 +03:00
|
|
|
[%mor $(sep sep.sep) tan+(tr-tors tac.sep) ~]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$inv
|
|
|
|
:- %tan
|
|
|
|
:_ ~
|
|
|
|
:- %leaf
|
|
|
|
%+ weld
|
2017-04-24 21:17:56 +03:00
|
|
|
?: inv.sep
|
2017-04-24 18:30:01 +03:00
|
|
|
"you have been invited to "
|
|
|
|
"you have been banished from "
|
2017-04-24 21:17:56 +03:00
|
|
|
~(cr-phat cr sat.sep)
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$mor
|
2017-04-24 21:17:56 +03:00
|
|
|
mor+(turn ses.sep |=(speech ^$(sep +<)))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$app
|
2017-04-24 21:17:56 +03:00
|
|
|
tan+~[rose+[": " ~ ~]^~[leaf+"[{(trip app.sep)}]" leaf+(trip msg.sep)]]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$api
|
|
|
|
:- %tan
|
|
|
|
:_ ~
|
|
|
|
:+ %rose
|
|
|
|
[": " ~ ~]
|
|
|
|
:~ leaf+"[{(trip id.sep)} on {(trip service.sep)}]"
|
|
|
|
leaf+(trip body.sep)
|
|
|
|
leaf+(earf url.sep)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-tors ::< attachment
|
|
|
|
::> renders an attachment.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= a/torso
|
|
|
|
^- tang
|
2017-03-23 03:34:56 +03:00
|
|
|
?- -.a
|
2017-04-24 21:17:56 +03:00
|
|
|
$name (welp $(a tac.a) leaf+"={(trip nom.a)}" ~)
|
2017-03-23 03:34:56 +03:00
|
|
|
$tank +.a
|
|
|
|
$text (turn (flop +.a) |=(b/cord leaf+(trip b)))
|
|
|
|
==
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-pals ::< aud w/o delivery
|
|
|
|
::> strip delivery info from audience, producing a
|
|
|
|
::> plain set of partners.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^- (set partner)
|
|
|
|
%- ~(gas in *(set partner))
|
2017-04-24 18:30:01 +03:00
|
|
|
%+ turn (~(tap by aud))
|
|
|
|
|=({a/partner *} a)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-chow ::< truncate
|
|
|
|
::> truncates the {txt} to be of max {len}
|
|
|
|
::> characters. if it does truncate, indicates it
|
|
|
|
::> did so by appending _ or ….
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {len/@u txt/tape}
|
|
|
|
^- tape
|
2017-03-23 03:34:56 +03:00
|
|
|
?: (gth len (lent txt)) txt
|
|
|
|
=. txt (scag len txt)
|
|
|
|
|-
|
|
|
|
?~ txt txt
|
|
|
|
?: =(' ' i.txt)
|
|
|
|
|-(['_' ?.(?=({$' ' *} t.txt) t.txt $(txt t.txt))])
|
|
|
|
?~ t.txt "…"
|
|
|
|
[i.txt $(txt t.txt)]
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-both ::< two tapes one line
|
|
|
|
::> attempts to fit two tapes into a 64-char line.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {a/tape b/tape}
|
|
|
|
^- tape
|
2017-03-23 03:34:56 +03:00
|
|
|
?: (gth (lent a) 62) (tr-chow 64 a)
|
|
|
|
%+ weld a
|
|
|
|
(tr-chow (sub 64 (lent a)) " {b}")
|
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ tr-text ::< one line contents
|
|
|
|
::> renders a single-line version of the message.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= oug/?
|
|
|
|
^- tape
|
2017-04-24 18:30:01 +03:00
|
|
|
?+ -.sep
|
|
|
|
~&(tr-lost+sep "")
|
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$mor
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ ses.sep ~&(%tr-mor-empty "")
|
2017-03-23 03:34:56 +03:00
|
|
|
|- ^- tape
|
2017-04-24 21:17:56 +03:00
|
|
|
?~ t.ses.sep ^$(sep i.ses.sep)
|
|
|
|
(tr-both ^$(sep i.ses.sep) $(ses.sep t.ses.sep))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$fat
|
2017-04-24 21:17:56 +03:00
|
|
|
%+ tr-both $(sep sep.sep)
|
|
|
|
?+ -.tac.sep "..."
|
|
|
|
$tank ~(ram re %rose [" " `~] +.tac.sep)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$exp
|
2017-04-24 21:17:56 +03:00
|
|
|
(tr-chow 66 '#' ' ' (trip exp.sep))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
$url
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ ful=(earf url.sep)
|
2017-04-24 18:30:01 +03:00
|
|
|
?: (gth 64 (lent ful)) ['/' ' ' ful]
|
|
|
|
:+ '/' '_'
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ hok=r.p.p.url.sep
|
2017-04-24 18:30:01 +03:00
|
|
|
~! hok
|
|
|
|
=- (swag [a=(sub (max 64 (lent -)) 64) b=64] -)
|
|
|
|
^- tape
|
|
|
|
=< ?: ?=($& -.hok)
|
|
|
|
(reel p.hok .)
|
|
|
|
+:(scow %if p.hok)
|
|
|
|
|= {a/knot b/tape}
|
|
|
|
?~ b (trip a)
|
|
|
|
(welp b '.' (trip a))
|
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$lin
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ txt=(trip msg.sep)
|
|
|
|
?: pat.sep
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ pal=tr-pals
|
2017-04-24 18:30:01 +03:00
|
|
|
=. pal ?: =(who our.bol) pal ::TODO =?
|
2017-03-23 03:34:56 +03:00
|
|
|
(~(del in pal) [%& who (main who)])
|
2017-04-24 18:30:01 +03:00
|
|
|
(weld ~(ar-pref ar pal) txt)
|
2017-03-23 03:34:56 +03:00
|
|
|
(weld " " txt)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-10 23:35:25 +03:00
|
|
|
$inv
|
|
|
|
%+ weld
|
2017-04-24 21:17:56 +03:00
|
|
|
?: inv.sep
|
2017-04-10 23:35:25 +03:00
|
|
|
" invited you to "
|
|
|
|
" banished you from "
|
2017-04-24 21:17:56 +03:00
|
|
|
~(cr-phat cr sat.sep)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$app
|
2017-04-24 21:17:56 +03:00
|
|
|
(tr-chow 64 "[{(trip app.sep)}]: {(trip msg.sep)}")
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$api
|
2017-04-24 18:30:01 +03:00
|
|
|
%+ tr-chow 64
|
|
|
|
%+ weld
|
|
|
|
"[{(trip id.sep)}@{(trip service.sep)}]: "
|
|
|
|
(trip summary.sep)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
::> ||
|
|
|
|
::> || %events
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ peer ::< accept subscription
|
|
|
|
::> incoming subscription on pax.
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
|
|
|
^- (quip move +>)
|
2017-04-21 18:37:10 +03:00
|
|
|
?. (team src.bol our.bol)
|
|
|
|
~& [%peer-talk-reader-stranger src.bol]
|
2017-03-28 00:17:09 +03:00
|
|
|
[~ +>]
|
|
|
|
?. ?=({$sole *} pax)
|
|
|
|
~& [%peer-talk-reader-strange pax]
|
|
|
|
[~ +>]
|
2017-04-24 18:30:01 +03:00
|
|
|
ta-done:ta-console:ta
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ diff-talk-lowdown ::< accept lowdown
|
|
|
|
::> 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.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
|= {way/wire low/lowdown}
|
2017-04-21 18:37:10 +03:00
|
|
|
ta-done:(ta-low:ta low)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ diff-talk-reaction ::< accept reaction
|
|
|
|
::> incoming talk reaction. process it.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
|
|
|
|= {way/wire rac/reaction}
|
2017-04-21 18:37:10 +03:00
|
|
|
?. =(src.bol -:(broker our.bol))
|
|
|
|
~& [%diff-reaction-stranger src.bol]
|
2017-04-10 23:24:25 +03:00
|
|
|
[~ +>]
|
2017-04-21 18:37:10 +03:00
|
|
|
ta-done:(ta-reaction:ta rac)
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
++ poke-sole-action ::< accept console
|
|
|
|
::> incoming sole action. process it.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
|= act/sole-action
|
2017-04-21 18:37:10 +03:00
|
|
|
ta-done:(ta-sole:ta act)
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|