2017-03-30 15:17:37 +03:00
|
|
|
:: :: ::
|
2017-03-23 03:34:56 +03:00
|
|
|
:::: /hoon/talk/app :: ::
|
2017-03-30 15:17:37 +03:00
|
|
|
:: :: ::
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
::TODO rename to hall
|
2017-04-24 21:17:56 +03:00
|
|
|
::TODO char57 comments as line comments when regarding code.
|
2017-04-25 22:09:20 +03:00
|
|
|
::TODO document what user-facing messages actually mean!
|
2017-11-01 22:24:11 +03:00
|
|
|
::TODO maybe have hall accept reactions as well, redirect them to readers.
|
|
|
|
:: that way we can have foreign halls react to our requests!
|
2017-07-06 23:38:36 +03:00
|
|
|
::TODO document gate samples fully.
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO ::> to :> etc.
|
2017-04-18 22:33:02 +03:00
|
|
|
::
|
2017-03-30 15:17:37 +03:00
|
|
|
::TODO crash on pokes/peers we do not expect
|
2017-11-01 22:24:11 +03:00
|
|
|
::TODO ++poke-reset. first call: warning. second call: reset state.
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
::TODO for using moons as tmp identities for friends: stories may want to keep
|
|
|
|
:: lists of moons (or just ships in general?) that we define as "standalone"
|
|
|
|
:: so that the "convert to true identity" doesn't happen for them.
|
|
|
|
::
|
2017-11-01 22:24:11 +03:00
|
|
|
::TODO uncouple presence from subscription state. have hall send an initial
|
|
|
|
:: presence when we sub to someplace, and remove that when we unsub, but
|
|
|
|
:: don't make the target source do that.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-04-28 20:40:12 +03:00
|
|
|
/? 151 ::< hoon version
|
2017-04-21 00:59:36 +03:00
|
|
|
/- talk ::< structures
|
2017-04-21 17:14:11 +03:00
|
|
|
/+ talk, time-to-id ::< libraries
|
2017-03-23 03:34:56 +03:00
|
|
|
/= seed /~ !>(.)
|
2017-03-30 15:17:37 +03:00
|
|
|
!:
|
2017-03-23 03:34:56 +03:00
|
|
|
::::
|
|
|
|
::
|
2017-10-06 20:35:25 +03:00
|
|
|
=, talk
|
2017-04-21 00:59:36 +03:00
|
|
|
=> ::> ||
|
|
|
|
::> || %arch
|
|
|
|
::> ||
|
|
|
|
::> data structures
|
|
|
|
::
|
|
|
|
|%
|
2017-10-10 17:30:27 +03:00
|
|
|
::> || %state ::
|
|
|
|
::> state data structures ::
|
2017-04-27 13:15:41 +03:00
|
|
|
++ state ::> broker state
|
2017-07-12 01:12:29 +03:00
|
|
|
$: stories/(map naem story) ::< conversations
|
2017-08-03 07:43:56 +03:00
|
|
|
outbox/(map serial tracking) ::< sent messages
|
2017-07-12 01:12:29 +03:00
|
|
|
log/(map naem @ud) ::< logged to clay
|
|
|
|
nicks/(map ship nick) ::< local nicknames
|
2017-10-19 03:05:53 +03:00
|
|
|
binds/(jug char audience) ::< circle glyph lookup
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ story ::> wire content
|
|
|
|
$: count/@ud ::< (lent grams)
|
|
|
|
grams/(list telegram) ::< all messages
|
2017-07-18 00:41:57 +03:00
|
|
|
locals/group ::< local status
|
|
|
|
remotes/(map circle group) ::< remote status
|
2017-04-21 00:59:36 +03:00
|
|
|
shape/config ::< configuration
|
2017-04-24 21:17:56 +03:00
|
|
|
mirrors/(map circle config) ::< remote config
|
2017-07-20 01:32:07 +03:00
|
|
|
sequence/(map circle @ud) ::< last-heard p circle
|
2017-04-21 00:59:36 +03:00
|
|
|
known/(map serial @ud) ::< messages heard
|
2017-07-31 22:09:44 +03:00
|
|
|
inherited/_| ::< from parent?
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-10-10 17:30:27 +03:00
|
|
|
::> || %deltas ::
|
|
|
|
::> changes to state ::
|
|
|
|
++ delta ::
|
|
|
|
$% :: messaging state ::
|
|
|
|
{$out cir/circle out/(list thought)} ::< send msgs to circle
|
|
|
|
$: $done ::> set delivery state
|
|
|
|
cir/circle ::
|
|
|
|
ses/(list serial) ::
|
|
|
|
res/delivery ::
|
|
|
|
== ::
|
|
|
|
:: shared ui state ::
|
|
|
|
{$glyph diff-glyph} ::< un/bound glyph
|
|
|
|
{$nick diff-nick} ::< changed nickname
|
|
|
|
:: story state ::
|
|
|
|
{$story nom/naem det/delta-story} ::< change to story
|
|
|
|
:: side-effects ::
|
|
|
|
{$init $~} ::< initialize
|
|
|
|
{$observe who/ship} ::< watch burden bearer
|
|
|
|
$: $present ::> send %present cmd
|
|
|
|
hos/ship ::
|
|
|
|
nos/(set naem) ::
|
|
|
|
dif/diff-status ::
|
|
|
|
== ::
|
|
|
|
{$quit ost/bone} ::< force unsubscribe
|
|
|
|
== ::
|
|
|
|
++ delta-story ::> story delta
|
|
|
|
$? diff-story ::< both in & outward
|
|
|
|
$% {$inherited ihr/?} ::< inherited flag
|
2017-11-01 22:24:11 +03:00
|
|
|
{$follow sub/? srs/(set source)} ::< un/subscribe
|
2017-10-10 17:30:27 +03:00
|
|
|
{$sequent cir/circle num/@ud} ::< update last-heard
|
|
|
|
{$gram gam/telegram} ::< new/changed msgs
|
|
|
|
== == ::
|
|
|
|
::> || %out ::
|
|
|
|
::> outgoing data ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ move (pair bone card) ::< all actions
|
|
|
|
++ lime ::> diff fruit
|
2017-05-13 01:05:49 +03:00
|
|
|
$% {$talk-prize prize} ::
|
|
|
|
{$talk-rumor rumor} ::
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ pear ::> poke fruit
|
2017-03-23 03:34:56 +03:00
|
|
|
$% {$talk-command command} ::
|
|
|
|
{$write-comment spur ship cord} ::
|
|
|
|
{$write-fora-post spur ship cord cord} ::
|
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ card ::> general card
|
2017-03-23 03:34:56 +03:00
|
|
|
$% {$diff lime} ::
|
2017-10-06 20:35:25 +03:00
|
|
|
{$info wire ship term nori:clay} ::
|
2017-03-23 03:34:56 +03:00
|
|
|
{$peer wire dock path} ::
|
|
|
|
{$poke wire dock pear} ::
|
|
|
|
{$pull wire dock $~} ::
|
|
|
|
{$quit $~} ::
|
|
|
|
== ::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ weir ::> parsed wire
|
2017-08-03 07:43:56 +03:00
|
|
|
$% {$repeat cir/circle ses/(list serial)} ::< messaging wire
|
2017-10-09 23:50:17 +03:00
|
|
|
{$circle nom/naem src/source} ::< subscription wire
|
2017-03-23 03:34:56 +03:00
|
|
|
== ::
|
|
|
|
--
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %work
|
|
|
|
::> ||
|
|
|
|
::> functional cores and arms.
|
|
|
|
::
|
2017-10-06 20:35:25 +03:00
|
|
|
|_ {bol/bowl:gall state}
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ prep ::< prepare state
|
2017-04-21 17:14:11 +03:00
|
|
|
::> adapts state.
|
2017-04-21 00:59:36 +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-10-09 12:57:36 +03:00
|
|
|
?~ old
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-04-21 00:59:36 +03:00
|
|
|
ta-done:ta-init:ta
|
2017-10-09 12:57:36 +03:00
|
|
|
[~ ..prep(+<+ u.old)]
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %engines
|
|
|
|
::> ||
|
|
|
|
::> main cores.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta ::< per transaction
|
2017-05-13 01:05:49 +03:00
|
|
|
::> thinker core, used for processing pokes into
|
|
|
|
::> deltas.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-01 03:24:32 +03:00
|
|
|
|_ ::> deltas: deltas created by core operations.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
deltas/(list delta)
|
2017-03-30 15:17:37 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-done ::< resolve core
|
|
|
|
::> produces the moves stored in ++ta's moves.
|
|
|
|
::> they are produced in reverse order because
|
|
|
|
::> ++ta-emil and ++ta-emit add them to the head of
|
|
|
|
::> the {moves}.
|
2017-05-13 01:05:49 +03:00
|
|
|
::> we don't produce any new state, because ++ta
|
|
|
|
::> doesn't make any changes to it itself.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
^- (list delta)
|
|
|
|
(flop deltas)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ ta-delta ::< emit a delta
|
|
|
|
::> adds a delta to the head of {deltas}.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta
|
|
|
|
%_(+> deltas [det deltas])
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ ta-deltas ::< emit delta list
|
2017-06-22 03:16:22 +03:00
|
|
|
::> adds multiple deltas to the head of {deltas}.
|
2017-05-13 01:05:49 +03:00
|
|
|
::> flops to stay consistent with ++ta-delta.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= des/(list delta)
|
|
|
|
%_(+> deltas (welp (flop des) deltas))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-04-25 14:33:02 +03:00
|
|
|
++ ta-note ::< tell user
|
|
|
|
::> sends {msg} as an %app message to the user's
|
|
|
|
::> inbox.
|
|
|
|
::
|
|
|
|
|= msg/cord
|
2017-04-25 22:09:20 +03:00
|
|
|
%^ ta-action 0 %phrase
|
2017-11-01 20:35:06 +03:00
|
|
|
:- [[our.bol %inbox] ~ ~]
|
2017-10-05 20:18:22 +03:00
|
|
|
[%app dap.bol msg]~
|
2017-04-25 14:33:02 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-evil ::< emit error
|
|
|
|
::> tracing printf and crash.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= msg/cord
|
2017-04-21 00:59:36 +03:00
|
|
|
~| [%talk-ta-evil msg]
|
2017-03-23 03:34:56 +03:00
|
|
|
!!
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %data
|
|
|
|
::> ||
|
|
|
|
::> utility functions for data retrieval.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-know ::< story monad
|
|
|
|
::> produces a gill that takes a gate.
|
|
|
|
::> if the story {nom} exists, calls the gate with
|
|
|
|
::> a story core. if it doesn't, does nothing.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-04-24 21:17:56 +03:00
|
|
|
|= fun/$-(_so _ta)
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ +>+>
|
|
|
|
=+ pur=(~(get by stories) nom)
|
|
|
|
?~ pur
|
2017-07-08 03:01:56 +03:00
|
|
|
%- ta-evil
|
|
|
|
(crip "no story '{(trip nom)}'")
|
2017-04-21 00:59:36 +03:00
|
|
|
(fun ~(. so nom ~ u.pur))
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %interaction-events
|
|
|
|
::> ||
|
|
|
|
::> arms that apply events we received.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ ta-init ::< initialize app
|
|
|
|
::> populate state on first boot.
|
|
|
|
::> creates our default mailbox and journal.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-22 03:15:13 +03:00
|
|
|
:: create default circles.
|
|
|
|
=> %+ roll
|
2017-07-12 01:12:29 +03:00
|
|
|
^- (list {security naem cord})
|
2017-11-01 20:35:06 +03:00
|
|
|
:~ [%mailbox %inbox 'default home']
|
2017-10-31 21:56:56 +03:00
|
|
|
[%journal %public 'visible activity']
|
2017-06-14 04:46:02 +03:00
|
|
|
==
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {{typ/security nom/naem des/cord} _ta}
|
2017-06-22 03:15:13 +03:00
|
|
|
%+ ta-action ost.bol
|
|
|
|
[%create nom des typ]
|
|
|
|
%- ta-deltas
|
|
|
|
:: if needed, subscribe to our parent's /burden.
|
|
|
|
=+ sen=(above our.bol)
|
2017-10-06 20:35:25 +03:00
|
|
|
?: ?| !=(%czar (clan:title sen))
|
2017-06-22 03:15:13 +03:00
|
|
|
=(sen our.bol)
|
2017-10-06 20:35:25 +03:00
|
|
|
=(%pawn (clan:title our.bol))
|
2017-06-22 03:15:13 +03:00
|
|
|
==
|
|
|
|
~
|
|
|
|
[%init ~]~
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-apply ::< apply command
|
|
|
|
::> applies the command sent by {src}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {src/ship cod/command}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
?- -.cod
|
2017-06-13 01:19:45 +03:00
|
|
|
::> %publish commands prompt us (as a circle host)
|
2017-04-21 00:59:36 +03:00
|
|
|
::> to verify and distribute messages.
|
2017-06-13 01:19:45 +03:00
|
|
|
$publish (ta-think | src +.cod)
|
2017-06-28 02:45:56 +03:00
|
|
|
::> %present commands are used to ask us to set
|
|
|
|
::> someone's status in the indicated stories.
|
|
|
|
$present (ta-present src +.cod)
|
2017-06-22 03:16:22 +03:00
|
|
|
::> %bearing commands are used by our children to
|
|
|
|
::> let us know they're bearing our /burden. we
|
|
|
|
::> need to watch them to allow changes to go up.
|
2017-11-01 22:24:11 +03:00
|
|
|
$bearing (ta-observe src) ::TODO isn't this redundant with ta-subscribe?
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-06-28 02:45:56 +03:00
|
|
|
++ ta-present ::< update a status
|
|
|
|
::>
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {who/ship nos/(set naem) dif/diff-status}
|
2017-06-28 02:45:56 +03:00
|
|
|
^+ +>
|
|
|
|
%- ta-deltas
|
|
|
|
%- ~(rep in nos)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {n/naem l/(list delta)}
|
2017-06-28 02:45:56 +03:00
|
|
|
:_ l
|
2017-07-11 02:41:47 +03:00
|
|
|
[%story n %status [our.bol n] who dif]
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-action ::< apply reader action
|
|
|
|
::> performs action sent by a reader.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
|
|
|
|= {red/bone act/action}
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
=< work
|
|
|
|
::> ||
|
|
|
|
::> || %actions
|
|
|
|
::> ||
|
|
|
|
::> action processing core
|
|
|
|
::>
|
|
|
|
::> ++work calls the appropriate action processing
|
|
|
|
::> arm. most use ++affect to retrieve the affected
|
2017-07-08 03:01:56 +03:00
|
|
|
::> story, crashing if it doesn't exist.
|
2017-04-21 00:59:36 +03:00
|
|
|
|%
|
|
|
|
:: || %utility
|
|
|
|
::+|
|
|
|
|
++ work ::< perform action
|
|
|
|
^+ ..ta-action
|
|
|
|
?- -.act
|
2017-04-24 21:17:56 +03:00
|
|
|
:: circle configuration
|
2017-04-21 00:59:36 +03:00
|
|
|
$create (action-create +.act)
|
|
|
|
$source (action-source +.act)
|
|
|
|
$depict (action-depict +.act)
|
2017-05-09 22:43:42 +03:00
|
|
|
$filter (action-filter +.act)
|
2017-04-21 00:59:36 +03:00
|
|
|
$permit (action-permit +.act)
|
|
|
|
$delete (action-delete +.act)
|
|
|
|
:: messaging
|
|
|
|
$convey (action-convey +.act)
|
|
|
|
$phrase (action-phrase +.act)
|
|
|
|
:: personal metadata
|
2017-06-28 02:45:56 +03:00
|
|
|
$notify (action-notify +.act)
|
|
|
|
$naming (action-naming +.act)
|
2017-04-21 00:59:36 +03:00
|
|
|
:: changing shared ui
|
|
|
|
$glyph (action-glyph +.act)
|
2017-05-13 01:05:49 +03:00
|
|
|
$nick (action-nick +.act)
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ affect ::< delta to story
|
2017-06-21 23:48:47 +03:00
|
|
|
::> store a delta about a story. if the story
|
2017-07-08 03:01:56 +03:00
|
|
|
::> does not exist, crash.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {nom/naem det/delta-story}
|
2017-05-13 01:05:49 +03:00
|
|
|
?: (~(has by stories) nom)
|
2017-07-22 01:53:24 +03:00
|
|
|
(impact nom det)
|
2017-07-08 03:01:56 +03:00
|
|
|
(ta-evil (crip "no story {(trip nom)}"))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ impact ::< delta for story
|
2017-06-21 23:48:47 +03:00
|
|
|
::> Store a delta about a story.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {nom/naem det/delta-story}
|
|
|
|
(ta-delta %story nom det)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-28 02:45:56 +03:00
|
|
|
++ present ::< send status update
|
|
|
|
::>
|
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {aud/audience dif/diff-status}
|
2017-06-28 02:45:56 +03:00
|
|
|
^+ ..ta-action
|
|
|
|
=/ cic
|
2017-07-12 01:12:29 +03:00
|
|
|
^- (jug ship naem)
|
2017-10-19 03:05:53 +03:00
|
|
|
%- ~(rep in aud)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {c/circle m/(jug ship naem)}
|
2017-06-28 02:45:56 +03:00
|
|
|
(~(put ju m) hos.c nom.c)
|
2017-10-10 17:44:37 +03:00
|
|
|
=? ..ta-action (~(has by cic) our.bol)
|
2017-06-28 02:45:56 +03:00
|
|
|
%- ~(rep in (~(get ju cic) our.bol))
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {n/naem _ta}
|
2017-07-11 02:41:47 +03:00
|
|
|
(affect n %status [our.bol n] our.bol dif)
|
2017-06-28 02:45:56 +03:00
|
|
|
=. cic (~(del by cic) our.bol)
|
|
|
|
%- ta-deltas
|
|
|
|
%- ~(rep by cic)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {{h/ship s/(set naem)} l/(list delta)}
|
2017-06-28 02:45:56 +03:00
|
|
|
:_ l
|
|
|
|
[%present h s dif]
|
|
|
|
::
|
2017-04-24 21:17:56 +03:00
|
|
|
::> || %circle-configuration
|
2017-04-21 00:59:36 +03:00
|
|
|
::+|
|
|
|
|
++ action-create ::< create story
|
|
|
|
::> creates a story with the specified parameters.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem des/cord typ/security}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
|
|
|
?. (~(has in stories) nom)
|
2017-05-13 01:05:49 +03:00
|
|
|
%^ impact nom %new
|
2017-10-09 23:50:17 +03:00
|
|
|
:* [[[our.bol nom] ~] ~ ~]
|
2017-04-28 20:40:12 +03:00
|
|
|
des
|
2017-07-19 03:08:08 +03:00
|
|
|
*filter
|
2017-06-14 03:28:16 +03:00
|
|
|
:- typ
|
2017-10-31 21:56:56 +03:00
|
|
|
?. ?=(?($village $journal) typ) ~
|
2017-06-14 03:28:16 +03:00
|
|
|
[our.bol ~ ~]
|
2017-04-28 20:40:12 +03:00
|
|
|
==
|
2017-07-08 03:01:56 +03:00
|
|
|
(ta-evil (crip "{(trip nom)}: already exists"))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
++ action-delete ::< delete + announce
|
|
|
|
::> delete story {nom}, optionally announcing the
|
|
|
|
::> event with message {mes}.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem mes/(unit cord)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
2017-10-10 17:44:37 +03:00
|
|
|
=? ..ta-action ?=(^ mes)
|
2017-05-03 19:38:41 +03:00
|
|
|
%+ action-phrase
|
2017-07-11 02:41:47 +03:00
|
|
|
[[our.bol nom] ~ ~]
|
2017-05-03 19:38:41 +03:00
|
|
|
[%lin | u.mes]~
|
2017-05-13 01:05:49 +03:00
|
|
|
(affect nom %remove ~)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ action-depict ::< change description
|
|
|
|
::> change description of story {nom} to {des}.
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem cap/cord}
|
2017-05-13 01:05:49 +03:00
|
|
|
(affect nom %config [our.bol nom] %caption cap)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-09 22:43:42 +03:00
|
|
|
++ action-filter ::< change message rules
|
|
|
|
::> replaces the story's current filter with the
|
|
|
|
::> specified one.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem fit/filter}
|
2017-05-13 01:05:49 +03:00
|
|
|
(affect nom %config [our.bol nom] %filter fit)
|
2017-05-09 22:43:42 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ action-permit ::< invite/banish
|
|
|
|
::> invite to/banish from story {nom} all {sis}.
|
2017-04-14 17:16:36 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem inv/? sis/(set ship)}
|
2017-05-13 01:05:49 +03:00
|
|
|
=+ soy=(~(get by stories) nom)
|
|
|
|
?~ soy
|
2017-07-08 03:01:56 +03:00
|
|
|
(ta-evil (crip "no story {(trip nom)}"))
|
2017-06-14 06:09:48 +03:00
|
|
|
so-done:(~(so-permit so nom ~ u.soy) inv sis)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-03 19:38:41 +03:00
|
|
|
++ action-source ::< un/sub p to/from r
|
2017-07-11 02:41:47 +03:00
|
|
|
::> add/remove {pos} as sources for story {nom}.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem sub/? srs/(set source)}
|
2017-06-27 02:56:03 +03:00
|
|
|
=+ soy=(~(get by stories) nom)
|
|
|
|
?~ soy
|
2017-07-08 03:01:56 +03:00
|
|
|
(ta-evil (crip "no story {(trip nom)}"))
|
2017-10-09 23:50:17 +03:00
|
|
|
so-done:(~(so-sources so nom ~ u.soy) sub srs)
|
2017-04-28 20:40:12 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> || %messaging
|
|
|
|
::+|
|
|
|
|
++ action-convey ::< post exact
|
|
|
|
::> sends the messages provided in the action.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= tos/(list thought)
|
|
|
|
(ta-think & our.bol tos)
|
|
|
|
::
|
|
|
|
++ action-phrase ::< post easy
|
|
|
|
::> sends the message contents provided in the
|
2017-07-07 04:16:17 +03:00
|
|
|
::> action generating a serial and setting a
|
|
|
|
::> timestamp.
|
2017-04-14 00:40:53 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {aud/audience ses/(list speech)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
|
|
|
=- (ta-think & our.bol tos)
|
2017-04-14 00:40:53 +03:00
|
|
|
|- ^- tos/(list thought)
|
2017-04-21 00:59:36 +03:00
|
|
|
?~ ses ~
|
2017-11-01 21:05:38 +03:00
|
|
|
=^ sir eny.bol ~(uniq talk bol)
|
2017-04-21 00:59:36 +03:00
|
|
|
:_ $(ses t.ses)
|
2017-10-19 03:05:53 +03:00
|
|
|
[sir aud [now.bol i.ses]]
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> || %personal-metadata
|
|
|
|
::+|
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
|
|
|
++ action-notify ::< our presence update
|
2017-11-02 02:44:13 +03:00
|
|
|
::> notify the audience of our new presence state,
|
|
|
|
::> or tell them to remove us if {pes} is ~.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-11-02 02:44:13 +03:00
|
|
|
|= {aud/audience pes/(unit presence)}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
2017-11-02 02:44:13 +03:00
|
|
|
?~ pes (present aud %remove ~)
|
|
|
|
(present aud %presence u.pes)
|
2017-06-28 02:45:56 +03:00
|
|
|
::
|
|
|
|
++ action-naming ::< our name update
|
|
|
|
::>
|
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {aud/audience man/human}
|
2017-06-28 02:45:56 +03:00
|
|
|
^+ ..ta-action
|
2017-10-19 03:05:53 +03:00
|
|
|
(present aud %human %full man)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> || %changing-shared-ui
|
|
|
|
::+|
|
2017-05-13 01:05:49 +03:00
|
|
|
++ action-nick ::< new identity
|
2017-04-21 00:59:36 +03:00
|
|
|
::> assigns a new local identity ("nickname") to the
|
|
|
|
::> target ship.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {who/ship nic/nick}
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ ..ta-action
|
2017-05-13 01:05:49 +03:00
|
|
|
?. =((~(get by nicks) who) `nic) ..ta-action ::< no change
|
|
|
|
(ta-delta %nick who nic)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ action-glyph ::< bind a glyph
|
2017-10-19 03:05:53 +03:00
|
|
|
::> un/bind glyph {lif} to audience {aud}.
|
2017-04-11 14:00:13 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {lif/char aud/audience bin/?}
|
|
|
|
(ta-delta %glyph bin lif aud)
|
2017-04-21 00:59:36 +03:00
|
|
|
--
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %subscription-events
|
|
|
|
::> ||
|
|
|
|
::> arms that react to subscription events.
|
|
|
|
::+|
|
2017-03-24 23:10:27 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ ta-observe ::< watch burden bearer
|
2017-06-21 23:48:47 +03:00
|
|
|
::> subscribe to a child who is bearing our burden.
|
2017-11-01 22:24:11 +03:00
|
|
|
::TODO everyone should be able to bear if they so desire.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
|= who/ship
|
|
|
|
^+ +>
|
2017-06-14 03:51:10 +03:00
|
|
|
?. =(our.bol (above who))
|
2017-06-13 01:19:45 +03:00
|
|
|
~&([%not-our-bearer who] +>)
|
|
|
|
(ta-delta %observe who)
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-subscribe ::< listen to
|
2017-07-18 00:41:57 +03:00
|
|
|
::> add her to a status list if applicable.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-23 04:03:37 +03:00
|
|
|
|= {her/ship qer/query}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-11-02 02:44:13 +03:00
|
|
|
?+ -.qer +>
|
|
|
|
$burden (ta-observe her)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ta-greet ::< subscription success
|
2017-06-21 23:48:47 +03:00
|
|
|
::> store a started subscription as source.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem src/source}
|
2017-06-13 01:19:45 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
2017-10-09 23:50:17 +03:00
|
|
|
(so-greet:sor src)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ ta-leave ::< subscription failed
|
2017-10-09 23:50:17 +03:00
|
|
|
::> removes {src} from story {nom}'s sources.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem src/source}
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
2017-10-09 23:50:17 +03:00
|
|
|
(so-leave:sor src)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ ta-take ::< apply prize
|
2017-06-21 23:48:47 +03:00
|
|
|
::> for a %burden prize, bear the burden in a new
|
|
|
|
::> or existing story.
|
|
|
|
::> for a %circle prize, use ++so to accept it.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
|= {wir/wire piz/prize}
|
2017-04-04 17:15:12 +03:00
|
|
|
^+ +>
|
2017-06-13 01:19:45 +03:00
|
|
|
?+ -.piz
|
|
|
|
~&([%ignoring-prize -.piz] +>)
|
|
|
|
::
|
|
|
|
$burden
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ roll ~(tap by sos.piz)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {{n/naem b/burden} _..ta-take}
|
2017-06-14 03:28:16 +03:00
|
|
|
=< so-done
|
|
|
|
(~(so-bear so n ~ (fall (~(get by stories) n) *story)) b)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$circle
|
2017-06-23 01:34:03 +03:00
|
|
|
=+ wer=(etch wir)
|
|
|
|
?> ?=($circle -.wer)
|
|
|
|
%- (ta-know nom.wer) |= sor/_so =< so-done
|
2017-10-09 23:50:17 +03:00
|
|
|
(so-take:sor cir.src.wer +.piz)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ ta-hear ::< apply rumor
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply changes from a rumor to our state.
|
|
|
|
::> for %burden, authoratively apply the story
|
|
|
|
::> diff. if it's a new one, bear it.
|
|
|
|
::> for %circle, apply the story diff normally.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {wir/wire rum/rumor}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.rum
|
|
|
|
~&([%ignoring-rumor -.rum] +>)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$burden
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.rum.rum
|
|
|
|
%- (ta-know nom.rum) |= sor/_so =< so-done
|
|
|
|
(so-hear:sor & [our.bol nom.rum] rum.rum)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$new
|
2017-06-14 03:28:16 +03:00
|
|
|
=< so-done
|
2017-07-22 01:53:24 +03:00
|
|
|
%- ~(so-bear so nom.rum ~ (fall (~(get by stories) nom.rum) *story))
|
|
|
|
[~ [cof.rum.rum ~] [~ ~]]
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
$circle
|
2017-06-23 01:34:03 +03:00
|
|
|
=+ wer=(etch wir)
|
|
|
|
?> ?=($circle -.wer)
|
|
|
|
%- (ta-know nom.wer) |= sor/_so =< so-done
|
2017-10-09 23:50:17 +03:00
|
|
|
(so-hear:sor | cir.src.wer rum.rum)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
|
|
|
::
|
2017-06-13 21:14:13 +03:00
|
|
|
++ ta-repeat ::< message delivered
|
2017-06-21 23:48:47 +03:00
|
|
|
::> message got delivered. if an error was returned
|
|
|
|
::> mark the message as rejected. if not, received.
|
2017-06-13 21:14:13 +03:00
|
|
|
::
|
2017-08-03 07:43:56 +03:00
|
|
|
|= {who/circle ses/(list serial) fal/(unit tang)}
|
2017-06-13 21:14:13 +03:00
|
|
|
^+ +>
|
2017-07-07 06:01:08 +03:00
|
|
|
~? ?=(^ fal) u.fal
|
2017-08-03 07:43:56 +03:00
|
|
|
=- (ta-delta %done who ses -)
|
|
|
|
?~ fal %accepted
|
|
|
|
~>(%slog.[0 u.fal] %rejected)
|
2017-06-13 21:14:13 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
++ ta-resub ::< subscription dropped
|
|
|
|
::> when a subscription gets dropped by gall, we
|
|
|
|
::> resubscribe.
|
|
|
|
::
|
|
|
|
|= {nom/naem src/source}
|
|
|
|
^+ +>
|
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
(so-resub:sor src)
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %messaging
|
|
|
|
::> ||
|
|
|
|
::> arms for sending and processing messages.
|
|
|
|
::+|
|
2017-03-29 01:11:12 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-think ::< publish or review
|
|
|
|
::> consumes each thought.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pub/? aut/ship tos/(list thought)}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
?~ tos +>
|
|
|
|
$(tos t.tos, +> (ta-consume pub aut i.tos))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 17:14:11 +03:00
|
|
|
++ ta-consume ::< to each audience
|
2017-07-11 02:41:47 +03:00
|
|
|
::> conducts thought {tot} to each circle in its audience.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {pub/? aut/ship tot/thought}
|
2017-10-06 20:35:25 +03:00
|
|
|
=+ aud=~(tap in aud.tot)
|
2017-03-23 03:34:56 +03:00
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ aud +>.^$
|
2017-07-07 04:16:17 +03:00
|
|
|
$(aud t.aud, +>.^$ (ta-conduct pub aut i.aud tot))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
++ ta-conduct ::< thought to circle
|
2017-04-21 00:59:36 +03:00
|
|
|
::> either publishes or records a thought.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-11 02:41:47 +03:00
|
|
|
|= {pub/? aut/ship cir/circle tot/thought}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-07-11 02:41:47 +03:00
|
|
|
?: pub
|
2017-10-06 20:35:25 +03:00
|
|
|
?. (team:title our.bol aut)
|
2017-07-11 02:41:47 +03:00
|
|
|
%- ta-note
|
|
|
|
(crip "strange author {(scow %p aut)}")
|
|
|
|
=. aut our.bol
|
|
|
|
?: =(aut hos.cir)
|
2017-10-31 19:09:24 +03:00
|
|
|
?: (~(has by stories) nom.cir)
|
2017-10-31 21:56:56 +03:00
|
|
|
(ta-record nom.cir hos.cir tot)
|
2017-10-31 19:09:24 +03:00
|
|
|
%- ta-note ::TODO avenue for abuse?
|
|
|
|
(crip "have no story {(scow %tas nom.cir)}")
|
2017-07-11 02:41:47 +03:00
|
|
|
(ta-transmit cir tot)
|
|
|
|
?. =(our.bol hos.cir) +>
|
|
|
|
(ta-record nom.cir aut tot)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-record ::< add to story
|
|
|
|
::> add or update telegram {gam} in story {nom}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem gam/telegram}
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (ta-know nom) |= sor/_so =< so-done
|
|
|
|
(so-learn:sor gam)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ ta-transmit ::< send message
|
2017-04-25 22:18:14 +03:00
|
|
|
::> sends thought {tot} to {cir}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-25 22:18:14 +03:00
|
|
|
|= {cir/circle tot/thought}
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-05-13 01:05:49 +03:00
|
|
|
(ta-delta %out cir tot ~)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %stories
|
|
|
|
::> ||
|
|
|
|
::> arms for modifying stories.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ so ::< story core
|
|
|
|
::> story core, used for doing work on a story.
|
|
|
|
::
|
|
|
|
|_ ::> nom: story name in {stories}.
|
|
|
|
::> acs: talk actions issued due to changes.
|
|
|
|
::> story is faceless to ease data access.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
$: nom/naem
|
2017-04-14 01:46:15 +03:00
|
|
|
acs/(list action)
|
2017-03-23 03:34:56 +03:00
|
|
|
story
|
|
|
|
==
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-done ::< apply changes
|
2017-11-01 22:24:11 +03:00
|
|
|
::> apply actions generated by story operations.
|
2017-07-06 23:38:36 +03:00
|
|
|
::TODO maybe produce list of actions, apply in ++ta
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
^+ +>
|
2017-04-14 01:46:15 +03:00
|
|
|
=. acs (flop acs)
|
2017-04-10 23:35:25 +03:00
|
|
|
|- ^+ +>+
|
2017-04-14 01:46:15 +03:00
|
|
|
?~ acs +>+
|
2017-04-21 00:59:36 +03:00
|
|
|
=. +>+ (ta-action ost.bol i.acs)
|
2017-04-14 01:46:15 +03:00
|
|
|
$(acs t.acs)
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-act ::< send action
|
|
|
|
::> stores a talk action.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= act/action
|
2017-03-23 03:34:56 +03:00
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
+>(acs [act acs])
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-25 14:33:02 +03:00
|
|
|
++ so-note ::< tell user
|
|
|
|
::> sends {msg} as an %app message to the user's
|
|
|
|
::> inbox.
|
|
|
|
::
|
|
|
|
|= msg/cord
|
|
|
|
^+ +>
|
|
|
|
%+ so-act %phrase
|
2017-11-01 20:35:06 +03:00
|
|
|
:- [[our.bol %inbox] ~ ~]
|
2017-10-05 20:18:22 +03:00
|
|
|
[%app dap.bol msg]~
|
2017-04-25 14:33:02 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ so-delta ::< send delta
|
2017-06-21 23:48:47 +03:00
|
|
|
::> store delta in ++ta core.
|
2017-04-03 17:50:35 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
+>(deltas [det deltas])
|
2017-04-03 17:50:35 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ so-deltas ::< send delta list
|
2017-06-21 23:48:47 +03:00
|
|
|
::> store multiple deltas in ++ta core.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= des/(list delta)
|
|
|
|
%_(+> deltas (welp (flop des) deltas))
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ so-delta-our ::< send delta of us
|
|
|
|
::> adds a delta about this story.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta-story
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
(so-delta %story nom det)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
++ so-deltas-our ::< send deltas of us
|
|
|
|
::> adds multiple deltas about this story.
|
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= des/(list delta-story)
|
2017-07-21 02:57:53 +03:00
|
|
|
^+ +>
|
|
|
|
%- so-deltas
|
2017-07-22 01:53:24 +03:00
|
|
|
%+ turn des
|
2017-07-21 02:57:53 +03:00
|
|
|
|= d/delta-story
|
|
|
|
[%story nom d]
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %data
|
|
|
|
::> ||
|
|
|
|
::> utility functions for data retrieval.
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ so-cir [our.bol nom] ::< us as circle
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %interaction-events
|
|
|
|
::> ||
|
|
|
|
::> arms that apply events we received.
|
|
|
|
::+|
|
|
|
|
::
|
2017-06-14 04:06:38 +03:00
|
|
|
++ so-take ::< accept circle prize
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply the prize as if it were rumors.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
|= {src/circle nes/(list envelope) cos/lobby pes/crowd}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-06-13 01:19:45 +03:00
|
|
|
=. +>.$
|
|
|
|
(so-hear | src %config src %full loc.cos)
|
|
|
|
=. +>.$
|
2017-10-08 16:20:02 +03:00
|
|
|
=+ los=~(tap by loc.pes)
|
|
|
|
|-
|
|
|
|
?~ los +>.^$
|
|
|
|
=. +>.^$
|
|
|
|
(so-hear | src %status src p.i.los %full q.i.los)
|
|
|
|
$(los t.los)
|
|
|
|
::TODO ideally you'd just do this, but that runtime errors...
|
|
|
|
::%- ~(rep in loc.pes)
|
|
|
|
::|= {{w/ship s/status} _+>.$}
|
|
|
|
::(so-hear | src %status src w %full s)
|
2017-07-21 02:57:53 +03:00
|
|
|
(so-unpack src nes)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-06-14 04:06:38 +03:00
|
|
|
++ so-hear ::< accept circle rumor
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply changes from a rumor to this story.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {bur/? src/circle rum/rumor-story}
|
2017-10-06 14:29:15 +03:00
|
|
|
::TODO tall-form gate comments like this for everything?
|
|
|
|
::|= $: ::> bur: whether the story is inherited
|
|
|
|
:: ::> src: story to change
|
|
|
|
:: ::> rum: change to this story
|
|
|
|
:: ::
|
|
|
|
:: bur/?
|
|
|
|
:: src/circle
|
|
|
|
:: rum/rumor-story
|
|
|
|
:: ==
|
2017-06-13 01:19:45 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?- -.rum
|
2017-06-14 03:28:16 +03:00
|
|
|
$new ?: =(src so-cir)
|
2017-07-22 01:53:24 +03:00
|
|
|
(so-config-full ~ cof.rum)
|
|
|
|
$(rum [%config src %full cof.rum])
|
2017-10-09 12:57:36 +03:00
|
|
|
$bear (so-bear bur.rum)
|
2017-07-22 01:53:24 +03:00
|
|
|
$gram (so-open src nev.rum)
|
2017-06-14 03:28:16 +03:00
|
|
|
$config :: full changes to us need to get split up.
|
2017-07-22 01:53:24 +03:00
|
|
|
?: &(=(cir.rum so-cir) ?=($full -.dif.rum))
|
|
|
|
(so-config-full `shape cof.dif.rum)
|
2017-06-14 03:28:16 +03:00
|
|
|
:: remotes are fine.
|
2017-07-22 01:53:24 +03:00
|
|
|
?: =(src cir.rum)
|
|
|
|
(so-delta-our rum)
|
2017-06-14 03:28:16 +03:00
|
|
|
:: remotes of remotes are not.
|
|
|
|
~? =(src so-cir) %but-src-is-us
|
|
|
|
+>
|
2017-05-13 01:05:49 +03:00
|
|
|
$status :: ignore foreign remotes.
|
2017-10-09 12:57:36 +03:00
|
|
|
?. |(=(src cir.rum) =(src so-cir)) +>
|
2017-07-22 01:53:24 +03:00
|
|
|
(so-delta-our rum)
|
2017-05-13 01:05:49 +03:00
|
|
|
$remove (so-delta-our %config src %remove ~)
|
|
|
|
==
|
|
|
|
::
|
2017-06-14 03:28:16 +03:00
|
|
|
++ so-bear ::< accept burden
|
2017-06-21 23:48:47 +03:00
|
|
|
::> add what was pushed down from above to our
|
|
|
|
::> state. in case of conflict, existing data is
|
|
|
|
::> overwritten.
|
2017-06-14 03:28:16 +03:00
|
|
|
::
|
|
|
|
|= {gaz/(list telegram) cos/lobby pes/crowd}
|
|
|
|
^+ +>
|
2017-07-07 00:45:38 +03:00
|
|
|
=* self +>
|
2017-06-14 03:28:16 +03:00
|
|
|
:: local config
|
2017-07-07 00:45:38 +03:00
|
|
|
=. self
|
2017-06-14 03:28:16 +03:00
|
|
|
(so-config-full `shape loc.cos)
|
|
|
|
:: remote config
|
2017-07-07 00:45:38 +03:00
|
|
|
=. self
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ roll ~(tap by rem.cos)
|
2017-07-07 00:45:38 +03:00
|
|
|
|= {{r/circle c/config} _self}
|
2017-06-14 03:28:16 +03:00
|
|
|
(so-delta-our %config r %full c)
|
2017-07-18 00:41:57 +03:00
|
|
|
:: local status
|
2017-07-07 00:45:38 +03:00
|
|
|
=. self
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ roll ~(tap by loc.pes)
|
2017-07-07 00:45:38 +03:00
|
|
|
|= {{w/ship s/status} _self}
|
2017-07-11 02:41:47 +03:00
|
|
|
(so-delta-our %status so-cir w %full s)
|
2017-10-31 19:10:44 +03:00
|
|
|
::TODO ^ runtime when accepting burden
|
2017-07-18 00:41:57 +03:00
|
|
|
:: remote status
|
2017-07-07 00:45:38 +03:00
|
|
|
=. self
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ roll ~(tap by rem.pes)
|
2017-07-11 02:41:47 +03:00
|
|
|
|= {{c/circle g/group} _self}
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ roll ~(tap by g)
|
2017-07-07 00:45:38 +03:00
|
|
|
|= {{w/ship s/status} _self}
|
2017-07-11 02:41:47 +03:00
|
|
|
(so-delta-our %status c w %full s)
|
2017-06-14 03:28:16 +03:00
|
|
|
:: telegrams
|
2017-07-07 00:45:38 +03:00
|
|
|
=. self
|
2017-07-21 02:57:53 +03:00
|
|
|
%- so-deltas-our
|
2017-06-14 03:28:16 +03:00
|
|
|
%+ turn gaz
|
|
|
|
|= t/telegram
|
2017-07-21 02:57:53 +03:00
|
|
|
^- delta-story
|
|
|
|
:- %gram
|
2017-07-07 04:16:17 +03:00
|
|
|
:: in audience, replace above with us.
|
2017-07-11 03:23:12 +03:00
|
|
|
=- t(aud -)
|
|
|
|
=+ (~(del in aud.t) [(above our.bol) nom])
|
2017-07-11 02:41:47 +03:00
|
|
|
(~(put in -) so-cir)
|
2017-07-11 04:41:50 +03:00
|
|
|
:: inherited flag
|
|
|
|
(so-delta-our %inherited &)
|
2017-06-14 03:28:16 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %changes
|
|
|
|
::> ||
|
2017-07-06 23:38:36 +03:00
|
|
|
::> arms that make miscellaneous changes to this story.
|
2017-04-21 00:59:36 +03:00
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-22 03:16:22 +03:00
|
|
|
++ so-config-full ::< split full config
|
|
|
|
::> split a %full config delta up into multiple
|
|
|
|
::> smaller ones, for easier application.
|
|
|
|
::
|
|
|
|
|= {old/(unit config) cof/config}
|
|
|
|
^+ +>
|
2017-11-01 22:24:11 +03:00
|
|
|
~? &(?=(^ old) !=(src.u.old src.cof))
|
|
|
|
%maybe-missing-src-changes
|
2017-06-22 03:16:22 +03:00
|
|
|
%- so-deltas
|
|
|
|
%+ turn
|
|
|
|
%+ weld
|
2017-07-08 03:21:40 +03:00
|
|
|
^- (list delta-story)
|
2017-06-22 03:16:22 +03:00
|
|
|
?~ old ~
|
|
|
|
::TODO? what to do about src?
|
|
|
|
:~ ::[%follow | src.u.old]
|
2017-10-31 21:56:56 +03:00
|
|
|
[%config so-cir %permit | sis.con.u.old]
|
2017-06-22 03:16:22 +03:00
|
|
|
==
|
2017-07-08 03:21:40 +03:00
|
|
|
^- (list delta-story)
|
2017-06-22 03:16:22 +03:00
|
|
|
:~ ::[%follow & src.cof]
|
|
|
|
[%config so-cir %caption cap.cof]
|
|
|
|
[%config so-cir %filter fit.cof]
|
|
|
|
[%config so-cir %secure sec.con.cof]
|
2017-10-31 21:56:56 +03:00
|
|
|
[%config so-cir %permit & sis.con.cof]
|
2017-06-22 03:16:22 +03:00
|
|
|
==
|
2017-07-08 03:21:40 +03:00
|
|
|
|= d/delta-story
|
2017-06-22 03:16:22 +03:00
|
|
|
[%story nom d]
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ so-sources ::< change source
|
2017-10-09 23:50:17 +03:00
|
|
|
::> adds or removes {srs} from our sources,
|
|
|
|
::> skipping over ones we already (don't) have.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {add/? srs/(set source)}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-10-09 23:50:17 +03:00
|
|
|
=/ sus/(set source)
|
|
|
|
%. src.shape
|
|
|
|
?:(add ~(dif in srs) ~(int in srs))
|
2017-10-10 16:59:15 +03:00
|
|
|
:: we only make a delta for removals here,
|
|
|
|
:: because we don't need to wait for ++reap when
|
|
|
|
:: pulling subscriptions.
|
|
|
|
=? +>.$ !add
|
|
|
|
=+ sos=~(tap in sus)
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ sos +>.^$
|
|
|
|
=. +>.^$ (so-delta-our %config so-cir %source | i.sos)
|
|
|
|
$(sos t.sos)
|
|
|
|
::TODO ideally below, but unexplained runtime error at `so-delta-our`
|
|
|
|
::%+ roll ~(tap in sus)
|
|
|
|
::|= {src/source _+>.$}
|
|
|
|
::^+ +>.^$
|
|
|
|
::(so-delta-our %config so-cir %source | src)
|
2017-10-09 23:50:17 +03:00
|
|
|
?~ sus +>.$
|
2017-10-10 16:59:15 +03:00
|
|
|
(so-delta-our %follow add sus)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
++ so-depict ::< change description
|
|
|
|
::> modifies our caption.
|
|
|
|
::
|
|
|
|
|= cap/cord
|
|
|
|
^+ +>
|
|
|
|
?: =(cap cap.shape) +>
|
|
|
|
(so-delta-our %config so-cir %caption cap)
|
|
|
|
::
|
|
|
|
++ so-filter ::< change message rules
|
|
|
|
::> modifies our filter.
|
|
|
|
::
|
|
|
|
|= fit/filter
|
|
|
|
^+ +>
|
|
|
|
?: =(fit fit.shape) +>
|
|
|
|
(so-delta-our %config so-cir %filter fit)
|
|
|
|
::
|
|
|
|
++ so-delete ::< delete story
|
2017-04-21 00:59:36 +03:00
|
|
|
::> deletes this story. removes it from {stories}
|
2017-04-24 21:17:56 +03:00
|
|
|
::> and unsubscribes from all src.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
(so-delta-our %remove ~)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %subscriptions
|
|
|
|
::> ||
|
|
|
|
::> arms for starting and ending subscriptions
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ so-greet ::< subscription started
|
2017-06-21 23:48:47 +03:00
|
|
|
::> store a started subscription as source.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= src/source
|
2017-06-13 01:19:45 +03:00
|
|
|
^+ +>
|
2017-10-09 23:50:17 +03:00
|
|
|
?: (~(has in src.shape) src) +>
|
|
|
|
(so-delta-our %config so-cir %source & src)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
++ so-leave ::< subscription ended
|
2017-10-09 23:50:17 +03:00
|
|
|
::> delete {src} from our sources.
|
|
|
|
::
|
|
|
|
|= src/source
|
|
|
|
^+ +>
|
|
|
|
?. (~(has in src.shape) src) +>
|
|
|
|
(so-delta-our %config so-cir %source | src)
|
|
|
|
::
|
|
|
|
++ so-resub ::< subscription revived
|
|
|
|
::> re-subscribe to a dropped subscription.
|
|
|
|
::> if it was already active, we continue where
|
|
|
|
::> we left off.
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= src/source
|
2017-04-21 00:59:36 +03:00
|
|
|
^+ +>
|
2017-10-09 23:50:17 +03:00
|
|
|
=- (so-delta-our %follow & [[cir.src -] ~ ~])
|
|
|
|
^- range
|
|
|
|
?. (~(has by sequence) cir.src) ran.src
|
|
|
|
=- `[[%ud (~(got by sequence) cir.src)] -]
|
|
|
|
?~ ran.src ~
|
|
|
|
tal.u.ran.src
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-first-grams ::< beginning of stream
|
2017-06-27 02:56:03 +03:00
|
|
|
::> find all grams that fall within the range.
|
|
|
|
::
|
|
|
|
|= ran/range
|
|
|
|
^- (list telegram)
|
|
|
|
=+ [num=0 gaz=grams zeg=*(list telegram)]
|
|
|
|
:: fill in empty ranges to select all grams.
|
|
|
|
=. ran
|
|
|
|
?~ ran `[[%ud 0] `[%ud count]]
|
|
|
|
?~ tal.u.ran `[hed.u.ran `[%ud count]]
|
|
|
|
ran
|
|
|
|
:: never fails, but compiler needs it.
|
|
|
|
?> &(?=(^ ran) ?=(^ tal.u.ran))
|
|
|
|
%- flop
|
|
|
|
|- ^- (list telegram)
|
|
|
|
?~ gaz zeg
|
|
|
|
?: ?- -.u.tal.u.ran :: after the end
|
|
|
|
$ud (lth +.u.tal.u.ran num)
|
2017-07-11 03:23:12 +03:00
|
|
|
$da (lth +.u.tal.u.ran wen.i.gaz)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-06-27 02:56:03 +03:00
|
|
|
:: if past the river, we're done searching.
|
|
|
|
zeg
|
|
|
|
?: ?- -.hed.u.ran :: before the start
|
|
|
|
$ud (lth num +.hed.u.ran)
|
2017-07-11 03:23:12 +03:00
|
|
|
$da (lth wen.i.gaz +.hed.u.ran)
|
2017-03-23 03:34:56 +03:00
|
|
|
==
|
2017-06-27 02:56:03 +03:00
|
|
|
:: if before the river, continue onward.
|
|
|
|
$(num +(num), gaz t.gaz)
|
2017-04-21 17:14:11 +03:00
|
|
|
:: if in the river, add this gram and continue.
|
2017-06-27 02:56:03 +03:00
|
|
|
$(num +(num), gaz t.gaz, zeg [i.gaz zeg])
|
|
|
|
::
|
|
|
|
++ so-in-range ::< place in range?
|
|
|
|
::> produces two booleans: whether we're
|
|
|
|
::> currently in the range, and whether the range
|
|
|
|
::> has passed.
|
2017-07-19 03:22:45 +03:00
|
|
|
::TODO to deal with changed messages, we'll want
|
|
|
|
:: to be able to pass in a num.
|
2017-06-27 02:56:03 +03:00
|
|
|
::
|
|
|
|
|= ran/range
|
|
|
|
^- {in/? done/?}
|
|
|
|
?~ ran [& |]
|
|
|
|
=/ min
|
|
|
|
?- -.hed.u.ran
|
|
|
|
$ud (gth count +.hed.u.ran)
|
|
|
|
$da (gth now.bol +.hed.u.ran)
|
|
|
|
==
|
|
|
|
?~ tal.u.ran
|
|
|
|
[min |]
|
|
|
|
=- [&(min -) !-]
|
|
|
|
?- -.u.tal.u.ran
|
|
|
|
$ud (gte +(+.u.tal.u.ran) count)
|
|
|
|
$da (gte +.u.tal.u.ran now.bol)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %messaging
|
|
|
|
::> ||
|
|
|
|
::> arms for adding to this story's messages.
|
|
|
|
::+|
|
|
|
|
::
|
2017-05-09 22:43:42 +03:00
|
|
|
++ so-sane ::< sanitize
|
|
|
|
::> sanitize %lin speech according to our settings.
|
|
|
|
::
|
2017-07-11 03:23:12 +03:00
|
|
|
|= sep/speech
|
|
|
|
^- speech
|
|
|
|
?. ?=($lin -.sep) sep
|
|
|
|
%_ sep
|
|
|
|
msg
|
2017-05-09 22:43:42 +03:00
|
|
|
%- crip
|
|
|
|
%- tufa
|
2017-07-11 03:23:12 +03:00
|
|
|
%+ turn (tuba (trip msg.sep))
|
2017-05-09 22:43:42 +03:00
|
|
|
|= a/@c
|
|
|
|
:: always replace control characters.
|
|
|
|
?: |((lth a 32) =(a `@c`127))
|
|
|
|
`@`'?'
|
|
|
|
:: if desired, remove uppercasing.
|
2017-06-16 06:29:35 +03:00
|
|
|
?: ?& !cas.fit.shape
|
2017-05-09 22:43:42 +03:00
|
|
|
(gte a 'A')
|
|
|
|
(lte a 'Z')
|
|
|
|
==
|
|
|
|
(add a 32)
|
|
|
|
:: if desired, replace non-ascii characters.
|
|
|
|
?: ?& !utf.fit.shape
|
|
|
|
(gth a 127)
|
|
|
|
==
|
|
|
|
`@`'?'
|
|
|
|
a
|
|
|
|
==
|
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
++ so-unpack ::< process envelopes
|
|
|
|
::> learn telegrams from list of envelopes and
|
|
|
|
::> update the sequence of the source if needed.
|
|
|
|
::
|
|
|
|
|= {src/circle nes/(list envelope)}
|
|
|
|
^+ +>
|
|
|
|
=. +> (so-lesson (turn nes tail))
|
|
|
|
=/ num
|
|
|
|
%+ roll nes
|
|
|
|
|= {nev/envelope max/@ud}
|
|
|
|
?:((gth num.nev max) num.nev max)
|
|
|
|
?. (gth num (fall (~(get by sequence) src) 0))
|
|
|
|
+>.$
|
|
|
|
(so-delta-our %sequent src num)
|
|
|
|
::
|
|
|
|
++ so-open ::< process envelope
|
|
|
|
::> learn telegram from envelope and update the
|
|
|
|
::> sequence of the source if needed.
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
|
|
|
|= {src/circle nev/envelope}
|
|
|
|
^+ +>
|
2017-07-21 02:57:53 +03:00
|
|
|
=. +> (so-learn gam.nev)
|
|
|
|
?. (gth num.nev (fall (~(get by sequence) src) 0))
|
|
|
|
+>
|
|
|
|
(so-delta-our %sequent src num.nev)
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-lesson ::< learn messages
|
|
|
|
::> learn all telegrams in a list.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= gaz/(list telegram)
|
|
|
|
^+ +>
|
|
|
|
?~ gaz +>
|
2017-04-21 00:59:36 +03:00
|
|
|
$(gaz t.gaz, +> (so-learn i.gaz))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-learn ::< save/update message
|
|
|
|
::> store an incoming telegram, updating if it
|
|
|
|
::> already exists.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-05-09 22:43:42 +03:00
|
|
|
:: check for write permissions.
|
2017-06-13 01:19:45 +03:00
|
|
|
?. (so-admire aut.gam) +>
|
2017-05-09 22:43:42 +03:00
|
|
|
:: clean up the message to conform to our rules.
|
2017-07-11 03:23:12 +03:00
|
|
|
=. sep.gam (so-sane sep.gam)
|
2017-07-21 02:57:53 +03:00
|
|
|
(so-delta-our %gram gam)
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %permissions
|
|
|
|
::> ||
|
|
|
|
::> arms relating to story permissions.
|
|
|
|
::+|
|
2017-04-14 17:41:49 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ so-permit ::< invite/banish
|
|
|
|
::> update config to dis/allow ships permission.
|
2017-04-10 23:35:25 +03:00
|
|
|
::
|
|
|
|
|= {inv/? sis/(set ship)}
|
|
|
|
^+ +>
|
2017-04-21 00:59:36 +03:00
|
|
|
::> wyt: whitelist?
|
|
|
|
::> add: add to list?
|
2017-10-31 21:56:56 +03:00
|
|
|
=/ wyt/? ?=(?($village $journal) sec.con.shape)
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ add/? =(inv wyt)
|
2017-06-14 06:09:48 +03:00
|
|
|
=/ sus/(set ship)
|
2017-10-31 21:56:56 +03:00
|
|
|
%. sis.con.shape
|
2017-06-14 06:09:48 +03:00
|
|
|
?:(add ~(dif in sis) ~(int in sis))
|
2017-04-10 23:35:25 +03:00
|
|
|
=. +>.$
|
2017-04-21 00:59:36 +03:00
|
|
|
%- so-act
|
2017-04-14 01:46:15 +03:00
|
|
|
:- %phrase
|
2017-06-14 06:09:48 +03:00
|
|
|
%- ~(rep in sus)
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {s/ship a/audience t/(list speech)}
|
2017-11-01 20:35:06 +03:00
|
|
|
:- (~(put in a) [s %inbox])
|
2017-05-13 01:05:49 +03:00
|
|
|
[[%inv inv so-cir] t]
|
2017-06-14 06:09:48 +03:00
|
|
|
(so-delta-our %config so-cir %permit [add sus])
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
++ so-admire ::< accept from
|
|
|
|
::> checks {her} write permissions.
|
|
|
|
::
|
|
|
|
|= her/ship
|
|
|
|
^- ?
|
2017-04-24 21:17:56 +03:00
|
|
|
?- sec.con.shape
|
2017-10-31 21:56:56 +03:00
|
|
|
$channel !(~(has in sis.con.shape) her) ::< blacklist
|
|
|
|
$village (~(has in sis.con.shape) her) ::< whitelist
|
|
|
|
$journal (~(has in sis.con.shape) her) ::< author whitelist
|
|
|
|
$mailbox !(~(has in sis.con.shape) her) ::< author blacklist
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ so-visible ::< display to
|
|
|
|
::> checks {her} read permissions.
|
|
|
|
::
|
|
|
|
|= her/ship
|
|
|
|
^- ?
|
2017-04-24 21:17:56 +03:00
|
|
|
?- sec.con.shape
|
2017-10-31 21:56:56 +03:00
|
|
|
$channel !(~(has in sis.con.shape) her) ::< blacklist
|
|
|
|
$village (~(has in sis.con.shape) her) ::< whitelist
|
|
|
|
$journal & ::< all
|
|
|
|
$mailbox (team:title our.bol her) ::< our team
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ da ::< delta application
|
|
|
|
::> core for doing things, mostly applying deltas to
|
|
|
|
::> application state, but also dealing with events
|
|
|
|
::> that aren't pokes.
|
|
|
|
::> where appropriate, creates moves. those get
|
|
|
|
::> produced when finalizing with ++da-done.
|
|
|
|
::
|
|
|
|
|_ ::> moves: moves created by core operations.
|
|
|
|
::
|
|
|
|
moves/(list move)
|
|
|
|
::
|
|
|
|
++ da-done ::< resolve core
|
|
|
|
::> produces the moves stored in ++da's moves.
|
|
|
|
::> they are produced in reverse order because
|
|
|
|
::> ++da-emil and ++da-emit add them to the head of
|
|
|
|
::> the {moves}.
|
|
|
|
::
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-05-13 01:05:49 +03:00
|
|
|
[(flop moves) +>]
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ da-emil ::< emit move list
|
|
|
|
::> adds multiple moves to the head of {moves}.
|
|
|
|
::> flops to stay consistent with ++ta-emit.
|
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
|
|
|
++ da-emit ::< emit a move
|
|
|
|
::> adds a move to the head of {moves}.
|
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
|
|
|
::
|
2017-06-28 02:45:56 +03:00
|
|
|
++ da-present ::< send %present cmd
|
|
|
|
::>
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {hos/ship nos/(set naem) dif/diff-status}
|
2017-06-28 02:45:56 +03:00
|
|
|
^+ +>
|
|
|
|
%- da-emit
|
|
|
|
:* ost.bol
|
|
|
|
%poke
|
|
|
|
/present
|
2017-10-05 20:18:22 +03:00
|
|
|
[hos dap.bol]
|
2017-06-28 02:45:56 +03:00
|
|
|
[%talk-command %present nos dif]
|
|
|
|
==
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
::> ||
|
|
|
|
::> || %change-application
|
|
|
|
::> ||
|
|
|
|
::> arms that change the application state.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ da-change ::< apply delta
|
|
|
|
::> modifies application state according to the
|
|
|
|
::> change specified in {dif}.
|
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?- -.det
|
|
|
|
$out (da-change-out +.det)
|
2017-08-03 07:43:56 +03:00
|
|
|
$done (da-change-done +.det)
|
2017-07-22 01:53:24 +03:00
|
|
|
$glyph (da-change-glyph +.det)
|
|
|
|
$nick (da-change-nick +.det)
|
|
|
|
$story (da-change-story +.det)
|
2017-06-28 02:45:56 +03:00
|
|
|
$init da-init
|
2017-07-22 01:53:24 +03:00
|
|
|
$observe (da-observe +.det)
|
|
|
|
$present (da-present +.det)
|
|
|
|
$quit (da-emit [ost.det %quit ~])
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ da-init ::< startup side-effects
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply %init delta, querying the /burden of the
|
|
|
|
::> ship above us.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
%- da-emit
|
|
|
|
:* 0
|
|
|
|
%peer
|
|
|
|
/burden
|
2017-10-05 20:18:22 +03:00
|
|
|
[(above our.bol) dap.bol]
|
2017-06-13 04:09:00 +03:00
|
|
|
/burden/(scot %p our.bol)
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ da-observe ::< watch burden bearer
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply %observe delta, querying the /report of
|
|
|
|
::> {who} below us.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
|= who/ship
|
|
|
|
%- da-emit
|
|
|
|
:* 0
|
|
|
|
%peer
|
2017-06-14 04:06:38 +03:00
|
|
|
/report/(scot %p who)
|
2017-10-05 20:18:22 +03:00
|
|
|
[who dap.bol]
|
2017-06-13 01:19:45 +03:00
|
|
|
/report
|
|
|
|
==
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ da-change-out ::< outgoing messages
|
2017-07-07 06:01:08 +03:00
|
|
|
::> apply an %out delta, sending a message.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
|= {cir/circle out/(list thought)}
|
|
|
|
^+ +>
|
2017-08-03 07:43:56 +03:00
|
|
|
=+ ses=(turn out head)
|
|
|
|
=. outbox
|
|
|
|
:: for every serial, add %pending state.
|
|
|
|
%+ roll ses
|
|
|
|
|= {s/serial o/_outbox}
|
2017-10-10 17:44:37 +03:00
|
|
|
=? o ?=($~ o) outbox
|
2017-08-03 07:43:56 +03:00
|
|
|
=+ t=(fall (~(get by o) s) *tracking)
|
|
|
|
%+ ~(put by o) s
|
|
|
|
(~(put by t) cir %pending)
|
2017-07-07 06:01:08 +03:00
|
|
|
%+ da-emit ost.bol
|
|
|
|
:* %poke
|
2017-08-03 07:43:56 +03:00
|
|
|
/repeat/(scot %p hos.cir)/[nom.cir]/(scot %ud (jam ses))
|
2017-10-05 20:18:22 +03:00
|
|
|
[hos.cir dap.bol]
|
2017-07-07 06:01:08 +03:00
|
|
|
[%talk-command %publish out]
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-08-03 07:43:56 +03:00
|
|
|
++ da-change-done ::< delivered messages
|
|
|
|
::> apply a %done delta, setting new delivery state
|
|
|
|
::> for messages.
|
|
|
|
::
|
|
|
|
|= {cir/circle ses/(list serial) res/delivery}
|
|
|
|
^+ +>
|
|
|
|
%_ +>
|
|
|
|
outbox
|
|
|
|
:: for every serial, set new delivery state.
|
|
|
|
%- ~(gas by outbox)
|
|
|
|
%+ turn ses
|
|
|
|
|= s/serial
|
|
|
|
:- s
|
|
|
|
%+ ~(put by (~(got by outbox) s))
|
|
|
|
cir res
|
|
|
|
==
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ da-change-glyph ::< un/bound glyph
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a %glyph delta, un/binding a glyph to/from
|
2017-10-19 03:05:53 +03:00
|
|
|
::> an audience.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-19 03:05:53 +03:00
|
|
|
|= {bin/? gyf/char aud/audience}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
|
|
|
?: bin
|
|
|
|
%_ +>
|
2017-10-19 03:05:53 +03:00
|
|
|
binds (~(put ju binds) gyf aud)
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
2017-10-19 03:05:53 +03:00
|
|
|
=/ ole/(list audience)
|
|
|
|
?. =(aud ~) [aud ~]
|
2017-10-06 20:35:25 +03:00
|
|
|
~(tap in (~(get ju binds) gyf))
|
2017-05-13 01:05:49 +03:00
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ ole +>.^$
|
|
|
|
%_ $
|
2017-07-11 23:11:17 +03:00
|
|
|
binds (~(del ju binds) gyf i.ole)
|
2017-05-13 01:05:49 +03:00
|
|
|
ole t.ole
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ da-change-nick ::< changed nickname
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a %nick delta, setting a nickname for a
|
|
|
|
::> ship.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {who/ship nic/nick}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-06-22 03:16:22 +03:00
|
|
|
+>(nicks (change-nicks nicks who nic))
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %stories
|
|
|
|
::> ||
|
|
|
|
::> arms for modifying stories.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ da-change-story ::< apply circle delta
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a %story delta, redirecting the delta
|
|
|
|
::> itself to ++sa-change.
|
|
|
|
::> in case of a new or deleted story, specialized
|
|
|
|
::> arms are called.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {nom/naem det/delta-story}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.det
|
2017-06-14 04:49:45 +03:00
|
|
|
=< sa-done
|
2017-07-22 01:53:24 +03:00
|
|
|
%. det
|
2017-07-11 04:41:50 +03:00
|
|
|
=+ (fall (~(get by stories) nom) *story)
|
|
|
|
~(sa-change sa nom -)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
$new (da-create nom +.det)
|
2017-06-14 03:28:16 +03:00
|
|
|
$bear ~&(%unexpected-unsplit-bear +>)
|
2017-05-13 01:05:49 +03:00
|
|
|
$remove (da-delete nom)
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ da-create ::< configure story
|
|
|
|
::> creates story {nom} with config {con}.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem cof/config}
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
|
|
|
=< sa-done
|
2017-07-11 04:41:50 +03:00
|
|
|
%- ~(sa-change sa nom *story)
|
2017-06-13 01:19:45 +03:00
|
|
|
[%config [our.bol nom] %full cof]
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ da-delete ::< delete story
|
|
|
|
::> calls the story core to delete story {nom}.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
|
|
|
=. +>
|
|
|
|
%- da-emil
|
|
|
|
~(sa-delete sa nom (~(got by stories) nom))
|
|
|
|
+>(stories (~(del by stories) nom))
|
|
|
|
::
|
|
|
|
++ sa ::< story delta core
|
|
|
|
::> story core, used for doing work on a story.
|
|
|
|
::
|
|
|
|
|_ ::> nom: story name in {stories}.
|
|
|
|
::> story is faceless to ease data access.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
$: nom/naem
|
2017-05-13 01:05:49 +03:00
|
|
|
story
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sa-done ::< apply changes
|
|
|
|
::> put changed story back into the map.
|
|
|
|
::
|
|
|
|
+>(stories (~(put by stories) nom +<+))
|
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %emitters
|
|
|
|
::> ||
|
|
|
|
::> arms that create outward changes.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sa-emil ::< emit move list
|
|
|
|
::> adds multiple moves to the head of {moves}.
|
|
|
|
::> flops to stay consistent with ++ta-emit.
|
|
|
|
::
|
|
|
|
|= mol/(list move)
|
|
|
|
%_(+> moves (welp (flop mol) moves))
|
|
|
|
::
|
|
|
|
++ sa-emit ::< emit a move
|
|
|
|
::> adds a move to the head of {moves}.
|
|
|
|
::
|
|
|
|
|= mov/move
|
|
|
|
%_(+> moves [mov moves])
|
|
|
|
::
|
|
|
|
++ sa-sauce ::< play cards
|
|
|
|
::> cards to moves.
|
|
|
|
::
|
|
|
|
|= {ost/bone cub/(list card)}
|
|
|
|
^- (list move)
|
|
|
|
(flop (turn cub |=(a/card [ost a])))
|
|
|
|
::
|
|
|
|
::> ||
|
2017-06-22 03:16:22 +03:00
|
|
|
::> || %data
|
2017-06-13 01:19:45 +03:00
|
|
|
::> ||
|
2017-06-22 03:16:22 +03:00
|
|
|
::> utility functions for data retrieval.
|
2017-06-13 01:19:45 +03:00
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sa-cir [our.bol nom]
|
|
|
|
::
|
|
|
|
::> ||
|
2017-05-13 01:05:49 +03:00
|
|
|
::> || %delta-application
|
|
|
|
::> ||
|
|
|
|
::> arms for applying deltas.
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sa-delete ::< deletion of story
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a %remove story delta, unsubscribing
|
|
|
|
::> this story from all its active sources.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
(sa-abjure src.shape)
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ sa-change ::< apply circle delta
|
2017-06-21 23:48:47 +03:00
|
|
|
::> figure out whether to apply a %story delta to
|
|
|
|
::> local or remote data.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta-story
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
%. det
|
|
|
|
?: ?& ?=(?($config $status) -.det)
|
|
|
|
!=(cir.det sa-cir)
|
2017-07-11 02:41:47 +03:00
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
sa-change-remote
|
2017-07-11 02:41:47 +03:00
|
|
|
sa-change-local
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
++ sa-change-local ::< apply our delta
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a %story delta to local data.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta-story
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.det
|
|
|
|
~&([%unexpected-delta-local -.det] !!)
|
2017-06-14 03:28:16 +03:00
|
|
|
::
|
2017-07-11 04:41:50 +03:00
|
|
|
$inherited
|
2017-07-22 01:53:24 +03:00
|
|
|
+>(inherited ihr.det)
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
|
|
|
$follow
|
2017-10-09 23:50:17 +03:00
|
|
|
(sa-emil (sa-follow-effects sub.det srs.det))
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
|
|
|
$sequent
|
2017-07-22 01:53:24 +03:00
|
|
|
+>(sequence (~(put by sequence) cir.det num.det))
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
$gram
|
2017-07-22 01:53:24 +03:00
|
|
|
(sa-change-gram gam.det)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
$config
|
|
|
|
=. +>
|
|
|
|
%- sa-emil
|
2017-07-22 01:53:24 +03:00
|
|
|
(sa-config-effects shape dif.det)
|
|
|
|
+>(shape (change-config shape dif.det))
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
$status
|
|
|
|
%_ +>
|
|
|
|
locals
|
2017-07-22 01:53:24 +03:00
|
|
|
%+ ~(put by locals) who.det
|
2017-05-13 01:05:49 +03:00
|
|
|
%+ change-status
|
2017-07-22 01:53:24 +03:00
|
|
|
(fall (~(get by locals) who.det) *status)
|
|
|
|
dif.det
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2017-06-21 23:48:47 +03:00
|
|
|
++ sa-change-gram ::< save/update message
|
2017-07-21 02:57:53 +03:00
|
|
|
::> apply a %gram delta, either appending or
|
2017-06-21 23:48:47 +03:00
|
|
|
::> updating a message.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
|= gam/telegram
|
|
|
|
^+ +>
|
2017-07-19 03:22:45 +03:00
|
|
|
::TODO move "known" logic up into ++so? that way,
|
|
|
|
:: we can attach message numbers to changes.
|
2017-07-11 03:23:12 +03:00
|
|
|
=+ old=(~(get by known) uid.gam)
|
2017-05-13 01:05:49 +03:00
|
|
|
?~ old
|
|
|
|
:: new message
|
|
|
|
%_ +>.$
|
2017-06-14 03:18:04 +03:00
|
|
|
grams (welp grams [gam ~])
|
2017-05-13 01:05:49 +03:00
|
|
|
count +(count)
|
2017-07-11 03:23:12 +03:00
|
|
|
known (~(put by known) uid.gam count)
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
:: changed message
|
|
|
|
%_ +>.$
|
|
|
|
grams %+ welp
|
2017-07-13 01:32:07 +03:00
|
|
|
(scag (dec u.old) grams)
|
|
|
|
[gam (slag u.old grams)]
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sa-change-remote ::< apply remote's delta
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply a story diff to remote data.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta-story
|
2017-05-13 01:05:49 +03:00
|
|
|
^+ +>
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.det
|
|
|
|
~&([%unexpected-delta-remote -.det] !!)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
$config
|
2017-07-22 01:53:24 +03:00
|
|
|
?: ?=($remove -.dif.det)
|
|
|
|
+>(mirrors (~(del by mirrors) cir.det))
|
2017-05-13 01:05:49 +03:00
|
|
|
=/ new/config
|
|
|
|
%+ change-config
|
2017-07-22 01:53:24 +03:00
|
|
|
(fall (~(get by mirrors) cir.det) *config)
|
|
|
|
dif.det
|
|
|
|
+>.$(mirrors (~(put by mirrors) cir.det new))
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
$status
|
|
|
|
%_ +>.$
|
|
|
|
remotes
|
2017-07-22 01:53:24 +03:00
|
|
|
%+ ~(put by remotes) cir.det
|
|
|
|
=+ ole=(fall (~(get by remotes) cir.det) *group)
|
|
|
|
?: ?=($remove -.dif.det) (~(del by ole) who.det)
|
|
|
|
=+ old=(fall (~(get by ole) who.det) *status)
|
|
|
|
(~(put by ole) who.det (change-status old dif.det))
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sa-config-effects ::< config side-effects
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply side-effects for a %config delta.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
|= {old/config dif/diff-config}
|
|
|
|
^- (list move)
|
|
|
|
?+ -.dif ~
|
2017-10-31 21:56:56 +03:00
|
|
|
$permit (sa-permit-effects sec.con.old sis.con.old +.dif)
|
2017-07-01 03:24:32 +03:00
|
|
|
::NOTE when doing a lone %secure, calculate the
|
|
|
|
:: necessary %permit deltas alongside it.
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ sa-follow-effects ::< un/subscribe
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply side-effects for a %follow delta,
|
2017-07-11 02:41:47 +03:00
|
|
|
::> un/subscribing this story to/from {cos}.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {sub/? srs/(set source)}
|
2017-05-13 01:05:49 +03:00
|
|
|
^- (list move)
|
2017-10-09 23:50:17 +03:00
|
|
|
%. srs
|
|
|
|
?:(sub sa-acquire sa-abjure)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
++ sa-permit-effects ::< notify permitted
|
2017-06-21 23:48:47 +03:00
|
|
|
::> apply side-effects for a %permit delta,
|
|
|
|
::> kicking the subscriptions of {sis} if they
|
|
|
|
::> are being banished.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
|= {sec/security old/(set ship) add/? sis/(set ship)}
|
|
|
|
^- (list move)
|
2017-10-31 21:56:56 +03:00
|
|
|
=/ wyt ?=(?($village $journal) sec)
|
2017-05-13 01:05:49 +03:00
|
|
|
=/ inv =(wyt add)
|
2017-06-14 06:09:48 +03:00
|
|
|
?: inv ~
|
2017-06-22 03:16:22 +03:00
|
|
|
=/ sus/(set ship)
|
2017-10-31 21:56:56 +03:00
|
|
|
%. sis.con.shape
|
2017-06-22 03:16:22 +03:00
|
|
|
?:(add ~(dif in sis) ~(int in sis))
|
2017-06-13 01:19:45 +03:00
|
|
|
(sa-eject sus)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
::> ||
|
|
|
|
::> || %subscriptions
|
|
|
|
::> ||
|
|
|
|
::> arms for starting and ending subscriptions
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ sa-acquire ::< subscribe us
|
2017-07-11 02:41:47 +03:00
|
|
|
::> subscribes this story to each circle.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= srs/(set source)
|
2017-05-13 01:05:49 +03:00
|
|
|
%+ sa-sauce 0 :: subscription is caused by this app
|
2017-11-01 22:24:11 +03:00
|
|
|
=- (murn - same)
|
2017-10-09 23:50:17 +03:00
|
|
|
%+ turn ~(tap in srs)
|
2017-07-11 02:41:47 +03:00
|
|
|
|= {cir/circle ran/range}
|
2017-11-01 22:24:11 +03:00
|
|
|
^- (unit card)
|
2017-07-11 02:41:47 +03:00
|
|
|
?: =(cir sa-cir) ~ :: ignore self-subs
|
2017-11-01 22:24:11 +03:00
|
|
|
`(circle-peer nom cir ran)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
++ sa-abjure ::< unsubscribe us
|
2017-07-11 02:41:47 +03:00
|
|
|
::> unsubscribes this story from each circle.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= srs/(set source)
|
2017-05-13 01:05:49 +03:00
|
|
|
%+ sa-sauce 0 :: subscription is caused by this app
|
|
|
|
%- zing
|
2017-10-09 23:50:17 +03:00
|
|
|
%+ turn ~(tap in srs)
|
|
|
|
|= {cir/circle ran/range}
|
2017-05-13 01:05:49 +03:00
|
|
|
^- (list card)
|
2017-07-11 02:41:47 +03:00
|
|
|
:_ ~
|
2017-10-09 23:50:17 +03:00
|
|
|
=+ rap=(range-to-path ran)
|
2017-07-11 02:41:47 +03:00
|
|
|
:* %pull
|
2017-10-09 23:50:17 +03:00
|
|
|
(welp /circle/[nom]/(scot %p hos.cir)/[nom.cir] rap)
|
2017-10-05 20:18:22 +03:00
|
|
|
[hos.cir dap.bol]
|
2017-07-11 02:41:47 +03:00
|
|
|
~
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sa-eject ::< unsubscribe ships
|
|
|
|
::> removes ships {sis} from {followers}.
|
|
|
|
::
|
|
|
|
|= sis/(set ship)
|
|
|
|
^- (list move)
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ turn ~(tap in (sa-unearth sis))
|
2017-05-13 01:05:49 +03:00
|
|
|
|= {b/bone}
|
|
|
|
[b %quit ~]
|
|
|
|
::
|
|
|
|
++ sa-unearth ::< ships' bones
|
2017-06-13 01:19:45 +03:00
|
|
|
::> find the bones in {sup.bol} that belong to
|
2017-05-13 01:05:49 +03:00
|
|
|
::> a ship in {sis}.
|
|
|
|
::
|
|
|
|
|= sis/(set ship)
|
|
|
|
^- (set bone)
|
|
|
|
%- ~(rep in sup.bol)
|
|
|
|
|= {{b/bone s/ship p/path} c/(set bone)}
|
|
|
|
?. ?& (~(has in sis) s)
|
|
|
|
?=({@tas *} p)
|
|
|
|
=(i.p nom)
|
|
|
|
==
|
|
|
|
c
|
|
|
|
(~(put in c) b)
|
|
|
|
--
|
|
|
|
--
|
|
|
|
::
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %wire-parsing
|
|
|
|
::> ||
|
|
|
|
::+|
|
|
|
|
::
|
|
|
|
++ etch ::< parse wire
|
2017-07-06 23:38:36 +03:00
|
|
|
::> parses {wir} to obtain either %circle with story
|
2017-06-23 01:34:03 +03:00
|
|
|
::> and circle or %repeat with message number, source
|
2017-08-03 07:43:56 +03:00
|
|
|
::> ship, story and serials.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= wir/wire
|
|
|
|
^- weir
|
|
|
|
?+ -.wir !!
|
2017-06-23 01:34:03 +03:00
|
|
|
$circle
|
|
|
|
?> ?=({@ @ @ *} t.wir)
|
|
|
|
:^ %circle
|
|
|
|
i.t.wir
|
2017-10-09 23:50:17 +03:00
|
|
|
[(slav %p i.t.t.wir) i.t.t.t.wir]
|
|
|
|
(path-to-range t.t.t.t.wir)
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
|
|
|
$repeat
|
2017-08-03 07:43:56 +03:00
|
|
|
?> ?=({@ @ @ $~} t.wir)
|
2017-07-07 06:01:08 +03:00
|
|
|
:+ %repeat
|
2017-08-03 07:43:56 +03:00
|
|
|
[(slav %p i.t.wir) i.t.t.wir]
|
|
|
|
((list serial) (cue (slav %ud i.t.t.t.wir)))
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-23 01:34:03 +03:00
|
|
|
++ etch-circle ::< parse /circle wire
|
|
|
|
::> parses a /circle wire, call a gate with the
|
|
|
|
::> result.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= $: wir/wire
|
|
|
|
$= fun
|
2017-10-09 23:50:17 +03:00
|
|
|
$- {nom/naem src/source}
|
2017-04-21 00:59:36 +03:00
|
|
|
{(list move) _.}
|
|
|
|
==
|
|
|
|
=+ wer=(etch wir)
|
2017-10-09 23:50:17 +03:00
|
|
|
?>(?=($circle -.wer) (fun nom.wer src.wer))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ etch-repeat ::< parse /repeat wire
|
|
|
|
::> parses a /repeat wire, call gate with the result.
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= $: wir/wire
|
|
|
|
$= fun
|
2017-08-03 07:43:56 +03:00
|
|
|
$- {cir/circle ses/(list serial)}
|
2017-04-21 00:59:36 +03:00
|
|
|
{(list move) _.}
|
|
|
|
==
|
|
|
|
=+ wer=(etch wir)
|
2017-08-03 07:43:56 +03:00
|
|
|
?>(?=($repeat -.wer) (fun cir.wer ses.wer))
|
2017-04-21 00:59:36 +03:00
|
|
|
::
|
2017-06-24 02:29:45 +03:00
|
|
|
++ circle-peer ::< /circle peer card
|
2017-10-09 23:50:17 +03:00
|
|
|
::> constructs a %peer move to subscribe {nom} to a
|
|
|
|
::> source.
|
2017-06-24 02:29:45 +03:00
|
|
|
::
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem source}
|
2017-06-24 02:29:45 +03:00
|
|
|
^- card
|
2017-10-09 23:50:17 +03:00
|
|
|
=+ rap=(range-to-path ran)
|
2017-06-24 02:29:45 +03:00
|
|
|
:* %peer
|
2017-10-09 23:50:17 +03:00
|
|
|
(welp /circle/[nom]/(scot %p hos.cir)/[nom.cir] rap)
|
2017-10-05 20:18:22 +03:00
|
|
|
[hos.cir dap.bol]
|
2017-10-09 23:50:17 +03:00
|
|
|
(welp /circle/[nom.cir] rap)
|
2017-06-24 02:29:45 +03:00
|
|
|
==
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
2017-05-13 01:05:49 +03:00
|
|
|
::> || %new-events
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-06-23 00:13:29 +03:00
|
|
|
++ bake ::< apply state delta
|
2017-05-13 01:05:49 +03:00
|
|
|
::> applies a change to the application state,
|
|
|
|
::> producing side-effects.
|
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-11-01 22:24:11 +03:00
|
|
|
da-done:(da-change:da det)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ pre-bake ::< apply more deltas
|
2017-06-21 23:48:47 +03:00
|
|
|
::> bake a list of deltas.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= des/(list delta)
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-10-08 16:20:02 +03:00
|
|
|
=| moz/(list move)
|
|
|
|
|- ^- (quip move _+>.^$)
|
|
|
|
?~ des [moz +>.^$]
|
|
|
|
=^ mos +>.^$ (bake i.des)
|
2017-11-01 22:24:11 +03:00
|
|
|
$(moz :(welp moz mos (affection i.des)), des t.des)
|
2017-10-08 16:20:02 +03:00
|
|
|
::TODO ideally you'd just do this, but that runtime errors on "bake"...
|
|
|
|
::%+ roll des
|
|
|
|
::|= {d/delta m/(list move) _+>.$}
|
|
|
|
::=^ mos +>.^$ (bake d)
|
2017-11-02 22:22:15 +03:00
|
|
|
::[:(welp m mos (affection d)) +>.^$]
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-06-22 22:33:12 +03:00
|
|
|
++ peek ::< query on state
|
2017-06-21 23:48:47 +03:00
|
|
|
::> find the result (if any) for a given query.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-23 04:03:37 +03:00
|
|
|
|= qer/query
|
2017-06-22 22:33:12 +03:00
|
|
|
^- (unit (unit prize))
|
2017-06-13 01:19:45 +03:00
|
|
|
?- -.qer
|
|
|
|
$reader
|
2017-07-11 23:11:17 +03:00
|
|
|
``[%reader binds nicks]
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$burden
|
2017-06-22 22:33:12 +03:00
|
|
|
:+ ~ ~
|
2017-06-13 01:19:45 +03:00
|
|
|
:- %burden
|
2017-07-12 01:12:29 +03:00
|
|
|
%- ~(gas in *(map naem burden))
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ murn ~(tap by stories)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {n/naem s/story}
|
|
|
|
^- (unit (pair naem burden))
|
2017-07-19 03:22:45 +03:00
|
|
|
:: only auto-federate channels for now.
|
2017-10-31 21:56:56 +03:00
|
|
|
?. ?=($channel sec.con.shape.s) ~
|
2017-06-13 01:19:45 +03:00
|
|
|
:+ ~ n
|
|
|
|
:+ grams.s
|
|
|
|
[shape.s mirrors.s]
|
|
|
|
[locals.s remotes.s]
|
|
|
|
::
|
|
|
|
$report
|
2017-07-01 03:24:32 +03:00
|
|
|
::REVIEW we just don't have a prize... but do have rumors.
|
|
|
|
:: or do we need [%report ~] ?
|
2017-07-06 23:38:36 +03:00
|
|
|
::TODO gall note: need to be able to subscirbe to just changes... or just
|
|
|
|
:: data etc.
|
2017-07-01 03:24:32 +03:00
|
|
|
~
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-06-27 02:56:03 +03:00
|
|
|
$circle ::REVIEW should we send precs & config to out of range subs?
|
2017-06-22 22:33:12 +03:00
|
|
|
=+ soy=(~(get by stories) nom.qer)
|
|
|
|
?~ soy ~
|
|
|
|
:+ ~ ~
|
2017-05-13 01:05:49 +03:00
|
|
|
:- %circle
|
2017-07-21 02:57:53 +03:00
|
|
|
:+ %+ turn
|
|
|
|
(~(so-first-grams so:ta nom.qer ~ u.soy) ran.qer)
|
|
|
|
(cury gram-to-envelope nom.qer)
|
2017-06-22 22:33:12 +03:00
|
|
|
[shape.u.soy mirrors.u.soy]
|
|
|
|
[locals.u.soy remotes.u.soy]
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
|
|
|
::
|
2017-07-20 01:32:07 +03:00
|
|
|
++ dedicate ::< rumor-story to theirs
|
2017-07-08 03:21:40 +03:00
|
|
|
::> modify a %story diff to make it about their ship
|
2017-06-21 23:48:47 +03:00
|
|
|
::> instead of ours.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {who/ship nom/naem det/delta-story}
|
2017-07-20 01:32:07 +03:00
|
|
|
^- rumor-story
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.det det
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
2017-11-01 22:24:11 +03:00
|
|
|
::> internal-only changes.
|
2017-07-20 01:32:07 +03:00
|
|
|
$follow !!
|
|
|
|
$inherited !!
|
|
|
|
$sequent !!
|
2017-07-01 03:23:41 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
$gram
|
|
|
|
:- %gram
|
|
|
|
%+ gram-to-envelope nom
|
2017-07-22 01:53:24 +03:00
|
|
|
%_ gam.det
|
2017-07-21 02:57:53 +03:00
|
|
|
aud
|
2017-07-22 01:53:24 +03:00
|
|
|
%- ~(run in aud.gam.det)
|
2017-07-20 01:32:07 +03:00
|
|
|
|= c/circle
|
2017-11-01 22:20:25 +03:00
|
|
|
?. &(=(hos.c our.bol) =(nom.c nom)) c
|
|
|
|
[who nom]
|
2017-07-21 02:57:53 +03:00
|
|
|
==
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$config
|
2017-11-01 22:20:25 +03:00
|
|
|
?. &(=(hos.cir.det our.bol) =(nom.cir.det nom))
|
|
|
|
det
|
|
|
|
det(cir [who nom])
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$status
|
2017-11-01 22:20:25 +03:00
|
|
|
?. &(=(hos.cir.det our.bol) =(nom.cir.det nom))
|
|
|
|
det
|
|
|
|
det(cir [who nom])
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
++ gram-to-envelope ::< wrap gram with nr
|
|
|
|
::> deduce the initial msg number from a telegram
|
|
|
|
::> for a given story. assumes both story and
|
|
|
|
::> telegram are known.
|
2017-07-20 01:32:07 +03:00
|
|
|
::
|
2017-07-21 02:57:53 +03:00
|
|
|
|= {nom/naem gam/telegram}
|
2017-07-20 01:32:07 +03:00
|
|
|
^- envelope
|
2017-07-21 02:57:53 +03:00
|
|
|
:_ gam
|
|
|
|
%. uid.gam
|
2017-07-20 01:32:07 +03:00
|
|
|
~(got by known:(~(got by stories) nom))
|
|
|
|
::
|
2017-06-23 00:13:29 +03:00
|
|
|
++ feel ::< delta to rumor
|
2017-06-21 23:48:47 +03:00
|
|
|
::> if the given delta changes the result of the given
|
|
|
|
::> query, produce the relevant rumor.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {qer/query det/delta}
|
2017-05-13 01:05:49 +03:00
|
|
|
^- (unit rumor)
|
2017-06-13 01:19:45 +03:00
|
|
|
?- -.qer
|
|
|
|
$reader
|
2017-05-13 01:05:49 +03:00
|
|
|
:: changes to shared ui state apply.
|
2017-07-22 01:53:24 +03:00
|
|
|
?+ -.det ~
|
|
|
|
$glyph `[%reader det]
|
|
|
|
$nick `[%reader det]
|
2017-05-13 01:05:49 +03:00
|
|
|
==
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$burden
|
2017-06-14 05:40:59 +03:00
|
|
|
::?: &(=(who.qer src.bol) did-they-send-a-burden) ~
|
2017-07-22 01:53:24 +03:00
|
|
|
?. ?=($story -.det) ~
|
|
|
|
?: ?=(?($follow $inherited $sequent) -.det.det) ~
|
2017-06-13 01:19:45 +03:00
|
|
|
:: only burden channels for now.
|
2017-10-31 21:56:56 +03:00
|
|
|
?. =(%channel sec.con.shape:(~(got by stories) nom.det)) ~
|
2017-07-22 01:53:24 +03:00
|
|
|
`[%burden nom.det (dedicate who.qer nom.det det.det)]
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$report
|
|
|
|
:: only send changes we didn't get from above.
|
2017-06-14 03:51:10 +03:00
|
|
|
?: =(src.bol (above our.bol)) ~
|
2017-06-13 01:19:45 +03:00
|
|
|
:: only send story reports about grams and status.
|
2017-07-22 01:53:24 +03:00
|
|
|
?. ?=($story -.det) ~
|
|
|
|
?. ?=(?($grams $status) -.det.det) ~
|
|
|
|
=+ soy=(~(got by stories) nom.det)
|
2017-06-13 01:19:45 +03:00
|
|
|
:: and only if the story is inherited.
|
2017-07-11 04:41:50 +03:00
|
|
|
?. inherited.soy ~
|
2017-06-13 01:19:45 +03:00
|
|
|
:: only burden channels for now.
|
2017-10-31 21:56:56 +03:00
|
|
|
?. =(%channel sec.con.shape.soy) ~
|
2017-07-22 01:53:24 +03:00
|
|
|
`[%burden nom.det (dedicate (above our.bol) nom.det det.det)]
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$circle
|
2017-07-22 01:53:24 +03:00
|
|
|
?. ?=($story -.det) ~
|
|
|
|
?. =(nom.qer nom.det) ~
|
|
|
|
?: ?=(?($follow $burden) -.det.det) ~ :: internal-only delta
|
2017-11-01 22:24:11 +03:00
|
|
|
=/ ren
|
|
|
|
%. ran.qer
|
|
|
|
=- ~(so-in-range so:ta nom.qer ~ -)
|
|
|
|
(~(got by stories) nom.qer)
|
2017-06-27 02:56:03 +03:00
|
|
|
?. in.ren ~
|
2017-07-20 01:32:07 +03:00
|
|
|
::TODO move up? we also check for $follow above, why?
|
2017-07-22 01:53:24 +03:00
|
|
|
?: ?=(?($follow $inherited $sequent) -.det.det) ~
|
|
|
|
=/ rum/rumor-story
|
|
|
|
?+ -.det.det det.det
|
2017-07-21 02:57:53 +03:00
|
|
|
$gram
|
2017-07-22 01:53:24 +03:00
|
|
|
[%gram (gram-to-envelope nom.det gam.det.det)]
|
2017-07-20 01:32:07 +03:00
|
|
|
==
|
2017-07-22 01:53:24 +03:00
|
|
|
`[%circle rum]
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
++ affection ::< rumors to interested
|
2017-06-21 23:48:47 +03:00
|
|
|
::> for a given delta, send rumors to all queries it
|
|
|
|
::> affects.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= det/delta
|
2017-05-13 01:05:49 +03:00
|
|
|
^- (list move)
|
2017-06-28 22:09:35 +03:00
|
|
|
:: cache results for paths.
|
2017-11-01 21:32:21 +03:00
|
|
|
=| res/(map path (list move))
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(tap by sup.bol)
|
2017-05-13 01:05:49 +03:00
|
|
|
|= {b/bone s/ship p/path}
|
2017-11-01 21:32:21 +03:00
|
|
|
^- (list move)
|
2017-06-28 22:09:35 +03:00
|
|
|
=+ mur=(~(get by res) p)
|
2017-11-01 21:32:21 +03:00
|
|
|
?^ mur u.mur
|
|
|
|
=- =. res (~(put by res) p -)
|
|
|
|
-
|
|
|
|
=+ qer=(path-to-query p)
|
|
|
|
%+ welp
|
|
|
|
=+ rum=(feel qer det)
|
|
|
|
?~ rum ~
|
|
|
|
[b %diff %talk-rumor u.rum]~
|
|
|
|
?. ?=($circle -.qer) ~
|
|
|
|
:: kill the subscription if it's past its range.
|
|
|
|
=- ?:(done:- [b %quit ~]~ ~)
|
|
|
|
%. ran.qer
|
|
|
|
=- ~(so-in-range so:ta nom.qer ~ -)
|
|
|
|
(~(got by stories) nom.qer)
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-21 23:48:47 +03:00
|
|
|
++ path-to-query ::< path, coins, query
|
|
|
|
::> parse a path into a (list coin), then parse that
|
|
|
|
::> into a query structure.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
|
|
|
(coins-to-query (path-to-coins pax))
|
|
|
|
::
|
2017-06-21 23:48:47 +03:00
|
|
|
++ path-to-coins ::< path to coin list
|
|
|
|
::> parse a path into a list of coins.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
|
|
|
^- (list coin)
|
2017-06-13 01:19:45 +03:00
|
|
|
%+ turn `path`pax
|
|
|
|
|= a/@ta
|
|
|
|
(need (slay a))
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-21 23:48:47 +03:00
|
|
|
++ coins-to-query ::< coin list to query
|
|
|
|
::> parse a list of coins into a query structure.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
^- $-((list coin) query)
|
|
|
|
=> depa
|
|
|
|
|^ %- af :~
|
|
|
|
[%reader ul]
|
2017-06-13 04:09:00 +03:00
|
|
|
[%burden (at /[%p])]
|
2017-06-13 01:19:45 +03:00
|
|
|
[%report ul]
|
2017-07-12 01:30:00 +03:00
|
|
|
[%circle (al term rang)]
|
2017-06-13 01:19:45 +03:00
|
|
|
==
|
2017-07-12 01:30:00 +03:00
|
|
|
++ term (do %tas)
|
2017-06-13 01:19:45 +03:00
|
|
|
++ rang (mu (al plac (mu (un plac))))
|
|
|
|
++ plac (or %da %ud)
|
|
|
|
--
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ leak ::< visible to
|
2017-06-21 23:48:47 +03:00
|
|
|
::> determine if the given query is visible to the
|
|
|
|
::> ship.
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
2017-06-23 04:03:37 +03:00
|
|
|
|= {who/ship qer/query}
|
2017-05-13 01:05:49 +03:00
|
|
|
^- ?
|
2017-06-13 01:19:45 +03:00
|
|
|
?- -.qer
|
2017-10-06 20:35:25 +03:00
|
|
|
$reader (team:title our.bol who)
|
2017-06-14 03:51:10 +03:00
|
|
|
$burden ?& =(who who.qer)
|
|
|
|
=(our.bol (above who))
|
|
|
|
==
|
|
|
|
$report =(who (above our.bol))
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
$circle
|
|
|
|
?. (~(has by stories) nom.qer) |
|
|
|
|
%. who
|
|
|
|
~(so-visible so:ta nom.qer ~ (~(got by stories) nom.qer))
|
|
|
|
==
|
2017-05-13 01:05:49 +03:00
|
|
|
::
|
|
|
|
::> ||
|
2017-04-21 00:59:36 +03:00
|
|
|
::> || %poke-events
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-04-10 23:24:25 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-command ::< accept command
|
|
|
|
::> incoming talk command. process it and update logs.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= cod/command
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-03-23 03:34:56 +03:00
|
|
|
=^ mos +>.$
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-04-21 00:59:36 +03:00
|
|
|
ta-done:(ta-apply:ta src.bol cod)
|
|
|
|
=^ mow +>.$
|
|
|
|
log-all-to-file
|
2017-03-23 03:34:56 +03:00
|
|
|
[(welp mos mow) +>.$]
|
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-action ::< accept action
|
|
|
|
::> incoming talk action. process it.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= act/action
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
|
|
|
?. (team:title src.bol our.bol)
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-04-25 14:33:02 +03:00
|
|
|
=< ta-done
|
|
|
|
%- ta-note:ta %- crip
|
|
|
|
"talk-action stranger {(scow %p src.bol)}"
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-04-21 00:59:36 +03:00
|
|
|
ta-done:(ta-action:ta ost.bol act)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %subscription-events
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-13 01:19:45 +03:00
|
|
|
++ diff-talk-prize ::< accept prize
|
2017-06-21 23:48:47 +03:00
|
|
|
::> accept a query result.
|
2017-06-13 01:19:45 +03:00
|
|
|
::
|
|
|
|
|= {wir/wire piz/prize}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-06-13 01:19:45 +03:00
|
|
|
=^ mos +>.$
|
2017-10-09 14:00:46 +03:00
|
|
|
:: this shouldn't be necessary, but see the TODO below.
|
|
|
|
?: ?=($burden -.piz)
|
|
|
|
%- pre-bake
|
|
|
|
=< ta-done
|
|
|
|
%+ roll ~(tap by sos.piz)
|
|
|
|
|= {{n/naem b/burden} _ta}
|
|
|
|
=< so-done
|
|
|
|
(~(so-bear so n ~ (fall (~(get by stories) n) *story)) b)
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-10-31 19:10:44 +03:00
|
|
|
ta-done:(ta-take:ta wir piz) ::TODO runtime for %burden prize...
|
2017-06-13 01:19:45 +03:00
|
|
|
=^ mow +>.$
|
|
|
|
log-all-to-file
|
|
|
|
[(welp mos mow) +>.$]
|
|
|
|
::
|
2017-05-13 01:05:49 +03:00
|
|
|
++ diff-talk-rumor ::< accept rumor
|
2017-06-21 23:48:47 +03:00
|
|
|
::> accept a query result change.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-22 01:53:24 +03:00
|
|
|
|= {wir/wire rum/rumor}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
=^ mos +>.$
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-07-22 01:53:24 +03:00
|
|
|
ta-done:(ta-hear:ta wir rum)
|
2017-04-21 00:59:36 +03:00
|
|
|
=^ mow +>.$
|
|
|
|
log-all-to-file
|
|
|
|
[(welp mos mow) +>.$]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ peer ::< accept subscription
|
|
|
|
::> incoming subscription on {pax}.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= pax/path
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
?: ?=({$sole *} pax) ~&(%talk-broker-no-sole !!)
|
2017-06-23 04:03:37 +03:00
|
|
|
=+ qer=(path-to-query pax)
|
2017-05-13 01:05:49 +03:00
|
|
|
?. (leak src.bol qer) ~&(%peer-invisible !!)
|
|
|
|
=^ mos +>.$
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-06-23 04:03:37 +03:00
|
|
|
ta-done:(ta-subscribe:ta src.bol qer)
|
2017-05-13 01:05:49 +03:00
|
|
|
:_ +>.$
|
2017-06-22 22:33:12 +03:00
|
|
|
=+ piz=(peek qer)
|
|
|
|
?~ piz ~&([%query-unavailable pax] mos)
|
|
|
|
?~ u.piz ~&([%query-invalid pax] mos)
|
2017-05-13 01:05:49 +03:00
|
|
|
:_ mos
|
2017-06-22 22:33:12 +03:00
|
|
|
[ost.bol %diff %talk-prize u.u.piz]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ pull ::< unsubscribe
|
|
|
|
::> unsubscribes.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
|
|
|
|= pax/path
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-11-02 02:44:13 +03:00
|
|
|
[~ +>]
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-13 04:10:55 +03:00
|
|
|
++ reap ::< catch-all reap
|
2017-06-21 23:48:47 +03:00
|
|
|
::> handle all remote errors.
|
2017-06-13 04:10:55 +03:00
|
|
|
::
|
|
|
|
|= {wir/wire fal/(unit tang)}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-06-13 04:10:55 +03:00
|
|
|
?~ fal [~ +>]
|
|
|
|
~| reap-fail+wir
|
|
|
|
(mean u.fal)
|
|
|
|
::
|
2017-06-23 01:34:03 +03:00
|
|
|
++ reap-circle ::< subscription n/ack
|
2017-04-21 00:59:36 +03:00
|
|
|
::> if subscribing failed, update state to reflect
|
|
|
|
::> that.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-14 04:06:38 +03:00
|
|
|
::TODO update to handle all subscription kinds.
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {wir/wire fal/(unit tang)}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-06-23 01:34:03 +03:00
|
|
|
%+ etch-circle [%circle wir]
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem src/source}
|
2017-06-13 01:19:45 +03:00
|
|
|
?~ fal
|
|
|
|
%- pre-bake
|
2017-10-09 23:50:17 +03:00
|
|
|
ta-done:(ta-greet:ta nom src)
|
|
|
|
=. u.fal [>%reap-circle-fail nom src< u.fal]
|
2017-04-21 00:59:36 +03:00
|
|
|
%- (slog (flop u.fal))
|
2017-06-13 01:19:45 +03:00
|
|
|
%- pre-bake
|
2017-10-09 23:50:17 +03:00
|
|
|
ta-done:(ta-leave:ta nom src)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-23 01:34:03 +03:00
|
|
|
++ quit-circle ::< dropped subscription
|
2017-04-21 00:59:36 +03:00
|
|
|
::> gall dropped our subscription. resubscribe.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-06-14 04:06:38 +03:00
|
|
|
::TODO update for all subscription kinds.
|
2017-04-21 00:59:36 +03:00
|
|
|
|= wir/wire
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-06-23 01:34:03 +03:00
|
|
|
%+ etch-circle [%circle wir]
|
2017-10-09 23:50:17 +03:00
|
|
|
|= {nom/naem src/source}
|
|
|
|
%- pre-bake
|
|
|
|
ta-done:(ta-resub:ta nom src)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ coup-repeat ::< message n/ack
|
|
|
|
::> ack from ++ta-transmit. mark the message as
|
|
|
|
::> received or rejected.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
|= {wir/wire fal/(unit tang)}
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
%+ etch-repeat [%repeat wir]
|
2017-08-03 07:43:56 +03:00
|
|
|
|= {cir/circle ses/(list serial)}
|
2017-06-13 21:14:13 +03:00
|
|
|
%- pre-bake
|
2017-08-03 07:43:56 +03:00
|
|
|
ta-done:(ta-repeat:ta cir ses fal)
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::> ||
|
|
|
|
::> || %logging
|
|
|
|
::> ||
|
|
|
|
::+|
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-save ::< save as log
|
|
|
|
::> stores the telegrams of story {nom} in a log file,
|
|
|
|
::> to be re-loaded by ++poke-talk-load.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ paf/path
|
|
|
|
/(scot %p our.bol)/home/(scot %da now.bol)/talk/[nom]/talk-telegrams
|
|
|
|
=+ grams:(~(got by stories) nom)
|
|
|
|
:_ +>.$
|
|
|
|
:_ ~
|
|
|
|
:* ost.bol
|
|
|
|
%info
|
|
|
|
/jamfile
|
|
|
|
our.bol
|
2017-10-06 20:35:25 +03:00
|
|
|
(foal:space:userlib paf [%talk-telegrams !>(-)])
|
2017-04-21 00:59:36 +03:00
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-load ::< load from log
|
|
|
|
::> loads the telegrams of story {nom} into our state,
|
|
|
|
::> as saved in ++poke-talk-save.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
=/ grams
|
|
|
|
.^ (list telegram)
|
|
|
|
%cx
|
|
|
|
/(scot %p our.bol)/home/(scot %da now.bol)/talk/[nom]/talk-telegrams
|
|
|
|
==
|
|
|
|
=+ soy=(~(got by stories) nom)
|
|
|
|
:- ~
|
|
|
|
%= +>.$
|
|
|
|
stories
|
|
|
|
%+ ~(put by stories) nom
|
|
|
|
soy(grams grams, count (lent grams))
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-log ::< start logging
|
|
|
|
::> starts logging story {nom}'s messages.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-04-21 00:59:36 +03:00
|
|
|
~& %talk-poke-log
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-04-21 00:59:36 +03:00
|
|
|
:- [(log-to-file nom) ~]
|
|
|
|
%= +>.$
|
|
|
|
log
|
|
|
|
%+ ~(put by log) nom
|
|
|
|
count:(~(got by stories) nom)
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ poke-talk-unlog ::< stop logging
|
|
|
|
::> stops logging story {nom}'s messages.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _+>)
|
2017-03-23 03:34:56 +03:00
|
|
|
:- ~
|
2017-04-21 00:59:36 +03:00
|
|
|
+>.$(log (~(del by log) nom))
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
++ log-all-to-file ::< update stories logs
|
|
|
|
::> for every story we're logging, (over)writes all
|
|
|
|
::> their grams to log files if new ones have arrived.
|
2017-03-23 03:34:56 +03:00
|
|
|
::
|
2017-04-21 00:59:36 +03:00
|
|
|
::TODO re-enable and test.
|
2017-10-06 20:35:25 +03:00
|
|
|
^- (quip move _.)
|
2017-04-21 00:59:36 +03:00
|
|
|
?: & [~ .] :: XXX!!!!
|
|
|
|
:_ %_ .
|
|
|
|
log
|
|
|
|
%- ~(urn by log)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem len/@ud}
|
2017-04-21 00:59:36 +03:00
|
|
|
count:(~(got by stories) nom)
|
|
|
|
==
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ murn ~(tap by log)
|
2017-07-12 01:12:29 +03:00
|
|
|
|= {nom/naem len/@ud}
|
2017-04-21 00:59:36 +03:00
|
|
|
^- (unit move)
|
|
|
|
?: (gte len count:(~(got by stories) nom))
|
|
|
|
~
|
|
|
|
`(log-to-file nom)
|
|
|
|
::
|
|
|
|
++ log-to-file ::< update story log
|
|
|
|
::> logs all grams of story {nom} to a file.
|
|
|
|
::
|
2017-07-12 01:12:29 +03:00
|
|
|
|= nom/naem
|
2017-04-21 00:59:36 +03:00
|
|
|
^- move
|
|
|
|
=+ ^- paf/path
|
|
|
|
=+ day=(year %*(. (yore now.bol) +.t +:*tarp))
|
2017-10-06 20:35:25 +03:00
|
|
|
%+ en-beam:format [our.bol %home da+now.bol]
|
2017-04-21 00:59:36 +03:00
|
|
|
/talk-telegrams/(scot %da day)/[nom]/talk
|
|
|
|
=+ grams:(~(got by stories) nom)
|
2017-10-06 20:35:25 +03:00
|
|
|
:* ost.bol
|
|
|
|
%info
|
|
|
|
/jamfile
|
|
|
|
our.bol
|
|
|
|
(foal:space:userlib paf [%talk-telegrams !>(-)])
|
|
|
|
==
|
2017-03-23 03:34:56 +03:00
|
|
|
--
|