urbit/main/app/helm/core.hook

175 lines
6.9 KiB
Plaintext
Raw Normal View History

2015-02-24 21:57:47 +03:00
:: :: ::
:::: /hook/core/helm/app :: ::
:: :: ::
/? 314 :: zuse version
/- *console :: structures
/+ console :: libraries
:: :: ::
:::: :: ::
!: :: ::
=> |% :: principal structures
++ helm-house :: all state
$: %0 :: state version
bur=(unit (pair ship mace)) :: requesting ticket
2015-02-24 21:57:47 +03:00
hoc=(map bone helm-session) :: consoles
== ::
++ helm-session ::
$: say=console-share ::
2015-02-25 19:57:43 +03:00
mud=(unit (console-dialog ,@ud)) ::
2015-02-24 21:57:47 +03:00
== ::
2015-03-12 19:35:06 +03:00
++ funk (pair ,@ ,@) ::
++ begs ,[his=@p tic=@p eny=@t ges=gens] :: begin data
2015-02-24 21:57:47 +03:00
++ helm-wish ::
2015-03-12 19:35:06 +03:00
$| $? %reset :: reset kernel
2015-02-24 21:57:47 +03:00
%verb :: verbose mode
== ::
$% [%reload p=(list term)] :: reload vanes
== ::
2015-03-12 19:35:06 +03:00
++ dill-flog :: sent to %dill
$% [%veer p=@ta q=path r=@t] :: install vane
[%vega p=path] :: reboot by path
[%verb ~] :: verbose mode
== ::
2015-02-24 21:57:47 +03:00
:: ::
++ gift :: out result <-$
$% [%mean p=ares] :: error
[%nice ~] :: acknowledge
[%rush %console-effect console-effect] :: effect
== ::
++ hapt ,[p=ship q=path] ::
++ move ,[p=bone q=(mold note gift)] ::
++ note-gall :: note to %gall
$% [%mess p=[p=ship q=path] q=ship r=cage] ::
[%show p=[p=ship q=path] q=ship r=path] ::
[%took p=[p=ship q=path] q=ship] ::
== ::
++ note-dill :: system command
2015-03-12 19:35:06 +03:00
$% [%flog p=dill-flog] ::
2015-02-24 21:57:47 +03:00
== ::
++ note :: out request $->
$% [%d note-dill] ::
[%g note-gall] ::
== ::
-- ::
:: ::
:::: ::
:: ::
|_ $: hid=hide :: system state
helm-house :: program state
== ::
++ he :: per session
|_ [[ost=bone moz=(list move)] helm-session] ::
++ he-abet :: resolve
[(flop moz) %_(+> hoc (~(put by hoc) ost +<+))] ::
:: ::
++ he-give :: emit gift
|= git=gift
%_(+> moz [[ost %give git] moz])
::
++ he-wish-reset
^+ .
2015-02-25 01:53:31 +03:00
=- %_(+ moz (weld zum moz))
^= zum ^- (list move)
2015-02-24 21:57:47 +03:00
=+ top=`path`/(scot %p our.hid)/arvo/(scot %da lat.hid)
2015-03-12 19:35:06 +03:00
:- [ost %pass /reset %d %flog %vega (weld top `path`/hoon)]
2015-02-24 21:57:47 +03:00
%+ 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]
=+ pax=`path`(welp top /[q])
=+ txt=((hard ,@) .^(%cx (welp pax /hoon)))
2015-03-12 19:35:06 +03:00
[ost %pass /reset %d %flog %veer p pax txt]
::
++ he-wish-reload
|= all=(list term)
%_ +>.$
moz
%- weld
:_ moz
%+ turn all
=+ ark=(arch .^(%cy /(scot %p our.hid)/arvo/(scot %da lat.hid)))
=+ 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)
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
:* ost
%pass
/reload
%d
%flog
[%veer ?:(=('z' tip) %$ tip) pax (,@ .^(%cx pax))]
==
==
2015-02-24 21:57:47 +03:00
::
++ he-wish-verb
%_ .
moz
:_ moz
2015-03-12 19:35:06 +03:00
[ost %pass /verb %d %flog %verb ~]
2015-02-24 21:57:47 +03:00
==
--
::
2015-03-12 19:35:06 +03:00
++ hake :: poke core
|= [ost=bone her=ship]
2015-02-24 21:57:47 +03:00
?> =(her our.hid)
2015-03-12 19:35:06 +03:00
~(. he [ost [ost %give %nice ~]~] (fall (~(get by hoc) ost) *helm-session))
::
++ poke-helm-reset
|= [ost=bone her=ship ~]
~& %poke-helm-reset
he-abet:he-wish-reset:(hake ost her)
2015-02-24 21:57:47 +03:00
::
2015-03-19 01:01:47 +03:00
++ poke-helm-verb
|= [ost=bone her=ship ~]
~& %poke-helm-verb
he-abet:he-wish-verb:(hake ost her)
::
2015-03-12 19:35:06 +03:00
++ poke-helm-reload
|= [ost=bone her=ship all=(list term)]
~& %poke-helm-reload
he-abet:(he-wish-reload:(hake ost her) all)
::
++ poke-helm-begin
|= [ost=bone you=ship begs]
~& %poke-helm-begin
?> ?=(~ bur)
=+ buz=(shax :(mix (jam ges) eny))
=+ loy=(bruw 2.048 buz)
:_ +>.$(bur `[his [0 sec:ex:loy]~])
:~ :* ost %pass /ticketing %a %want [our.hid (sein his)] /q/ta
his tic ges pub:ex:loy
==
[ost %give %nice ~]
==
::
++ poke-will
|= [ost=bone you=ship wil=(unit will)]
~& %poke-helm-will
?> ?=(^ bur)
:_ +>.$(bur ~)
?~ wil
[ost %give %mean ~ %rejected ~]~
2015-03-19 01:01:47 +03:00
~& [%poke-will-good bur]
:~ [ost %pass / %a %cash p.u.bur q.u.bur u.wil]
[ost %pass / %c %plug our.hid %main (sein our.hid) %main]
[ost %pass / %c %plug our.hid %arvo (sein our.hid) %arvo]
[ost %pass / %c %plug our.hid %try (sein our.hid) %try]
[ost %give %nice ~]
==
2015-02-24 21:57:47 +03:00
--