diff --git a/app/baby.hoon b/app/baby.hoon index 850d50e26..ec0313a27 100644 --- a/app/baby.hoon +++ b/app/baby.hoon @@ -13,7 +13,11 @@ $: top-comments=(list tape) == +$ command cord - ++ tapp (^tapp state command) + +$ poke-data + $% [%noun cord] + == + ++ tapp (^tapp state command poke-data) + ++ stdio (^stdio poke-data) -- => |% diff --git a/app/sitter.hoon b/app/sitter.hoon new file mode 100644 index 000000000..4e6f64514 --- /dev/null +++ b/app/sitter.hoon @@ -0,0 +1,30 @@ +/+ tapp, stdio +=> + |% + +$ subscription-state + $: her=ship + app=term + == + +$ state + $: subscription=(unit subscription-state) + == + +$ command cord + +$ poke-data + $% [%noun cord] + == + ++ tapp (^tapp state command poke-data) + ++ stdio (^stdio poke-data) + -- +=, trad=trad:tapp +=, tapp-trad=tapp-trad:tapp +=, stdio +%- create-tapp:tapp +^- tapp-core:tapp +|_ [=bowl:gall state] +++ handle-command + |= =command + =/ m tapp-trad + ^- form:m + ;< ~ bind:m (poke-app [our.bowl %baby] %noun 'print') + (pure:m subscription) +-- diff --git a/lib/stdio.hoon b/lib/stdio.hoon index 44fafa4da..d7bbc8d8b 100644 --- a/lib/stdio.hoon +++ b/lib/stdio.hoon @@ -12,6 +12,8 @@ :: /- tapp-sur=tapp /+ trad +|* poke-data=mold +=/ tapp-sur (tapp-sur poke-data) =, card=card:tapp-sur =, sign=sign:tapp-sur =, contract=contract:tapp-sur @@ -36,6 +38,15 @@ |= trad-input [~ ~ (silt [add contract]~) %done ~] :: +:: Send effect +:: +++ send-effect + |= =card + =/ m (trad ,~) + ^- form:m + |= trad-input + [~ [card]~ ~ %done ~] +:: :: ---- :: :: HTTP requests @@ -181,4 +192,14 @@ ?. ?=(%cont -.next.c-res) c-res c-res(self.next ..loop(computation self.next.c-res)) +:: +:: ---- +:: +:: Apps +:: +++ poke-app + |= [[her=ship app=term] =poke-data] + =/ m (trad ,~) + ^- form:m + (send-effect %poke / [her app] poke-data) -- diff --git a/lib/tapp.hoon b/lib/tapp.hoon index 3d24b281b..e4a9001be 100644 --- a/lib/tapp.hoon +++ b/lib/tapp.hoon @@ -1,11 +1,11 @@ -/- tapp +/- tapp-sur=tapp /+ trad -=, card=card:tapp -=, sign=sign:tapp -=, contract=contract:tapp -=, trad-lib=trad -|* [state-type=mold command-type=mold] +|* [state-type=mold command-type=mold poke-data=mold] |% +++ tapp-sur (^tapp-sur poke-data) +++ card card:tapp-sur +++ sign sign:tapp-sur +++ contract contract:tapp-sur :: :: The form of a tapp :: @@ -17,7 +17,7 @@ *form:tapp-trad -- :: -++ trad-lib (^trad-lib sign card contract) +++ trad-lib (^trad sign card contract) ++ trad trad:trad-lib :: +$ move (pair bone card) @@ -34,7 +34,7 @@ ++ prep |= old-state=* ^- (quip move _this-tapp) - ~& %tapp-loaded + ~& [%tapp-loaded dap.bowl] =/ old ((soft tapp-state) old-state) ?~ old `this-tapp diff --git a/sur/tapp.hoon b/sur/tapp.hoon index bbbd04651..3e2cce9da 100644 --- a/sur/tapp.hoon +++ b/sur/tapp.hoon @@ -1,3 +1,4 @@ +|* poke-data=mold |% :: :: Possible async calls @@ -7,6 +8,7 @@ [%them wire ~] [%wait wire @da] [%rest wire @da] + [%poke wire dock poke-data] == :: :: Possible async responses