mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-24 10:33:22 +03:00
mall: refactor gift/sign/task types
+on-agent now takes a +sign:agent:mall, which doesn't include spurious options. Similarly, +task:agent:mall is smaller.
This commit is contained in:
parent
aba0811b1d
commit
7c4316fce4
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:62ee6b1aaba1ef75b1ad7e9e42086f68b25102d3512a7c9dd8507a16978e21f8
|
||||
size 9154329
|
||||
oid sha256:051e022155585506992b39696e890d7ae618b129b303f230065eaa3bdb520e15
|
||||
size 9155947
|
||||
|
@ -887,7 +887,7 @@
|
||||
== ==
|
||||
::
|
||||
++ he-unto :: result from behn
|
||||
|= {way/wire cit/gift:agent:mall}
|
||||
|= {way/wire cit/sign:agent:mall}
|
||||
^+ +>
|
||||
?. ?=($poke-ack -.cit)
|
||||
~& [%strange-unto cit]
|
||||
@ -1223,10 +1223,10 @@
|
||||
*(unit (unit cage))
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
|= [=wire =sign:agent:mall]
|
||||
=/ =session (~(got by hoc) ost)
|
||||
=^ moves state
|
||||
he-abet:(~(he-unto he hid ost ~ session) wire gift)
|
||||
he-abet:(~(he-unto he hid ost ~ session) wire sign)
|
||||
[moves ..on-init]
|
||||
::
|
||||
++ on-arvo
|
||||
|
@ -189,14 +189,14 @@
|
||||
*(unit (unit cage))
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
|= [=wire =sign:agent:mall]
|
||||
=/ h (help hid)
|
||||
=^ cards lac
|
||||
?+ wire ~|([%hood-bad-wire wire] !!)
|
||||
[%helm *] ((wrap take-agent):from-helm:h wire gift)
|
||||
[%kiln *] ((wrap take-agent):from-kiln:h wire gift)
|
||||
[%drum *] ((wrap take-agent):from-drum:h wire gift)
|
||||
[%write *] ((wrap take-agent):from-write:h wire gift)
|
||||
[%helm *] ((wrap take-agent):from-helm:h wire sign)
|
||||
[%kiln *] ((wrap take-agent):from-kiln:h wire sign)
|
||||
[%drum *] ((wrap take-agent):from-drum:h wire sign)
|
||||
[%write *] ((wrap take-agent):from-write:h wire sign)
|
||||
==
|
||||
[cards ..on-init]
|
||||
::
|
||||
|
@ -49,11 +49,11 @@
|
||||
==
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
|= [=wire =sign:agent:mall]
|
||||
^- (quip card _this)
|
||||
=^ cards state
|
||||
?+ wire !!
|
||||
[%imp @ *] (on-agent:sc i.t.wire t.t.wire gift)
|
||||
[%imp @ *] (on-agent:sc i.t.wire t.t.wire sign)
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
@ -85,8 +85,8 @@
|
||||
(take-input imp-name ~ %sign wire sign-arvo)
|
||||
::
|
||||
++ on-agent
|
||||
|= [=imp-name =wire =gift:agent:mall]
|
||||
(take-input imp-name ~ %agent wire gift)
|
||||
|= [=imp-name =wire =sign:agent:mall]
|
||||
(take-input imp-name ~ %agent wire sign)
|
||||
::
|
||||
++ handle-start-imp
|
||||
|= [=imp-name =term]
|
||||
|
@ -36,30 +36,26 @@
|
||||
!!
|
||||
::
|
||||
++ on-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
|= [=wire =sign:agent:mall]
|
||||
^- (quip card:agent:mall _agent)
|
||||
?- -.gift
|
||||
?- -.sign
|
||||
%poke-ack
|
||||
?~ p.gift
|
||||
?~ p.sign
|
||||
`agent
|
||||
%- (slog leaf+"poke failed from {<dap.bowl>} on wire {<wire>}" u.p.gift)
|
||||
%- (slog leaf+"poke failed from {<dap.bowl>} on wire {<wire>}" u.p.sign)
|
||||
`agent
|
||||
::
|
||||
%watch-ack
|
||||
?~ p.gift
|
||||
?~ p.sign
|
||||
`agent
|
||||
=/ =tank leaf+"subscribe failed from {<dap.bowl>} on wire {<wire>}"
|
||||
%- (slog tank u.p.gift)
|
||||
%- (slog tank u.p.sign)
|
||||
`agent
|
||||
::
|
||||
%kick `agent
|
||||
%fact
|
||||
~| "unexpected subscription update to {<dap.bowl>} on wire {<wire>}"
|
||||
~| "with mark {<p.cage.gift>}"
|
||||
!!
|
||||
::
|
||||
%http-response
|
||||
~| "unexpected http-response to {<dap.bowl>} on wire {<wire>}"
|
||||
~| "with mark {<p.cage.sign>}"
|
||||
!!
|
||||
==
|
||||
::
|
||||
|
@ -252,18 +252,18 @@
|
||||
==
|
||||
::
|
||||
++ take-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
?+ wire ~|([%drum-bad-take-agent wire -.gift] !!)
|
||||
|= [=wire =sign:agent:mall]
|
||||
?+ wire ~|([%drum-bad-take-agent wire -.sign] !!)
|
||||
[%drum %phat *]
|
||||
?- -.gift
|
||||
?- -.sign
|
||||
%http-response !!
|
||||
%poke-ack (take-coup-phat t.t.wire p.gift)
|
||||
%watch-ack (reap-phat t.t.wire p.gift)
|
||||
%poke-ack (take-coup-phat t.t.wire p.sign)
|
||||
%watch-ack (reap-phat t.t.wire p.sign)
|
||||
%kick (quit-phat t.t.wire)
|
||||
%fact
|
||||
%+ diff-sole-effect-phat t.t.wire
|
||||
?> ?=(%sole-effect p.cage.gift)
|
||||
!<(sole-effect q.cage.gift)
|
||||
?> ?=(%sole-effect p.cage.sign)
|
||||
!<(sole-effect q.cage.sign)
|
||||
==
|
||||
==
|
||||
::
|
||||
|
@ -216,10 +216,10 @@
|
||||
==
|
||||
::
|
||||
++ take-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
?+ wire ~|([%helm-bad-take-agent wire -.gift] !!)
|
||||
[%helm %hi *] ?> ?=(%poke-ack -.gift)
|
||||
(coup-hi t.t.wire p.gift)
|
||||
|= [=wire =sign:agent:mall]
|
||||
?+ wire ~|([%helm-bad-take-agent wire -.sign] !!)
|
||||
[%helm %hi *] ?> ?=(%poke-ack -.sign)
|
||||
(coup-hi t.t.wire p.sign)
|
||||
==
|
||||
::
|
||||
++ take-bound
|
||||
|
@ -305,14 +305,14 @@
|
||||
abet
|
||||
::
|
||||
++ take-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
?+ wire ~|([%kiln-bad-take-agent wire -.gift] !!)
|
||||
[%kiln %fancy *] ?> ?=(%poke-ack -.gift)
|
||||
(take-coup-fancy t.t.wire p.gift)
|
||||
[%kiln %reload *] ?> ?=(%poke-ack -.gift)
|
||||
(take-coup-reload t.t.wire p.gift)
|
||||
[%kiln %spam *] ?> ?=(%poke-ack -.gift)
|
||||
(take-coup-spam t.t.wire p.gift)
|
||||
|= [=wire =sign:agent:mall]
|
||||
?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!)
|
||||
[%kiln %fancy *] ?> ?=(%poke-ack -.sign)
|
||||
(take-coup-fancy t.t.wire p.sign)
|
||||
[%kiln %reload *] ?> ?=(%poke-ack -.sign)
|
||||
(take-coup-reload t.t.wire p.sign)
|
||||
[%kiln %spam *] ?> ?=(%poke-ack -.sign)
|
||||
(take-coup-spam t.t.wire p.sign)
|
||||
==
|
||||
::
|
||||
++ take-general
|
||||
|
@ -138,6 +138,6 @@
|
||||
+>.sign-arvo
|
||||
::
|
||||
++ take-agent
|
||||
|= [=wire =gift:agent:mall]
|
||||
~|([%write-bad-take-agent wire -.gift] !!)
|
||||
|= [=wire =sign:agent:mall]
|
||||
~|([%write-bad-take-agent wire -.sign] !!)
|
||||
--
|
||||
|
@ -35,7 +35,7 @@
|
||||
!!
|
||||
::
|
||||
++ on-agent
|
||||
|~ [wire gift:agent:mall]
|
||||
|~ [wire sign:agent:mall]
|
||||
^- (quip card:agent:mall agent:mall)
|
||||
!!
|
||||
::
|
||||
|
@ -3,7 +3,7 @@
|
||||
+$ input
|
||||
$% [%poke =cage]
|
||||
[%sign =wire =sign-arvo]
|
||||
[%agent =wire =gift:agent:mall]
|
||||
[%agent =wire =sign:agent:mall]
|
||||
[%watch =path]
|
||||
==
|
||||
+$ thread-input [=bowl:mall in=(unit input)]
|
||||
|
@ -10165,7 +10165,7 @@
|
||||
=+ (balk(sut yet) hum hud dom)
|
||||
[yet hum]
|
||||
::
|
||||
++ mine !:
|
||||
++ mine
|
||||
:: mint all chapters and feet in a core
|
||||
::
|
||||
|= [gol/type mel/vair nym/(unit term) hud/poly dom/(map term tome)]
|
||||
|
@ -436,13 +436,13 @@
|
||||
{$m $unto *}
|
||||
:: ~& [%take-gall-unto +>.sih]
|
||||
?- -.+>.sih
|
||||
$poke-ack ?~(p.p.+>.sih +>.$ (crud %coup u.p.p.+>.sih))
|
||||
$kick peer
|
||||
$watch-ack ?~ p.p.+>.sih
|
||||
+>.$
|
||||
(dump:(crud %reap u.p.p.+>.sih) %logo ~)
|
||||
$fact pump:(from ;;(dill-blit q:`vase`+>+>+.sih))
|
||||
$http-response !!
|
||||
$poke-ack ?~(p.p.+>.sih +>.$ (crud %coup u.p.p.+>.sih))
|
||||
$kick peer
|
||||
$watch-ack ?~ p.p.+>.sih
|
||||
+>.$
|
||||
(dump:(crud %reap u.p.p.+>.sih) %logo ~)
|
||||
$fact pump:(from ;;(dill-blit q:`vase`+>+>.sih))
|
||||
$http-response !!
|
||||
==
|
||||
::
|
||||
{$c $note *}
|
||||
|
@ -1403,7 +1403,7 @@
|
||||
:^ duct %pass /channel/poke/[channel-id]/(scot %ud request-id.i.requests)
|
||||
=, i.requests
|
||||
:* %m %deal `sock`[our ship] app
|
||||
`task:agent:mall`[%poke-translated mark %json !>(json)]
|
||||
`task:agent:mall`[%poke-as mark %json !>(json)]
|
||||
==
|
||||
::
|
||||
$(requests t.requests)
|
||||
@ -1419,7 +1419,7 @@
|
||||
:^ duct %pass channel-wire
|
||||
=, i.requests
|
||||
:* %m %deal [our ship] app
|
||||
`task:agent:mall`[%watch-translated %json path]
|
||||
`task:agent:mall`[%watch-as %json path]
|
||||
==
|
||||
::
|
||||
=. session.channel-state.state
|
||||
@ -1513,19 +1513,19 @@
|
||||
:: +on-gall-response: turns a gall response into an event
|
||||
::
|
||||
++ on-gall-response
|
||||
|= [channel-id=@t request-id=@ud =gift:agent:mall]
|
||||
|= [channel-id=@t request-id=@ud =unto:mall]
|
||||
^- [(list move) server-state]
|
||||
::
|
||||
?+ -.gift ~|([%invalid-gall-response -.gift] !!)
|
||||
?+ -.unto ~|([%invalid-gall-response -.unto] !!)
|
||||
%poke-ack
|
||||
=/ =json
|
||||
=, enjs:format
|
||||
%- pairs :~
|
||||
['response' [%s 'poke']]
|
||||
['id' (numb request-id)]
|
||||
?~ p.gift
|
||||
?~ p.unto
|
||||
['ok' [%s 'ok']]
|
||||
['err' (wall (render-tang-to-wall 100 u.p.gift))]
|
||||
['err' (wall (render-tang-to-wall 100 u.p.unto))]
|
||||
==
|
||||
::
|
||||
(emit-event channel-id [(en-json:html json)]~)
|
||||
@ -1537,8 +1537,8 @@
|
||||
['response' [%s 'diff']]
|
||||
['id' (numb request-id)]
|
||||
:- 'json'
|
||||
?> =(%json p.cage.gift)
|
||||
;;(json q.q.cage.gift)
|
||||
?> =(%json p.cage.unto)
|
||||
;;(json q.q.cage.unto)
|
||||
==
|
||||
::
|
||||
(emit-event channel-id [(en-json:html json)]~)
|
||||
@ -1560,9 +1560,9 @@
|
||||
%- pairs :~
|
||||
['response' [%s 'subscribe']]
|
||||
['id' (numb request-id)]
|
||||
?~ p.gift
|
||||
?~ p.unto
|
||||
['ok' [%s 'ok']]
|
||||
['err' (wall (render-tang-to-wall 100 u.p.gift))]
|
||||
['err' (wall (render-tang-to-wall 100 u.p.unto))]
|
||||
==
|
||||
::
|
||||
(emit-event channel-id [(en-json:html json)]~)
|
||||
|
@ -36,7 +36,7 @@
|
||||
::
|
||||
++ foreign-response
|
||||
$? %watch
|
||||
%watch-translated
|
||||
%watch-as
|
||||
%poke
|
||||
%leave
|
||||
==
|
||||
@ -145,7 +145,7 @@
|
||||
==
|
||||
:: +blocked: blocked tasks
|
||||
::
|
||||
++ blocked (qeu (trel duct routes task:agent))
|
||||
++ blocked (qeu (trel duct routes deal))
|
||||
:: +stats: statistics
|
||||
::
|
||||
++ stats
|
||||
@ -328,10 +328,10 @@
|
||||
::
|
||||
++ mo-handle-foreign-request
|
||||
~/ %mo-handle-foreign-request
|
||||
|= [=ship =term =task:agent]
|
||||
|= [=ship =term =deal]
|
||||
^+ mo-core
|
||||
::
|
||||
?: ?=(%pump -.task)
|
||||
?: ?=(%pump -.deal)
|
||||
::
|
||||
:: you'd think this would send an ack for the diff that caused
|
||||
:: this pump. it would, but we already sent it when we got the
|
||||
@ -342,17 +342,17 @@
|
||||
::
|
||||
=^ bone mo-core (mo-assign-bone ship)
|
||||
=/ =forward-ames
|
||||
?- -.task
|
||||
%poke [%m p.cage.task q.q.cage.task]
|
||||
%leave [%u ~]
|
||||
%raw-poke !!
|
||||
%poke-translated !!
|
||||
%watch-translated [%l task]
|
||||
%watch [%s path.task]
|
||||
?- -.deal
|
||||
%poke [%m p.cage.deal q.q.cage.deal]
|
||||
%leave [%u ~]
|
||||
%raw-poke !!
|
||||
%poke-as !!
|
||||
%watch-as [%l deal]
|
||||
%watch [%s path.deal]
|
||||
==
|
||||
::
|
||||
=/ sys-path
|
||||
=/ action -.task
|
||||
=/ action -.deal
|
||||
/sys/way/[action]
|
||||
::
|
||||
=/ =note-arvo
|
||||
@ -379,10 +379,10 @@
|
||||
::
|
||||
=/ result (bind art to-tang)
|
||||
?- foreign-response
|
||||
%watch-translated (mo-give %unto %watch-ack result)
|
||||
%watch (mo-give %unto %watch-ack result)
|
||||
%poke (mo-give %unto %poke-ack result)
|
||||
%leave mo-core
|
||||
%watch-as (mo-give %unto %watch-ack result)
|
||||
%watch (mo-give %unto %watch-ack result)
|
||||
%poke (mo-give %unto %poke-ack result)
|
||||
%leave mo-core
|
||||
==
|
||||
:: +mo-assign-bone: assign an outbone to a ship.
|
||||
::
|
||||
@ -520,7 +520,7 @@
|
||||
(mo-give %unto %poke-ack err)
|
||||
::
|
||||
=/ =cage (result-to-cage:ford build-result)
|
||||
(mo-give %unto %fact ~ cage)
|
||||
(mo-give %unto %fact cage)
|
||||
:: +mo-handle-sys-red: diff ack.
|
||||
::
|
||||
:: On receipt of a valid +sign from %ames, we simply pass a %pump
|
||||
@ -548,15 +548,15 @@
|
||||
?~ coop
|
||||
=/ =note-arvo
|
||||
=/ =sock [him our]
|
||||
=/ =task:agent [%pump ~]
|
||||
=/ =task:able [%deal sock dap task]
|
||||
=/ =deal [%pump ~]
|
||||
=/ =task:able [%deal sock dap deal]
|
||||
[%m task]
|
||||
(mo-pass sys-path note-arvo)
|
||||
::
|
||||
=/ mall-move=note-arvo
|
||||
=/ =sock [him our]
|
||||
=/ =task:agent [%leave ~]
|
||||
=/ =task:able [%deal sock dap task]
|
||||
=/ =deal [%leave ~]
|
||||
=/ =task:able [%deal sock dap deal]
|
||||
[%m task]
|
||||
::
|
||||
=/ ames-move=note-arvo
|
||||
@ -608,7 +608,7 @@
|
||||
mo-core
|
||||
=. mo-core (mo-abed u.duct)
|
||||
=/ =cage (result-to-cage:ford build-result)
|
||||
=/ =gift:able [%unto [%fact ~ cage]]
|
||||
=/ =gift:able [%unto %fact cage]
|
||||
(mo-give gift)
|
||||
:: +mo-handle-sys-req: process an inbound request.
|
||||
::
|
||||
@ -641,17 +641,17 @@
|
||||
mo-core
|
||||
::
|
||||
?> ?=([%m %unto *] sign-arvo)
|
||||
=/ =gift:agent +>.sign-arvo
|
||||
=/ =unto:agent +>.sign-arvo
|
||||
::
|
||||
?- -.gift
|
||||
?- -.unto
|
||||
%poke-ack
|
||||
(mo-give %mack p.gift)
|
||||
(mo-give %mack p.unto)
|
||||
::
|
||||
%fact
|
||||
=/ sys-path [%sys %red t.path]
|
||||
=/ =note-arvo
|
||||
=/ path [%m %gh dap ~]
|
||||
=/ noun [num %d p.cage.gift q.q.cage.gift]
|
||||
=/ noun [num %d p.cage.unto q.q.cage.unto]
|
||||
[%a %want him path noun]
|
||||
(mo-pass sys-path note-arvo)
|
||||
::
|
||||
@ -664,7 +664,7 @@
|
||||
(mo-pass sys-path note-arvo)
|
||||
::
|
||||
%watch-ack
|
||||
(mo-give %mack p.gift)
|
||||
(mo-give %mack p.unto)
|
||||
::
|
||||
%http-response
|
||||
!!
|
||||
@ -693,8 +693,8 @@
|
||||
::
|
||||
=/ =routes [disclosing=~ attributing=ship]
|
||||
=/ =cage (result-to-cage:ford build-result)
|
||||
=/ =task:agent [%poke cage]
|
||||
(mo-apply term routes task)
|
||||
=/ =deal [%poke cage]
|
||||
(mo-apply term routes deal)
|
||||
:: +mo-handle-sys-way: outbound request.
|
||||
::
|
||||
++ mo-handle-sys-way
|
||||
@ -732,6 +732,8 @@
|
||||
::
|
||||
=. app (ap-generic-take:app t.t.path sign-arvo)
|
||||
ap-abet:app
|
||||
=/ =unto +>.sign-arvo
|
||||
?< ?=(%http-response -.unto)
|
||||
=/ app
|
||||
?> ?=([%out @ @ *] t.t.path)
|
||||
=/ =term i.path
|
||||
@ -739,8 +741,7 @@
|
||||
=/ =routes [disclosing=~ attributing=ship]
|
||||
(ap-abed:ap term routes)
|
||||
=. app
|
||||
=/ =gift:agent +>.sign-arvo
|
||||
(ap-specific-take:app t.t.path gift)
|
||||
(ap-specific-take:app t.t.path unto)
|
||||
ap-abet:app
|
||||
:: +mo-clear-queue: clear blocked tasks from the specified running agent.
|
||||
::
|
||||
@ -765,11 +766,11 @@
|
||||
=^ task blocked [p q]:~(get to blocked)
|
||||
=/ =duct p.task
|
||||
=/ =routes q.task
|
||||
=/ =task:agent r.task
|
||||
=/ =deal r.task
|
||||
::
|
||||
=/ move
|
||||
=/ =sock [attributing.routes our]
|
||||
=/ card [%slip %m %deal sock term task]
|
||||
=/ card [%slip %m %deal sock term deal]
|
||||
[duct card]
|
||||
$(moves [move moves])
|
||||
:: +mo-beak: assemble a beak for the specified agent.
|
||||
@ -796,7 +797,7 @@
|
||||
:: +mo-apply: apply the supplied action to the specified agent.
|
||||
::
|
||||
++ mo-apply
|
||||
|= [=term =routes =task:agent]
|
||||
|= [=term =routes =deal]
|
||||
^+ mo-core
|
||||
::
|
||||
=/ =path
|
||||
@ -807,26 +808,26 @@
|
||||
=/ =beak (mo-beak term)
|
||||
[p q]:beak
|
||||
::
|
||||
?: ?=(%raw-poke -.task)
|
||||
=/ =schematic:ford [%vale ship-desk +.task]
|
||||
?: ?=(%raw-poke -.deal)
|
||||
=/ =schematic:ford [%vale ship-desk +.deal]
|
||||
=/ =note-arvo [%f %build live=%.n schematic]
|
||||
(mo-pass path note-arvo)
|
||||
::
|
||||
?: ?=(%poke-translated -.task)
|
||||
=/ =schematic:ford [%cast ship-desk mark.task [%$ cage.task]]
|
||||
?: ?=(%poke-as -.deal)
|
||||
=/ =schematic:ford [%cast ship-desk mark.deal [%$ cage.deal]]
|
||||
=/ =note-arvo [%f %build live=%.n schematic]
|
||||
(mo-pass path note-arvo)
|
||||
::
|
||||
=/ app (ap-abed:ap term routes)
|
||||
=. app (ap-apply:app task)
|
||||
=. app (ap-apply:app deal)
|
||||
ap-abet:app
|
||||
:: +mo-handle-local: handle locally.
|
||||
::
|
||||
:: If the agent is running or blocked, assign it the supplied +task.
|
||||
:: If the agent is running or blocked, assign it the supplied +deal.
|
||||
:: Otherwise simply apply the action to the agent.
|
||||
::
|
||||
++ mo-handle-local
|
||||
|= [=ship =term =task:agent]
|
||||
|= [=ship =term =deal]
|
||||
^+ mo-core
|
||||
::
|
||||
=/ =routes [disclosing=~ attributing=ship]
|
||||
@ -836,14 +837,14 @@
|
||||
?: |(!is-running is-blocked)
|
||||
=/ =blocked
|
||||
=/ waiting (~(get by blocked.agents.state) term)
|
||||
=/ tasks (fall waiting *blocked)
|
||||
=/ task [hen routes task]
|
||||
(~(put to tasks) task)
|
||||
=/ deals (fall waiting *blocked)
|
||||
=/ deal [hen routes deal]
|
||||
(~(put to deals) deal)
|
||||
::
|
||||
%_ mo-core
|
||||
blocked.agents.state (~(put by blocked.agents.state) term blocked)
|
||||
==
|
||||
(mo-apply term routes task)
|
||||
(mo-apply term routes deal)
|
||||
:: +mo-handle-forward: handle forward %ames message.
|
||||
::
|
||||
++ mo-handle-forward
|
||||
@ -865,26 +866,26 @@
|
||||
?- -.forward-ames
|
||||
%m
|
||||
=/ =task:able
|
||||
=/ =task:agent [%raw-poke [mark noun]:forward-ames]
|
||||
[%deal sock term task]
|
||||
=/ =deal [%raw-poke [mark noun]:forward-ames]
|
||||
[%deal sock term deal]
|
||||
[%m task]
|
||||
::
|
||||
%l
|
||||
=/ =task:able
|
||||
=/ =task:agent [%watch-translated [mark path]:forward-ames]
|
||||
[%deal sock term task]
|
||||
=/ =deal [%watch-as [mark path]:forward-ames]
|
||||
[%deal sock term deal]
|
||||
[%m task]
|
||||
::
|
||||
%s
|
||||
=/ =task:able
|
||||
=/ =task:agent [%watch path.forward-ames]
|
||||
[%deal sock term task]
|
||||
=/ =deal [%watch path.forward-ames]
|
||||
[%deal sock term deal]
|
||||
[%m task]
|
||||
::
|
||||
%u
|
||||
=/ =task:able
|
||||
=/ =task:agent [%leave ~]
|
||||
[%deal sock term task]
|
||||
=/ =deal [%leave ~]
|
||||
[%deal sock term deal]
|
||||
[%m task]
|
||||
==
|
||||
(mo-pass path note-arvo)
|
||||
@ -918,7 +919,7 @@
|
||||
mo-core
|
||||
=/ initialised
|
||||
(mo-abed u.out)
|
||||
(mo-give:initialised %unto %kick ~ ~)
|
||||
(mo-give:initialised %unto %kick ~)
|
||||
==
|
||||
:: +ap: agent engine
|
||||
::
|
||||
@ -1018,7 +1019,7 @@
|
||||
::
|
||||
++ ap-from-internal
|
||||
~/ %ap-from-internal
|
||||
|= =card:agent
|
||||
|= card=(wind neat gift:agent)
|
||||
^- (list move)
|
||||
::
|
||||
?- -.card
|
||||
@ -1032,7 +1033,7 @@
|
||||
|= =duct
|
||||
~? &(=(duct system-duct.agents.state) !=(agent-name %hood))
|
||||
[%agent-giving-on-system-duct agent-name -.gift]
|
||||
[duct %give %unto gift]
|
||||
[duct %give %unto %kick ~]
|
||||
::
|
||||
?. ?=(%fact -.gift)
|
||||
[agent-duct %give %unto gift]~
|
||||
@ -1048,7 +1049,7 @@
|
||||
(~(gut by marks.current-agent) duct p.cage)
|
||||
::
|
||||
?: =(mark p.cage)
|
||||
[duct %give %unto gift]
|
||||
[duct %give %unto %fact cage.gift]
|
||||
=/ =path /sys/pel/[agent-name]
|
||||
=/ =note-arvo
|
||||
=/ =schematic:ford
|
||||
@ -1061,21 +1062,21 @@
|
||||
%pass
|
||||
=/ =duct system-duct.agents.state
|
||||
=/ =wire p.card
|
||||
=/ =note:agent q.card
|
||||
=? wire ?=(%agent -.note)
|
||||
[%out (scot %p ship.note) name.note wire]
|
||||
=/ =neat:agent q.card
|
||||
=? wire ?=(%agent -.neat)
|
||||
[%out (scot %p ship.neat) name.neat wire]
|
||||
=. wire
|
||||
:: Is it bad that this includes attributing ship? May create
|
||||
:: spurious duct mismatches
|
||||
::
|
||||
[%use agent-name (scot %p attributing.agent-routes) wire]
|
||||
=/ =note-arvo
|
||||
?- -.note
|
||||
%arvo note-arvo.note
|
||||
?- -.neat
|
||||
%arvo note-arvo.neat
|
||||
%agent
|
||||
=/ =task:able
|
||||
=/ =sock [our ship.note]
|
||||
[%deal sock [name task]:note]
|
||||
=/ =sock [our ship.neat]
|
||||
[%deal sock [name deal]:neat]
|
||||
[%m task]
|
||||
==
|
||||
[duct %pass wire note-arvo]~
|
||||
@ -1102,7 +1103,7 @@
|
||||
=? ap-core =(ship ship.i.out)
|
||||
=/ core
|
||||
=. agent-duct system-duct.agents.state
|
||||
(ap-specific-take wire.i.out %kick ~ ~)
|
||||
(ap-specific-take wire.i.out %kick ~)
|
||||
core(agent-duct agent-duct)
|
||||
$(out t.out)
|
||||
:: +ap-agent-core: agent core with current bowl and state
|
||||
@ -1133,17 +1134,17 @@
|
||||
:: +ap-apply: apply effect.
|
||||
::
|
||||
++ ap-apply
|
||||
|= =task:agent
|
||||
|= =deal
|
||||
^+ ap-core
|
||||
::
|
||||
?- -.task
|
||||
%watch-translated (ap-subscribe-translated +.task)
|
||||
%poke (ap-poke +.task)
|
||||
%watch (ap-subscribe +.task)
|
||||
%raw-poke !!
|
||||
%poke-translated !!
|
||||
%leave ap-load-delete
|
||||
%pump ap-dequeue
|
||||
?- -.deal
|
||||
%watch-as (ap-subscribe-as +.deal)
|
||||
%poke (ap-poke +.deal)
|
||||
%watch (ap-subscribe +.deal)
|
||||
%raw-poke !!
|
||||
%poke-as !!
|
||||
%leave ap-load-delete
|
||||
%pump ap-dequeue
|
||||
==
|
||||
:: +ap-peek: peek.
|
||||
::
|
||||
@ -1181,8 +1182,8 @@
|
||||
:: =/ way [(scot %p ship) %out wire]
|
||||
::
|
||||
?: is-ok
|
||||
=/ =note:agent [%agent [other-ship other-agent] %pump ~]
|
||||
(ap-pass wire note)
|
||||
=/ =neat [%agent [other-ship other-agent] %pump ~]
|
||||
(ap-pass wire neat)
|
||||
(ap-kill-down wire [other-ship other-agent])
|
||||
:: +ap-dequeue: drop from queue.
|
||||
::
|
||||
@ -1266,11 +1267,11 @@
|
||||
:: +ap-pass: request action.
|
||||
::
|
||||
++ ap-pass
|
||||
|= [=path =note:agent]
|
||||
|= [=path =neat]
|
||||
^+ ap-core
|
||||
::
|
||||
=/ internal-moves
|
||||
(ap-from-internal %pass path note)
|
||||
(ap-from-internal %pass path neat)
|
||||
ap-core(agent-moves (weld internal-moves agent-moves))
|
||||
:: +ap-reinstall: reinstall.
|
||||
::
|
||||
@ -1294,10 +1295,10 @@
|
||||
=^ maybe-tang ap-core prep
|
||||
?~ maybe-tang
|
||||
ap-core
|
||||
(ap-error %prep-failed u.maybe-tang)
|
||||
:: +ap-subscribe-translated: apply %watch-translated.
|
||||
(ap-error %load-failed u.maybe-tang)
|
||||
:: +ap-subscribe-as: apply %watch-as.
|
||||
::
|
||||
++ ap-subscribe-translated
|
||||
++ ap-subscribe-as
|
||||
|= [=mark =path]
|
||||
^+ ap-core
|
||||
::
|
||||
@ -1358,7 +1359,7 @@
|
||||
:: +ap-specific-take: specific take.
|
||||
::
|
||||
++ ap-specific-take
|
||||
|= [=wire =gift:agent]
|
||||
|= [=wire =sign:agent]
|
||||
^+ ap-core
|
||||
::
|
||||
~| wire=wire
|
||||
@ -1369,10 +1370,10 @@
|
||||
=/ agent-wire t.t.t.wire
|
||||
:: if subscription ack or close, handle before calling user code
|
||||
::
|
||||
=? outgoing.subscribers.current-agent ?=(%kick -.gift)
|
||||
=? outgoing.subscribers.current-agent ?=(%kick -.sign)
|
||||
%- ~(del by outgoing.subscribers.current-agent)
|
||||
[agent-wire dock]
|
||||
?: ?& ?=(%watch-ack -.gift)
|
||||
?: ?& ?=(%watch-ack -.sign)
|
||||
!(~(has by outgoing.subscribers.current-agent) [agent-wire dock])
|
||||
==
|
||||
%- %: slog
|
||||
@ -1384,8 +1385,8 @@
|
||||
==
|
||||
ap-core
|
||||
::
|
||||
=? outgoing.subscribers.current-agent ?=(%watch-ack -.gift)
|
||||
?^ p.gift
|
||||
=? outgoing.subscribers.current-agent ?=(%watch-ack -.sign)
|
||||
?^ p.sign
|
||||
%- ~(del by outgoing.subscribers.current-agent)
|
||||
[wire dock]
|
||||
%+ ~(jab by outgoing.subscribers.current-agent) [agent-wire dock]
|
||||
@ -1396,12 +1397,12 @@
|
||||
::
|
||||
=^ maybe-tang ap-core
|
||||
%+ ap-ingest ~ |.
|
||||
(on-agent:ap-agent-core agent-wire gift)
|
||||
(on-agent:ap-agent-core agent-wire sign)
|
||||
::
|
||||
=? ap-core ?=(%fact -.gift)
|
||||
=? ap-core ?=(%fact -.sign)
|
||||
(ap-update-subscription =(~ maybe-tang) p.dock q.dock agent-wire)
|
||||
?^ maybe-tang
|
||||
(ap-error -.gift leaf/"closing subscription" u.maybe-tang)
|
||||
(ap-error -.sign leaf/"closing subscription" u.maybe-tang)
|
||||
ap-core
|
||||
:: +ap-install: install wrapper.
|
||||
::
|
||||
@ -1488,7 +1489,7 @@
|
||||
::
|
||||
=. ap-core
|
||||
=/ way [%out (scot %p p.dock) q.dock wire]
|
||||
(ap-specific-take way %kick ~ ~)
|
||||
(ap-specific-take way %kick ~)
|
||||
(ap-pass wire %agent dock %leave ~)
|
||||
:: +ap-ingest: call agent arm
|
||||
::
|
||||
@ -1614,16 +1615,16 @@
|
||||
=> (mo-boot:initialised q.dock q.task)
|
||||
mo-abet
|
||||
::
|
||||
?(%deal %deal-mall)
|
||||
%deal
|
||||
=/ =sock p.task
|
||||
=/ =term q.task
|
||||
=/ =task:agent r.task
|
||||
=/ =deal r.task
|
||||
?. =(q.sock our)
|
||||
?> =(p.sock our)
|
||||
=> (mo-handle-foreign-request:initialised q.sock term task)
|
||||
=> (mo-handle-foreign-request:initialised q.sock term deal)
|
||||
mo-abet
|
||||
::
|
||||
=> (mo-handle-local:initialised p.sock term task)
|
||||
=> (mo-handle-local:initialised p.sock term deal)
|
||||
mo-abet
|
||||
::
|
||||
%init
|
||||
|
@ -1876,7 +1876,7 @@
|
||||
$% {$mass p/mass} :: memory usage
|
||||
{$onto p/(each suss tang)} :: about agent
|
||||
{$rend p/path q/*} :: network request
|
||||
{$unto p/gift:agent} ::
|
||||
{$unto p/unto} ::
|
||||
{$mack p/(unit tang)} :: message ack
|
||||
== ::
|
||||
++ task :: incoming request
|
||||
@ -1884,8 +1884,7 @@
|
||||
$% {$conf p/dock q/dock} :: configure app
|
||||
{$conf-mall p/dock q/dock} :: configure app
|
||||
$>(%init vane-task) :: set owner
|
||||
{$deal p/sock q/term r/task:agent} :: full transmission
|
||||
{$deal-mall p/sock q/term r/task:agent} :: full transmission
|
||||
{$deal p/sock q/term r/deal} :: full transmission
|
||||
$>(%trim vane-task) :: trim state
|
||||
$>(%vega vane-task) :: report upgrade
|
||||
$>(%west vane-task) :: network request
|
||||
@ -1919,6 +1918,20 @@
|
||||
== ::
|
||||
++ suss (trel dude @tas @da) :: config report
|
||||
++ well (pair desk term) ::
|
||||
++ neat
|
||||
$% [%arvo =note-arvo]
|
||||
[%agent [=ship name=term] =deal]
|
||||
==
|
||||
+$ deal
|
||||
$% [%raw-poke =mark =noun]
|
||||
[%pump ~]
|
||||
task:agent
|
||||
==
|
||||
+$ unto
|
||||
$% [%http-response =http-event:http]
|
||||
sign:agent
|
||||
==
|
||||
::
|
||||
:: +agent: app core
|
||||
::
|
||||
++ agent
|
||||
@ -1931,20 +1944,23 @@
|
||||
[%agent [=ship name=term] =task]
|
||||
==
|
||||
+$ task
|
||||
$% [%watch-translated =mark =path]
|
||||
[%watch =path]
|
||||
$% [%watch =path]
|
||||
[%watch-as =mark =path]
|
||||
[%leave ~]
|
||||
[%poke =cage]
|
||||
[%raw-poke =mark =noun]
|
||||
[%poke-translated =mark =cage]
|
||||
[%pump ~]
|
||||
[%poke-as =mark =cage]
|
||||
==
|
||||
+$ gift
|
||||
$% [%poke-ack p=(unit tang)]
|
||||
[%fact path=(unit path) =cage]
|
||||
$% [%fact path=(unit path) =cage]
|
||||
[%kick path=(unit path) ship=(unit ship)]
|
||||
[%watch-ack p=(unit tang)]
|
||||
[%http-response =http-event:http]
|
||||
[%poke-ack p=(unit tang)]
|
||||
==
|
||||
+$ sign
|
||||
$% [%poke-ack p=(unit tang)]
|
||||
[%watch-ack p=(unit tang)]
|
||||
[%fact =cage]
|
||||
[%kick ~]
|
||||
==
|
||||
++ form
|
||||
$_ ^|
|
||||
@ -1960,7 +1976,7 @@
|
||||
*(quip card _^|(..on-init))
|
||||
::
|
||||
++ on-poke
|
||||
|~ in-poke-data=cage
|
||||
|~ [mark vase]
|
||||
*(quip card _^|(..on-init))
|
||||
::
|
||||
++ on-watch
|
||||
@ -1976,11 +1992,11 @@
|
||||
*(unit (unit cage))
|
||||
::
|
||||
++ on-agent
|
||||
|~ [wire gift]
|
||||
|~ [wire sign]
|
||||
*(quip card _^|(..on-init))
|
||||
::
|
||||
++ on-arvo
|
||||
|~ [wire =sign-arvo]
|
||||
|~ [wire sign-arvo]
|
||||
*(quip card _^|(..on-init))
|
||||
::
|
||||
++ on-fail
|
||||
|
Loading…
Reference in New Issue
Block a user