2017-03-23 03:34:56 +03:00
|
|
|
:: :: ::
|
2017-11-08 00:05:52 +03:00
|
|
|
:::: /app/talk/hoon :: ::
|
2017-03-23 03:34:56 +03:00
|
|
|
:: :: ::
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
::TODO maybe keep track of received grams per circle, too?
|
2017-11-10 00:35:24 +03:00
|
|
|
::
|
2017-10-27 22:09:36 +03:00
|
|
|
::TODO [type query] => [press tab to cycle search results, newest-first]
|
|
|
|
:: => [escape to clear]
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:: This client implementation makes use of the %inbox
|
|
|
|
:: for all its subscriptions and messaging. All
|
|
|
|
:: rumors received are exclusively about the %inbox,
|
|
|
|
:: since that's the only thing the client ever
|
|
|
|
:: subscribes to.
|
2017-04-12 14:14:09 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
/- hall, sole :: structures
|
|
|
|
/+ hall, sole :: libraries
|
2017-03-23 03:34:56 +03:00
|
|
|
/= seed /~ !>(.)
|
2017-11-10 02:04:07 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
::::
|
|
|
|
::
|
2017-11-08 00:05:52 +03:00
|
|
|
=, hall
|
2017-10-06 20:35:25 +03:00
|
|
|
=, sole
|
2017-12-19 02:53:59 +03:00
|
|
|
=> :> #
|
|
|
|
:> # %arch
|
|
|
|
:> #
|
|
|
|
:> data structures
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
|
|
|
|%
|
2017-12-19 02:53:59 +03:00
|
|
|
++ state :> application state
|
2017-04-11 23:36:11 +03:00
|
|
|
$: :: messaging state ::
|
2017-12-19 02:53:59 +03:00
|
|
|
count/@ud :< (lent grams)
|
|
|
|
grams/(list telegram) :< all history
|
|
|
|
known/(map serial @ud) :< messages heard
|
|
|
|
sources/(set circle) :< our subscriptions
|
2017-07-11 02:41:47 +03:00
|
|
|
:: circle details ::
|
2017-12-19 02:53:59 +03:00
|
|
|
remotes/(map circle group) :< remote presences
|
|
|
|
mirrors/(map circle config) :< remote configs
|
2017-04-11 23:36:11 +03:00
|
|
|
:: ui state ::
|
2017-12-19 02:53:59 +03:00
|
|
|
nicks/(map ship nick) :< human identities
|
|
|
|
bound/(map audience char) :< bound circle glyphs
|
|
|
|
binds/(jug char audience) :< circle glyph lookup
|
|
|
|
cli/shell :< interaction state
|
2017-03-24 01:10:28 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ shell :> console session
|
|
|
|
$: id/bone :< identifier
|
|
|
|
latest/@ud :< latest shown msg num
|
|
|
|
say/sole-share :< console state
|
|
|
|
active/audience :< active targets
|
|
|
|
settings/(set term) :< frontend settings
|
|
|
|
width/@ud :< display width
|
|
|
|
timez/(pair ? @ud) :< timezone adjustment
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ move (pair bone card) :< all actions
|
|
|
|
++ lime :> diff fruit
|
2017-06-13 01:19:45 +03:00
|
|
|
$% {$sole-effect sole-effect} ::
|
2017-03-27 16:27:08 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ pear :> poke fruit
|
2017-11-08 00:05:52 +03:00
|
|
|
$% {$hall-command command} ::
|
|
|
|
{$hall-action action} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +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-12-12 18:04:51 +03:00
|
|
|
{$pull wire dock $~} ::
|
2017-03-24 23:10:27 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ work :> interface action
|
2017-04-24 21:17:56 +03:00
|
|
|
$% :: circle management ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$join (map circle range)} :< subscribe to
|
|
|
|
{$leave audience} :< unsubscribe from
|
2017-12-19 17:33:30 +03:00
|
|
|
{$create security name cord} :< create circle
|
|
|
|
{$delete name (unit cord)} :< delete circle
|
|
|
|
{$depict name cord} :< change description
|
|
|
|
{$filter name ? ?} :< change message rules
|
|
|
|
{$invite name (set ship)} :< give permission
|
|
|
|
{$banish name (set ship)} :< deny permission
|
|
|
|
{$source name (map circle range)} :< add source
|
|
|
|
{$unsource name (map circle range)} :< remove source
|
2017-11-02 18:53:19 +03:00
|
|
|
:: personal metadata ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$attend audience (unit presence)} :< set our presence
|
|
|
|
{$name audience human} :< set our name
|
2017-04-21 18:37:10 +03:00
|
|
|
:: messaging ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$say (list speech)} :< send message
|
|
|
|
{$eval cord hoon} :< send #-message
|
|
|
|
{$target p/audience q/(unit work)} :< set active targets
|
|
|
|
{$reply $@(@ud {@u @ud}) (list speech)} :< reply to
|
2017-04-21 18:37:10 +03:00
|
|
|
:: displaying info ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$number $@(@ud {@u @ud})} :< relative/absolute
|
|
|
|
{$who audience} :< presence
|
|
|
|
{$what (unit $@(char audience))} :< show bound glyph
|
|
|
|
{$sources circle} :< show active sources
|
2017-04-21 18:37:10 +03:00
|
|
|
:: ui settings ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$bind char (unit audience)} :< bind glyph
|
|
|
|
{$unbind char (unit audience)} :< unbind glyph
|
|
|
|
{$nick (unit ship) (unit cord)} :< un/set/show nick
|
|
|
|
{$set term} :< enable setting
|
|
|
|
{$unset term} :< disable setting
|
|
|
|
{$width @ud} :< change display width
|
|
|
|
{$timez ? @ud} :< adjust shown times
|
2017-04-24 21:17:56 +03:00
|
|
|
:: miscellaneous ::
|
2017-12-19 02:53:59 +03:00
|
|
|
{$show circle} :< show membership
|
|
|
|
{$hide circle} :< hide membership
|
|
|
|
{$help $~} :< print usage info
|
2017-03-27 16:27:08 +03:00
|
|
|
== ::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ glyphs `wall`~[">=+-" "}),." "\"'`^" "$%&@"] :< circle char pool '
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %work
|
|
|
|
:> #
|
|
|
|
:> functional cores and arms.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-10-06 20:35:25 +03:00
|
|
|
|_ {bol/bowl:gall state}
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> # %transition
|
|
|
|
:> prep transition
|
|
|
|
+|
|
|
|
|
::
|
|
|
|
++ prep
|
|
|
|
:> adapts state
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-04-27 13:15:41 +03:00
|
|
|
|= old/(unit state)
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _..prep)
|
2017-04-21 18:37:10 +03:00
|
|
|
?~ old
|
|
|
|
ta-done:ta-init:ta
|
2017-12-08 18:00:40 +03:00
|
|
|
[~ ..prep(+<+ u.old)]
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %utility
|
|
|
|
:> #
|
|
|
|
:> small utility functions.
|
|
|
|
+|
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
2017-12-13 00:34:04 +03:00
|
|
|
++ self
|
2017-12-06 19:09:59 +03:00
|
|
|
(true-self our.bol)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ server
|
|
|
|
:> our hall instance
|
2017-06-13 01:19:45 +03:00
|
|
|
^- dock
|
2017-12-13 00:34:04 +03:00
|
|
|
[self %hall]
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ inbox
|
|
|
|
:> client's circle name
|
|
|
|
:>
|
|
|
|
:> produces the name of the circle used by this
|
|
|
|
:> client for all its operations
|
2017-12-18 16:20:45 +03:00
|
|
|
^- name
|
2017-11-01 20:35:06 +03:00
|
|
|
%inbox
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ incir
|
|
|
|
:> client's circle
|
|
|
|
:>
|
|
|
|
:> ++inbox, except a full circle.
|
2017-06-13 01:19:45 +03:00
|
|
|
^- circle
|
2017-12-13 00:34:04 +03:00
|
|
|
[self inbox]
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ renum
|
|
|
|
:> find the grams list index for gram with serial.
|
2017-10-06 01:02:59 +03:00
|
|
|
|= ser/serial
|
|
|
|
^- (unit @ud)
|
|
|
|
=+ num=(~(get by known) ser)
|
|
|
|
?~ num ~
|
|
|
|
`(sub count +(u.num))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ recall
|
|
|
|
:> find a known gram with serial {ser}.
|
2017-10-06 01:02:59 +03:00
|
|
|
|= ser/serial
|
|
|
|
^- (unit telegram)
|
|
|
|
=+ num=(renum ser)
|
|
|
|
?~ num ~
|
|
|
|
`(snag u.num grams)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ bound-from-binds
|
|
|
|
:> bound from binds
|
|
|
|
:>
|
|
|
|
:> using a mapping of character to audiences, create
|
|
|
|
:> a mapping of audience to character.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-11-02 18:36:23 +03:00
|
|
|
|= bin/_binds
|
|
|
|
^+ bound
|
2017-10-19 03:05:53 +03:00
|
|
|
%- ~(gas by *(map audience char))
|
2017-06-13 01:19:45 +03:00
|
|
|
=- (zing -)
|
2017-11-02 18:36:23 +03:00
|
|
|
%+ turn ~(tap by bin)
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {a/char b/(set audience)}
|
|
|
|
(turn ~(tap by b) |=(c/audience [c a]))
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ glyph
|
|
|
|
:> finds a new glyph for assignment.
|
2017-11-25 01:05:12 +03:00
|
|
|
::
|
|
|
|
|= idx/@
|
|
|
|
=< cha
|
|
|
|
%+ reel glyphs
|
|
|
|
|= {all/tape ole/{cha/char num/@}}
|
|
|
|
=+ new=(snag (mod idx (lent all)) all)
|
|
|
|
=+ num=~(wyt in (~(get ju binds) new))
|
|
|
|
?~ cha.ole [new num]
|
|
|
|
?: (lth num.ole num)
|
|
|
|
ole
|
|
|
|
[new num]
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ peer-client
|
|
|
|
:> ui state peer move
|
2017-12-08 17:58:58 +03:00
|
|
|
^- move
|
2017-12-14 03:36:28 +03:00
|
|
|
:* 0
|
2017-12-08 17:58:58 +03:00
|
|
|
%peer
|
|
|
|
/server/client
|
|
|
|
server
|
|
|
|
/client
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ peer-inbox
|
|
|
|
^- move
|
2017-12-14 03:36:28 +03:00
|
|
|
:* 0
|
2017-12-08 17:58:58 +03:00
|
|
|
%peer
|
|
|
|
/server/inbox
|
|
|
|
server
|
|
|
|
/circle/[inbox]/grams/config/group/(scot %ud count)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %engines
|
|
|
|
:> #
|
|
|
|
:> main cores.
|
|
|
|
+|
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta
|
|
|
|
:> per transaction
|
|
|
|
:>
|
|
|
|
:> for every transaction/event (poke, peer etc.)
|
|
|
|
:> talk 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-12-19 02:53:59 +03:00
|
|
|
|_ :> moves: moves created by core operations.
|
2017-04-21 18:37:10 +03:00
|
|
|
::
|
|
|
|
moves/(list move)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> # %resolve
|
|
|
|
+|
|
|
|
|
::
|
|
|
|
++ 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 ~
|
2017-12-19 02:53:59 +03:00
|
|
|
?~ t.q.yop `i.q.yop :: single sole-effect
|
|
|
|
`[%mor (flop q.yop)] :: more sole-effects
|
2017-04-21 18:37:10 +03:00
|
|
|
:: produce moves or sole-effects and moves.
|
|
|
|
?~ foc moz
|
2017-11-16 02:56:33 +03:00
|
|
|
?~ id.cli ~&(%client-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-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %emitters
|
|
|
|
:> #
|
|
|
|
:> arms that create outward changes.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-emil
|
|
|
|
:> emit move list
|
|
|
|
:>
|
|
|
|
:> adds multiple moves to the core's list.
|
|
|
|
:> flops to emulate ++ta-emit.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-emit
|
|
|
|
:> adds a move to the core's list.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %interaction-events
|
|
|
|
:> #
|
|
|
|
:> arms that apply events we received.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-init
|
|
|
|
:> subscribes to our hall.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
%- ta-emil
|
|
|
|
^- (list move)
|
2017-12-08 17:58:58 +03:00
|
|
|
~[peer-client peer-inbox]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-take
|
|
|
|
:> accept prize
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
|= piz/prize
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-10-09 12:57:36 +03:00
|
|
|
?+ -.piz +>
|
2017-11-16 02:56:33 +03:00
|
|
|
$client
|
2017-06-13 01:19:45 +03:00
|
|
|
%= +>
|
2017-11-02 18:36:23 +03:00
|
|
|
binds gys.piz
|
|
|
|
bound (bound-from-binds gys.piz)
|
2017-06-13 01:19:45 +03:00
|
|
|
nicks nis.piz
|
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
$circle
|
2017-07-21 02:57:53 +03:00
|
|
|
%. nes.piz
|
|
|
|
%= ta-unpack
|
2017-10-09 23:50:17 +03:00
|
|
|
sources (~(run in src.loc.cos.piz) head)
|
2017-06-13 01:19:45 +03:00
|
|
|
mirrors (~(put by rem.cos.piz) incir loc.cos.piz)
|
2017-07-11 02:41:47 +03:00
|
|
|
remotes (~(put by rem.pes.piz) incir loc.pes.piz)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-hear
|
|
|
|
:> apply change
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= rum/rumor
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-10-09 12:57:36 +03:00
|
|
|
?+ -.rum +>
|
2017-11-16 02:56:33 +03:00
|
|
|
$client
|
2017-07-22 01:53:24 +03:00
|
|
|
?- -.rum.rum
|
2017-06-13 01:19:45 +03:00
|
|
|
$glyph
|
2017-07-22 01:53:24 +03:00
|
|
|
(ta-change-glyph +.rum.rum)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
$nick
|
2017-07-22 01:53:24 +03:00
|
|
|
+>(nicks (change-nicks nicks who.rum.rum nic.rum.rum))
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
$circle
|
2017-07-22 01:53:24 +03:00
|
|
|
(ta-change-circle rum.rum)
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-change-circle
|
|
|
|
:> apply circle change
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= rum/rumor-story
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.rum
|
|
|
|
~&([%unexpected-circle-rumor -.rum] +>)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
$gram
|
2017-07-22 01:53:24 +03:00
|
|
|
(ta-learn gam.nev.rum)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
$config
|
2017-11-14 01:44:44 +03:00
|
|
|
=+ cur=(fall (~(get by mirrors) cir.rum) *config)
|
|
|
|
=. +>.$
|
|
|
|
=< sh-done
|
|
|
|
%- ~(sh-show-config sh cli)
|
|
|
|
[cir.rum cur dif.rum]
|
2017-12-11 22:14:31 +03:00
|
|
|
=? +>.$
|
|
|
|
?& ?=($source -.dif.rum)
|
|
|
|
add.dif.rum
|
|
|
|
=(cir.rum incir)
|
|
|
|
==
|
2017-11-25 01:05:12 +03:00
|
|
|
=* cir cir.src.dif.rum
|
|
|
|
=+ ren=~(cr-phat cr cir)
|
|
|
|
=+ gyf=(~(get by bound) [cir ~ ~])
|
|
|
|
=< sh-done
|
|
|
|
=> :_ .
|
|
|
|
%- ~(sh-act sh cli)
|
|
|
|
[%notify [cir ~ ~] `%hear]
|
|
|
|
?^ gyf
|
|
|
|
(sh-note "has glyph {[u.gyf ~]} for {ren}")
|
|
|
|
:: we use the rendered circle name to determine
|
|
|
|
:: the glyph for higher glyph consistency when
|
|
|
|
:: federating.
|
|
|
|
=+ cha=(glyph (mug ren))
|
|
|
|
(sh-work %bind cha `[cir ~ ~])
|
2017-11-14 01:44:44 +03:00
|
|
|
%= +>.$
|
2017-06-13 01:19:45 +03:00
|
|
|
sources
|
2017-11-25 01:05:12 +03:00
|
|
|
?. &(?=($source -.dif.rum) =(cir.rum incir))
|
2017-06-13 01:19:45 +03:00
|
|
|
sources
|
2017-10-09 23:50:17 +03:00
|
|
|
%. cir.src.dif.rum
|
2017-07-22 01:53:24 +03:00
|
|
|
?: add.dif.rum
|
2017-06-28 21:12:12 +03:00
|
|
|
~(put in sources)
|
|
|
|
~(del in sources)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
mirrors
|
2017-07-22 01:53:24 +03:00
|
|
|
?: ?=($remove -.dif.rum) (~(del by mirrors) cir.rum)
|
|
|
|
%+ ~(put by mirrors) cir.rum
|
2017-11-14 01:44:44 +03:00
|
|
|
(change-config cur dif.rum)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
$status
|
2017-11-14 00:25:05 +03:00
|
|
|
=+ rem=(fall (~(get by remotes) cir.rum) *group)
|
|
|
|
=+ cur=(fall (~(get by rem) who.rum) *status)
|
|
|
|
=. +>.$
|
|
|
|
=< sh-done
|
|
|
|
%- ~(sh-show-status sh cli)
|
|
|
|
[cir.rum who.rum cur dif.rum]
|
|
|
|
%= +>.$
|
2017-06-13 01:19:45 +03:00
|
|
|
remotes
|
2017-07-22 01:53:24 +03:00
|
|
|
%+ ~(put by remotes) cir.rum
|
|
|
|
?: ?=($remove -.dif.rum) (~(del by rem) who.rum)
|
|
|
|
%+ ~(put by rem) who.rum
|
2017-11-14 00:25:05 +03:00
|
|
|
(change-status cur dif.rum)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-03-29 01:11:12 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-change-glyph
|
|
|
|
:> applies new set of glyph bindings.
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {bin/? gyf/char aud/audience}
|
2017-03-29 01:11:12 +03:00
|
|
|
^+ +>
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ nek=(change-glyphs binds bin gyf aud)
|
|
|
|
?: =(nek binds) +>.$ :: no change
|
|
|
|
=. binds nek
|
|
|
|
=. bound (bound-from-binds nek)
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-done:~(sh-prod sh cli)
|
2017-03-27 15:52:53 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %messages
|
|
|
|
:> #
|
|
|
|
:> storing and updating messages.
|
|
|
|
+|
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-unpack
|
|
|
|
:> open envelopes
|
|
|
|
:>
|
|
|
|
:> the client currently doesn't care about nums.
|
2017-07-21 02:57:53 +03:00
|
|
|
::
|
|
|
|
|= nes/(list envelope)
|
|
|
|
^+ +>
|
|
|
|
(ta-lesson (turn nes tail))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-lesson
|
|
|
|
:> 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-12-19 02:53:59 +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-10-06 01:02:59 +03:00
|
|
|
=+ old=(renum uid.gam)
|
2017-04-11 23:36:11 +03:00
|
|
|
?~ old
|
2017-12-19 02:53:59 +03:00
|
|
|
(ta-append gam) :: add
|
|
|
|
(ta-revise u.old gam) :: modify
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-append
|
|
|
|
:> store a new telegram.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-11 23:36:11 +03:00
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-06-13 21:16:19 +03:00
|
|
|
=: grams [gam grams]
|
|
|
|
count +(count)
|
2017-07-11 03:23:12 +03:00
|
|
|
known (~(put by known) uid.gam count)
|
2017-04-11 23:36:11 +03:00
|
|
|
==
|
2017-06-13 21:16:19 +03:00
|
|
|
=< sh-done
|
|
|
|
(~(sh-gram sh cli) gam)
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-revise
|
|
|
|
:> modify a telegram we know.
|
2017-04-11 23:36:11 +03:00
|
|
|
::
|
|
|
|
|= {num/@ud gam/telegram}
|
2017-10-06 01:02:59 +03:00
|
|
|
=+ old=(snag num grams)
|
2017-06-13 21:16:19 +03:00
|
|
|
?: =(gam old) +>.$ :: no change
|
2017-12-14 18:57:18 +03:00
|
|
|
=. grams
|
|
|
|
%+ welp
|
|
|
|
(scag num grams)
|
|
|
|
[gam (slag +(num) grams)]
|
2017-07-11 03:23:12 +03:00
|
|
|
?: =(sep.gam sep.old) +>.$ :: no worthy change
|
2017-06-13 21:16:19 +03:00
|
|
|
=< sh-done
|
|
|
|
(~(sh-gram sh cli) gam)
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %console
|
|
|
|
:> #
|
|
|
|
:> arms for shell functionality.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-console
|
|
|
|
:> initialize the shell of this client.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
^+ .
|
|
|
|
=/ she/shell
|
2017-11-02 18:20:30 +03:00
|
|
|
%*(. *shell id ost.bol, active (sy incir ~), width 80)
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-done:~(sh-prod sh she)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ta-sole
|
|
|
|
:> apply sole input
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
|
|
|
?. =(id.cli ost.bol)
|
|
|
|
~&(%strange-sole !!)
|
|
|
|
sh-done:(~(sh-sole sh cli) act)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh
|
|
|
|
:> per console
|
|
|
|
:>
|
|
|
|
:> shell core, responsible for handling user input
|
|
|
|
:> and the related actions, and outputting changes
|
|
|
|
:> to the cli.
|
|
|
|
::
|
|
|
|
|_ $: :> she: console state.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
she/shell
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> # %resolve
|
|
|
|
+|
|
|
|
|
::
|
|
|
|
++ sh-done
|
|
|
|
:> stores changes to the cli.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
^+ +>
|
|
|
|
+>(cli she)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %emitters
|
|
|
|
:> #
|
|
|
|
:> arms that create outward changes.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-fact
|
|
|
|
:> adds a console effect to ++ta's moves.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= fec/sole-effect
|
|
|
|
^+ +>
|
|
|
|
+>(moves [[id.she %diff %sole-effect fec] moves])
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-act
|
|
|
|
:> adds an action to ++ta's moves.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= act/action
|
|
|
|
^+ +>
|
|
|
|
%= +>
|
|
|
|
moves
|
|
|
|
:_ moves
|
|
|
|
:* ost.bol
|
|
|
|
%poke
|
2017-11-16 02:56:33 +03:00
|
|
|
/client/action
|
|
|
|
server
|
2017-11-08 00:05:52 +03:00
|
|
|
[%hall-action act]
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %cli-interaction
|
|
|
|
:> #
|
|
|
|
:> processing user input as it happens.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-sole
|
|
|
|
:> applies sole action.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= act/sole-action
|
|
|
|
^+ +>
|
|
|
|
?- -.act
|
|
|
|
$det (sh-edit +.act)
|
|
|
|
$clr ..sh-sole :: (sh-pact ~) :: XX clear to PM-to-self?
|
|
|
|
$ret sh-obey
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-edit
|
|
|
|
:> apply sole edit
|
|
|
|
:>
|
|
|
|
:> called when typing into the cli prompt.
|
|
|
|
:> applies the change and does sanitizing.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= 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)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ 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-12-19 02:53:59 +03:00
|
|
|
:> # %parsers
|
|
|
|
:> various parsers for command line input.
|
2017-03-24 23:10:27 +03:00
|
|
|
|%
|
2017-12-19 02:53:59 +03:00
|
|
|
++ expr
|
|
|
|
:> [cord hoon]
|
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-12-19 02:53:59 +03:00
|
|
|
++ dare
|
|
|
|
:> @dr
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ sear
|
|
|
|
|= a/coin
|
|
|
|
?. ?=({$$ $dr @} a) ~
|
|
|
|
(some `@dr`+>.a)
|
|
|
|
nuck:so
|
|
|
|
::
|
2017-12-19 02:53:59 +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-12-19 02:53:59 +03:00
|
|
|
++ cire :< local circle
|
2017-12-18 16:21:52 +03:00
|
|
|
;~(pfix cen urs:ab)
|
2017-04-17 14:14:04 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ circ :< circle
|
2017-03-23 03:34:56 +03:00
|
|
|
;~ pose
|
2017-06-13 01:19:45 +03:00
|
|
|
(cold incir col)
|
2017-12-18 16:21:52 +03:00
|
|
|
;~(pfix cen (stag self urs:ab))
|
|
|
|
;~(pfix fas (stag (sein:title self) urs:ab))
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
|
|
|
%+ cook
|
|
|
|
|= {a/@p b/(unit term)}
|
2017-11-01 20:35:06 +03:00
|
|
|
[a ?^(b u.b %inbox)]
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ plug
|
|
|
|
ship
|
|
|
|
(punt ;~(pfix fas urs:ab))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ circles-flat :< collapse mixed list
|
2017-10-27 22:09:36 +03:00
|
|
|
|= a/(list (each circle (set circle)))
|
|
|
|
^- (set circle)
|
|
|
|
?~ a ~
|
|
|
|
?- -.i.a
|
|
|
|
$& (~(put in $(a t.a)) p.i.a)
|
|
|
|
$| (~(uni in $(a t.a)) p.i.a)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cirs :< non-empty circles
|
2017-10-27 22:09:36 +03:00
|
|
|
%+ cook circles-flat
|
|
|
|
%+ most ;~(plug com (star ace))
|
|
|
|
(^pick circ (sear sh-glyf glyph))
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ drat
|
|
|
|
:> @da or @dr
|
|
|
|
:>
|
|
|
|
:> pas: whether @dr's are in the past or not.
|
2017-11-02 20:23:59 +03:00
|
|
|
|= pas/?
|
|
|
|
=- ;~(pfix sig (sear - crub:so))
|
|
|
|
|= a/^dime
|
|
|
|
^- (unit @da)
|
|
|
|
?+ p.a ~
|
|
|
|
$da `q.a
|
|
|
|
$dr :- ~
|
|
|
|
%. [now.bol q.a]
|
|
|
|
?:(pas sub add)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ pont :< point for range
|
|
|
|
:> hed: whether this is the head or tail point.
|
2017-11-02 20:23:59 +03:00
|
|
|
|= hed/?
|
2017-06-27 02:56:03 +03:00
|
|
|
;~ pose
|
2017-11-02 20:23:59 +03:00
|
|
|
(cold [%da now.bol] (jest 'now'))
|
|
|
|
(stag %da (drat hed))
|
2017-06-27 02:56:03 +03:00
|
|
|
(stag %ud dem:ag)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ rang :< subscription range
|
2017-06-27 02:56:03 +03:00
|
|
|
=+ ;~ pose
|
2017-11-02 20:23:59 +03:00
|
|
|
(cook some ;~(pfix fas (pont |)))
|
2017-06-27 02:56:03 +03:00
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
;~ pose
|
2017-11-02 20:23:59 +03:00
|
|
|
(cook some ;~(plug ;~(pfix fas (pont &)) -))
|
2017-06-27 02:56:03 +03:00
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sorz :< non-empty sources
|
2017-07-11 02:41:47 +03:00
|
|
|
%+ cook ~(gas by *(map circle range))
|
|
|
|
(most ;~(plug com (star ace)) ;~(plug circ rang))
|
2017-06-27 02:56:03 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ pick :< message reference
|
2017-10-06 01:02:59 +03:00
|
|
|
;~(pose nump (cook lent (star sem)))
|
|
|
|
::
|
2017-12-19 02:53:59 +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-12-19 02:53:59 +03:00
|
|
|
++ pore :< security
|
2017-10-31 21:56:56 +03:00
|
|
|
(perk %channel %village %journal %mailbox ~)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ lobe :< y/n loob
|
2017-05-09 22:43:42 +03:00
|
|
|
;~ pose
|
2017-11-13 18:00:50 +03:00
|
|
|
(cold %& ;~(pose (jest 'y') (jest '&') (just 'true')))
|
|
|
|
(cold %| ;~(pose (jest 'n') (jest '|') (just 'false')))
|
2017-05-09 22:43:42 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ message :< exp, lin or url msg
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ pose
|
|
|
|
;~(plug (cold %eval hax) expr)
|
2017-10-06 01:02:59 +03:00
|
|
|
(stag %say speeches)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ speeches :< lin or url msgs
|
2017-10-06 01:08:47 +03:00
|
|
|
%+ most (jest '•')
|
2017-10-06 01:02:59 +03:00
|
|
|
;~ pose
|
2017-10-06 20:35:25 +03:00
|
|
|
(stag %url aurf:de-purl:html)
|
2017-10-06 14:22:12 +03:00
|
|
|
:(stag %lin & ;~(pfix pat text))
|
|
|
|
:(stag %lin | ;~(less sem hax text))
|
2017-03-24 23:10:27 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ text :< msg without break
|
2017-10-06 01:08:47 +03:00
|
|
|
%+ cook crip
|
|
|
|
(plus ;~(less (jest '•') next))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ nick (cook crip (plus next)) :< nickname
|
|
|
|
++ glyph (mask "/\\\{(<!?{(zing glyphs)}") :< circle postfix
|
|
|
|
++ setting :< setting flag
|
2017-03-24 23:10:27 +03:00
|
|
|
%- perk :~
|
2017-10-10 18:17:10 +03:00
|
|
|
%nicks
|
2017-03-24 23:10:27 +03:00
|
|
|
%quiet
|
2017-10-10 18:40:38 +03:00
|
|
|
%notify
|
2017-03-24 23:10:27 +03:00
|
|
|
%showtime
|
|
|
|
==
|
2017-12-19 02:53:59 +03:00
|
|
|
++ work :< full input
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ knee *^work |. ~+
|
|
|
|
=- ;~(pose ;~(pfix sem -) message)
|
|
|
|
;~ pose
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: circle management
|
|
|
|
::
|
2017-06-27 02:56:03 +03:00
|
|
|
;~((glue ace) (perk %join ~) sorz)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
;~((glue ace) (perk %leave ~) cirs)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~ (glue ace) (perk %create ~)
|
|
|
|
pore
|
2017-05-01 20:39:21 +03:00
|
|
|
cire
|
2017-03-24 23:10:27 +03:00
|
|
|
qut
|
|
|
|
==
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-04-14 17:16:36 +03:00
|
|
|
;~ plug (perk %delete ~)
|
2017-12-18 16:20:45 +03:00
|
|
|
;~(pfix ace cire)
|
2017-04-14 17:16:36 +03:00
|
|
|
;~ pose
|
|
|
|
(cook some ;~(pfix ace qut))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-05-01 20:39:21 +03:00
|
|
|
;~((glue ace) (perk %depict ~) cire qut)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-05-09 22:43:42 +03:00
|
|
|
;~((glue ace) (perk %filter ~) cire lobe lobe)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-05-01 20:39:21 +03:00
|
|
|
;~((glue ace) (perk %invite ~) cire shiz)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-05-01 20:39:21 +03:00
|
|
|
;~((glue ace) (perk %banish ~) cire shiz)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-06-27 02:56:03 +03:00
|
|
|
;~((glue ace) (perk %source ~) cire sorz)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-11-09 21:05:58 +03:00
|
|
|
;~((glue ace) (perk %unsource ~) cire sorz)
|
|
|
|
::TODO why do these nest-fail when doing perk with multiple?
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: personal metadata
|
|
|
|
::
|
2017-06-28 02:45:56 +03:00
|
|
|
;~ (glue ace)
|
|
|
|
(perk %attend ~)
|
|
|
|
cirs
|
2017-11-02 02:44:13 +03:00
|
|
|
;~ pose
|
|
|
|
(cold ~ sig)
|
|
|
|
(cook some (perk %gone %idle %hear %talk ~))
|
|
|
|
==
|
2017-06-28 02:45:56 +03:00
|
|
|
==
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-06-28 02:45:56 +03:00
|
|
|
;~ plug
|
|
|
|
(perk %name ~)
|
|
|
|
;~(pfix ace cirs)
|
|
|
|
;~(pfix ace ;~(pose (cook some qut) (cold ~ sig)))
|
|
|
|
;~ pose
|
|
|
|
;~ pfix ace
|
|
|
|
%+ cook some
|
|
|
|
;~ pose
|
|
|
|
;~((glue ace) qut (cook some qut) qut)
|
|
|
|
;~(plug qut (cold ~ ace) qut)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
;~(pfix ace (cold ~ sig))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: displaying info
|
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
;~(plug (perk %who ~) ;~(pose ;~(pfix ace cirs) (easy ~)))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-11-10 02:01:50 +03:00
|
|
|
;~ plug
|
|
|
|
(perk %what ~)
|
|
|
|
;~ pose
|
|
|
|
;~(pfix ace (cook some ;~(pose glyph cirs)))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
2017-12-14 03:36:02 +03:00
|
|
|
::
|
|
|
|
;~((glue ace) (perk %sources ~) circ)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-11-03 23:36:42 +03:00
|
|
|
;~((glue ace) (perk %show ~) circ)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-11-03 23:36:42 +03:00
|
|
|
;~((glue ace) (perk %hide ~) circ)
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: ui settings
|
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
;~(plug (perk %bind ~) ;~(pfix ace glyph) (punt ;~(pfix ace cirs)))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
;~(plug (perk %unbind ~) ;~(pfix ace glyph) (punt ;~(pfix ace cirs)))
|
2017-11-17 23:14:42 +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-11-17 23:14:42 +03:00
|
|
|
::
|
2017-11-02 18:20:30 +03:00
|
|
|
;~(plug (cold %width (jest 'set width ')) dem:ag)
|
2017-11-17 23:32:44 +03:00
|
|
|
::
|
|
|
|
;~ plug
|
|
|
|
(cold %timez (jest 'set timezone '))
|
|
|
|
::
|
|
|
|
;~ pose
|
|
|
|
(cold %| (just '-'))
|
|
|
|
(cold %& (just '+'))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
%+ sear
|
|
|
|
|= a/@ud
|
|
|
|
^- (unit @ud)
|
|
|
|
?: &((gte a 0) (lte a 14))
|
|
|
|
`a ~
|
|
|
|
dem:ag
|
|
|
|
==
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %set ~) ;~(pose ;~(pfix ace setting) (easy %$)))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %unset ~) ;~(pfix ace setting))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: miscellaneous
|
|
|
|
::
|
2017-03-24 23:10:27 +03:00
|
|
|
;~(plug (perk %help ~) (easy ~))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: (parsers below come last because they match quickly)
|
|
|
|
::
|
|
|
|
:: messaging
|
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
(stag %target ;~(plug cirs (punt ;~(pfix ace message))))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
2017-10-06 01:02:59 +03:00
|
|
|
(stag %reply ;~(plug pick ;~(pfix ace speeches)))
|
2017-11-17 23:14:42 +03:00
|
|
|
::
|
|
|
|
:: displaying info
|
|
|
|
::
|
2017-10-06 01:02:59 +03:00
|
|
|
(stag %number pick)
|
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-12-19 02:53:59 +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
|
|
|
|
~
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$target
|
|
|
|
?~(q.wok ~ $(wok u.q.wok))
|
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-slug
|
|
|
|
:> 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-12-19 02:53:59 +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) ~
|
2017-11-02 20:30:25 +03:00
|
|
|
?: ?=($reply -.u.jub) ~
|
2017-04-24 18:30:01 +03:00
|
|
|
:_ ~
|
|
|
|
[%txt (runt [14 '-'] `tape`['|' ' ' (tufa `(list @)`buf)])]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %user-action
|
|
|
|
:> #
|
|
|
|
:> processing user actions.
|
|
|
|
+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +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
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %helpers
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ 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)
|
2017-05-09 22:43:42 +03:00
|
|
|
$filter (filter +.job)
|
2017-11-02 18:53:19 +03:00
|
|
|
$invite (permit & +.job)
|
|
|
|
$banish (permit | +.job)
|
2017-11-09 21:05:58 +03:00
|
|
|
$source (source & +.job)
|
|
|
|
$unsource (source | +.job)
|
2017-06-13 01:19:45 +03:00
|
|
|
:: personal metadata
|
2017-06-28 02:45:56 +03:00
|
|
|
$attend (attend +.job)
|
2017-12-18 16:20:45 +03:00
|
|
|
$name (set-name +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: 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)
|
2017-10-06 01:02:59 +03:00
|
|
|
$reply (reply +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: displaying info
|
|
|
|
$number (number +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$who (who +.job)
|
|
|
|
$what (what +.job)
|
2017-12-14 03:36:02 +03:00
|
|
|
$sources (list-sources +.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-11-02 18:20:30 +03:00
|
|
|
$width (width +.job)
|
2017-11-17 23:32:44 +03:00
|
|
|
$timez (timez +.job)
|
2017-04-21 18:37:10 +03:00
|
|
|
:: miscelaneous
|
2017-11-03 23:36:42 +03:00
|
|
|
$show (public & +.job)
|
|
|
|
$hide (public | +.job)
|
2017-03-24 23:10:27 +03:00
|
|
|
$help help
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ activate
|
|
|
|
:> prints message details.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
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-07-11 03:23:12 +03:00
|
|
|
sh-prod(active.she aud.gam)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ deli
|
|
|
|
:> gets absolute message number from relative.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= {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-12-19 02:53:59 +03:00
|
|
|
++ set-glyph
|
|
|
|
:> new glyph binding
|
|
|
|
:>
|
|
|
|
:> applies glyph binding to our state and sends
|
|
|
|
:> an action.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {cha/char aud/audience}
|
2017-11-02 18:36:23 +03:00
|
|
|
=: bound (~(put by bound) aud cha)
|
|
|
|
binds (~(put ju binds) cha aud)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
2017-11-25 01:05:12 +03:00
|
|
|
sh-prod:(sh-act %glyph cha aud &)
|
2017-04-18 15:29:17 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ unset-glyph
|
|
|
|
:> remote old glyph binding
|
|
|
|
:>
|
|
|
|
:> removes either {aud} or all bindings on a
|
|
|
|
:> glyph and sends an action.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {cha/char aud/(unit audience)}
|
|
|
|
=/ ole/(set audience)
|
|
|
|
?^ aud [u.aud ~ ~]
|
2017-11-02 18:36:23 +03:00
|
|
|
(~(get ju binds) cha)
|
2017-10-19 03:05:53 +03:00
|
|
|
=. ..sh-work (sh-act %glyph cha (fall aud ~) |)
|
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
|
2017-11-02 18:36:23 +03:00
|
|
|
bound (~(del by bound) n.ole)
|
|
|
|
binds (~(del ju binds) cha n.ole)
|
2017-04-18 15:29:17 +03:00
|
|
|
==
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ reverse-nicks
|
|
|
|
:> finds all ships whose handle matches {nym}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-12 01:50:39 +03:00
|
|
|
|= nym/^nick
|
2017-04-24 18:30:01 +03:00
|
|
|
^- (list ship)
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ murn ~(tap by nicks)
|
2017-07-12 01:50:39 +03:00
|
|
|
|= {p/ship q/^nick}
|
2017-06-13 01:19:45 +03:00
|
|
|
?. =(q nym) ~
|
2017-04-24 18:30:01 +03:00
|
|
|
[~ u=p]
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ hoon-head
|
|
|
|
:> eval data
|
|
|
|
:>
|
|
|
|
:> makes a vase of environment data to evaluate
|
|
|
|
:> against (for #-messages).
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
^- vase
|
|
|
|
!> ^- {our/@p now/@da eny/@uvI}
|
2017-12-13 00:34:04 +03:00
|
|
|
[self now.bol (shas %eny eny.bol)]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %circle-management
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ join
|
|
|
|
:> %join
|
|
|
|
:>
|
|
|
|
:> change local mailbox config to include
|
|
|
|
:> subscriptions to {pas}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
|= pos/(map circle range)
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ pas=~(key by pos)
|
2017-03-31 13:46:40 +03:00
|
|
|
=. ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
sh-prod(active.she pas)
|
2017-12-14 03:30:06 +03:00
|
|
|
:: default to a day of backlog
|
|
|
|
=. pos
|
|
|
|
%- ~(run by pos)
|
|
|
|
|= r/range
|
|
|
|
?~(r `[da+(sub now.bol ~d1) ~] r)
|
2017-11-25 01:05:12 +03:00
|
|
|
(sh-act %source inbox & pos)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ leave
|
|
|
|
:> %leave
|
|
|
|
:>
|
|
|
|
:> change local mailbox config to exclude
|
|
|
|
:> subscriptions to {pas}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
|= pas/(set circle)
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-12-14 03:32:39 +03:00
|
|
|
:: remove *all* sources relating to {pas}.
|
2017-06-27 02:56:03 +03:00
|
|
|
=/ pos
|
2017-12-14 03:32:39 +03:00
|
|
|
%- ~(gas in *(set ^source))
|
|
|
|
%- zing
|
|
|
|
=/ sos
|
|
|
|
=- ~(tap in src:-)
|
|
|
|
(fall (~(get by mirrors) incir) *config)
|
|
|
|
%+ turn ~(tap in pas)
|
|
|
|
|= c/circle
|
|
|
|
%+ skim sos
|
|
|
|
|=(s/^source =(cir.s c))
|
2017-11-02 02:44:13 +03:00
|
|
|
=. ..sh-work
|
|
|
|
(sh-act %source inbox | pos)
|
|
|
|
(sh-act %notify pas ~)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ create
|
|
|
|
:> %create
|
|
|
|
:>
|
|
|
|
:> creates circle {nom} with specified config.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {sec/security nom/name txt/cord}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
=. ..sh-work
|
2017-04-27 00:33:25 +03:00
|
|
|
(sh-act %create nom txt sec)
|
2017-12-13 00:34:04 +03:00
|
|
|
(join [[[self nom] ~] ~ ~])
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ delete
|
|
|
|
:> %delete
|
|
|
|
:>
|
|
|
|
:> deletes our circle {nom}, after optionally
|
|
|
|
:> sending a last announce message {say}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {nom/name say/(unit cord)}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %delete nom say)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ depict
|
|
|
|
:> %depict
|
|
|
|
:>
|
|
|
|
:> changes the description of {nom} to {txt}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {nom/name txt/cord}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %depict nom txt)
|
2017-04-18 15:29:17 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ permit
|
|
|
|
:> %invite / %banish
|
|
|
|
:>
|
|
|
|
:> invites or banishes {sis} to/from our
|
|
|
|
:> circle {nom}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {inv/? nom/name sis/(set ship)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-11-02 18:53:19 +03:00
|
|
|
(sh-act %permit nom inv sis)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-05-09 22:43:42 +03:00
|
|
|
++ filter
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {nom/name cus/? utf/?}
|
2017-05-09 22:43:42 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
(sh-act %filter nom cus utf)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ source
|
|
|
|
:> %source
|
|
|
|
:>
|
|
|
|
:> adds {pas} to {nom}'s src.
|
2017-05-03 19:38:41 +03:00
|
|
|
::
|
2017-12-18 16:20:45 +03:00
|
|
|
|= {sub/? nom/name pos/(map circle range)}
|
2017-05-03 19:38:41 +03:00
|
|
|
^+ ..sh-work
|
2017-11-09 21:05:58 +03:00
|
|
|
(sh-act %source nom sub pos)
|
2017-05-03 19:38:41 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %personal-metadata
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-28 20:40:12 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ attend
|
|
|
|
:> sets our presence to {pec} for {aud}.
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
2017-11-02 02:44:13 +03:00
|
|
|
|= {aud/audience pec/(unit presence)}
|
2017-06-28 02:45:56 +03:00
|
|
|
^+ ..sh-work
|
2017-10-19 03:05:53 +03:00
|
|
|
(sh-act %notify aud pec)
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
2017-12-19 17:33:30 +03:00
|
|
|
++ set-name
|
2017-12-19 02:53:59 +03:00
|
|
|
:> sets our name to {man} for {aud}.
|
2017-04-28 20:40:12 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {aud/audience man/human}
|
2017-04-28 20:40:12 +03:00
|
|
|
^+ ..sh-work
|
2017-10-19 03:05:53 +03:00
|
|
|
(sh-act %naming aud man)
|
2017-04-28 20:40:12 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %messaging
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ say
|
|
|
|
:> sends message.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= 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)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ eval
|
|
|
|
:> run
|
|
|
|
:>
|
|
|
|
:> executes {exe} and sends both its code and
|
|
|
|
:> result.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-11-27 21:27:20 +03:00
|
|
|
|= {txt/cord exe/hoon}
|
|
|
|
=> |.([(sell (slap (slop hoon-head seed) exe))]~)
|
2017-04-24 18:30:01 +03:00
|
|
|
=+ tan=p:(mule .)
|
2017-07-01 04:44:37 +03:00
|
|
|
(say [%exp txt tan] ~)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ target
|
|
|
|
:> %target
|
|
|
|
:>
|
|
|
|
:> sets messaging target, then execute {woe}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {aud/audience woe/(unit ^work)}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
2017-10-19 03:05:53 +03:00
|
|
|
=. ..sh-pact (sh-pact aud)
|
2017-04-24 18:30:01 +03:00
|
|
|
?~(woe ..sh-work work(job u.woe))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ reply
|
|
|
|
:> %reply
|
|
|
|
:>
|
|
|
|
:> send a reply to the selected message.
|
2017-10-06 01:02:59 +03:00
|
|
|
::
|
|
|
|
|= {num/$@(@ud {p/@u q/@ud}) sep/(list speech)}
|
|
|
|
^+ ..sh-work
|
2017-11-02 20:30:25 +03:00
|
|
|
:: =- (say (turn ... [%ire - s])) nest-fails on the - ???
|
2017-10-06 01:02:59 +03:00
|
|
|
::TODO what's friendlier, reply-to-null or error?
|
|
|
|
=/ ser/serial
|
|
|
|
?@ num
|
|
|
|
?: (gte num count) 0v0
|
|
|
|
uid:(snag num grams)
|
|
|
|
?: (gth q.num count) 0v0
|
|
|
|
?: =(count 0) 0v0
|
|
|
|
=+ msg=(deli (dec count) num)
|
|
|
|
uid:(snag (sub count +(msg)) grams)
|
2017-11-02 20:30:25 +03:00
|
|
|
(say (turn sep |=(s/speech [%ire ser s])))
|
2017-10-06 01:02:59 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %displaying-info
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ who
|
|
|
|
:> %who
|
|
|
|
:>
|
|
|
|
:> prints presence lists for {cis} or all.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-27 23:58:10 +03:00
|
|
|
|= cis/(set circle) ^+ ..sh-work
|
2017-10-06 20:35:25 +03:00
|
|
|
=< (sh-fact %mor (murn (sort ~(tap by remotes) aor) .))
|
2017-10-27 23:58:10 +03:00
|
|
|
|= {cir/circle gop/group} ^- (unit sole-effect)
|
|
|
|
?. |(=(~ cis) (~(has in cis) cir)) ~
|
2017-10-31 21:56:56 +03:00
|
|
|
?: =(%mailbox sec.con:(fall (~(get by mirrors) cir) *config)) ~
|
2017-10-27 23:58:10 +03:00
|
|
|
?. (~(has in sources) cir) ~
|
2017-11-02 19:14:57 +03:00
|
|
|
=- `[%tan rose+[", " `~]^- leaf+~(cr-full cr cir) ~]
|
2017-10-06 20:35:25 +03:00
|
|
|
=< (murn (sort ~(tap by gop) aor) .)
|
2017-04-24 18:30:01 +03:00
|
|
|
|= {a/ship b/presence c/human} ^- (unit tank)
|
2017-10-10 17:44:37 +03:00
|
|
|
=? c =(han.c `(scot %p a)) [~ 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-12-19 02:53:59 +03:00
|
|
|
++ what
|
|
|
|
:> %what
|
|
|
|
:>
|
|
|
|
:> prints binding details. goes both ways.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-11-10 02:01:50 +03:00
|
|
|
|= qur/(unit $@(char audience))
|
2017-04-14 17:16:36 +03:00
|
|
|
^+ ..sh-work
|
2017-04-24 18:30:01 +03:00
|
|
|
?^ qur
|
2017-11-10 02:01:50 +03:00
|
|
|
?^ u.qur
|
|
|
|
=+ cha=(~(get by bound) u.qur)
|
|
|
|
(sh-fact %txt ?~(cha "none" [u.cha]~))
|
|
|
|
=+ pan=~(tap in (~(get ju binds) u.qur))
|
|
|
|
?: =(~ pan) (sh-fact %txt "~")
|
|
|
|
=< (sh-fact %mor (turn pan .))
|
|
|
|
|=(a/audience [%txt ~(ar-phat ar a)])
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%- ~(rep by binds)
|
|
|
|
|= $: {gyf/char aus/(set audience)}
|
|
|
|
lis/(list sole-effect)
|
|
|
|
==
|
|
|
|
%+ weld lis
|
|
|
|
^- (list sole-effect)
|
|
|
|
%- ~(rep in aus)
|
|
|
|
|= {a/audience l/(list sole-effect)}
|
|
|
|
%+ weld l
|
|
|
|
^- (list sole-effect)
|
|
|
|
[%txt [gyf ' ' ~(ar-phat ar a)]]~
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ number
|
|
|
|
:> %number
|
|
|
|
:>
|
|
|
|
:> finds selected message, expand it.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= 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-12-19 02:53:59 +03:00
|
|
|
++ list-sources
|
|
|
|
:> %sources
|
|
|
|
:>
|
|
|
|
:> display the active sources for our circle.
|
2017-12-14 03:36:02 +03:00
|
|
|
::
|
|
|
|
|= cir/circle
|
|
|
|
^+ ..sh-work
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn
|
|
|
|
:: make sure to exclude {nom} itself.
|
|
|
|
=- ~(tap in (~(del in src:-) [cir ~]))
|
|
|
|
(fall (~(get by mirrors) cir) *config)
|
|
|
|
|= s/^source
|
|
|
|
^- sole-effect
|
|
|
|
:- %txt
|
|
|
|
%+ weld ~(cr-phat cr cir.s)
|
|
|
|
%+ roll (range-to-path ran.s)
|
|
|
|
|= {a/@ta b/tape}
|
|
|
|
:(weld b "/" (trip a))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %ui-settings
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ bind
|
|
|
|
:> %bind
|
|
|
|
:>
|
|
|
|
:> binds targets {aud} to the glyph {cha}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {cha/char aud/(unit audience)}
|
2017-04-14 17:16:36 +03:00
|
|
|
^+ ..sh-work
|
2017-10-19 03:05:53 +03:00
|
|
|
?~ aud $(aud `active.she)
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ ole=(~(get by bound) u.aud)
|
2017-04-24 18:30:01 +03:00
|
|
|
?: =(ole [~ cha]) ..sh-work
|
2017-10-19 03:05:53 +03:00
|
|
|
%. "bound {<cha>} {<u.aud>}"
|
|
|
|
sh-note:sh-prod:(set-glyph cha u.aud)
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ unbind
|
|
|
|
:> %unbind
|
|
|
|
:>
|
|
|
|
:> unbinds targets {aud} to glyph {cha}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {cha/char aud/(unit audience)}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
2017-11-02 18:36:23 +03:00
|
|
|
?. ?| &(?=(^ aud) (~(has by bound) u.aud))
|
|
|
|
&(?=($~ aud) (~(has by binds) cha))
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
..sh-work
|
|
|
|
%. "unbound {<cha>}"
|
2017-10-19 03:05:53 +03:00
|
|
|
sh-note:sh-prod:(unset-glyph cha aud)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ nick
|
|
|
|
:> %nick
|
|
|
|
:>
|
|
|
|
:> either shows, sets or unsets nicknames
|
|
|
|
:> depending on arguments.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-12 01:50:39 +03:00
|
|
|
|= {her/(unit ship) nym/(unit ^nick)}
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ ..sh-work
|
2017-12-19 02:53:59 +03:00
|
|
|
:: no arguments, show all
|
2017-03-24 23:10:27 +03:00
|
|
|
?: ?=({$~ $~} +<)
|
|
|
|
%+ sh-fact %mor
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ turn ~(tap by nicks)
|
2017-07-12 01:50:39 +03:00
|
|
|
|= {p/ship q/^nick}
|
2017-03-24 23:10:27 +03:00
|
|
|
:- %txt
|
2017-06-13 01:19:45 +03:00
|
|
|
"{<p>}: {<q>}"
|
2017-12-19 02:53:59 +03:00
|
|
|
:: show her nick
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ nym
|
|
|
|
?> ?=(^ her)
|
2017-06-13 01:19:45 +03:00
|
|
|
=+ asc=(~(get by nicks) u.her)
|
2017-03-24 23:10:27 +03:00
|
|
|
%+ sh-fact %txt
|
|
|
|
?~ asc "{<u.her>} unbound"
|
2017-06-13 01:19:45 +03:00
|
|
|
"{<u.her>}: {<u.asc>}"
|
2017-12-19 02:53:59 +03:00
|
|
|
:: show nick ship
|
2017-03-24 23:10:27 +03:00
|
|
|
?~ her
|
|
|
|
%+ sh-fact %mor
|
2017-06-13 01:19:45 +03:00
|
|
|
%+ turn (reverse-nicks u.nym)
|
2017-03-24 23:10:27 +03:00
|
|
|
|= p/ship
|
|
|
|
[%txt "{<p>}: {<u.nym>}"]
|
2017-06-13 01:19:45 +03:00
|
|
|
%. [%nick u.her (fall nym '')]
|
2017-04-21 18:37:10 +03:00
|
|
|
%= sh-act
|
2017-06-13 01:19:45 +03:00
|
|
|
nicks
|
2017-04-24 18:30:01 +03:00
|
|
|
?~ u.nym
|
2017-12-19 02:53:59 +03:00
|
|
|
:: unset nickname
|
2017-06-13 01:19:45 +03:00
|
|
|
(~(del by nicks) u.her)
|
2017-12-19 02:53:59 +03:00
|
|
|
:: set nickname
|
2017-06-13 01:19:45 +03:00
|
|
|
(~(put by nicks) u.her u.nym)
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ wo-set
|
|
|
|
:> %set
|
|
|
|
:>
|
|
|
|
:> enables ui setting flag.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-18 00:30:52 +03:00
|
|
|
|= seg/term
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
?~ seg
|
|
|
|
%+ sh-fact %mor
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ turn ~(tap in settings.she)
|
2017-07-18 00:30:52 +03:00
|
|
|
|= s/term
|
2017-04-24 18:30:01 +03:00
|
|
|
[%txt (trip s)]
|
|
|
|
%= ..sh-work
|
|
|
|
settings.she (~(put in settings.she) seg)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ unset
|
|
|
|
:> %unset
|
|
|
|
:>
|
|
|
|
:> disables ui setting flag.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-18 00:30:52 +03:00
|
|
|
|= neg/term
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ ..sh-work
|
|
|
|
%= ..sh-work
|
|
|
|
settings.she (~(del in settings.she) neg)
|
2017-03-24 23:10:27 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ width
|
|
|
|
:> ;set width
|
|
|
|
:>
|
|
|
|
:> change the display width in cli.
|
2017-11-02 18:20:30 +03:00
|
|
|
::
|
|
|
|
|= wid/@ud
|
|
|
|
^+ ..sh-work
|
|
|
|
..sh-work(width.she (max 30 wid))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ timez
|
|
|
|
:> ;set timezone
|
|
|
|
:>
|
|
|
|
:> adjust the displayed timestamp.
|
2017-11-17 23:32:44 +03:00
|
|
|
::
|
|
|
|
|= tim/(pair ? @ud)
|
|
|
|
^+ ..sh-work
|
|
|
|
..sh-work(timez.she tim)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %miscellaneous
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ public
|
|
|
|
:> show/hide membership
|
|
|
|
:>
|
|
|
|
:> adds or removes the circle from the public
|
|
|
|
:> membership list.
|
2017-11-03 23:36:42 +03:00
|
|
|
::
|
|
|
|
|= {add/? cir/circle}
|
|
|
|
(sh-act %public add cir)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ help
|
|
|
|
:> %help
|
|
|
|
:>
|
|
|
|
:> prints help message
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
(sh-fact %txt "see http://urbit.org/docs/using/messaging/")
|
|
|
|
--
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-pact
|
|
|
|
:> update active aud
|
|
|
|
:>
|
|
|
|
:> change currently selected audience to {aud}
|
|
|
|
:> and update the prompt.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= aud/audience
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ +>
|
2017-12-19 02:53:59 +03:00
|
|
|
:: ensure we can see what we send.
|
2017-10-19 03:05:53 +03:00
|
|
|
=+ act=(sh-pare aud)
|
2017-04-24 18:30:01 +03:00
|
|
|
?: =(active.she act) +>.$
|
|
|
|
sh-prod(active.she act)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-pare
|
|
|
|
:> adjust target list
|
|
|
|
:>
|
|
|
|
:> if the audience {aud} does not contain a
|
|
|
|
:> circle we're subscribed to, add our mailbox
|
|
|
|
:> to the audience (so that we can see our own
|
|
|
|
:> message).
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= aud/audience
|
|
|
|
?: (sh-pear aud) aud
|
|
|
|
(~(put in aud) incir)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-pear
|
|
|
|
:> hearback
|
|
|
|
:>
|
|
|
|
:> produces true if any circle is included in
|
|
|
|
:> our subscriptions, meaning, we hear messages
|
|
|
|
:> sent to {aud}.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= aud/audience
|
|
|
|
?~ aud |
|
|
|
|
?| (~(has in sources) `circle`n.aud)
|
|
|
|
$(aud l.aud)
|
|
|
|
$(aud r.aud)
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-glyf
|
|
|
|
:> decode glyph
|
|
|
|
:>
|
|
|
|
:> finds the circle(s) that match a glyph.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= cha/char ^- (unit audience)
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ lax=(~(get ju binds) cha)
|
2017-12-19 02:53:59 +03:00
|
|
|
:: no circle.
|
2017-04-24 18:30:01 +03:00
|
|
|
?: =(~ lax) ~
|
2017-12-19 02:53:59 +03:00
|
|
|
:: single circle.
|
2017-04-24 18:30:01 +03:00
|
|
|
?: ?=({* $~ $~} lax) `n.lax
|
2017-12-19 02:53:59 +03:00
|
|
|
:: in case of multiple audiences, pick the most recently active one.
|
2017-10-19 03:05:53 +03:00
|
|
|
|- ^- (unit audience)
|
2017-04-24 18:30:01 +03:00
|
|
|
?~ grams ~
|
2017-12-19 02:53:59 +03:00
|
|
|
:: get first circle from a telegram's audience.
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ pan=(silt ~(tap in aud.i.grams))
|
2017-04-24 18:30:01 +03:00
|
|
|
?: (~(has in lax) pan) `pan
|
|
|
|
$(grams t.grams)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %differs
|
|
|
|
:> #
|
|
|
|
:> arms that calculate differences between datasets.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-group-diff
|
|
|
|
:> group diff parts
|
|
|
|
:>
|
|
|
|
:> calculates the difference between two presence
|
|
|
|
:> lists, producing lists of removed, added and
|
|
|
|
:> changed presences.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
|= {one/group two/group}
|
2017-04-24 18:30:01 +03:00
|
|
|
=| $= ret
|
|
|
|
$: old/(list (pair ship status))
|
|
|
|
new/(list (pair ship status))
|
|
|
|
cha/(list (pair ship status))
|
|
|
|
==
|
|
|
|
^+ ret
|
|
|
|
=. ret
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ eno=~(tap by one)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ 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
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ owt=~(tap by two)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ 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
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-rempe-diff
|
|
|
|
:> remotes diff
|
|
|
|
:>
|
|
|
|
:> calculates the difference between two remote
|
|
|
|
:> presence maps, producing a list of removed,
|
|
|
|
:> added and changed presences maps.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
|= {one/(map circle group) two/(map circle group)}
|
2017-04-24 18:30:01 +03:00
|
|
|
=| $= ret
|
2017-07-11 02:41:47 +03:00
|
|
|
$: old/(list (pair circle group))
|
|
|
|
new/(list (pair circle group))
|
|
|
|
cha/(list (pair circle group))
|
2017-04-24 18:30:01 +03:00
|
|
|
==
|
|
|
|
^+ ret
|
|
|
|
=. ret
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ eno=~(tap by one)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ 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
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ owt=~(tap by two)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ ret
|
|
|
|
?~ owt ret
|
|
|
|
=. ret $(owt t.owt)
|
|
|
|
?: (~(has by one) p.i.owt)
|
|
|
|
ret
|
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
ret
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-remco-diff
|
|
|
|
:> config diff parts
|
|
|
|
:>
|
|
|
|
:> calculates the difference between two config
|
|
|
|
:> maps, producing lists of removed, added and
|
|
|
|
:> changed configs.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
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
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ eno=~(tap by one)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ 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
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ owt=~(tap by two)
|
2017-04-24 18:30:01 +03:00
|
|
|
|- ^+ ret
|
|
|
|
?~ owt ret
|
|
|
|
=. ret $(owt t.owt)
|
|
|
|
?: (~(has by one) p.i.owt)
|
|
|
|
ret
|
|
|
|
ret(new [i.owt new.ret])
|
|
|
|
ret
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-set-diff
|
|
|
|
:> set diff
|
|
|
|
:>
|
|
|
|
:> calculates the difference between two sets,
|
|
|
|
:> procuding lists of removed and added items.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|* {one/(set *) two/(set *)}
|
2017-10-06 20:35:25 +03:00
|
|
|
:- ^= old ~(tap in (~(dif in one) two))
|
|
|
|
^= new ~(tap in (~(dif in two) one))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %printers
|
|
|
|
:> #
|
|
|
|
:> arms for printing data to the cli.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-lame
|
|
|
|
:> send error
|
|
|
|
:>
|
|
|
|
:> just puts some text into the cli as-is.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
(sh-fact [%txt txt])
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-note
|
|
|
|
:> shell message
|
|
|
|
:>
|
|
|
|
:> left-pads {txt} with heps and prints it.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= txt/tape
|
|
|
|
^+ +>
|
2017-12-11 23:00:55 +03:00
|
|
|
%+ sh-fact %txt
|
|
|
|
%+ runt [14 '-']
|
|
|
|
`tape`['|' ' ' (scag (sub width.she 16) txt)]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-prod
|
|
|
|
:> show prompt
|
|
|
|
:>
|
|
|
|
:> makes and stores a move to modify the cli
|
|
|
|
:> prompt to display the current audience.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
^+ .
|
|
|
|
%+ sh-fact %pro
|
|
|
|
:+ & %talk-line
|
|
|
|
^- tape
|
2017-10-19 03:05:53 +03:00
|
|
|
=/ rew/(pair (pair cord cord) audience)
|
2017-04-24 18:30:01 +03:00
|
|
|
[['[' ']'] active.she]
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ cha=(~(get by bound) q.rew)
|
2017-04-24 18:30:01 +03:00
|
|
|
?^ cha ~[u.cha ' ']
|
|
|
|
=+ por=~(ar-prom ar q.rew)
|
|
|
|
(weld `tape`[p.p.rew por] `tape`[q.p.rew ' ' ~])
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-rend
|
|
|
|
:> prints a telegram as rendered by ++tr-rend.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= gam/telegram
|
2017-05-09 17:57:35 +03:00
|
|
|
^+ +>
|
|
|
|
=+ lis=~(tr-rend tr settings.she gam)
|
|
|
|
?~ lis +>.$
|
|
|
|
%+ sh-fact %mor
|
|
|
|
%+ turn `(list tape)`lis
|
2017-12-13 00:34:04 +03:00
|
|
|
=+ nom=(scag 7 (cite:title self))
|
2017-05-09 17:57:35 +03:00
|
|
|
|= t/tape
|
2017-10-10 18:40:38 +03:00
|
|
|
?. ?& (~(has in settings.she) %notify)
|
|
|
|
?=(^ (find nom (slag 15 t)))
|
|
|
|
==
|
|
|
|
[%txt t]
|
|
|
|
[%mor [%txt t] [%bel ~] ~]
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-numb
|
|
|
|
:> prints a message number, left-padded by heps.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
|
|
|
|= num/@ud
|
|
|
|
^+ +>
|
|
|
|
=+ bun=(scow %ud num)
|
|
|
|
%+ sh-fact %txt
|
|
|
|
(runt [(sub 13 (lent bun)) '-'] "[{bun}]")
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-cure
|
|
|
|
:> renders a security kind.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
|= a/security
|
|
|
|
^- tape
|
2017-10-31 21:56:56 +03:00
|
|
|
(scow %tas a)
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-scis
|
|
|
|
:> render status
|
|
|
|
:>
|
|
|
|
:> gets the presence of {saz} as a tape.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
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
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-show-status
|
|
|
|
:> prints presence changes to the cli.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-11-14 00:25:05 +03:00
|
|
|
|= {cir/circle who/ship cur/status dif/diff-status}
|
|
|
|
^+ +>
|
|
|
|
?: (~(has in settings.she) %quiet) +>
|
|
|
|
%- sh-note
|
2017-11-16 23:31:17 +03:00
|
|
|
%+ weld
|
|
|
|
(weld ~(cr-phat cr cir) ": ")
|
2017-11-14 00:25:05 +03:00
|
|
|
?- -.dif
|
|
|
|
$full
|
2017-11-14 02:56:04 +03:00
|
|
|
"hey {(scow %p who)} {(scow %tas pec.sat.dif)}"
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 00:25:05 +03:00
|
|
|
$presence
|
2017-11-14 02:56:04 +03:00
|
|
|
"see {(scow %p who)} {(scow %tas pec.dif)}"
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 00:25:05 +03:00
|
|
|
$human
|
|
|
|
%+ weld "nom {(scow %p who)}"
|
|
|
|
?: ?=($true -.dif.dif) ~
|
|
|
|
=- " '{(trip (fall han.man.cur ''))}' -> '{-}'"
|
|
|
|
%- trip
|
|
|
|
=- (fall - '')
|
|
|
|
?- -.dif.dif
|
|
|
|
$full han.man.dif.dif
|
|
|
|
$handle han.dif.dif
|
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 00:25:05 +03:00
|
|
|
$remove
|
|
|
|
"bye {(scow %p who)}"
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-show-config
|
|
|
|
:> prints config changes to the cli.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-11-14 01:44:44 +03:00
|
|
|
|= {cir/circle cur/config dif/diff-config}
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ +>
|
2017-11-14 02:56:04 +03:00
|
|
|
?: (~(has in settings.she) %quiet) +>
|
2017-11-14 01:44:44 +03:00
|
|
|
?: ?=($full -.dif)
|
2017-12-11 21:54:22 +03:00
|
|
|
=. +>
|
|
|
|
(sh-note (weld "new " (~(cr-show cr cir) ~)))
|
|
|
|
=. +> $(dif [%caption cap.cof.dif])
|
|
|
|
$(dif [%filter fit.cof.dif])
|
2017-11-14 01:44:44 +03:00
|
|
|
?: ?=($remove -.dif)
|
|
|
|
(sh-note (weld "rip " (~(cr-show cr cir) ~)))
|
|
|
|
%- sh-note
|
2017-11-17 15:47:16 +03:00
|
|
|
%+ weld
|
|
|
|
(weld ~(cr-phat cr cir) ": ")
|
2017-11-14 01:44:44 +03:00
|
|
|
?- -.dif
|
|
|
|
$source
|
|
|
|
%+ weld ?:(add.dif "onn " "off ")
|
|
|
|
~(cr-full cr cir.src.dif)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 01:44:44 +03:00
|
|
|
$caption
|
2017-12-11 21:54:22 +03:00
|
|
|
"cap: {(trip cap.dif)}"
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 01:44:44 +03:00
|
|
|
$filter
|
|
|
|
;: weld
|
|
|
|
"fit: caps:"
|
|
|
|
?:(cas.fit.dif "Y" "n")
|
|
|
|
" unic:"
|
|
|
|
?:(utf.fit.dif "✔" "n")
|
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 01:44:44 +03:00
|
|
|
$secure
|
|
|
|
"sec {(trip sec.con.cur)} -> {(trip sec.dif)}"
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-11-14 01:44:44 +03:00
|
|
|
$permit
|
|
|
|
%+ weld
|
|
|
|
=? add.dif
|
|
|
|
?=(?($channel $mailbox) sec.con.cur)
|
|
|
|
!add.dif
|
|
|
|
?:(add.dif "inv " "ban ")
|
|
|
|
^- tape
|
|
|
|
%- ~(rep in sis.dif)
|
|
|
|
|= {s/ship t/tape}
|
|
|
|
=? t ?=(^ t) (weld t ", ")
|
|
|
|
(weld t (cite:title s))
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-gram
|
|
|
|
:> show telegram
|
|
|
|
:>
|
|
|
|
:> prints the telegram. every fifth message,
|
|
|
|
:> print the message number also.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
|= gam/telegram
|
2017-03-24 23:10:27 +03:00
|
|
|
^+ +>
|
2017-07-11 03:23:12 +03:00
|
|
|
=+ num=(~(got by known) uid.gam)
|
2017-06-13 01:19:45 +03:00
|
|
|
=. +>.$
|
|
|
|
:: if the number isn't directly after latest, print it always.
|
|
|
|
?. =(num +(latest.she))
|
|
|
|
(sh-numb num)
|
|
|
|
:: if the number is directly after latest, print every fifth.
|
|
|
|
?. =(0 (mod num 5)) +>.$
|
|
|
|
(sh-numb num)
|
|
|
|
(sh-rend(latest.she num) gam)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ sh-grams
|
|
|
|
:> prints multiple telegrams.
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
|= gaz/(list telegram)
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
2017-06-13 01:19:45 +03:00
|
|
|
$(gaz t.gaz, +> (sh-gram i.gaz))
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %renderers
|
|
|
|
:> #
|
|
|
|
:> rendering cores.
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr
|
|
|
|
:> circle renderer
|
|
|
|
:>
|
|
|
|
:> used in both circle and ship rendering.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +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-12-19 02:53:59 +03:00
|
|
|
++ cr-beat
|
|
|
|
:> {one} more relevant?
|
|
|
|
:>
|
|
|
|
:> returns true if one is better to show, false
|
|
|
|
:> otherwise. prioritizes: our > main > size.
|
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.
|
2017-12-13 00:34:04 +03:00
|
|
|
?: =(self hos.one)
|
|
|
|
?. =(self hos.two) &
|
2017-04-25 22:09:20 +03:00
|
|
|
?< =(nom.one nom.two)
|
|
|
|
:: if both circles are ours, the main story is better.
|
2017-11-02 19:14:57 +03:00
|
|
|
?: =(%inbox nom.one) &
|
|
|
|
?: =(%inbox nom.two) |
|
2017-04-25 22:09:20 +03:00
|
|
|
:: if neither are, pick the "larger" one.
|
|
|
|
(lth nom.one nom.two)
|
2017-04-24 18:30:01 +03:00
|
|
|
:: if one isn't ours but two is, two is better.
|
2017-12-13 00:34:04 +03:00
|
|
|
?: =(self hos.two) |
|
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-25 22:09:20 +03:00
|
|
|
:: if they're from different ships, neither ours, pick hierarchically.
|
|
|
|
(lth (xeb hos.one) (xeb hos.two))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr-best
|
|
|
|
:> returns the most relevant circle.
|
2017-11-02 19:14:57 +03:00
|
|
|
::
|
|
|
|
|= two/circle
|
|
|
|
?:((cr-beat two) one two)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr-curt
|
|
|
|
:> 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-10-06 20:35:25 +03:00
|
|
|
=+ raw=(cite:title hos.one)
|
2017-03-23 03:34:56 +03:00
|
|
|
(runt [(sub 14 (lent raw)) ' '] raw)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr-nick
|
|
|
|
:> get nick for ship, or shortname if no nick.
|
|
|
|
:>
|
|
|
|
:> left-pads with spaces.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-11-13 21:41:42 +03:00
|
|
|
|= aud/audience
|
|
|
|
^- tape
|
|
|
|
=/ nic/(unit cord)
|
|
|
|
?: (~(has by nicks) hos.one)
|
|
|
|
(~(get by nicks) hos.one)
|
|
|
|
%- ~(rep in aud)
|
|
|
|
|= {cir/circle han/(unit cord)}
|
|
|
|
?^ han han
|
|
|
|
=+ gop=(~(get by remotes) cir)
|
|
|
|
?~ gop ~
|
|
|
|
han.man:(fall (~(get by u.gop) hos.one) *status)
|
|
|
|
?~ nic (cr-curt |)
|
|
|
|
=+ raw=(scag 14 (trip u.nic))
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ len=(sub 14 (lent raw))
|
|
|
|
(weld (reap len ' ') raw)
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:: todo: figure out why enabling the doccord causes a nest fail, even when
|
|
|
|
:: attached to the arm instead of the product.
|
|
|
|
::
|
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-12-13 00:34:04 +03:00
|
|
|
?: =(hos.one self)
|
2017-04-24 21:17:56 +03:00
|
|
|
?: =(nom.one inbox)
|
2017-03-23 03:34:56 +03:00
|
|
|
":"
|
2017-04-24 21:17:56 +03:00
|
|
|
['%' (trip nom.one)]
|
2017-10-09 13:02:28 +03:00
|
|
|
=+ wun=(cite:title hos.one)
|
2017-11-01 20:35:06 +03:00
|
|
|
?: =(nom.one %inbox)
|
2017-03-23 03:34:56 +03:00
|
|
|
wun
|
2017-12-13 00:34:04 +03:00
|
|
|
?: =(hos.one (sein:title self))
|
2017-06-13 01:19:45 +03:00
|
|
|
['/' (trip nom.one)]
|
2017-04-24 21:17:56 +03:00
|
|
|
:(welp wun "/" (trip nom.one))
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr-full (cr-show ~) :< render full width
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ cr-show
|
|
|
|
:> renders a circle as text.
|
|
|
|
:>
|
|
|
|
:> moy: multiple circles in audience?
|
2017-03-23 03:34:56 +03:00
|
|
|
|= moy/(unit ?)
|
|
|
|
^- tape
|
2017-07-11 02:41:47 +03:00
|
|
|
:: render circle (as glyph if we can).
|
|
|
|
?~ moy
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ cha=(~(get by bound) one ~ ~)
|
2017-11-25 01:05:41 +03:00
|
|
|
=- ?~(cha - "{u.cha ~} {-}")
|
2017-07-11 02:41:47 +03:00
|
|
|
~(cr-phat cr one)
|
|
|
|
(~(cr-curt cr one) u.moy)
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar
|
|
|
|
:> audience renderer
|
|
|
|
:>
|
|
|
|
:> used for representing audiences (sets of circles)
|
|
|
|
:> as tapes.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
|_ :> aud: members of the audience.
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
aud/audience
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-best
|
|
|
|
:> find the most relevant circle in the set.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
^- (unit circle)
|
2017-10-19 03:05:53 +03:00
|
|
|
?~ aud ~
|
2017-03-23 03:34:56 +03:00
|
|
|
:- ~
|
2017-07-11 02:41:47 +03:00
|
|
|
|- ^- circle
|
2017-10-19 03:05:53 +03:00
|
|
|
=+ lef=`(unit circle)`ar-best(aud l.aud)
|
|
|
|
=+ rit=`(unit circle)`ar-best(aud r.aud)
|
2017-11-02 19:14:57 +03:00
|
|
|
=? n.aud ?=(^ lef) (~(cr-best cr n.aud) u.lef)
|
|
|
|
=? n.aud ?=(^ rit) (~(cr-best cr n.aud) u.rit)
|
2017-10-19 03:05:53 +03:00
|
|
|
n.aud
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-deaf
|
|
|
|
:> remove ourselves from the audience.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
^+ .
|
2017-10-19 03:05:53 +03:00
|
|
|
.(aud (~(del in aud) `circle`incir))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-maud
|
|
|
|
:> multiple audience
|
|
|
|
:>
|
|
|
|
:> checks if there's multiple circles 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-10-19 03:05:53 +03:00
|
|
|
!?=($@($~ {* $~ $~}) aud)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-phat
|
|
|
|
:> render all circles, no glyphs.
|
2017-11-10 02:01:50 +03:00
|
|
|
::
|
|
|
|
^- tape
|
|
|
|
%- ~(rep in aud)
|
|
|
|
|= {c/circle t/tape}
|
|
|
|
=? t ?=(^ t)
|
|
|
|
(weld t ", ")
|
|
|
|
(weld t ~(cr-phat cr c))
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-prom
|
|
|
|
:> render all circles, 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
|
2017-10-19 03:05:53 +03:00
|
|
|
%+ sort `(list circle)`~(tap in aud)
|
2017-07-11 02:41:47 +03:00
|
|
|
|= {a/circle b/circle}
|
2017-11-02 19:14:57 +03:00
|
|
|
(~(cr-beat cr a) b)
|
2017-03-23 03:34:56 +03:00
|
|
|
=+ fir=&
|
|
|
|
|- ^- tape
|
|
|
|
?~ all ~
|
|
|
|
;: welp
|
|
|
|
?:(fir "" " ")
|
2017-11-02 19:14:57 +03:00
|
|
|
(~(cr-show cr i.all) ~)
|
2017-03-23 03:34:56 +03:00
|
|
|
$(all t.all, fir |)
|
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-whom
|
|
|
|
:> render sender as the most relevant circle.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-11-02 19:14:57 +03:00
|
|
|
(~(cr-show cr (need ar-best)) ~ ar-maud)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-dire
|
|
|
|
:> returns true if circle is a mailbox of ours.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
|= cir/circle ^- ?
|
2017-12-13 00:34:04 +03:00
|
|
|
?& =(hos.cir self)
|
2017-07-11 02:41:47 +03:00
|
|
|
=+ sot=(~(get by mirrors) cir)
|
2017-10-31 21:56:56 +03:00
|
|
|
&(?=(^ sot) ?=($mailbox sec.con.u.sot))
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ ar-glyf
|
|
|
|
:: todo: another place where doccords break things.
|
|
|
|
::
|
|
|
|
::> audience glyph
|
|
|
|
::>
|
2017-11-03 22:00:11 +03:00
|
|
|
::> get the glyph that corresponds to the audience.
|
|
|
|
::> for mailbox messages and complex audiences, use
|
|
|
|
::> reserved "glyphs".
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^- tape
|
2017-11-02 18:36:23 +03:00
|
|
|
=+ cha=(~(get by bound) aud)
|
2017-11-03 22:00:11 +03:00
|
|
|
?^ cha ~[u.cha]
|
2017-10-19 03:05:53 +03:00
|
|
|
?. (lien ~(tap by aud) ar-dire)
|
2017-11-03 22:00:11 +03:00
|
|
|
"*"
|
2017-10-19 03:05:53 +03:00
|
|
|
?: ?=({^ $~ $~} aud)
|
2017-11-03 22:00:11 +03:00
|
|
|
":"
|
|
|
|
";"
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
::
|
2017-12-19 02:53:59 +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-12-19 02:53:59 +03:00
|
|
|
|_ $: :> sef: settings flags.
|
|
|
|
:> who: author.
|
|
|
|
:> sen: unique identifier.
|
|
|
|
:> aud: audience.
|
|
|
|
:> wen: timestamp.
|
|
|
|
:> sep: message contents.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-18 00:30:52 +03:00
|
|
|
sef/(set term)
|
2017-03-23 03:34:56 +03:00
|
|
|
who/ship
|
|
|
|
sen/serial
|
|
|
|
aud/audience
|
|
|
|
wen/@da
|
|
|
|
sep/speech
|
|
|
|
==
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +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-12-19 02:53:59 +03:00
|
|
|
++ tr-rend
|
|
|
|
:> renders a telegram
|
|
|
|
:>
|
|
|
|
:> the first line will contain the author and
|
|
|
|
:> optional timestamp.
|
2017-05-09 17:57:35 +03:00
|
|
|
::
|
|
|
|
^- (list tape)
|
|
|
|
=/ wyd
|
2017-11-02 18:20:30 +03:00
|
|
|
%+ sub width.cli :: termwidth,
|
2017-05-09 17:57:35 +03:00
|
|
|
%+ add 14 :: minus author,
|
|
|
|
?:((~(has in sef) %showtime) 10 0) :: minus timestamp.
|
|
|
|
=+ txs=(tr-text wyd)
|
|
|
|
?~ txs ~
|
|
|
|
:: render the author.
|
|
|
|
=/ nom/tape
|
2017-10-10 18:17:10 +03:00
|
|
|
?: (~(has in sef) %nicks)
|
2017-11-13 21:41:42 +03:00
|
|
|
(~(cr-nick cr [who %inbox]) aud)
|
2017-11-01 20:35:06 +03:00
|
|
|
(~(cr-curt cr [who %inbox]) |)
|
2017-05-09 17:57:35 +03:00
|
|
|
:: regular indent.
|
|
|
|
=/ den/tape
|
|
|
|
(reap (lent nom) ' ')
|
|
|
|
:: timestamp, if desired.
|
|
|
|
=/ tam/tape
|
|
|
|
?. (~(has in sef) %showtime) ""
|
2017-11-17 23:32:44 +03:00
|
|
|
=. wen
|
|
|
|
%. [wen (mul q.timez.cli ~h1)]
|
|
|
|
?:(p.timez.cli add sub)
|
|
|
|
=+ dat=(yore wen)
|
2017-04-24 18:30:01 +03:00
|
|
|
=/ t
|
|
|
|
|= a/@
|
2017-03-23 03:34:56 +03:00
|
|
|
%+ weld
|
2017-05-09 17:57:35 +03:00
|
|
|
?:((lth a 10) "0" ~)
|
2017-04-24 18:30:01 +03:00
|
|
|
(scow %ud a)
|
|
|
|
=/ time
|
|
|
|
;: weld
|
|
|
|
"~" (t h.t.dat)
|
|
|
|
"." (t m.t.dat)
|
|
|
|
"." (t s.t.dat)
|
|
|
|
==
|
2017-05-09 17:57:35 +03:00
|
|
|
%+ weld
|
2017-07-22 01:16:41 +03:00
|
|
|
(reap (sub +(wyd) (min wyd (lent (tuba i.txs)))) ' ')
|
2017-05-09 17:57:35 +03:00
|
|
|
time
|
|
|
|
%- flop
|
|
|
|
%+ roll `(list tape)`txs
|
|
|
|
|= {t/tape l/(list tape)}
|
|
|
|
?~ l [:(weld nom t tam) ~]
|
|
|
|
[(weld den t) l]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +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-07-11 02:41:47 +03:00
|
|
|
=/ cis
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ turn ~(tap in aud)
|
2017-07-11 02:41:47 +03:00
|
|
|
|= a/circle
|
2017-11-02 19:14:57 +03:00
|
|
|
leaf+~(cr-full cr a)
|
2017-07-11 02:41:47 +03:00
|
|
|
[%rose [" " ~ ~] [hed >who< [%rose [", " "to " ~] cis] ~]]~
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +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-07-01 04:44:37 +03:00
|
|
|
?- -.sep
|
2017-04-24 18:30:01 +03:00
|
|
|
$lin
|
2017-10-06 14:22:12 +03:00
|
|
|
tan+~[leaf+"{?:(pat.sep "@ " "")}{(trip msg.sep)}"]
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$url
|
2017-10-06 20:35:25 +03:00
|
|
|
url+(crip (apix:en-purl:html url.sep))
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$exp
|
2017-10-25 23:07:36 +03:00
|
|
|
mor+~[txt+"# {(trip exp.sep)}" tan+res.sep]
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-10-06 01:02:59 +03:00
|
|
|
$ire
|
2017-12-18 20:32:59 +03:00
|
|
|
=+ num=(~(get by known) top.sep)
|
|
|
|
?~ num $(sep sep.sep)
|
|
|
|
=+ gam=(snag (sub count +(u.num)) grams)
|
2017-11-02 20:30:25 +03:00
|
|
|
=- mor+[tan+- $(sep sep.sep) ~]
|
|
|
|
%- flop %+ weld
|
2017-12-18 20:32:59 +03:00
|
|
|
:_ ~ :- %leaf
|
|
|
|
%+ weld "in reply to: {(cite:title aut.gam)}: "
|
|
|
|
"[{(scow %ud u.num)}]"
|
|
|
|
%+ turn (~(tr-text tr sef gam) width.cli)
|
2017-11-02 20:30:25 +03:00
|
|
|
|=(t/tape [%leaf t])
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$fat
|
2017-04-27 00:33:25 +03:00
|
|
|
[%mor $(sep sep.sep) tan+(tr-tach tac.sep) ~]
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
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-25 22:18:14 +03:00
|
|
|
~(cr-phat cr cir.sep)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$app
|
2017-11-06 19:21:50 +03:00
|
|
|
[%mor tan+~[leaf+"[{(trip app.sep)}]: "] $(sep sep.sep) ~]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ tr-tach
|
|
|
|
:> renders an attachment.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-27 00:33:25 +03:00
|
|
|
|= a/attache
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tang
|
2017-03-23 03:34:56 +03:00
|
|
|
?- -.a
|
2017-11-06 21:26:36 +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-12-19 02:53:59 +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)
|
2017-05-09 17:57:35 +03:00
|
|
|
|-
|
|
|
|
:- '_'
|
|
|
|
?. ?=({$' ' *} t.txt)
|
|
|
|
t.txt
|
|
|
|
$(txt t.txt)
|
2017-03-23 03:34:56 +03:00
|
|
|
?~ t.txt "…"
|
|
|
|
[i.txt $(txt t.txt)]
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ tr-text
|
|
|
|
:> compact contents
|
|
|
|
:>
|
|
|
|
:> renders just the most important data of the
|
|
|
|
:> message. if possible, these stay within a single
|
|
|
|
:> line.
|
|
|
|
:>
|
|
|
|
:> pre: replace/append line prefix
|
2017-11-14 17:16:28 +03:00
|
|
|
::TODO this should probably be redone someday.
|
|
|
|
=| pre/(unit (pair ? tape))
|
2017-05-09 17:57:35 +03:00
|
|
|
|= wyd/@ud
|
|
|
|
^- (list tape)
|
2017-07-01 04:44:37 +03:00
|
|
|
?- -.sep
|
2017-03-23 03:34:56 +03:00
|
|
|
$fat
|
2017-05-09 17:57:35 +03:00
|
|
|
%+ weld $(sep sep.sep)
|
|
|
|
^- (list tape)
|
2017-11-06 21:26:36 +03:00
|
|
|
?+ -.tac.sep [" attached: ..." ~]
|
|
|
|
$name [(scag wyd " attached: {(trip nom.tac.sep)}") ~]
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$exp
|
2017-10-25 23:07:36 +03:00
|
|
|
:- (tr-chow wyd '#' ' ' (trip exp.sep))
|
|
|
|
?~ res.sep ~
|
2017-11-01 23:53:00 +03:00
|
|
|
=- [' ' (tr-chow (dec wyd) ' ' -)]~
|
|
|
|
~(ram re (snag 0 `(list tank)`res.sep))
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-10-06 01:02:59 +03:00
|
|
|
$ire
|
2017-11-14 17:16:28 +03:00
|
|
|
$(sep sep.sep, pre `[| "^ "])
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-24 18:30:01 +03:00
|
|
|
$url
|
2017-05-09 17:57:35 +03:00
|
|
|
:_ ~
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ ful=(apix:en-purl:html url.sep)
|
2017-11-14 17:16:28 +03:00
|
|
|
=+ pef=q:(fall pre [p=| q=""])
|
2017-11-12 00:11:45 +03:00
|
|
|
:: clean up prefix if needed.
|
|
|
|
=? pef =((scag 1 (flop pef)) " ")
|
|
|
|
(scag (dec (lent pef)) pef)
|
|
|
|
=. pef (weld "/" pef)
|
2017-11-06 21:26:36 +03:00
|
|
|
=. wyd (sub wyd +((lent pef))) :: account for prefix.
|
2017-05-09 17:57:35 +03:00
|
|
|
:: if the full url fits, just render it.
|
2017-11-06 21:26:36 +03:00
|
|
|
?: (gte wyd (lent ful)) :(weld pef " " ful)
|
2017-05-09 17:57:35 +03:00
|
|
|
:: if it doesn't, prefix with _ and render just (the tail of) the domain.
|
2017-11-06 21:26:36 +03:00
|
|
|
%+ weld (weld pef "_")
|
2017-04-24 21:17:56 +03:00
|
|
|
=+ hok=r.p.p.url.sep
|
2017-05-09 17:57:35 +03:00
|
|
|
=- (swag [a=(sub (max wyd (lent -)) wyd) b=wyd] -)
|
2017-04-24 18:30:01 +03:00
|
|
|
^- tape
|
|
|
|
=< ?: ?=($& -.hok)
|
|
|
|
(reel p.hok .)
|
|
|
|
+:(scow %if p.hok)
|
|
|
|
|= {a/knot b/tape}
|
|
|
|
?~ b (trip a)
|
|
|
|
(welp b '.' (trip a))
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$lin
|
2017-05-09 17:57:35 +03:00
|
|
|
:: glyph prefix
|
2017-11-06 19:21:50 +03:00
|
|
|
=/ pef/tape
|
2017-11-14 17:16:28 +03:00
|
|
|
?: &(?=(^ pre) p.u.pre) q.u.pre
|
2017-10-06 14:22:12 +03:00
|
|
|
?: pat.sep " "
|
2017-11-14 17:16:28 +03:00
|
|
|
=- (weld - q:(fall pre [p=| q=" "]))
|
2017-11-03 22:00:11 +03:00
|
|
|
%~ ar-glyf ar
|
2017-12-13 00:34:04 +03:00
|
|
|
?: =(who self) aud
|
2017-11-13 18:00:22 +03:00
|
|
|
(~(del in aud) [who %inbox])
|
2017-05-09 17:57:35 +03:00
|
|
|
==
|
2017-11-14 17:32:42 +03:00
|
|
|
=. wyd (sub wyd (min (div wyd 2) (lent pef)))
|
2017-07-22 01:16:41 +03:00
|
|
|
=/ txt (tuba (trip msg.sep))
|
2017-05-09 17:57:35 +03:00
|
|
|
|- ^- (list tape)
|
|
|
|
?~ txt ~
|
2017-11-02 18:19:50 +03:00
|
|
|
=+ ^- {end/@ud nex/?}
|
|
|
|
?: (lte (lent txt) wyd) [(lent txt) &]
|
2017-07-22 01:16:41 +03:00
|
|
|
=+ ace=(find " " (flop (scag +(wyd) `(list @c)`txt)))
|
2017-11-02 18:19:50 +03:00
|
|
|
?~ ace [wyd |]
|
|
|
|
[(sub wyd u.ace) &]
|
2017-07-22 01:16:41 +03:00
|
|
|
:- (weld pef (tufa (scag end `(list @c)`txt)))
|
2017-11-02 18:19:50 +03:00
|
|
|
$(txt (slag ?:(nex +(end) end) `(list @c)`txt), pef (reap (lent pef) ' '))
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-04-10 23:35:25 +03:00
|
|
|
$inv
|
2017-05-09 17:57:35 +03:00
|
|
|
:_ ~
|
|
|
|
%+ tr-chow wyd
|
2017-04-10 23:35:25 +03:00
|
|
|
%+ 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-25 22:18:14 +03:00
|
|
|
~(cr-phat cr cir.sep)
|
2017-11-16 03:21:25 +03:00
|
|
|
::
|
2017-03-23 03:34:56 +03:00
|
|
|
$app
|
2017-11-14 17:16:28 +03:00
|
|
|
$(sep sep.sep, pre `[& "[{(trip app.sep)}]: "])
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
--
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
:> #
|
|
|
|
:> # %events
|
|
|
|
:> #
|
|
|
|
+|
|
2017-04-24 18:30:01 +03:00
|
|
|
::
|
2017-12-08 17:58:58 +03:00
|
|
|
++ quit-server-client
|
|
|
|
|= wir/wire
|
|
|
|
^- (quip move _+>)
|
|
|
|
[[peer-client]~ +>]
|
|
|
|
::
|
|
|
|
++ quit-server-inbox
|
|
|
|
|= wir/wire
|
|
|
|
^- (quip move _+>)
|
|
|
|
[[peer-inbox]~ +>]
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ peer
|
|
|
|
:> incoming subscription on pax.
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-12-18 19:03:18 +03:00
|
|
|
?. =(src.bol our.bol)
|
|
|
|
~! [%peer-talk-stranger src.bol]
|
|
|
|
!!
|
2017-03-28 00:17:09 +03:00
|
|
|
?. ?=({$sole *} pax)
|
2017-12-18 19:03:18 +03:00
|
|
|
~! [%peer-talk-strange pax]
|
|
|
|
!!
|
2017-04-24 18:30:01 +03:00
|
|
|
ta-done:ta-console:ta
|
2017-03-28 00:17:09 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ diff-hall-prize
|
|
|
|
:> accept query answer
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
|= {way/wire piz/prize}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-06-13 01:19:45 +03:00
|
|
|
ta-done:(ta-take:ta piz)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ diff-hall-rumor
|
|
|
|
:> accept query change
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {way/wire rum/rumor}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-07-22 01:53:24 +03:00
|
|
|
ta-done:(ta-hear:ta rum)
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ poke-sole-action
|
|
|
|
:> 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-07-08 03:01:56 +03:00
|
|
|
::
|
2017-12-11 02:55:13 +03:00
|
|
|
::TODO for debug purposes. remove eventually.
|
2017-12-14 03:55:33 +03:00
|
|
|
:: users beware, here be dragons.
|
2017-12-11 02:55:13 +03:00
|
|
|
++ poke-noun
|
|
|
|
|= a/@t
|
|
|
|
^- (quip move _+>)
|
2017-12-14 03:55:33 +03:00
|
|
|
?: =(a 'check')
|
|
|
|
~& 'verifying message reference integrity...'
|
2017-12-11 02:55:13 +03:00
|
|
|
=- ~&(- [~ +>.$])
|
2017-12-14 18:58:51 +03:00
|
|
|
~& [%count--lent count (lent grams)]
|
2017-12-11 02:55:13 +03:00
|
|
|
=+ %- ~(rep by known)
|
|
|
|
|= {{u/serial a/@ud} k/@ud m/@ud}
|
|
|
|
:- ?:((gth a k) a k)
|
|
|
|
?: =(u uid:(snag (sub count +(a)) grams)) m +(m)
|
2017-12-14 18:58:51 +03:00
|
|
|
:- %check-talk
|
2017-12-11 02:55:13 +03:00
|
|
|
[known=k mismatch=m]
|
|
|
|
?: =(a 'rebuild')
|
2017-12-14 03:55:33 +03:00
|
|
|
~& 'rebuilding message references...'
|
2017-12-11 02:55:13 +03:00
|
|
|
=+ %+ reel grams
|
|
|
|
|= {t/telegram c/@ud k/(map serial @ud)}
|
|
|
|
[+(c) (~(put by k) uid.t c)]
|
|
|
|
[~ +>.$(count c, known k)]
|
2017-12-14 03:55:33 +03:00
|
|
|
?: =(a 'reconnect')
|
|
|
|
~& 'disconnecting and reconnecting to hall...'
|
|
|
|
:_ +>
|
|
|
|
:~ [0 %pull /server/client server ~]
|
|
|
|
[0 %pull /server/inbox server ~]
|
|
|
|
peer-client
|
|
|
|
peer-inbox
|
|
|
|
==
|
2017-12-15 22:24:00 +03:00
|
|
|
?: =(a 'reset')
|
|
|
|
~& 'full reset incoming, hold on to your cli...'
|
|
|
|
:_ +>(grams ~, known ~, count 0)
|
|
|
|
:~ [0 %pull /server/client server ~]
|
|
|
|
[0 %pull /server/inbox server ~]
|
|
|
|
peer-client
|
|
|
|
peer-inbox
|
|
|
|
==
|
2017-12-15 22:48:01 +03:00
|
|
|
:: this deletes a message from your backlog, and may
|
|
|
|
:: make talk throw stack traces.
|
|
|
|
:: **aka don't run this!**
|
2017-12-15 22:24:00 +03:00
|
|
|
?: =(a 'screw')
|
|
|
|
~& 'screwing things up...'
|
|
|
|
:- ~
|
2017-12-15 22:48:01 +03:00
|
|
|
+>(grams (oust [0 1] grams))
|
2017-12-11 02:55:13 +03:00
|
|
|
[~ +>]
|
|
|
|
::
|
2017-12-19 02:53:59 +03:00
|
|
|
++ coup-client-action
|
|
|
|
:> accept n/ack
|
2017-07-08 03:01:56 +03:00
|
|
|
::
|
|
|
|
|= {wir/wire fal/(unit tang)}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-07-08 03:01:56 +03:00
|
|
|
?~ fal [~ +>]
|
|
|
|
%- (slog leaf+"action failed: " u.fal)
|
|
|
|
[~ +>]
|
2017-03-24 23:10:27 +03:00
|
|
|
--
|