mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 11:51:32 +03:00
521 lines
17 KiB
Plaintext
521 lines
17 KiB
Plaintext
::
|
|
:::: /hook/core/talk/app
|
|
::
|
|
/? 314
|
|
/- *radio
|
|
/+ radio
|
|
::
|
|
::::
|
|
::
|
|
!:
|
|
=> |% :: structures
|
|
++ town :: all client state
|
|
$: live=(unit span) :: present story
|
|
console=terminal :: controlling terminal
|
|
stories=(map span story) :: all stories
|
|
== ::
|
|
++ grip :: subscription state
|
|
|* nub=$+(* *) :: wrapped state
|
|
$% [%cold ~] :: inactive
|
|
[%cool ~] :: active but empty
|
|
[%warm p=nub] :: connected
|
|
== ::
|
|
++ terminal :: terminal state
|
|
$: present=presence :: presence state
|
|
== ::
|
|
++ story :: persona
|
|
$: link=bridge :: connection
|
|
count=@ud :: message counter
|
|
mike=(pair ,? (set station)) :: active/voice
|
|
quiet=? :: !verbose
|
|
past=(list station) :: past received auds
|
|
== ::
|
|
++ bridge :: subscriptions
|
|
$: fm=(grip ,~) :: content grip
|
|
xm=(grip config) :: config grip
|
|
am=(grip register) :: presence grip
|
|
:: rb=(grip ,~) :: rollback grip
|
|
== ::
|
|
++ work :: general action
|
|
$% [%ask (unit work)] :: help (about)
|
|
[%exp twig] :: compute
|
|
[%mor (list work)] :: sequence
|
|
[%rub work-adjust] :: configure story
|
|
[%say speech] :: publish in voice
|
|
[%wry work-construct] :: configure system
|
|
[%who (unit station)] :: show presence
|
|
== ::
|
|
++ work-adjust :: adjust story
|
|
$% [%dark p=(set ship)] :: toggle blacklist
|
|
[%lite p=(set ship)] :: toggle whitelist
|
|
[%love p=(set station)] :: toggle stations
|
|
[%whom p=? q=(set station)] :: active/voice
|
|
[%wind p=@dr] :: rewind by date
|
|
== ::
|
|
++ work-construct :: configure system
|
|
$% [%make p=span] :: create story
|
|
[%raze p=span] :: destroy story
|
|
[%tune p=span] :: switch to story
|
|
== ::
|
|
++ iron :: terminal output
|
|
$% [%prompt p=cord q=prom r=cord] :: prompt
|
|
[%tang p=(list tank)] :: prettyprintable
|
|
[%txt p=cord] :: simple text
|
|
==
|
|
++ gift
|
|
$% [%mean ares]
|
|
[%nice ~]
|
|
[%rush iron]
|
|
[%rust iron]
|
|
==
|
|
++ hapt ,[p=ship q=path]
|
|
++ move ,[p=bone q=(mold note gift)]
|
|
++ note
|
|
$? $: %g
|
|
$% [%mess p=hapt q=ship r=cage]
|
|
[%nuke p=hapt q=ship]
|
|
[%show p=hapt q=ship r=path]
|
|
== ==
|
|
$: %t
|
|
$% [%wait p=@da]
|
|
== == ==
|
|
++ gall-sign :: subscription result
|
|
$% [%mean p=ares]
|
|
[%nice ~]
|
|
$: %rush
|
|
$= p
|
|
$% [%txt p=cord] :: input text
|
|
[%type p=?] :: typing notify
|
|
== ==
|
|
$: %rust
|
|
$= p
|
|
$% [%txt p=cord]
|
|
[%radio-report p=report]
|
|
== ==
|
|
==
|
|
++ sign
|
|
$? [%g gall-sign] :: from %gall
|
|
$: %t :: from %time
|
|
$% [%wake ~] :: timer wakeup
|
|
== == ==
|
|
--
|
|
!:
|
|
::::
|
|
::
|
|
=> |%
|
|
++ swatch :: print station set
|
|
|= tou=(set station)
|
|
=+ tuo=(~(tap in tou))
|
|
|- ^- tape
|
|
?~ tuo ~
|
|
=+ ted=$(tuo t.tuo)
|
|
=+ ^= ind ^- tape
|
|
?- -.i.tuo
|
|
%& =+ sip=(scow %p p.p.i.tuo)
|
|
?: =(%floor q.p.i.tuo)
|
|
sip
|
|
(weld sip (trip q.p.i.tuo))
|
|
%| ['^' '@' (trip p.p.i.tuo)]
|
|
==
|
|
?~ ted ind
|
|
(welp ind `tape`[',' ' ' ted])
|
|
::
|
|
++ parse :: command parser
|
|
=+ vag=(vang | [&1:% &2:% '0' |3:%])
|
|
|%
|
|
++ come :: keyword command
|
|
|* [a=@tas b=_rule]
|
|
;~((glue (plus ace)) (cold a (jest a)) b)
|
|
::
|
|
++ gone :: parse unit
|
|
|* a=_rule
|
|
;~(pose (stag ~ a) (easy ~))
|
|
::
|
|
++ posh :: parse each
|
|
|* [a=_rule b=_rule]
|
|
;~(pose (stag %& a) (stag %| b))
|
|
::
|
|
++ ship ;~(pfix sig fed:ag) :: ship
|
|
++ shiz :: ship set
|
|
%+ cook
|
|
|=(a=(list ^ship) (~(gas in *(set ^ship)) a))
|
|
(most ;~(plug com (star ace)) ship)
|
|
::
|
|
++ stat :: station
|
|
%+ posh
|
|
;~ plug
|
|
ship
|
|
;~(pose ;~(pfix fas urs:ab) (easy %floor))
|
|
==
|
|
;~ pfix ket
|
|
;~ pose
|
|
;~(pfix pat (stag %twitter urs:ab))
|
|
==
|
|
==
|
|
::
|
|
++ staz :: station set
|
|
%+ cook
|
|
|=(a=(list station) (~(gas in *(set station)) a))
|
|
(most ;~(plug com (star ace)) stat)
|
|
::
|
|
++ step :: rollback interval
|
|
%+ sear
|
|
|= a=coin
|
|
?. ?=([%$ %dr @] a) ~
|
|
(some `@dr`+>.a)
|
|
nuck:so
|
|
::
|
|
++ text (boss 256 (star prn)) :: utf8 text
|
|
++ tome
|
|
%+ stag %lin
|
|
;~ pose
|
|
(stag %| ;~(pfix pat text))
|
|
(stag %& text)
|
|
==
|
|
::
|
|
++ work :: all commands
|
|
%+ knee *^work |. ~+
|
|
;~ pose
|
|
;~ pfix zap
|
|
%+ stag %wry
|
|
;~ pose
|
|
(come %make urs:ab)
|
|
(come %raze urs:ab)
|
|
(come %tune urs:ab)
|
|
==
|
|
==
|
|
::
|
|
;~ pfix cen
|
|
%+ stag %rub
|
|
;~ pose
|
|
(come %dark shiz)
|
|
(come %lite shiz)
|
|
(come %whom (stag %& staz))
|
|
(come %wind step)
|
|
==
|
|
==
|
|
::
|
|
;~(pfix wut (stag %ask (gone work)))
|
|
;~(pfix tis (stag %who (gone stat)))
|
|
;~(pfix cen (stag %exp wide:vag))
|
|
::
|
|
%+ cook
|
|
|= [a=(set station) b=(unit ,[%lin p=? q=@t])]
|
|
^- ^work
|
|
=. b ?~(b ~ ?:(=(0 q.u.b) ~ b))
|
|
=+ c=[%rub %whom %& a]
|
|
?~(b c [%mor c [%say u.b] ~])
|
|
;~ plug
|
|
staz
|
|
(gone ;~(pfix (star ace) tome))
|
|
==
|
|
::
|
|
(stag %say tome)
|
|
==
|
|
--
|
|
++ stog :: toggle set
|
|
|* [tog=(set) tag=(set)]
|
|
=+ got=(~(tap in tog))
|
|
|- ^+ tag
|
|
?~ got tag
|
|
%= $
|
|
got t.got
|
|
tag ?: (~(has in tag) i.got)
|
|
(~(del in tag) i.got)
|
|
(~(put in tag) i.got)
|
|
==
|
|
--
|
|
!:
|
|
::::
|
|
::
|
|
|_ [hid=hide town]
|
|
++ transmit :: radio command
|
|
|= [cod=command moz=(list move)]
|
|
^- (list move)
|
|
:_ moz
|
|
:* 0 %pass /command
|
|
%g %mess [our.hid /radio] our.hid
|
|
[%radio-command !>(cod)]
|
|
==
|
|
::
|
|
++ subscribe :: radio show
|
|
|= [way=path hoc=path moz=(list move)]
|
|
^- (list move)
|
|
:_(moz [0 %pass way %g %show [our.hid /radio] our.hid hoc])
|
|
::
|
|
++ unsubscribe :: radio nuke
|
|
|= [way=path moz=(list move)]
|
|
^- (list move)
|
|
:_(moz [0 %pass way %g %nuke [our.hid /radio] our.hid])
|
|
::
|
|
++ render :: send to console
|
|
|= [rod=iron moz=(list move)]
|
|
=+ oss=(~(tap in (~(get ju pus.hid) /out)))
|
|
|- ^- (list move)
|
|
?~ oss moz
|
|
[`move`[i.oss %give %rush rod] $(oss t.oss)]
|
|
::
|
|
++ display :: print to console
|
|
|= [tay=(list tank) moz=(list move)]
|
|
(render [%tang tay] moz)
|
|
::
|
|
++ show :: simple show
|
|
|= [tep=tape moz=(list move)]
|
|
(display [%leaf tep]~ moz)
|
|
::
|
|
++ accept :: set prompt
|
|
|= [asq=cord moz=(list move)]
|
|
(render [%prompt asq %text ''] moz)
|
|
::
|
|
++ sy
|
|
|_ $: $: man=span :: u.live
|
|
moz=(list move) :: pending moves
|
|
== ::
|
|
story :: current story
|
|
==
|
|
::
|
|
++ sy-abet :: resolve core
|
|
^- [(list move) town]
|
|
[moz +>+<+(stories (~(put by stories) man +<+))]
|
|
::
|
|
++ sy-start :: start subscriptions
|
|
sy-subscribe-fm:sy-subscribe-am:sy-subscribe-xm
|
|
::
|
|
++ sy-stop :: stop subscriptions
|
|
sy-unsubscribe-fm:sy-unsubscribe-am:sy-unsubscribe-xm
|
|
::
|
|
++ sy-subscribe-am :: presence subscribe
|
|
?> =(%cold -.am.link)
|
|
%_ .
|
|
am.link [%cool ~]
|
|
moz (subscribe /am/[man] /am/[man] moz)
|
|
==
|
|
::
|
|
++ sy-subscribe-xm :: config subscribe
|
|
?> =(%cold -.xm.link)
|
|
%_ .
|
|
xm.link [%cool ~]
|
|
moz (subscribe /xm/[man] /xm/[man] moz)
|
|
==
|
|
::
|
|
++ sy-subscribe-fm :: content subscribe
|
|
?> =(%cold -.fm.link)
|
|
%_ .
|
|
fm.link [%cool ~]
|
|
moz (subscribe /fm/[man] /fm/[man]/(scot %ud count) moz)
|
|
==
|
|
::
|
|
++ sy-unsubscribe-am :: presence unsub
|
|
?: =(%cold -.am.link) .
|
|
%_ .
|
|
am.link [%cold ~]
|
|
moz (unsubscribe /am/[man] moz)
|
|
==
|
|
::
|
|
++ sy-unsubscribe-xm :: config unsubs
|
|
?: =(%cold -.xm.link) .
|
|
%_ .
|
|
xm.link [%cold ~]
|
|
moz (unsubscribe /fm/[man] moz)
|
|
==
|
|
::
|
|
++ sy-unsubscribe-fm :: content unsub
|
|
?: =(%cold -.fm.link) .
|
|
%_ .
|
|
fm.link [%cold ~]
|
|
moz (unsubscribe /fm/[man] moz)
|
|
==
|
|
::
|
|
++ sy-serial :: make serial no
|
|
^- [serial _.]
|
|
[(shaf %serial eny.hid) .(eny.hid (shax eny.hid))]
|
|
::
|
|
++ sy-audience :: speech audience
|
|
%- ~(gas by *audience)
|
|
%+ turn `(list station)`[[%& our.hid man] (~(tap in q.mike))]
|
|
|=(a=station [a %pending])
|
|
::
|
|
++ sy-message :: print message
|
|
|= msg=tape
|
|
%_(+> moz (display [%leaf "{(trip man)}: {msg}"]~ moz))
|
|
::
|
|
++ sy-cordon :: set cordon
|
|
|= con=(each (set ship) (set ship))
|
|
^+ +>
|
|
?. ?=(%warm -.xm.link) (sy-message "not connected")
|
|
=. cordon.p.xm.link
|
|
?- -.cordon.p.xm.link
|
|
%& ?- -.con
|
|
%& [%& (stog p.con p.cordon.p.xm.link)]
|
|
%| con
|
|
==
|
|
%| ?- -.con
|
|
%& con
|
|
%| [%| (stog p.con p.cordon.p.xm.link)]
|
|
==
|
|
==
|
|
+>.$(moz (transmit [%design man ~ p.xm.link] moz))
|
|
::
|
|
++ sy-sources :: set sources
|
|
|= src=(set station)
|
|
^+ +>
|
|
?. ?=(%warm -.xm.link) (sy-message "not connected")
|
|
=. sources.p.xm.link (stog src sources.p.xm.link)
|
|
+>.$(moz (transmit [%design man ~ p.xm.link] moz))
|
|
::
|
|
++ sy-voice :: set targets
|
|
|= [act=? tou=(set station)]
|
|
%_(+> mike [act tou], moz (accept (crip (swatch tou)) moz))
|
|
::
|
|
++ sy-rollback
|
|
|= lon=@dr
|
|
!!
|
|
::
|
|
++ sy-work
|
|
|= job=work
|
|
^+ +>
|
|
?- -.job
|
|
%ask !!
|
|
%exp !!
|
|
%mor
|
|
|- ^+ +>.^$
|
|
?~ +.job +>.^$
|
|
$(+.job t.+.job, +>.^$ ^$(job i.+.job))
|
|
::
|
|
%rub
|
|
?- +<.job
|
|
%lite (sy-cordon [%| +>.job])
|
|
%dark (sy-cordon [%& +>.job])
|
|
%love (sy-sources +>.job)
|
|
%whom (sy-voice +>.job)
|
|
%wind !!
|
|
==
|
|
%say
|
|
=^ sir +>.$ sy-serial
|
|
+>.$(moz (transmit [%publish [[sir sy-audience [lat.hid +.job]] ~]] moz))
|
|
::
|
|
%wry !!
|
|
%who !!
|
|
==
|
|
--
|
|
++ ny :: top configuration
|
|
|_ moz=(list move)
|
|
++ ny-abet :: resolve core
|
|
^- [(list move) town]
|
|
[moz +>+<+]
|
|
::
|
|
++ ny-amid :: integrate story
|
|
|= nov=_sy
|
|
=^ zom +>+>+<+ sy-abet:nov
|
|
+>.$(moz zom)
|
|
::
|
|
++ ny-tune :: connect to story
|
|
|= man=span
|
|
^+ +>
|
|
?: =(`man live)
|
|
+>(moz (show "already tuned to {(trip man)}" moz))
|
|
?. (~(has by stories) man)
|
|
+>(moz (show "no story {(trip man)}" moz))
|
|
=. +> ny-stop
|
|
=. live `man
|
|
~& [%tune-start man]
|
|
(ny-amid sy-start:(need (novel moz)))
|
|
::
|
|
++ ny-stop :: disconnect story
|
|
^+ .
|
|
?~ live .
|
|
(ny-amid(live ~) sy-stop:(need (novel moz)))
|
|
::
|
|
++ ny-tell :: hear from server
|
|
|= sap=(set span)
|
|
^+ +>
|
|
=. +> ?.(&(?=(^ live) !(~(has in sap) u.live)) +> ny-stop)
|
|
=. stories
|
|
=+ ros=(skim (~(tap by stories)) |=([a=span *] (~(has in sap) a)))
|
|
=+ pas=(~(tap in sap))
|
|
%- ~(gas by *(map span story))
|
|
|- ^- (list (pair span story))
|
|
?~ pas ros
|
|
=+ sor=$(pas t.pas)
|
|
?:((~(has by stories) i.pas) sor [[i.pas *story] sor])
|
|
?^ live +>.$
|
|
?~ stories +>.$
|
|
?: (~(has by `(map span story)`stories) %floor)
|
|
(ny-tune %floor)
|
|
(ny-tune p.n.stories)
|
|
::
|
|
++ ny-work :: user command
|
|
|= jaw=work-construct
|
|
^+ +>
|
|
?- -.jaw
|
|
%raze +>(moz (transmit [%design p.jaw ~] moz))
|
|
%make +>(moz (transmit [%design p.jaw [~ ~ %| ~]] moz))
|
|
%tune (ny-tune p.jaw)
|
|
==
|
|
--
|
|
::
|
|
++ novel :: live story
|
|
|= moz=(list move)
|
|
^- (unit ,_sy)
|
|
?~ live ~
|
|
`~(. sy [u.live moz] (~(got by stories) u.live))
|
|
::
|
|
++ pour-shell
|
|
|= txt=cord
|
|
^- [(list move) _+>]
|
|
=+ jub=(rush txt work:parse)
|
|
?~ jub
|
|
[(display [%leaf "invalid input"]~ ~) +>.$]
|
|
?: ?=(%wry -.u.jub)
|
|
=^ moz +<+.+>.$ ny-abet:(ny-work:ny +.u.jub)
|
|
[moz +>.$]
|
|
=+ nuv=(novel ~)
|
|
?~ nuv [(display [%leaf "not tuned to any story"]~ ~) +>.$]
|
|
=^ moz +<+.+>.$ sy-abet:(sy-work:u.nuv u.jub)
|
|
[moz +>.$]
|
|
::
|
|
++ pour
|
|
|= [ost=bone pax=path sih=*]
|
|
^- [(list move) _+>]
|
|
=> .(sih ((hard sign) sih))
|
|
:: ~& talk-pour/sih
|
|
?~ pax ~& talk-pour-strange-path/pax !!
|
|
?+ i.pax ~& talk-pour-strange-path/pax !!
|
|
%cmd-in
|
|
?+ +<.sih !!
|
|
%nice [~ +>.$]
|
|
%mean ~&(%talk-input-crash !!)
|
|
?(%rush %rust)
|
|
?> ?=(%txt -.p.sih)
|
|
(pour-shell p.p.sih)
|
|
==
|
|
::
|
|
%server
|
|
?+ +<.sih !!
|
|
%nice [~ +>.$]
|
|
%mean ~&(%talk-server-crash !!)
|
|
?(%rush %rust)
|
|
?> ?=([%radio-report %house *] p.sih)
|
|
=^ moz +>+<+ ny-abet:(ny-tell:ny +.p.p.sih)
|
|
[moz +>.$]
|
|
::
|
|
%
|
|
==
|
|
==
|
|
::
|
|
++ poke-talk-args
|
|
|= [ost=bone you=ship arg=~]
|
|
^- [(list move) _+>]
|
|
:_ +>
|
|
:~ [0 %pass /cmd-in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
|
|
[0 %pass /time %t %wait (add ~s10 lat.hid)]
|
|
[0 %pass /cmd-ac %g %show [our.hid +.imp.hid] you /active/[-.imp.hid]]
|
|
^- move
|
|
:* 0 %pass /server
|
|
%g %show
|
|
[our.hid /radio] our.hid
|
|
/
|
|
==
|
|
==
|
|
--
|