2020-10-24 02:25:44 +03:00
|
|
|
:: herm: stand-in for term.c with http interface
|
|
|
|
::
|
|
|
|
/+ default-agent, dbug, verb
|
|
|
|
=, able:jael
|
|
|
|
|%
|
|
|
|
+$ state-0 [%0 ~]
|
|
|
|
--
|
|
|
|
::
|
|
|
|
=| state-0
|
|
|
|
=* state -
|
|
|
|
%+ verb |
|
|
|
|
%- agent:dbug
|
|
|
|
^- agent:gall
|
2020-11-06 17:42:15 +03:00
|
|
|
=> |%
|
|
|
|
++ request-tube
|
|
|
|
|= [bowl:gall from=mark to=mark next=?]
|
|
|
|
^- card:agent:gall
|
|
|
|
:* %pass /tube/[from]/[to]
|
|
|
|
%arvo %c %warp
|
|
|
|
our q.byk ~
|
|
|
|
::
|
|
|
|
?: next
|
|
|
|
[%next %c da+now /[from]/[to]]
|
|
|
|
[%sing %c da+now /[from]/[to]]
|
|
|
|
==
|
|
|
|
--
|
2020-10-24 02:25:44 +03:00
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
::
|
|
|
|
++ on-init
|
|
|
|
^- (quip card:agent:gall _this)
|
|
|
|
:_ this
|
2020-11-06 17:42:15 +03:00
|
|
|
:: set up dill session subscription,
|
|
|
|
:: and ensure the tubes we use are in cache
|
|
|
|
::
|
2020-11-10 21:32:26 +03:00
|
|
|
:~ [%pass [%view %$ ~] %arvo %d %view ~]
|
2020-11-06 17:42:15 +03:00
|
|
|
(request-tube bowl %blit %json |)
|
|
|
|
(request-tube bowl %json %belt |)
|
|
|
|
==
|
2020-10-24 02:25:44 +03:00
|
|
|
::
|
|
|
|
++ on-save !>([%0 ~])
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
|
|
|
^- (quip card:agent:gall _this)
|
|
|
|
[~ this(state [%0 ~])]
|
|
|
|
::
|
|
|
|
++ on-watch
|
|
|
|
|= =path
|
|
|
|
^- (quip card:agent:gall _this)
|
2020-11-10 21:32:26 +03:00
|
|
|
?> ?=([%session @ ~] path)
|
2020-11-05 22:13:36 +03:00
|
|
|
:_ this
|
|
|
|
:: scry prompt and cursor position out of dill for initial response
|
|
|
|
::
|
|
|
|
=/ base=^path
|
|
|
|
/dx/(scot %p our.bowl)//(scot %da now.bowl)/sessions
|
|
|
|
:~ [%give %fact ~ %blit !>(.^(blit:dill (weld base //line)))]
|
|
|
|
[%give %fact ~ %blit !>(`blit:dill`hop+.^(@ud (weld base //cursor)))]
|
|
|
|
==
|
2020-10-24 02:25:44 +03:00
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
^- (quip card:agent:gall _this)
|
2020-11-06 17:42:15 +03:00
|
|
|
?+ wire !!
|
|
|
|
:: pass on dill blits for the session
|
|
|
|
::
|
2020-11-10 21:32:26 +03:00
|
|
|
[%view %$ ~]
|
2020-11-06 17:42:15 +03:00
|
|
|
?. ?=([%d %blit *] sign-arvo)
|
|
|
|
~| [%unexpected-sign [- +<]:sign-arvo]
|
|
|
|
!!
|
|
|
|
:_ this
|
|
|
|
%+ turn p.sign-arvo
|
|
|
|
|= =blit:dill
|
2020-11-10 21:32:26 +03:00
|
|
|
[%give %fact [%session %$ ~]~ %blit !>(blit)]
|
2020-11-06 17:42:15 +03:00
|
|
|
::
|
|
|
|
:: ensure the tubes we need remain in cache
|
|
|
|
::
|
|
|
|
[%tube @ @ ~]
|
|
|
|
=* from i.t.wire
|
|
|
|
=* to i.t.t.wire
|
|
|
|
?. ?=([%c %writ *] sign-arvo)
|
|
|
|
~| [%unexpected-sign [- +<]:sign-arvo]
|
|
|
|
!!
|
|
|
|
:_ this
|
|
|
|
[(request-tube bowl from to &)]~
|
|
|
|
==
|
2020-10-24 02:25:44 +03:00
|
|
|
::
|
|
|
|
++ on-poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
^- (quip card:agent:gall _this)
|
|
|
|
?. ?=(%belt mark)
|
|
|
|
~| [%unexpected-mark mark]
|
|
|
|
!!
|
|
|
|
:_ this
|
2020-11-10 21:32:26 +03:00
|
|
|
[%pass [%belt %$ ~] %arvo %d %belt !<(belt:dill vase)]~
|
2020-10-24 02:25:44 +03:00
|
|
|
::
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-fail on-fail:def
|
|
|
|
--
|