mirror of
https://github.com/urbit/shrub.git
synced 2024-12-13 16:03:36 +03:00
Add old radio back into radio branch.
This commit is contained in:
parent
6dfd825b9c
commit
22ef9e18b2
95
main/app/radio/core.hook
Normal file
95
main/app/radio/core.hook
Normal file
@ -0,0 +1,95 @@
|
||||
/- mess,user,users,zing,zong
|
||||
!:
|
||||
=> |%
|
||||
++ axle
|
||||
$% [%0 p=(map path ,[p=(list zong) q=(map ship ,?)])]
|
||||
==
|
||||
++ blitz
|
||||
$% [%zong p=zong]
|
||||
[%user p=user]
|
||||
==
|
||||
++ iron
|
||||
$% [%zongs p=(list zong)]
|
||||
[%users p=users]
|
||||
==
|
||||
++ gift
|
||||
$% [%rush blitz]
|
||||
[%rust iron]
|
||||
[%mean ares]
|
||||
[%nice ~]
|
||||
==
|
||||
++ move ,[p=bone q=(mold note gift)]
|
||||
++ note ,~
|
||||
--
|
||||
|_ [hid=hide vat=axle]
|
||||
++ grab
|
||||
|= sta=path
|
||||
(fall (~(get by p.vat) sta) *[p=(list zong) q=(map ship ,?)])
|
||||
::
|
||||
++ ident
|
||||
|= you=ship
|
||||
%- (hard ,@t)
|
||||
.^(%a (scot %p our.hid) %name (scot %da lat.hid) (scot %p you) ~)
|
||||
::
|
||||
++ peer
|
||||
|= [ost=bone you=ship pax=path]
|
||||
^- [(list move) _+>]
|
||||
?~ pax
|
||||
[[ost %give %mean ~ %radio-bad-path ~]~ +>.$]
|
||||
=+ ya=(grab t.pax)
|
||||
?+ -.pax [~ +>.$]
|
||||
%mensajes
|
||||
[[ost %give %rust %zongs p.ya]~ +>.$]
|
||||
%amigos
|
||||
=. q.ya (~(put by q.ya) you %.y)
|
||||
:_ +>.$(p.vat (~(put by p.vat) t.pax ya))
|
||||
:_ (send pax %give %rush %user %in you (ident you))
|
||||
:* ost %give %rust %users
|
||||
%+ murn (~(tap by q.ya))
|
||||
|= [shi=ship liv=?]
|
||||
?. liv
|
||||
~
|
||||
(some [shi (ident shi)])
|
||||
==
|
||||
==
|
||||
::
|
||||
++ poke-zing
|
||||
|= [ost=bone you=ship zig=zing]
|
||||
^- [(list move) _+>]
|
||||
=+ ya=(grab p.zig)
|
||||
?. (~(has by q.ya) you)
|
||||
[[ost %give %mean ~ %no-te-conozco ~]~ +>.$]
|
||||
=+ zog=`zong`[%mess lat.hid you q.zig]
|
||||
=. p.vat (~(put by p.vat) p.zig [[zog p.ya] q.ya])
|
||||
:_ +>.$
|
||||
:- [ost %give %nice ~]
|
||||
(send mensajes/p.zig %give %rush %zong zog)
|
||||
::
|
||||
++ poke-bit
|
||||
|= [ost=bone you=ship ~]
|
||||
^- [(list move) _+>]
|
||||
:_ +>.$
|
||||
%+ turn (~(tap by sup.hid))
|
||||
|= [ost=bone her=ship pax=path]
|
||||
[ost %give %mean ~ %reload leaf/"please quit chat and re-enter" ~]
|
||||
::
|
||||
++ pull
|
||||
|= ost=bone
|
||||
^- [(list move) _+>]
|
||||
=+ ^- (unit ,[his=ship pax=path])
|
||||
(~(get by sup.hid) ost)
|
||||
?~ - ~& %strange-pull [~ +>.$]
|
||||
?. ?=([%mensajes *] pax.u)
|
||||
[~ +>.$]
|
||||
=+ sta=(~(got by p.vat) t.pax.u)
|
||||
=. q.sta %+ ~(put by q.sta) his.u %.n
|
||||
=. p.vat %+ ~(put by p.vat) t.pax.u sta
|
||||
[(send amigos/t.pax.u %give %rush %user %out his.u (ident his.u)) +>.$]
|
||||
::
|
||||
++ send
|
||||
|= [pax=path msg=(mold note gift)]
|
||||
^- (list move)
|
||||
:: ~& [%radi-sub pus.hid]
|
||||
%+ turn (~(tap in (~(get ju pus.hid) pax)))
|
||||
|=(ost=bone [ost msg])
|
||||
--
|
90
main/mar/radio-command/door.hook
Normal file
90
main/mar/radio-command/door.hook
Normal file
@ -0,0 +1,90 @@
|
||||
::
|
||||
:::: /hook/door/radio-command/mar
|
||||
::
|
||||
/? 314
|
||||
/- *radio
|
||||
!:
|
||||
|_ cod=command
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun command :: clam from %noun
|
||||
++ json
|
||||
=> [jo ..command]
|
||||
|= a=json ^- command
|
||||
=- (need ((of -) a))
|
||||
=< :~ publish/(ar thot)
|
||||
review/(ar thot)
|
||||
design/(ot party/so config/(mu conf) ~)
|
||||
ping/auri
|
||||
==
|
||||
|%
|
||||
++ op :: parse keys of map
|
||||
|* [fel=_rule wit=fist]
|
||||
%+ cu mo
|
||||
%- ci :_ (om wit)
|
||||
|= a=(map cord ,_(need *wit))
|
||||
^- (unit (list ,_[(wonk *fel) (need *wit)]))
|
||||
(zl (turn (~(tap by a)) (head-rush fel)))
|
||||
::
|
||||
++ as :: array as set
|
||||
:: |*(a=fist (cu sa (ar a))) :: XX types
|
||||
|* a=fist
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set ,_(need *a)))
|
||||
::
|
||||
++ lake |*(a=_,* $+(json (unit a)))
|
||||
++ peach
|
||||
|* a=_[rule rule]
|
||||
|= tub=nail
|
||||
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
|
||||
%. tub
|
||||
;~(pose (stag %& -.a) (stag %| +.a))
|
||||
::
|
||||
++ head-rush
|
||||
|* a=_rule
|
||||
|* [b=cord c=*]
|
||||
=+ nit=(rush b a)
|
||||
?~ nit ~
|
||||
(some [u.nit c])
|
||||
::
|
||||
::
|
||||
++ thot
|
||||
^- $+(json (unit thought))
|
||||
%- ot :~
|
||||
serial/(ci (slat %uv) so)
|
||||
audience/audi
|
||||
statement/stam
|
||||
==
|
||||
::
|
||||
++ audi (op stati (ci (soft delivery) so)) :: audience
|
||||
++ auri (op stati (ci (soft presence) so))
|
||||
::
|
||||
++ stati
|
||||
^- $+(nail (like station))
|
||||
%+ peach
|
||||
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
|
||||
%+ sear (soft partner)
|
||||
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
|
||||
::
|
||||
++ stam
|
||||
^- $+(json (unit statement))
|
||||
=- (ot now/di speech/(of -) ~)
|
||||
:~ own/so
|
||||
say/so
|
||||
exp/(cu |=(a=cord [a ~]) so)
|
||||
inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
|
||||
==
|
||||
::
|
||||
::
|
||||
++ conf
|
||||
^- $+(json (unit config))
|
||||
%- ot :~
|
||||
sources/(as (su stati))
|
||||
:- %cordon
|
||||
%+ cu |*(a=^ ?~(-.a a a)) :: XX do type stuff
|
||||
(ot white/bu list/(as (su fed:ag)) ~)
|
||||
==
|
||||
--
|
||||
-- --
|
||||
|
92
main/mar/radio-report/door.hook
Normal file
92
main/mar/radio-report/door.hook
Normal file
@ -0,0 +1,92 @@
|
||||
::
|
||||
:::: /hook/door/radio-report/mar
|
||||
::
|
||||
/? 314
|
||||
/- *radio
|
||||
!:
|
||||
|_ rep=report
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun report :: clam from %noun
|
||||
--
|
||||
++ grow
|
||||
|%
|
||||
++ mime [/text/json (taco (crip (pojo json)))]
|
||||
++ json
|
||||
=> +
|
||||
|^ %+ joba -.rep
|
||||
?- -.rep
|
||||
%config ~! rep (conf +.rep)
|
||||
%house [%a (turn (~(tap by +.rep)) joce)]
|
||||
%grams (jobe num/(jone p.rep) tele/[%a (turn q.rep gram)] ~)
|
||||
::%group (grop +.rep)
|
||||
%group (jobe local/(grop p.rep) global/%.(q.rep (jome stan grop)) ~)
|
||||
==
|
||||
++ joce |=(a=span [%s a])
|
||||
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
|
||||
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
|
||||
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
|
||||
:: ++ jase
|
||||
:: |* a=,json
|
||||
:: |= b=(set ,_+<.a) ^- json
|
||||
:: ~! b
|
||||
:: [%a (turn (~(tap in b)) a)]
|
||||
::
|
||||
++ jome :: stringify keys
|
||||
|* [a=_cord b=_json]
|
||||
|= c=(map ,_+<.a ,_+<.b)
|
||||
(jobe (turn (~(tap by c)) (both a b)))
|
||||
::
|
||||
++ both :: cons two gates
|
||||
|* [a=_,* b=_,*]
|
||||
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
|
||||
::
|
||||
::
|
||||
++ grop (jome phon stas) :: (map ship status)
|
||||
++ phon |=(a=ship (scot %p a))
|
||||
++ stas |=(status (jobe presence/(joce p) human/(huma q) ~))
|
||||
++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~))
|
||||
++ thot
|
||||
|= thought
|
||||
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
|
||||
::
|
||||
++ audi (jome stan joce)
|
||||
++ stan
|
||||
|= a=station ^- cord
|
||||
%- crip
|
||||
?~ -.a "{<p.p.a>}/{(trip q.p.a)}"
|
||||
?- -.p.a
|
||||
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
|
||||
==
|
||||
::
|
||||
++ stam |=(statement (jobe time/(jode p) speech/(spec q) ~))
|
||||
++ spec
|
||||
|= a=speech
|
||||
%+ joba -.a
|
||||
?- -.a
|
||||
?(%own %say) [%s p.a]
|
||||
%exp (jobe code/[%s p.a] done/?~(q.a ~ (joke u.q.a)) ~)
|
||||
%inv (jobe ship/(jope p.a) party/[%s q.a] ~)
|
||||
==
|
||||
::
|
||||
++ huma
|
||||
|= human
|
||||
%^ jobe
|
||||
hand/?~(hand ~ [%s u.hand])
|
||||
:- %true
|
||||
?~ true ~
|
||||
=+ u.true
|
||||
(jobe first/[%s p] middle/?~(q ~ [%s u.q]) last/[%s r] ~)
|
||||
~
|
||||
::
|
||||
++ conf
|
||||
|= config
|
||||
%- jobe :~
|
||||
sources/[%a (turn (~(tap in sources)) |=(a=station [%s (stan a)]))]
|
||||
=- cordon/(jobe white/[%b -.cordon] list/[%a -] ~)
|
||||
(turn (~(tap in p.cordon)) jope) :: XX jase
|
||||
==
|
||||
--
|
||||
-- --
|
||||
|
45
main/sur/radio/core.hook
Normal file
45
main/sur/radio/core.hook
Normal file
@ -0,0 +1,45 @@
|
||||
::
|
||||
:::: /hook/core/radio/sur
|
||||
::
|
||||
|%
|
||||
++ audience (map station delivery) :: destination/state
|
||||
++ atlas (map ship status) :: presence map
|
||||
++ command :: effect on party
|
||||
$% [%design (pair span (unit config))] :: configure/destroy
|
||||
[%publish (list thought)] :: originate
|
||||
[%review (list thought)] :: deliver
|
||||
[%ping (map station presence)] :: declare status
|
||||
== ::
|
||||
++ config :: party configuration
|
||||
$: sources=(set station) :: pulls from
|
||||
cordon=(each (set ship) (set ship)) :: white/blacklist
|
||||
== ::
|
||||
++ cousin (pair ship span) :: domestic flow
|
||||
++ delivery ?(%pending %received %rejected %released) :: delivery state
|
||||
++ human :: human identifier
|
||||
$: true=(unit (trel ,@t (unit ,@t) ,@t)) :: true name
|
||||
hand=(unit ,@t) :: handle
|
||||
== ::
|
||||
++ partner :: foreign flow
|
||||
$% [%twitter p=@t] :: twitter
|
||||
== ::
|
||||
++ presence ?(%hear %talk) :: status type
|
||||
++ report :: unified rush/rust
|
||||
$% [%house (set span)] :: meta-changes
|
||||
[%grams (pair ,@ud (list telegram))] :: thoughts
|
||||
[%group (pair atlas (map station atlas))] :: presence
|
||||
[%config config] :: reconfigure
|
||||
== ::
|
||||
++ serial ,@uvH :: unique identity
|
||||
++ station (each cousin partner) :: interlocutor
|
||||
++ status (pair presence human) :: participant
|
||||
++ speech :: party action
|
||||
$% [%own p=@t] :: @ or /me
|
||||
[%exp p=@t q=(unit tank)] :: program output
|
||||
[%say p=@t] :: normal line
|
||||
[%inv p=ship q=span] :: invite to
|
||||
== ::
|
||||
++ statement (pair ,@da speech) :: when this
|
||||
++ telegram (pair ship thought) :: who which whom what
|
||||
++ thought (trel serial audience statement) :: which whom what
|
||||
--
|
Loading…
Reference in New Issue
Block a user