garden: version treaty, docket

This commit is contained in:
Liam Fitzgerald 2021-09-28 10:19:43 +10:00
parent cf5f444458
commit f3f13b1261
26 changed files with 35 additions and 38 deletions

View File

@ -0,0 +1 @@
../../garden-dev/mar/docket-0.hoon

View File

@ -1 +0,0 @@
../../garden-dev/mar/docket.hoon

1
pkg/bitcoin/mar/glob-0.hoon Symbolic link
View File

@ -0,0 +1 @@
../../base-dev/mar/glob-0.hoon

View File

@ -1 +0,0 @@
../../base-dev/mar/glob.hoon

View File

@ -0,0 +1 @@
../../garden-dev/sur/hark-store.hoon

View File

@ -133,9 +133,7 @@
~| [%glob-unavailable requested=hash have=have]
?> =(hash have)
:_ state
:~ [%give %fact ~[path] %glob !>(`glob`glob.chad.charge)]
[%give %kick ~[path] ~]
==
(fact-init-kick:io (glob:cg:cc glob.chad.charge))
==
[cards this]
::
@ -163,8 +161,7 @@
::
[%x %charges ~]
:- ~ :- ~
:- %charge-update
!> ^- charge-update
%- charge-update:cg:cc
:- %initial
%- ~(gas by *(map desk charge))
%+ turn ~(tap by charges)
@ -391,6 +388,15 @@
++ def ~(. (default-agent state %|) bowl)
::
++ hash-glob sham
++ cg
|%
++ glob |=(g=^glob glob-0+!>(g))
++ docket |=(d=^docket docket-0+!>(docket))
++ charge-update |=(u=^charge-update charge-update+!>(u))
++ kiln-uninstall |=(=desk kiln-uninstall+!>(desk))
++ kiln-install
|=([here=desk her=ship there=desk] kiln-install+!>([here her there]))
--
::
++ handle-http-request
|= [eyre-id=@ta inbound-request:eyre]
@ -538,7 +544,7 @@
=- [%pass /write/[desk] %arvo %c %info -]~
%+ foal:space:userlib
/(scot %p our.bowl)/[desk]/(scot %da now.bowl)/desk/docket
=- [%docket !>(`docket`-)]
%- docket:cg
docket.charge(glob-reference.href [(hash-glob glob) %ames our.bowl])
==
::
@ -639,13 +645,14 @@
==
++ add-fact
=/ =charge (~(got by charges) desk)
(fact:io charge-update+!>([%add-charge desk (get-light-charge charge)]) /charges ~)
++ del-fact (fact:io charge-update+!>([%del-charge desk]) /charges ~)
=- (fact:io - /charges ~)
(charge-update:cg %add-charge desk (get-light-charge charge))
++ del-fact (fact:io (charge-update:cg %del-charge desk) /charges ~)
++ install
|= [=ship remote=^desk]
(poke-our:(pass /install) %hood kiln-install+!>([desk ship remote]))
(poke-our:(pass /install) %hood (kiln-install:cg desk ship remote))
++ uninstall
(poke-our:(pass /uninstall) %hood kiln-uninstall+!>(desk))
(poke-our:(pass /uninstall) %hood (kiln-uninstall:cg desk))
++ new-docket
|= d=^docket
%+ ~(put by charges) desk
@ -681,8 +688,9 @@
:~ (watch-our:(pass (glob-wire ref)) %spider /thread-result/[tid])
(poke-our:(pass (glob-wire ref)) %spider cage)
==
++ docket-exists .^(? %cu (scry:io desk /desk/docket))
++ docket .^(^docket %cx (scry:io desk /desk/docket))
++ docket-loc `path`/desk/docket-0
++ docket-exists .^(? %cu (scry:io desk docket-loc))
++ docket .^(^docket %cx (scry:io desk docket-loc))
--
--

View File

@ -99,10 +99,10 @@
=/ =ship (slav %p i.t.path)
=* desk i.t.t.path
?: =(our.bowl ship)
:_(this (fact-init:io treaty+!>((~(got by sovereign) desk)))^~)
:_(this (fact-init:io (treaty:cg:cc (~(got by sovereign) desk)))^~)
?^ treat=(~(get by treaties) [ship desk])
:_ this
(fact-init:io treaty+!>(u.treat))^~
(fact-init:io (treaty:cg:cc u.treat))^~
?> =(our.bowl src.bowl)
=. direct (~(put in direct) [ship desk])
:_(this (drop ~(safe-watch tr:cc [ship desk])))
@ -134,13 +134,12 @@
%+ skim ~(tap by treaties)
|= [ref=[^ship desk] =treaty]
(~(has in alliance) ref)
``(treaty-update:cg:ca %ini allied)
``(treaty-update:cg:ca:cc %ini allied)
::
[%x %treaty @ @ ~]
=/ =ship (slav %p i.t.t.path)
=* desk i.t.t.t.path
=/ =treaty (~(got by treaties) [ship desk])
``treaty+!>(treaty)
``(treaty:cg:cc (~(got by treaties) [ship desk]))
==
::
++ on-agent
@ -226,7 +225,6 @@
[%sovereign @ ~]
=* desk i.t.wire
(take-sovereign desk)
==
::
++ take-sovereign
@ -303,9 +301,9 @@
++ wire /sovereign/[desk]
++ pass ~(. ^pass wire)
++ path /treaty/(scot %p our.bowl)/[desk]
++ get-docket .^(docket:docket %cx (scry:io desk /desk/docket))
++ get-docket .^(docket:docket %cx (scry:io desk /desk/docket-0))
++ warp
(warp-our:pass desk `[%next %x da+now.bowl /desk/docket])
(warp-our:pass desk `[%next %x da+now.bowl /desk/docket-0])
++ kick
(kick:io path ~)
++ give
@ -315,13 +313,3 @@
(poke-our:pass %hood kiln-permission+!>([desk / &]))
--
--

View File

@ -0,0 +1 @@
../../garden-dev/mar/docket-0.hoon

View File

@ -1 +0,0 @@
../../garden-dev/mar/docket.hoon

1
pkg/garden/mar/glob-0.hoon Symbolic link
View File

@ -0,0 +1 @@
../../base-dev/mar/glob-0.hoon

View File

@ -1 +0,0 @@
../../base-dev/mar/glob.hoon

View File

@ -0,0 +1 @@
../../garden-dev/mar/docket-0.hoon

View File

@ -1 +0,0 @@
../../garden-dev/mar/docket.hoon

View File

@ -0,0 +1 @@
../../base-dev/mar/glob-0.hoon

View File

@ -1 +0,0 @@
../../base-dev/mar/glob.hoon

View File

@ -0,0 +1 @@
../../garden-dev/mar/docket-0.hoon

View File

@ -1 +0,0 @@
../../garden-dev/mar/docket.hoon

1
pkg/webterm/mar/glob-0.hoon Symbolic link
View File

@ -0,0 +1 @@
../../base-dev/mar/glob-0.hoon

View File

@ -1 +0,0 @@
../../base-dev/mar/glob.hoon