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
|
|
|
|
::TODO rename cores. pa->ta (transaction), ta->pa (partner), etc.
|
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-12 21:09:23 +03:00
|
|
|
::TODO remove man from door sample where it's always (main our.hid).
|
2017-04-11 23:36:11 +03:00
|
|
|
::TODO maybe collapse sources, remotes and mirrors into a single map?
|
|
|
|
::TODO maybe keep track of received grams per partner, too?
|
|
|
|
::
|
2017-04-12 14:14:09 +03:00
|
|
|
::x This reader implementation makes use of the mailbox for all its
|
2017-04-12 23:37:37 +03:00
|
|
|
::x subscriptions and messaging. All lowdowns received are exclusively about
|
|
|
|
::x the mailbox, since that's the only thing the reader ever subscribes to.
|
2017-04-12 14:14:09 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
/? 310 :: hoon version
|
|
|
|
/- talk, sole :: structures
|
|
|
|
/+ talk, sole, time-to-id, twitter :: libraries
|
|
|
|
/= 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-03-23 03:34:56 +03:00
|
|
|
=> |% :: data structures
|
2017-03-24 01:10:28 +03:00
|
|
|
++ chattel :: full state
|
2017-04-11 23:36:11 +03:00
|
|
|
$: :: messaging state ::
|
|
|
|
count/@ud :: (lent grams)
|
|
|
|
grams/(list telegram) :: all history
|
|
|
|
known/(map serial @ud) :: messages heard
|
|
|
|
sources/(set partner) :: our subscriptions
|
|
|
|
:: partner details ::
|
2017-04-04 01:14:06 +03:00
|
|
|
remotes/(map partner atlas) :: remote presences
|
|
|
|
mirrors/(map station config) :: remote configs
|
2017-04-11 23:36:11 +03:00
|
|
|
:: ui state ::
|
2017-03-23 03:34:56 +03:00
|
|
|
folks/(map ship human) :: human identities
|
|
|
|
nik/(map (set partner) char) :: bound station glyphs
|
|
|
|
nak/(jug char (set partner)) :: station glyph lookup
|
2017-03-30 15:17:37 +03:00
|
|
|
cli/shell :: interaction state
|
2017-03-24 01:10:28 +03:00
|
|
|
== ::
|
2017-03-23 03:34:56 +03:00
|
|
|
++ shell :: console session
|
2017-03-30 19:04:47 +03:00
|
|
|
$: id/bone :: identifier
|
2017-03-23 03:34:56 +03:00
|
|
|
count/@ud :: messages shown
|
|
|
|
say/sole-share :: console state
|
2017-03-27 13:52:30 +03:00
|
|
|
active/(set partner) :: active targets
|
2017-03-23 03:34:56 +03:00
|
|
|
settings/(set knot) :: frontend settings
|
|
|
|
== ::
|
2017-03-24 23:10:27 +03:00
|
|
|
:: ::
|
|
|
|
++ move (pair bone card) :: all actions
|
2017-03-27 16:27:08 +03:00
|
|
|
++ lime :: diff fruit
|
|
|
|
$% {$talk-report report} ::
|
|
|
|
{$sole-effect sole-effect} ::
|
|
|
|
== ::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ pear :: poke fruit
|
|
|
|
$% {$talk-command command} ::
|
2017-04-10 23:24:25 +03:00
|
|
|
{$talk-action action} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
== ::
|
|
|
|
++ card :: general card
|
|
|
|
$% {$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
|
|
|
== ::
|
|
|
|
++ work :: interface action
|
|
|
|
$% {$number p/$@(@ud {@u @ud})} :: relative/absolute
|
|
|
|
{$help $~} :: print usage info
|
|
|
|
{$who p/where} :: presence
|
|
|
|
{$what p/$@(char (set partner))} :: show bound glyph
|
|
|
|
{$bind p/char q/(unit where)} ::
|
2017-04-18 15:29:17 +03:00
|
|
|
{$unbind p/char q/(unit where)} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
{$join p/where} ::
|
|
|
|
{$leave p/where} ::
|
|
|
|
{$say p/(list speech)} ::
|
|
|
|
{$eval p/cord q/twig} ::
|
2017-04-10 23:35:25 +03:00
|
|
|
{$invite p/knot q/(set ship)} :: give permission
|
|
|
|
{$banish p/knot q/(set ship)} :: deny permission
|
2017-03-24 23:10:27 +03:00
|
|
|
{$nick p/(unit ship) q/(unit cord)} ::
|
|
|
|
{$set p/knot} ::
|
|
|
|
{$unset p/knot} ::
|
|
|
|
{$target p/where q/(unit work)} :: set active targets
|
|
|
|
:: {$destroy p/knot} ::
|
|
|
|
{$create p/posture q/knot r/cord} ::
|
2017-04-14 17:16:36 +03:00
|
|
|
{$depict p/knot q/cord} ::
|
|
|
|
{$source p/knot q/(set partner)} ::
|
|
|
|
{$delete p/knot q/(unit cord)} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
{$probe p/station} ::
|
|
|
|
== ::
|
2017-03-27 16:27:08 +03:00
|
|
|
++ weir :: parsed wire
|
|
|
|
$% {$repeat p/@ud q/@p r/knot} ::
|
|
|
|
{$friend p/knot q/station} ::
|
|
|
|
== ::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ where (set partner) :: non-empty audience
|
|
|
|
++ glyphs `wall`~[">=+-" "}),." "\"'`^" "$%&@"] :: station char pool'
|
2017-03-27 15:52:53 +03:00
|
|
|
++ broker :: broker ship and name
|
|
|
|
|= our/ship
|
|
|
|
:_ %talk-guardian
|
|
|
|
?. =((clan our) %earl)
|
|
|
|
our
|
|
|
|
(sein our)
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-03-24 01:10:28 +03:00
|
|
|
|_ {hid/bowl chattel}
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ ra :: per transaction
|
|
|
|
::x gets called when talk gets poked or otherwise prompted/needs to perform
|
|
|
|
::x an action.
|
|
|
|
::x arms generally modify state, and store moves in ++ra's moves. these get
|
|
|
|
::x produced when calling ++ra-abet.
|
|
|
|
::x in applying commands and making reports, it uses ++pa for story work.
|
|
|
|
::
|
|
|
|
::x moves: moves storage, added to by ++ra-emit and -emil, produced by -abed.
|
|
|
|
|_ moves/(list move)
|
|
|
|
::
|
2017-03-30 15:17:37 +03:00
|
|
|
++ ra-abet :: resolve core
|
2017-03-24 23:10:27 +03:00
|
|
|
::x produces the moves stored in ++ra's moves.
|
|
|
|
::x sole-effects get special treatment to become a single move.
|
|
|
|
::
|
|
|
|
^+ [*(list move) +>]
|
|
|
|
:_ +>
|
|
|
|
::x seperate our sole-effects from other moves.
|
|
|
|
=+ ^= yop
|
|
|
|
|- ^- (pair (list move) (list sole-effect))
|
|
|
|
?~ moves [~ ~]
|
|
|
|
=+ mor=$(moves t.moves)
|
2017-03-29 14:00:44 +03:00
|
|
|
?: ?& =(id.cli p.i.moves)
|
2017-03-24 23:10:27 +03:00
|
|
|
?=({$diff $sole-effect *} q.i.moves)
|
|
|
|
==
|
|
|
|
[p.mor [+>.q.i.moves q.mor]]
|
|
|
|
[[i.moves p.mor] q.mor]
|
|
|
|
::x 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 `[%mor (flop `(list sole-effect)`q.yop)])
|
|
|
|
==
|
2017-03-29 14:00:44 +03:00
|
|
|
?~ foc
|
|
|
|
moz
|
|
|
|
?~ id.cli
|
|
|
|
~& %no-sole
|
|
|
|
moz
|
2017-03-24 23:10:27 +03:00
|
|
|
::x produce moves or sole-effects and moves.
|
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-10 23:24:25 +03:00
|
|
|
++ ra-reaction
|
|
|
|
::x process a talk reaction.
|
|
|
|
::
|
|
|
|
|= rac/reaction
|
|
|
|
^+ +>
|
2017-04-11 14:08:15 +03:00
|
|
|
sh-abet:(~(sh-reaction sh cli (main our.hid)) rac)
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-04 22:52:05 +03:00
|
|
|
++ ra-low
|
2017-03-29 01:11:12 +03:00
|
|
|
::x process 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-04 22:55:05 +03:00
|
|
|
$glyph (ra-low-glyph +.low)
|
|
|
|
$names (ra-low-names +.low)
|
2017-04-11 18:01:25 +03:00
|
|
|
$confs (ra-low-confs +.low)
|
2017-04-04 22:55:05 +03:00
|
|
|
$precs (ra-low-precs +.low)
|
|
|
|
$grams (ra-low-grams +.low)
|
2017-03-29 01:11:12 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-04 22:52:05 +03:00
|
|
|
++ ra-low-glyph
|
2017-03-29 01:11:12 +03:00
|
|
|
::x apply new set of glyph bindings.
|
|
|
|
::
|
|
|
|
|= nek/_nak
|
|
|
|
^+ +>
|
2017-03-31 00:56:48 +03:00
|
|
|
?: =(nek nak)
|
|
|
|
+>
|
2017-03-29 01:11:12 +03:00
|
|
|
=. nak nek
|
|
|
|
=. nik %- ~(gas by *(map (set partner) char))
|
|
|
|
=- (zing `(list (list {(set partner) char}))`-)
|
|
|
|
%+ turn (~(tap by nek))
|
|
|
|
|= {a/char b/(set (set partner))}
|
|
|
|
(turn (~(tap by b)) |=(c/(set partner) [c a]))
|
2017-04-11 14:08:15 +03:00
|
|
|
sh-abet:~(sh-prod sh cli (main our.hid))
|
2017-03-27 15:52:53 +03:00
|
|
|
::
|
2017-04-04 22:52:05 +03:00
|
|
|
++ ra-low-names
|
2017-03-29 01:11:12 +03:00
|
|
|
::x apply 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-03-29 01:11:12 +03:00
|
|
|
%= +> folks
|
|
|
|
%- ~(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)}
|
|
|
|
?~ h ~
|
|
|
|
(some [s u.h])
|
|
|
|
==
|
2017-04-04 01:14:06 +03:00
|
|
|
::
|
2017-04-11 18:01:25 +03:00
|
|
|
++ ra-low-confs
|
2017-04-12 23:37:37 +03:00
|
|
|
|= {coy/(unit config) cofs/(map station (unit config))}
|
2017-04-04 01:14:06 +03:00
|
|
|
^+ +>
|
2017-04-12 16:09:24 +03:00
|
|
|
::x if possible, update sources. if we do, and we gain new ones, update
|
|
|
|
::x the prompt. (this is to remove the mailbox from the audience after
|
|
|
|
::x creating or joining a new station.)
|
2017-04-12 23:37:37 +03:00
|
|
|
?~ coy ~&(%mailbox-deleted !!)
|
|
|
|
=. +> ::TODO =?
|
|
|
|
?~ (~(dif in sources.u.coy) sources) +>.$
|
|
|
|
=< sh-abet
|
|
|
|
%- ~(sh-pact sh(sources sources.u.coy) cli (main our.hid))
|
|
|
|
(~(dif in sources.u.coy) sources)
|
|
|
|
=. sources sources.u.coy
|
|
|
|
=. cofs (~(put by cofs) [our.hid (main our.hid)] coy)
|
|
|
|
=. +>.$
|
2017-04-12 21:09:23 +03:00
|
|
|
=< sh-abet
|
|
|
|
%+ roll (~(tap by cofs))
|
|
|
|
|= {{s/station c/(unit config)} core/_sh}
|
|
|
|
(~(sh-low-config core cli (main our.hid)) s (~(get by mirrors) s) c)
|
2017-04-11 18:01:25 +03:00
|
|
|
::TODO fix sh-low-remco to print properly.
|
2017-04-11 23:36:11 +03:00
|
|
|
::TODO actually delete ~ configs.
|
2017-04-12 21:09:23 +03:00
|
|
|
::=/ cogs/_mirrors (~(run by cofs) |=(a/(unit config) (fall a *config)))
|
|
|
|
::=. +>.$ sh-abet:(~(sh-low-remco sh cli (main our.hid)) mirrors cogs)
|
|
|
|
=. mirrors
|
|
|
|
%- ~(gas by *_mirrors)
|
|
|
|
%+ murn (~(tap by cofs))
|
|
|
|
|= {s/station c/(unit config)}
|
|
|
|
^- (unit (pair station config))
|
|
|
|
?~(c ~ `[s u.c])
|
2017-04-11 18:01:25 +03:00
|
|
|
+>.$
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-04 22:52:05 +03:00
|
|
|
++ ra-low-precs
|
2017-04-18 15:29:58 +03:00
|
|
|
::x applies new presences. other clients might care for tas, but we're only
|
|
|
|
::x ever getting this for the mailbox, where we're the only ones present.
|
|
|
|
::
|
2017-04-12 23:37:37 +03:00
|
|
|
|= {tas/atlas pas/(map partner atlas)}
|
2017-04-04 01:14:06 +03:00
|
|
|
^+ +>
|
2017-04-18 15:29:58 +03:00
|
|
|
=/ ner/_remotes
|
|
|
|
:: per-partner uni.
|
|
|
|
%- ~(urn by pas)
|
|
|
|
|= {p/partner a/atlas}
|
|
|
|
=+ o=(~(get by remotes) p)
|
|
|
|
?~(o a (~(uni by u.o) a))
|
|
|
|
:: then fill in the gaps with what we know.
|
|
|
|
=. ner (~(uni by remotes) ner)
|
2017-04-04 01:14:06 +03:00
|
|
|
?: =(remotes ner) +>.$
|
2017-04-12 23:37:37 +03:00
|
|
|
=. +>.$ sh-abet:(~(sh-low-rempe sh cli (main our.hid)) remotes ner)
|
|
|
|
+>.$(remotes ner)
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-04 22:52:05 +03:00
|
|
|
++ ra-low-grams
|
2017-03-29 01:11:12 +03:00
|
|
|
::x apply new grams
|
|
|
|
::
|
2017-04-12 23:37:37 +03:00
|
|
|
|= {num/@ud gams/(list telegram)}
|
2017-03-30 15:14:30 +03:00
|
|
|
^+ +>
|
2017-04-11 23:51:47 +03:00
|
|
|
=. +>.$ sh-abet:(~(sh-low-grams sh cli (main our.hid)) num gams)
|
2017-04-11 23:36:11 +03:00
|
|
|
(ra-lesson gams)
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-03-27 15:52:53 +03:00
|
|
|
++ ra-emil :: ra-emit move list
|
|
|
|
::x adds multiple moves to the core's list. flops to emulate ++ra-emit.
|
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
|
|
|
++ ra-emit :: emit a move
|
|
|
|
::x adds a move to the core's list.
|
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ ra-sole
|
|
|
|
::x applies sole-action.
|
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
2017-03-28 00:11:25 +03:00
|
|
|
?. =(id.cli ost.hid)
|
|
|
|
~& %strange-sole
|
2017-03-24 23:10:27 +03:00
|
|
|
!!
|
2017-04-11 14:08:15 +03:00
|
|
|
sh-abet:(~(sh-sole sh cli (main our.hid)) act)
|
2017-03-28 00:11:25 +03:00
|
|
|
::
|
|
|
|
++ ra-console
|
|
|
|
::x make a shell for her.
|
|
|
|
::
|
|
|
|
|= {her/ship pax/path}
|
2017-03-30 15:17:37 +03:00
|
|
|
~& [%ra-console her pax ost.hid]
|
2017-03-28 00:11:25 +03:00
|
|
|
^+ +>
|
|
|
|
::x get story from the path, default to standard mailbox.
|
|
|
|
=/ man/knot
|
|
|
|
?+ pax !!
|
|
|
|
$~ (main her)
|
|
|
|
{@ta $~} i.pax
|
|
|
|
==
|
|
|
|
=/ she/shell
|
2017-03-30 19:04:47 +03:00
|
|
|
%*(. *shell id ost.hid, active (sy [%& our.hid man] ~))
|
2017-04-11 14:08:15 +03:00
|
|
|
sh-abet:~(sh-prod sh she man)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-03-28 00:17:09 +03:00
|
|
|
++ ra-init
|
|
|
|
::x populate state on first boot. subscribes to our broker.
|
|
|
|
::
|
2017-03-30 15:17:37 +03:00
|
|
|
~& [%r-ra-init ost.hid]
|
2017-03-28 00:17:09 +03:00
|
|
|
%- ra-emit
|
|
|
|
:* ost.hid
|
|
|
|
%peer
|
2017-04-12 23:37:37 +03:00
|
|
|
/ ::x return/diff path
|
2017-03-28 00:17:09 +03:00
|
|
|
(broker our.hid)
|
2017-04-12 23:37:37 +03:00
|
|
|
/reader/(main our.hid) ::x peer path
|
2017-03-28 00:17:09 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
++ ra-lesson :: learn multiple
|
|
|
|
::x 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 +>
|
|
|
|
$(gaz t.gaz, +> (ra-learn i.gaz))
|
|
|
|
::
|
|
|
|
++ ra-learn :: learn message
|
|
|
|
::x store an incoming telegram, modifying audience to say we received it.
|
|
|
|
::x update existing telegram if it already exists.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
|
|
|
=+ old=(~(get by known) p.q.gam)
|
|
|
|
?~ old
|
|
|
|
(ra-append gam) ::x add
|
|
|
|
(ra-revise u.old gam) ::x modify
|
|
|
|
::
|
|
|
|
++ ra-append :: append new gram
|
|
|
|
::x add gram to our story, and update our subscribers.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
|
|
|
%= +>
|
|
|
|
grams [gam grams]
|
|
|
|
count +(count)
|
|
|
|
known (~(put by known) p.q.gam count)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ra-revise :: revise existing gram
|
|
|
|
::x modify a gram in our story, and update our subscribers.
|
|
|
|
::
|
|
|
|
|= {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-03-24 23:10:27 +03:00
|
|
|
++ sh :: per console
|
|
|
|
::x shell core, responsible for doing things with console sessions,
|
|
|
|
::x like parsing input, acting based on input, showing output, keeping
|
|
|
|
::x track of settings and other frontend state.
|
|
|
|
::x important arms include ++sh-repo which is used to apply reports, and
|
|
|
|
::x ++sh-sole which gets called upon cli prompt interaction.
|
|
|
|
::
|
2017-04-11 14:08:15 +03:00
|
|
|
|_ $: ::x she: console session state used in this core.
|
|
|
|
::x man: our mailbox
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
she/shell
|
2017-03-30 19:04:47 +03:00
|
|
|
man/knot
|
2017-03-24 23:10:27 +03:00
|
|
|
==
|
|
|
|
++ sh-scad :: command parser
|
|
|
|
::x builds a core with parsers for talk-cli, and produces its work arm.
|
|
|
|
::x ++work uses those parsers to parse the current talk-cli prompt input
|
|
|
|
::x and produce a work item to be executed by ++sh-work.
|
|
|
|
::
|
|
|
|
=< work
|
|
|
|
|%
|
|
|
|
++ expr :: [cord twig]
|
|
|
|
|= tub/nail %. tub
|
|
|
|
%+ stag (crip q.tub)
|
|
|
|
wide:(vang & [&1:% &2:% (scot %da now.hid) |3:%])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ dare :: @dr
|
|
|
|
%+ sear
|
|
|
|
|= a/coin
|
|
|
|
?. ?=({$$ $dr @} a) ~
|
|
|
|
(some `@dr`+>.a)
|
|
|
|
nuck:so
|
|
|
|
::
|
|
|
|
++ ship ;~(pfix sig fed:ag) :: ship
|
|
|
|
++ shiz :: ship set
|
|
|
|
%+ cook
|
|
|
|
|=(a/(list ^ship) (~(gas in *(set ^ship)) a))
|
|
|
|
(most ;~(plug com (star ace)) ship)
|
|
|
|
::
|
|
|
|
++ pasp :: passport
|
|
|
|
;~ pfix pat
|
|
|
|
;~ pose
|
|
|
|
(stag %twitter ;~(pfix (jest 't') col urs:ab))
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-04-17 14:14:04 +03:00
|
|
|
++ stat :: local station
|
|
|
|
;~(pfix cen sym)
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ stan :: station
|
2017-03-23 03:34:56 +03:00
|
|
|
;~ pose
|
2017-03-30 19:04:47 +03:00
|
|
|
(cold [our.hid (main our.hid)] col)
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(pfix cen (stag our.hid sym))
|
|
|
|
;~(pfix fas (stag (sein our.hid) sym))
|
|
|
|
::
|
|
|
|
%+ 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
|
|
|
::
|
|
|
|
++ parn :: partner
|
|
|
|
;~ pose
|
|
|
|
(stag %& stan)
|
|
|
|
(stag %| pasp)
|
|
|
|
==
|
|
|
|
++ partners-flat :: collapse mixed list
|
|
|
|
|= 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-03-24 23:10:27 +03:00
|
|
|
++ para :: partners alias
|
|
|
|
%+ cook partners-flat
|
|
|
|
%+ most ;~(plug com (star ace))
|
|
|
|
(pick parn (sear sh-glyf glyph))
|
|
|
|
::
|
|
|
|
++ parz :: non-empty partners
|
|
|
|
%+ cook ~(gas in *(set partner))
|
|
|
|
(most ;~(plug com (star ace)) parn)
|
|
|
|
::
|
|
|
|
++ nump :: number reference
|
|
|
|
;~ pose
|
|
|
|
;~(pfix hep dem:ag)
|
|
|
|
;~ plug
|
|
|
|
(cook lent (plus (just '0')))
|
|
|
|
;~(pose dem:ag (easy 0))
|
|
|
|
==
|
|
|
|
(stag 0 dem:ag)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ pore :: posture
|
|
|
|
;~ 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-03-24 23:10:27 +03:00
|
|
|
++ message
|
|
|
|
;~ 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))
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ nick (cook crip (stun [1 14] low)) :: nickname
|
|
|
|
++ text (cook crip (plus (shim ' ' '~'))) :: bullets separating
|
|
|
|
++ glyph (mask "/\\\{(<!?{(zing glyphs)}") :: station postfix
|
|
|
|
++ setting
|
|
|
|
%- perk :~
|
|
|
|
%noob
|
|
|
|
%quiet
|
|
|
|
%showtime
|
|
|
|
==
|
|
|
|
++ work
|
|
|
|
%+ knee *^work |. ~+
|
|
|
|
=- ;~(pose ;~(pfix sem -) message)
|
|
|
|
;~ pose
|
|
|
|
;~ (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-10 23:35:25 +03:00
|
|
|
::
|
2017-04-17 14:14:04 +03:00
|
|
|
;~((glue ace) (perk %invite ~) stat shiz)
|
|
|
|
;~((glue ace) (perk %banish ~) stat shiz)
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-04-17 14:14:04 +03:00
|
|
|
;~((glue ace) (perk %depict ~) stat qut)
|
|
|
|
;~((glue ace) (perk %source ~) stat parz)
|
2017-04-14 17:16:36 +03:00
|
|
|
;~ plug (perk %delete ~)
|
|
|
|
;~(pfix ;~(plug ace cen) sym)
|
|
|
|
;~ pose
|
|
|
|
(cook some ;~(pfix ace qut))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
;~(plug (perk %who ~) ;~(pose ;~(pfix ace para) (easy ~)))
|
|
|
|
;~(plug (perk %bind ~) ;~(pfix ace glyph) (punt ;~(pfix ace para)))
|
2017-04-18 15:29:17 +03:00
|
|
|
;~(plug (perk %unbind ~) ;~(pfix ace glyph) (punt ;~(pfix ace para)))
|
2017-03-24 23:10:27 +03:00
|
|
|
;~((glue ace) (perk %join ~) para)
|
|
|
|
;~((glue ace) (perk %leave ~) para)
|
|
|
|
;~((glue ace) (perk %what ~) ;~(pose parz glyph))
|
|
|
|
::
|
|
|
|
;~ 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-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
;~(plug (perk %set ~) ;~(pose ;~(pfix ace setting) (easy %$)))
|
|
|
|
;~(plug (perk %unset ~) ;~(pfix ace setting))
|
|
|
|
::
|
|
|
|
;~(plug (perk %help ~) (easy ~))
|
|
|
|
(stag %number nump)
|
|
|
|
(stag %target ;~(plug para (punt ;~(pfix ace message))))
|
|
|
|
(stag %number (cook lent (star sem)))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|
|
|
|
++ sh-abet
|
2017-04-11 14:08:15 +03:00
|
|
|
::x stores changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
^+ +> ::x points to ++sh's |_ core's context.
|
2017-04-11 14:08:15 +03:00
|
|
|
+>(cli she)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-fact :: send console effect
|
|
|
|
::x adds a console effect to ++ra's moves.
|
|
|
|
::
|
|
|
|
|= fec/sole-effect
|
|
|
|
^+ +>
|
2017-03-29 14:00:44 +03:00
|
|
|
+>(moves :_(moves [id.she %diff %sole-effect fec]))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-11 14:00:13 +03:00
|
|
|
++ sh-action
|
|
|
|
::x adds a talk-action to ++ra's moves
|
2017-03-25 02:24:55 +03:00
|
|
|
::
|
2017-04-11 14:00:13 +03:00
|
|
|
|= act/action
|
2017-03-25 02:24:55 +03:00
|
|
|
^+ +>
|
2017-03-27 15:52:53 +03:00
|
|
|
%= +>
|
2017-04-11 14:00:13 +03:00
|
|
|
moves
|
|
|
|
:_ moves
|
|
|
|
:* ost.hid
|
|
|
|
%poke
|
|
|
|
/reader/action
|
|
|
|
(broker our.hid)
|
|
|
|
[%talk-action act]
|
|
|
|
==
|
2017-03-27 15:52:53 +03:00
|
|
|
==
|
2017-03-25 02:24:55 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-prod :: show prompt
|
|
|
|
::x make and store a move to modify the cli prompt, displaying audience.
|
|
|
|
::
|
|
|
|
^+ .
|
|
|
|
%+ sh-fact %pro
|
|
|
|
:+ & %talk-line
|
|
|
|
^- tape
|
|
|
|
=/ rew/(pair (pair @t @t) (set partner))
|
2017-03-27 13:52:30 +03:00
|
|
|
[['[' ']'] active.she]
|
2017-03-24 23:10:27 +03:00
|
|
|
=+ cha=(~(get by nik) q.rew)
|
|
|
|
?^ cha ~[u.cha ' ']
|
|
|
|
:: ~& [rew nik nak]
|
2017-03-30 19:04:47 +03:00
|
|
|
=+ por=~(te-prom te man q.rew)
|
2017-03-24 23:10:27 +03:00
|
|
|
(weld `tape`[p.p.rew por] `tape`[q.p.rew ' ' ~])
|
|
|
|
::
|
|
|
|
++ sh-pact :: update active aud
|
|
|
|
::x change currently selected audience to lix, updating prompt.
|
|
|
|
::
|
|
|
|
|= lix/(set partner)
|
|
|
|
^+ +>
|
|
|
|
=+ act=(sh-pare lix) ::x ensure we can see what we send.
|
2017-03-27 13:52:30 +03:00
|
|
|
?: =(active.she act) +>.$
|
|
|
|
sh-prod(active.she act)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ sh-pare :: adjust target list
|
|
|
|
::x if the audience paz does not contain a partner we're subscribed to,
|
|
|
|
::x add our mailbox to the audience (so that we can see our own message).
|
|
|
|
::
|
|
|
|
|= paz/(set partner)
|
|
|
|
?: (sh-pear paz) paz
|
2017-03-30 19:04:47 +03:00
|
|
|
(~(put in paz) [%& our.hid (main our.hid)])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-pear :: hearback
|
|
|
|
::x produces true if any partner is included in our subscriptions,
|
|
|
|
::x aka, if we hear messages sent to paz.
|
|
|
|
::
|
|
|
|
|= paz/(set partner)
|
|
|
|
?~ paz |
|
2017-04-11 23:36:11 +03:00
|
|
|
?| (~(has in sources) `partner`n.paz)
|
2017-04-04 16:40:59 +03:00
|
|
|
$(paz l.paz)
|
2017-03-24 23:10:27 +03:00
|
|
|
$(paz r.paz)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-pest :: report listen
|
|
|
|
::x updates audience to be tay, only if tay is not a village/%white.
|
|
|
|
::x? why exclude village (invite-only?) audiences from this?
|
|
|
|
::
|
2017-03-30 19:04:47 +03:00
|
|
|
::TODO does this still do the correct thing?
|
2017-03-24 23:10:27 +03:00
|
|
|
|= tay/partner
|
|
|
|
^+ +>
|
|
|
|
?. ?=($& -.tay) +> ::x if partner is a passport, do nothing.
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ cof=(~(get by mirrors) +.tay)
|
|
|
|
?. |(?=($~ cof) !?=($white p.cordon.u.cof))
|
2017-03-24 23:10:27 +03:00
|
|
|
+>.$
|
|
|
|
(sh-pact [tay ~ ~])
|
|
|
|
::
|
|
|
|
++ sh-rend :: print on one line
|
|
|
|
::x renders a telegram as a single line, adds it as a console move,
|
|
|
|
::x and updates the selected audience to match the telegram's.
|
|
|
|
::
|
|
|
|
|= gam/telegram
|
2017-03-30 19:04:47 +03:00
|
|
|
=+ lin=~(tr-line tr man settings.she gam)
|
2017-03-24 23:10:27 +03:00
|
|
|
(sh-fact %txt lin)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-numb :: print msg number
|
|
|
|
::x does as it says on the box.
|
|
|
|
::
|
|
|
|
|= num/@ud
|
|
|
|
^+ +>
|
|
|
|
=+ bun=(scow %ud num)
|
|
|
|
%+ sh-fact %txt
|
|
|
|
(runt [(sub 13 (lent bun)) '-'] "[{bun}]")
|
|
|
|
::
|
|
|
|
++ sh-glyf :: decode glyph
|
|
|
|
::x gets the partner(s) that match a glyph.
|
|
|
|
::x? why (set partner)? it seems like it only ever returns a single one.
|
|
|
|
::TODO should produce a set when ambiguous.
|
|
|
|
::
|
|
|
|
|= cha/char ^- (unit (set partner))
|
|
|
|
=+ lax=(~(get ju nak) cha)
|
|
|
|
?: =(~ lax) ~ ::x no partner.
|
|
|
|
?: ?=({* $~ $~} lax) `n.lax ::x single partner.
|
|
|
|
::x in case of multiple partners, pick the most recently active one.
|
|
|
|
|- ^- (unit (set partner))
|
|
|
|
?~ grams ~
|
|
|
|
::x get first partner from a telegram's audience.
|
|
|
|
=+ pan=(silt (turn (~(tap by q.q.i.grams)) head))
|
|
|
|
?: (~(has in lax) pan) `pan
|
|
|
|
$(grams t.grams)
|
|
|
|
::
|
2017-04-10 23:24:25 +03:00
|
|
|
++ sh-reaction
|
|
|
|
::x renders a reaction.
|
|
|
|
::
|
|
|
|
|= rac/reaction
|
|
|
|
(sh-lame (trip what.rac))
|
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-atlas-diff
|
2017-03-24 23:10:27 +03:00
|
|
|
::x calculates the difference between two atlasses (presence lists).
|
|
|
|
::
|
|
|
|
|= {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)
|
|
|
|
?: =(%gone p.q.i.eno) ret
|
|
|
|
=+ unt=(~(get by two) p.i.eno)
|
|
|
|
?~ unt
|
|
|
|
ret(old [i.eno old.ret])
|
|
|
|
?: =(%gone p.u.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)
|
|
|
|
?: =(%gone p.q.i.owt) ret
|
|
|
|
?. (~(has by one) p.i.owt)
|
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
?: =(%gone p:(~(got by one) p.i.owt))
|
|
|
|
ret(new [i.owt new.ret])
|
2017-03-23 03:34:56 +03:00
|
|
|
ret
|
2017-03-24 23:10:27 +03:00
|
|
|
ret
|
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-remco-diff
|
|
|
|
::x calculates the difference between two maps of station configurations.
|
2017-04-04 21:59:51 +03:00
|
|
|
::
|
|
|
|
|= {one/(map station config) two/(map station config)}
|
|
|
|
=| $= ret
|
|
|
|
$: old/(list (pair station config))
|
|
|
|
new/(list (pair station config))
|
|
|
|
cha/(list (pair station config))
|
|
|
|
==
|
|
|
|
^+ 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
|
|
|
|
::
|
2017-03-30 12:52:40 +03:00
|
|
|
++ sh-set-diff
|
|
|
|
::x calculates the difference between two sets,
|
|
|
|
::x returning what was lost in old and what was gained in new.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-03-30 12:52:40 +03:00
|
|
|
|* {one/(set *) two/(set *)}
|
|
|
|
:- ^= old (~(tap in (~(dif in one) two)))
|
|
|
|
^= new (~(tap in (~(dif in two) one)))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-puss
|
|
|
|
::x posture as text.
|
|
|
|
::
|
|
|
|
|= a/posture ^- tape
|
|
|
|
?- a
|
|
|
|
$black "channel"
|
|
|
|
$brown "mailbox"
|
|
|
|
$white "village"
|
|
|
|
$green "journal"
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-config-exceptions
|
|
|
|
::x used by ++sh-low-config-show to aid in printing info to cli.
|
2017-03-24 23:10:27 +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)))
|
|
|
|
+>.$
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-config-sources
|
|
|
|
::x used by ++sh-low-config-show to aid in printing info to cli,
|
2017-03-24 23:10:27 +03:00
|
|
|
::x pertaining to the un/subscribing to partners.
|
|
|
|
::
|
|
|
|
|= {pre/tape old/(list partner) new/(list partner)}
|
|
|
|
^+ +>
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ old +>.^$
|
|
|
|
=. +>.^$ $(old t.old)
|
2017-03-30 19:04:47 +03:00
|
|
|
(sh-note (weld pre "off {~(ta-full ta man i.old)}"))
|
2017-03-24 23:10:27 +03:00
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new +>.^$
|
|
|
|
=. +>.^$ $(new t.new)
|
2017-03-30 19:04:47 +03:00
|
|
|
(sh-note (weld pre "hey {~(ta-full ta man i.new)}"))
|
2017-03-24 23:10:27 +03:00
|
|
|
+>.$
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-config-show
|
2017-03-24 23:10:27 +03:00
|
|
|
::x prints config changes to the cli.
|
|
|
|
::
|
|
|
|
|= {pre/tape laz/config loc/config}
|
|
|
|
^+ +>
|
|
|
|
=. +>.$
|
|
|
|
?: =(caption.loc caption.laz) +>.$
|
|
|
|
(sh-note :(weld pre "cap " (trip caption.loc)))
|
|
|
|
=. +>.$
|
2017-04-04 22:08:57 +03:00
|
|
|
%+ sh-low-config-sources
|
2017-03-30 19:04:47 +03:00
|
|
|
(weld (trip man) ": ")
|
2017-03-30 12:52:40 +03:00
|
|
|
(sh-set-diff sources.laz sources.loc)
|
2017-03-24 23:10:27 +03:00
|
|
|
?: !=(p.cordon.loc p.cordon.laz)
|
|
|
|
=. +>.$ (sh-note :(weld pre "but " (sh-puss p.cordon.loc)))
|
2017-04-04 22:08:57 +03:00
|
|
|
%^ sh-low-config-exceptions
|
2017-03-30 19:04:47 +03:00
|
|
|
(weld (trip man) ": ")
|
2017-03-24 23:10:27 +03:00
|
|
|
p.cordon.loc
|
|
|
|
[~ (~(tap in q.cordon.loc))]
|
2017-04-04 22:08:57 +03:00
|
|
|
%^ sh-low-config-exceptions
|
2017-03-30 19:04:47 +03:00
|
|
|
(weld (trip man) ": ")
|
2017-03-23 03:34:56 +03:00
|
|
|
p.cordon.loc
|
2017-03-30 12:52:40 +03:00
|
|
|
(sh-set-diff q.cordon.laz q.cordon.loc)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-30 19:04:47 +03:00
|
|
|
++ sh-low-config
|
2017-04-04 21:59:51 +03:00
|
|
|
::x prints changes to a config to cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-12 21:09:23 +03:00
|
|
|
|= {sat/station old/(unit config) new/(unit config)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-04-12 21:09:23 +03:00
|
|
|
?~ old ~&([%new-conf sat] +>)
|
|
|
|
?~ new ~&([%del-conf sat] +>) ::TODO tmp
|
|
|
|
%^ sh-low-config-show
|
|
|
|
(weld ~(sn-phat sn man sat) ": ")
|
|
|
|
u.old u.new
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-04 21:59:51 +03:00
|
|
|
++ sh-low-remco
|
|
|
|
::x prints changes to remote configs to cli.
|
|
|
|
::
|
|
|
|
|= {ole/(map station config) neu/(map station config)}
|
|
|
|
^+ +>
|
2017-04-04 22:08:57 +03:00
|
|
|
=+ (sh-low-remco-diff ole neu)
|
2017-04-04 21:59:51 +03:00
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new +>.^$
|
|
|
|
=. +>.^$ $(new t.new)
|
|
|
|
=. +>.^$ (sh-pest [%& p.i.new])
|
2017-04-04 22:08:57 +03:00
|
|
|
%+ sh-low-config-show
|
2017-04-04 21:59:51 +03:00
|
|
|
(weld ~(sn-phat sn man p.i.new) ": ")
|
|
|
|
[*config q.i.new]
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ cha +>.^$
|
|
|
|
=. +>.^$ $(cha t.cha)
|
2017-04-04 22:08:57 +03:00
|
|
|
%+ sh-low-config-show
|
2017-04-04 21:59:51 +03:00
|
|
|
(weld ~(sn-phat sn man p.i.cha) ": ")
|
|
|
|
[(~(got by ole) `station`p.i.cha) q.i.cha]
|
|
|
|
+>.$
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-note :: shell message
|
|
|
|
::x prints a txt to cli in talk's format.
|
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
^+ +>
|
|
|
|
(sh-fact %txt (runt [14 '-'] `tape`['|' ' ' (scag 64 txt)]))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-spaz :: print status
|
|
|
|
::x gets the presence of a status.
|
|
|
|
::
|
|
|
|
|= saz/status
|
|
|
|
^- tape
|
|
|
|
['%' (trip p.saz)]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-rogue-diff
|
2017-04-03 17:50:35 +03:00
|
|
|
::x calculates the difference between two maps of stations and their
|
|
|
|
::x presence lists.
|
|
|
|
::
|
|
|
|
|= {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
|
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-precs-diff :: print atlas diff
|
2017-03-24 23:10:27 +03:00
|
|
|
::x prints presence notifications.
|
|
|
|
::
|
|
|
|
|= $: pre/tape
|
|
|
|
$= cul
|
|
|
|
$: old/(list (pair ship status))
|
|
|
|
new/(list (pair ship status))
|
|
|
|
cha/(list (pair ship status))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
?: (~(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)}")
|
2017-03-23 03:34:56 +03:00
|
|
|
+>.$
|
|
|
|
::
|
2017-04-04 22:08:57 +03:00
|
|
|
++ sh-low-rempe :: update foreign
|
2017-04-03 17:50:35 +03:00
|
|
|
::x updates remote presences(?) and prints changes.
|
|
|
|
::
|
|
|
|
|= {old/(map partner atlas) new/(map partner atlas)}
|
2017-04-04 22:08:57 +03:00
|
|
|
=+ day=(sh-low-rogue-diff old new)
|
2017-04-03 17:50:35 +03:00
|
|
|
?: (~(has in settings.she) %quiet)
|
|
|
|
+>.$
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ old.day +>.^$
|
|
|
|
=. +>.^$ $(old.day t.old.day)
|
|
|
|
(sh-note (weld "not " (~(ta-show ta man p.i.old.day) ~)))
|
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ new.day +>.^$
|
|
|
|
=. +>.^$ $(new.day t.new.day)
|
|
|
|
=. +>.^$
|
|
|
|
(sh-note (weld "new " (~(ta-show ta man p.i.new.day) ~)))
|
2017-04-04 22:08:57 +03:00
|
|
|
(sh-low-precs-diff "--" ~ (~(tap by q.i.new.day)) ~)
|
2017-04-03 17:50:35 +03:00
|
|
|
=. +>.$
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ cha.day +>.^$
|
|
|
|
=. +>.^$ $(cha.day t.cha.day)
|
|
|
|
=. +>.^$
|
|
|
|
(sh-note (weld "for " (~(ta-show ta man p.i.cha.day) ~)))
|
|
|
|
=+ yez=(~(got by old) p.i.cha.day)
|
2017-04-04 22:08:57 +03:00
|
|
|
%+ sh-low-precs-diff "--"
|
|
|
|
(sh-low-atlas-diff yez q.i.cha.day)
|
2017-04-03 17:50:35 +03:00
|
|
|
+>.$
|
|
|
|
::
|
2017-03-30 15:14:30 +03:00
|
|
|
++ sh-low-precs
|
|
|
|
::x print presence changes
|
|
|
|
::
|
2017-04-04 01:14:06 +03:00
|
|
|
|= {old/atlas new/atlas}
|
2017-03-30 15:14:30 +03:00
|
|
|
^+ +>
|
2017-04-04 22:08:57 +03:00
|
|
|
=+ dif=(sh-low-atlas-diff old new)
|
|
|
|
(sh-low-precs-diff "" dif)
|
2017-03-30 15:14:30 +03:00
|
|
|
::
|
|
|
|
++ sh-low-gram
|
2017-03-24 23:10:27 +03:00
|
|
|
::x renders telegram: increase gram count and print the gram.
|
|
|
|
::x every fifth gram, prints the number.
|
|
|
|
::
|
|
|
|
|= {num/@ud gam/telegram}
|
|
|
|
^+ +>
|
|
|
|
?: =(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-30 15:14:30 +03:00
|
|
|
++ sh-low-grams :: apply telegrams
|
2017-03-24 23:10:27 +03:00
|
|
|
::x renders telegrams.
|
|
|
|
::
|
|
|
|
|= {num/@ud gaz/(list telegram)}
|
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
2017-03-30 15:14:30 +03:00
|
|
|
$(gaz t.gaz, num +(num), +> (sh-low-gram num i.gaz))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-sane-chat :: sanitize chatter
|
|
|
|
::x (for chat messages) sanitizes the input buffer and splits it into
|
|
|
|
::x multiple lines ('•').
|
|
|
|
::
|
|
|
|
|= 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
|
2017-03-23 03:34:56 +03:00
|
|
|
:- (fix(inx brk) (turf '•'))
|
|
|
|
?: isa
|
2017-03-24 23:10:27 +03:00
|
|
|
[[%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
|
|
|
|
::
|
|
|
|
++ 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-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-sane :: sanitize input
|
|
|
|
::x parses cli prompt input using ++sh-scad and sanitizes when invalid.
|
|
|
|
::
|
|
|
|
|= {inv/sole-edit buf/(list @c)}
|
|
|
|
^- {lit/(list sole-edit) err/(unit @u)}
|
|
|
|
=+ res=(rose (tufa buf) sh-scad)
|
|
|
|
?: ?=($| -.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-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-slug :: edit to sanity
|
|
|
|
::x corrects invalid prompt input.
|
|
|
|
::
|
|
|
|
|= {lit/(list sole-edit) err/(unit @u)}
|
|
|
|
^+ +>
|
|
|
|
?~ 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]~)])
|
|
|
|
::
|
|
|
|
++ sh-stir :: apply edit
|
|
|
|
::x called when typing into the talk prompt. applies the change and does
|
|
|
|
::x sanitizing.
|
|
|
|
::
|
|
|
|
|= cal/sole-change
|
|
|
|
^+ +>
|
|
|
|
=^ inv say.she (~(transceive sole say.she) cal)
|
|
|
|
=+ fix=(sh-sane inv buf.say.she)
|
|
|
|
?~ lit.fix
|
|
|
|
+>.$
|
|
|
|
?~ err.fix
|
|
|
|
(sh-slug fix) :: just capital correction
|
|
|
|
?. &(?=($del -.inv) =(+(p.inv) (lent buf.say.she)))
|
|
|
|
+>.$ :: allow interior edits, deletes
|
|
|
|
(sh-slug fix)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-lame :: send error
|
|
|
|
::x just puts some text into the cli.
|
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
(sh-fact [%txt txt])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-twig-head ^- vase :: eval data
|
|
|
|
::x makes a vase of environment data to evaluate against (#-messages).
|
|
|
|
::
|
|
|
|
!>(`{our/@p now/@da eny/@uvI}`[our.hid now.hid (shas %eny eny.hid)])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-work :: do work
|
|
|
|
::x implements worker arms for different talk commands.
|
|
|
|
::x all worker arms must produce updated state/context.
|
|
|
|
::
|
|
|
|
|= job/work
|
|
|
|
^+ +>
|
|
|
|
=< work
|
|
|
|
|%
|
|
|
|
++ work
|
|
|
|
?- -.job
|
|
|
|
$number (number +.job)
|
|
|
|
$leave (leave +.job)
|
|
|
|
$join (join +.job)
|
|
|
|
$eval (eval +.job)
|
|
|
|
$who (who +.job)
|
|
|
|
$what (what +.job)
|
|
|
|
$bind (bind +.job)
|
2017-04-18 15:29:17 +03:00
|
|
|
$unbind (unbind +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$invite (invite +.job)
|
|
|
|
$banish (banish +.job)
|
|
|
|
$create (create +.job)
|
2017-04-14 17:16:36 +03:00
|
|
|
$depict (depict +.job)
|
|
|
|
$source (source +.job)
|
|
|
|
$delete (delete +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$nick (nick +.job)
|
|
|
|
$set (wo-set +.job)
|
|
|
|
$unset (unset +.job)
|
|
|
|
$target (target +.job)
|
|
|
|
$probe (probe +.job)
|
|
|
|
$help help
|
|
|
|
$say (say +.job)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ activate :: from %number
|
|
|
|
|= gam/telegram
|
|
|
|
^+ ..sh-work
|
2017-03-30 19:04:47 +03:00
|
|
|
=+ tay=~(. tr man 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
|
|
|
::
|
|
|
|
++ help
|
|
|
|
(sh-fact %txt "see http://urbit.org/docs/using/messaging/")
|
|
|
|
::
|
|
|
|
++ glyph
|
|
|
|
|= 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]
|
|
|
|
::
|
|
|
|
++ set-glyph
|
|
|
|
|= {cha/char lix/(set partner)}
|
|
|
|
=: nik (~(put by nik) lix cha)
|
|
|
|
nak (~(put ju nak) cha lix)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
|
|
|
(sh-action %glyph cha lix &)
|
|
|
|
::
|
|
|
|
++ unset-glyph
|
|
|
|
|= {cha/char lix/(unit (set partner))}
|
|
|
|
=/ ole/(set (set partner))
|
|
|
|
?^ lix [u.lix ~ ~]
|
|
|
|
(~(get ju nak) cha)
|
|
|
|
=. ..sh-work (sh-action %glyph cha (fall lix ~) |)
|
|
|
|
|- ^+ ..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
|
|
|
::
|
|
|
|
++ join :: %join
|
|
|
|
|= pan/(set partner)
|
|
|
|
^+ ..sh-work
|
|
|
|
=. ..sh-work
|
|
|
|
=+ (~(get by nik) pan)
|
|
|
|
?^ - (sh-note "has glyph {<u>}")
|
|
|
|
=+ cha=(glyph (mug pan))
|
|
|
|
(sh-note:(set-glyph cha pan) "new glyph {<cha>}")
|
2017-03-31 13:46:40 +03:00
|
|
|
=. ..sh-work
|
|
|
|
sh-prod(active.she pan)
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ loc=(~(got by mirrors) [our.hid man])
|
2017-03-24 23:10:27 +03:00
|
|
|
::x change local mailbox config to include subscription to pan.
|
2017-04-14 00:40:53 +03:00
|
|
|
(sh-action %source man & pan)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ leave :: %leave
|
|
|
|
|= pan/(set partner)
|
|
|
|
^+ ..sh-work
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ loc=(~(got by mirrors) [our.hid man])
|
2017-03-24 23:10:27 +03:00
|
|
|
::x change local mailbox config to exclude subscription to pan.
|
2017-04-14 00:40:53 +03:00
|
|
|
(sh-action %source man | pan)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ what :: %what
|
|
|
|
|= qur/$@(char (set partner)) ^+ ..sh-work
|
|
|
|
?^ 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 ~(te-whom te man.she a)
|
|
|
|
::
|
|
|
|
++ who :: %who
|
|
|
|
|= pan/(set partner) ^+ ..sh-work
|
2017-03-30 19:04:47 +03:00
|
|
|
::TODO clever use of =< and . take note!
|
2017-03-31 16:01:17 +03:00
|
|
|
~& [%who-ing pan]
|
2017-04-04 01:14:06 +03:00
|
|
|
=< (sh-fact %mor (murn (sort (~(tap by remotes) ~) aor) .))
|
2017-04-03 17:50:35 +03:00
|
|
|
|= {pon/partner alt/atlas} ^- (unit sole-effect)
|
|
|
|
?. |(=(~ pan) (~(has in pan) pon)) ~
|
|
|
|
=- `[%tan rose+[", " `~]^- leaf+~(ta-full ta man pon) ~]
|
|
|
|
=< (murn (sort (~(tap by alt)) aor) .)
|
2017-03-31 16:01:17 +03:00
|
|
|
|= {a/ship b/presence c/human} ^- (unit tank)
|
2017-04-04 16:40:59 +03:00
|
|
|
=. c
|
|
|
|
?. =(hand.c `(scot %p a)) c
|
|
|
|
[true.c ~]
|
2017-03-31 16:01:17 +03:00
|
|
|
?- b
|
|
|
|
$gone ~
|
2017-04-04 16:40:59 +03:00
|
|
|
$hear `leaf+:(weld "hear " (scow %p a) " " (trip (fall hand.c '')))
|
|
|
|
$talk `leaf+:(weld "talk " (scow %p a) " " (trip (fall hand.c '')))
|
2017-03-31 16:01:17 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ bind :: %bind
|
|
|
|
|= {cha/char pan/(unit (set partner))} ^+ ..sh-work
|
2017-03-27 13:52:30 +03:00
|
|
|
?~ pan $(pan `active.she)
|
2017-03-24 23:10:27 +03:00
|
|
|
=+ ole=(~(get by nik) u.pan)
|
|
|
|
?: =(ole [~ cha]) ..sh-work
|
2017-04-18 15:29:17 +03:00
|
|
|
(sh-note:sh-prod:(set-glyph cha u.pan) "bound {<cha>} {<u.pan>}")
|
|
|
|
::
|
|
|
|
++ unbind :: %unbind
|
|
|
|
|= {cha/char pan/(unit (set partner))} ^+ ..sh-work
|
|
|
|
?. ?| &(?=(^ pan) (~(has by nik) u.pan))
|
|
|
|
&(?=($~ pan) (~(has by nak) cha))
|
|
|
|
==
|
|
|
|
..sh-work
|
|
|
|
(sh-note:sh-prod:(unset-glyph cha pan) "unbound {<cha>}")
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ invite :: %invite
|
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-11 14:00:13 +03:00
|
|
|
(sh-action %permit nom & sis)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ banish :: %banish
|
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-11 14:00:13 +03:00
|
|
|
(sh-action %permit nom | sis)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
++ create :: %create
|
|
|
|
|= {por/posture nom/knot txt/cord}
|
|
|
|
^+ ..sh-work
|
2017-04-11 23:36:11 +03:00
|
|
|
?: (~(has in mirrors) [our.hid nom])
|
2017-03-24 23:10:27 +03:00
|
|
|
(sh-lame "{(trip nom)}: already exists")
|
|
|
|
=. ..sh-work
|
2017-04-11 14:24:07 +03:00
|
|
|
(sh-action %create nom txt por)
|
2017-03-24 23:10:27 +03:00
|
|
|
(join [[%& our.hid nom] ~ ~])
|
|
|
|
::
|
2017-04-14 17:16:36 +03:00
|
|
|
++ depict
|
|
|
|
|= {nom/knot txt/cord}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-action %depict nom txt)
|
|
|
|
::
|
|
|
|
++ source
|
|
|
|
|= {nom/knot pas/(set partner)}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-action %source nom & pas)
|
|
|
|
::
|
|
|
|
++ delete
|
|
|
|
|= {nom/knot say/(unit cord)}
|
|
|
|
^+ ..sh-work
|
|
|
|
(sh-action %delete nom say)
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ reverse-folks
|
|
|
|
|= nym/knot
|
|
|
|
^- (list ship)
|
|
|
|
%+ murn (~(tap by folks))
|
2017-03-23 03:34:56 +03:00
|
|
|
|= {p/ship q/human}
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ hand.q ~
|
|
|
|
?. =(u.hand.q nym) ~
|
|
|
|
[~ u=p]
|
|
|
|
::
|
|
|
|
++ nick :: %nick
|
|
|
|
|= {her/(unit ship) nym/(unit cord)}
|
|
|
|
^+ ..sh-work
|
2017-03-30 15:17:37 +03:00
|
|
|
::x no arguments
|
2017-03-24 23:10:27 +03:00
|
|
|
?: ?=({$~ $~} +<)
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn (~(tap by folks))
|
|
|
|
|= {p/ship q/human}
|
|
|
|
:- %txt
|
|
|
|
?~ hand.q
|
|
|
|
"{<p>}:"
|
|
|
|
"{<p>}: {<u.hand.q>}"
|
2017-03-30 15:17:37 +03:00
|
|
|
::x unset nickname
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ nym
|
|
|
|
?> ?=(^ her)
|
|
|
|
=+ asc=(~(get by folks) u.her)
|
|
|
|
%+ sh-fact %txt
|
|
|
|
?~ asc "{<u.her>} unbound"
|
|
|
|
?~ hand.u.asc "{<u.her>}:"
|
|
|
|
"{<u.her>}: {<u.hand.u.asc>}"
|
2017-03-30 15:17:37 +03:00
|
|
|
::x get nickname
|
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-11 14:00:13 +03:00
|
|
|
%= sh-action
|
2017-03-24 23:10:27 +03:00
|
|
|
folks ?~ u.nym
|
2017-03-25 02:24:55 +03:00
|
|
|
(~(del by folks) u.her) ::x unset nickname
|
|
|
|
(~(put by folks) u.her [true=~ hand=nym]) ::x set nickname
|
2017-03-24 23:10:27 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ wo-set :: %set
|
|
|
|
|= 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
|
|
|
|
|= neg/knot
|
|
|
|
^+ ..sh-work
|
|
|
|
%= ..sh-work
|
|
|
|
settings.she (~(del in settings.she) neg)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ target :: %target
|
|
|
|
|= {pan/(set partner) woe/(unit ^work)}
|
|
|
|
^+ ..sh-work
|
|
|
|
=. ..sh-pact (sh-pact pan)
|
|
|
|
?~(woe ..sh-work work(job u.woe))
|
|
|
|
::
|
|
|
|
++ number :: %number
|
|
|
|
|= num/$@(@ud {p/@u q/@ud})
|
|
|
|
^+ ..sh-work
|
|
|
|
|-
|
|
|
|
?@ num
|
2017-04-11 23:36:11 +03:00
|
|
|
?: (gte num count)
|
2017-03-24 23:10:27 +03:00
|
|
|
(sh-lame "{(scow %s (new:si | +(num)))}: no such telegram")
|
|
|
|
=. ..sh-fact (sh-fact %txt "? {(scow %s (new:si | +(num)))}")
|
2017-04-11 23:36:11 +03:00
|
|
|
(activate (snag num grams))
|
|
|
|
?. (gth q.num count)
|
|
|
|
?: =(count 0)
|
2017-03-24 23:10:27 +03:00
|
|
|
(sh-lame "0: no messages")
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ msg=(deli (dec count) num)
|
2017-03-24 23:10:27 +03:00
|
|
|
=. ..sh-fact (sh-fact %txt "? {(scow %ud msg)}")
|
2017-04-11 23:36:11 +03:00
|
|
|
(activate (snag (sub count +(msg)) grams))
|
2017-03-24 23:10:27 +03:00
|
|
|
(sh-lame "…{(reap p.num '0')}{(scow %ud q.num)}: no such telegram")
|
|
|
|
::
|
|
|
|
++ deli :: find number
|
|
|
|
|= {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)))
|
|
|
|
::
|
|
|
|
++ probe :: inquire
|
|
|
|
|= cuz/station
|
|
|
|
^+ ..sh-work
|
2017-04-12 21:09:23 +03:00
|
|
|
::TODO? what's this?
|
2017-03-24 23:10:27 +03:00
|
|
|
~& [%probe cuz]
|
|
|
|
..sh-work
|
|
|
|
::
|
|
|
|
++ eval :: run
|
|
|
|
|= {txt/cord exe/twig}
|
|
|
|
=> |.([(sell (slap (slop sh-twig-head seed) exe))]~)
|
|
|
|
=+ tan=p:(mule .)
|
|
|
|
(say [%fat tank+tan exp+txt] ~)
|
|
|
|
::
|
|
|
|
++ say :: publish
|
|
|
|
|= sep/(list speech)
|
|
|
|
^+ ..sh-work
|
2017-04-14 00:40:53 +03:00
|
|
|
(sh-action %phrase active.she sep)
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
++ sh-done :: apply result
|
|
|
|
::x called upon hitting return in the prompt. if input is invalid,
|
|
|
|
::x ++sh-slug is called. otherwise, the appropriate work is done
|
|
|
|
::x and the entered command (if any) gets displayed to the user.
|
|
|
|
::
|
|
|
|
=+ fix=(sh-sane [%nop ~] buf.say.she)
|
|
|
|
?^ lit.fix
|
|
|
|
(sh-slug fix)
|
|
|
|
=+ jub=(rust (tufa buf.say.she) sh-scad)
|
|
|
|
?~ 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-03-24 23:10:27 +03:00
|
|
|
++ sh-sole :: apply edit
|
|
|
|
::x applies sole action.
|
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
|
|
|
?- -.act
|
|
|
|
$det (sh-stir +.act)
|
|
|
|
$clr ..sh-sole :: (sh-pact ~) :: XX clear to PM-to-self?
|
|
|
|
$ret sh-done
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ sh-uniq
|
|
|
|
::x generates a new serial.
|
|
|
|
::
|
|
|
|
^- {serial _.}
|
|
|
|
[(shaf %serial eny.hid) .(eny.hid (shax eny.hid))]
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ sn :: station render core
|
|
|
|
::x used in both station and ship rendering.
|
|
|
|
::
|
|
|
|
::x man: mailbox.
|
|
|
|
::x one: the station.
|
2017-03-24 23:10:27 +03:00
|
|
|
|_ {man/knot one/station}
|
2017-03-23 03:34:56 +03:00
|
|
|
++ sn-best :: best to show
|
|
|
|
::x returns true if one is better to show, false otherwise.
|
|
|
|
::x prioritizes: our > main > size.
|
2017-03-24 01:07:35 +03:00
|
|
|
::TODO maybe simplify. (lth (xeb (xeb p.one)) (xeb (xeb p.two)))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= two/station
|
|
|
|
^- ?
|
|
|
|
::x the station that's ours is better.
|
|
|
|
?: =(our.hid p.one)
|
|
|
|
?: =(our.hid p.two)
|
|
|
|
?< =(q.one q.two)
|
|
|
|
::x if both stations are ours, the main story is better.
|
|
|
|
?: =((main p.one) q.one) %&
|
|
|
|
?: =((main p.two) q.two) %|
|
|
|
|
::x if neither are, pick the "larger" one.
|
|
|
|
(lth q.one q.two)
|
|
|
|
%&
|
|
|
|
::x if one isn't ours but two is, two is better.
|
|
|
|
?: =(our.hid p.two)
|
|
|
|
%|
|
|
|
|
?: =(p.one p.two)
|
|
|
|
::x if they're from the same ship, pick the "larger" one.
|
|
|
|
(lth q.one q.two)
|
|
|
|
::x when in doubt, pick one if its ship is "smaller" than its channel.
|
|
|
|
::x? i guess you want this to be consistent across (a b) and (b a), but
|
|
|
|
::x this still seems pretty arbitrary.
|
|
|
|
(lth p.one q.one)
|
|
|
|
::
|
|
|
|
++ sn-curt :: render name in 14
|
|
|
|
::x prints a ship name in 14 characters. left-pads with spaces.
|
2017-03-24 01:07:35 +03:00
|
|
|
::x mup signifies "are there other targets besides this one"
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= mup/?
|
|
|
|
^- tape
|
|
|
|
=+ raw=(cite p.one)
|
|
|
|
(runt [(sub 14 (lent raw)) ' '] raw)
|
|
|
|
::
|
|
|
|
++ sn-nick
|
|
|
|
::x get nick for ship, or shortname if no nick. left-pads with spaces.
|
|
|
|
::
|
|
|
|
|. ^- tape
|
|
|
|
=+ nym=(~(get by folks) p.one)
|
|
|
|
?~ nym
|
|
|
|
(sn-curt |)
|
|
|
|
?~ hand.u.nym
|
|
|
|
(sn-curt |)
|
|
|
|
=+ raw=(trip u.hand.u.nym)
|
|
|
|
=+ len=(sub 14 (lent raw))
|
|
|
|
(weld (reap len ' ') raw)
|
|
|
|
::
|
|
|
|
++ sn-phat :: render accurately
|
|
|
|
::x prints a station fully, but still taking "shortcuts" where possible:
|
|
|
|
::x ":" for local mailbox, "~ship" for foreign mailbox,
|
|
|
|
::x "%channel" for local station, "/channel" for parent station.
|
|
|
|
::
|
|
|
|
^- tape
|
|
|
|
?: =(p.one our.hid)
|
|
|
|
?: =(q.one man)
|
|
|
|
":"
|
|
|
|
['%' (trip q.one)]
|
|
|
|
?: =(p.one (sein our.hid))
|
|
|
|
['/' (trip q.one)]
|
|
|
|
=+ wun=(scow %p p.one)
|
|
|
|
?: =(q.one (main p.one))
|
|
|
|
wun
|
|
|
|
:(welp wun "/" (trip q.one))
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ ta :: partner core
|
|
|
|
::x used primarily for printing partners.
|
|
|
|
::
|
|
|
|
::x man: mailbox.
|
|
|
|
::x one: the partner.
|
|
|
|
|_ {man/knot one/partner}
|
|
|
|
++ ta-beat :: more relevant
|
|
|
|
::x returns true if one is better to show, false otherwise.
|
|
|
|
::x prefers stations over passports. if both are stations, sn-best. if both
|
|
|
|
::x are passports, pick the "larger" one, if they're equal, content hash.
|
|
|
|
::
|
|
|
|
|= two/partner ^- ?
|
|
|
|
?- -.one
|
|
|
|
$&
|
|
|
|
?- -.two
|
|
|
|
$| %&
|
|
|
|
$& (~(sn-best sn man p.one) p.two)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
$|
|
|
|
|
?- -.two
|
|
|
|
$& %|
|
|
|
|
$| ?: =(-.p.two -.p.one)
|
|
|
|
(lth (mug +.p.one) (mug +.p.two))
|
|
|
|
(lth -.p.two -.p.one)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
++ ta-best :: most relevant
|
|
|
|
::x picks the most relevant partner.
|
|
|
|
::
|
|
|
|
|=(two/partner ?:((ta-beat two) two one))
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ ta-sigh :: assemble label
|
|
|
|
::x prepend pre to yiz, omitting characters of yiz to stay within len.
|
|
|
|
::
|
|
|
|
|= {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-03-23 03:34:56 +03:00
|
|
|
++ ta-full (ta-show ~) :: render full width
|
|
|
|
++ ta-show :: render partner
|
|
|
|
::x renders a partner as text.
|
|
|
|
::
|
|
|
|
|= moy/(unit ?)
|
|
|
|
^- tape
|
|
|
|
?- -.one
|
|
|
|
::x render station as glyph if we can.
|
|
|
|
$&
|
|
|
|
?~ moy
|
|
|
|
=+ cha=(~(get by nik) one ~ ~)
|
|
|
|
=- ?~(cha - "'{u.cha ~}' {-}")
|
|
|
|
~(sn-phat sn man p.one)
|
|
|
|
(~(sn-curt sn man p.one) u.moy)
|
|
|
|
::
|
|
|
|
::x render passport.
|
|
|
|
$|
|
|
|
|
=+ ^= pre ^- tape
|
|
|
|
?- -.p.one
|
|
|
|
$twitter "@t:"
|
|
|
|
==
|
|
|
|
?~ moy
|
|
|
|
(weld pre (trip p.p.one))
|
|
|
|
=. pre ?.(=(& u.moy) pre ['*' pre])
|
2017-03-24 23:10:27 +03:00
|
|
|
(ta-sigh 14 pre p.p.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ te :: audience renderer
|
|
|
|
::x used for representing audiences (sets of partners) as tapes.
|
|
|
|
::
|
|
|
|
:: man: mailbox.
|
|
|
|
:: lix: members of the audience.
|
|
|
|
|_ {man/knot lix/(set partner)}
|
|
|
|
++ te-best ^- (unit partner)
|
|
|
|
::x pick the most relevant partner.
|
|
|
|
::
|
|
|
|
?~ lix ~
|
|
|
|
:- ~
|
|
|
|
|- ^- partner
|
|
|
|
=+ lef=`(unit partner)`te-best(lix l.lix)
|
|
|
|
=+ rit=`(unit partner)`te-best(lix r.lix)
|
|
|
|
=. n.lix ?~(lef n.lix (~(ta-best ta man n.lix) u.lef))
|
|
|
|
=. n.lix ?~(rit n.lix (~(ta-best ta man n.lix) u.rit))
|
|
|
|
n.lix
|
|
|
|
::
|
|
|
|
++ te-deaf ^+ . :: except for self
|
|
|
|
::x remove ourselves from the audience.
|
|
|
|
::
|
|
|
|
.(lix (~(del in lix) `partner`[%& our.hid man]))
|
|
|
|
::
|
|
|
|
++ te-maud ^- ? :: multiple audience
|
|
|
|
::x checks if there's multiple partners in the audience via pattern match.
|
|
|
|
::
|
|
|
|
=. . te-deaf
|
|
|
|
!?=($@($~ {* $~ $~}) lix)
|
|
|
|
::
|
|
|
|
++ te-prom ^- tape :: render targets
|
|
|
|
::x render all partners, ordered by relevance.
|
|
|
|
::
|
|
|
|
=. . te-deaf
|
|
|
|
=+ ^= all
|
|
|
|
%+ sort `(list partner)`(~(tap in lix))
|
|
|
|
|= {a/partner b/partner}
|
|
|
|
(~(ta-beat ta man a) b)
|
|
|
|
=+ fir=&
|
|
|
|
|- ^- tape
|
|
|
|
?~ all ~
|
|
|
|
;: welp
|
|
|
|
?:(fir "" " ")
|
|
|
|
(~(ta-show ta man i.all) ~)
|
|
|
|
$(all t.all, fir |)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ te-whom :: render sender
|
|
|
|
::x render sender as the most relevant partner.
|
|
|
|
::
|
|
|
|
(~(ta-show ta man (need te-best)) ~ te-maud)
|
|
|
|
::
|
|
|
|
++ ta-dire :: direct message
|
|
|
|
::x returns true if partner is a mailbox of ours.
|
|
|
|
::
|
|
|
|
|= pan/partner ^- ?
|
|
|
|
?& ?=($& -.pan)
|
|
|
|
=(p.p.pan our.hid)
|
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
=+ sot=(~(get by mirrors) +.pan)
|
|
|
|
&(?=(^ sot) ?=($brown p.cordon.u.sot))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ te-pref :: audience glyph
|
|
|
|
::x get the glyph that corresponds to the audience, with a space appended.
|
|
|
|
::x if it's a dm to us, use :. if it's a dm by us, use ;. complex, use *.
|
|
|
|
::
|
|
|
|
^- tape
|
|
|
|
=+ cha=(~(get by nik) lix)
|
|
|
|
?^ cha ~[u.cha ' ']
|
|
|
|
?. (lien (~(tap by lix)) ta-dire)
|
|
|
|
"* "
|
|
|
|
?: ?=({{$& ^} $~ $~} lix)
|
|
|
|
": "
|
|
|
|
"; "
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ tr :: telegram renderer
|
|
|
|
::x responsible for converting telegrams and everything relating to them to
|
|
|
|
::x text to be displayed in the cli.
|
|
|
|
::
|
|
|
|
|_ $: ::x man: story.
|
|
|
|
::x sef: settings flags.
|
|
|
|
::x telegram:
|
|
|
|
::x who: author.
|
|
|
|
::x thought:
|
|
|
|
::x sen: unique identifier.
|
|
|
|
::x aud: audience.
|
|
|
|
::x statement:
|
|
|
|
::x wen: timestamp.
|
|
|
|
::x bou: complete aroma.
|
|
|
|
::x sep: message contents.
|
|
|
|
::
|
|
|
|
man/knot
|
|
|
|
sef/(set knot)
|
|
|
|
who/ship
|
|
|
|
sen/serial
|
|
|
|
aud/audience
|
|
|
|
wen/@da
|
|
|
|
bou/bouquet
|
|
|
|
sep/speech
|
|
|
|
==
|
|
|
|
++ tr-fact ^- sole-effect :: activate effect
|
|
|
|
::x produce sole-effect for printing message details.
|
|
|
|
::
|
|
|
|
~[%mor [%tan tr-meta] tr-body]
|
|
|
|
::
|
|
|
|
++ tr-line ^- tape :: one-line print
|
|
|
|
::x crams a telegram into a single line by displaying a short ship name,
|
|
|
|
::x a short representation of the gram, and an optional timestamp.
|
|
|
|
::
|
|
|
|
=+ txt=(tr-text =(who our.hid))
|
|
|
|
?: =(~ txt) ""
|
|
|
|
=+ ^= baw
|
2017-03-30 15:17:37 +03:00
|
|
|
:: ?: oug
|
2017-03-23 03:34:56 +03:00
|
|
|
:: ~(te-whom te man tr-pals)
|
|
|
|
?. (~(has in sef) %noob)
|
|
|
|
(~(sn-curt sn man [who (main who)]) |)
|
|
|
|
(~(sn-nick sn man [who (main who)]))
|
|
|
|
?: (~(has in sef) %showtime)
|
|
|
|
=+ dat=(yore now.hid)
|
|
|
|
=+ ^= t
|
|
|
|
|= a/@ ^- tape
|
|
|
|
%+ weld
|
|
|
|
?: (lth a 10) "0" ~
|
|
|
|
(scow %ud a)
|
|
|
|
=+ ^= time :(weld "~" (t h.t.dat) "." (t m.t.dat) "." (t s.t.dat))
|
|
|
|
:(weld baw txt (reap (sub 67 (lent txt)) ' ') time)
|
|
|
|
(weld baw txt)
|
|
|
|
::
|
|
|
|
++ tr-meta ^- tang
|
|
|
|
::x build strings that display metadata, including message serial,
|
|
|
|
::x timestamp, author and audience.
|
|
|
|
::
|
|
|
|
=. wen (sub wen (mod wen (div wen ~s0..0001))) :: round
|
|
|
|
=+ hed=leaf+"{(scow %uv sen)} at {(scow %da wen)}"
|
|
|
|
=+ =< paz=(turn (~(tap by aud)) .)
|
|
|
|
|=({a/partner *} leaf+~(ta-full ta man a))
|
|
|
|
=+ bok=(turn (sort (~(tap in bou)) aor) smyt)
|
|
|
|
[%rose [" " ~ ~] [hed >who< [%rose [", " "to " ~] paz] bok]]~
|
|
|
|
::
|
|
|
|
++ tr-body
|
|
|
|
::x long-form display of message contents, specific to each speech type.
|
|
|
|
::
|
|
|
|
|- ^- sole-effect
|
|
|
|
?+ -.sep tan+[>sep<]~
|
|
|
|
$exp tan+~[leaf+"# {(trip p.sep)}"]
|
|
|
|
$lin tan+~[leaf+"{?:(p.sep "" "@ ")}{(trip q.sep)}"]
|
|
|
|
$non tan+~
|
|
|
|
$app tan+~[rose+[": " ~ ~]^~[leaf+"[{(trip p.sep)}]" leaf+(trip q.sep)]]
|
|
|
|
$url url+(crip (earf p.sep))
|
|
|
|
$mor mor+(turn p.sep |=(speech ^$(sep +<)))
|
|
|
|
$fat [%mor $(sep q.sep) tan+(tr-rend-tors p.sep) ~]
|
2017-04-10 23:35:25 +03:00
|
|
|
$inv
|
|
|
|
:- %tan
|
|
|
|
:_ ~
|
|
|
|
:- %leaf
|
|
|
|
%+ weld
|
|
|
|
?: p.sep
|
|
|
|
"you have been invited to "
|
|
|
|
"you have been banished from "
|
|
|
|
~(sn-phat sn man q.sep)
|
2017-03-23 03:34:56 +03:00
|
|
|
$api
|
|
|
|
:- %tan
|
|
|
|
:_ ~
|
|
|
|
:+ %rose
|
|
|
|
[": " ~ ~]
|
|
|
|
:~ leaf+"[{(trip id.sep)} on {(trip service.sep)}]"
|
|
|
|
leaf+(trip body.sep)
|
|
|
|
leaf+(earf url.sep)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ tr-rend-tors
|
|
|
|
::x render an attachment.
|
|
|
|
::
|
|
|
|
|= a/torso ^- tang
|
|
|
|
?- -.a
|
|
|
|
$name (welp $(a q.a) leaf+"={(trip p.a)}" ~)
|
|
|
|
$tank +.a
|
|
|
|
$text (turn (flop +.a) |=(b/cord leaf+(trip b)))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ tr-pals
|
|
|
|
::x strip delivery info from audience, producing a set of partners.
|
|
|
|
::
|
|
|
|
^- (set partner)
|
|
|
|
%- ~(gas in *(set partner))
|
|
|
|
(turn (~(tap by aud)) |=({a/partner *} a))
|
|
|
|
::
|
|
|
|
++ tr-chow
|
|
|
|
::x truncate the txt to be of max len characters. if it does truncate,
|
|
|
|
::x indicates it did so by appending a character.
|
|
|
|
::
|
|
|
|
|= {len/@u txt/tape} ^- tape
|
|
|
|
?: (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)]
|
|
|
|
::
|
|
|
|
++ tr-both
|
|
|
|
::x try to fit two tapes into a single line.
|
|
|
|
::
|
|
|
|
|= {a/tape b/tape} ^- tape
|
|
|
|
?: (gth (lent a) 62) (tr-chow 64 a)
|
|
|
|
%+ weld a
|
|
|
|
(tr-chow (sub 64 (lent a)) " {b}")
|
|
|
|
::
|
|
|
|
++ tr-text
|
|
|
|
::x gets a tape representation of a message that fits within a single line.
|
|
|
|
::
|
|
|
|
|= oug/?
|
|
|
|
^- tape
|
|
|
|
?+ -.sep ~&(tr-lost+sep "")
|
|
|
|
$mor
|
|
|
|
?~ p.sep ~&(%tr-mor-empty "")
|
|
|
|
|- ^- tape
|
|
|
|
?~ t.p.sep ^$(sep i.p.sep)
|
|
|
|
(tr-both ^$(sep i.p.sep) $(p.sep t.p.sep))
|
|
|
|
::
|
|
|
|
$fat
|
|
|
|
%+ tr-both $(sep q.sep)
|
|
|
|
?+ -.p.sep "..."
|
|
|
|
$tank ~(ram re %rose [" " `~] +.p.sep)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
$exp (tr-chow 66 '#' ' ' (trip p.sep))
|
|
|
|
$url =+ ful=(earf p.sep)
|
|
|
|
?: (gth 64 (lent ful)) ['/' ' ' ful]
|
2017-03-30 15:17:37 +03:00
|
|
|
:+ '/' '_'
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ hok=r.p.p.p.sep
|
|
|
|
~! 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))))
|
|
|
|
::
|
|
|
|
$lin
|
|
|
|
=+ txt=(trip q.sep)
|
|
|
|
?: p.sep
|
|
|
|
=+ pal=tr-pals
|
|
|
|
=. pal ?: =(who our.hid) pal
|
|
|
|
(~(del in pal) [%& who (main who)])
|
|
|
|
(weld ~(te-pref te man pal) txt)
|
|
|
|
(weld " " txt)
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
|
|
|
$inv
|
|
|
|
%+ weld
|
|
|
|
?: p.sep
|
|
|
|
" invited you to "
|
|
|
|
" banished you from "
|
|
|
|
~(sn-phat sn man q.sep)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
$app
|
|
|
|
(tr-chow 64 "[{(trip p.sep)}]: {(trip q.sep)}")
|
|
|
|
::
|
|
|
|
$api
|
|
|
|
(tr-chow 64 "[{(trip id.sep)}@{(trip service.sep)}]: {(trip summary.sep)}")
|
|
|
|
==
|
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-03-28 00:17:09 +03:00
|
|
|
++ peer
|
|
|
|
::x incoming subscription on pax.
|
|
|
|
::
|
|
|
|
|= pax/path
|
|
|
|
~& [%r-peer pax ost.hid src.hid]
|
|
|
|
^- (quip move +>)
|
|
|
|
?. (team src.hid our.hid)
|
|
|
|
~& [%peer-talk-reader-stranger src.hid]
|
|
|
|
[~ +>]
|
|
|
|
?. ?=({$sole *} pax)
|
|
|
|
~& [%peer-talk-reader-strange pax]
|
|
|
|
[~ +>]
|
2017-03-30 15:17:37 +03:00
|
|
|
~& [%r-peer-sole ost.hid]
|
2017-03-28 00:17:09 +03:00
|
|
|
ra-abet:(ra-console:ra src.hid t.pax)
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ diff-talk-lowdown
|
|
|
|
::x incoming talk-lowdown. process it.
|
2017-04-12 23:37:37 +03:00
|
|
|
::x we *could* use the wire to identify what story subscription our lowdown
|
|
|
|
::x is coming from, but since we only ever subscribe to a single story, we
|
|
|
|
::x don't bother.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
|= {way/wire low/lowdown}
|
2017-04-04 22:52:05 +03:00
|
|
|
ra-abet:(ra-low:ra low)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-10 23:24:25 +03:00
|
|
|
++ diff-talk-reaction :: accept reaction
|
|
|
|
::x incoming talk reaction. process it.
|
|
|
|
::
|
|
|
|
|= {way/wire rac/reaction}
|
|
|
|
?. =(src.hid -:(broker our.hid))
|
|
|
|
~& [%diff-reaction-stranger src.hid]
|
|
|
|
[~ +>]
|
|
|
|
ra-abet:(ra-reaction:ra rac)
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
++ poke-sole-action :: accept console
|
|
|
|
::x incoming sole action. process it.
|
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
ra-abet:(ra-sole:ra act)
|
|
|
|
::
|
2017-03-28 00:17:09 +03:00
|
|
|
++ prep
|
|
|
|
::x state adapter.
|
|
|
|
::
|
2017-03-30 15:17:37 +03:00
|
|
|
|= old/*::(unit chattel)
|
2017-03-28 00:17:09 +03:00
|
|
|
::^- (quip move ..prep)
|
|
|
|
::?~ old
|
2017-03-30 15:17:37 +03:00
|
|
|
ra-abet:ra-init:ra
|
2017-03-28 00:17:09 +03:00
|
|
|
::[~ ..prep(+<+ u.old)]
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|