2021-12-16 17:33:36 +03:00
|
|
|
:: autoprop: make pills & props when desk contents change
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
|
|
|
:: auto-build a new .urb/put/latest-solid.pill:
|
2021-12-16 19:23:04 +03:00
|
|
|
:: +latest-solid solid %kids %garden
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
|
|
|
:: stop auto-building latest-solid:
|
|
|
|
:: -latest-solid
|
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
:: auto-build a new .urb/put/somedesk.jam:
|
2021-12-16 19:23:04 +03:00
|
|
|
:: +some-desk desk %somedesk
|
2021-12-16 17:33:36 +03:00
|
|
|
::
|
|
|
|
:: see currently configured build tasks:
|
2021-10-29 02:09:04 +03:00
|
|
|
:: ?
|
|
|
|
::
|
2021-12-16 19:06:18 +03:00
|
|
|
:: run task right now:
|
|
|
|
:: !latest-solid
|
|
|
|
::
|
2021-10-29 02:09:04 +03:00
|
|
|
/+ libpill=pill, shoe, verb, dbug, default-agent
|
2021-12-16 17:33:36 +03:00
|
|
|
::
|
|
|
|
=, clay
|
|
|
|
::
|
2021-10-29 02:09:04 +03:00
|
|
|
|%
|
|
|
|
+$ state-0
|
|
|
|
$: %0
|
2021-12-16 19:00:45 +03:00
|
|
|
make=(map @ta [next=(unit @da) =task]) :: things to make
|
|
|
|
hear=(set desk) :: observed desks
|
2023-01-23 23:27:55 +03:00
|
|
|
sole=sole-id :: the way out
|
2021-12-16 17:33:36 +03:00
|
|
|
==
|
|
|
|
::
|
2023-01-23 23:27:55 +03:00
|
|
|
+$ sole-id sole-id:sole:shoe
|
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
+$ task
|
|
|
|
$% pill
|
|
|
|
prop
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ pill
|
|
|
|
$% [%ivory base=desk]
|
|
|
|
[%solid base=desk etc=(set desk)]
|
|
|
|
[%brass base=desk etc=(set desk)]
|
|
|
|
==
|
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
+$ prop
|
|
|
|
$% [%desk =desk]
|
|
|
|
==
|
|
|
|
::
|
2021-10-29 02:09:04 +03:00
|
|
|
+$ command
|
2021-12-16 17:33:36 +03:00
|
|
|
$% [%put name=@ta =task] :: configure pill build
|
2021-10-29 02:09:04 +03:00
|
|
|
[%del name=@ta] :: remove pill build
|
|
|
|
[%see ~] :: help & current config
|
2021-12-16 17:33:36 +03:00
|
|
|
[%run name=@ta] :: force build
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
+$ card card:shoe
|
2021-12-16 17:33:36 +03:00
|
|
|
::
|
|
|
|
++ delay ~d5
|
2021-10-29 02:09:04 +03:00
|
|
|
--
|
|
|
|
=| state-0
|
|
|
|
=* state -
|
|
|
|
::
|
|
|
|
%+ verb |
|
|
|
|
%- agent:dbug
|
|
|
|
^- agent:gall
|
|
|
|
%- (agent:shoe command)
|
|
|
|
^- (shoe:shoe command)
|
|
|
|
|_ =bowl:gall
|
|
|
|
+* this .
|
|
|
|
def ~(. (default-agent this %|) bowl)
|
|
|
|
des ~(. (default:shoe this command) bowl)
|
|
|
|
::
|
|
|
|
++ on-init
|
|
|
|
^- (quip card _this)
|
|
|
|
[~ this]
|
|
|
|
::
|
|
|
|
++ on-save !>(state)
|
|
|
|
++ on-load
|
|
|
|
|= old=vase
|
|
|
|
^- (quip card _this)
|
|
|
|
[~ this(state !<(state-0 old))]
|
|
|
|
::
|
|
|
|
++ command-parser
|
2023-01-23 23:27:55 +03:00
|
|
|
|= =sole-id
|
2021-10-29 02:09:04 +03:00
|
|
|
^+ |~(nail *(like [? command]))
|
|
|
|
%+ pick
|
|
|
|
(cold [%see ~] wut)
|
|
|
|
|^ ;~ pose
|
2021-12-16 19:23:04 +03:00
|
|
|
(stag %put ;~(plug (ifix [lus ace] sym) ;~(pose pil pro)))
|
2021-10-29 02:09:04 +03:00
|
|
|
;~(plug (cold %del hep) sym)
|
2021-12-16 17:33:36 +03:00
|
|
|
;~(plug (cold %run zap) sym)
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ pil
|
|
|
|
;~ pose
|
|
|
|
;~(plug (perk %ivory ~) ;~(pfix ace des))
|
|
|
|
;~(plug (perk %solid ~) ;~(pfix ace dez))
|
|
|
|
;~(plug (perk %brass ~) ;~(pfix ace dez))
|
|
|
|
==
|
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
++ pro
|
|
|
|
;~(plug (perk %desk ~) ;~(pfix ace des))
|
|
|
|
::
|
2021-10-29 02:09:04 +03:00
|
|
|
++ des
|
|
|
|
;~(pfix cen sym)
|
|
|
|
::
|
|
|
|
++ dez
|
|
|
|
;~ plug
|
|
|
|
des
|
|
|
|
;~ pose
|
|
|
|
;~(pfix ace (cook ~(gas in *(set desk)) (more ace des)))
|
|
|
|
(easy ~)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ on-command
|
2023-01-23 23:27:55 +03:00
|
|
|
|= [=sole-id =command]
|
2021-10-29 02:09:04 +03:00
|
|
|
^- (quip card _this)
|
|
|
|
?- -.command
|
|
|
|
%put
|
2021-12-16 17:33:36 +03:00
|
|
|
=* task task.command
|
2021-12-16 18:43:00 +03:00
|
|
|
=/ targ=(set desk)
|
2021-12-16 17:33:36 +03:00
|
|
|
?- -.task
|
|
|
|
%ivory [base.task ~ ~]
|
|
|
|
?(%solid %brass) (~(put in etc.task) base.task)
|
|
|
|
%desk [desk.task ~ ~]
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
2021-12-16 18:43:00 +03:00
|
|
|
=/ news (~(dif in targ) hear)
|
|
|
|
=. hear (~(uni in hear) targ)
|
2021-12-16 19:00:45 +03:00
|
|
|
=. make (~(put by make) name.command `now.bowl task.command)
|
2021-10-29 02:09:04 +03:00
|
|
|
:_ this
|
2021-12-16 18:43:00 +03:00
|
|
|
%+ turn ~(tap in news)
|
2021-10-29 02:09:04 +03:00
|
|
|
|= =desk
|
|
|
|
:+ %pass /desk/[desk]
|
|
|
|
[%arvo %c %warp our.bowl desk `[%next %z da+now.bowl /]]
|
|
|
|
::
|
|
|
|
%del
|
|
|
|
::NOTE deletion from hear, if necessary, handled in +on-arvo
|
|
|
|
[~ this(make (~(del by make) name.command))]
|
|
|
|
::
|
|
|
|
%see
|
|
|
|
:_ this
|
|
|
|
^- (list card)
|
|
|
|
=- [%shoe [sole-id]~ %sole %mor -]~
|
|
|
|
^- (list sole-effect:shoe)
|
2021-12-16 19:23:04 +03:00
|
|
|
:- [%txt "to add: +task-name type %args"]
|
|
|
|
:- [%txt " where type is one of: solid, brass, ivory, desk"]
|
2021-12-16 19:06:18 +03:00
|
|
|
:- [%txt "to del: -task-name"]
|
|
|
|
:- [%txt "to run: !task-name"]
|
2021-10-29 02:09:04 +03:00
|
|
|
?: =(~ make)
|
|
|
|
[%txt "no builds configured"]~
|
|
|
|
:- [%txt "--"]
|
|
|
|
:- [%txt "builds:"]
|
|
|
|
%+ turn ~(tap by make)
|
2021-12-16 19:00:45 +03:00
|
|
|
|= [name=@ta next=(unit @da) =task]
|
2021-10-29 02:09:04 +03:00
|
|
|
:- %txt
|
|
|
|
%- trip
|
|
|
|
%+ rap 3
|
2021-12-16 19:00:45 +03:00
|
|
|
:* name ' ('
|
|
|
|
?~(next 'up to date' (scot %da u.next))
|
|
|
|
') : +' -.task ' %'
|
|
|
|
::
|
|
|
|
?- -.task
|
|
|
|
%ivory [base.task ~]
|
2021-12-16 19:23:04 +03:00
|
|
|
?(%solid %brass) :- base.task
|
|
|
|
?: =(~ etc.task) ~
|
|
|
|
[' %' (join ' %' ~(tap in etc.task))]
|
2021-12-16 19:00:45 +03:00
|
|
|
%desk [desk.task ~]
|
|
|
|
== ==
|
2021-12-16 17:33:36 +03:00
|
|
|
::
|
|
|
|
%run
|
|
|
|
=* name name.command
|
|
|
|
=+ (~(got by make) name)
|
2021-12-16 19:00:45 +03:00
|
|
|
:_ =- this(make (~(jab by make) name -))
|
|
|
|
|=([next=(unit @da) =^task] [~ task])
|
2021-12-16 17:33:36 +03:00
|
|
|
::TODO just poke hood instead?
|
|
|
|
=; sag=sole-effect:shoe
|
2021-12-16 19:23:04 +03:00
|
|
|
:_ ~
|
|
|
|
:+ %shoe [sole]~
|
|
|
|
:+ %sole %mor
|
|
|
|
:~ [%txt "{(trip dap.bowl)} built {(trip name)}"]
|
|
|
|
sag
|
|
|
|
==
|
2021-12-16 17:33:36 +03:00
|
|
|
|^ =* base base.task
|
|
|
|
:+ %sag
|
|
|
|
?- -.task
|
2021-12-16 19:23:04 +03:00
|
|
|
?(%solid %brass %ivory) /[dap.bowl]/[name]/pill
|
|
|
|
%desk /[dap.bowl]/[name]/jam
|
2021-12-16 17:33:36 +03:00
|
|
|
==
|
|
|
|
?- -.task
|
|
|
|
%ivory (ivory:libpill (sys base))
|
|
|
|
::
|
|
|
|
?(%solid %brass)
|
|
|
|
=/ dez=(list [desk path])
|
|
|
|
%+ turn ~(tap in etc.task)
|
|
|
|
|=(d=desk [d (bek d)])
|
|
|
|
?- -.task
|
2021-12-16 18:43:00 +03:00
|
|
|
%solid (solid:libpill (sys base) dez | now.bowl &)
|
|
|
|
%brass (brass:libpill (sys base) dez &)
|
2021-12-16 17:33:36 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
%desk
|
|
|
|
=* desk desk.task
|
2021-12-16 18:43:00 +03:00
|
|
|
(install:events:libpill desk (byk desk) &)
|
2021-12-16 17:33:36 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ sys
|
|
|
|
|= d=desk
|
|
|
|
`path`(snoc (bek d) %sys)
|
|
|
|
::
|
|
|
|
++ byk
|
|
|
|
|= d=desk
|
|
|
|
`beak`[our.bowl d da+now.bowl]
|
|
|
|
::
|
|
|
|
++ bek
|
|
|
|
|= d=desk
|
|
|
|
`path`(en-beam (byk d) /)
|
|
|
|
--
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ on-arvo
|
|
|
|
|= [=wire sign=sign-arvo]
|
|
|
|
^- (quip card _this)
|
2021-12-16 17:33:36 +03:00
|
|
|
?: ?=([%build ~] wire)
|
2021-12-16 19:33:48 +03:00
|
|
|
:: on-wake, build all tasks whose time has come
|
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
?> ?=(%wake +<.sign)
|
|
|
|
=/ tasks=(list @ta)
|
|
|
|
%+ murn ~(tap by make)
|
2021-12-16 19:00:45 +03:00
|
|
|
|= [name=@ta next=(unit @da) task]
|
|
|
|
?~ next ~
|
|
|
|
?:((lte u.next now.bowl) (some name) ~)
|
2021-12-16 19:33:48 +03:00
|
|
|
?^ error.sign
|
|
|
|
((slog 'on-wake build failed' >tasks< u.error.sign) ~ this)
|
2021-12-16 17:33:36 +03:00
|
|
|
::
|
|
|
|
=| cards=(list card)
|
|
|
|
|-
|
|
|
|
?~ tasks [cards this]
|
|
|
|
=^ caz this (on-command sole %run i.tasks)
|
|
|
|
$(tasks t.tasks, cards (weld cards caz))
|
|
|
|
::
|
2021-10-29 02:09:04 +03:00
|
|
|
?> ?=([%desk @ ~] wire)
|
|
|
|
=* desk i.t.wire
|
|
|
|
?. ?=(%writ +<.sign)
|
|
|
|
~& [dap.bowl %unexpected-sign +<.sign]
|
|
|
|
[~ this]
|
2021-12-16 19:33:48 +03:00
|
|
|
:: on-writ, bump build timers for all affected tasks
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
=/ tasks=(list @ta)
|
|
|
|
%+ murn ~(tap by make)
|
2021-12-16 19:00:45 +03:00
|
|
|
|= [name=@ta (unit @da) =task]
|
2021-12-16 17:33:36 +03:00
|
|
|
=- ?:(- (some name) ~)
|
|
|
|
?- -.task
|
|
|
|
%ivory =(desk base.task)
|
|
|
|
?(%solid %brass) |(=(desk base.task) (~(has in etc.task) desk))
|
|
|
|
%desk =(desk desk.task)
|
2021-10-29 02:09:04 +03:00
|
|
|
==
|
2021-12-16 17:33:36 +03:00
|
|
|
?: =(~ tasks)
|
2021-12-16 18:43:00 +03:00
|
|
|
[~ this(hear (~(del in hear) desk))]
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
=/ next=@da (add now.bowl delay)
|
|
|
|
:_ :: delay next build for affected tasks
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
2021-12-16 17:33:36 +03:00
|
|
|
|- ?~ tasks this
|
|
|
|
=. make
|
|
|
|
%+ ~(jab by make) i.tasks
|
2021-12-16 19:00:45 +03:00
|
|
|
|=([(unit @da) =task] [`next task])
|
2021-12-16 17:33:36 +03:00
|
|
|
$(tasks t.tasks)
|
|
|
|
:~ :: watch for the next change on this desk
|
|
|
|
::
|
|
|
|
:+ %pass /desk/[desk]
|
|
|
|
[%arvo %c %warp our.bowl desk `[%next %z da+now.bowl /]]
|
|
|
|
::
|
|
|
|
:: set a timer for building affected tasks
|
|
|
|
::
|
|
|
|
[%pass /build %arvo %b %wait next]
|
|
|
|
==
|
2021-10-29 02:09:04 +03:00
|
|
|
::
|
|
|
|
++ on-connect
|
2023-01-23 23:27:55 +03:00
|
|
|
|= =sole-id
|
2021-10-29 02:09:04 +03:00
|
|
|
^- (quip card _this)
|
2021-12-16 17:33:36 +03:00
|
|
|
::TODO actually should just poke drum to write
|
2021-10-29 02:09:04 +03:00
|
|
|
[~ this(sole sole-id)]
|
|
|
|
::
|
|
|
|
++ can-connect |=(* =(src our):bowl)
|
|
|
|
++ on-disconnect on-disconnect:des
|
|
|
|
++ tab-list tab-list:des
|
|
|
|
::
|
|
|
|
++ on-poke on-poke:def
|
|
|
|
++ on-watch on-watch:def
|
|
|
|
++ on-leave on-leave:def
|
|
|
|
++ on-peek on-peek:def
|
|
|
|
++ on-agent on-agent:def
|
|
|
|
++ on-fail on-fail:def
|
2021-10-29 02:22:28 +03:00
|
|
|
--
|