shrub/pkg/arvo/sur/neo.hoon

1026 lines
21 KiB
Plaintext
Raw Normal View History

2024-01-28 06:20:35 +03:00
:: $neo: New Shrub
::
:: Urbit is a namespace, from a path -> data
:: /~hastuc-dibtux/chats/unit-731 :: this a chat
:: /~hastuc-dibtux/chats/unit-731/msg/~2024.1.27..10.30 :: this is a
:: message inside the chat
::
:: neo is a recipe for defining the kinds of data that live at these
:: paths. For instance, you would maybe like to define a chat
:: datatype, that could be bound into your namespace, so that your
:: friends could send you memes.
::
::
::
::
::
::
2024-01-19 02:07:28 +03:00
|%
2024-03-22 09:52:35 +03:00
+$ care
$? %x :: single node
%y :: single node and immediate children
%z :: single node and all descendants
==
+$ tour [=care =pith]
+$ block [get=(set tour) err=(unit tang)]
+$ curb @ud :: blocking request ID
+$ halt
$: by-tour=(map tour flow)
by-flow=(jug flow tour)
clog=(map flow (qeu move))
==
+$ flow (pair pith pith)
2024-03-26 21:09:37 +03:00
+$ disk
$@(~ [=ship =term])
+$ tack
?(%con %imp %pro)
+$ post (pair tack stud)
++ get-stud-name
|= =stud
?@ stud stud
mark.stud
2024-03-29 20:18:36 +03:00
++ drive
|%
++ en
=| res=pith
|= ps=(list pith)
?~ ps
res
$(res (welp res [%ud (lent i.ps)] i.ps), ps t.ps)
++ de
=| res=(list pith)
|= pax=(pole iota)
^+ res
?: =(~ pax)
(flop res)
=^ nex=pith pax
?> ?=([[%ud len=@] rest=*] pax)
`[pith (pole iota)]`[(scag [len rest]:pax) (slag [len rest]:pax)]
$(res [nex res])
--
2024-03-22 09:52:35 +03:00
::
2024-03-20 22:39:46 +03:00
++ ford
|%
2024-03-22 09:52:35 +03:00
++ dep `fief`[& %x %ford-in %ford-out]
++ get-output
|= [=bowl =term]
^- (unit vase)
=+ !<([vax=(unit vase) *] q.pail.q:(~(got by deps.bowl) term))
vax
2024-03-26 21:09:37 +03:00
::
2024-03-20 22:39:46 +03:00
++ run
|= txt=@t
2024-03-28 20:53:56 +03:00
(scan (trip txt) (rein *name))
2024-03-20 22:39:46 +03:00
+$ lib
2024-03-28 20:53:56 +03:00
[face=term =name]
2024-03-20 22:39:46 +03:00
+$ pro
[face=term =stud]
2024-03-26 21:09:37 +03:00
+$ vale
[face=term =stud]
2024-03-20 22:39:46 +03:00
+$ file
$: pro=(list pro)
2024-03-26 21:09:37 +03:00
:: grab=(list
2024-03-20 22:39:46 +03:00
lib=(list lib)
=hoon
==
++ rein
2024-03-28 20:53:56 +03:00
|= =name
2024-03-20 22:39:46 +03:00
=< apex
|%
++ nam
:: ^- $-(nail (like name:neo))
2024-03-28 20:53:56 +03:00
;~ pose
%+ sear
|= [kets=(list) pit=pith]
^- (unit ^name)
%- mole
|. ^- ^name
=. pit (scag (sub (lent pit) (lent kets)) pit)
name(pith (welp pith.name pit))
;~(pfix cen ;~(plug (star ket) stip)) :: relative
;~(plug ;~(pfix fas sig fed:ag) stip) :: absolute
==
2024-03-20 22:39:46 +03:00
++ std
;~ pose
;~(plug sym ;~(pfix col sig fed:ag) ;~(pfix fas sym))
sym
==
++ pro
:: ^- $-(nail (like ^pro))
%+ rune pat
;~ pose
2024-03-27 19:41:23 +03:00
;~(plug sym ;~(pfix tis std))
2024-03-20 22:39:46 +03:00
%+ cook
|= =stud
?@ stud [stud stud]
[mark.stud stud]
std
==
++ lib
:: ^- $-(nail (like ^lib))
2024-03-28 20:53:56 +03:00
%+ rune hep
2024-03-20 22:39:46 +03:00
;~ pose
2024-03-28 20:53:56 +03:00
;~(plug sym ;~(pfix tis nam))
%+ cook
|= n=^name
=/ last (rear pith.n)
?> ?=(@ last)
[last n]
nam
2024-03-20 22:39:46 +03:00
==
++ rune
|* [car=rule rul=rule]
(ifix [;~(plug fas car gap) gay] rul)
++ libs
:: ^- $-(nail (like (list ^lib)))
(star lib)
++ pros
:: ^- $-(nail (like (list ^pro)))
(star pro)
++ hone
:: ^- $-(nail (like hoon))
2024-03-28 20:53:56 +03:00
=+ vaz=(vang & (en-path:^name name))
2024-03-20 22:39:46 +03:00
(ifix [gay gay] tall:vaz)
++ apex
:: ^- rule
;~ plug
pros
libs
hone
==
--
++ with-face
|= [fac=@tas =vase]
vase(p [%face fac p.vase])
2024-03-26 21:09:37 +03:00
++ with-faces
|= [reef=vase faces=(list (pair term vase))]
?~ faces
reef
2024-03-27 19:41:23 +03:00
$(reef (slop (with-face i.faces) reef), faces t.faces)
2024-03-20 22:39:46 +03:00
--
2024-03-20 20:05:02 +03:00
++ behn
|%
+$ req $>(?(%rest %wait) task:^behn)
+$ res $>(%wake gift:^behn)
--
2024-03-29 20:18:36 +03:00
++ clay
|%
+$ peer [=care =desk =path]
+$ req
$% [%peer =pith =peer]
[%pull =pith]
==
+$ res (pair pith $>(?(%wris %writ) gift:^clay))
--
2024-03-20 17:49:42 +03:00
:: Total version
+$ ever [node=@ud tree=@ud]
:: $once: reference to version
+$ once $%([%node p=@ud] [%tree p=@ud])
:: $road: fully qualified path
+$ road [=name =once grab=pith]
:: +$ pike (each road name)
:: * A `$bolt` is a `[=stud =once]`
::
:: $tone: parent change tracking
+$ tone
$% [%dep =term =care =name]
[%sync =care]
==
:: $sound: change tracking listeners
2024-03-20 17:49:42 +03:00
+$ sound
$: voice=(jug pith [to=pith =term]) :: %x listeners
tones=(jug pith [to=pith =term]) :: %y listeners
noise=(jug pith [to=pith =term]) :: %z listeners
==
:: $ring: node change tracking
::
+$ ring
$% [%dep p=term =care q=name]
2024-03-20 17:49:42 +03:00
[%sync ~]
==
::
+$ out
$% [%sync p=tour]
[%stop p=tour]
2024-03-20 17:49:42 +03:00
==
2024-03-13 22:38:08 +03:00
++ pave
|= p=path
^- pith
%+ turn p
|= i=@ta
(fall (rush i spot:stip) [%ta i])
::
2024-03-20 17:49:42 +03:00
++ stip :: typed path parser
2024-03-13 22:38:08 +03:00
=< swot
|%
++ swot |=(n=nail `(like pith)`(;~(pfix fas (more fas spot)) n))
::
++ spot
%+ sear
|= a=*
^- (unit iota)
?+ a ~
@ ?:(((sane %tas) a) [~ `@tas`a] ~)
[@ @] ((soft iota) a)
==
%- stew
^. stet ^. limo
:~ :- 'a'^'z' sym
:- '$' (cold [%tas %$] buc)
:- '0'^'9' bisk:so
:- '-' tash:so
:- '.' zust:so
2024-03-27 19:41:23 +03:00
:- '~' ;~(pfix sig ;~(pose (stag %da (cook year when:so)) crub:so (easy [%n ~])))
2024-03-13 22:38:08 +03:00
:- '\'' (stag %t qut)
==
--
2024-03-22 09:52:35 +03:00
::
2024-03-09 01:37:44 +03:00
++ goon
|%
:: $date: date w/ TZ offset
+$ date [dat=@da off=@ud]
:: $size: size of a rect
+$ size [w=@ud h=@ud]
:: $hsrc: HTTP source (URL)
+$ hsrc @t
:: $dims: Spatial dimensions
+$ dims [ideal=size min=(unit size)]
:: $dimt: Temporal dimension
+$ dimt [len=@dr sta=@ud]
+$ scar
$? %patp
%patud
%cord
%patda
%date
%img
%video
%audio
==
+$ clot
$? [%patp p=@p]
[%patud p=@ud]
[%cord p=cord]
[%patda p=@da]
[%date =date]
[%img =hsrc =dims]
[%video =hsrc =dims =dimt]
[%audio =hsrc =dimt]
==
--
++ pike
=< pike
|%
++ card
$% [%peek =path]
[%grab items=(list item)]
==
++ sign
$% [%peek =cage]
[%grab items=(list clot:goon)]
==
+$ item
$: lede=cord
info=cord
err=(unit cord)
=scar:goon
==
+$ bowl
2024-03-18 20:18:31 +03:00
$: our=@p
wer=name
2024-03-09 01:37:44 +03:00
eny=@uvJ
now=@da
==
+$ input [=bowl syn=(unit sign)]
++ raw
|%
++ output
|* a=mold
$~ [%done *a]
$% [%emit =card]
[%cont self=(form a)]
[%fail err=(pair term tang)]
[%done value=a]
==
++ form |*(a=mold $-(input (output a)))
--
++ fail
|= err=(pair term tang)
|= input
[~ %fail err]
++ pikv
(pike vase)
++ pike
|* a=mold
|%
++ output (output:raw a)
++ form (form:raw a)
++ pure
|= arg=a
^- form
|= input
[%done arg]
++ bind
|* b=mold
|= [m-b=(form:raw b) fun=$-(b form)]
^- form
=* loop $
|= in=input
=/ b-res=(output:raw b)
(m-b in)
^- output
?- -.b-res
%emit [%emit card.b-res]
%cont [%cont loop(m-b self.b-res)]
%fail [%fail err.b-res]
%done [%cont (fun value.b-res)]
==
+$ eval-form
$: =form
==
::
:: Convert initial form to eval-form
::
++ from-form
|= =form
^- eval-form
form
::
:: The cases of results of +take
::
+$ eval-result
$% [%emit car=card]
[%fail err=(pair term tang)]
[%done value=a]
==
++ take
|= [=eval-form =input]
^- [=eval-result _eval-form]
=* take-loop $
:: =? car.input ?=(^ car.input)
=/ =output (form.eval-form input)
?- -.output
%emit [[%emit card.output] eval-form]
%fail [[%fail err.output] eval-form]
%done [[%done value.output] eval-form]
%cont
%_ take-loop
form.eval-form self.output
input [bowl.input ~]
==
==
--
--
2024-02-23 19:23:42 +03:00
:: $stud: mark name
+$ stud
$@ @tas :: auth=urbit
$: mark=@tas ::
2024-03-13 22:38:08 +03:00
[=ship =desk]
2024-02-23 19:23:42 +03:00
== ::
::
2024-02-19 23:56:04 +03:00
++ pith
|^ $+(pith ^pith)
++ en-tape
|= pit=$
(spud (pout pit))
2024-03-26 21:09:37 +03:00
++ en-cord
|= pit=$
(spat (pout pit))
2024-03-11 20:44:33 +03:00
++ prefix
=| res=$
|= [long=$ curt=$]
^- (unit _res)
?~ curt `(flop res)
?~ long ~
?. =(i.long i.curt)
~
$(long t.long, curt t.curt, res [i.long res])
++ suffix
|= [long=$ curt=$]
^- _curt
?~ curt
long
?~ long
~
$(curt t.curt, long t.long)
2024-02-19 23:56:04 +03:00
--
++ name
2024-03-18 20:18:31 +03:00
=< name
|%
+$ name [=ship =pith]
++ rule
:: ^- _|~(nail *(like name))
;~(plug ;~(pfix fas sig fed:ag) stip)
2024-02-19 23:56:04 +03:00
++ en-pith
2024-03-18 20:18:31 +03:00
|= nam=name
2024-02-19 23:56:04 +03:00
^- pith
[p/ship.nam pith.nam]
++ en-tape
2024-03-18 20:18:31 +03:00
|= nam=name
2024-02-19 23:56:04 +03:00
(spud (pout (en-pith nam)))
++ en-path
2024-03-18 20:18:31 +03:00
|= nam=name
2024-02-19 23:56:04 +03:00
(pout (en-pith nam))
2024-03-13 22:38:08 +03:00
++ de-pith |=(pith ~|(de-pith/+< (need (de-pith-soft +<))))
2024-02-19 23:56:04 +03:00
++ de-pith-soft
|= =pith
2024-03-18 20:18:31 +03:00
^- (unit name)
2024-02-19 23:56:04 +03:00
?. ?=([[%p @] *] pith)
~
`[+.i.pith t.pith]
--
2024-03-20 17:49:42 +03:00
++ axal
|$ [item]
[fil=(unit item) kid=(map iota $)]
++ axil
|$ [item]
[fil=(unit item) kid=(map pith item)]
2024-03-12 22:17:20 +03:00
++ of
2024-03-20 17:49:42 +03:00
=| fat=(axal)
|@
++ view
=| res=(map pith _?>(?=(^ fil.fat) u.fil.fat))
|= [=care pax=pith]
=. fat (dip pax)
=? res ?=(^ fil.fat)
(~(put by res) ~ u.fil.fat)
?- care
%x res
%y =.(fat snip (~(uni by res) tar))
%z (~(uni by res) tar)
==
::
++ anc-jab
|* [pax=pith fun=$-(* *)]
^+ fat
?~ pax
fat
=? fil.fat ?=(^ fil.fat)
`(fun u.fil.fat)
fat(kid (~(put by kid.fat) i.pax $(fat (~(got by kid.fat) i.pax), pax t.pax)))
::
++ anc
=| res=(list pith)
=| cur=pith
|= pax=pith
^- (set pith)
?~ pax
(~(gas in *(set pith)) res)
=? res ?=(^ fil.fat)
[cur res]
$(fat (~(got by kid.fat) i.pax), pax t.pax, cur (snoc cur i.pax))
++ parent
=| res=(unit pith)
=| cur=pith
|= pax=pith
|- ^+ res
?~ pax
res
=? res ?=(^ fil.fat)
`cur
=/ nex (~(get by kid.fat) i.pax)
?~ nex
res
$(fat u.nex, pax t.pax, cur (snoc cur i.pax))
++ snip
|- ^+ fat
=* loop $
%_ fat
kid
%- ~(run by kid.fat)
|= f=_fat
?^ fil.f
[`u.fil.f ~]
loop(fat f)
==
::
++ kid
|= pax=pith
^- (map pith _?>(?=(^ fil.fat) u.fil.fat))
=. fat (dip pax)
=. fat snip
2024-03-27 19:41:23 +03:00
=. fil.fat ~
tar
::
++ kids
|= pax=pith
^- (axil _?>(?=(^ fil.fat) u.fil.fat))
:- (get pax)
(kid pax)
::
2024-03-12 22:17:20 +03:00
++ del
|= pax=pith
^+ fat
?~ pax [~ kid.fat]
=/ kid (~(get by kid.fat) i.pax)
?~ kid fat
fat(kid (~(put by kid.fat) i.pax $(fat u.kid, pax t.pax)))
2024-03-20 17:49:42 +03:00
::
2024-03-12 22:17:20 +03:00
:: Descend to the axal at this path
::
++ dip
|= pax=pith
^+ fat
?~ pax fat
=/ kid (~(get by kid.fat) i.pax)
?~ kid [~ ~]
$(fat u.kid, pax t.pax)
::
++ gas
2024-03-20 17:49:42 +03:00
|* lit=(list (pair pith _?>(?=(^ fil.fat) u.fil.fat)))
2024-03-12 22:17:20 +03:00
^+ fat
?~ lit fat
$(fat (put p.i.lit q.i.lit), lit t.lit)
++ got
|= pax=pith
~| missing-room/pax
(need (get pax))
2024-03-20 17:49:42 +03:00
++ gut
|* [pax=pith dat=*]
=> .(dat `_?>(?=(^ fil.fat) u.fil.fat)`dat, pax `pith`pax)
^+ dat
(fall (get pax) dat)
2024-03-12 22:17:20 +03:00
::
++ get
|= pax=pith
fil:(dip pax)
:: Fetch file at longest existing prefix of the path
::
++ fit
|= pax=pith
^+ [pax fil.fat]
?~ pax [~ fil.fat]
=/ kid (~(get by kid.fat) i.pax)
?~ kid [pax fil.fat]
=/ low $(fat u.kid, pax t.pax)
?~ +.low
[pax fil.fat]
low
::
++ has
2024-03-13 22:38:08 +03:00
|= pax=pith
2024-03-12 22:17:20 +03:00
!=(~ (get pax))
:: Delete subtree
::
++ lop
2024-03-13 22:38:08 +03:00
|= pax=pith
2024-03-12 22:17:20 +03:00
^+ fat
?~ pax fat
|-
?~ t.pax fat(kid (~(del by kid.fat) i.pax))
=/ kid (~(get by kid.fat) i.pax)
?~ kid fat
fat(kid (~(put by kid.fat) i.pax $(fat u.kid, pax t.pax)))
::
++ put
2024-03-20 17:49:42 +03:00
|* [pax=pith dat=*]
=> .(dat `_?>(?=(^ fil.fat) u.fil.fat)`dat, pax `pith`pax)
2024-03-12 22:17:20 +03:00
|- ^+ fat
?~ pax fat(fil `dat)
=/ kid (~(gut by kid.fat) i.pax ^+(fat [~ ~]))
fat(kid (~(put by kid.fat) i.pax $(fat kid, pax t.pax)))
::
++ tap
=| pax=pith
=| out=(list (pair pith _?>(?=(^ fil.fat) u.fil.fat)))
|- ^+ out
=? out ?=(^ fil.fat) :_(out [pax u.fil.fat])
=/ kid ~(tap by kid.fat)
|- ^+ out
?~ kid out
%= $
kid t.kid
out ^$(pax (weld pax /[p.i.kid]), fat q.i.kid)
==
:: Serialize to map
::
++ tar
2024-03-20 17:49:42 +03:00
(~(gas by *(map pith _?>(?=(^ fil.fat) u.fil.fat))) tap)
2024-03-12 22:17:20 +03:00
--
+$ pate [[%p p=ship] q=pith]
++ petty-port
|* a=mold
^- port
[a a]
+$ dita (each iota aura)
+$ pish (list dita)
+$ conf (map term pith)
2024-03-20 20:05:02 +03:00
+$ card (pair pith note)
2024-02-19 23:56:04 +03:00
+$ request
[src=pith dest=pith val=*]
2024-03-22 09:52:35 +03:00
+$ ack (unit nack)
+$ nack
$% [%get p=(set pith)]
[%sec p=(set pith)]
[%err p=tang]
2024-02-23 19:23:42 +03:00
==
+$ update diff
2024-02-19 23:56:04 +03:00
+$ watch (list update)
::
+$ err
$% [%here =pith]
[%goof err=*]
[%fail err=*]
==
+$ response-status
$% [%done ~]
err
==
2024-03-18 20:18:31 +03:00
+$ page (pair stud *)
:: +$ cage (pair stud vase)
2024-02-19 23:56:04 +03:00
::
2024-03-28 20:53:56 +03:00
+$ made
[=code init=(unit vase) =conf]
2024-01-19 02:07:28 +03:00
+$ note
2024-03-28 20:53:56 +03:00
$% [%make made] :: todo: configuration values, init cannot be ^ if installing over
2024-03-22 09:52:35 +03:00
[%poke =pail]
2024-03-28 20:53:56 +03:00
[%tomb cas=(unit case)] :: tom
2024-03-27 19:41:23 +03:00
[%link from=pith src=stud] :: XX deprecate
2024-01-19 02:07:28 +03:00
==
2024-03-27 19:41:23 +03:00
+$ raw-poke
(pair flow vial)
2024-01-19 02:07:28 +03:00
+$ yard
$+ yard
$~ ~
2024-01-19 20:56:14 +03:00
(map iota hall)
2024-03-22 09:52:35 +03:00
+$ rely
[=term =stem]
2024-03-22 09:52:35 +03:00
+$ mode ?(%add %dif %del)
+$ stem
$~ [[0 0] %x %stud *vase]
%+ pair ever
$% [%x =pail]
[%y =pail kids=(map pith [=ever =mode =pail])]
[%z =pail kids=(map pith [=ever =mode =pail])]
==
+$ twig
2024-03-22 09:52:35 +03:00
$~ [[0 0] %x %stud ~]
%+ pair ever
$% [%x =vial]
[%y =vial kids=(map pith [=ever =mode =vial])]
[%z =vial kids=(map pith [=ever =mode =vial])]
2024-03-22 09:52:35 +03:00
==
++ bulb [=ever =pail]
++ wand
|^
$~ [%x [0 0] [%$ ~] ~]
$: =care
=ever
=vial
kids=(map pith [=ever =vial])
==
++ make
|= [=care at=pith ax=(axal room)]
^- ^$
=/ rot (need fil.ax)
:+ care ever.icon.rot
:- [state:q.span.rot q.state.icon.rot]
%- ~(gas by *(map pith [ever vial]))
=- %+ turn ~(tap by -)
|=([k=pith v=[ever vial]] [(welp at k) v])
?- care
%x ~
%y
=. ax ~(snip of ax)
(~(run by ~(tar of ax)) |=(r=room [ever.icon.r (to-vial:room r)]))
::
%z
(~(run by ~(tar of ax)) |=(r=room [ever.icon.r (to-vial:room r)]))
==
--
2024-03-26 21:09:37 +03:00
+$ pulp ?(%noun %json)
2024-03-22 09:52:35 +03:00
+$ cane
$~ [%x [0 0] [%$ *vase] ~]
$: =care
=ever
=pail
kids=(map pith [=ever =pail])
2024-03-22 09:52:35 +03:00
==
::
2024-03-26 21:09:37 +03:00
++ make-cane
|= [=care at=pith ax=(axal room)]
^- cane
=/ rot (need fil.ax)
:+ care ever.icon.rot
:- [state:q.span.rot state.icon.rot]
%- ~(gas by *(map pith [ever pail]))
=- %+ turn ~(tap by -)
|=([k=pith v=[ever pail]] [(welp at k) v])
?- care
%x ~
%y
=. ax ~(snip of ax)
(~(run by ~(tar of ax)) |=(r=room [ever.icon.r (to-pail:room r)]))
::
%z
(~(run by ~(tar of ax)) |=(r=room [ever.icon.r (to-pail:room r)]))
==
2024-03-29 20:18:36 +03:00
++ dejs
=, dejs:format
|%
++ stud
^- $-(json ^stud)
so
++ pail
|= fun=$-([stud json] vase)
|= jon=json
^- ^pail
?> ?=(^ jon)
?> ?=(%o -.jon)
=/ std (~(got by p.jon) %stud)
=/ dat (~(got by p.jon) %data)
?> ?=(%s -.std)
[`@tas`p.std (fun [p.std dat])]
--
2024-03-26 21:09:37 +03:00
++ enjs
=, enjs:format
|%
++ ever
|= eve=^ever
^- json
%- pairs
:~ node/(numb node.eve)
tree/(numb tree.eve)
==
::
++ cane
|= [can=^cane con=$-(pail json)]
^- json
=, enjs:format
%- pairs
:~ care/s/care.can
ever/(ever ever.can)
pail/(con pail.can)
:- %kids
%- pairs
%+ turn ~(tap by kids.can)
|= [pit=pith eve=^ever pal=pail]
^- [@t json]
:- (en-cord:pith pit)
%- pairs
:~ ever/(ever eve)
pail/(con pal)
==
==
--
2024-03-27 19:41:23 +03:00
++ en-html
|_ [basename=pith here=pith]
++ basetape |=(=care (en-tape:pith :(welp basename ~[care] here)))
++ ever
|= eve=^ever
^- manx
;dl.ever-neo
;dt: Node
;dd: {(a-co:co node.eve)}
::
;dt: Tree
;dd: {(a-co:co tree.eve)}
==
++ link
|= [=care pax=pith]
^- manx
=/ href=tape "{(welp (basetape care) (en-tape:pith pax))}.html"
;a(href href): As {<care>}
++ path
|= pax=pith
^- manx
;details
;summary: {(en-tape:pith pax)}
;ul
;li
;+ (link %x pax)
==
;li
;+ (link %y pax)
==
;li
;+ (link %z pax)
==
==
==
++ stud
|= std=^stud
^- tape
?@ std
(trip std)
"{(trip mark.std)}/{(scow %p ship.std)}/{(trip desk.std)}"
::
++ cane
|= [can=^cane con=$-(pail manx)]
^- manx
;dl.cane-neo
;dt: Care
;dd.care-neo: {(trip care.can)}
::
;dt: Ever
;dd
;+ (ever ever.can)
==
;dt: Type
;dd: {(stud p.pail.can)}
::
;dt: Value
;dd
;+ (con pail.can)
==
::
;dt: Children
;dd
;*
%+ turn ~(tap by kids.can)
|= [pit=pith eve=^ever pal=pail]
^- manx
;dl
;dt: Path
;dd
;+ (path pit)
==
::
;dt: Ever
;dd
;+ (ever eve)
==
::
;dt: Value
;dd
;+ (con pal)
==
==
==
==
++ lift-to-hymn
|= [pax=pith in=manx]
^- manx
;html
;head
;title: {(en-tape:pith pax)}
==
;body
;+ in
==
==
--
2024-03-26 21:09:37 +03:00
::
2024-03-22 09:52:35 +03:00
:: !!stud refers to imp/ different from $vial
+$ diff [=pith =ever dat=(unit vial)]
:: +$ mace [=pith =ever =diff]
2024-03-12 22:17:20 +03:00
::
2024-03-20 22:39:46 +03:00
++ sign
|^
$% [%poke status=response-status]
[%conf conf]
==
2024-03-20 22:39:46 +03:00
+$ conf
2024-03-22 09:52:35 +03:00
$% [%val ~]
[%pith ~ q=pith]
2024-03-20 22:39:46 +03:00
==
--
2024-03-22 09:52:35 +03:00
+$ pail (pair stud vase)
:: $ewer: deprecated
2024-03-18 20:18:31 +03:00
+$ ewer (pair stud vase)
+$ vial (pair stud *)
+$ move (pair pith card)
2024-03-18 20:18:31 +03:00
+$ code
2024-03-27 19:41:23 +03:00
$% [%clay p=path] :: XX: %clay is only for app/neo
[%stud p=stud] :: look in the imp directory for that name
2024-03-18 20:18:31 +03:00
==
+$ span (pair code firm)
2024-01-19 02:07:28 +03:00
+$ icon
2024-03-22 09:52:35 +03:00
$: =ever
state=vase
history=(list *)
migration=(list *)
==
2024-02-19 23:56:04 +03:00
:: subscription metadata
+$ jail
2024-02-23 19:23:42 +03:00
$+ jail
$~ ~
(map iota cell)
+$ cell
$+ cell
[case=@ud state=vase =span =jail]
+$ brig
2024-03-20 17:49:42 +03:00
$+ brig (axal cell)
2024-02-23 19:23:42 +03:00
+$ fleet
$+ fleet
$~ ~
(map ship brig)
2024-03-12 22:17:20 +03:00
+$ hall hall:room
2024-02-19 23:56:04 +03:00
:: $room: state of a shrub
::
:: TODO: refactor for networking?
2024-03-12 22:17:20 +03:00
++ room
=< room
|%
+$ hall
$% [%exit pith]
[%room room]
==
+$ room
$+ room
$~ [*span ~ *icon]
$: =span
=conf
=icon
==
++ to-vial
|= rom=room
^- vial
[state:q.span.rom q.state.icon.rom]
::
++ to-pail
|= rom=room
^- pail
[state:q.span.rom state.icon.rom]
::
2024-03-12 22:17:20 +03:00
++ de-hall-soft
|= hal=hall
^- (unit room)
?. ?=(%room -.hal)
~
`+.hal
++ de-hall
|= hal=hall
2024-03-21 01:47:15 +03:00
(need (de-hall-soft hal))
2024-03-12 22:17:20 +03:00
--
+$ bowl
2024-03-27 19:41:23 +03:00
$: src=name :: [=ship =pith]
our=@p :: our
2024-03-20 17:49:42 +03:00
were=pith :: XX: rename to here
2024-03-27 19:41:23 +03:00
here=pith ::
now=@da
2024-03-22 09:52:35 +03:00
deps=(map term (pair pith cane))
2024-03-27 19:41:23 +03:00
kids=(map pith vase) :: XX: vase -> pail
==
2024-03-20 20:05:02 +03:00
+$ quay
$% [%x =port]
[%y =dock]
2024-03-20 20:05:02 +03:00
[%z =dock]
==
+$ fief [required=? =quay]
+$ dock [=port =kids]
+$ port :: TODO: how to specify behaviour
2024-03-22 09:52:35 +03:00
[state=stud diff=stud] :: state, diff actually $stud
+$ deps (map term fief)
2024-01-19 23:52:55 +03:00
+$ kids (map pish port)
2024-01-28 06:20:35 +03:00
:: $firm: type of the value in the urbit namespace
::
+$ firm
$_ ^&
|%
2024-01-28 06:20:35 +03:00
:: $state: the state of this value in the urbit namespace
::
:: For instance, a message would be
:: ```hoon
:: [author=ship time-sent=time message=txt]
:: ```
::
:: ```
2024-03-22 09:52:35 +03:00
++ state *stud
2024-01-28 06:20:35 +03:00
:: $poke: a poke is a request to change a value in teh urbit
:: namespace.
::
:: For instance a blocked list that is a set of users would be
:: [%add who=user]
:: [%del who=user]
::
::
2024-03-22 09:52:35 +03:00
++ poke *(set stud)
++ form *^form
2024-01-28 06:20:35 +03:00
::
:: +kids: Some nodes in the namespace define what children are
:: allowed to be under them. For instance, it should not be allowed
:: to create /~hastuc-dibtux/chats/unit-731/blog-post-1. This is
:: nonsensical because blog posts don't go in chats.
2024-01-19 23:52:55 +03:00
++ kids *(map pish port)
2024-01-28 06:20:35 +03:00
::
:: +deps: Some nodes in the namespace might like to hear about other
:: things that happen in the namespace. For instance, a substack-type
:: software would like to know where the wallet software is located
:: in the name
++ deps *(map term fief)
--
2024-01-19 02:07:28 +03:00
+$ form
$_ ^|
|_ [=bowl =icon]
2024-03-22 09:52:35 +03:00
:: +reduce: apply %poke, producing state and IO
2024-01-28 06:20:35 +03:00
::
:: ('liam'' ~) [%add who='ruby'] -> ('liam' 'ruby')
:: ('liam' 'ruby' ~) [%del who='ruby'] -> ('liam')
2024-03-22 09:52:35 +03:00
++ poke
|~ [=stud val=vase]
*(quip card vase)
2024-01-19 02:07:28 +03:00
++ init
2024-02-19 23:56:04 +03:00
|~ old=(unit vase)
2024-03-22 09:52:35 +03:00
*(quip card vase)
2024-01-19 02:07:28 +03:00
--
--