2019-11-22 03:51:52 +03:00
|
|
|
::
|
2020-09-01 04:54:39 +03:00
|
|
|
:: soto [landscape]: A Dojo relay for Urbit's Landscape interface
|
|
|
|
::
|
2019-11-22 03:51:52 +03:00
|
|
|
:: Relays sole-effects to subscribers and forwards sole-action pokes
|
|
|
|
::
|
|
|
|
/- sole
|
2020-04-29 22:01:31 +03:00
|
|
|
/+ *soto, default-agent
|
2019-11-22 03:51:52 +03:00
|
|
|
|%
|
|
|
|
+$ card card:agent:gall
|
|
|
|
::
|
2020-06-18 14:47:44 +03:00
|
|
|
+$ versioned-state
|
|
|
|
$@ state-null
|
|
|
|
state-zero
|
|
|
|
::
|
|
|
|
+$ state-null ~
|
|
|
|
::
|
|
|
|
+$ state-zero [%0 ~]
|
2019-11-22 03:51:52 +03:00
|
|
|
--
|
|
|
|
=| state-zero
|
|
|
|
=* state -
|
|
|
|
^- agent:gall
|
|
|
|
|_ bol=bowl:gall
|
|
|
|
+* this .
|
|
|
|
soto-core +>
|
|
|
|
sc ~(. soto-core bol)
|
|
|
|
def ~(. (default-agent this %|) bol)
|
|
|
|
::
|
2020-06-18 14:47:44 +03:00
|
|
|
++ on-init
|
|
|
|
:_ this
|
|
|
|
:_ ~
|
|
|
|
:* %pass /srv %agent [our.bol %file-server]
|
|
|
|
%poke %file-server-action
|
2020-08-26 22:22:54 +03:00
|
|
|
!>([%serve-dir /'~dojo' /app/landscape %.n %.y])
|
2020-06-18 14:47:44 +03:00
|
|
|
==
|
2019-11-22 03:51:52 +03:00
|
|
|
++ on-save !>(state)
|
|
|
|
::
|
|
|
|
++ on-load
|
2020-06-18 14:47:44 +03:00
|
|
|
|= old-vase=vase
|
|
|
|
=/ old
|
|
|
|
!<(versioned-state old-vase)
|
|
|
|
?^ old
|
|
|
|
[~ this(state old)]
|
|
|
|
:_ this(state [%0 ~])
|
2020-05-28 21:47:34 +03:00
|
|
|
:~ [%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]
|
|
|
|
:* %pass /srv %agent [our.bol %file-server]
|
|
|
|
%poke %file-server-action
|
2020-08-26 22:22:54 +03:00
|
|
|
!>([%serve-dir /'~dojo' /app/landscape %.n %.y])
|
2020-05-28 21:47:34 +03:00
|
|
|
==
|
|
|
|
==
|
2019-11-22 03:51:52 +03:00
|
|
|
::
|
2020-04-29 22:01:31 +03:00
|
|
|
++ on-poke on-poke:def
|
2019-11-22 03:51:52 +03:00
|
|
|
++ on-watch
|
|
|
|
|= pax=path
|
|
|
|
^- (quip card _this)
|
2020-04-29 22:01:31 +03:00
|
|
|
?+ pax (on-watch:def pax)
|
2019-11-22 03:51:52 +03:00
|
|
|
[%sototile ~]
|
|
|
|
:_ this
|
|
|
|
[%give %fact ~ %json !>(~)]~
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [wir=wire sin=sign-arvo]
|
|
|
|
^- (quip card _this)
|
|
|
|
?: ?=(%bound +<.sin)
|
|
|
|
[~ this]
|
|
|
|
(on-arvo:def wir sin)
|
|
|
|
::
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
::
|
|
|
|
--
|