shrub/base/lib/helm/core.hook

161 lines
7.1 KiB
Plaintext
Raw Normal View History

2015-05-11 20:53:47 +03:00
:: :: ::
:::: /hook/core/helm/lib :: ::
:: :: ::
/? 310 :: version
:: :: ::
:::: :: ::
:: :: ::
|% :: ::
++ helm-part :: helm state
$: %helm :: doubletag
%0 :: state version
bur=(unit (pair ship mace)) :: requesting ticket
hoc=(map bone helm-session) :: consoles
== ::
++ helm-session ::
$: say=sole-share :: console state
mud=(unit (sole-dialog ,@ud)) :: console dialog
== ::
:: :: ::
:::: :: ::
:: :: ::
2015-05-12 03:31:37 +03:00
++ hood-begin :: begin command
2015-05-11 20:53:47 +03:00
$: his=@p :: identity
tic=@p :: ticket
eny=@t :: entropy
ges=gens :: description
== ::
2015-05-12 03:31:37 +03:00
++ hood-init :: report init
2015-05-11 20:53:47 +03:00
$: him=ship ::
== ::
2015-05-12 03:31:37 +03:00
++ hood-start :: start (local) server
2015-05-11 20:53:47 +03:00
$: syd=desk :: desk
dap=term :: program
== ::
2015-05-12 03:31:37 +03:00
++ hood-reset :: reset command
2015-05-11 20:53:47 +03:00
,~ ::
++ helm-verb :: reset command
,~ ::
2015-05-12 03:31:37 +03:00
++ hood-reload :: reload command
2015-05-11 20:53:47 +03:00
(list term) ::
-- ::
:: :: ::
:::: :: ::
!: :: ::
|% :: helm library
++ helm-work :: work in helm
|= [[hide from] helm-part]
?> =(src our)
=+ sez=(fall (~(get by hoc) ost) *helm-session)
=> |% :: arvo structures
++ card ::
$% [%cash wire p=@p q=buck] ::
[%conf wire dock %load ship term] ::
[%flog wire dill] ::
[%plug wire @p @tas @p @tas] ::
[%want wire sock path *] :: send message
== ::
++ suss ,[term @tas @da] :: config report
++ dill :: sent to %dill
$% [%crud p=term q=(list tank)] :: fat report
[%text p=tape] :: thin report
[%veer p=@ta q=path r=@t] :: install vane
[%vega p=path] :: reboot by path
[%verb ~] :: verbose mode
== ::
++ move (pair bone card) :: user-level move
--
|_ moz=(list move)
++ abet :: resolve
[(flop moz) %_(+>+>+<+ hoc (~(put by hoc) ost sez))]
::
++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card
++ emil :: return cards
|= (list card)
^+ +>
?~(+< +> $(+< t.+<, +> (emit i.+<)))
::
++ poke-begin :: make/send keypair
2015-05-12 03:31:37 +03:00
|= hood-begin =< abet
2015-05-11 20:53:47 +03:00
?> ?=(~ bur)
=+ buz=(shax :(mix (jam ges) eny))
=+ loy=(bruw 2.048 buz)
%- emit(bur `[his [0 sec:ex:loy]~])
[%want /ticketing [our (sein his)] /q/ta his tic ges pub:ex:loy]
::
++ poke-init :: initialize
|= him=ship =< abet
(emit %flog /helm %crud %hax-init leaf/(scow %p him) ~)
::
++ poke-start :: start a server
2015-05-12 03:31:37 +03:00
|= hood-start =< abet
2015-05-11 20:53:47 +03:00
(emit %conf /helm [our dap] %load our syd)
::
++ poke-reload :: reload vanes
|= all=(list term) =< abet
%- emil
%+ turn all
=+ ark=(arch .^(%cy /(scot %p our)/base/(scot %da lat)/arvo))
=+ van=(~(tap by r.ark))
|= nam=@tas
=. nam
?. =(1 (met 3 nam))
nam
=+ ^- zaz=(list ,[p=span ~])
(skim van |=([a=term ~] =(nam (end 3 1 a))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz
=+ tip=(end 3 1 nam)
2015-05-12 22:57:58 +03:00
=+ way=[(scot %p our) %home (scot %da lat) %arvo nam %hoon ~]
2015-05-11 20:53:47 +03:00
=+ fil=(,@ .^(%cx way))
:* %flog
/reload
[%veer ?:(=('z' tip) %$ tip) way (,@ .^(%cx way))]
==
::
++ poke-reset :: reset system
2015-05-12 03:31:37 +03:00
|= hood-reset =< abet
2015-05-11 20:53:47 +03:00
%- emil
=+ top=`path`/(scot %p our)/base/arvo/(scot %da lat)
:- [%flog /reset %vega (weld top `path`/hoon)]
%+ turn
^- (list ,[p=@tas q=@tas])
:~ [%$ %zuse]
[%a %ames]
[%c %clay]
[%d %dill]
[%e %eyre]
[%f %ford]
[%g %gall]
[%t %time]
==
|= [p=@tas q=@tas]
=+ way=`path`(welp top /[q])
=+ txt=((hard ,@) .^(%cx (welp way /hoon)))
[%flog /reset %veer p way txt]
::
++ poke-will :: hear certificate
|= wil=(unit will) =< abet
?> ?=(^ bur)
?> ?=(^ wil)
%- emil(bur ~)
:~ [%cash /helm p.u.bur q.u.bur u.wil]
[%plug /helm our %main (sein our) %main]
[%plug /helm our %arvo (sein our) %arvo]
[%plug /helm our %try (sein our) %try]
==
::
++ poke-verb
|= ~ =< abet
(emit %flog /helm %verb ~)
::
++ take-onto :: result of %conf
|= saw=(each suss tang) =< abet
%- emit
?- -.saw
%| [%flog ~ %crud %onto `tang`p.saw]
%& [%flog ~ %text "<{<p.saw>}>"]
==
--
--