Merge branch 'test' of github.com:urbit/urbit into test

This commit is contained in:
Galen Wolfe-Pauly 2015-01-27 09:01:07 -08:00
commit 73bbefdb6f
92 changed files with 18966 additions and 1565 deletions

View File

@ -322,7 +322,7 @@
0w2g.gLmg4.MtrHQ.A5VmH.WPk6G :: 150, ~ryg, Dan Haffey (fortuna)
0w0 :: 151, ~ryx, Tlon (gleba)
0w0 :: 152, ~fep, Tlon (gleba)
0w3q.4RDyP.CTcbc.ZX4Hj.BH6Hu :: 153, ~tyr, ~hobmed-hinrym (fidelis)
0w2j.T1u2s.BfXjV.ldOGR.aiZrQ :: 153, ~tyr, ~hobmed-hinrym (fidelis)
0w0 :: 154, ~tus, Tlon (gleba)
0w0 :: 155, ~tyc, Tlon (gleba)
0w0 :: 156, ~leg, Tlon (gleba)
@ -440,7 +440,7 @@
vix=(bex +((cut 0 [25 2] mag))) :: width of sender
tay=(cut 0 [27 5] mag) :: message type
==
?> =(4 vez)
?> =(0 vez)
?> =(chk (end 0 20 (mug bod)))
:+ [(end 3 wix bod) (cut 3 [wix vix] bod)]
(kins tay)
@ -460,7 +460,7 @@
=+ tay=(ksin q.kec)
%+ mix
%+ can 0
:~ [3 4]
:~ [3 0]
[20 (mug bod)]
[2 yax]
[2 qax]
@ -546,11 +546,6 @@
?~ dyv ~
[~ u.dyv ..kuch]
::
++ trox :: trox:lax:as:go
|= [now=@da] :: expire by date
^+ +>
+> :: XX
::
++ wasc :: wasc:lax:as:go
|= key=code :: hear foreign code
^+ +>
@ -1048,7 +1043,7 @@
++ gnaw :: gnaw:am
|= [kay=cape ryn=lane pac=rock] :: process packet
^- [p=(list boon) q=fort]
?. =(4 (end 0 3 pac)) [~ fox]
?. =(0 (end 0 3 pac)) [~ fox]
=+ kec=(bite pac)
?: (goop p.p.kec) [~ fox]
?. (~(has by urb.ton.fox) q.p.kec)
@ -1096,7 +1091,8 @@
++ rack :: rack:am
|= [soq=sock cha=path cop=coop] :: e2e ack
=+ oh=(ho:(um p.soq) q.soq)
=. oh (cook:oh cop cha ~)
=^ gud oh (cook:oh cop cha ~)
?. gud oh
(cans:oh cha)
::
++ wake :: wake:am
@ -1170,11 +1166,14 @@
::
++ cook :: cook:ho:um:am
|= [cop=coop cha=path ram=(unit ,[ryn=lane dam=flap])]
^+ +> :: acknowledgment
^- [gud=? con=_+>] :: acknowledgment
:: ~& [%cook cop num cha ram]
=+ rum=(need (~(get by raz.bah) cha))
=+ lat=(~(get by mis.rum) did.rum)
?: &(?=(~ lat) ?=(~ ram)) ~&(%ack-late-or-redundant +>.$)
?: &(?=(~ lat) ?=(~ ram))
~& %ack-late-or-redundant
[%| +>.$]
:- %&
=+ ^- [ryn=lane dam=flap]
?^ ram [ryn.u.ram dam.u.ram]
?< ?=(~ lat)
@ -1322,7 +1321,7 @@
+>
?. (gte num did.rum) :: always ack a dup
:: ~& [%deer-1 num]
(cook (~(get by bum.rum) num) cha ~ ryn dam)
con:(cook (~(get by bum.rum) num) cha ~ ryn dam)
?: dod.rum
:: ~& [%deer-2 num]
(coat cha rum(mis (~(put by mis.rum) num [kay ryn dam dut])))
@ -1701,19 +1700,20 @@
?> ?=([@ @ *] t.q.q.bon)
:_ fox
=+ [cak=i.t.q.q.bon ven=i.t.t.q.q.bon]
:~ =+ neh=(claw p.p.bon)
?> ?=(^ neh)
=+ ton=[%waft p.bon r.bon]
:: ~& [%milk-waft [[ven `path`t.t.t.q.q.bon] t.neh]]
:- ?: =(%c ven)
?> =(%re cak)
[[%c `path`t.t.t.q.q.bon] hen]
?: =(%e ven)
?> |(=(%pr cak) =(%pc cak))
[[%e `path`t.t.t.q.q.bon] hen]
[[ven `path`t.t.t.q.q.bon] t.neh]
[%sick ton]
==
:_ ~
=+ neh=(claw p.p.bon)
?> ?=(^ neh)
?: ?=(%e ven)
?> |(=(%pr cak) =(%pc cak))
:_ [%sick %wart p.bon cak `path`t.t.t.q.q.bon r.bon]
[[%e `path`t.t.t.q.q.bon] hen]
=+ ton=[%waft p.bon r.bon]
:: ~& [%milk-waft [[ven `path`t.t.t.q.q.bon] t.neh]]
:_ [%sick ton]
?: =(%c ven)
?> =(%re cak)
[[%c `path`t.t.t.q.q.bon] hen]
[[ven `path`t.t.t.q.q.bon] t.neh]
?> ?=(%q i.q.q.bon)
?> ?=([@ *] t.q.q.bon)
?+ i.t.q.q.bon
@ -1755,7 +1755,7 @@
%+ turn paz
|= him=ship
:- hen
[%pass /ye %g %mess [him ye/~] p.p.bon [%txt !>(;;(,@t r.bon))]]
[%pass /ye %g %mess [him ye/~] p.p.bon [%txt !>(((hard ,@t) r.bon))]]
==
::
%mulk
@ -1768,6 +1768,7 @@
:~ :- (claw p.p.bon)
[%sick %wart p.bon i.t.q.q.bon t.t.q.q.bon r.bon]
==
::
%ge :: %gall request
=* imp t.t.q.q.bon
?> (levy imp (sane %ta))
@ -1776,6 +1777,7 @@
(scot %p q.p.bon)
q.q.bon
:_ fox [hen %pass pax %g %rote p.bon imp r.bon]~
::
%gh :: %gall response
=* imp t.t.q.q.bon
?> (levy imp (sane %ta))

View File

@ -407,7 +407,7 @@
=+ ^= lum
^- (unit (unit mizu))
%^ ~(construct-merge ze now dom ran)
?:(=(0 let.dom) %init %mate)
?:(=(0 let.dom) %init %meld)
who
:+ syd
`saba`[her sud [0 let.der] der]
@ -677,14 +677,16 @@
=+ got=(~(has by fat.ruf) his)
=+ luk=?.(?=(%$ -.lot) ~ ((soft case) p.lot))
?~ luk [~ ~]
=+ une=(un his now ruf)
?: =(%$ ren)
[~ ~]
=+ run=((soft care) ren)
?~ run [~ ~]
%+ bind
%. [u.run u.luk tyl]
aver:?.(got (do now [his his] syd ruf) (di:une syd))
=< aver
?: got
(di:(un his now ruf) syd)
(do now [his his] syd ruf)
|=(a=(unit) (bind a |=(b=* [%noun b])))
::
++ stay [%0 ruf]

View File

@ -43,23 +43,15 @@
$: %c ::
$% [%warp p=sock q=riff] ::
== == ::
::S $% $: %b :: to %batz
::S $% [%hail ~] ::
::S [%harm ~] ::
::S [%hook ~] ::
::S [%kill p=~] ::
::S [%line p=@t] ::
::S [%ling ~] ::
::S [%make p=(unit ,@t) q=@ud r=@ s=?] ::
::S [%sith p=@p q=@uw r=?] ::
::S == == ::
$: %d ::
$% [%crud p=@tas q=(list tank)] ::
[%text p=tape] ::
== == ::
$: %g ::
$% [%mess p=[p=ship q=path] q=ship r=mess] ::
[%nuke p=[p=ship q=path] q=ship] ::
[%show p=[p=ship q=path] q=ship r=path] ::
[%took p=[p=ship q=path] q=ship] ::
== == ::
$: %t ::
$% [%wait p=@da] ::
@ -67,20 +59,6 @@
++ riff ,[p=desk q=(unit rave)] :: see %clay
++ sign :: in result $<-
$?
::S $: %b :: by %batz
::S $% [%hail ~] ::
::S [%helo p=path q=prod] ::
::S [%logo p=@] ::
::S [%save p=path q=@] ::
::S [%sage p=path q=*] ::
::S [%talk p=tank] ::
::S [%tell p=(list ,@t)] ::
::S [%text p=tape] ::
::S [%verb ~] ::
::S [%veer p=@ta q=path r=@t] ::
::S [%vega p=path] ::
::S [%warn p=tape] ::
::S == == ::
$: %c ::
$% [%writ p=riot] ::
== == ::
@ -88,21 +66,18 @@
$% [%logo p=@] ::
[%mean p=ares] ::
[%nice ~] ::
$: %rush :: XX
$: %rush ::
$% [%term-line q=term-line] ::
[%hymn q=manx] ::
[%json q=json] ::
== == ::
$: %rust ::
$% [%term-line q=term-line] ::
[%hymn q=manx] ::
[%json q=json] ::
== == ::
[%verb ~] ::
[%sage p=path q=*] ::
[%veer p=@ta q=path r=@t] ::
[%vega p=path] ::
== == ::
$: %t ::
$% [%wake ~] ::
== ==
$: @tas :: by any
$% [%crud p=@tas q=(list tank)] ::
[%init p=@p] ::
@ -111,12 +86,13 @@
++ term-in ::
$: pax=path ::
$= jof ::
$% [%line p=span] ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::
== == ::
++ term-line ,[p=[p=cord q=prom r=cord] q=(list cord) r=(list tark)]
++ tark ?(tank [%stem p=tank q=tank]) ::
++ tark ?(tank [%stem p=@da q=tank r=tank]) ::
:::::::: :: dill tiles
++ bein :: terminal control
$: $: bul=@ud :: buffer length
@ -170,6 +146,13 @@
%right ::
== ::
++ yard :: terminal state
$: p=? :: verbose
q=blur :: display state
r=(map path hist) :: history
s=[p=? q=@da] :: typing?/last typed
== ::
:: XX LEGACY 12-16-2014
++ yord :: old terminal state
$: p=? :: verbose
q=blur :: display state
r=(map path hist) :: history
@ -177,12 +160,12 @@
-- =>
|%
++ dy
|= [hen=duct our=ship def=(unit duct) dug=(map duct yard)]
|= [hen=duct our=ship now=@da def=(unit duct) dug=(map duct yard)]
=+ ^= yar ^- yard
=+ yur=(~(get by dug) hen)
?^ yur u.yur
?^ def (~(got by dug) u.def)
[& [80 ~ *blot] ~]
[& [80 ~ *blot] ~ | *@da]
=| mos=(list move)
|%
++ beep (curb [[%bel ~] ~]) :: send beep
@ -330,58 +313,35 @@
?~ q.+.sih +>.^$
(fume:$(q.+.sih t.q.+.sih) '!' `tank`i.q.+.sih)
::
::S %helo :: trigger prompt
::S %- edit
::S =| bed=bein
::S =+ ^= hyt ^- hist
::S =+ hyt=(~(get by r.yar) p.+.sih)
::S ?~(hyt *hist u.hyt)
::S ?: &(?=(^ q.q.yar) =(p.+.sih hux.u.q.q.yar))
::S %= u.q.q.yar
::S hyt [+(p.hyt) [%$ q.hyt]]
::S pot q.q.+.sih
::S pol (lent q.q.+.sih)
::S buy p.q.+.sih
::S ==
::S =+ zon=(tuba r.q.+.sih)
::S =+ zow=(lent zon)
::S %= bed
::S bul zow
::S bus zow
::S but zon
::S buy p.q.+.sih
::S hux p.+.sih
::S hiz 0
::S hyt [+(p.hyt) [%$ q.hyt]]
::S pot q.q.+.sih
::S pol (lent q.q.+.sih)
::S ==
::S ::
::S ?(%hail %make %sith)
::S +>.$(mos :_(mos [hen %pass ~ %b +.sih]))
::S ::
%mean ~& %dill-mean +>.$
%nice +>.$
%note ?.(p.yar +>.$ (fume p.+.sih q.+.sih)) :: debug message
?(%rush %rust) :: XX reset prompt
=. mos :_(mos [hen %pass tea %g %took [our /terminal] our])
?> ?=(%term-line +>-.sih)
=. +>.$
=- (furl (zing (turn (flop r.q.sih) -)))
=+ lis=(scag 1.000 r.q.sih)
=- (furl (zing (turn (flop lis) -)))
|= a=tark
^- wall
?+ -.a (~(win re a) 0 p.q.yar)
%stem ~[~(ram re p.a) ~(ram re p.a)]
?+ -.a (~(win re a) 0 p.q.yar)
%stem
?: =(q.s.yar p.a) ~
~[(welp ~(ram re q.a) ~(ram re r.a))]
==
?. (levy r.q.sih |=(a=tark ?=(%stem -.a)))
+>.$ :: XX separate prompt/history messages
%- edit
=| bed=bein
=+ ^= hyt ^- hist
=+ hyt=(~(get by r.yar) /)
?~(hyt *hist u.hyt)
?: &(?=(^ q.q.yar) =(/ hux.u.q.q.yar))
=+ bun=(rip 5 (turf r.p.q.sih))
%= u.q.q.yar
bul ?~ r.p.q.sih bul.u.q.q.yar (met 3 r.p.q.sih)
bus ?~ r.p.q.sih bus.u.q.q.yar (met 3 r.p.q.sih)
but ?~ r.p.q.sih but.u.q.q.yar (rip 3 r.p.q.sih)
bul ?~ r.p.q.sih bul.u.q.q.yar (lent bun)
bus ?~ r.p.q.sih bus.u.q.q.yar (lent bun)
but ?~ r.p.q.sih but.u.q.q.yar bun
hyt [+(p.hyt) [%$ q.hyt]]
pot (trip p.p.q.sih)
pol (met 3 p.p.q.sih)
@ -406,10 +366,22 @@
?(%init %logo %veer %vega %verb) :: drop-throughs
+>(mos :_(mos [hen %give +.sih]))
%writ :: file exists
%= +>.$
%_ +>.$
mos
:_ mos
[hen %pass / %g %show [our /terminal] our /lines]
[hen %pass /term-show %g %show [our /terminal] our /lines]
==
::
%wake
?: (lte (sub now ~s15) q.s.yar)
%_ +>.$
mos
:_ mos
[hen %pass /activity %t %wait (add q.s.yar ~s15)]
==
%_ +>.$
p.s.yar |
mos :_(mos (poke %term-in -:!>(*term-in) / %type %|))
==
==
::
@ -420,6 +392,16 @@
%flog !!
%noop +>
%belt :: terminal input
=. +>.$
?. ?=(?(%bac %del %ret %txt) -.p.kyz) +>.$
?: p.s.yar +>.$(s.yar [& now])
%_ +>.$
s.yar [& now]
mos
:_ :_ mos
[hen %pass /activity %t %wait (add ?:(p.s.yar q.s.yar now) ~s15)]
(poke %term-in -:!>(*term-in) / %type %&)
==
?~ q.q.yar
%^ furl
"Downloading files from ticketing ship, please wait until"
@ -493,6 +475,7 @@
$(kyz [%belt %del ~])
%e (edit u.q.q.yar(bus bul.u.q.q.yar))
%f $(kyz [%belt %aro %r])
%g +>.$(mos :_(mos (poke %term-in -:!>(*term-in) / %cmd %g)))
%k ?: =(bul.u.q.q.yar bus.u.q.q.yar)
beep
=> .(+>.$ (kill (slag bus.u.q.q.yar but.u.q.q.yar)))
@ -524,6 +507,12 @@
==
%l +>.$(mos :_(mos [hen %give %blit [[%clr ~] ~]]))
%n $(kyz [%belt %aro %d])
%o %_ +>.$
mos
:_ :_ mos
[hen %pass /term-show %g %nuke [our /terminal] our]
[hen %pass /term-show %g %show [our /terminal] our /lines]
==
%p $(kyz [%belt %aro %u])
%u ?: =(0 bus.u.q.q.yar)
beep
@ -536,6 +525,20 @@
but (slag bus.u.q.q.yar but.u.q.q.yar)
==
%r (edit u.q.q.yar(hyr [~ ~]))
%w ?: =(0 bus.u.q.q.yar)
beep
=+ bow=(wob u.q.q.yar)
=+ sow=(sub bus.u.q.q.yar bow)
=> .(+>.$ (kill (swag [bow sow] but.u.q.q.yar)))
%- edit
?> ?=(^ q.q.yar)
%= u.q.q.yar
bus bow
bul (sub bul.u.q.q.yar sow)
but %+ welp
(scag bow but.u.q.q.yar)
(slag bus.u.q.q.yar but.u.q.q.yar)
==
%x +>.$(mos :_(mos (poke %term-in -:!>(*term-in) / %cmd %x)))
%y ?: =(0 p.r.q.yar)
beep
@ -644,6 +647,7 @@
::
%hail :: refresh
+>.$
::+>.$(mos :_(mos (poke %term-ctrl -:!>(%hail) %hail)))
::
%harm :: all terms hung up
=+ nug=((map duct yard) [[hen (~(get by dug) hen)] ~ ~])
@ -674,7 +678,7 @@
++ poke
|= msg=mess
^- move
:^ hen %pass /
:^ hen %pass /term-mess
:^ %g %mess [our /terminal]
:- our msg
::
@ -684,7 +688,7 @@
(~(put by dug) hen yar)
--
--
=| $: %0 ::
=| $: %1 ::
our=ship ::
def=(unit duct) ::
dug=(map duct yard) ::
@ -710,7 +714,7 @@
:_ ..^$
%+ turn (~(tap by dug) *(list ,[p=duct q=yard]))
|=([a=duct b=yard] [a %slip %d p.q.hic])
=+ res=yerk:(lear:(dy hen our def dug) q.hic)
=+ res=yerk:(lear:(dy hen our now def dug) q.hic)
[-.res ..^$(our +<.res, dug +>+.res, def +>-.res)]
::
++ doze
@ -718,20 +722,32 @@
^- (unit ,@da)
~
::
++ load
|= old=[%0 our=ship def=(unit duct) dug=(map duct yard)]
++ load :: XX LEGACY 12-16-2014
|= $= old
$% [%0 our=ship def=(unit duct) dug=(map duct yord)]
[%1 our=ship def=(unit duct) dug=(map duct yard)]
==
^+ ..^$
..^$(our our.old, def def.old, dug dug.old)
?- -.old
%1 %_(..^$ our our.old, def def.old, dug dug.old)
%0 %= $
old
%= old
- %1
dug (~(run by dug.old) |=(yor=yord [p q r | *@da]:yor))
==
==
==
::
++ scry
|= [fur=(unit (set monk)) ren=@tas his=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
[~ ~ [%tank >dug<]]
::
++ stay [%0 our def dug]
++ stay [%1 our def dug]
++ take :: process move
|= [tea=wire hen=duct hin=(hypo sign)]
^- [p=(list move) q=_..^$]
=+ res=yerk:(leap:(dy hen our def dug) tea q.hin)
=+ res=yerk:(leap:(dy hen our now def dug) tea q.hin)
[-.res ..^$(our +<.res, dug +>+.res, def +>-.res)]
--

View File

@ -1,4 +1,4 @@
:: :: %eyre, http servant
!: :: %eyre, http servant
!? 164
::::
|= pit=vase
@ -46,6 +46,7 @@
$% [%mess p=hapt q=ship r=cage] ::
[%nuke p=hapt q=ship] ::
[%show p=hapt q=ship r=path] ::
[%took p=hapt q=ship] ::
== == ::
$: %t :: to %temp
$% [%wait p=@da] ::
@ -132,7 +133,6 @@
== ::
++ dual ,[p=@ud q=(each ,[p=ship q=hole] ship)] :: request handle
++ dude ,[p=@tas q=@] :: client identity
++ loco ,[p=? q=(unit ,@tas) r=path] :: logical construct
++ pest :: request in progress
$| $? %new :: virgin
%way :: waiting
@ -225,7 +225,7 @@
?~ - ~
=+ ^= pax
%+ rush pax.u
;~(pfix fas (more fas (cook crip (plus ;~(pose low nud hep)))))
;~(pfix fas (more fas ;~(simu next urs:ab)))
?~ pax ~
`[[his.u app.u] u.pax]
::
@ -401,13 +401,17 @@
?: ?=(%mess i.mab)
(hear:woy ~ %& %json !>(jon))
=+ can=(slav %ud i.t.mab)
=+ sem=(need (~(get by can.sub.siq:beat:u.ouy) can))
(soon %& sem u.ouy can %show ?.(?=(%show i.mab) jon (wrap sem jon)))
=+ sem=(~(get by can.sub.siq:beat:u.ouy) can)
?~ sem :: XX shouldn't occur
u.ouy
(soon %& u.sem u.ouy can %show ?.(?=(%show i.mab) jon (wrap u.sem jon)))
::
?(%rust %rush)
?> ?=(%show i.mab)
=+ can=(slav %ud i.t.mab)
=+ sem=(need (~(get by can.sub.siq:beat:u.ouy) can))
=. mow.u.ouy
:_(mow.u.ouy [hen %pass tea [%g %took [- + ~]:hap.sem you.u.ouy]])
?: =(0 can)
=< abet =< work =< abet
?~ num.sem
@ -537,6 +541,7 @@
q.ask (~(del by q.ask) sud)
kes (~(del by kes) hen)
==
:: ~& eyre-them/(earn p.u.p.kyz)
%= +>.$
mow :_(mow [ged [%give %thus p.ask p.kyz]])
p.ask +(p.ask)
@ -546,6 +551,7 @@
::
%they :: inbound response
=+ kas=(need (~(get by q.ask) p.kyz))
:: ~& > eyre-they/[p.q.kyz (earn p.q.kas)]
%= +>.$
mow :_(mow [p.kas [%give %thou q.kyz]])
q.ask (~(del by q.ask) p.kas)
@ -563,7 +569,7 @@
?> ?=([~ @ ~] hot)
[[sec (rash i.u.hot thor:epur)] p.ryp q.ryp]
==
=. p.p.pul |(p.p.pul =([& /localhost] r.p.pul))
=. p.p.pul |(p.p.pul ?=(hoke r.p.pul))
(hell pul +.kyz [p.heq mah s.heq])
::
%thud :: cancel request
@ -649,12 +655,12 @@
++ haji :: send %pc login
|= [our=ship him=ship ses=hole]
^+ +>
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pc ~] ses]]))
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pc %e ~] ses]]))
::
++ hajj :: send %pr response
|= [our=ship him=ship tus=path har=httr]
^+ +>
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pr tus] har]]))
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pr %e tus] har]]))
::
++ hare :: receive request
|= [our=ship tus=path him=ship hor=*]
@ -867,14 +873,15 @@
[~ u=~(. ya [our ses] u.suf u.cuz)]
::
++ noon :: login page
|= [our=ship whu=(unit ship) rul=tape ruf=tape]
|= [our=ship ses=hole whu=(unit ship) rul=tape]
^- manx
=+ ^= sic ^- manx
;script:'''
var seal = {
who: goal,
url: burl,
pas: null
pas: null,
ses: sesh
}
var hist = []
var hind = 0
@ -908,12 +915,13 @@
}
if(seal.who !== host) {
var foreign = {oth: host, ses: session};
var all = $.extend({}, seal, foreign);
var all = $.extend({}, seal, {oth:host});
delete all.pas;
console.log('redirect')
window.location="http://"+seal.who+".urbit.org/gul"
+ $.params(all);
window.location= // "http://"+seal.who+".urbit.org/gul?"
"http://0:8445/gul?"
+ $.param(all);
return false;
}
@ -927,12 +935,16 @@
login = function() {
seal.pas = $input.val()
var oth = /[&?]oth=[^&]*/.exec(location.search)
if(oth && oth.length)
seal.oth = oth[0].slice(5)
output = $output.html()
console.log($output.html())
$output.html(output.replace('sorry. please try again.<br>',''))
$output.html(output.replace(
'sorry. please try again.<br>',''))
$.post(form, seal, function(data,xhr,status) {
$.post("/pul", seal, function(data,xhr,status) {
console.log(data);
if(data.ok == true) {
document.location = data.next;
@ -984,7 +996,7 @@
; var host = '{(trip (rsh 3 1 (scot %p our)))}';
; var goal = '{?~(whu ~ (trip (rsh 3 1 (scot %p u.whu))))}';
; var burl = '{rul}';
; var form = '{ruf}';
; var sesh = '{(trip ses)}';
==
=> .(+.sic (weld `marl`cof `marl`+.sic))
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
@ -1420,9 +1432,7 @@
++ foal :: url from query
|= [nam=@t yaq=(map ,@t ,@t)]
^- (unit purl)
=+ uru=(~(get by yaq) %url)
?~ uru ~
(rush u.uru auri:epur)
(biff (~(get by yaq) %url) epur)
::
++ folk :: seal from query
|= quy=quay
@ -1586,20 +1596,16 @@
^- (unit seam)
:+ ~
%red
:: :+ [& q.p.pul r.p.pul]
%+ earl our
:+ [p.p.pul q.p.pul r.p.pul]
:: :+ [p.p.pul q.p.pul r.p.pul]
:+ [| q.p.pul r.p.pul] :: XX https
[~ /gul]
:- [%url (crip (urle (earn (earl our pul))))]
:- [%url (crip (earn pul(p.p |)))]
?~ whu ~
[%who (rsh 3 1 (scot %p u.whu))]~
::
++ holy :: structured request
|= [pul=purl moh=moth]
^- (unit seam)
?: &(=(%get p.moh) ?=([~ [@ ~]] q.pul)) :: app shortcut
:: XX use credential to figure out gog/gig
$(q.pul [`%html [%gog i.q.q.pul ~]])
?~ q.q.pul ~
=* nep i.q.q.pul
=+ paw=t.q.q.pul
@ -1641,7 +1647,17 @@
::
!&(=(%c tri) !=(%o two))
=(3 (met 3 nep))
==
==
?: &(=(%get p.moh) ?=([~ [@ ~]] q.pul)) :: app shortcut
=- $(q.pul [`%html -])
=+ ato=(~(tap in (~(get ju aut.ced) %$)))
=+ att=`(list ship)`(murn ato |=(a=span (slaw %p a)))
?~ att [%geg i.q.q.pul ~]
?: (~(has in (sa att)) our)
[%gog i.q.q.pul ~]
:+ %gig
(rsh 3 1 (scot %p (snag 0 (sort att lth))))
/[i.q.q.pul]
~
=^ yun paw
?+ two ~
@ -1650,10 +1666,10 @@
[(slav %p (cat 3 '~' i.paw)) t.paw]
%o [our paw]
==
:: ?: &(=(%i two) =(~ aut.ced))
:: (holt ~ pul)
:: ?: &(=(%o two) !(~(has ju aut.ced) %$ (scot %p our)))
:: (holt [~ our] pul)
?: &(=(%i two) !(lash yun) !=(yun (shaf %fake ses)))
(holt [~ yun] pul)
?: &(=(%o two) !(lash our))
(holt [~ our] pul)
?+ one ~
%g
?+ tri ~
@ -1723,6 +1739,16 @@
u.pup(pez [%fin %raw cod *mess `*octs])
==
::
++ erle :: url localize
|= [his=ship pul=purl] ^- purl
=+ pod=(mo (turn (~(tap by dop)) |=([p=host q=ship] [q p])))
?: (~(has by pod) his)
pul(p [& ~ (~(got by pod) his)])
?: ?=(hoke r.p.pul)
~| %no-port
pul(q.p [~ ?+(his !! %~zod 8.443)]) :: XX
pul(p [& ~ [~ /org/urbit/(rsh 3 1 (scot %p his))]])
::
++ inch :: function built
|= [num=@ud mez=(each bead (list tank))]
^+ +>
@ -1764,8 +1790,12 @@
::
++ lass :: load secret
^- @ta
=+ pax=/(scot %p our)/code/(scot %da now)/(scot %p our)
%^ rsh 3 1
(scot %p (,@ (need (sky %a (scot %p our) %code (scot %da now) ~))))
(scot %p (,@ (need (sky %a pax))))
::
++ lash :: user is authorized
|=(a=ship (~(has ju aut.ced) %$ (scot %p a)))
::
++ step :: step in work
|- ^+ +
@ -1783,6 +1813,7 @@
++ wink :: advance request
|= [num=@ud pip=pimp]
^- [(unit pimp) _+>]
:: ~& wink-do/[?@(pez.pip pez.pip -.pez.pip) -.som.pip]
?- pez.pip
%way [[~ pip] +>.$]
%new
@ -1853,43 +1884,47 @@
+>.$(..ya (honk our num ses kas))
::
%lon
?^ pus.p.som.pip
?. =(lass u.pus.p.som.pip)
:_ +>.$
:- ~
%= pip
pez
[%fin %mid /text/json (tact (pojo (jobe [%ok [%b |]]~)))]
^- [(unit pimp) _+>.$]
?~ pus.p.som.pip
:_ +>.$
?: ?~ whu.p.som.pip |
(lash u.whu.p.som.pip)
[~ pip(som [%red pul.p.som.pip])]
?: wit.p.som.pip
[~ pip(pez [%who %$ (scot %p (need whu.p.som.pip))])]
=+ rul=(earn pul.p.som.pip)
=+ sus=?~(foy.p.som.pip ses q.u.foy.p.som.pip)
~& auth-request/secret=`cord`lass
=+ ham=(noon our sus whu.p.som.pip rul)
[~ pip(pez [%fin %ham ham])]
?. =(lass u.pus.p.som.pip)
:_ +>.$
:- ~
%= pip
pez
[%fin %mid /text/json (tact (pojo (jobe [%ok [%b |]]~)))]
==
=. aut.ced (~(put ju aut.ced) %$ (scot %p (need whu.p.som.pip)))
?~ foy.p.som.pip
=+ ^= jon
%- jobe
:~ [%ok [%b &]]
[%next (jape (earn pul.p.som.pip))]
==
=. aut.ced (~(put ju aut.ced) %$ (scot %p (need whu.p.som.pip)))
?~ foy.p.som.pip
=+ ^= jon
%- jobe
:~ [%ok [%b &]]
[%next (jape (earn pul.p.som.pip))]
==
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
=. ..ya (haji our u.foy.p.som.pip)
=+ ^= lup ^- purl
:+ ^- hart
:+ & ~
[%& ~[%org %urbit (rsh 3 1 (scot %p p.u.foy.p.som.pip))]]
^- pork
[~ /gul]
^- quay
:~ [%who (rsh 3 1 (scot %p (need whu.p.som.pip)))]
[%url (crip (earn pul.p.som.pip))]
[%wit %yes]
==
=+ jon=(jobe ~[[%ok [%b &]] [%next (jape (earn lup))]])
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
:_ +>.$
?: wit.p.som.pip
[~ pip(pez [%who %$ (scot %p (need whu.p.som.pip))])]
=+ rul=(earn pul.p.som.pip)
=+ ruf=(earn (earl our pul.p.som.pip(q.q /pul, r ~)))
=+ ham=(noon our whu.p.som.pip rul ruf)
[~ pip(pez [%fin %ham ham])]
=. ..ya (haji our u.foy.p.som.pip)
=+ ^= lup ^- purl
%+ erle p.u.foy.p.som.pip
:+ `hart`p.pul.p.som.pip
^- pork
[~ /gul]
^- quay
:~ [%who (rsh 3 1 (scot %p (need whu.p.som.pip)))]
[%url (crip (earn pul.p.som.pip))]
[%wit %yes]
==
=+ jon=(jobe ~[[%ok [%b &]] [%next (jape (earn lup))]])
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
::
%red
:_ +>.$
@ -1898,7 +1933,7 @@
pez
:- %fin
:- %raw
:+ 301
:+ 307
[%location (crip (earn p.som.pip))]~
~
==
@ -2022,7 +2057,7 @@
|= nap=@ud
=+ suy=(~(get by sok) nap)
?~ suy ~
(some ~(. yo nap u.suy))
(some ~(. yo nap=nap you=p.u.suy siq=q.u.suy))
::
++ yo :: app instance
|_ $: nap=@ud :: instance number
@ -2119,7 +2154,7 @@
=. +>.$
?. =(cnt num.meg.siq) +>.$
%+ pass(num.meg.siq +(num.meg.siq)) [%| hap]
`note`[%f %exec you ~ %cast for %done ~ %json !>(jon)]
`note`[%f %exec our ~ %cast for %done ~ %json !>(jon)]
?. =(+(cnt) num.meg.siq)
+>.$(..yo (bust 204 num))
(hire:(yule %meg) cnt num)
@ -2128,8 +2163,8 @@
|= [num=@ud hap=hasp pax=path]
^- [(unit pimp) _+>]
=. +>.$
%+ ~(rep by can.sub.siq) +>.$
|= [p=[p=@ud q=stem] q=_+>.$]
%- ~(rep by can.sub.siq)
=+ [*p=[p=@ud q=stem] q=+>.$] |.
?. =([hap pax] [hap.q.p pax.q.p]) q
=. q q(can.sub.siq (~(del by can.sub.siq:q) p.p))
([-(hen +)]:[pass:q hen.q.p] `p.p %g %nuke [- + ~]:hap you)

View File

@ -37,9 +37,10 @@
[%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend
[%hel p=horn] :: /% propogate heel
[%hub p=horn] :: /@ list by @ud
[%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /% homo map
[%nap p=horn] :: /_ homo map
[%now p=horn] :: /& list by @da
[%saw p=twig q=horn] :: /; operate on
[%see p=beam q=horn] :: /: relative to
@ -94,7 +95,7 @@
$: p=cafe :: cache
$= q ::
$% [%0 p=(set beam) q=a] :: depends/product
[%1 p=(set ,[p=beam q=(list tank)])] :: blocks
[%1 p=(set ,[p=care q=beam r=(list tank)])] :: blocks
[%2 p=(list tank)] :: error
== ::
== ::
@ -114,13 +115,15 @@
== ::
++ calx :: concrete cache line
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile
[%slit p=calm q=[p=type q=type] r=type] :: slam type
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
[%slap p=calm q=[p=vase q=twig] r=vase] :: compute
[%slam p=calm q=[p=vase q=vase] r=vase] :: compute
== ::
++ task :: problem in progress
$: nah=duct :: cause
kas=silk :: problem
kig=[p=@ud q=(map ,@ud beam)] :: blocks
kig=[p=@ud q=(map ,@ud ,[p=care q=beam])] :: blocks
== ::
-- ::
|% ::
@ -131,6 +134,8 @@
%hood ?>(?=(%hood -.cax) r.cax)
%slap ?>(?=(%slap -.cax) r.cax)
%slam ?>(?=(%slam -.cax) r.cax)
%slim ?>(?=(%slim -.cax) r.cax)
%slit ?>(?=(%slit -.cax) r.cax)
==
::
++ calk :: cache lookup
@ -151,16 +156,6 @@
^- cafe ::
[(grom p.a p.b) (grum q.a q.b)] ::
:: ::
++ colt :: reduce to save
|= lex=axle ::
^- axle
%= lex
pol
%- ~(run by pol.lex)
|= bay=baby
bay(jav ~)
==
::
++ faun |=([a=cafe b=vase] (fine a `cage`noun/b)) :: vase to cage
++ feel |=([a=cafe b=cage] (fine a q.b)) :: cage to vase
++ fest |*([a=cafe b=*] (fine a [~ u=b])) :: bolt to unit
@ -191,7 +186,6 @@
::
++ za :: per event
=| $: $: $: our=ship :: computation owner
tea=wire :: event place
hen=duct :: event floor
== ::
$: now=@da :: event date
@ -224,6 +218,12 @@
==
~(exec zo [num `task`[hen u.kus 0 ~]])
::
++ apel :: stateless
|= [hen=duct kus=silk]
^- (unit gift)
=+ num=0 :: XX
~(exit zo [num `task`[hen kus 0 ~]])
::
++ axon :: take
|= [num=@ud tik=@ud sih=sign]
^+ +>
@ -246,7 +246,7 @@
==
++ camo :: stop requests
^+ .
=+ kiz=(~(tap by q.kig) *(list ,[p=@ud q=beam]))
=+ kiz=(~(tap by q.kig) *(list ,[p=@ud q=[p=care q=beam]]))
|- ^+ +>
?~ kiz +>
%= $
@ -255,19 +255,19 @@
:- hen
:^ %pass [(scot %p our) (scot %ud num) (scot %ud p.i.kiz) ~]
%c
[%warp [our p.q.i.kiz] q.q.i.kiz ~]
[%warp [our p.q.q.i.kiz] q.q.q.i.kiz ~]
==
::
++ camp :: request a file
|= [ren=care bem=beam]
^+ +>
%= +>
kig [+(p.kig) (~(put by q.kig) p.kig bem)]
kig [+(p.kig) (~(put by q.kig) p.kig [ren bem])]
mow :_ mow
:- hen
:^ %pass [(scot %p our) (scot %ud num) (scot %ud p.kig) ~]
%c
[%warp [our p.bem] q.bem [~ %& ren r.bem s.bem]]
[%warp [our p.bem] q.bem [~ %& ren r.bem (flop s.bem)]]
==
::
++ clef :: cache a result
@ -339,22 +339,31 @@
?- -.ton
%2 [%2 p=p.ton]
%0 [%0 p=*(set beam) q=(fun p.ton)]
%1 ~& [%coup-need ((list path) p.ton)]
%1 :: ~& [%coup-need ((list path) p.ton)]
=- ?- -.faw
& [%1 p=(sa (turn p.faw |=(a=beam [a *(list tank)])))]
& :- %1
^= p
%- sa
%+ turn p.faw
|=(a=[care beam] [-.a +.a *(list tank)])
| [%2 p=p.faw]
==
^= faw
|- ^- (each (list beam) (list tank))
|- ^- (each (list (pair care beam)) (list tank))
?~ p.ton [%& ~]
=+ nex=$(p.ton t.p.ton)
=+ pax=(path i.p.ton)
?~ pax [%| (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
?. ?=(%c (end 3 1 i.pax))
[%| leaf/"blocking not clay" (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
=+ ren=((soft care) (rsh 3 1 i.pax))
?~ ren
[%| leaf/"blocking not care" (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
=+ zis=(tome t.pax)
?~ zis
[%| (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
[%| leaf/"blocking not beam" (smyt pax) ?:(?=(& -.nex) ~ p.nex)]
?- -.nex
& [%& u.zis p.nex]
& [%& [u.ren u.zis] p.nex]
| nex
==
==
@ -374,10 +383,19 @@
^+ +>
%_(+> jav.bay q.cof)
::
++ exit :: stateless exec
^- (unit gift)
=+ bot=(make [~ jav.bay] kas)
:: =. ..exec (dash p.bot)
?- -.q.bot
%0 `[%made %& p.q.bot q.q.bot]
%2 `[%made %| p.q.bot]
%1 ~
==
::
++ exec :: execute app
^+ ..zo
?: !=(~ q.kig) ..zo
|- ^+ ..zo
=+ bot=(make [~ jav.bay] kas)
=. ..exec (dash p.bot)
?- -.q.bot
@ -387,7 +405,7 @@
=< abet
|- ^+ ..exec
?~ zuk ..exec
=+ foo=`_..exec`(camp %x `beam`p.i.zuk)
=+ foo=`_..exec`(camp p.i.zuk q.i.zuk)
$(zuk t.zuk, ..exec foo)
==
::
@ -418,9 +436,10 @@
=+ pax=/door/[for]/mar
=+ ^= bem ^- beam
:_ pax
?: =(p.bek our) bek
?: &(=(p.bek our) =(q.bek %main)) bek
=+ oak=[our %main %da now]
?. =(~ (ska %cy (tope [oak pax]))) oak
?: ?=([~ ~ *] (ska %cy (tope [oak pax])))
oak
bek
(cope (fade cof %hook bem) abut:(meow bem ~))
::
@ -500,9 +519,10 @@
(stag %dub ;~(pfix tis dub:read))
(stag %fan ;~(pfix dot fan:read))
(stag %for ;~(pfix com for:read))
(stag %hel ;~(pfix cen day:read))
(stag %hub ;~(pfix pat day:read))
(stag %man ;~(pfix tar man:read))
(stag %nap ;~(pfix cen day:read))
(stag %nap ;~(pfix cab day:read))
(stag %now ;~(pfix pam day:read))
(stag %saw ;~(pfix sem saw:read))
(stag %see ;~(pfix col see:read))
@ -646,8 +666,9 @@
++ lamp :: normalize version
|= [cof=cafe bem=beam]
^- (bolt beam)
?: ?=(%ud -.r.bem) (fine cof bem)
=+ von=(ska %cw (tope bem(s ~)))
?~ von [p=cof q=[%1 [bem ~] ~ ~]]
?~ von [p=cof q=[%1 [%w bem ~] ~ ~]]
(fine cof bem(r [%ud ((hard ,@) (need u.von))]))
::
++ lave :: validate
@ -672,7 +693,7 @@
|= [cof=cafe bem=beam]
^- (bolt arch)
=+ von=(ska %cy (tope bem))
?~ von [p=cof q=[%1 [bem ~] ~ ~]]
?~ von [p=cof q=[%1 [%y bem ~] ~ ~]]
(fine cof ((hard arch) (need u.von)))
::
++ liar :: load vase
@ -680,7 +701,7 @@
^- (bolt vase)
=+ von=(ska %cx (tope bem))
?~ von
[p=*cafe q=[%1 [[bem ~] ~ ~]]]
[p=*cafe q=[%1 [[%x bem ~] ~ ~]]]
?~ u.von
(flaw cof (smyt (tope bem)) ~)
(fine cof ?^(u.u.von [%cell %noun %noun] [%atom %$]) u.u.von)
@ -768,11 +789,11 @@
?. ?=(%0 -.q.rof) [rof +>.$]
?~ q.q.rof
[[p.rof [%0 p.q.rof ~]] +>.$]
=^ orf +>.$ (apse cof i.q.q.rof)
=^ orf +>.$ (apse p.rof i.q.q.rof)
?. ?=(%0 -.q.orf)
[orf +>.$]
?~ q.q.orf
$(cof p.orf, q.q.rof t.q.q.rof)
$(p.rof p.orf, q.q.rof t.q.q.rof)
[[p.orf [%0 (grom p.q.rof p.q.orf) q.q.orf]] +>.$]
::
++ apse
@ -797,18 +818,24 @@
|= [cof=cafe yed=vase]
^$(cof cof, for i.yaw, yaw t.yaw, vax yed)
::
++ mail :: cached mint
|= [cof=cafe sut=type gen=twig]
^- (bolt (pair type nock))
%+ (clef %slim) (fine cof sut gen)
|= [cof=cafe sut=type gen=twig]
=+ puz=(mule |.((~(mint ut sut) [%noun gen])))
?- -.puz
| (flaw cof p.puz)
& (fine cof p.puz)
==
::
++ maim :: slap
|= [cof=cafe vax=vase gen=twig]
^- (bolt vase)
%+ (clef %slap) (fine cof vax gen)
|= [cof=cafe vax=vase gen=twig]
=+ puz=(mule |.((~(mint ut p.vax) [%noun gen])))
?- -.puz
| (flaw cof p.puz)
& %+ (coup cof) (mock [q.vax q.p.puz] (mole ska))
|= val=*
`vase`[p.p.puz val]
==
%+ cope (mail cof p.vax gen)
|= [cof=cafe typ=type fol=nock]
%+ (coup cof) (mock [q.vax fol] (mole ska))
|=(val=* `vase`[typ val])
::
++ make :: reduce silk
|= [cof=cafe kas=silk]
@ -844,7 +871,7 @@
(fine cof `cage`[p.kas vax])
::
%call
%+ cool |.(leaf/"ford: call {<`@p`(mug kas)>}")
:: %+ cool |.(leaf/"ford: call {<`@p`(mug kas)>}")
%. [cof p.kas q.kas]
;~ cope
;~ coax
@ -895,18 +922,24 @@
(fine cof `cage`[p.kas vax])
==
::
++ malt :: cached slit
|= [cof=cafe gat=type sam=type]
^- (bolt type)
%+ (clef %slit) (fine cof gat sam)
|= [cof=cafe gat=type sam=type]
=+ top=(mule |.((slit gat sam)))
?- -.top
| (flaw cof p.top)
& (fine cof p.top)
==
::
++ maul :: slam
|= [cof=cafe gat=vase sam=vase]
^- (bolt vase)
%+ (clef %slam) (fine cof gat sam)
|= [cof=cafe gat=vase sam=vase]
=+ top=(mule |.((slit p.gat p.sam)))
?- -.top
| (flaw cof p.top)
& %+ (coup cof) (mong [q.gat q.sam] (mole ska))
|= val=*
`vase`[p.top val]
==
%+ cope (malt cof p.gat p.sam)
|= [cof=cafe typ=type]
%+ (coup cof) (mong [q.gat q.sam] (mole ska))
|=(val=* `vase`[typ val])
::
++ meow :: assemble
|= [how=beam arg=heel]
@ -1051,6 +1084,7 @@
(slop i.tev $(tev t.tev))
::
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
%hel $(hon p.hon, arg /, s.how (weld arg s.how))
%hub (chad cof bax %ud p.hon)
%man
|- ^- (bolt vase)
@ -1085,7 +1119,7 @@
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
(fine cof [p.tug q.vax])
::
%toy (cope (make cof %bake p.hon how arg) feel)
%toy (cope (make cof %boil p.hon how ~) feel)
==
::
++ head :: consume structures
@ -1191,16 +1225,19 @@
^+ ..zo
?> (~(has by q.kig) tik)
?~ rot
amok:(expo [%made %| (smyt (tope (need (~(get by q.kig) tik)))) ~])
=+ `[ren=care bem=beam]`(~(got by q.kig) tik)
amok:(expo [%made %| (smyt ren (tope bem)) ~])
exec(q.kig (~(del by q.kig) tik))
--
--
::
--
. ==
=| axle
=* lex -
|= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core
~% %ford-d +>+>+>+>+>+> ~
|% ::
++ call :: request
|= [hen=duct hic=(hypo (hobo kiss))]
@ -1215,7 +1252,7 @@
=+ buy=(~(get by pol.lex) our)
?~(buy *baby u.buy)
=^ mos bay
abet:(~(apex za [[our ~ hen] [now eny ska] ~] bay) q.q.hic)
abet:(~(apex za [[our hen] [now eny ska] ~] bay) q.q.hic)
[mos ..^$(pol (~(put by pol) our bay))]
::
++ doze
@ -1243,7 +1280,7 @@
++ scry
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
~
[~ ~]
::
++ stay :: save w/o cache
`axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~])))
@ -1257,8 +1294,8 @@
num=(need (slaw %ud i.t.tea))
tik=(need (slaw %ud i.t.t.tea))
==
=+ bay=(need (~(get by pol.lex) our))
=+ bay=(~(got by pol.lex) our)
=^ mos bay
abet:(~(axon za [[our tea hen] [now eny ska] ~] bay) num tik q.hin)
abet:(~(axon za [[our hen] [now eny ska] ~] bay) num tik q.hin)
[mos ..^$(pol (~(put by pol) our bay))]
--

View File

@ -31,6 +31,7 @@
[%nuke p=hapt q=ship] :: clear duct
[%rote p=sack q=path r=*] :: remote request
[%roth p=sack q=path r=*] :: remote response
[%took p=hapt q=ship] :: remote acknowledge
[%wipe p=hapt] :: forget app
== ::
++ knob :: pending action
@ -45,6 +46,8 @@
[%sire p=term q=span] :: spawn subprocess
[%nuke p=ship] :: clear duct
[%take p=path q=vase] :: user result
[%took p=ship] :: rush queue drained
[%told p=ship] :: rush queue filled
== ::
++ mast :: apps by ship
$: hun=duct :: control duct
@ -67,11 +70,11 @@
[%sire p=term q=hapt] ::
[%mess p=hapt q=ship r=cage] ::
[%nuke p=hapt q=ship] ::
[%took p=hapt q=ship] ::
== == ::
$: @tas :: to any
$% [%meta p=vase] ::
== == == ::
++ rapt |*(a=$+(* *) (qual path path ,@da a)) :: versioned result
++ rave :: see %clay
$% [& p=mood] :: single request
[| p=moat] :: change range
@ -88,9 +91,9 @@
r=(map bone duct) :: by bone
== ::
++ roon :: foreign response
$% [%d p=mark q=*] :: diff
$% [%d p=mark q=*] :: diff (rush)
[%e p=ares] :: error
[%f p=mark q=*] :: full refresh
[%f p=mark q=*] :: full refresh (rust)
[%k ~] :: message response
== ::
++ rook :: foreign request
@ -100,20 +103,24 @@
== ::
++ seat :: the living app
$: app=term :: app name
huv=(unit vase) :: application vase
qic=(unit toil) :: current project
onz=(unit (pair duct path)) :: live fords
vey=(qeu toil) :: pending projects
$: huv=(unit vase) :: application vase
qic=(unit toil) :: current project
onz=(unit (pair duct path)) :: live fords
vey=(qeu toil) :: pending projects
== ::
nuc=(set duct) :: nuked ducts
tik=@ud :: build number
act=@ud :: action number
lat=@da :: last change
orm=(unit ,@da) :: build date
$: tik=@ud :: build number
act=@ud :: action number
lat=@da :: last change
orm=(unit ,@da) :: build date
== ::
mom=(unit duct) :: parent duct
cub=(map span term) :: offspring
sup=(map bone (pair ship path)) :: subscribers
pus=(jug path bone) :: srebircsbus
peq=(map bone ,@uvI) :: peekers
$: sup=(map bone (pair ship path)) :: subscribers
pus=(jug path bone) :: srebircsbus
peq=(map bone ,@uvI) :: peekers
qel=(map bone ,@ud) :: rush queue length
== ::
ped=(set (pair ship desk)) :: active depends
zam=scar :: opaque ducts
== ::
@ -158,16 +165,6 @@
++ toil (pair duct knob) :: work in progress
-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
++ byby :: double bind
|* [a=(unit (unit)) b=$+(* *)]
?~ a ~
?~ u.a [~ u=~]
[~ u=[~ u=(b u.u.a)]]
:: ::
++ colt :: reduce to save
|= all=axle ::
all
::
++ read :: read permission
|= law=(unit cuff)
^- (unit (set monk))
@ -202,21 +199,14 @@
:- ?~(p.u.a ~ ?~(p.u.b ~ `(grom u.p.u.b u.p.u.a)))
(grom q.u.b q.u.a)
::
++ lamp
|= con=(unit coin)
^- (unit path)
?. ?=([~ %many *] con) ~
%- zl:jo
%+ turn p.u.con
|= tem=coin
?.(?=([%$ %ta @] tem) ~ (some q.p.tem))
::
++ lump :: position
|= pax=path
^- [p=hapt q=path]
?> ?=([@ @ *] pax)
?. ?=([@ @ *] pax)
~& [%lump-path-bad pax]
!!
:- :- (slav %p i.pax)
(need (lamp (slay i.t.pax)))
(need (pick i.t.pax))
t.t.pax
--
. == :: end preface
@ -233,17 +223,21 @@
?- -.q.hic
%init
[p=~ q=..^$(pol.all (~(put by pol.all) p.q.hic hen ~ ~))]
::
%rote
(gawk hen p.q.hic q.q.hic ((hard ,[@ud rook]) r.q.hic))
::
%roth
(gawd hen p.q.hic q.q.hic ((hard ,[@ud roon]) r.q.hic))
::
%wipe
=+ mat=(~(got by pol.all) p.p.q.hic)
~? !(~(has by bum.mat) q.p.q.hic) [%wipe-lost q.p.q.hic]
=. bum.mat (~(del by bum.mat) q.p.q.hic)
=. pol.all (~(put by pol.all) p.p.q.hic mat)
[p=~ q=..^$]
?(%mess %show %nuke %sire)
::
?(%mess %show %nuke %took %sire)
|- ^- [p=(list move) q=_..^^$]
=+ =| law=(unit cuff)
|- ^- $: law=(unit cuff)
@ -256,6 +250,7 @@
%mess [p %mess q r]:q.hic
%show [p %show q r]:q.hic
%nuke [p %nuke q]:q.hic
%took [p %took q]:q.hic
%sire [[p.q +.q.q] %sire p -.q.q]:q.hic
==
((goad hen law) p.hap q.hap kon)
@ -265,7 +260,8 @@
|= [pax=path hen=duct hin=(hypo sign)] ::
^- [p=(list move) q=_..^$]
?: ?=(%crud +<.q.hin)
~& [%gall-crud-error pax hen q.hin]
~& [%gall-crud-error pax hen]
~& [%gall-crud-data (,[@tas (list tank)] +>.q.hin)]
?> ?=(%g -.q.hin)
?~ pax ~& %strange-path [~ ..^$]
=+ lum=(lump t.pax)
@ -274,7 +270,6 @@
=+ sat=(~(get by bum.u.mat) q.p.lum)
?~ sat ~& %no-app [~ ..^$]
:- `(list move)`[hen %give %crud p.q.hin q.q.hin]~
~& [%crud-stuff qic=?~(qic.u.sat ~ [p -.q]:u.qic.u.sat) onz=onz.u.sat]
%= ..^$ :: XX maybe call work?
pol.all
%+ ~(put by pol.all) p.p.lum
@ -294,7 +289,9 @@
?~ mat [~ ..^$]
=+ sat=(~(get by bum.u.mat) q.p.lum)
?~ sat [~ ..^$]
?. (~(has by q.zam.u.sat) hen) ~& %app-lost [~ ..^$]
:: ?. (~(has by q.zam.u.sat) hen)
:: ~& [%app-lost pax hen p.lum q.lum]
:: [~ ..^$]
=< abet =< work
(more:(bear:(gaff p.lum) hen) q.lum hin)
::
@ -360,7 +357,10 @@
|= [hen=duct law=(unit cuff)]
|= [our=@p imp=path kon=knob]
^- [(list move) _..^^$]
?> ?=(?(%mess %show %nuke) -.kon)
?> ?=(?(%mess %show %nuke %took) -.kon)
?: ?=(%took -.kon)
:: ~& [%gape-took our imp hen]
[~ ..^^$]
=+ you=`ship`?-(-.kon %mess p.kon, %nuke p.kon, %show p.kon)
=+ mat=(~(got by pol.all) you)
=+ sad==+(sad=(~(get by sap.mat) our) ?^(sad u.sad [.(p 1)]:*scad))
@ -395,11 +395,14 @@
^- [(list move) _..^$]
?+ -.sih !!
%a
?> ?=(%woot +<.sih)
?. ?=(%woot +<.sih)
~& [%gall-bad-gasp-a pax=pax lgsih=+<.sih]
~& [%gall-bad-gasp-b pax=pax sih=sih] `..^$
:_ ..^$ :_ ~
?~ q.sih
[hen %give %nice ~]
[hen %give %mean u.q.sih]
::
%f
:_ ..^$
:_ ~
@ -425,6 +428,7 @@
num=(slav %ud i.t.t.t.pax)
imp=`path`t.t.t.t.pax
==
:: ~& [%gall-gave hen -.pax [our you num imp]]
:_ ..^$
=+ rod=|=(ron=roon `note`[%a %wont [our you] [%q %gh imp] num ron])
?+ -.pax !!
@ -456,7 +460,8 @@
==
==
%s ?+ -.sih !!
%a ~
%a :_ ~ :- hen
[%pass [%r pax] %g %took [our imp] you]
%g
:_ ~ :- hen
?- -.+.sih
@ -465,11 +470,11 @@
%gone !!
%init !!
%logo !!
%logo !!
%mean [%give %mean p.+.sih]
%mean [%pass [%r pax] (rod %e p.+.sih)]
%nice [%give %nice ~]
%rush [%pass [%r pax] (rod %d p.+.sih q.+.sih)]
%rust [%pass [%r pax] (rod %f p.+.sih q.+.sih)]
%rust :: ~& [%gave-rust [our you num imp] hen]
[%pass [%r pax] (rod %f p.+.sih q.+.sih)]
%sage !!
%verb !!
%veer !!
@ -539,6 +544,8 @@
^- [(list move) _..^^$]
=+ mut=(~(get by pol.all) our)
?^ mut
?: &(?=([@ @ *] imp) !(~(has by bum.u.mut) imp)) :: %took for dead imps
[~ ..^^$]
abet:work:(quem:(boar:(gent our imp u.mut) hen law) kon)
((gape hen law) our imp kon)
::
@ -562,14 +569,19 @@
==
==
::
++ able :: bone to duct
|= ost=bone ^- duct
?: =(0 ost)
[(away ~) ~]
(~(got by r.zam.sat) ost)
::
++ away :: application path
|= pax=path ^- path
=+ imc=[%many (turn imp |=(a=span [%$ %ta a]))]
[%a (scot %p our) ~(rent co imc) pax]
[%a (scot %p our) ?~(imp %$ (pack imp)) pax]
::
++ bear :: write backward
|= hen=duct
=+ orf=(~(got by q.zam.sat) hen)
=+ orf=(fall (~(get by q.zam.sat) hen) [p=0 q=*(unit cuff)])
~(apex bo:~(. au (read q.orf)) hen p.orf (rite q.orf) ~)
::
++ beef :: read in
@ -644,7 +656,7 @@
::
++ bing :: reset to duct
|= neh=duct
=+ orf=(~(got by q.zam.sat) neh)
=+ orf=(fall (~(get by q.zam.sat) neh) [p=0 q=*(unit cuff)])
%_ +>.$
hen neh
ost p.orf
@ -660,7 +672,8 @@
::
++ blow
^+ .
=> (give %nice ~)
:: ~& [%gall-blow ost]
=> (give %mean ~)
=+ pax=+:(fall (~(get by sup.sat) ost) *[ship path])
%= +
qic.sat ~
@ -680,6 +693,7 @@
:_ ~
:- [%$ 12]~
(cave !>([[our app.sat imp] cub.sat sup.sat pus.sat [act.sat eny now]]))
::
++ core |=(vax=vase (cove %core vax)) :: core as silk
++ cove :: cage as silk
|= cay=cage
@ -687,24 +701,7 @@
[%done ~ cay]
::
++ deal :: reboot
^+ .
=. tik.sat +(tik.sat)
=+ pys=(~(tap by sup.sat) ~)
:: ~& [%gall-deal tik.sat pys]
|- ^+ +>.$
?~ pys +>.$
=. +>.$ $(pys t.pys)
%_ +>.$
mow
:_ mow
[(~(got by r.zam.sat) p.i.pys) %slip [%g %show [our imp] q.i.pys]]
==
:: %= +>.$
:: vey.sat
:: %- ~(put to vey.sat)
:: :- (~(got by r.zam.sat) p.i.pys)
:: [%show q.i.pys]
:: ==
.(tik.sat +(tik.sat))
::
++ deff
|= [wir=wire hon=duct caq=vase]
@ -715,8 +712,8 @@
::
++ drug :: set dependencies
|= pen=(set (pair ship desk))
:: ~& [%drug %pen pen]
:: ~& [%drug %ped ped.sat]
:: ~& [%drug ped=ped.sat]
:: ~& [%drug pen=pen]
^+ +>
=+ ^= new ^- (list move)
%+ turn
@ -725,7 +722,7 @@
|= a=(pair ship desk)
:- hun.mat
:^ %pass (away %w %drug (scot %p p.a) q.a ~) %c
::~& [%sync-subscribe our p.a q.a]
:: ~& [%sync-subscribe our p.a q.a]
[%warp [our p.a] q.a ~ %| [%da +(now)] [%da (add now ~d1000)] /]
=+ ^= old ^- (list move)
%+ turn
@ -961,6 +958,10 @@
|= vax=vase
^+ +>
=+ new=?~(huv.sat & !=(+<+.q.vax +<+.q.u.huv.sat))
:: ?. ?=(%core -.p.vax)
:: ~| [%morn-not-core -.p.vax app.sat imp]
:: ~> %mean.|.((skol p.vax))
:: !!
=. huv.sat `vax
?. new +>.$
=: act.sat +(act.sat)
@ -969,10 +970,9 @@
=+ pex=(~(tap by peq.sat) ~)
|- ^+ +>.^$
?~ pex +>.^$
%= $
pex t.pex
+>.^$ %- quem(hen (~(got by r.zam.sat) p.i.pex))
[%show (~(got by sup.sat) p.i.pex)]
%= $
pex t.pex
+>.^$ (quem(hen (able p.i.pex)) [%show (~(got by sup.sat) p.i.pex)])
==
::
++ mort :: failed boot
@ -1004,15 +1004,32 @@
=+ yov=(~(tap by vey.sat) ~) :: XX ++pun
+>.$(vey.sat (~(gas to *(qeu toil)) `_yov`[[hen kon] yov]))
::
++ said
++ said :: sayz, done wrong
|= vud=vase
|- ^- [(list toil) (list move)]
?: =(~ q.vud) [~ mow]
=- [p.fob (weld (flop q.fob) mow)]
^= fob
|- ^- (pair (list toil) (list move))
?: =(~ q.vud) [~ ~]
=+ sud=(sump (slot 2 vud))
=+ res=$(vud (slot 3 vud))
?: ?=(%& -.sud)
[-.res [p.sud +.res]]
[[p.sud -.res] +.res]
:- ?~ -.sud
-.res
[u.-.sud -.res]
?~ +.sud
+.res
[u.+.sud +.res]
::
++ sayz :: dissect app moves
|= vud=vase
=| toy=(list toil)
|- ^- [(list toil) (list move)]
?: =(~ q.vud) [toy mow]
=+ sud=(sump (slot 2 vud))
%= $
vud (slot 3 vud)
toy ?~(-.sud toy [u.-.sud toy])
mow ?~(+.sud mow [u.+.sud mow])
==
::
++ show :: subscribe
|= [you=ship pax=path] :: subscription
@ -1025,24 +1042,33 @@
::
++ sump
|= wec=vase
^- (each move toil)
=+ hon=(need (~(get by r.zam.sat) ((hard bone) -.q.wec)))
^- [(unit toil) (unit move)]
=+ ost=((hard bone) -.q.wec)
=+ hon=(able ost)
=+ caq=(spec (slot 3 wec))
?+ q.caq ~&(%sump-bad !!)
::
[%pass p=* q=@tas r=[p=@tas q=*]]
=+ wir=(away %u ((hard path) p.q.caq))
?: ?=(%cide p.r.q.caq) [%| (deff wir hon caq)]
?: ?=(%sire p.r.q.caq) [%& (birf wir hon caq)]
:+ %& hon
?: ?=(%cide p.r.q.caq) [`(deff wir hon caq) ~]
?: ?=(%sire p.r.q.caq) [~ `(birf wir hon caq)]
:^ ~ ~ hon
:^ %pass wir
(need ((sand %tas) ((hard ,@) q.q.caq)))
[%meta (spec (slot 15 caq))]
::
[%give p=[p=@tas q=*]]
:+ %& hon
?: ?=(%mean p.p.q.caq)
:- `[hon %nuke our]
`[hon %give %mean (ares q.p.q.caq)]
:- ?. ?| ?=(?(%rush %rust) p.p.q.caq)
?& ?=(%meta p.p.q.caq)
?=([* ?(%rush %rust) *] q.p.q.caq)
== ==
~
`[hon %told our]
:+ ~ hon
:- %give
?: ?=(%mean p.p.q.caq) [%mean (ares q.p.q.caq)]
?: ?=(%nice p.p.q.caq) [%nice ~]
(sumo (spec (slot 3 caq)))
==
@ -1054,7 +1080,6 @@
::
++ work :: eat queue
|- ^+ +
:: ~& [%work imp ?~(qic.sat ~ [~ -.q.u.qic.sat (turn (~(tap by vey.sat)) |=(toil -.q))])]
?: |(?=(^ qic.sat) =(~ vey.sat)) +.$ :: nothing to do
=^ yev vey.sat [p q]:~(get to vey.sat)
?: (~(has in nuc.sat) p.yev) $
@ -1084,7 +1109,7 @@
%boot
=. orm.sat `now
%+ ford /s/park
:+ %dude leaf/"booting"
:: :+ %dude leaf/"booting"
^- silk
:- home
?~ huv.sat nile
@ -1119,6 +1144,31 @@
::
%feel
+>.$(qic.sat ~)
::
%took
=+ qol=(~(get by qel.sat) ost)
:: ~& [%yawn-took-has ost qol [our hen]]
%= +>.$
qic.sat ~
qel.sat
?~ qol
:: ~& [%took-underflow our hen]
qel.sat
?: =(`1 qol)
(~(del by qel.sat) ost)
(~(put by qel.sat) ost (dec u.qol))
==
::
%told
=+ qol=(~(get by qel.sat) ost)
:: ~& [%yawn-told-has ost qol [our hen]]
=+ qul=?~(qol 1 +(u.qol))
=. qel.sat (~(put by qel.sat) ost qul)
:: XX turn me back on!
:: ?: =(10 qul)
:: ~& [%yawn-told-full ost our hen]
:: +>.$(qic.sat ~, vey.sat (~(put to vey.sat) hen %nuke p.kon))
+>.$(qic.sat ~)
::
%load
=+ [hom=(slot 2 q.p.kon) old=(slot 3 q.p.kon)]
@ -1143,21 +1193,39 @@
(yawl [%pull ~] leaf/"pulling" u.huv.sat [[%atom %ud] ost])
::
%mess
=+ ^= cog ^- term
?: =(%$ p.q.kon) %poke
=+ goc=(cat 3 'poke-' p.q.kon)
?:((warm goc) goc %poke)
=+ ^- cog=term
=- |- ?~ goz ?:((warm %pock) %pock %poke)
?: (warm i.goz) i.goz
$(goz t.goz)
^- goz=(list term)
?: =(%$ p.q.kon)
/pock
=+ ^= goc
|= [a=term b=(list term)]
[(cat 3 'pock-' a) (cat 3 'poke-' a) b]
=+ ofs=(met 3 app.sat)
?. .= (cat 3 app.sat '-') :: XX temporary, until /=main=/bin
(end 3 +(ofs) p.q.kon)
(goc p.q.kon /pock)
:(goc p.q.kon (rsh 3 ofs p.q.kon) /pock)
=+ hyp=?=(%pock (end 3 4 cog))
?. (warm cog)
(give(qic.sat ~) %mean ~ %poke-find-fail ~)
?> ?=(^ huv.sat)
=+ sam=:(slop [[%atom %ud] ost] [[%atom %p] p.kon] q.q.kon)
=+ err=?.(=(%poke cog) <cog> "%poke with mark <p.q.kon>")
=+ ^= sam
;: slop
[[%atom %ud] ost]
[[%atom %p] p.kon]
?.(hyp q.q.kon (slop !>(p.q.q.kon) q.q.kon))
==
=+ err=?.(?=(?(%poke %pock) cog) <cog> "{<cog>} with mark <p.q.kon>")
:: ~& [%mess-poke cog]
%+ ford /s/poke
:+ %dude leaf/"poking {err}"
[%call (harm cog (conf (core u.huv.sat))) (cove %$ sam)]
::
%show
:: ~& showing/[app.sat imp q.kon]
?: (warm %peer)
=+ sam=!>([ost p.kon q.kon])
?> ?=(^ huv.sat)
@ -1190,6 +1258,17 @@
(xeno [q.kon imp] %feel ~)
::
%take
?: ?& ?=([%g %rush @ *] q.q.kon)
|((warm %posh) (warm (cat 3 'posh-' &3.q.q.kon)))
==
?> ?=(^ huv.sat)
=+ [goc gil]=[(cat 3 'posh-' &3.q.q.kon) (spec (slot 7 q.kon))]
=. - ?:((warm goc) [goc (slot 3 gil)] [%posh gil])
=+ sam=:(slop [[%atom %ud] ost] !>(p.kon) gil)
%+ ford /s/pour
:+ %dude leaf/"pouring"
:+ %dude (skol p.gil)
[%call (harm goc (conf (core u.huv.sat))) (cove %$ sam)]
?: (warm %purr)
?> ?=(^ huv.sat)
=+ sam=:(slop [[%atom %ud] ost] !>(p.kon) !>(p.q.kon) q.kon)

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
:: %jael is logically homogeneous, but please follow these conventions:
::
:: /cap :: foreign app keys
:: /service :: service name, eg %face
:: /service :: service name, eg %face for FB
:: /appid :: your ship's app-id
:: /@uvH :: by hash
:: /@ud :: by number
@ -25,7 +25,7 @@
:: structures
|%
++ axle :: %jael state
$: %0 ::
$: %0 :: %jael version
ent=@ :: entropy
sef=safe :: secret tree
red=(map duct (set path)) :: reverse subscribers
@ -36,22 +36,69 @@
== ::
++ kiss :: in request ->$
$% [%kill p=path] :: discard secret
[%make p=@uw q=(unit ,@da) r=@ud s=path] :: create secret
[%make p=@uw q=(unit ,@da) r=@ud s=path] :: generate random
[%nuke ~] :: erase subscriber
[%prim p=@uw q=(unit ,@da) r=perm s=path] :: forge prime
[%tell p=@uw q=(unit ,@da) r=path] :: save secret
== ::
++ move ,[p=duct q=[%give p=gift]] :: local move
++ move ,[p=duct q=(mold note gift)] :: typed move
++ note :: out request $->
$% $: %t :: to %time
$% [%wait p=@da] ::
[%rest p=@da] ::
== == == ::
++ perm (pair ,@ud (list ,@ud)) :: prime definition
++ safe ::
$: nub=@uw :: secret
$: nub=(unit ,@uw) :: secret
dex=(unit ,@da) :: expiration
sud=(set duct) :: subscribers
kin=(map term safe) :: children
== ::
-- ::
:: programs
|%
++ bu
|_ $: xap=path
fes=(list safe)
moz=(list move)
==
axle
::
++ bu-abet :: resolve
^- axle
?~ xap +<+
%= bu-abet
xap t.xap
fes t.fes
sef %= i.fes
kin
?: =(*safe sef)
(~(del by kin.i.fes) i.xap)
(~(put by kin.i.fes) i.xap sef)
==
==
::
++ bu-kill :: destroy
^+ .
=+ dus=(~(tap by
::
++ bu-ajar :: descend
|= pax=path
^+ +>
?~ pax +>.$
%= $
pax t.pax
xap [i.pax xap]
fes [sef fes]
sef (fall (~(get by kin.sef) i.pax) *safe)
==
--
++ bury
|= [pax=path lex=axle]
(~(bu-ajar bu [~ ~ ~] tof.lex lex) pax)
--
. ==
=| axle
=* lex -
|= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core
|% ::
@ -59,7 +106,16 @@
|= [hen=duct hic=(hypo (hobo kiss))]
^- [p=(list move) q=_..^$]
=> .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic)))
!!
=^ moz +>+>-
=< bu-abet
?- -.p.q.hic
%kill
kill:(bury p.p.q.hic +>+>-)
::
%make
%nuke
%tell
==
::
++ doze
|= [now=@da hen=duct]

View File

@ -62,7 +62,7 @@
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
~& %lunt-reset
~& %khan-reset
..^$
..^$(+>- u.lox)
::

View File

@ -1,12 +1,19 @@
::
:: zuse (3), standard library (tang)
::
~% %zuse + ~
|%
:::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 3b, Arvo libraries ::::
:: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 3bA, lite number theory ::
::
++ dope
~/ %dope
|= a=@
~& [%dope-zuse (mug +>)]
:(mul a a a)
::
++ fu :: modulo (mul p q)
|= a=[p=@ q=@]
=+ b=?:(=([0 0] a) 0 (~(inv fo p.a) (~(sit fo p.a) q.a)))
@ -415,31 +422,46 @@
" " "+0000"
==
::
++ stud :: parse UTC format
|= cud=tape
^- (unit date)
=- ?~ tud ~
`[[%.y &3.u.tud] &2.u.tud &1.u.tud &4.u.tud &5.u.tud &6.u.tud ~]
^= tud
%+ rust cud
;~ plug
;~(pfix (stun [5 5] next) dim:ag)
++ stud !: :: parse UTC format
=< |= a=cord :: expose parsers
%+ biff (rush a (more sepa elem))
|= b=(list ,_(wonk *elem)) ^- (unit date)
=- ?.((za:jo -) ~ (some (zp:jo -)))
^+ =+ [*date u=unit]
*[(u ,_[a y]) (u ,_m) (u ,_d.t) (u ,_+.t) ~]
:~ :: XX types
|-(?~(b ~ ?.(?=(%y -.i.b) $(b t.b) `+.i.b)))
|-(?~(b ~ ?.(?=(%m -.i.b) $(b t.b) `+.i.b)))
|-(?~(b ~ ?.(?=(%d -.i.b) $(b t.b) `+.i.b)))
|-(?~(b ~ ?.(?=(%t -.i.b) $(b t.b) `+.i.b)))
==
|%
::
%+ cook
|= a=tape
=+ b=0
|- ^- @
?: =(a (snag b (turn mon:yu |=(a=tape (scag 3 a)))))
+(b)
$(b +(b))
(ifix [ace ace] (star alf))
++ snug
|= a=wall
|= b=tape
=+ [pos=1 len=(lent b)]
|- ^- (unit ,@u)
?~ a ~
?: =(b (scag len i.a))
`pos
$(pos +(pos), a t.a)
::
;~(sfix dim:ag ace)
;~(sfix dim:ag col)
;~(sfix dim:ag col)
dim:ag
(cold ~ (star next))
==
::
++ sepa ;~(pose ;~(plug com (star ace)) (plus ace))
++ elem
;~ pose
(stag %t t) (stag %y y) (stag %m m) (stag %d d)
(stag %w w) (stag %z z)
==
::
++ y (stag %& (bass 10 (stun 3^4 dit)))
++ m (sear (snug mon:yu) (plus alf))
++ d (bass 10 (stun 1^2 dit))
++ t [;~(plug - - + (easy ~))]:[;~(sfix d col) d]
++ w (sear (snug wik:yu) (plus alf))
++ z [;~(plug (mask "-+") . .)]:(bass 10 (stun 2^2 dit))
--
::
++ unt :: UGT to UTC time
|= a=@
@ -502,19 +524,18 @@
==
::
++ poja :: parse JSON
=< |=(a=cord (rush a apex))
=< |=(a=cord `(unit json)`(rush a apex))
|%
++ apex :: JSON value
%+ knee *json |. ~+
;~ pfix spac
;~ pose
(cold ~ (jest 'null'))
(stag %b bool)
(stag %s stri)
(cook |=(s=tape [%n p=(rap 3 s)]) numb)
abox
obox
==
%+ ifix [spac spac]
;~ pose
(cold ~ (jest 'null'))
(stag %b bool)
(stag %s stri)
(cook |=(s=tape [%n p=(rap 3 s)]) numb)
abox
obox
==
++ tops ;~(pose abox obox) :: JSON strict
:: JSON arrays
@ -619,13 +640,16 @@
=+ man=`mane`n.g.mex
=. unq |(unq =(%script man) =(%style man))
=+ tam=(name man)
=. rez :(weld "</" tam ">" rez)
=+ att=`mart`a.g.mex
:- '<'
%+ welp tam
=. rez ['>' (many c.mex rez)]
?~(att rez [' ' (attr att rez)])
::
=- ?~(att rez [' ' (attr att rez)])
^- rez=tape
::?~ c.mex
:: [' ' '/' '>' rez]
:- '>'
(many c.mex :(weld "</" tam ">" rez))
:: ::
++ attr :: attributes to tape
|= [tat=mart rez=tape]
^- tape
@ -670,17 +694,17 @@
::
++ poxa :: xml parser
=< |=(a=cord (rush a apex))
|%
|_ ent=_`(map term ,@t)`[[%apos '\''] ~ ~]
++ apex
=+ spa=;~(pose comt whit)
%+ knee *manx |. ~+
%+ ifix [(star spa) (star spa)]
;~ pose
%+ sear |=([a=marx b=marl c=mane] ?.(=(c n.a) ~ (some [a b])))
;~(plug head (more (star comt) ;~(pose apex chrd)) tail)
;~(plug head many tail)
empt
==
::
::
++ attr :: attributes
%+ knee *mart |. ~+
%- star
@ -696,7 +720,7 @@
::
++ chrd :: character data
%+ cook |=(a=tape ^-(mars :/(a)))
(plus ;~(less soq doq ;~(pose (just `@`10) escp)))
(plus ;~(less doq ;~(pose (just `@`10) escp)))
::
++ comt :: comments
=- (ifix [(jest '<!--') (jest '-->')] (star -))
@ -705,16 +729,20 @@
whit
;~(less (jest '-->') hep)
==
::
++ escp
::
++ escp ;~(pose ;~(less gal gar pam prn) enty)
++ enty :: entity
%+ ifix pam^sem
;~ pose
;~(less gal gar pam prn)
(cold '>' (jest '&gt;'))
(cold '<' (jest '&lt;'))
(cold '&' (jest '&amp;'))
(cold '"' (jest '&quot;'))
(cold '\'' (jest '&apos;'))
=+ def=`_ent`(mo [%gt '>'] [%lt '<'] [%amp '&'] [%quot '"'] ~)
%+ sear ~(get by (~(uni by def) ent))
(cook crip ;~(plug alf (stun 1^31 aln)))
%+ cook |=(a=@c ?:((gth a 0x10.ffff) '<27>' (tuft a)))
=< ;~(pfix hax ;~(pose - +))
:- (bass 10 (stun 1^8 dit))
(bass 16 ;~(pfix (mask "xX") (stun 1^8 hit)))
==
::
++ empt :: self-closing tag
%+ ifix [gal (jest '/>')]
;~(plug ;~(plug name attr) (cold ~ (star whit)))
@ -722,6 +750,9 @@
++ head :: opening tag
(ifix [gal gar] ;~(plug name attr))
::
++ many
(more (star comt) ;~(pose apex chrd))
::
++ name :: tag name
=+ ^= chx
%+ cook crip
@ -769,6 +800,11 @@
++ bu :: boolean not
|=(jon=json ?.(?=([%b *] jon) ~ [~ u=!p.jon]))
::
++ ci :: maybe transform
|* [poq=$+(* *) wit=fist]
|= jon=json
(biff (wit jon) poq)
::
++ cu :: transform
|* [poq=$+(* *) wit=fist]
|= jon=json
@ -777,7 +813,7 @@
++ da :: UTC date
|= jon=json
?. ?=([%s *] jon) ~
(bind (stud (trip p.jon)) |=(a=date (year a)))
(bind (stud p.jon) |=(a=date (year a)))
::
++ di :: millisecond date
%- cu :_ ni
@ -834,6 +870,18 @@
?. ?=([%o *] jon) ~
(zm (~(run by p.jon) wit))
::
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
=- (zl (turn (~(tap by a)) -))
|* [a=cord b=*]
=+ nit=(rush a fel)
?~ nit ~
(some [u.nit b])
::
++ pe :: prefix
|* [pre=* wit=fist]
(cu |*(a=* [pre a]) wit)
@ -878,7 +926,7 @@
::
++ zm :: collapse unit map
|* lum=(map term (unit))
?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
?: (~(rep by lum) |=([[@ a=(unit)] b=_|] |(b ?=(~ a))))
~
(some (~(run by lum) need))
--
@ -905,6 +953,11 @@
?: =(0 a) '0'
(crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
::
++ jode :: ms timestamp
|= a=time
=- (jone (div (mul - 1.000) ~s1))
(add (div ~s1 2.000) (sub a ~1970.1.1))
::
++ jesc
|= a=@ ^- tape
?+ a [a ~]
@ -961,10 +1014,6 @@
=+ buf=(rap 3 (turn wol |=(a=tape (crip (weld a `tape`[`@`10 ~])))))
[(met 3 buf) buf]
::
::
++ txml :: string to xml
|= tep=tape ^- mars
[[%$ [%$ tep] ~] ~]
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 3bE, tree sync ::
::
@ -1968,11 +2017,6 @@
==
[p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]]
::
++ meat :: kite to .^ path
|= kit=kite
^- path
[(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
::
++ tame :: parse kite path
|= hap=path
^- (unit kite)
@ -2029,16 +2073,6 @@
[~ [i.rax ~]]
[q.u.raf [p.u.raf ~]]
::
++ fain :: path restructure
|= [hom=path raw=path]
=+ bem=(need (tome raw))
=+ [mer=(flop s.bem) moh=(flop hom)]
|- ^- (pair beam path)
?~ moh
[bem(s hom) (flop mer)]
?> &(?=(^ mer) =(i.mer i.moh))
$(mer t.mer, moh t.moh)
::
++ fuel :: parse fcgi
|= [bem=beam but=path]
^- epic
@ -2144,7 +2178,7 @@
|= har=hart
^- tape
;: weld
?:(&(p.har !=([& /localhost] r.har)) "https://" "http://")
?:(&(p.har !?=(hoke r.har)) "https://" "http://")
::
?- -.r.har
| (trip (rsh 3 1 (scot %if p.r.har)))
@ -2172,7 +2206,7 @@
--
::
++ epur :: url/header parser
=< |=(a=cord (rush a auri))
=< |=(a=cord `(unit purl)`(rush a auri))
|%
++ apat :: 2396 abs_path
%+ cook deft
@ -2180,7 +2214,7 @@
++ auri :: 2396 URL
%+ cook
|= a=purl
?.(=([& /localhost] r.p.a) a a(p.p &))
?.(?=(hoke r.p.a) a a(p.p &))
;~ plug
;~ plug
%+ sear
@ -2615,6 +2649,14 @@
?: ?=(| -.mud) mud
(mule |.((slam p.mud sam)))
::
++ pack :: light path encoding
|= [a=term b=path] ^- span
%+ rap 3 :- (wack a)
(turn b |=(c=span (cat 3 '_' (wack c))))
::
++ pick :: light path decoding
=+ fel=(most cab (sear wick urt:ab))
|=(a=span `(unit ,[p=term q=path])`(rush a fel))
++ saxo :: autocanon
|= who=ship
^- (list ship)
@ -2665,7 +2707,6 @@
q=(unit ,[p=cash q=*]) :: file
r=(map ,@ta ankh) :: folders
== ::
++ ankz ,[p=@ (map ,@ta ankz)] :: trimmed ankh
++ apex ,[p=@uvI q=(map ,@ta ,@uvI) r=(map ,@ta ,~)] :: node report (old)
++ ares (unit ,[p=term q=(list tank)]) :: possible error
++ ball ,@uw :: statement payload
@ -2796,7 +2837,6 @@
ton=town :: security
zac=(map ship corn) :: flows by server
== ::
++ frog ,[p=@da q=nori] :: time and change
++ gank (each vase (list tank)) :: abstract result
++ gift :: one-way effect
$% [%$ p=vase] :: trivial output
@ -2888,6 +2928,8 @@
++ hoot ,[p=? q=(unit ,@ud) r=host] :: secure/port/host
++ hort ,[p=(unit ,@ud) q=host] :: http port/host
++ host $%([& p=(list ,@t)] [| p=@if]) :: http host
++ hoke %+ each ,[%localhost ~] :: local host
?(%.0.0.0.0 %.127.0.0.1) ::
++ httq :: raw http request
$: p=meth :: method
q=@t :: unparsed url
@ -2907,11 +2949,7 @@
[%b p=?] :: boolean
[%o p=(map ,@t json)] :: object
[%n p=@ta] :: number
[%s p=@ta] :: string
== ::
++ jsot :: strict json top
$% [%a p=(list json)] :: array
[%o p=(map ,@t json)] :: object
[%s p=@t] :: string
== ::
++ lamb :: short path
$% [& p=@tas] :: auto
@ -2942,10 +2980,8 @@
[%wan p=wain] :: text lines
[%zap p=@ud q=(list tank)] :: status/error
== ::
++ luge ,[p=mark q=*] :: fully typed content
++ maki ,[p=@ta q=@ta r=@ta s=path] ::
++ mace (list ,[p=life q=ring]) :: private secrets
++ marv ?(%da %tas %ud) :: release form
++ math (map ,@t (list ,@t)) :: semiparsed headers
++ meal :: payload
$% [%back p=cape q=flap r=@dr] :: acknowledgment
@ -3107,7 +3143,6 @@
++ step ,[p=bray q=gens r=pass] :: identity stage
++ tako ,@ :: yaki ref
++ tart $+([@da path note] bowl) :: process core
++ taxi ,[p=lane q=rock] :: routed packet
++ tick ,@ud :: process id
++ toro ,[p=@ta q=nori] :: general change
++ town :: all security state
@ -3132,6 +3167,5 @@
[%chan (list $|(@ud [p=@ud q=@ud]))] ::
++ wund (list ,[p=life q=ring r=acru]) :: mace in action
++ will (list deed) :: certificate
++ worm ,* :: vase of tart
++ zuse %314 :: hoon/zuse kelvin
++ zuse %310 :: hoon/zuse kelvin
--

21
main/app/bang/core.hook Normal file
View File

@ -0,0 +1,21 @@
:: Bang: send cards to arvo
::
:::: /hook/core/bang/app
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ lima |*(a=(pole) ?~(a ~ [i t]=a(+ (..$ +.a))))
++ poke--args
|* [ost=bone @ a=[* (pole)]]
=> .(a ^.(lima a))
:_(+> (turn a |*(b=_i.a [ost %pass / b])))
::
++ pour
%- add-exit
|= [@ * sih=*]
~& bang-resp/(,[term term] [&1 &2]:sih)
`+>.$
--

View File

@ -1,16 +1,17 @@
/- begin-args
::
|%
++ sign
$% $: %a
$% [%went p=ship q=cape]
[%init p=@p]
== == ==
++ began-args ,[his=@p tic=@p eny=@t ges=gens]
++ began-args ,[his=@p tic=@p eny=@t ges=gens ~]
--
::
!:
::::
::
|_ [hid=hide %0 ust=bone his=@p mac=mace]
++ peer ,_`.
++ poke-began-args
|= [ost=bone you=ship began-args]
=+ bur=(shax :(mix (jam ges) eny))
@ -26,9 +27,13 @@
:_ +>.$
?~ wil
[ust %give %mean ~ %rejected ~]~
:_ :_ ~
[ust %give %nice ~]
[ust %pass / %a %cash his mac u.wil]
:~ [ust %pass / %a %cash his mac u.wil]
[ust %pass / %c %plug our.hid %main (sein our.hid) %main]
[ust %pass / %c %plug our.hid %arvo (sein our.hid) %arvo]
[ust %pass / %c %plug our.hid %try (sein our.hid) %try]
[ust %give %nice ~]
==
::
++ pour
|= [ost=bone pax=path sih=*]
@ -40,8 +45,4 @@
%went ~
==
::
++ peer
|=
*
`+>
--

View File

@ -1,5 +1,3 @@
/- begin-args
::
|%
++ sign
$% $: %g
@ -19,14 +17,17 @@
--
::
!:
::::
::
|_ [hid=hide sat=state form]
++ peer ,_`.
++ done
|= ost=bone
:_ +>.$
:* :* ost %pass /to-gan %g %mess [our.hid /began] our.hid
%began-args !>([his tic eny ges])
%began-args !>([his tic eny ges ~])
==
(spam %rush %prompt "[waiting...]" %text '')
(spam %rush %prompt '[waiting...]' %text '')
==
::
++ loon
@ -377,149 +378,17 @@
:_ +>.$(q.ges [%duke wat], sat %done)
[`['' %text ''] ~]
::
%done !!
%done !! :: can't actually complete event because vere commits suicide
::[[`['[waiting...]' %text ''] ~] +>.$]
==
::
++ poke-begin-args
|= [ost=bone you=ship arg=(list)]
=^ sot +>.$
?~ arg [%begin +>.$]
=+ ((soft ,@p) i.arg)
?~ - [%begin +>.$]
=. his u.-
?~ t.arg [%his +>.$]
=+ ((soft ,@p) i.t.arg)
?~ - [%his +>.$]
=. tic u.-
?~ t.t.arg [%tic +>.$]
=+ ((soft ,@t) i.t.t.arg)
?~ - [%tic +>.$]
=. eny u.-
?~ t.t.t.arg [%eny +>.$]
=+ ((soft lang) i.t.t.t.arg)
?~ - [%eny +>.$]
?~ (glon u.-) [%eny +>.$]
=. p.ges u.-
=+ ran=(clan his)
=* sec t.t.t.t.arg
?~ sec [%lag +>.$]
?- ran
?(%czar %pawn) %begin
?(%king %earl)
=+ ((soft ,@t) i.sec)
?~ - [%lag +>.$]
=. q.ges
?- ran
%king [%king u.-]
%earl [%earl u.-]
==
[%done +>.$]
::
%duke
=+ ((soft ?(%anon %lady %lord %punk)) i.sec)
?~ - [%lag +>.$]
?- u.-
%anon
=. q.ges [%duke %anon ~]
[%done +>.$]
::
%punk
?~ t.sec [%form +>.$]
=+ ((soft ,@t) i.t.sec)
?~ - [%form +>.$]
=. q.ges [%duke %punk *sect u.-]
?~ t.t.sec [%pname +>.$]
=+ ((soft sect) i.t.t.sec)
?~ - [%pname +>.$]
?> ?=(%duke -.q.ges)
?> ?=(%punk -.p.q.ges)
=. q.ges [%duke %punk u.- q.p.q.ges]
[%done +>.$]
::
?(%lady %lord)
=. q.ges
^- gcos
:- %duke
?- u.-
%lady [%lady *whom]
%lord [%lord *whom]
==
?~ t.sec [%form +>.$]
=+ ((soft ,@ud) i.t.sec)
?~ - [%form +>.$]
=+ ^= wat
=+ woh=`whom`[u.- *govt *sect *name]
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges `gcos`[%duke wat]
?~ t.t.sec [%year +>.$]
=+ ((soft govt) i.t.t.sec)
?~ - [%year +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ woh=`whom`[p.p.p.q.ges u.- *sect *name]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges [%duke wat]
?~ t.t.t.sec [%govt +>.$]
=+ ((soft sect) i.t.t.t.sec)
?~ - [%govt +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges u.- *name]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges [%duke wat]
=+ nam=((hard (list)) |8.arg)
?~ nam [%sect +>.$]
=+ ((soft ,@t) i.nam)
?~ - [%sect +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ nym=`name`[u.- *(unit ,@t) *(unit ,@t) *@t]
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nym]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
~! nama=nam
=. q.ges `gcos`[%duke wat]
~! namb=nam
?~ t.nam [%fname +>.$]
=+ ((soft (unit ,@t)) i.t.nam)
?~ - [%fname +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ nym=[p.s.p.p.q.ges u.- *(unit ,@t) *@t]
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nym]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges [%duke wat]
?~ t.t.nam [%mname +>.$]
=+ ((soft (unit ,@t)) i.t.t.nam)
?~ - [%mname +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ nym=[p.s.p.p.q.ges q.s.p.p.q.ges u.- *@t]
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nym]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges [%duke wat]
?~ t.t.t.nam [%nname +>.$]
=+ ((soft ,@t) i.t.t.t.nam)
?~ - [%nname +>.$]
=+ ^= wat
?> ?=(%duke -.q.ges)
?> ?=(?(%lady %lord) -.p.q.ges)
=+ nym=[p.s.p.p.q.ges q.s.p.p.q.ges r.s.p.p.q.ges u.-]
=+ woh=`whom`[p.p.p.q.ges q.p.p.q.ges r.p.p.q.ges nym]
`what`?-(-.p.q.ges %lord [%lord woh], %lady [%lady woh])
=. q.ges [%duke wat]
[%done +>.$]
==
==
|= [ost=bone you=ship arg=$|(~ [his=ship ~])]
=^ res +>.$
^- [[pot=(unit ,[cord prom cord]) tak=(list cord)] _+>.$]
(next(sat sot) '')
?~ arg
(next(sat %begin) '')
(next(sat %his) (rsh 3 1 (scot %p his.arg)))
:_ +>.$
%+ welp
:~ [ost %pass /in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
@ -527,8 +396,8 @@
==
%+ welp
?~(pot.res ~ (spam %rush %prompt u.pot.res))
%- zing
(turn (flop tak.res) |=(a=cord (spam %rush %txt a)))
%^ spam %rush %tang
(turn (flop tak.res) |=(a=cord [%leaf (trip a)]))
::
++ pour
|= [ost=bone pax=path sih=*]
@ -545,8 +414,8 @@
:_ +>.$
%+ welp
?~(pot.res ~ (spam %rush %prompt u.pot.res))
%- zing
(turn (flop tak.res) |=(a=cord (spam %rush %txt a)))
%^ spam %rush %tang
(turn (flop tak.res) |=(a=cord [%leaf (trip a)]))
:_ +>.$
:- [ost %give +.sih]
?+ +<.sih ~
@ -564,10 +433,6 @@
[%leaf "begin failed"]
==
++ peer
|=
*
`+>
::
++ spam
|* git=*

View File

@ -1,27 +1,35 @@
:: ConCATenate file listings
::
:::: /hook/core/cat/app
::
/+ sh-utils
// /%%%/ls/subdir
!:
::::
::
|_ [hid=hide ~]
++ poke-cat-args
|= [ost=bone you=ship arg=(list path)]
:_ +>.$
:* [ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang
%- flop
^- (list tank)
%- zing
%+ turn arg
|= pax=path
=+ ark=;;(arch .^(%cy pax))
?~ q.ark ~[leaf/"file {<pax>} not available"]
:- leaf/(spud pax)
%+ turn (lore ;;(,@t .^(%cx pax)))
|= a=cord
leaf/(trip a)
++ peer ,_`.
++ poke--args
%+ args-into-gate .
|= [arg=(list path)]
=- tang/(zing -)
%+ turn arg
|= pax=path
^- tang
=+ ark=;;(arch .^(%cy pax))
?^ q.ark
:- leaf/(spud pax)
%+ turn (lore ;;(@t .^(%cx pax)))
|=(a=cord leaf/(trip a))
?- r.ark :: handle ambiguity
~
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
[[@t ~] ~ ~]
$(pax (welp pax /[p.n.r.ark]))
*
=- [palm/[": " ``~]^-]~
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
`tank`(subdir pax r.ark)
==
==
++ peer
|=
*
`+>
--

View File

@ -8,7 +8,7 @@
$: %0
air=(map path station)
pom=(unit ship)
sen=(qeu mess)
sen=(set mess)
$= fal
$: eth=?
qit=?
@ -59,6 +59,7 @@
$% [%mess p=hapt q=ship r=cage]
[%nuke p=hapt q=ship]
[%show p=hapt q=ship r=path]
[%took p=hapt q=ship]
== == ==
++ sign
$? $: %g
@ -141,12 +142,12 @@
[(send /out %give %rush %tang [%leaf "invalid input"] ~) +>.$]
|-
?- -.u.rey
%all =+ ^= mof
%all =+ ^= mof
?~ pom ~
(send /out %give %rush %prompt '& ' %text '')
=^ mow +>.^$
(poke-zung(pom ~) ost our.hid %mess sat.fal p.u.rey)
[(welp mof mow) +>.^$(sen (~(put to sen) p.u.rey))]
[(welp mof mow) +>.^$(sen (~(put in sen) p.u.rey))]
%back
:_ +>.^$
%^ send /out %give :+ %rush %tang
@ -219,9 +220,7 @@
;title: Radio
;script(type "text/javascript", src "//use.typekit.net/fkv0sjk.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script:'''
try{Typekit.load();}catch(e){}
'''
;script:'try{Typekit.load();}catch(e){}'
;link(rel "stylesheet", type "text/css", href "/gen/main/pub/src/chat/main.css");
==
;body
@ -293,11 +292,17 @@
==
[~ +>.$]
::
++ pass-took
|= [moz=(list move) ost=bone pax=path imp=path]
:_ +>.$
:_(moz [ost %pass pax %g %took [our.hid imp] our.hid])
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
:: ~& sih=sih
=+ sih=((hard sign) sih)
=+ took=|=([imp=path moz=(list move)] (pass-took moz ost pax imp))
?~ pax ~& %chat-pour-strange-path !!
:: ~& [%pour-mess pax]
?+ i.pax ~& %chat-pour-strange-path !!
@ -307,7 +312,8 @@
%mean [(send /out %give +.sih) +>.$]
?(%rush %rust)
?> ?=(%txt -.p.sih)
(exec-cmd ost p.p.sih)
=^ moz +>.$ (exec-cmd ost p.p.sih)
(took +.imp.hid moz)
==
::
?(%mesg %priv)
@ -319,14 +325,21 @@
[~ +>.$]
?> ?=(%rush +<.sih)
?> ?=(%zong -.p.sih)
:_ +>.$
(send /out %give %rush %tang (zong-to-tank & p.p.sih) ~)
(took /chat (send /out %give %rush %tang (zong-to-tank & p.p.sih) ~))
::
?(%radi-a %radi-m)
?: ?=(?(%nice %mean) +<.sih)
?: ?=(%nice +<.sih)
:_ +>.$
?: ?=(%radi-a i.pax) ~
[ost %give +.sih]~
?: ?=(%mean +<.sih)
:_ +>.$ :_ ~
=- ~& [%trying-again -] -
:* ost %pass pax %g %show
[pad.fal /radio] our.hid
?-(i.pax %radi-a %amigos, %radi-m %mensajes)
sat.fal
==
=+ ya=(grab t.pax)
=. ya
?- i.pax
@ -357,28 +370,33 @@
=+ ^= pout ?:(=(i.pax %radi-a) %amigos %mensajes)
=. air (~(put by air) t.pax ya)
=+ mow=(send [pout t.pax] %give +.sih)
=< [mow +>.$]
=< (took /radio mow)
:: =< [mow +>.$]
:: XX yes, I just used an inline comment
:: XX and multiple XX's. why? because
:: XX tmi is incredibly lame.
^+ .
?: =(%zong -.p.sih)
=+ zog=((hard zong) p.p.sih)
?: &(=(our.hid q.zog) =(`r.zog ~(top to sen)))
%_(+ sen ^+(sen ~(nap to sen)))
?: &(=(our.hid q.zog) (~(has in sen) r.zog))
+
:: ?: &(=(our.hid q.zog) =(`r.zog ~(top to sen)))
:: %_(+ sen ^+(sen ~(nap to sen)))
%_ +
mow
(welp mow (send /out %give %rush %tang (zong-to-tank | zog) ~))
==
?: =(%zongs -.p.sih)
=+ zos=((hard (list zong)) p.p.sih)
=+ zos=(scag 200 ((hard (list zong)) p.p.sih))
=< +(mow (flop mow))
|- ^+ +.$
?: =(~ zos) +.$ :: XX tm freakin i
=+ zoy=((hard zong) -.zos)
=. +.$ $(zos +.zos)
?: &(=(our.hid &3.zoy) =(`&4.zoy ~(top to sen)))
%_(+.$ sen `(qeu mess)`~(nap to sen))
?: &(=(our.hid &3.zoy) (~(has in sen) &4.zoy))
+.$
:: ?: &(=(our.hid &3.zoy) =(`&4.zoy ~(top to sen)))
:: %_(+.$ sen `(qeu mess)`~(nap to sen))
%_ +.$
mow
(welp mow (send /out %give %rush %tang (zong-to-tank | zoy) ~))

9
main/app/code/core.hook Normal file
View File

@ -0,0 +1,9 @@
:: Show passcode
/+ sh-utils
|_ [hide ~]
++ peer ,_`.
++ poke--args
%+ args-into-gate .
=+ pax=/(crip <our>)/code/(crip <lat>)/(crip <our>)
,_tang/~[leaf/"{<(,@p .^(%a pax))>}"]
--

View File

@ -1,9 +1,13 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-cp-args
|= [ost=bone you=ship input=path output=path ~]
:_ +>.$
:* [ost %pass /cp %c %info our.hid (foal output .^(%cx input))]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
@ -11,8 +15,4 @@
:- %tang :_ ~
leaf/"copied"
==
++ peer
|=
*
`+>
--

21
main/app/gnab/core.hook Normal file
View File

@ -0,0 +1,21 @@
:: gnaB: send gift to arvo
::
:::: /hook/core/gnab/app
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ lima |*(a=(pole) ?~(a ~ [i t]=a(+ (..$ +.a))))
++ poke--args
|* [ost=bone @ a=[* (pole)]]
=> .(a ^.(lima a))
:_(+> (turn a |*(b=_i.a [ost %give b])))
::
++ pour
%- add-exit
|= [@ * sih=*]
~& gnab-resp/(,[term term] [&1 &2]:sih)
`+>.$
--

View File

@ -10,6 +10,8 @@
--
::
!:
::::
::
|_ [hid=hide arg=cord]
++ poke-grep-args
|= [ost=bone you=ship arg=cord ~]
@ -29,7 +31,7 @@
%nice
[ost %give %nice ~]~
%rush
%+ weld (spam %rush %prompt 'searching for {<arg>}...')
%+ weld (spam %rush %prompt 'searching for {<arg>}...' %text ~)
%- spam
?- &3.sih
%txt

View File

@ -1,6 +1,10 @@
:: Hi
:: Hi, send optional message to a ship
::
:::: /hook/gate/hi/bin
:::: /hook/core/hi/bin
::
/+ sh-utils
::
::::
::
|%
++ sign ::
@ -13,37 +17,30 @@
[%text p=tape] ::
== ::
--
::
!:
::::
::
|_ [hid=hide ~]
++ poke-hi-args
|= [ost=bone you=ship her=ship mes=?(~ [tex=tape ~])]
:_ +>.$
=+ mez=[%txt !>(?~(mes '' (crip tex.mes)))]
:~ [ost %pass /hi/(scot %p her) %g %mess [her /hi] you mez]
[ost %give %nice ~]
==
++ peer ,_`.
++ poke--args
|= [bone you=ship her=ship mes=?(~ [tex=tape ~])]
%. +<
%+ add-resp
=+ mez=[%txt !>(?~(mes '' (crip tex.mes)))]
[%pass /hi/(scot %p her) %g %mess [her /hi] you mez]
(add-nice ,_`+>.$)
::
++ poke-txt
%- add-nice
|= [ost=bone him=ship cor=@t]
:_ +>.$
:~ [ost %pass /di %d %flog %text "< {<him>}: {(trip cor)}"]
[ost %give %nice ~]
==
[ost %pass /di %d %flog %text "< {<him>}: {(trip cor)}"]~
::
++ pour
|= [ost=bone pax=path sih=sign]
?> ?=([%hi @t ~] pax)
:_ +>.$
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
?: ?=(%nice +<.sih)
leaf/"hi {(trip i.t.pax)} successful"
leaf/"hi {(trip i.t.pax)} unsuccessful"
++ peer
|=
*
`+>
%. +<
=+ ack=?+(+<.sih "unsuccesful" %nice "succesful")
(add-exit (print +>.$ "hi {(trip i.t.pax)} {ack}"))
::
--

View File

@ -1,9 +1,13 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-into-args
|= [ost=bone you=ship pax=path dat=@ ~]
:_ +>.$
:* [ost %pass /cp %c %info our.hid (foal pax dat)]
:* [ost %pass /into %c %info our.hid (foal pax dat)]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
@ -11,8 +15,4 @@
:- %tang :_ ~
leaf/"written"
==
++ peer
|=
*
`+>
--

13
main/app/label/core.hook Normal file
View File

@ -0,0 +1,13 @@
!:
::::
::
|_ [hid=hide ~]
++ poke-label-args
|= [ost=bone you=ship syd=@tas lab=@tas ~]
:_ +>.$
:~ [ost %pass /label %c %info our.hid syd %| lab]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
==
++ peer |=(* `+>)
--

View File

@ -1,21 +1,17 @@
:: LiSt directory subnodes
::
::::
::
/+ sh-utils
// /%%/subdir
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-ls-args
|= [ost=bone you=ship arg=path ~]
%+ args-into-gate .
|= [arg=path ~]
=+ lon=((hard arch) .^(%cy arg))
:_ +>.$
:* ::[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang
:_ ~
:+ %rose [" " ~ ~]
(turn (~(tap by r.lon) ~) |=([a=@ta b=*] leaf/(trip a)))
==
++ peer
|=
*
`+>
tang/[?~(r.lon leaf/"~" (subdir arg r.lon))]~
--

20
main/app/ls/subdir.hoon Normal file
View File

@ -0,0 +1,20 @@
|%
++ subdir
|= [pax=path des=(map ,@t ,~)]
^- tank
:+ %rose [" " `~]
%+ turn (sort (~(tap by des)) aor)
|= [kid=@ta ~]
=+ paf=`path`/[kid]
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
(turn paf |=(a=span leaf/(trip a)))
|- ^- [dir=? paf=path]
=+ arf=;;(arch .^(%cy (weld pax paf)))
?^ q.arf
[| paf]
?~ r.arf
[& paf] :: !!
?. ?=([^ ~ ~] r.arf)
[& paf]
$(paf (welp paf /[p.n.r.arf]))
--

View File

@ -1,20 +1,17 @@
:: MoVe file from one location to another
::
:::: /hook/core/mv/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-mv-args
|= [ost=bone you=ship input=path output=path ~]
:_ +>.$
:* :^ ost %pass /cp
:^ %c %info our.hid
(furl (foal output .^(%cx input)) (fray input))
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"moved"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [input=path output=path ~]
:^ %c %info our.hid
(furl (foal output .^(%cx input)) (fray input))
(args-into-gate . ,_[%txt 'moved'])
--

1
main/app/nop/core.hook Normal file
View File

@ -0,0 +1 @@
|_ ^ ++ poke-nop-args ,_`. --

34
main/app/peek/core.hook Normal file
View File

@ -0,0 +1,34 @@
:: Peek imp path || Poke ship imp path. Subscribe to an app.
!:
::::
::
|_ [hide ~]
++ ptah ,[p=path q=path ~]
++ poke-peek-args
|= [ost=bone @ a=?(ptah [her=ship ptah])]
=- :_(+>.$ ~[[ost %give %nice ~] [ost %pass / %g %show -]])
^- [p=[ship path] q=ship r=path]
?^ |2.a [[her p]:a our q.a]
[[our p.a] our q.a]
::
++ posh
|* [@ * git=[@tas *]]
~& peek-posh/git
`+>
++ pour
|= [ost=bone * sih=*]
~& =+ cod=(,[term term] [&1 &2]:sih)
?+ +.cod peek-resp/cod
%nice %peek-nice
%mean
=+ are=((soft ares) |2.sih)
?~ are %peek-mean
?~ u.are %peek-done
~& > p.u.u.are
|-
?~ q.u.u.are %peek-mean
~> %slog.`rose/[~ "! " ~]^[i.q.u.u.are]~
$(q.u.u.are t.q.u.u.are)
==
:_(+> ?+(&2.sih ~ %mean [ost %pass / %g %cide %$]~))
--

30
main/app/poke/core.hook Normal file
View File

@ -0,0 +1,30 @@
:: Poke path [mark *] || Poke ship path [mark *]. Send message to an app.
!:
::::
::
|_ [hide ~]
++ mess ,[p=path q=[@ *] ~]
++ pock-poke-args
|= [ost=bone @ a=type b=?(mess [her=ship mess])]
=- :_(+>.$ [ost %pass / %g %mess -]~)
^- [p=[ship path] q=ship r=cage]
?^ |2.b [[her p]:b our -.q.b (slot 29 [a b])] :: +.&3
[[our p.b] our -.q.b (slot 13 [a b])] :: +.&2
::
++ pour
|= [ost=bone * sih=*]
~& =+ cod=(,[term term] [&1 &2]:sih)
?+ +.cod poke-resp/cod
%nice %poke-nice
%mean
=+ are=((soft ares) |2.sih)
?~ are %poke-mean
?~ u.are %poke-nil-mean
~& > p.u.u.are
|-
?~ q.u.u.are %poke-mean
~> %slog.`rose/[~ "! " ~]^[i.q.u.u.are]~
$(q.u.u.are t.q.u.u.are)
==
:_(+> [ost %pass / %g %cide %$]~)
--

47
main/app/pope/core.hook Normal file
View File

@ -0,0 +1,47 @@
:: Pope, generate key for carrier
::
:::: /hook/core/pope/app
::
/+ sh-utils
!:
::::
::
|%
++ gilt $%([%tang (list tank)] [%prompt @t prom @t])
++ sign
$% [%t %wake ~]
[%g $%([%nice ~] [%rush %txt p=cord])]
==
--
!:
::::
::
=+ cryp=bruw :: XX change to ec2 ++brew eventually
|_ [hide who=@p fra=@t]
++ peer ,_`.
++ poke--args
|= [@ @ who=ship ~]
?> ?=(%czar (clan who))
=. ^who who
=- %.(+<.$ (add-nice (gate-bang ,_noe (return git))))
:- noe=[%g %show our^+.imp our /in/[-.imp]] :: request input
git=prompt/['passphrase: ' %pass '']
::
++ return |=(a=gilt (add-output +> rush/a ,_`+>))
++ pour
|= [@ * sih=*]
=+ sih=;;(sign sih)
?- -.sih
%g ?. ?=(%rush +<.sih) `+>.$
=. fra p.sih
=- %.(+<.$ (gate-bang ,_noe (return tang/~[leaf/msg])))
:- noe=[%t %wait (add ~s1 lat)] :: set print timeout
msg="generating carrier {(scow %p who)} (#{(scow %ud who)})"
::
%t =- %.(+<.$ (add-exit (return tang/-)))
=+ bur=(shax (add who (shax fra)))
=+ arc=(cryp 2.048 bur)
:~ leaf/"generator: {(scow %uw bur)}"
leaf/"fingerprint: {(scow %uw fig:ex:arc)}"
== ==
--

View File

@ -65,16 +65,26 @@
:- [ost %give %nice ~]
(send mensajes/p.zig %give %rush %zong zog)
::
++ poke-bit
|= [ost=bone you=ship ~]
^- [(list move) _+>]
:_ +>.$
%+ turn (~(tap by sup.hid))
|= [ost=bone her=ship pax=path]
[ost %give %mean ~ %reload leaf/"please quit chat and re-enter" ~]
::
++ pull
|= ost=bone
^- [(list move) _+>]
=+ ^- [his=ship pax=path] (~(got by sup.hid) ost)
?. ?=([%mensajes *] pax)
=+ ^- (unit ,[his=ship pax=path])
(~(get by sup.hid) ost)
?~ - ~& %strange-pull [~ +>.$]
?. ?=([%mensajes *] pax.u)
[~ +>.$]
=+ sta=(~(got by p.vat) pax)
=. q.sta %+ ~(put by q.sta) his %.n
=. p.vat %+ ~(put by p.vat) pax sta
[(send amigos/pax %give %rush %user %out his (ident his)) +>.$]
=+ sta=(~(got by p.vat) t.pax.u)
=. q.sta %+ ~(put by q.sta) his.u %.n
=. p.vat %+ ~(put by p.vat) t.pax.u sta
[(send amigos/t.pax.u %give %rush %user %out his.u (ident his.u)) +>.$]
::
++ send
|= [pax=path msg=(mold note gift)]

37
main/app/reboot/core.hook Normal file
View File

@ -0,0 +1,37 @@
:: Reboot %zuse and all kernel vanes
::
:::: /hook/core/reboot/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke--args
%^ add-output .
rush/tang/[leaf/"done"]~
%+ args-into-resp .
|= arg=~
%- turn
:_ |= [tip=@tasD nam=@tas]
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
[%veer tip pax (,@ .^(%cx pax))]
^- (list ,[p=@tas q=@tas])
:~ [%$ %zuse]
[%a %ames]
[%c %clay]
[%d %dill]
[%e %eyre]
[%f %ford]
[%g %gall]
[%t %time]
==
++ pour
%+ gate-bang
=+ pax=/(scot %p our.hid)/=/(scot %da lat.hid)/==count/txt
=+ nuf=(file pax)
=+ num=?~(nuf 0 +((fall (slaw %ud (,@t u.nuf)) 0)))
,_[%c %info our.hid (foal pax num)] :: touch clay to reload apps
,_`.
--

View File

@ -1,22 +1,30 @@
:: Reload kernel vanes, specified by name or letter
::
:::: /hook/core/reload/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-reload-args
|= [ost=bone you=ship all=(list ,@tas)]
:_ +>.$
%+ welp
%+ turn all
|= nam=@tas
=+ tip=(end 3 1 nam)
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
[ost %give %veer ?:(=('z' tip) %$ tip) pax (,@ .^(%cx pax))]
:- [ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"done"
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%^ add-output .
rush/tang/[leaf/"done"]~
%+ args-into-resp .
|= all=(list ,@tas)
%+ 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 ~]
[%veer ?:(=('z' tip) %$ tip) pax (,@ .^(%cx pax))]
--

38
main/app/reset/core.hook Normal file
View File

@ -0,0 +1,38 @@
:: Reset: recompile arvo, from hoon/hoon up
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-reset-args
|= [ost=bone you=ship arg=$|(~ [_| ~])]
:_ +>.$
=+ top=`path`/(scot %p our.hid)/arvo/(scot %da lat.hid)
:^ [ost %give %nice ~]
[ost %pass ?~(arg /refresh /) %t %wait lat.hid]
[ost %give %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]
=+ pax=`path`(welp top /[q])
=+ txt=((hard ,@) .^(%cx (welp pax /hoon)))
[ost %give %veer p pax txt]
++ pour
|= [ost=bone pax=path *]
:_ +>.$
?~ pax ~
:_ ~
=+ paf=/(scot %p our.hid)/=/(scot %da lat.hid)/==count/txt
=+ nuf=(file paf)
=+ num=?~(nuf 0 +((fall (slaw %ud (,@t u.nuf)) 0)))
[ost %pass /touch %c %info our.hid (foal paf num)]
--

View File

@ -1,9 +1,13 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-rm-args
|= [ost=bone you=ship pax=path ~]
:_ +>.$
:* [ost %pass /cp %c %info our.hid (fray pax)]
:* [ost %pass /rm %c %info our.hid (fray pax)]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
@ -11,8 +15,4 @@
:- %tang :_ ~
leaf/"removed"
==
++ peer
|=
*
`+>
--

763
main/app/rodeo/core.hook Normal file
View File

@ -0,0 +1,763 @@
::
:::: /hook/core/rodeo/app
::
/? 314
/- *rodeo, *twitter
/+ rodeo
::
::::
::
!:
=> |% :: data structures
++ house ,[%1 house-1] :: full state
++ house-any :: app history
$% [%1 house-1] :: 1: rodeo
[%0 house-0] :: 0: initial version
== ::
++ house-1 ::
$: stories=(map span story) :: conversations
general=(set bone) :: meta-subscribe
outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox
folks=(map ship human) :: human identities
== ::
++ house-0 :: legacy state
%+ map path ::
,[p=(list zong) q=(map ship ,?)] ::
:: ::
++ zong :: legacy messages
$% $: %mess p=@da q=ship ::
$= r ::
$% [%do p=@t] ::
[%exp p=@t q=tank] ::
[%say p=@t] ::
== == == ::
++ story :: wire content
$: count=@ud :: (lent grams)
grams=(list telegram) :: all history
locals=(map ship (pair ,@da status)) :: local presence
remotes=(map partner atlas) :: remote presence
sequence=(map partner ,@ud) :: partners heard
shape=config :: configuration
known=(map serial ,@ud) :: messages heard
guests=(map bone river) :: message followers
viewers=(set bone) :: presence followers
owners=(set bone) :: config followers
== ::
++ river (pair point point) :: stream definition
++ point :: stream endpoint
$% [%ud p=@ud] :: by number
[%da p=@da] :: by date
== ::
++ gift :: result
$% [%rush %rodeo-report report] :: refresh
[%mean ares] :: cancel
[%nice ~] :: accept
== ::
++ sign :: response
$% $: %e :: from %eyre
$% [%thou p=httr] :: HTTP response
== == ::
$: %g :: application
$% [%mean p=ares] :: cancel
[%nice ~] :: acknowledge
[%rush p=silt] :: subs data
== == ::
$: %t ::
$% [%wake ~] :: timer wakeup
== == == ::
++ silt
$% [%rodeo-report p=report] :: refresh
[%twit-stat p=twit-stat] :: tweet reciept
[%twit-feed p=(list twit-stat)] :: tweet reciept
==
++ move ,[p=bone q=(mold note gift)] :: all actions
++ hapt ,[p=ship q=path] :: app instance
++ note :: requests
$% $: %c ::
$% [%info p=@p q=@tas r=nori] ::
== == ::
$: %e :: through %eyre
$% [%them p=(unit hiss)] :: HTTP request
== == ::
$: %g :: network
$% [%mess p=hapt q=ship r=cage] :: message
[%nuke p=hapt q=ship] :: cancel
[%show p=hapt q=ship r=path] :: subscribe
[%took p=hapt q=ship] :: acknowledge
== == ::
$: %t ::
$% [%wait p=@da] ::
== == == ::
--
|_ [hid=hide house]
++ ra :: transaction core
|_ [ost=bone moves=(list move)]
++ ra-abet :: resolve core
^- [(list move) _+>]
[(flop moves) +>]
::
++ ra-emil :: ra-emit move list
|= mol=(list move)
%_(+> moves (welp (flop mol) moves))
::
++ ra-emit :: emit a move
|= mov=move
%_(+> moves [mov moves])
::
++ ra-ever :: emit success
(ra-emit ost %give %nice ~)
::
++ ra-evil :: emit error
|= msg=cord
~& [%ra-evil msg]
(ra-emit ost %give %mean ~ msg ~)
::
++ ra-hiss :: emit http request
|= [pax=path hiz=hiss]
(ra-emit ost %pass pax %e %them ~ hiz)
::
++ ra-house :: emit partners
|= ost=bone
%+ ra-emit ost
:^ %give %rush %rodeo-report
:- %house
%- ~(gas in *(map span (pair posture cord)))
%+ turn (~(tap by stories))
|=([a=span b=story] [a p.cordon.shape.b caption.shape.b])
::
++ ra-homes :: update partners
=+ gel=general
|- ^+ +>
?~ gel +>
=. +> $(gel l.gel)
=. +> $(gel r.gel)
(ra-house n.gel)
::
++ ra-init :: initialize rodeo
=+ sir=(sein our.hid)
%+ ra-apply our.hid
:+ %design (main our.hid)
:- ~
:_ [%default ?:((gte our.hid 65.536) %brown %black) ~]
?:(=(sir our.hid) ~ [[%& sir (main sir)] ~ ~])
::
++ ra-apply :: apply command
|= [her=ship cod=command]
^+ +>
~& [%ra-apply cod]
?- -.cod
%design
?. =(her our.hid)
(ra-evil %rodeo-no-owner)
?~ q.cod
?. (~(has by stories) p.cod)
(ra-evil %rodeo-no-story)
=. +>.$ (ra-config p.cod *config)
ra-ever(stories (~(del by stories) p.cod))
=. +>.$ (ra-config p.cod u.q.cod)
ra-ever
::
%review ra-ever:(ra-think | her +.cod)
%publish ra-ever:(ra-think & her +.cod)
==
::
++ ra-config :: configure story
|= [man=span con=config]
^+ +>
=+ :- neu=(~(has by stories) man)
pur=(fall (~(get by stories) man) *story)
=. +>.$ pa-abet:(~(pa-reform pa man pur) con)
?:(neu +>.$ ra-homes)
::
++ ra-friend :: %friend response
|= [man=span tay=partner sih=sign]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur ~& [%ra-friend-none man] +>.$
pa-abet:(~(pa-friend pa man u.pur) tay sih)
::
++ ra-twitter :: %twitter response
|= [[num=@ud man=span] sih=sign]
^+ +>
?+ sih ~|([%rodeo-bad-twitter sih] !!)
[%g ?(%nice %mean) ~]
+>
[%g %mean ^]
(ra-repeat num [%| %twitter man] sih)
[%g %rush %twit-stat *]
(ra-repeat num [%| %twitter man] [%g %nice ~])
==
::
++ ra-repeat :: %repeat response
|= [num=@ud pan=partner sih=sign]
=+ oot=(~(get by q.outbox) num)
?~ oot ~& [%ra-repeat-none num] +>.$
=. q.outbox (~(del by q.outbox) num)
=. q.u.oot
=+ olg=(~(got by q.u.oot) pan)
%+ ~(put by q.u.oot) pan
:- -.olg
?+ sih !!
[%g %mean *] ~&([%rodeo-repeat-rejected num pan sih] %rejected)
[%g %nice ~] %received
==
(ra-think | our.hid u.oot ~)
::
++ ra-cancel :: drop a bone
^+ .
=+ hep=(~(get by sup.hid) ost)
?~ hep +
?. ?=([@ @ *] q.u.hep)
+(general (~(del in general) ost))
=* man i.t.q.u.hep
=+ pur=(~(get by stories) man)
?~ pur +>
pa-abet:(pa-notify:~(pa-cancel pa man u.pur) p.u.hep %gone *human)
::
++ ra-human :: look up person
|= her=ship
^- [human _+>]
=^ who folks
=+ who=(~(get by folks) her)
?^ who [u.who folks]
=+ who=`human`[~ `(scot %p her)] :: XX do right
[who (~(put by folks) her who)]
[who +>.$]
::
++ ra-subscribe :: listen to
|= [her=ship pax=path]
^+ +>
:: ~& [%ra-subscribe her pax]
?: ?=(~ pax)
(ra-house(general (~(put in general) ost)) ost)
?. ?=([@ @ *] pax)
(ra-evil %rodeo-bad-path)
=+ ^= vab ^- (set ,@tas)
=| vab=(set ,@tas)
|- ^+ vab
?: =(0 i.pax) vab
$(i.pax (rsh 3 1 i.pax), vab (~(put in vab) (end 3 1 i.pax)))
=+ pur=(~(get by stories) i.t.pax)
?~ pur
~& [%bad-subscribe-story-c i.t.pax]
(ra-evil %rodeo-no-story)
=+ soy=~(. pa i.t.pax u.pur)
=. soy ?.((~(has in vab) %a) soy (pa-watch:soy her))
=. soy ?.((~(has in vab) %x) soy (pa-master:soy her))
=. soy ?.((~(has in vab) %f) soy (pa-listen:soy her t.t.pax))
=^ who +>.$ (ra-human her)
pa-abet:(pa-notify:soy her %hear who)
::
++ ra-think :: publish/review
|= [pub=? her=ship tiz=(list thought)]
^+ +>
?~ tiz +>
$(tiz t.tiz, +> (ra-consume pub her i.tiz))
::
++ ra-consume :: consume thought
|= [pub=? her=ship tip=thought]
=+ aud=(~(tap by q.tip) ~)
|- ^+ +>.^$
?~ aud +>.^$
$(aud t.aud, +>.^$ (ra-conduct pub her p.i.aud tip))
::
++ ra-conduct :: thought to partner
|= [pub=? her=ship tay=partner tip=thought]
^+ +>
:: ~& [%ra-conduct pub her tay]
?- -.tay
%& ?: pub
=. her our.hid :: XX security!
?: =(her p.p.tay)
(ra-record q.p.tay p.p.tay tip)
(ra-transmit p.tay tip)
?. =(our.hid p.p.tay)
+>
(ra-record q.p.tay her tip)
%| ?. pub +>
?- -.p.tay
%twitter
(ra-tweet p.p.tay tip)
== ==
::
++ ra-record :: add to story
|= [man=span gam=telegram]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur
~& [%no-story man]
+>.$
pa-abet:(~(pa-learn pa man u.pur) gam)
::
++ ra-transmit :: send to neighbor
|= [cuz=station tip=thought]
^+ +>
=. +>
%+ ra-emit ost
:* %pass
/repeat/(scot %ud p.outbox)/(scot %p p.cuz)/[q.cuz]
%g
%mess
[p.cuz /rodeo]
our.hid
[%rodeo-command !>(`command`[%review tip ~])]
==
+>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip))
::
++ ra-tweet :: send to /twit
|= [man=span tip=thought]
=* sta r.tip
?> ?=(%lin -.r.sta)
=. q.outbox (~(put by q.outbox) p.outbox tip)
%^ ra-emil(p.outbox +(p.outbox))
:* ost
%pass /twitter/stat/(scot %ud p.outbox)/[man]
%g %mess
[our.hid /twit] our.hid
[%twit-do !>(`twit-do`[man %post p.tip q.r.sta])]
==
:* ost
%pass /twitter/stat/(scot %ud p.outbox)/[man]
[%g %show [our.hid /twit] our.hid /post/(scot %uv p.tip)]
==
~
++ pa :: story core
|_ $: man=span
story
==
++ pa-abet
^+ +>
+>(stories (~(put by stories) man `story`+<+))
::
++ pa-admire :: accept from
|= her=ship
^- ?
::?- -.cordon.shape
:: %& (~(has in p.cordon.shape) her)
:: %| !(~(has in p.cordon.shape) her)
::==
&
::
++ pa-watch :: watch presence
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-watch-unauthorized ~] ~])
=. viewers (~(put in viewers) ost)
(pa-display ost ~ ~)
::
++ pa-master :: hear config
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-master-unauthorized ~] ~])
=. owners (~(put in owners) ost)
:: ~& [%pa-master her man shape]
(pa-sauce ost [[%rush %rodeo-report %config shape] ~])
::
++ pa-display :: update presence
|= vew=(set bone)
=+ ^= reg
:_ remotes
|- ^- atlas
?~ locals ~
[[p.n.locals q.q.n.locals] $(locals l.locals) $(locals r.locals)]
:: ~& [%pa-display man reg]
|- ^+ +>.^$
?~ vew +>.^$
=. +>.^$ $(vew l.vew)
=. +>.^$ $(vew r.vew)
(pa-sauce n.vew [[%rush %rodeo-report %group reg] ~])
::
++ pa-monitor :: update config
=+ owe=owners
|- ^+ +>
?~ owe +>
=. +> $(owe l.owe)
=. +> $(owe r.owe)
:: ~& [%pa-monitor man shape]
(pa-sauce n.owe [[%rush %rodeo-report %config shape] ~])
::
++ pa-friend :: subscribed update
|= [tay=partner sih=sign]
^+ +>
?+ sih ~|([%rodeo-bad-friend sih] !!)
[%g %nice ~]
+>.$
::
[%g %mean *]
?~ +>.sih
(pa-acquire [tay ~])
~& [%pa-friend-mean +>.sih]
pa-monitor(sources.shape (~(del in sources.shape) tay))
::
[%g %rush %twit-feed *]
%- pa-lesson
%+ turn p.p.sih |= twit-stat
^- telegram
:^ our.hid :: XX inaccurate
(shas %twit id)
`audience`[[tay [& ~ tay] %received] `~] :: current party?
^- statement
:+ now
~ :: XX hashtags
[%lin & txt]
[%g %rush %rodeo-report *]
:: ~& [%pa-friend-report +>+.sih]
?> ?=(& -.tay)
=. +> %+ pa-scrub ost
:_ ~
:- /friend/show/[man]/(scot %p p.p.tay)/[q.p.tay]
[%g %took [p.p.tay /rodeo] our.hid]
?+ -.p.p.sih ~|([%rodeo-odd-friend sih] !!)
%config +>.$
%group (pa-remind tay +.p.p.sih)
%grams (pa-lesson q.+.p.p.sih)
==
==
::
++ pa-scrub :: pass forward
|= [ost=bone bub=(list (pair path note))]
%_ +>.$
moves
(welp (flop (turn bub |=(a=(pair path note) [ost %pass a]))) moves)
==
::
++ pa-sauce :: send backward
|= [ost=bone gub=(list gift)]
%_ +>.$
moves
(welp (flop (turn gub |=(a=gift [ost %give a]))) moves)
==
::
++ pa-abjure :: unsubscribe move
|= tal=(list partner)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=partner
?- -.tay
%| ~& tweet-abjure/p.p.tay
!!
:: :~ :- /friend/nuke/[man]/twitter/[p.p.tay]
:: [%g %nuke [our.hid /twit] our.hid]
:: ==
::
%& :: ~& [%pa-abjure [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/nuke/[man]/(scot %p p.p.tay)/[q.p.tay]
[%g %nuke [p.p.tay /rodeo] our.hid]
==
==
::
++ pa-acquire :: subscribe to
|= tal=(list partner)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=partner
^- (list (pair path note))
=+ num=(fall (~(get by sequence) tay) 0)
?- -.tay
%| ~& tweet-acquire/p.p.tay
:~ :- /friend/show/[man]/twitter/[p.p.tay]
[%g %show [our.hid /twit] our.hid /user/[p.p.tay]]
==
::
%& :: ~& [%pa-acquire [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/show/[man]/(scot %p p.p.tay)/[q.p.tay]
[%g %show [p.p.tay /rodeo] our.hid /af/[q.p.tay]/(scot %ud num)]
==
==
::
++ pa-reform :: reconfigure, ugly
|= cof=config
=+ ^= dif ^- (pair (list partner) (list partner))
=+ old=`(list partner)`(~(tap in sources.shape) ~)
=+ new=`(list partner)`(~(tap in sources.cof) ~)
:- (skip new |=(a=partner (~(has in sources.shape) a)))
(skip old |=(a=partner (~(has in sources.cof) a)))
=. +>.$ (pa-acquire p.dif)
=. +>.$ (pa-abjure q.dif)
=. shape cof
pa-monitor
::
++ pa-cancel :: unsubscribe from
:: ~& [%pa-cancel ost]
%_ .
guests (~(del by guests) ost)
viewers (~(del in viewers) ost)
owners (~(del in owners) ost)
==
::
++ pa-notify :: local presence
|= [her=ship saz=status]
^+ +>
=+ ^= nol
?: =(%gone p.saz)
(~(del by locals) her)
(~(put by locals) her lat.hid saz)
?: =(nol locals) +>.$
(pa-display(locals nol) viewers)
::
++ pa-remind :: remote presence
|= [tay=partner loc=atlas rem=(map partner atlas)]
=+ ^= buk
=+ mer=(turn (~(tap by rem) ~) |=([* a=atlas] a))
|- ^- atlas
?~ mer loc
=. loc $(mer t.mer)
=+ dur=`(list (pair ship status))`(~(tap by i.mer) ~)
|- ^- atlas
?~ dur loc
=. loc $(dur t.dur)
=+ fuy=(~(get by loc) p.i.dur)
?~ fuy (~(put by loc) p.i.dur q.i.dur)
?: =(`presence`p.q.i.dur `presence`p.u.fuy)
loc
?- p.u.fuy
%gone (~(del by loc) p.i.dur q.i.dur)
%talk loc
%hear (~(put by loc) p.i.dur q.i.dur)
==
=+ gub=(~(get by remotes) tay)
:: ~& [%pa-remind tay gub buk]
?. |(?=(~ gub) !=(buk u.gub))
+>.$
=. remotes (~(put by remotes) tay buk)
(pa-display viewers)
::
++ pa-start :: start stream
|= riv=river
^+ +>
=- :: ~& [%pa-start riv lab]
=. +>.$ (pa-sauce ost [[%rush %rodeo-report %grams q.lab r.lab] ~])
?: p.lab
(pa-sauce ost [[%mean ~] ~])
+>.$(guests (~(put by guests) ost riv))
^= lab
=+ [end=count gaz=grams dun=| zeg=*(list telegram)]
|- ^- (trel ,? ,@ud (list telegram))
?~ gaz [dun end zeg]
?: ?- -.q.riv :: after the end
%ud (lte p.q.riv end)
%da (lte p.q.riv p.r.q.i.gaz)
==
$(end (dec end), gaz t.gaz)
?: ?- -.p.riv :: before the start
%ud (lth end p.p.riv)
%da (lth p.r.q.i.gaz p.p.riv)
==
[dun end zeg]
$(end (dec end), gaz t.gaz, zeg [i.gaz zeg])
::
++ pa-listen :: subscribe
|= [her=ship pax=path]
^+ +>
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-listen-unauthorized ~] ~])
=+ ^= ruv ^- (unit river)
?: ?=(~ pax)
`[[%ud count] [%da (dec (bex 128))]]
?: ?=([@ ~] pax)
=+ say=(slay i.pax)
?. ?=([~ %$ ?(%ud %da) @] say) ~
`[(point +>.say) [%da (dec (bex 128))]]
?. ?=([@ @ ~] pax) ~
=+ [say=(slay i.pax) den=(slay i.t.pax)]
?. ?=([~ %$ ?(%ud %da) @] say) ~
?. ?=([~ %$ ?(%ud %da) @] den) ~
`[(point +>.say) (point +>.den)]
:: ~& [%pa-listen her pax ruv]
?~ ruv
(pa-sauce ost [[%mean ~ %rodeo-malformed ~] ~])
(pa-start u.ruv)
::
++ pa-refresh :: update stream
|= [num=@ud gam=telegram]
~& [%pa-refresh man num gam guests]
=+ ^= moy
|- ^- (pair (list bone) (list move))
?~ guests [~ ~]
:: ~& [%pa-refresh num n.guests]
=+ lef=$(guests l.guests)
=+ rit=$(guests r.guests)
=+ old=[p=(welp p.lef p.rit) q=(welp q.lef q.rit)]
?: ?- -.q.q.n.guests :: after the end
%ud (lte p.q.q.n.guests num)
%da (lte p.q.q.n.guests p.r.q.gam)
==
[[p.n.guests p.old] [[p.n.guests %give %mean ~] q.old]]
?: ?- -.p.q.n.guests :: before the start
%ud (gth p.p.q.n.guests num)
%da (gth p.p.q.n.guests p.r.q.gam)
==
old
:- p.old
[[p.n.guests %give %rush %rodeo-report %grams num gam ~] q.old]
=. moves (welp q.moy moves)
|- ^+ +>.^$
?~ p.moy +>.^$
$(p.moy t.p.moy, guests (~(del by guests) i.p.moy))
::
++ pa-lesson :: learn multiple
|= gaz=(list telegram)
^+ +>
?~ gaz +>
$(gaz t.gaz, +> (pa-learn i.gaz))
::
++ pa-learn :: learn message
|= gam=telegram
^+ +>
?. (pa-admire p.gam)
~& %pa-admire-rejected
+>.$
=. q.q.gam
=+ ole=(~(get by q.q.gam) [%& our.hid man])
?~ ole q.q.gam
(~(put by q.q.gam) [%& our.hid man] -.u.ole %received)
=+ old=(~(get by known) p.q.gam)
?~ old
(pa-append gam)
(pa-revise u.old gam)
::
++ pa-append :: append new
|= gam=telegram
^+ +>
%+ %= pa-refresh
grams [gam grams]
count +(count)
known (~(put by known) p.q.gam count)
==
count
gam
::
++ pa-revise :: revise existing
|= [num=@ud gam=telegram]
=+ way=(sub count num)
=. grams (welp (scag (dec way) grams) [gam (slag way grams)])
(pa-refresh num gam)
--
--
++ peer
|= [ost=bone her=ship pax=path]
^- [(list move) _+>]
:: ~& [%rodeo-peer ost her pax]
ra-abet:(~(ra-subscribe ra ost ~) her pax)
::
++ poke-rodeo-command
|= [ost=bone her=ship cod=command]
^- [(list move) _+>]
:: ~& [%rodeo-poke-command her cod]
=^ moz +>.$ ra-abet:(~(ra-apply ra ost ~) her cod)
[moz +>.$]
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
:: ~& sih=sih
=+ sih=((hard sign) sih)
:: ~& [%rodeo-pour ost pax sih]
?+ pax ~& [%rodeo-strange-path pax] !!
::
[%twitter *]
=- ra-abet:(~(ra-twitter ra ost ~) met sih)
^= met
?+ t.pax ~| [%rodeo-twitter-strange-path pax] !!
:: [%mine @ @ ~]
:: [i.t.pax i.t.t.t.pax]
[%stat @ @ ~]
[(slav %ud i.t.t.pax) i.t.t.t.pax]
==
::
[%friend *]
?> ?=([@ @ @ @ ~] t.pax)
?. =(%show i.t.pax)
~& [%pour-friend-nuke-nuke pax]
[~ +>.$]
=+ man=i.t.t.pax
=+ ?: ?=(%twitter i.t.t.t.pax)
tay=[%| i.t.t.t.pax i.t.t.t.t.pax]
tay=[%& (slav %p i.t.t.t.pax) i.t.t.t.t.pax]
ra-abet:(~(ra-friend ra ost ~) man tay sih)
::
[%repeat *]
?> ?=([@ @ @ ~] t.pax)
=+ [num her man]=[(slav %ud i.t.pax) (slav %p i.t.t.pax) i.t.t.t.pax]
ra-abet:(~(ra-repeat ra ost ~) num [%& her man] sih)
==
::
++ pull
|= ost=bone
^- [(list move) _+>]
~& [%rodeo-pull `*`ost]
ra-abet:~(ra-cancel ra ost ~)
::
++ poke-bit
|= [ost=bone you=ship ~]
^- [(list move) _+>]
:_ +>.$
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
[ost %pass /jamfile %c %info our.hid (foal paf (jam +<+.+>.$))]~
::
++ prep
|= old=(unit (unit house-any))
^- [(list move) _+>]
?> ?=(^ old)
=| moz=(list move)
|-
?~ u.old
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
?. ?=([%0 %0 %0] [.^(%cy paf)])
$(u.old (some ((hard house-any) (cue ((hard ,@) .^(%cx paf))))))
~& %rodeo-prep-new
ra-abet:~(ra-init ra 0 moz)
~& %rodeo-prep-old
:- moz
|-
?- -.u.u.old
%1 %_(+>.^^$ +<+ u.u.old)
%0 $(u.u.old [%1 (house-0-to-house-1 +.u.u.old)])
==
::
++ house-0-to-house-1
|= vat=house-0
^- house-1
=- :* stories=-
general=~
outbox=[0 ~]
folks=~
==
^- (map span story)
=- %- ~(run by -)
|= grams=(list telegram)
^- story
:* count=(lent grams)
grams=grams
locals=~
remotes=~
sequence=~
shape=[.(cordon [%black ~])]:*config
^= known %- mo ^- (list ,[serial @]) =< +
(roll grams |=([telegram a=@ b=(list ,[serial @])] [+(a) [a p.q] b]))
guests=~
viewers=~
owners=~
==
^- (map span (list telegram))
%- mo %+ turn (~(tap by vat))
|= [a=path b=(list zong) c=(map ship ,?)]
=+ ^= par
?: =(/ a) 'hub'
=+ (turn a |=(d=span leaf/(trip d)))
(crip ~(ram re %rose ["_" ~ ~] -))
:- par
=+ aud=`audience`[[[%& our.hid par] *envelope %received] `~]
=+ ^= spe
|= r=_r:*zong ^- speech
?- -.r
%say [%lin %& p.r]
%do [%lin %| p.r]
%exp [%fat [%tank q.r ~] [%exp p.r]]
==
%+ turn b
|= d=zong ^- telegram
[q.d (sham eny.hid d) aud p.d ~ (spe r.d)]
--

View File

@ -10,11 +10,14 @@
::
|% ::
++ axle ::
$: pid=@u :: next process id
$: %1 :: version
tiv=? :: typing?
wit=[p=@u q=(map ,@u coma)] :: waiting commands
pid=@u :: next process id
pax=_`path`/=try= :: working directory
act=(unit span) :: active child
pip=(map span span) :: pipe out->in
pop=(map span span) :: pipe in->out
pip=(jar span span) :: pipe out->in
pop=(jar span span) :: pipe in->out
pot=(map span ,[cord prom cord]) :: prompts
var=(map term vase) :: variables
== ::
@ -33,8 +36,9 @@
++ gilt ::
$% [%term-line p=term-line] ::
[%txt p=cord] ::
[%type p=?] ::
== ::
++ glas $|(%out [%in p=cord]) ::
++ glas ?(%out [%in p=cord] [%active p=cord]) ::
++ hapt ,[p=ship q=path] ::
++ move ,[p=bone q=(mold note gift)] ::
++ note ::
@ -47,6 +51,8 @@
[%sire p=term q=span] ::
[%mess p=hapt q=ship r=cage] ::
[%meta p=vase] ::
[%nuke p=hapt q=ship] ::
[%took p=hapt q=ship] ::
== == == ::
++ mand ,[p=term q=(list twig)] :: name and arguments
++ coma ::
@ -55,16 +61,18 @@
[%path p=path] :: chdir
[%del p=path] :: rm file
[%ins p=path q=(unit twig)] :: add file
[%mut p=path q=twig] :: change file
[%mut p=path q=(unit twig)] :: change file
[%hoon p=twig] :: eval expression
[%comt ~] :: comment
[%var p=term q=twig] :: set variable
[%rvar p=term] :: unset variable
[%help p=term] :: info about command
== ::
++ sign ::
$% $: %g ::
$% [%gone p=hapt] ::
[%init p=@p] ::
[%dumb ~] ::
[%mean p=ares] ::
[%nice ~] ::
[%rush p=mark q=*] ::
@ -108,9 +116,10 @@
;~ pose
(stag %run ;~(plug (star ;~(sfix (task(tol %0) bar) ace)) (task col)))
(stag %end ;~(pfix col sem ;~(pose (stag %& dem) (stag %| sym))))
(stag %del ;~(pfix hep ace loca))
(stag %mut ;~(pfix col ace ;~(plug loca expg)))
(stag %ins ;~(pfix lus ace ;~(plug loca (opts expg))))
(stag %del ;~(pfix hep (plus ace) loca))
(stag %mut ;~(pfix col (plus ace) ;~(plug loca (opts expg))))
(stag %ins ;~(pfix lus (plus ace) ;~(plug loca (opts expg))))
(stag %help ;~(pfix wut ace ;~(pfix col sym)))
(stag %path (full ;~(sfix loca(pax paf) (star ace))))
(stag %var ;~(plug ;~(pfix tis sym) expg))
(stag %rvar ;~(pfix ;~(plug tis tis) sym))
@ -149,27 +158,22 @@
::
++ blab
|= mof=(list move)
+>.$(mow (welp mof mow))
+>.$(mow (welp (flop mof) mow))
::
++ chew-file
|= [paf=path msg=tape tor=(unit toro)]
|= [paf=path mor=$|(cord toro)]
%- blab
^- (list move)
%+ welp
(print palm/[" " ~ ~ ~]^~[leaf/msg (dank:ut paf)])
%+ turn (drop tor)
|=(a=toro [ost %pass writ/paf %c %info our.hid a])
?@ mor
(print palm/[" " ~ ~ ~]^~[leaf/(trip mor) (dank:ut paf)])
[ost %pass writ/paf %c %info our.hid mor]~
::
++ cubs :: tasks with open /in
%- sort :_ |=([a=span b=span] (lth (slav %ud a) (slav %ud b)))
^- (list span)
%+ murn (~(tap by sup.hid))
|= [@ @ a=path]
?. ?& ?=([%in cord ~] a)
(~(has by cub.hid) i.t.a)
!(~(has by pop) i.t.a)
==
~
(some i.t.a)
%+ murn (~(tap by cub.hid))
|= [a=span @]
?.(=([~ ~] (~(get by pop) a)) ~ (some a))
::
++ eat
|= [you=ship com=coma]
@ -180,6 +184,7 @@
%hoon (eat-hoon +.com)
%ins (eat-ins +.com)
%mut (eat-mut +.com)
%help (eat-help +.com)
%path (eat-path +.com)
%run (eat-run you +.com)
%rvar (eat-rvar +.com)
@ -189,11 +194,9 @@
++ eat-del
|= paf=path
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! none" ~]
["deleted" `(fray paf)]
?~ (file paf) '! none'
(fray paf)
::
++ eat-end :: XX clean up state
|= poc=(each ,@u cord)
@ -202,17 +205,18 @@
%&
=+ cil=(scot %ud p.poc)
=+ cin=(trip (~(got by cub.hid) cil))
%+ blab
[ost %pass /child/[cil]/fork %g %cide cil]
%- blab
%+ welp
(kill cil)
(print leaf/"- :{cin}({(trip cil)})")
::
%|
=+ ^- moz=(list move)
%+ murn (~(tap by cub.hid))
%- zing
%+ turn (~(tap by cub.hid))
|= [a=span b=term]
?. =(b p.poc) ~
%- some
[ost %pass /child/[a]/fork %g %cide a]
(kill a)
%- blab %+ welp moz
(print leaf/"-{<(lent moz)>} :{(trip p.poc)}")
==
@ -220,26 +224,43 @@
++ eat-hoon
|= gen=twig
^+ +>
(blab (print (sell (exec gen))))
%+ with gen |= rez=vase
(blab (print (sell rez)))
::
++ eat-ins
|= [paf=path gen=(unit twig)]
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! exists" ~]
:- "written"
`(foal paf q:(exec (fall gen [%bczp atom/%t])))
?^ (file paf) (chew-file paf '! exists')
%+ with (fall gen [%bczp atom/%t])
|= new=vase
(chew-file paf (foal paf q.new))
::
++ eat-mut
|= [paf=path gen=twig]
|= [paf=path gen=(unit twig)]
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! none" ~]
["changed" `(foal paf q:(exec gen))]
=+ fel=(file paf)
?~ fel
(chew-file paf '! none')
?^ gen
%+ with u.gen |= new=vase
(chew-file paf (foal paf q.new))
(blab (stray (crip ": {(spud paf)} {<(,@t u.fel)>}")))
::
++ eat-help
|= app=term
^+ +>
%- blab %- print
^- tank
=+ rup=/(scot %p our.hid)/main/(scot %da lat.hid)
=+ paf=`path`(welp rup /app/[app]/core/hook)
=+ src=(file paf)
?. ?=([~ @t] src)
leaf/"app {<app>} does not exist"
=+ cot=;~(pfix col col (plus ace) (star prn))
=+ led=(cot 1^1 (trip u.src))
?^ q.led
leaf/":: {(wonk led)}"
palm/[" " ``~]^~[leaf/"no leading comment in" >paf<]
::
++ eat-path
|= paf=path
@ -251,28 +272,30 @@
|= [you=ship mud=(list mand) mad=mand]
^+ +>
:: =. +>.$ (blab (print leaf/"+ :{(trip p.mad)}"))
?: .= [0 0 0]
?. =- (~(has by r:(arch -)) %core)
.^(%cy /(scot %p our.hid)/main/(scot %da lat.hid)/app/[p.mad])
(blab (print leaf/"{<p.mad>} does not exist"))
=| inp=(unit span)
=< +>.$
%+ reel
`(list mand)`(welp mud mad ~)
=+ a=[app=*mand .]
|.
=> a
(blab (print leaf/"app {<p.mad>} does not exist"))
=+ liz=`(list mand)`(welp mud mad ~)
%+ with [%clsg (turn liz |=(mand [%clsg q]))]
|= arg=vase
=| inp=(unit span)
|-
?~ liz ..eat-run
=+ cil=(scot %ud pid)
%_ +>
%_ $
liz t.liz
arg (slot 3 arg)
pid +(pid)
pip ?~ inp pip (~(put by pip) cil u.inp)
pop ?~ inp pop (~(put by pop) u.inp cil)
pip ?~ inp pip (~(add ja pip) cil u.inp)
pop ?~ inp pop (~(add ja pop) u.inp cil)
inp `cil
mow
=< mow :: XX side effects?
%- blab
=+ yon=[our.hid cil imp.hid]
=+ mez=[(cat 3 p.app '-args') (exec [%clsg q.app])]
%- welp :_ mow
=+ mez=[(cat 3 p.i.liz '-args') (slot 2 arg)]
^- (list move)
:~ [ost %pass /child/[cil]/fork %g %sire p.app cil]
:~ [ost %pass /child/[cil]/fork %g %sire p.i.liz cil]
[ost %pass /child/[cil]/out %g %show yon you /out]
[ost %pass /child/[cil]/main %g %meta !>([%mess yon you mez])]
==
@ -288,29 +311,47 @@
++ eat-var
|= [vor=term gen=twig]
^+ +>
%+ with gen |= new=vase
=+ old=(~(get by var) vor)
=+ new=(exec gen)
=+ mod=?~(old "new var" ?:(=(new u.old) "same var" "changed"))
=. var (~(put by var) vor new)
(blab (print leaf/"{mod} {<vor>}"))
::
++ exec
|= gen=twig
++ with
|= [gen=twig coz=$+(vase _..with)]
%- coz
%- slap :_ gen
=+ tym=!>(lat.hid)
%+ slop [[%face %tym p.tym] q.tym]
%+ slop
%+ slop [[%face %our p] q]:!>(our.hid)
%+ slop [[%face %tym p] q]:!>(lat.hid)
[[%face %eny p] q]:!>(eny.hid)
%+ roll (~(tap by var))
=< .(q pit)
|= [[n=term v=vase] q=vase]
(slop [[%face n p.v] q.v] q)
::
++ kill
|= cil=span
^- (list move)
:~ [ost %pass /child/[cil]/fork %g %cide cil]
::[ost %pass /child/[cil]/out %g %nuke [our.hid cil imp.hid] our.hid]
==
::
++ next-act :: rotate active task
=+ opt=[i=`(unit span)`~ t=(turn cubs |=(a=span `(unit span)`[~ a]))]
|-
?~ t.opt ~
?: =(act i.opt)
i.t.opt
$(opt t.opt)
=+ ^- nex=(unit span)
=+ opt=[i=`(unit span)`~ t=(turn cubs |=(a=span `(unit span)`[~ a]))]
|-
?~ t.opt ~
?: =(act i.opt)
i.t.opt
$(opt t.opt)
?. tiv +(act nex)
%- blab(act nex)
%+ weld
?~ nex ~
(spam /active/[u.nex] %rush %type %&)
?~ act ~
(spam /active/[u.act] %rush %type %|)
::
++ peer
|= [you=ship gal=glas]
@ -319,12 +360,16 @@
%_ +>.$
mow :_(mow [ost %give %rush %term-line prompt ~ ~])
==
?: ?=(%active -.gal)
(blab [ost %give %rush %type %|] ~)
?. (~(has by cub.hid) p.gal) +>.$
?: (~(has by pop) p.gal) +>.$
=. act `p.gal
=: act `p.gal
pop (~(put by pop) p.gal ~) :: .=(~ standard-in)
==
(blab ping)
::
++ ping (print-vase !>(*(list tank)))
++ ping (print-vase !>(*tang))
++ poke-kyev
|= [you=ship key=kyev]
^+ +>
@ -339,13 +384,16 @@
[ost %give %nice ~]
[ost %give %logo ~]
~
(eat-end(act next-act) %& (slav %ud u.act))
%x =. act next-act
(eat-end:next-act %& (slav %ud u.act))
%g =+ =- tak=rose/[" " "[" "]"]^(turn (~(tap by cub.hid)) -)
=+ c=(sa cubs)
|= [a=span b=term]
:- %leaf
=+ (trip (rap 3 b '(' a ')' ~))
?.((~(has in c) a) - ?.(=([~ a] act) ['+' -] ['*' -]))
(blab [ost %give %nice ~] (print tak))
%x =. +>.$ next-act
(blab [ost %give %nice ~] ping)
%l =+ =- tak=rose/[" " "[" "]"]^(turn cubs -)
|= a=span
leaf/(trip (rap 3 (~(got by cub.hid) a) '(' a ')' ~))
(blab [ost give/nice/~] (print tak))
==
::
++ poke-txt :: handle command
@ -357,21 +405,32 @@
(spam /in/[u.act] %rush %txt txt)
=+ pas=((full ~(parse from pax lat.hid)) [1 1] (trip txt))
?~ q.pas
(blab (print leaf/"<syntax error at {<`[@ @]`p.pas>}>"))
=- (blab (weld (stray txt) (print leaf/-)))
"<syntax error at {<`[@ @]`p.pas>}>"
=+ com=(wonk pas)
=> .(+>.$ (eat you com))
=. +>.$ (blab (stash txt))
+>.$(mow :_(mow [ost %give %nice ~]))
::
++ print |=(a=tank (print-vase !>(`(list tank)`[a ~])))
++ poke-type
|= [you=ship tiv=?]
^+ +>
=. tiv tiv
?^ act
%+ blab
[ost %give %nice ~]
(spam /active/[u.act] %rush %type tiv)
(blab [ost %give %nice ~] ~)
::
++ print |=(a=tank (print-vase !>(`tang`[a ~])))
++ print-vase
|= tan=vase :: [p=p:!>(*(list tank)) q=*]
|= tan=vase :: [p=p:!>(*tang) q=*]
^- (list move)
%^ spam /out %meta
:(slop !>(%rush) !>(%term-line) !>(prompt) !>(~) tan)
::
++ prompt
^- [cord prom cord]
^- [p=cord q=prom r=cord]
?^ act
=+ por=(~(get by pot) u.act)
?^ por u.por
@ -388,28 +447,37 @@
?- fom
%fork
?> ?=(%gone +<.sih)
%_ +>.$
mow :_(mow [ost %give %nice ~])
act ?:(=(act [~ cil]) ~ act)
==
=. mow :_(mow [ost %give %nice ~])
?. =(act [~ cil]) +>.$
=. act ~
(blab ping)
::
%main
?> ?=(?(%nice %mean) +<.sih)
(blab [ost %give +.sih] ping)
%+ blab
[ost %give +.sih]
?. ?=(%mean +<.sih)
ping
(welp ping (kill cil))
::
%out
?. ?=(?(%rust %rush) +<.sih) +>.$
=> .(+<.sih %rush)
?: ?=(%prompt p.sih)
?: (~(has by pip) cil) +>.$
?^ (~(get ja pip) cil) +>.$
=. pot (~(put by pot) cil (,[cord prom cord] q.sih))
(blab ping)
%- blab
?: (~(has by pip) cil)
(spam /in/(~(got by pip) cil) %meta (slot 3 typ sih))
=+ inp=(~(get ja pip) cil)
|-
?~ inp ~
%+ weld $(inp t.inp)
(spam /in/[i.inp] %meta (slot 3 typ sih))
%- print-vase
?+ p.sih
!>([(sell (slot 15 [typ sih]))]~)
%tang (slot 15 [typ sih])
%tang (slam !>(flop) p:!>(*tang) q.sih)
%txt
?^ q.sih !! :: move to vase space?
!>([leaf/(trip q.sih)]~)
@ -427,6 +495,12 @@
|= a=cord
%^ spam /out %meta
!>([%rush %term-line `term-line`[prompt [a]~ ~]])
::
++ stray
|= a=cord
%^ spam /out %meta
=+ pro=prompt
!>([%rush %term-line `term-line`[pro(r a) ~ ~]])
--
--
!:
@ -438,10 +512,11 @@
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
?~ pax `+>.$
?. ?=(?(%in %out) i.pax) `+>.$
?. ?=(?(%in %out %active) i.pax) `+>.$
=+ ^= gal
?: ?=(%out i.pax) %out
[%in ?<(?=(~ t.pax) i.t.pax)]
?: ?=(%in i.pax) [%in ?<(?=(~ t.pax) i.t.pax)]
[%active ?<(?=(~ t.pax) i.t.pax)]
=+ abet:(peer:(ve hid ost vat) you gal)
[-< +>.$(vat ->)]
::
@ -457,11 +532,19 @@
=+ abet:(poke-txt:(ve hid ost vat) you txt)
[-< +>.$(vat ->)]
::
++ poke-type :: handle command
|= [ost=bone you=ship tiv=?]
^- [(list move) _+>]
=+ abet:(poke-type:(ve hid ost vat) you tiv)
[-< +>.$(vat ->)]
::
++ purr
|= [ost=bone pax=path typ=type sih=sign]
^- [(list move) _+>]
?: ?=(%init +<.sih) :: vomit
[[ost %give +.sih]~ +>.$]
?: ?=(%dumb +<.sih) :: sleep
[~ +>.$]
?: ?=(%sage +<.sih) :: vomit
[[ost %give +.sih]~ +>.$]
?: ?=(%verb +<.sih) :: vomit
@ -472,6 +555,8 @@
[[ost %give +.sih]~ +>.$]
?~ pax ~& %no-path !!
?> ?=([%child span ?(%fork %out %main) ~] pax)
=+ abet:(purr:(ve hid ost vat) i.t.pax i.t.t.pax typ sih)
[-< +>.$(vat ->)]
=^ moz vat abet:(purr:(ve hid ost vat) i.t.pax i.t.t.pax typ sih)
:_ +>.$
?. ?=(%rush +<.sih) moz
[[ost %pass pax %g %took [our.hid i.t.pax imp.hid] our.hid] moz]
--

View File

@ -1,5 +1,8 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-solid-args
|= [ost=bone you=ship ~]
:_ +>.$
@ -32,6 +35,7 @@
=+ nex=+:.*([-.gat [sam +>.gat]] -.gat)
$(vay t.vay, all nex)
:~ [ost %give %sage [%urbit %pill ~] [ken all]]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
==
:: ~& %solid-jamming
@ -46,8 +50,4 @@
:: :- %tang :_ ~
:: leaf/"done"
:: ==
++ peer
|=
*
`+>
--

View File

@ -1,18 +1,16 @@
:: Desk sync
::
:::: /hook/core/sync/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-sync-args
|= [ost=bone you=ship syd=@tas her=@p sud=@tas ~]
:_ +>.$
:* [ost %pass /sync %c %font our.hid syd her sud]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"synced"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [syd=@tas her=@p sud=@tas ~]
[%c %font our.hid syd her sud]
(print . "synced")
--

672
main/app/talk/core.hook Normal file
View File

@ -0,0 +1,672 @@
::
:::: /hook/core/talk/app
::
/? 314
/- *rodeo
/+ rodeo
::
::::
::
!:
=> |% :: structures
++ town :: all client state
$: live=(unit span) :: present story
console=terminal :: controlling terminal
stories=(map span story) :: all stories
== ::
++ grip :: subscription state
|* nub=$+(* *) :: wrapped state
$| $? %warm :: activated
%cool :: activating
%dead :: inoperative
%cold :: inactive
== [%live p=nub] :: operating
++ terminal :: terminal state
$: present=presence :: presence state
== ::
++ story :: station content
$: poe=posture :: security posture
desc=@t :: description
link=(grip bridge) :: connection
count=@ud :: message counter
mike=(pair ,? (set partner)) :: passive/voice
quiet=? :: !verbose
past=(list partner) :: past received auds
== ::
++ bridge :: remote state
$: xm=config :: configuration
am=register :: presence
== ::
++ work :: general action
$% [%ask (unit work)] :: help (about)
[%exp twig] :: compute
[%mor (list work)] :: sequence
[%rub work-adjust] :: configure story
[%say speech] :: publish in voice
[%who (unit partner)] :: show presence
[%wry work-construct] :: configure system
== ::
++ work-adjust :: adjust story
$% [%dark p=(set ship)] :: toggle blacklist
[%lite p=(set ship)] :: toggle whitelist
[%love p=(set partner)] :: toggle partners
[%whom p=? q=(set partner)] :: active/voice
[%wind p=@dr] :: rewind by date
== ::
++ work-construct :: configure system
$% [%make p=span] :: create story
[%raze p=span] :: destroy story
[%tune p=span] :: switch to story
== ::
++ iron :: terminal output
$% [%prompt p=cord q=prom r=cord] :: prompt
[%tang p=(list tank)] :: prettyprintable
[%txt p=cord] :: simple text
==
++ gift
$% [%mean ares]
[%nice ~]
[%rush iron]
==
++ hapt ,[p=ship q=path]
++ move ,[p=bone q=(mold note gift)]
++ note
$? $: %g
$% [%mess p=hapt q=ship r=cage]
[%nuke p=hapt q=ship]
[%show p=hapt q=ship r=path]
[%took p=hapt q=ship]
== ==
$: %t
$% [%wait p=@da]
== == ==
++ gall-sign :: subscription result
$% [%mean p=ares]
[%nice ~]
$: %rush
$= p
$% [%txt p=cord] :: input text
[%type p=?] :: typing notify
[%rodeo-report p=report]
== ==
==
++ sign
$? [%g gall-sign] :: from %gall
$: %t :: from %time
$% [%wake ~] :: timer wakeup
== == ==
--
!:
::::
::
=> |% :: tools
++ hy :: messenger
|_ [moz=(list move) hide]
++ hy-abet moz :: resolve core
++ hy-transmit :: send command
|= cod=command
%_ +>
moz :_ moz
[0 %pass /command %g %mess [our /rodeo] our [%rodeo-command !>(cod)]]
==
::
++ hy-render :: return to console
|= rod=iron
%_ +>
moz
=+ oss=(~(tap in (~(get ju pus) /out)))
|- ^- (list move)
?~ oss moz
[`move`[i.oss %give %rush rod] $(oss t.oss)]
==
::
++ hy-subscribe :: send %show
|= [way=path hoc=path]
%_(+> moz :_(moz [0 %pass way %g %show [our /rodeo] our hoc]))
::
++ hy-unsubscribe :: send %nuke
|= way=path
%_(+> moz :_(moz [0 %pass way %g %nuke [our /rodeo] our]))
::
++ hy-display :: print to console
|=(tay=(list tank) (hy-render %tang tay))
::
++ hy-print :: simple print
|=(tep=tape (hy-display [%leaf tep]~))
::
++ hy-accept :: set prompt
|=(asq=cord (hy-render [%prompt asq %text '']))
--
::
++ parse :: command parser
|= our=ship
=+ vag=(vang | [&1:% &2:% '0' |3:%])
|%
++ come :: keyword command
|* [a=@tas b=_rule]
;~((glue (plus ace)) (cold a (jest a)) b)
::
++ gone :: parse unit
|* a=_rule
;~(pose (stag ~ a) (easy ~))
::
++ posh :: parse each
|* [a=_rule b=_rule]
;~(pose (stag %& a) (stag %| b))
::
++ ship ;~(pfix sig fed:ag) :: ship
++ shiz :: ship set
%+ cook
|=(a=(list ^ship) (~(gas in *(set ^ship)) a))
(most ;~(plug com (star ace)) ship)
::
++ stat :: partner
%+ posh
;~ plug
ship
;~(pose ;~(pfix fas urs:ab) (easy (main our)))
==
;~ pose
;~(pfix pat (stag %twitter urs:ab))
==
::
++ staz :: partner set
%+ cook
|=(a=(list partner) (~(gas in *(set partner)) a))
(most ;~(plug com (star ace)) stat)
::
++ step :: rollback interval
%+ sear
|= a=coin
?. ?=([%$ %dr @] a) ~
(some `@dr`+>.a)
nuck:so
::
++ text (boss 256 (star prn)) :: utf8 text
++ tome
%+ stag %lin
;~ pose
(stag %| ;~(pfix pat text))
(stag %& text)
==
::
++ work :: all commands
%+ knee *^work |. ~+
;~ pose
;~ pfix zap
%+ stag %wry
;~ pose
(come %make urs:ab)
(come %raze urs:ab)
(come %tune urs:ab)
==
==
::
;~ pfix cen
%+ stag %rub
;~ pose
(come %dark shiz)
(come %lite shiz)
(come %whom (stag %& staz))
(come %wind step)
==
==
::
;~(pfix wut (stag %ask (gone work)))
;~(pfix tis (stag %who (gone stat)))
;~(pfix cen (stag %exp wide:vag))
::
%+ cook
|= [a=(set partner) b=(unit ,[%lin p=? q=@t])]
^- ^work
=. b ?~(b ~ ?:(=(0 q.u.b) ~ b))
=+ c=[%rub %whom %& a]
?~(b c [%mor c [%say u.b] ~])
;~ plug
staz
(gone ;~(pfix (star ace) tome))
==
::
(stag %say tome)
==
--
::
++ swatch :: print partner set
|= [our=ship tou=(set partner)]
=+ tuo=(~(tap in tou))
|- ^- tape
?~ tuo ~
=+ ted=$(tuo t.tuo)
=+ ^= ind ^- tape
?- -.i.tuo
%& =+ sip=(scow %p p.p.i.tuo)
?: =((main p.p.i.tuo) q.p.i.tuo)
sip
:(welp sip "/" (trip q.p.i.tuo))
%| ['@' (trip p.p.i.tuo)]
==
?~ ted ind
(welp ind `tape`[',' ' ' ted])
::
++ stog :: toggle set
|* [tog=(set) tag=(set)]
=+ got=(~(tap in tog))
|- ^+ tag
?~ got tag
%= $
got t.got
tag ?: (~(has in tag) i.got)
(~(del in tag) i.got)
(~(put in tag) i.got)
==
--
!:
::::
::
|_ [hid=hide town]
++ hype |=(moz=(list move) ~(. hy moz hid))
++ sy
|_ $: $: man=span :: u.live
moz=(list move) :: pending moves
== ::
story :: current story
==
::
++ sy-abet :: resolve core
^- [(list move) _+>]
[(flop moz) +>(stories (~(put by stories) man +<+))]
::
++ sy-subscribe :: story subscribe
?> =(%cold link)
=+ cub=?.(=(0 count) (scot %ud count) (scot %da (sub lat.hid ~d1)))
=. + (sy-message "subscribe <{(trip cub)}>")
%_ +
link %cool
moz =< hy-abet
%+ hy-subscribe:(hype moz)
/fm/[man]
:~ %afx
man
?: =(0 count)
:: ~& [%story-init man `@da`(sub lat.hid ~d1)]
(scot %da (sub lat.hid ~d1))
(scot %ud count)
==
==
::
++ sy-unsubscribe :: story unsubscribe
?: =(& ?=(?(%cold %dead) link)) .
%_ .
link %cold
moz hy-abet:(hy-unsubscribe:(hype moz) /fm/[man])
==
::
++ sy-serial :: make serial no
^- [serial _.]
[(shaf %serial eny.hid) .(eny.hid (shax eny.hid))]
::
++ sy-audience :: speech audience
%- ~(gas by *audience)
%+ turn `(list partner)`[[%& our.hid man] (~(tap in q.mike))]
|=(a=partner [a *envelope %pending])
::
++ sy-message :: print message
|= msg=tape
%_(+> moz hy-abet:(hy-print:(hype moz) ":{(trip man)}: {msg}"))
::
++ sy-present
|= [msg=tape tay=(list tank)]
=. tay (welp tay `(list tank)`[%leaf "::"]~)
=. tay :_(tay [%leaf ":{(trip man)}: {msg}:: "])
%_(+>.$ moz hy-abet:(hy-display:(hype moz) tay))
::
++ sy-prompt
|= tou=(set partner)
^- tape
;: welp
(scow %p our.hid)
?:(=(man (main our.hid)) "" `tape`:(welp "/" (trip man)))
?~ tou "& "
`tape`:(welp "(" (swatch our.hid tou) ")& ")
==
::
++ sy-voice :: set targets
|= [pas=? tou=(set partner)]
?: &(!p.mike pas) +>
%_ +>.$
mike [pas tou]
moz hy-abet:(hy-accept:(hype moz) (crip (sy-prompt tou)))
==
::
++ sy-rollback
|= lon=@dr
!!
::
++ sy-work :: run user command
|= job=work
^+ +>
?- -.job
%ask ~|(%sy-work-ask-stub !!)
%exp ~|(%sy-work-exp-stub !!)
%mor
|- ^+ +>.^$
?~ +.job +>.^$
$(+.job t.+.job, +>.^$ ^$(job i.+.job))
::
%rub
?: ?=(%whom +<.job)
(sy-voice +>.job)
?: ?=(%wind +<.job)
~& %rub-wind-stub
!!
=+ suz=sy-live
?~ suz (sy-message "not connected")
?- +<.job
%lite sz-abet:(sz-cordon:u.suz [%white +>.job])
%dark sz-abet:(sz-cordon:u.suz [%black +>.job])
%love sz-abet:(sz-sources:u.suz +>.job)
==
::
%say
=^ sir +>.$ sy-serial
%= +>.$
moz
=< hy-abet
%- ~(hy-transmit hy moz hid)
[%publish [[sir sy-audience [lat.hid ~ +.job]] ~]]
==
::
%wry ~|(%sy-work-wry !!)
%who ~|(%sy-work-who-stub !!)
==
::
++ sy-gram :: apply telegram
|= [num=@ud gam=telegram]
^+ +>
%= +>
moz
=< hy-abet
%- hy-render:(hype moz)
=* sta r.q.gam
?+ -.r.sta ~|([%strange-gram -.r.sta] !!)
::
%lin
:- %txt
%+ rap 3
:~ (scot %ud num) ')'
(scot %p p.gam) ?:(p.r.sta ': ' ' ')
q.r.sta
==
==
==
::
++ sy-grams :: apply telegrams
|= [num=@ud gaz=(list telegram)]
^+ +>
:: ~& [%sy-grams [num count] (lent gaz)]
?: (gth num count)
(sy-message(count 0) "message gap: {<num>} at {<count>}")
=. .
?: =(num count) .
.(num count, gaz (slag (sub count num) gaz))
=+ las=(add count (lent gaz))
|- ^+ +>.^$
?~ gaz +>.^$(count las)
$(gaz t.gaz, count +(count), +>.^$ (sy-gram num i.gaz))
::
++ sy-error :: report error
|= ars=ares
%= +>
moz
=< hy-abet
%- hy-print:(hype moz)
?~(ars "connection error" "disaster: (trip p.u.ars)")
==
::
++ sy-sign :: subscription sign
|= res=gall-sign
^+ +>
:: ~& [%sy-sign res]
?- -.res
%mean
=. link %dead
(sy-error p.res)
::
%nice :: misordered, ignore
:: ?. ?=(%cool link)
:: ~& [%sy-sign-nice-bad link]
:: +>.$
::+>(link %warm)
+>.$
::
%rush :: direct update
?: ?=(?(%cold %dead) link)
~& [%sy-sign-rust-bad `@tas`link]
+>.$
?> ?=(%rodeo-report +<.res)
?: ?=(%cool link)
:: XX workaround for inverted nice
$(link %warm)
=+ suz=sy-live
?~ suz (sy-message "not connected")
sz-abet:(sz-apply:u.suz +>.res)
==
::
++ sy-live :: as connected
^- (unit ,_sz)
?: ?=([%live *] link)
`~(. sz p.link)
?.(?=(%warm link) ~ `~(. sz *bridge))
::
++ sz :: story, connected
|_ big=bridge
++ sz-abet %_(+> link [%live big]) :: resolve to ++sy
++ sz-amok
|= why=?(%cold %cool %dead %warm)
%_(+>+> link why)
::
++ sz-cordon :: design cordon
|= con=control
^+ +>
=. cordon.xm.big
?: =(p.cordon.xm.big p.con)
[p.con (stog q.con q.cordon.xm.big)]
con
+>.$(moz hy-abet:(hy-transmit:(hype moz) [%design man ~ xm.big]))
::
++ sz-sources :: design sources
|= src=(set partner)
^+ +>
=. sources.xm.big (stog src sources.xm.big)
+>.$(moz hy-abet:(hy-transmit:(hype moz) [%design man ~ xm.big]))
::
++ sz-config :: apply config
|= cof=config
=. +>+> (sy-present "config" >cof< ~)
:: ~& [%sz-config cof]
%_(+> xm.big cof, +> (sy-voice %& sources.cof))
::
++ sz-group :: apply register
|= rex=register
=. +>+> (sy-present "register" >rex< ~)
%_(+> am.big rex)
::
++ sz-apply :: apply report
|= rad=report
^+ +>
?- -.rad
%house ~|(%sz-apply-house !!)
%grams +>(+> (sy-grams +.rad))
%config (sz-config +.rad)
%group (sz-group +.rad)
==
--
--
++ ny :: top configuration
|_ moz=(list move)
++ ny-abet :: resolve core
^- [(list move) _+>]
[(flop moz) +>]
::
++ ny-amid :: integrate story
|= nov=_sy
=^ zom +>+> sy-abet:nov
+>.$(moz (flop zom))
::
++ ny-tune :: connect to story
|= man=span
^+ +>
?: =(`man live)
+>(moz hy-abet:(hy-print:(hype moz) "already tuned to {(trip man)}"))
?. (~(has by stories) man)
+>(moz hy-abet:(hy-print:(hype moz) "no story {(trip man)}"))
=. +> ny-stop
=. live `man
:: ~& [%tune-start man]
(ny-amid sy-subscribe:(need (novel moz)))
::
++ ny-stop :: disconnect story
^+ .
?~ live .
(ny-amid(live ~) sy-unsubscribe:(need (novel moz)))
::
++ ny-tell :: hear from server
|= sap=(map span (pair posture cord))
^+ +>
=. +> ?.(&(?=(^ live) !(~(has by sap) u.live)) +> ny-stop)
=. stories
=+ pas=(~(tap by sap))
=+ ros=(skim (~(tap by stories)) |=([a=span *] (~(has by sap) a)))
%- ~(gas by *(map span story))
|- ^- (list (pair span story))
?~ pas
%+ turn ros
|= [a=span b=story]
=+ hig=(~(get by sap) a)
[a ?~(hig b b(poe p.u.hig, desc q.u.hig))]
=+ sor=$(pas t.pas)
?: (~(has by stories) i.pas)
sor
=+ soy=*story
[[p.i.pas soy(poe p.q.i.pas, desc q.q.i.pas)] sor]
?^ live +>.$
?~ stories +>.$
?: (~(has by `(map span story)`stories) (main our.hid))
(ny-tune (main our.hid))
(ny-tune p.n.stories)
::
++ ny-work :: user command
|= jaw=work-construct
^+ +>
?- -.jaw
%raze +>(moz hy-abet:(hy-transmit:(hype moz) [%design p.jaw ~]))
%tune (ny-tune p.jaw)
%make
%= +>
moz
hy-abet:(hy-transmit:(hype moz) [%design p.jaw [~ ~ %default %black ~]])
==
==
--
::
++ novel :: live story
|= moz=(list move)
^- (unit ,_sy)
?~ live ~
`~(. sy [u.live moz] (~(got by stories) u.live))
::
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
[~ +>.$]
::
++ pour-shell
|= txt=cord
^- [(list move) _+>]
=+ jub=(rush txt work:(parse our.hid))
?~ jub
[hy-abet:(hy-print:(hype ~) "invalid input") +>.$]
?: ?=(%wry -.u.jub)
ny-abet:(ny-work:ny +.u.jub)
=+ nuv=(novel ~)
?~ nuv [hy-abet:(hy-print:(hype ~) "not tuned to any story") +>.$]
sy-abet:(sy-work:u.nuv u.jub)
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
~| sign=sih
=> .(sih ((hard sign) sih))
:: ~& talk-pour/sih
?~ pax ~& talk-pour-strange-path/pax !!
?+ i.pax ~& talk-pour-strange-path/pax
~& sign/sih
!!
%command
?+ +<.sih !!
%nice [~ +>.$]
%mean ~|([%pour-mean-cmd-in +>.sih] !!)
==
%cmd-in
?+ +<.sih !!
%nice [~ +>.$]
%mean ~|([%pour-mean-cmd-in +>.sih] !!)
%rush
?> ?=(%txt -.p.sih)
=^ moz +>.$ (pour-shell p.p.sih)
:_ +>.$
:_(moz [ost %pass pax %g %took [our.hid +.imp.hid] our.hid])
==
::
%cmd-ac
?+ +<.sih !!
%nice [~ +>.$]
%mean ~|([%pour-mean-cmd-ac +>.sih] !!)
%rush
:_ +>.$
[ost %pass pax %g %took [our.hid +.imp.hid] our.hid]~
==
::
%server
?+ +<.sih !!
%nice [~ +>.$]
%mean ~|(%talk-server-crash !!)
%rush
?> ?=([%rodeo-report %house *] p.sih)
=^ moz +>.$ ny-abet:(ny-tell:ny +.p.p.sih)
:_ +>.$
:_(moz [ost %pass pax %g %took [our.hid /rodeo] our.hid])
==
::
%time
:_ +>.$
:: ~& [%talk-pour-time lat.hid `@da`(add ~s10 lat.hid)]
:~ [0 %pass /time %t %wait (add ~s10 lat.hid)]
==
::
%fm
?> ?=([@ *] t.pax)
?. =(& &(?=(^ live) =(u.live i.t.pax)))
~& [%talk-wrong-story live i.t.pax]
[~ +>.$]
?> ?=(%g -.sih)
=^ moz +>.$ sy-abet:(sy-sign:(need (novel ~)) +.sih)
:_ +>.$
:_(moz `move`[ost %pass pax %g %took [our.hid /rodeo] our.hid])
==
::
++ poke-talk-args
|= [ost=bone you=ship arg=~]
^- [(list move) _+>]
:_ +>
:~ [0 %pass /cmd-in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
[0 %pass /time %t %wait (add ~s10 lat.hid)]
[0 %pass /cmd-ac %g %show [our.hid +.imp.hid] you /active/[-.imp.hid]]
^- move
:* 0 %pass /server
%g %show
[our.hid /rodeo] our.hid
/
==
==
--

View File

@ -18,7 +18,6 @@
== ::
++ gift ::
$% [%rush gilt] ::
[%rust gilt] ::
[%init p=@p] ::
[%logo @] ::
[%mean p=ares] ::
@ -33,6 +32,7 @@
++ mess ::
$% [%txt p=(hypo cord)] ::
[%kyev p=(hypo kyev)] ::
[%type p=(hypo ,?)] ::
== ::
++ move ,[p=bone q=(mold note gift)] ::
++ note ::
@ -41,6 +41,7 @@
[%show p=hapt q=ship r=path] ::
[%sire p=term q=span] ::
[%mess p=hapt q=ship r=mess] ::
[%took p=hapt q=ship] ::
== == == ::
++ sign ::
$% $: %g ::
@ -49,7 +50,6 @@
[%logo @] ::
[%mean p=ares] ::
[%nice ~] ::
[%rust p=%term-line q=term-line] ::
[%rush p=%term-line q=term-line] ::
[%sage p=path q=*] ::
[%verb ~] ::
@ -62,11 +62,6 @@
::
|%
++ aut %shell
++ encode
|= [a=term b=path] ^- span
(rap 3 a (turn b |=(c=span (cat 3 '_' c))))
::
++ decode |=(a=span `[p=term q=path]`(rash a (most cab sym)))
++ inject
|= [a=[i=mane t=(list mane)] b=marl]
|= man=manx
@ -78,8 +73,9 @@
::
++ start-shell
|= [our=ship imp=path ost=bone you=ship pax=path]
%- flop
^- (list move)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
:- [ost %pass [%fork pax] %g %sire [aut auc]]
[ost %pass [%resp pax] %g %show [our [auc imp]] you /out]~
--
@ -90,7 +86,7 @@
++ se
|= [hid=hide ost=bone you=ship hiz=(map path term-line) pax=path]
=+ tel=(fall (~(get by hiz) pax) *term-line)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
=^ mow tel
?: (~(has by cub.hid) auc)
[~ tel]
@ -102,18 +98,18 @@
[(flop mow) (~(put by hiz) pax tel)]
::
++ page
;html
;head
;title: Not yet
==
;body;
==
:: %. stat
:: %+ inject
:: ~[%html %head]
:: ;= ;script: urb.appl = "{(trip app.hid)}"
:: ;script: urb.term = \{pax: "{(spud pax)}"}
:: ;html
:: ;head
:: ;title: Not yet
:: ==
:: ;body;
:: ==
%. stat
%+ inject
~[%html %head]
;= ;script: urb.appl = "{(trip app.hid)}"
;script: urb.term = \{pax: "{(spud pax)}"}
==
::
++ peer
|= gal=glas
@ -127,7 +123,7 @@
==
::
++ poke
|= jof=$%([%line p=span] [%res p=span] [%cmd p=char])
|= jof=$%([%line p=cord] [%res p=span] [%cmd p=char] [%type p=?])
^+ +>
?- -.jof
%res :: restart shell
@ -141,54 +137,61 @@
r.tel :_(r.tel leaf/"+ {(trip auc)}")
mow
;: welp
(spam tel)
[ost %give %nice ~]~
(start-shell our.hid imp.hid ost you pax)
[ost %give %nice ~]~
(spam tel)
mow
==
==
::
%line :: command entered
=+ new=stem/[lat.hid leaf/(trip p.p.tel) leaf/(trip p.jof)]
=. r.tel
:_ r.tel
stem/[leaf/(trip p.p.tel) leaf/(trip p.jof)]
(send %txt -:!>(*cord) p.jof)
stem/[lat.hid leaf/(trip p.p.tel) leaf/(trip p.jof)]
=. +>.$ (send %txt -:!>(*cord) p.jof)
+>.$(mow (welp (spam p.tel q.tel new ~) mow))
::
%cmd :: key command
?+ p.jof
(send %kyev -:!>(*kyev) [[%ctrl ~ ~] p.jof])
%r $(jof [%res 'shell'])
==
::
%type
(send %type -:!>(*?) p.jof)
==
::
++ poke-ctrl
.(mow :_(mow [ost %give %rush %term-line [p q ~]:tel]))
::
++ pour
|= [dis=?(%fork %resp %txt %kyev) sih=sign]
|= [dis=?(%fork %resp %txt %kyev %type) sih=sign]
^+ +>
?- dis
%fork ?>(?=(%gone +<.sih) +>.$) :: XX maybe mean?
%resp
?+ +<.sih !!
%nice +>.$
?(%rust %rush)
%rush
:: ~? !=(p.tel p.q.sih) prompt/[p.q.sih ?=(~ q.q.sih)]
=. p.q.sih ?^(q.q.sih p.tel p.q.sih) :: XX prompt hack
%_ +>.$
mow (welp (spam q.sih) mow)
mow :- [ost %pass [%resp pax] %g %took [our.hid [auc imp.hid]] you]
(welp (spam q.sih) mow)
tel [p.q.sih (weld q.q.sih q.tel) (weld r.q.sih r.tel)]
==
==
::
?(%txt %kyev)
?(%txt %kyev %type)
?+ +<.sih !!
%nice +>.$(mow :_(mow [ost %give +.sih]))
%mean
=+ ^= new
=- (turn - |=(a=tank rose/[~ "! " ~]^[a]~))
^- (list tank)
%- flop ^- tang
?~ p.sih ~
(welp q.u.p.sih leaf/(trip p.u.p.sih) ~)
[leaf/(trip p.u.p.sih) q.u.p.sih]
%_ +>.$
r.tel (welp new r.tel)
mow
@ -196,7 +199,7 @@
[[ost %give +.sih] (spam [p.tel q.tel new])]
==
==
==
==
::
++ send
|= mez=mess
@ -206,7 +209,7 @@
^- (list move)
%+ murn (~(tap by cub.hid))
|= [p=span q=term]
?. =(pax q:(decode p)) ~
?. =(p auc) ~
%- some ^- move
:^ ost %pass [-.mez pax]
[%g %mess [our.hid p imp.hid] you mez]
@ -256,7 +259,18 @@
?: ?=(?(%sage %init %logo %verb %veer %vega) &2.sih) :: vomit
[[ost %give +.sih]~ +>.$]
?~ pax !!
?. ?=(?(%fork %resp %txt %kyev) i.pax) !!
?. ?=(?(%fork %resp %txt %kyev %type) i.pax) !!
=+ abet:(pour:(se hid ost our.hid hiz t.pax) i.pax sih)
[-< +>.$(hiz ->)]
::
++ prep
|= old=(unit (unit axle))
^- [(list move) _+>]
:- ~
%_ +>.$
hiz
?. ?=([~ ~ *] old) hiz
%- ~(run by hiz.u.u.old)
|=(term-line [p q ~])
==
--

View File

@ -12,10 +12,11 @@
;html
;head
;title: Hi
;script(src "/gen/main/lib/urb.js");
;script(src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script(src "//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.js");
;script(src "//use.typekit.net/fkv0sjk.js");
;script: window.urb = window.urb || \{};
;script@"/gen/main/lib/urb.js";
;script@"//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js";
;script@"//cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.js";
;script@"//use.typekit.net/fkv0sjk.js";
;script:'try{Typekit.load();}catch(e){}'
:: ;script: urb.appl = "terminal"; urb.term = \{pax: "/"}
;+ styl

View File

@ -38,8 +38,8 @@
== == == ::
++ test :: test template
$_ ^? |% ::
++ poke |+([bone ship] [_(list move) +>]) :: start test
++ pour |+([bone path *] [_(list move) +>]) :: system response
++ poke |+([bone ship] [*(list move) +>]) :: start test
++ pour |+([bone path *] [*(list move) +>]) :: system response
-- ::
-- ::
!:

View File

@ -3,13 +3,14 @@
:::: /hook/hymn/front/twit/app
::
/? 314 :: need urbit 314
/= urbit /:/===/lib/urb:/hymn/ :: urbit library (js)
/= urbit /:/===lib/urb:/hymn/ :: urbit library (js)
/= style /:/%%%/style:/hymn/ :: stylesheet (css)
/= application /:/%%%/app:/hymn/ :: application (js)
!:
:::: content
::
^- manx
=- ~! - -
;html
;head
;title: Tests

View File

@ -1,8 +1,12 @@
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-ticket-args
|= [ost=bone you=ship her=@p num=?(~ [p=@ud ~])]
:_ +>.$
%+ args-into-gate .
|= [her=@p num=?(~ [p=@ud ~])]
=+ n=?~(num 1 p.num)
=+ ^= sep ^- @
=+ mir=(clan her)
@ -11,23 +15,10 @@
%duke (bex 16)
%earl (bex 32)
==
:- [ost %give %nice ~]
|-
:- %tang
|- ^- tang
?: ?=(0 n) ~
=+ ^= tic
(,@p .^(%a (scot %p our.hid) %tick (scot %da lat.hid) (scot %p her) ~))
%+ welp
(spam ost "{<her>}: {<tic>}")
=+ tic=/(scot %p our.hid)/tick/(scot %da lat.hid)/(scot %p her)
:- leaf/"{<her>}: {<(,@p .^(%a tic))>}"
$(her (add sep her), n (dec n))
++ spam
|= [ost=bone msg=tape]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/msg
++ peer
|=
*
`+>
--

26
main/app/tree/core.hook Normal file
View File

@ -0,0 +1,26 @@
:: Tree view recursive directory contents
::
:::: /hook/core/tree/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke--args
%+ args-into-gate .
|= [pax=path fla=$|(~ [%full ~])]
=+ len=(lent pax)
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))
:- %tang
|- ^- tang
=+ ark=;;(arch .^(cy/pax))
=- ?~ q.ark -
[(rend pax) -]
%- zing
%+ turn
(sort (~(tap by r.ark)) aor)
|= [a=@t ~]
^$(pax (welp pax /[a]))
--

13
main/app/tweet/core.hook Normal file
View File

@ -0,0 +1,13 @@
/+ sh-utils
!:
|_ [hide ~]
++ peer ,_`.
++ poke--args
%+ add-subs [[our /twit] our /post/(scot %uv eny)]
%^ gate-mess .
|=([a=span b=cord ~] [/twit %twit-do !>([a %post eny b])])
,_`.
++ posh-twit-stat
(args-into-gate . |=([@ @ a=@da @] tang/~[leaf/"Tweet recieved {<a>}"]))
++ pour |*([ost=@ * sih=[@ ^]] :_(+>.$ [ost %give +.sih]~))
--

217
main/app/twit/core.hook Normal file
View File

@ -0,0 +1,217 @@
:: Twitter daemon
::
:::: /hook/core/twit/app
::
/- *twitter
/+ twitter
::
:::: ~fyr
::
|%
++ twit-path :: valid peer path
$% :: [%home ~] :: home timeline
[%user p=@t ~] :: user's tweets
[%post p=@ta ~] :: status of status
==
::
++ axle :: app state
$: %0
kes=(map span keys:twit-do) :: auth
out=(map ,@uvI (each ,[span cord] stat)) :: sent tweets
ran=(map path ,[p=@ud q=@da]) :: polls active
fed=(jar path stat) :: feed cache
==
::
++ gift :: app response
$% [%nice ~] :: acknowledgement
[%mean p=ares] :: error/termination
[%rush p=gilt] :: subscription data
==
::
++ gilt
$% [%twit-feed p=(list stat)] :: posts in feed
[%twit-stat p=stat] :: tweet accepted
==
::
++ move ,[bone (mold note gift)]
++ note :: arvo request
$% [%e %them ~ u=hiss] :: HTTP request
[%t %wait p=@da] :: timeout
==
::
++ sign :: arvo response
$% [%e %thou p=httr] :: HTTP result
[%t %wake ~] :: timeout ping
==
::
++ stat twit-stat :: recieved tweet
--
!:
::::
::
|_ [hide axle]
++ any-auth ?~(kes (auth) (auth p.n.kes)) :: use any keys
++ auth :: build API door
|= a=span
~| [%no-auth a]
~(. twit (~(got by kes) a) lat `@`eny)
::
++ cull :: remove seen tweets
|= [pax=path rep=(list stat)] ^+ rep
=+ pev=(sa (turn (~(get ja fed) pax) |=(stat id)))
(skip rep |=(stat (~(has in pev) id)))
::
++ dely :: next polling timeout
|= pax=path
^- [(unit time) _ran]
=+ cur=(~(get by ran) pax)
=+ tym=(add lat (mul ~s8 (bex ?~(cur 0 p.u.cur))))
:: ~& dely/`@dr`(sub tym lat)
?: &(?=(^ cur) (gte tym q.u.cur) (gth q.u.cur lat))
[~ ran]
[`tym (~(put by ran) pax ?~(cur 0 (min 5 +(p.u.cur))) tym)]
::
++ wait :: ensure poll by path
|= [ost=bone pax=path mof=(list move)]
=^ tym ran (dely pax)
:_ +>.$
?~ tym
:: ~& no-wait/ran
mof
:: ~& will-wait/u.tym
:- [ost %pass pax %t %wait u.tym]
mof
::
++ poke-twit-do :: recieve request
|= [ost=bone @ act=twit-do]
^+ [*(list move) +>]
?- -.q.act
%auth
:: ~& twit-auth/p.act
=. kes (~(put by kes) p.act p.q.act)
:_(+>.$ [ost %give %nice ~]~) :: XX verify key
%post
=: out (~(put by out) p.q.act %& p.act q.q.act)
ran (~(del by ran) /peer/home)
==
%^ wait ost /peer/home
:- [ost %give %nice ~]
=+ mez=(stat-upda:(auth p.act) [%status q.q.act]~ ~)
[ost %pass /post/(scot %uv p.q.act) %e %them ~ mez]~
==
::
++ pour :: recieve response
|= [ost=bone pax=path sig=sign]
^+ [*(list move) +>]
?- &2.sig
%wake
~& wake/[pax sig]
:_ +>.$
?. (~(has by ran) pax) :: ignore if retracted
~
?+ pax ~|([%wake-missed pax] !!)
[%peer *]
?~ (~(get ju pus) t.pax)
~
~& peer-again/[t.pax ran]
(pear | ost our t.pax)
==
%thou
?+ p.p.sig ~|([%unknown-code p.p.sig] !!)
429 :: Rate-limit
=. ran (~(put by ran) pax 6 lat)
=+ lim=%.(%x-rate-limit-reset ;~(biff ~(get by (mo q.p.sig)) poja ni:jo))
=+ tym=?~(lim (add ~m7.s30 lat) (add ~1970.1.1 (mul ~s1 u.lim)))
~& retrying-in/`@dr`(sub tym lat)
:_(+>.$ [ost %pass pax %t %wait tym]~)
200 :: OK
=+ jon=(need (poja q:(need r.p.sig)))
:: ~& twit-resp/%.(jon ?+(-.jon !! %o stat:twir, %a (ar:jo stat:twir)))
?+ pax ~|([%http-missed pax] !!)
[%post @ ~] :: post acknowledged
=+ ^= rep
~| [%bad-post jon]
(need %.(jon stat:twir))
=. out (~(put by out) (slav %uv i.t.pax) %| rep)
:_ +>.$
(weld (spam pax %rush %twit-stat rep) (spam pax %mean ~))
[%peer *] :: feed data
=+ ^= rep
~| [%bad-feed jon]
(need %.(jon (ar:jo stat:twir)))
:: ~& got-feed/[(scag 5 (turn rep |=(stat id))) fed]
=+ ren=(cull t.pax rep) :: new messages
?~ ren
(wait ost pax ~) :: pump polling
~& spam-feed/ren
=: ran (~(del by ran) pax) :: clear poll delay
fed (~(put by fed) t.pax rep) :: saw last message
==
(wait ost pax (spam t.pax %rush twit-feed/(flop ren)))
==
?(400 401 403 404) :: Err
=+ ^- git=gift
=+ err=%.(q:(need r.p.sig) ;~(biff poja mean:twir))
:^ %mean ~ %bad-http
[leaf/"HTTP Code {<p.p.sig>}" (turn (need err) mean:twip)]
?+ pax [[ost %give git]~ +>.$]
[%post @ ~]
[(spam pax git) +>.$]
== ==
==
::
++ peer :: accept subscription
|= [ost=bone ship path]
^+ [*(list move) +>]
:_(+> [[ost %give %nice ~] (pear & +<)])
::
++ pear :: poll, possibly returning current data
|= [ver=? ost=bone @ pax=path]
^- (list move)
?. ?=(twit-path pax)
~|([%missed-path pax] !!)
=> .(pax `twit-path`pax)
?: ?=(%post -.pax)
?. ver ~
=+ sta=(~(get by out) (slav %uv p.pax))
?. ?=([~ %| ^] sta) :: post not received
~
:- [ost %give %rush %twit-stat p.u.sta]
[ost %give %mean ~]~ :: subscription end
=+ ole=(~(get ja fed) pax)
:_ ?. ver ~
?~ ole ~
[ost %give %rush %twit-feed (flop ole)]~
=- [ost %pass [%peer pax] %e %them ~ `hiss`-]
=+ opt=?~(ole ~ ['since_id' (lutt:twit id.i.ole)]~)
=+ aut=any-auth
?- -.pax
%user (stat-user:aut [(to-sd p.pax)]~ opt)
:: %home (stat-home:auth ~ opt)
==
::
++ to-sd :: parse user name/numb
|= a=span ^- sd:twit
~| [%not-user a]
%+ rash a
;~(pose (stag %user-id dem) (stag %screen-name user:twir))
::
++ pull :: release subscription
|= ost=bone
?. (~(has by sup) ost) `+>.$ :: XX should not occur
=+ [his pax]=(~(got by sup) ost)
?: (lth 1 ~(wyt in (~(get ju pus) pax)))
`+>.$
=: ran (~(del by ran) [%peer pax])
fed (~(del by fed) pax)
==
`+>.$
::
++ spam :: send by path
|= [a=path b=gift] ^- (list move)
%+ murn (~(tap by sup))
|= [ost=bone @ pax=path]
^- (unit move)
?. =(pax a) ~
[~ [ost %give b]]
--

View File

@ -0,0 +1,4 @@
:- :- 'AP3G1t8ki6rPzeeAqdWCTw03F'
'VV784LPwZSaAxtF16RWWTnST4F85BHN8VqQKNyv7MprCkA0xZD'
:- '2821727326-RZGXSeTn7hCFQfJqR0ViivM3YYpu2O1M71gelBl'
'jW9VygFPOTsEK0WmrJDHYSoEnofOPdCE1oQRzueemVTl8'

View File

@ -0,0 +1,34 @@
:: Input twitter keys
/+ sh-utils
!:
|_ [hide vat=wain]
++ prompts
^- wain
:~ 'User: '
'App token: '
'App secret: '
'User token: '
'User secret: '
''
==
++ peek ,_prompt/[(snag (lent vat) prompts) %text '']
++ posh-txt
|= [@ * p=cord]
=. vat [p vat]
?. =(5 (lent vat)) `+>.$
%.(+< (add-exit ,_`+>.$))
::
++ part
=. vat (flop vat) :: put into order of entry
?. ?=([@ @ @ @ @ ~] vat)
~|([%keys-missing vat] !!)
=+ =< aut=[acc %auth [ctok csec] atok asec]
`[acc=span ctok=cord csec=cord atok=cord asec=cord ~]`vat
|= ost=bone
:_ ~
:^ ost %pass /out
[%g %mess serv our %twit-do !>(aut)]
::
++ poke--args (listen-in . (add-nice ,_`.))
++ serv [our /twit]
--

View File

@ -0,0 +1,5 @@
hoontap
AP3G1t8ki6rPzeeAqdWCTw03F
VV784LPwZSaAxtF16RWWTnST4F85BHN8VqQKNyv7MprCkA0xZD
2821727326-RZGXSeTn7hCFQfJqR0ViivM3YYpu2O1M71gelBl
jW9VygFPOTsEK0WmrJDHYSoEnofOPdCE1oQRzueemVTl8

View File

@ -0,0 +1,22 @@
:: Display twitter feed
::
:::: /hook/core/twitter-feed/app
::
/+ sh-utils
!:
::
:::: ~fyr
::
|_ [hide ~]
++ stat ,[id=@u who=@ta now=@da txt=@t]
++ rens
|=(stat rose/[": " `~]^~[leaf/"{<now>} @{(trip who)}" leaf/(trip txt)])
++ peer ,_`.
++ poke--args
|= [ost=bone his=ship who=span ~]
%.(+< (add-subs [[our /twit] our /user/[who]] ,_`+>.$))
::
++ posh-twit-feed
(args-into-gate . |=(a=(list stat) tang/(turn a rens)))
:: ++ pour |*([ost=@ * sih=[@ ^]] :_(+>.$ [ost %give +.sih]~))
--

19
main/app/type/core.hook Normal file
View File

@ -0,0 +1,19 @@
:: Type, render tpyes of arguments
::
:::: /hook/core/type/app
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ peer ,_`.
++ pock--args
%+ args-into-gate .
|= a=vase
:- %tang
|- ^- tang
=+ nex=(slew 3 a)
?~ nex ~
[(skol p:(slot 2 a)) $(a u.nex)]
--

View File

@ -1,18 +1,16 @@
:: Desk unsync
::
:::: /hook/core/unsync/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-unsync-args
|= [ost=bone you=ship syd=@tas her=@p sud=@tas ~]
:_ +>.$
:* [ost %pass /sync %c %plug our.hid syd her sud]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"unsynced"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [syd=@tas her=@p sud=@tas ~]
[%c %plug our.hid syd her sud]
(print . "unsynced")
--

View File

@ -1,13 +1,12 @@
:: Verb: toggle verbose mode
::
:::: /hook/core/verb/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-verb-args
|= [ost=bone you=ship ~]
:_ +>.$
:~ [ost %give %verb ~]
[ost %give %nice ~]
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args (add-resp [%give %verb ~] (args-done ,_`.))
--

13
main/app/wipe/core.hook Normal file
View File

@ -0,0 +1,13 @@
:: Wipe path, retcon app existence
::
::::
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ poke--args
%+ gate-bang |=([a=path ~] [%g %wipe our a])
(args-done ,_`.)
--

View File

@ -2,6 +2,10 @@
::
:::: /hook/gate/ye/bin
::
/+ sh-utils
::
::::
::
|%
++ sign ::
$% $: %a ::
@ -12,36 +16,27 @@
[%text p=tape] ::
== ::
--
::
!:
::::
::
|_ [hid=hide ~]
++ poke-ye-args
|= [ost=bone you=ship tex=tape ~]
:_ +>.$
=+ mez=(crip "{<our.hid>}: {tex}")
:~ [ost %pass /ye %a %want [our.hid (sein our.hid)] /q/ye mez]
[ost %give %nice ~]
==
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [tex=tape ~]
=+ mez=(crip "{<our.hid>}: {tex}")
[%a %want [our.hid (sein our.hid)] /q/ye mez]
(add-nice ,_`.)
::
++ poke-txt
|= [ost=bone him=ship cor=@t]
:_ +>.$
~[[ost %give %nice ~] [ost %pass /de %d %flog %text "> {(trip cor)}"]]
%+ gate-bang |=(cor=@t [%d %flog `flog`[%text "> {(trip cor)}"]])
(add-nice ,_`.)
::
++ pour
|= [ost=bone pax=path sih=sign]
?> ?=([%ye ~] pax)
:_ +>.$
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
?. ?=(%good q.sih)
leaf/"ye failed"
leaf/"ye received"
?> ?=([%bang ~] pax)
%. +<
=+ ack=?+(q.sih "failed" %good "recieved")
(add-exit (print +>.$ "ye {ack}"))
::
++ peer
|=
*
`+>
--

19
main/lib/rodeo/core.hook Normal file
View File

@ -0,0 +1,19 @@
::
:::: /hook/core/rodeo/lib
::
:: This file is in the public domain.
::
/? 314
/- *rodeo
::
::::
::
|%
++ main :: main story
|= our=ship ^- cord
=+ can=(clan our)
?+ can %porch
%czar %court
%king %floor
==
--

109
main/lib/sh-utils/core.hook Normal file
View File

@ -0,0 +1,109 @@
:: App construction utilities
::
:::: /hook/core/sh-utils/lib
::
|%
++ append
|* a=*
|* b=*
[b a]
::
++ hapt (pair ship path)
--
!:
::::
::
|%
++ args-done |*(ref=_,[(list) ^] (add-exit (add-nice ref))) :: accept args
::
++ add-exit :: add "kill self" kiss
|* ref=_,[(list) ^]
%+ add-resp [%pass / %g %cide %$]
ref
::
++ add-nice :: return "succcess" response
|* ref=_,[(list) ^]
%+ add-resp [%give %nice ~]
ref
::
++ add-subs :: add gall subscription
|* [hat=[hapt ship path] ref=_,[(list) ^]]
=+ `[hapt ship path]`hat :: typecheck
%+ add-resp [%pass /show %g %show hat]
ref
::
++ args-into-gate :: poke--args from gate: output and exit
|* [con=[* [hide *] *] gat=_,[@ *]]
%- args-done
%^ gate-outs con
|=(a=_+<.gat [%rush (gat a)])
,_`con
::
++ args-into-resp :: compute gifts with gate and exit
|* [con=[* [hide *] *] gat=_,(pole ,[@ *])]
%- args-done
|* [ost=bone * arg=_+<.gat]
:_ con
%. (gat arg)
|* a=(pole ,[@ *])
?~ a ~
a(- [ost %give -.a], + $(a +.a))
::
++ add-output :: send gift to /out
|* [con=[* [hide *] *] ote=[@ *] ref=_,[(list) ^]]
=> .(+<- `[* [hid=hide *] *]`con)
=+ sus=(~(tap in `(set bone)`(~(get ju pus.hid) /out)))
=+ mof=(turn sus (append [%give ote]))
|= _+<.ref
=+ neu=(ref +<)
neu(- (welp mof -.neu))
::
++ add-resp :: add response move to requesting bone
|* [mof=[@ @ *] ref=_,[(list) ^]]
|* [ost=bone _?@(+<.ref ~ +<+.ref)]
=+ neu=(ref +<)
neu(- [[ost mof] -.neu])
::
++ gate-give :: respond with computed gift
|* [gat=_,[@ *] ref=_,[(list) ^]]
(gate-move |*(_+<.gat [%give (gat +<)]) ref)
::
++ gate-bang :: respond with computed note
|* [gat=_,[@ @ *] ref=_,[(list) ^]]
(gate-move |*(_+<.gat [%pass /bang (gat +<)]) ref)
::
++ gate-mess :: respond with local message
|* [con=[* [hide *] *] gat=_,[@ @ *] ref=_,[(list) ^]]
=> .(+<- `[* [hid=hide *] *]`con)
%- gate-move :_ ref
|* _+<.gat
=+ `[imp=path mez=cage]`(gat +<)
[%pass /poke %g %mess [our.hid imp] our.hid mez]
::
++ gate-move :: respond with computed move
|* [gat=_,(mold) ref=_,[(list) ^]]
|* [ost=bone * arg=_+<.gat]
((add-resp (gat arg) ref) +<)
::
::
++ gate-outs :: send computed gift to /out
|* [con=[* [hide *] *] gat=_,[@ *] ref=_,[(list) ^]]
|* [ost=bone * arg=_+<.gat]
((add-output con (gat arg) ref) +<)
::
++ listen-in :: recieve standard input
|* [con=[* [hide *] *] ref=_,[(list) ^]]
=> .(+<- `[* [hid=hide *] *]`con)
(add-subs [[our +.imp] our /in/[-.imp]]:hid ref)
::
++ print
|* [con=[* [hide *] *] tap=tape]
(add-output con [%rush %tang [%leaf tap] ~] ,_[~ con])
::
++ verify :: type-check with context and move
|* [con=^ mof=[@ *]]
|* ref=_,[(list ,_mof) _con]
|* _+<.ref
^- [(list ,_mof) _con]
(ref +<)
--

43
main/lib/sqar/core.hook Normal file
View File

@ -0,0 +1,43 @@
~% %util +> ~
|%
++ kids (list inline)
++ inline
=+ ^= inlik
$% [%emph p=?] :: strong?
[%delt ~] :: strikethrough
[%link p=tape q=(unit tape)]
[%blot p=tape q=(unit tape)] :: image
==
=+ ^= inlin
$% [%$ p=tape]
[%line ~]
[%code p=tape]
[%html p=cord]
==
$&([p=inlik q=kids] inlin)
::
::
++ elem $&(tops node)
++ tops :: childful block
$: $= p
$% [%bloq ~]
[%list p=? q=$|(char [p=@u q=char])] :: tight, ordered?
[%item ~]
==
q=(list elem)
==
:: ++ mist |*(a=_,* ,[i=a t=$|(~ (mist a))]) :: .=(%mist +(%list))
++ node :: childless block
$% [%para p=kids]
[%hrul ~]
[%head p=@u q=kids]
[%code p=(unit ,[p=char q=@u r=tape]) q=wain] :: info, contents
[%html p=wain]
[%defn ~] :: empty para
==
::
++ sqar
~/ %sqar
|= @t
*(list elem)
--

544
main/lib/twitter/core.hook Normal file
View File

@ -0,0 +1,544 @@
:: A Twitter API library.
::
:::: /hook/core/twitter/lib
::
/? 314
/- *twitter
=+ twit
!:
:::: functions
::
|%
++ fass :: rewrite path
|= a=path
%- trip
%^ gsub '-' '_'
%+ reel a
|= [p=@t q=@t]
(cat 3 '/' (cat 3 p q))
::
++ gsub :: replace chars
|= [a=@t b=@t t=@t]
^- @t
?~ t t
%+ add (lsh 3 1 $(t (rsh 3 1 t)))
=+ c=(mod t (bex 8))
?:(=(a c) b c)
::
++ oauth :: OAuth 1.0 header
|= $: med=meth
url=tape
pas=(list tape)
key=keys
zet=@
ken=@
==
^- @t
=+ non=(turn (rip 2 (shaw zet 128 ken)) |=(a=@ ~(x ne a)))
=+ tim=(slag 2 (scow %ui (unt zet)))
=+ sky=(crip :(weld (urle (trip sec.con.key)) "&" (urle (trip sec.acc.key))))
=+ ^= bas
^- tape
=+ ^= hds
%- reel :_ |=([p=tape q=tape] :(weld p "&" q))
%- sort :_ aor
%- weld :- pas
^- (list tape)
:~ :(weld "oauth_consumer_key=" (trip tok.con.key))
:(weld "oauth_nonce=" non)
:(weld "oauth_signature_method=HMAC-SHA1")
:(weld "oauth_timestamp=" tim)
:(weld "oauth_token=" (trip tok.acc.key))
:(weld "oauth_version=1.0")
==
;: weld
(trip (cuss (trip `@t`med))) "&"
(urle url) "&"
(urle (scag (dec (lent hds)) `tape`hds))
==
=+ sig=`tape`(sifo (swap 3 (hmac (swap 3 sky) (crip bas))))
%- crip
;: weld "OAuth "
"oauth_consumer_key=" "\"" (trip tok.con.key) "\", "
"oauth_nonce=" "\"" non "\", "
"oauth_signature=" "\"" (urle sig) "\", "
"oauth_signature_method=\"HMAC-SHA1\", "
"oauth_timestamp=" "\"" tim "\", "
"oauth_token=" "\"" (trip tok.acc.key) "\", "
"oauth_version=1.0"
==
::
++ valve :: produce request
|= $: med=meth
[rus=tape quy=quay]
key=keys
est=time
eny=@
==
^- hiss
=+ url="https://api.twitter.com/1.1{rus}.json"
=+ req=|=(a=tape (scan a auri:epur))
=+ ^= help
|= quy=(list ,[tape tape])
^- (list tape)
%+ turn quy
|= a=[p=tape q=tape]
:(weld (urle p.a) "=" (urle q.a))
=+ tan=(turn quy |=([p=@t q=@t] [(trip p) (trip q)]))
=+ har=(help (turn tan |=(p=[p=tape q=tape] [p.p (urle q.p)])))
=+ hab=(help tan)
=+ lav=(reel har |=([p=tape q=tape] :(weld p "&" q)))
=+ voy=?:(=(0 (lent lav)) ~ (scag (dec (lent lav)) `tape`lav))
=+ vab=(reel hab |=([p=tape q=tape] :(weld p "&" q)))
=+ vur=(crip ?:(=(0 (lent vab)) ~ (scag (dec (lent vab)) `tape`vab)))
=+ ^= head
%- ~(gas by *math)
:~ ['authorization' [(oauth med url hab key est eny) ~]]
['content-type' ['application/x-www-form-urlencoded' ~]]
==
?: =(%get med)
?~ voy
[(req url) med head ~]
[(req :(weld url "?" voy)) med head ~]
[(req url) med head (some [(met 3 vur) vur])]
--
!:
:::: library
::
|%
++ twip :: response printers
|%
++ mean
|= [msg=@t num=@ud] ^- tank
rose/[": " `~]^~[leaf/"Error {<num>}" leaf/(trip msg)]
--
++ twir :: response parsers
|%
++ fasp |*([a=@tas b=*] [(gsub '-' '_' a) b])
++ user (cook crip (plus ;~(pose aln cab)))
++ mean (ot errors/(ar (ot message/so code/ni ~)) ~):jo
++ stat
=+ jo
^- $+(json (unit ,[id=@u who=@ta now=@da txt=@t]))
%- ot
:~ id/ni
user/(ot (fasp screen-name/(su user)) ~)
(fasp created-at/da)
text/so
==
++ usel
=+ jo
^- $+(json (unit (list ,who=@ta)))
=- (ot users/(ar -) ~)
(ot (fasp screen-name/(su user)) ~)
--
++ twit
=> |% :: request structures
++ dev ,@t :: device name
++ gat ,@t :: grant type
++ lat ,@t :: latitude
++ lid (list tid)
++ lon ,@t :: longitude
++ lsc (list scr)
++ lst (list ,@t)
++ nam ,@t :: location name
++ pla ,@t :: place-id
++ scr ,@t :: screen name
++ slu ,@t :: category name
++ tid ,@u
++ tok ,@t :: oauth token
++ url ,@t :: callback url
::
++ at ,[%access-token p=tok]
++ de ,[%device p=dev]
++ fo ,[%follow p=lid]
++ gr ,[%grant-type p=gat]
++ id ,[%id p=tid]
++ ii ,[%'!inline' p=@t]
++ is ,[%id p=lid]
++ la ,[%lat p=lat]
++ lo ,[%long p=lon]
++ na ,[%name p=lid]
++ oa ,[%oauth-callback p=url]
++ os ,[%source-screen-name p=scr]
++ pl ,[%place-id p=pla]
++ qq ,[%q p=@t]
++ sc ,[%screen-name p=scr]
++ sd ?(ui sc)
++ ss ,[%screen-name p=lsc]
++ sl ,[%slug p=slu]
++ si ,[%source-id p=tid]
++ st ,[%status p=@t]
++ te ,[%text p=@t]
++ ti ,[%target-id p=tid]
++ ts ,[%target-screen-name p=scr]
++ tr ,[%track p=lst]
++ ur ,[%url p=url]
++ ui ,[%user-id p=tid]
++ us ,[%user-id p=lid]
--
|_ [key=keys est=time eny=@uw]
++ lutt |=(@ `@t`(rsh 3 2 (scot %ui +<)))
++ llsc
|= (list scr)
(roll +< |=([p=scr q=@t] (cat 3 (cat 3 q ',') p)))
::
++ llst
|= (list ,@t)
(roll +< |=([p=@t q=@t] (cat 3 (cat 3 q ',') p)))
::
++ llid
|= (list tid)
(roll +< |=([p=tid q=@t] (cat 3 (cat 3 q ',') (lutt p))))
::
++ mold :: construct request
|* [med=meth pax=path a=$+(* *)]
|= [args=a quy=quay]
(valve med (cowl pax args quy) key est eny)
::
++ cowl :: handle parameters
|= $: pax=path
ban=(list ,[p=@t q=?(@ (list ,@))])
quy=quay
==
^- [path quay]
?~ ban
[(fass pax) quy]
?: =('!inline' p.i.ban)
?@ q.i.ban
[(fass (welp pax /[`@t`q.i.ban])) quy]
!!
:- (fass pax)
%+ welp quy
%+ turn `(list ,[p=@t q=?(@ (list ,@))])`ban
|= [p=@t q=?(@ (list ,@))]
^- [@t @t]
:- (gsub '-' '_' p)
?@ q
?- p
?(%id %source-id %target-id %user-id) (lutt q)
@ `@t`q
==
?- p
?(%follow %id %name %user-id) (llid q)
%track (llst q)
%screen-name (llsc q)
* !!
==
::
++ stat-ment
(mold %get /statuses/mentions-timeline ,~)
::
++ stat-user
(mold %get /statuses/user-timeline ,[sd ~])
::
++ stat-home
(mold %get /statuses/home-timeline ,~)
::
++ stat-retw
(mold %get /statuses/retweets-of-me ,~)
::
++ stat-rets-iddd
(mold %get /statuses/retweets ,[ii ~])
::
++ stat-show
(mold %get /statuses/show ,[id ~])
::
++ stat-dest-iddd
(mold %post /statuses/destroy ,[ii ~])
::
++ stat-upda
(mold %post /statuses/update ,[st ~])
::
++ stat-retw-iddd
(mold %post /statuses/retweet ,[ii ~])
::
++ stat-oemb-iddd
(mold %get /statuses/oembed ,[id ~])
::
++ stat-oemb-urll
(mold %get /statuses/oembed ,[ur ~])
::
++ stat-retw-idss
(mold %get /statuses/retweeters/ids ,[id ~])
::
++ sear-twee
(mold %get /search/tweets ,[qq ~])
::
++ stat-filt-foll
(mold %post /statuses/filter ,[?(fo tr) ~])
::
++ stat-samp
(mold %get /statuses/sample ,~)
::
++ stat-fire
(mold %get /statuses/firehose ,~)
::
++ user
(mold %get /user ,~)
::
++ site
(mold %get /site ,[fo ~])
::
++ dire
(mold %get /direct-messages ,~)
::
++ dire-sent
(mold %get /direct-messages/sent ,~)
::
++ dire-show
(mold %get /direct-messages/show ,[id ~])
::
++ dire-dest
(mold %post /direct-messages/destroy ,[id ~])
::
++ dire-neww
(mold %post /direct-messages/new ,[sd te ~])
::
++ frie-nore-idss
(mold %get /friendships/no-retweets/ids ,~)
::
++ frie-idss
(mold %get /friends/ids ,[sd ~])
::
++ foll-idss
(mold %get /followers/ids ,[sd ~])
::
++ frie-inco
(mold %get /friendships/incoming ,~)
::
++ frie-outg
(mold %get /friendships/outgoing ,~)
::
++ frie-crea
(mold %post /friendships/create ,[sd ~])
::
++ frie-dest
(mold %post /friendships/destroy ,[sd ~])
::
++ frie-upda
(mold %post /friendships/update ,[sd ~])
::
++ frie-show
(mold %get /friendships/show ,[?(si os) ?(ti ts) ~])
::
++ frie-list
(mold %get /friends/list ,[sd ~])
::
++ foll-list
(mold %get /followers/list ,[sd ~])
::
++ frie-look
(mold %get /friendships/lookup ,[?(us ss) ~])
::
++ acco-sett-gett
(mold %get /account/settings ,~)
::
++ acco-veri
(mold %get /account/verify-credentials ,~)
::
++ acco-sett-post
(mold %post /account/settings ,~)
::
++ acco-upda-deli
(mold %post /account/update-delivery-device ,[de ~])
::
++ acco-upda-prof
(mold %post /account/update-profile ,~)
::
++ acco-upda-prof-back
(mold %post /account/update-profile-background-image ,~)
::
++ acco-upda-prof-colo
(mold %post /account/update-profile-colors ,~)
::
++ bloc-list
(mold %get /blocks/list ,~)
::
++ bloc-idss
(mold %get /blocks/ids ,~)
::
++ bloc-crea
(mold %post /blocks/create ,[sd ~])
::
++ bloc-dest
(mold %post /blocks/destroy ,[sd ~])
::
++ user-look
(mold %get /users/lookup ,[?(us ss) ~])
::
++ user-show
(mold %get /users/show ,[sd ~])
::
++ user-sear
(mold %get /users/search ,[qq ~])
::
++ user-cont-tees
(mold %get /users/contributees ,[sd ~])
::
++ user-cont-tors
(mold %get /users/contributors ,[sd ~])
::
++ acco-remo
(mold %post /account/remove-profile-banner ,~)
::
++ user-prof
(mold %get /users/profile-banner ,[sd ~])
::
++ mute-user-crea
(mold %post /mutes/users/create ,[sd ~])
::
++ mute-user-dest
(mold %post /mutes/users/destroy ,[sd ~])
::
++ mute-user-idss
(mold %get /mutes/users/ids ,~)
::
++ mute-user-list
(mold %get /mutes/users/list ,~)
::
++ user-sugg-slug
(mold %get /users/suggestions ,[sl ~])
::
++ user-sugg
(mold %get /users/suggestions ,~)
::
++ favo-list
(mold %get /favorites/list ,~)
::
++ favo-dest
(mold %post /favorites/destroy ,[id ~])
::
++ favo-crea
(mold %post /favorites/create ,[id ~])
::
++ list-list
(mold %get /lists/list ,~)
::
++ list-stat
(mold %get /lists/statuses ,~)
::
++ list-memb-dest
(mold %post /lists/members/destroy ,~)
::
++ list-memb-hips
(mold %get /lists/memberships ,[sd ~])
::
++ list-subs-bers
(mold %get /lists/subscribers ,~)
::
++ list-subs-crea
(mold %post /lists/subscribers/create ,~)
::
++ list-subs-show
(mold %get /lists/subscribers/show ,[sd ~])
::
++ list-subs-dest
(mold %post /lists/subscribers/destroy ,~)
::
++ list-memb-crea-alll
(mold %post /lists/members/create-all ,[?(us ss) ~])
::
++ list-memb-show
(mold %get /lists/members/show ,[sd ~])
::
++ list-memb-bers
(mold %get /lists/members ,~)
::
++ list-memb-crea
(mold %post /lists/members/create ,[sd ~])
::
++ list-dest
(mold %post /lists/destroy ,~)
::
++ list-upda
(mold %post /lists/update ,~)
::
++ list-crea
(mold %post /lists/create ,[na ~])
::
++ list-show
(mold %get /lists/show ,~)
::
++ list-subs-ions
(mold %get /lists/subscriptions ,[sd ~])
::
++ list-memb-dest-alll
(mold %post /lists/members/destroy-all ,[?(us ss) ~])
::
++ list-owne
(mold %get /lists/ownerships ,[sd ~])
::
++ save-list
(mold %get /saved-searches/list ,~)
::
++ save-show-iddd
(mold %get /saved-searches/show ,[ii ~])
::
++ save-crea
(mold %post /saved-searches/create ,[qq ~])
::
++ save-dest-iddd
(mold %post /saved-searches/destroy ,[ii ~])
::
++ geoo-iddd-plac
(mold %get /geo/id ,[ii ~])
::
++ geoo-reve
(mold %get /geo/reverse-geocode ,[la lo ~])
::
++ geoo-sear
(mold %get /geo/search ,~)
::
++ geoo-simi
(mold %get /geo/similar-places ,[la lo na ~])
::
++ tren-plac
(mold %get /trends/place ,[id ~])
::
++ tren-avai
(mold %get /trends/available ,~)
::
++ tren-clos
(mold %get /trends/closest ,[la lo ~])
::
++ user-repo
(mold %post /users/report-spam ,[sd ~])
::
++ oaut-auth-cate
(mold %get /oauth/authenticate ,~)
::
++ oaut-auth-rize
(mold %get /oauth/authorize ,~)
::
++ oaut-acce
(mold %post /oauth/access-token ,~)
::
++ oaut-requ
(mold %post /oauth/request-token ,[oa ~])
::
++ oaut-toke
(mold %post /oauth2/token ,[gr ~])
::
++ oaut-inva
(mold %post /oauth2/invalidate-token ,[at ~])
::
++ help-conf
(mold %get /help/configuration ,~)
::
++ help-lang
(mold %get /help/languages ,~)
::
++ help-priv
(mold %get /help/privacy ,~)
::
++ help-toss
(mold %get /help/tos ,~)
::
++ appl-rate
(mold %get /application/rate-limit-status ,~)
::
++ stat-look
(mold %get /statuses/lookup ,[us ~])
--
--

View File

@ -84,7 +84,22 @@ window.urb.unsubscribe = function(params,cb) {
var $this = this
this.req(method,url,params,true,function(err,data) {
$this.cabs[$this.gsig(params)]('subscription closed')
delete $this.cabs[$this.gsig(params)]
cb(err,data)
})
}
window.urb.util = {
toDate: function (dat){
var mils = Math.floor((0x10000 * dat.getUTCMilliseconds()) / 1000).toString(16)
function pad(num, str){
return ((new Array(num + 1)).join('0') + str).substr(-num,num)
}
return '~' + dat.getUTCFullYear() +
'.' + (dat.getUTCMonth() + 1) +
'.' + dat.getUTCDate() +
'..' + pad(2, dat.getUTCHours()) +
'.' + pad(2, dat.getUTCMinutes()) +
'.' + pad(2, dat.getUTCSeconds()) +
'..' + pad(4, mils)
}
}

View File

@ -1,15 +0,0 @@
::
:::: /hoon/core/zing/pro
::
/? 314
/- begin-args
|_ arg=begin-args
::
++ grab :: convert from
|%
++ noun :: convert from %noun
|= src=*
^+ +>+
+>+(arg (begin-args src))
--
--

View File

@ -1,327 +1,42 @@
::
:::: /hoon/core/down/mar
::
/? 314
/- *markdown
/? 314
/- *markdown
::
::::
::
// /%%/parse :: inli donp parse
// /%%/rend :: sing sung sang flat into-inner
:: ~% %utyl +>+>+> ~
|_ don=down
++ grab :: convert from
|%
|%
++ md :: convert from %md
=< |=(src=@t (mark (trip src)))
=< |=(src=@t (mark src))
~% %utyl ..is ~
::~% %utyl +>+>+>+> ~
|%
++ mark
|= p=tape
(scan p apex)
::
++ apex :: markdown parser
|= tub=nail
^- (like down)
=+ sep=(sepa tub)
?~ q.sep [p.sep ~]
:- p.sep
%- some :_ [p.sep ~]
(turn p.u.q.sep |=(a=tape (scan a blos)))
::
++ base %+ stag %par
;~ plug
(stag %tex (plus ;~(pose prn eol)))
(easy ~)
==
::
++ blos :: block element
%+ knee *barb |. ~+
;~ pose
head quot lasd horz
code codf html para base
==
::
++ brek (stag %cut (cold ~ ;~(plug fas fas))) :: line break
++ chrd ;~(pose escp prn (cold ' ' eol)) :: shin character data
++ code :: code block
%+ stag %pre
%- full
%- plus
;~ pfix (stun [4 4] ace)
;~ pose
%+ cook welp
;~(plug (plus prn) (cold "\0a" eol))
(full (plus prn))
==
==
::
++ codf :: fenced code block
%+ stag %pre
%- full
%+ ifix
[;~(plug tec tec tec eol) ;~(plug tec tec tec)]
%- plus
;~ pose
%+ cook welp
;~(plug (star prn) (cold "\0a" eol))
(full (plus ;~(less ;~(plug tec tec tec) prn)))
==
::
++ cods :: code shin
%+ stag %cod
=+ chx=;~(pose (cold ' ' eol) prn)
;~ pose
%+ ifix [(jest '```') (jest '```')]
(plus ;~(less (jest '```') chx))
%+ ifix [(jest '``') (jest '``')]
(plus ;~(less (jest '``') chx))
(ifix [tec tec] (plus ;~(less tec chx)))
==
::
++ dont :: control chars
;~ pose tar tec cab sel
;~(plug sig sig)
;~(plug fas fas)
==
++ spas :: all shin elements
|* res=_rule
%- plus
;~ pose emph stri link
brek cods (text res)
==
::
++ eol (just `@`10) :: newline
++ emph :: emphasis
%+ knee *shin |. ~+
%+ stag %emp
=+ inn=(plus ;~(pose cods stri link (text fail)))
;~ pose
(ifix [(jest '***') (jest '***')] (stag %both inn))
(ifix [(jest '**_') (jest '_**')] (stag %both inn))
(ifix [(jest '*__') (jest '__*')] (stag %both inn))
(ifix [(jest '_**') (jest '**_')] (stag %both inn))
(ifix [(jest '__*') (jest '*__')] (stag %both inn))
(ifix [(jest '___') (jest '___')] (stag %both inn))
(ifix [(jest '**') (jest '**')] (stag %bold inn))
(ifix [(jest '__') (jest '__')] (stag %bold inn))
(ifix [tar tar] (stag %bent inn))
(ifix [cab cab] (stag %bent inn))
==
::
++ escp ;~(pfix bas (mask (trip '`*#-.{}[]\\'))) :: escapable chars
::
++ head :: header
%+ stag %had
=+ ^= hed
;~ pose
;~ plug
;~(pfix wits (spas hax))
(cook some (ifix [;~(plug (star hax) sel hax) ser] (plus alp)))
==
(ifix [wits (star hax)] ;~(plug (spas hax) (easy ~)))
==
=+ ^= sed
;~ pose
;~ plug
(spas ;~(pose eol sel))
(cook some (ifix [;~(plug sel hax) ser] (plus alp)))
==
;~(plug (spas eol) (easy ~))
==
%- full
;~ pose
;~(plug (cook lent (stun [1 6] hax)) hed)
(stag 1 (ifix [wits ;~(plug eol (plus tis))] sed))
(stag 2 (ifix [wits ;~(plug eol (plus hep))] sed))
==
::
++ horz :: horizontal rule
%+ stag %hot
%+ cold ~
%- full
;~ pose
;~(plug (stun [0 3] ace) hep wits hep wits hep (star ;~(pose hep ace)))
;~(plug (stun [0 3] ace) tar wits tar wits tar (star ;~(pose tar ace)))
;~(plug (stun [0 3] ace) cab wits cab wits cab (star ;~(pose cab ace)))
==
::
++ html (stag %hem apex:poxa) :: html barb
++ lasd :: top level list
%+ stag %lit
%- full
;~ pose
(stag & (lisd ;~(plug (star nud) dot)))
(stag | (lisd hep))
(stag | (lisd tar))
(stag | (lisd lus))
==
::
++ lisd :: list funk
|* bus=_rule
|= tub=nail
^- (like down)
=+ chx=;~(plug (plus prn) (cold "\0a" eol))
=- ?~ q.pre pre
:- p.pre %- some
[(turn `wall`p.u.q.pre |=(a=tape [%lie (scan a apex)])) [p.pre ~]]
^= pre %. tub
%+ most ;~(pose ;~(plug wits eol) (easy ~))
%+ cook |=(a=wall `tape`(zing a)) :: XX core dump w/o cast
;~ plug
%+ cook zing
;~ pose
(full ;~(pfix bus ace ;~(plug (plus prn) (easy ~))))
;~(pfix bus ace ;~(plug (plus prn) (cold "\0a" eol) (easy ~)))
==
%- star
;~ pose
;~(plug ;~(sfix eol ace ace) (cook welp chx))
;~(pfix ace ace (cook welp chx))
(full ;~(pfix ace ace (plus prn)))
==
==
::
++ link :: link element
%+ knee *shin |. ~+
%+ stag %lin
;~ plug
(ifix [sel ser] (plus ;~(pose emph stri cods (text ser))))
;~ pose
%+ ifix [pel per]
;~ plug
;~(sfix (cook zing (most eol (plus ;~(less ace prn)))) ace)
(cook some (ifix [doq doq] (plus ;~(less doq ;~(pose prn eol)))))
==
%+ ifix [pel per]
;~(plug (cook zing (most eol (plus ;~(less per prn)))) (easy ~))
==
==
::
++ para (stag %par (full (spas fail))) :: paragraph
++ quot :: blockquotes
%+ stag %quo
%- full
|= tub=nail
^- (like down)
=- ?~ q.pre
[p.pre ~]
(apex [[1 1] (welp p.u.q.pre q.q.u.q.pre)])
^= pre %. tub
%+ cook |=(a=wall `tape`(zing a))
%- plus
;~ pfix ;~(pose ;~(plug gar ace) gar)
;~ pose
(cook welp ;~(plug (star prn) (cold "\0a" eol)))
(full (star prn))
==
==
::
++ sepa :: separate barbs
%+ knee *wall |. ~+
=+ lin=;~(plug eol wits eol)
%- full
%+ ifix [(star whit) (star whit)]
%+ more ;~(plug eol wits (more wits eol))
;~ pose
sepc
(sepl (cold "-" hep))
(sepl (cold "*" tar))
(sepl (cold "+" lus))
(sepl (cook welp ;~(plug (star nud) (cold "." dot))))
(plus ;~(pose prn ;~(less lin eol)))
==
::
++ sepc :: separate code block
=+ tecs=(cold "```" (jest '```'))
%+ cook |=(wall `tape`(zing +<))
;~ plug
tecs
(cook zing (star ;~(plug eol ;~(less tecs (star prn)))))
(cold "\0a" eol)
tecs
(easy ~)
==
++ sepl :: separate list
|* bus=_rule
%+ cook zing
%+ most ;~(pose ;~(plug wits eol) (easy ~))
%+ cook |=(a=wall `tape`(zing a))
;~ plug
%+ cook |=(a=wall `tape`(zing a))
;~ pose
;~(plug bus (cold " " ace) (plus prn) (cold "\0a" eol) (easy ~))
(full ;~(plug bus (cold " " ace) (plus prn) (easy ~)))
==
%- star
;~ pose
;~ pfix wits
;~ plug eol ace ace
(cook welp ;~(plug (plus prn) (cold "\0a" eol)))
==
==
;~(plug ace ace (cook welp ;~(plug (plus prn) (cold "\0a" eol))))
(full ;~(plug ace ace (plus prn)))
==
==
::
++ stri :: strikethrough text
%+ stag %ike
%+ ifix [(jest '~~') (jest '~~')]
(plus ;~(pose emph cods link (text fail)))
::
++ text |*(res=_rule (stag %tex (plus ;~(less ;~(pose res dont) chrd))))
++ whit (mask ~[`@`0x20 `@`0xa]) :: whitespace w/nl
++ wits (star ace)
~/ %dawn
|= p=@t
(normalize (rash p parse))
--
::
++ noun down :: clam from %noun
--
::
++ grow :: convert into
=< |%
++ hymn :: convert to %hymn
;html
;head:title:"Untitled"
;body
;* (apex don)
==
==
++ psal :: convert to %psal
;div
;* (apex don)
==
--
|%
++ apex |=(don=down (turn don |=(bol=barb (blok bol))))
++ blok
|= bol=barb
^- manx
?- bol
[%had *]
:_ (turn q.bol sank)
[(cat 3 'h' (scot %ud p.bol)) ?~(r.bol ~ [[%id u.r.bol] ~])]
[%par *] [[%p ~] (turn p.bol sank)]
[%hot *] [[%hr ~] ~]
[%pre *] [[%pre ~] ~[[[%$ [[%$ (zing p.bol)] ~]] ~]]]
[%quo *] [[%blockquote ~] (apex p.bol)]
[%lie *] [[%li ~] (apex p.bol)]
[%lit *] ?: =(& p.bol) [[%ol ~] (apex q.bol)]
[[%ul ~] (apex q.bol)]
[%hem *] p.bol
==
::
++ sank
|= san=shin
^- manx
?- san
[%tex *] [[%$ [[%$ p.san] ~]] ~]
[%cut *] [[%br ~] ~]
[%ike *] [[%del ~] (turn p.san ..$)]
[%cod *] [[%code ~] ~[[[%$ [[%$ p.san] ~]] ~]]]
[%emp *]
?: =(%bent p.san) [[%em ~] (turn q.san ..$)]
?: =(%bold p.san) [[%strong ~] (turn q.san ..$)]
[[%em ~] ~[[[%strong ~] (turn q.san ..$)]]]
[%lin *]
?~ r.san [[%a ~[[%href q.san]]] (turn p.san ..$)]
[[%a ~[[%href q.san] [%title u.r.san]]] (turn p.san ..$)]
++ hymn :: convert to %hymn
;html
;head:title:"Untitled"
;body
;* (sing don)
==
==
++ psal :: convert to %psal
;div
;* (sing don)
==
--
--

File diff suppressed because one or more lines are too long

1006
main/mar/down/parse.hoon Normal file

File diff suppressed because it is too large Load Diff

222
main/mar/down/rend.hoon Normal file
View File

@ -0,0 +1,222 @@
:: ++down rendering arms
::
::::
::
|%
++ into-inner
|= [a=marl b=manx]
?~ c.b b(c a)
$(b i.c.b)
::
++ flat
|= a=marl
^- tape
?~ a ~
%- weld :_ $(a t.a)
^- tape
?~ n.g.i.a
?>(?=(_:/(**) i.a) v.i.a.g.i.a)
?+ n.g.i.a $(a c.i.a)
%img
%- zing ^- wall
%+ murn a.g.i.a |= [a=mane b=tape]
^- (unit tape)
?+ a ~
%alt [~ b]
==
==
::
++ sang :: tight item children
|= a=(list elem)
^- marl
?~ a ~
%- weld :_ $(a t.a)
?. ?=(%para -.i.a)
(sing i.a ~)
(sung p.i.a)
::
++ sing :: elem to manx
=> |%
++ first-word
|= a=tape
=. a (trip (crip a)) :: XX valid tapes
^- (unit tape)
=. a q.q:(need q:((star ace) [1 1] a))
=+ vex=((plus ;~(less ace prn)) [1 1] a)
?~ q.vex ~
(some (wonk vex))
--
=+ [tig=| had=*(unit mane)]
|= lum=(list elem)
|^ ^- marl
=+ a=apex
?~ q.a
p.a
(weld p.a $(lum q.a))
::
++ apex
^- [p=marl q=_lum]
?~ lum
?~ had [~ ~]
(lose "unclosed {<u.had>}")
=> [ele=i.lum .(lum t.lum)]
?. ?=(%html -.ele)
(push (reso ele) ~)
=+ tex=(trip (role p.ele))
=^ mar tex [p q.q]:(need q:(many:poxa 1^1 tex))
?^ mar
(push mar)
=^ hed lum (chomp tex head:poxa)
?^ hed
=+ max=`marx`u.hed
(push(lum q) [max p] ~):[apex(had `n.max) .]
=^ tal lum (chomp tex tail:poxa)
?~ tal
(push ;lost:"{tex}" ~)
?: =(had tal)
[~ lum]
?^ had
=. lum [ele lum]
(lose "unclosed {<u.had>}")
(lose "close {<u.tal>}")
::
++ lose |=(a=tape [[;lost:"{a}"]~ lum])
++ chomp
|* [tap=tape fel=_rule]
^- [(unit ,_(wonk *fel)) _lum]
=+ vex=(fel 1^1 tap)
?~ q.vex [~ lum]
:- [~ (wonk vex)]
?~(q.q.u.q.vex lum [[%html (crip q.q.u.q.vex) ~] lum])
::
++ push
|= a=marl
^+ apex
?~ a apex
[[b p] q]:[b=i.a (push t.a)]
::
++ reso
|= a=elem
?^ -.a
=. tig ?.(?=(%list -.p.a) tig p.p.a)
?: &(tig ?=(%item -.p.a))
[/li (sang q.a)]
%+ into-inner ^$(lum q.a)
?- -.p.a
%bloq ;blockquote;
%item ;li;
%list ?@ q.p.a ;ul;
?: =(1 p.q.p.a) ;ol;
=+ num=(pojo (jone p.q.p.a))
;ol(start num);
==
?- -.a :: :/("unimplemented {<p.a>}")
%html !! :: handled earlier XX do type stuff
%para [/p (sung p.a)]
%head [/(add %h0 (lsh 3 1 p.a)) (sung q.a)]
%hrul ;hr;
:: %html
::=+ tex=(role (turn p.a crip))
::=+ (poxa tex)
::?^ - u.-
::=+ (rush tex (star ;~(pose gah comt:poxa)))
::?^ - :/(~)
::;lost: {<p.a>}
:: :/([(role (turn p.a crip))]~) :: XX haaaaaaack
%defn :/(~)
%code =+ lan=?~(p.a ~ (first-word r.u.p.a))
=+ tex=(trip (role q.a))
?~ lan ;pre:code:"{tex}"
;pre:code(class "language-{u.lan}"):"{tex}"
==
--
::
++ sung
|= lim=kids
=+ had=*(unit mane)
|^ ^- marl
=+ a=apex
?~ q.a
p.a
(weld p.a $(lim q.a))
::
++ apex
^- [p=marl q=_lim]
?~ lim
?~ had [~ ~]
(lose "unclosed {<u.had>}")
=> [ele=i.lim .(lim t.lim)]
?. ?=(%htmt -.ele)
?: &(?=(%$ -.ele) ?=([[%$ *] *] lim))
apex(p.i.lim (weld p.ele p.i.lim))
(push (reso ele) ~)
=+ tex=(trip p.ele)
=^ emo lim (chomp tex empt:poxa)
?^ emo
=+ man=`manx`u.emo
(push man ~)
=^ hed lim (chomp tex head:poxa)
?^ hed
=+ max=`marx`u.hed
(push(lim q) [max p] ~):[apex(had `n.max) .]
=^ tal lim (chomp tex tail:poxa)
?~ tal
(push ;lost:"{tex}" ~)
?: =(had tal)
[~ lim]
?^ had
=. lim [ele lim]
(lose "unclosed {<u.had>}")
(lose "close {<u.tal>}")
::
++ lose |=(a=tape [[;lost:"{a}"]~ lim])
++ chomp
|* [tap=tape fel=_rule]
^- [(unit ,_(wonk *fel)) _lim]
=+ vex=(fel 1^1 tap)
?~ q.vex [~ lim]
:- [~ (wonk vex)]
?~(q.q.u.q.vex lim [[%htmt (crip q.q.u.q.vex)] lim])
::
++ push
|= a=marl
^+ apex
?~ a apex
[[b p] q]:[b=i.a (push t.a)]
::
++ urly
|= a=tape ^- tape
?~ a ~
:: ?: (gth i.a 0xff) "XX" :: XX
?: ?| [?=(^ q)]:(alp 1^1 a)
(~(has in (sa "!*'();:@&=+$,/?#%.~_")) i.a) :: XX reparse
==
[i.a $(a t.a)]
(weld (urle (trip i.a)) $(a t.a))
::
++ reso
|= b=inline
^- manx
?@ -.b
?- -.b
%$ :/(p.b)
%line ;br;
%code ;code:"{p.b}"
%htmt !! ::p.b :: handled earlier :: XX do type stuff
==
?: ?=(%blot -.p.b)
=+ res=`manx`;img(src (urly p.p.b), alt (flat (turn q.b ..$)));
:: ;img@"{p.p.b}";
?~ q.p.b res
res(a.g (welp a.g.res title/u.q.p.b ~))
%+ into-inner (sung q.b)
?- p.b
[%emph ?] ?.(p.p.b ;em; ;strong;)
[%delt ~] ;del;
[%link ^] =+ url=(urly p.p.b)
?~ q.p.b ;a/"{url}";
;a/"{url}"(title u.q.p.b);
==
--
--

View File

@ -0,0 +1,74 @@
::
:::: /hook/door/radio-command/mar
::
/? 314
/- *radio
!:
|_ cod=command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=> [jo ..command]
|= a=json ^- command
=- (need ((of -) a))
=< :~ publish/(ar thot)
review/(ar thot)
design/(ot party/so config/(mu conf) ~)
ping/auri
==
|%
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- cu :_ (ar a)
~(gas in *(set ,_(need *a)))
::
++ lake |*(a=_,* $+(json (unit a)))
++ peach
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op stati (ci (soft delivery) so)) :: audience
++ auri (op stati (ci (soft presence) so))
::
++ stati
^- $+(nail (like station))
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft partner)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ stam
^- $+(json (unit statement))
=- (ot now/di speech/(of -) ~)
:~ own/so
say/so
exp/(cu |=(a=cord [a ~]) so)
inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
==
::
::
++ conf
^- $+(json (unit config))
%- ot :~
sources/(as (su stati))
:- %cordon
%+ cu |*(a=^ ?~(-.a a a)) :: XX do type stuff
(ot white/bu list/(as (su fed:ag)) ~)
==
--
-- --

View File

@ -0,0 +1,92 @@
::
:::: /hook/door/radio-report/mar
::
/? 314
/- *radio
!:
|_ rep=report
::
++ grab :: convert from
|%
++ noun report :: clam from %noun
--
++ grow
|%
++ mime [/text/json (taco (crip (pojo json)))]
++ json
=> +
|^ %+ joba -.rep
?- -.rep
%config ~! rep (conf +.rep)
%house [%a (turn (~(tap by +.rep)) joce)]
%grams (jobe num/(jone p.rep) tele/[%a (turn q.rep gram)] ~)
::%group (grop +.rep)
%group (jobe local/(grop p.rep) global/%.(q.rep (jome stan grop)) ~)
==
++ joce |=(a=span [%s a])
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
:: ++ jase
:: |* a=,json
:: |= b=(set ,_+<.a) ^- json
:: ~! b
:: [%a (turn (~(tap in b)) a)]
::
++ jome :: stringify keys
|* [a=_cord b=_json]
|= c=(map ,_+<.a ,_+<.b)
(jobe (turn (~(tap by c)) (both a b)))
::
++ both :: cons two gates
|* [a=_,* b=_,*]
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
::
::
++ grop (jome phon stas) :: (map ship status)
++ phon |=(a=ship (scot %p a))
++ stas |=(status (jobe presence/(joce p) human/(huma q) ~))
++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~))
++ thot
|= thought
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
::
++ audi (jome stan joce)
++ stan
|= a=station ^- cord
%- crip
?~ -.a "{<p.p.a>}/{(trip q.p.a)}"
?- -.p.a
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
::
++ stam |=(statement (jobe time/(jode p) speech/(spec q) ~))
++ spec
|= a=speech
%+ joba -.a
?- -.a
?(%own %say) [%s p.a]
%exp (jobe code/[%s p.a] done/?~(q.a ~ (joke u.q.a)) ~)
%inv (jobe ship/(jope p.a) party/[%s q.a] ~)
==
::
++ huma
|= human
%^ jobe
hand/?~(hand ~ [%s u.hand])
:- %true
?~ true ~
=+ u.true
(jobe first/[%s p] middle/?~(q ~ [%s u.q]) last/[%s r] ~)
~
::
++ conf
|= config
%- jobe :~
sources/[%a (turn (~(tap in sources)) |=(a=station [%s (stan a)]))]
=- cordon/(jobe white/[%b -.cordon] list/[%a -] ~)
(turn (~(tap in p.cordon)) jope) :: XX jase
==
--
-- --

View File

@ -0,0 +1,90 @@
::
:::: /hook/door/rodeo-command/mar
::
/? 314
/- *rodeo
!:
|_ cod=command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=> [jo ..command]
|= a=json ^- command
=- (need ((of -) a))
=< :~ publish/(ar thot)
review/(ar thot)
design/(ot party/so config/(mu conf) ~)
==
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- cu :_ (ar a)
~(gas in *(set ,_(need *a)))
::
++ lake |*(a=_,* $+(json (unit a)))
++ peach
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op parn memb) :: audience
++ auri (op parn (ci (soft presence) so))
++ memb (ot envelope/lope delivery/(ci (soft delivery) so) ~)
++ lope (ot visible/bo sender/(mu (su parn)) ~)
::
++ parn
^- $+(nail (like partner))
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft passport)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ stam
^- $+(json (unit statement))
=- (ot date/di bouquet/(as (ar so)) speech/(of -) ~)
:~ lin/(ot say/bo txt/so ~)
:: exp/(cu |=(a=cord [a ~]) so)
:: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
==
::
::
++ conf
^- $+(json (unit config))
%- ot :~
sources/(as (su parn))
caption/so
:- %cordon
(ot posture/(ci (soft posture) so) list/(as (su fed:ag)) ~)
==
--
-- --

View File

@ -0,0 +1,109 @@
::
:::: /hook/door/rodeo-report/mar
::
/? 314
/- *rodeo
!:
|_ rep=report
::
++ grab :: convert from
|%
++ noun report :: clam from %noun
--
++ grow
|%
++ mime [/text/json (taco (crip (pojo json)))]
++ json
=> +
|^ %+ joba -.rep
?- -.rep
%config ~! rep (conf +.rep)
%house a/(turn (~(tap by +.rep)) jose)
%grams (jobe num/(jone p.rep) tele/[%a (turn q.rep gram)] ~)
%group (jobe local/(grop p.rep) global/%.(q.rep (jome parn grop)) ~)
==
++ joce |=(a=span [%s a])
++ jose
|= [a=span b=posture c=cord]
(jobe name/[%s a] posture/[%s a] caption/[%s b] ~)
::
++ jove
|= [a=envelope b=delivery]
%- jobe :~
envelope/(jobe visible/[%b p.a] sender/?~(q.a ~ s/(parn u.q.a)) ~)
delivery/[%s b]
==
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))])
++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
:: ++ jase
:: |* a=,json
:: |= b=(set ,_+<.a) ^- json
:: ~! b
:: [%a (turn (~(tap in b)) a)]
::
++ jome :: stringify keys
|* [a=_cord b=_json]
|= c=(map ,_+<.a ,_+<.b)
(jobe (turn (~(tap by c)) (both a b)))
::
++ both :: cons two gates
|* [a=_,* b=_,*]
|=(c=_[+<.a +<.b] [(a -.c) (b +.c)])
::
::
++ grop (jome phon stas) :: (map ship status)
++ phon |=(a=ship (scot %p a))
++ stas |=(status (jobe presence/(joce p) human/(huma q) ~))
++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~))
++ thot
|= thought
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
::
++ audi (jome parn jove)
++ bouq
|= a=bouquet
a/(turn (~(tap in a)) |=(b=path a/(turn b |=(c=span s/c))))
::
++ parn
|= a=partner ^- cord
%- crip
?~ -.a "{<p.p.a>}/{(trip q.p.a)}"
?- -.p.a
%twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
::
++ stam
|= statement
(jobe date/(jode p) bouquet/(bouq q) speech/(spec r) ~)
::
++ spec
|= a=speech
%+ joba -.a
?+ -.a !!
%lin (jobe say/[%b p.a] txt/[%s q.a] ~)
%exp (jobe code/[%s p.a] ~)
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
==
::
++ huma
|= human
%^ jobe
hand/?~(hand ~ [%s u.hand])
:- %true
?~ true ~
=+ u.true
(jobe first/[%s p] middle/?~(q ~ [%s u.q]) last/[%s r] ~)
~
::
++ conf
|= config
%- jobe :~
sources/[%a (turn (~(tap in sources)) |=(a=partner [%s (parn a)]))]
caption/[%s caption]
=- cordon/(jobe posture/[%s -.cordon] list/[%a -] ~)
(turn (~(tap in q.cordon)) jope) :: XX jase
==
--
-- --

View File

@ -13,7 +13,7 @@
%- need
%. jon => jo
%^ ot
pax/(su ;~(pfix fas (more fas sym)))
pax/(su ;~(pose (cold ~ (full fas)) (plus ;~(pfix fas urs:ab))))
act/(of line/so res/so cmd/so ~)
~
++ noun term-in :: clam from %noun

View File

@ -18,10 +18,10 @@
[%history %a (turn q.tel |=(a=cord [%s a]))]
:+ %lines %a
%- zing ^- (list (list ^json))
%+ turn (flop r.tel) |= a=?(tank [%stem p=tank q=tank])
%+ turn (flop r.tel) |= a=?(tank [%stem p=@da q=tank r=tank])
?. ?=(%stem -.a)
(turn (wash 0^80 a) jape)
[(jobe prompt/(jape ~(ram re p.a)) task/(jape ~(ram re q.a)) ~)]~
[(jobe prompt/(jape ~(ram re q.a)) task/(jape ~(ram re r.a)) ~)]~
==
--
--

View File

@ -0,0 +1,46 @@
/+ sqar
// /=try=/daun
!:
=-
;html
;head
;title: skuaring
==
;body
;p: 15 skwared is *{(sing (sqar -))}
==
==
'''
## Why is a spec needed?
John Gruber's [canonical description of Markdown's
syntax](http://daringfireball.net/projects/markdown/syntax)
does not specify the syntax unambiguously. Here are some examples of
questions it does not answer:
1. How much indentation is needed for a sublist? The spec says that
continuation paragraphs need to be indented four spaces, but is
not fully <emph>explicit</emph> about sublists. It is natural to think that
they, too, must be indented four spaces, but `Markdown.pl` does
not require that. This is hardly a "corner case," and divergences
between implementations on this issue often lead to surprises for
users in real documents. (See [this comment by John
Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).)
2. Is a blank line needed before a block quote or header?
Most implementations do not require the blank line. However,
this can lead to unexpected results in hard-wrapped text, and
also to ambiguities in parsing (note that some implementations
put the header inside the blockquote, while others do not).
(John Gruber has also spoken [in favor of requiring the blank
lines](http://article.gmane.org/gmane.text.markdown.general/2146).)
3. Is a blank line needed before an indented code block?
(`Markdown.pl` requires it, but this is not mentioned in the
documentation, and some implementations do not require it.)
``` markdown
paragraph
code?
```
'''

View File

@ -0,0 +1,26 @@
::
::
:::: /hook/hymn/fab/chat/pub/
::
^- manx
;html
;head
;meta(charset "utf-8");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/react/0.12.1/react.min.js");
;meta(name "viewport", content "width=432, initial-scale=1");
;script(type "text/javascript", src "//use.typekit.net/fkv0sjk.js");
;script:'''
try{Typekit.load();}catch(e){}
'''
;link(type "text/css", rel "stylesheet", href "/gen/main/pub/radio/src/main.css");
;script(type "text/javascript", src "/gop/hart.js");
;title: Radio
==
;body
;div#c;
;script(type "text/javascript", src "/gen/main/lib/urb.js");
;script(type "text/javascript", src "/gen/main/pub/radio/src/main.js");
==
==

327
main/pub/radio/src/main.css Normal file
View File

@ -0,0 +1,327 @@
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/bauregular.otf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/bauregularitalic.otf");
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/baumedium.otf");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/baumediumitalic.otf");
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/baubold.otf");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("https://s3-us-west-2.amazonaws.com/urbit/baubolditalic.otf");
font-weight: 600;
font-style: italic;
}
.iden,
.time,
#length,
input.join,
.stations {
font-family: "source-code-pro";
}
input {
-webkit-appearance: none;
border-radius: 0;
}
html,
body {
height: 100%;
font-family: "bau";
}
#length,
.time {
font-size: 0.6rem;
letter-spacing: 0;
font-weight: 200;
}
input.join,
.stations,
.iden,
#station {
font-size: 0.7rem;
}
html,
body {
font-size: 18px;
}
body {
background-color: #fefefe;
padding: 0;
margin: 0;
}
.hidden {
display: none;
}
#c {
width: 66rem;
top: 0;
padding: 1rem 1rem 0 1rem;
background-color: #fff;
height: 100%;
}
#stations-container {
position: fixed;
top: 1rem;
left: 1rem;
width: 12rem;
}
#station-container {
position: fixed;
top: 1rem;
left: 54rem;
width: 12rem;
}
#stations-container,
#messages-container {
vertical-align: top;
}
#station {
width: 18rem;
}
#station .iden {
display: block;
}
.stations {
width: 4rem;
}
.station {
display: inline-block;
width: 9rem;
margin-bottom: 0.3rem;
cursor: pointer;
}
.station .name {
border-bottom: 2px solid transparent;
}
.station.selected .name {
font-weight: 600;
border-bottom: 2px solid #000;
}
.station > div {
display: inline;
}
.station .remove {
display: none;
float: right;
font-size: 0.8rem;
line-height: 1rem;
}
.station:hover .remove {
display: inline;
}
.join-ctrl {
margin-top: 1.2rem;
}
.join-ctrl input {
border: none;
}
.join-ctrl input::-webkit-input-placeholder {
font-weight: 200;
}
.join-ctrl input {
font-weight: 400;
}
.message {
margin-bottom: 0.2rem;
}
#messages .message:last-child {
margin-bottom: 2rem;
}
#messages .message .time {
opacity: 0;
}
#messages .message:last-child .time,
#messages .message:hover .time {
opacity: 1;
}
.time {
margin-right: 0.6rem;
}
.member {
width: 12rem;
margin: 0.3rem 0.6rem 0.3rem 0;
}
#messages {
height: auto;
}
.attr {
width: 9rem;
text-align: right;
margin-right: 2rem;
}
.mess,
.attr,
.iden,
.attr > div,
#station .member div,
#writing {
display: inline-block;
}
.iden > div {
display: inline;
}
.mess,
#writing,
#length {
vertical-align: top;
}
.mess {
font-size: 0.8rem;
letter-spacing: 0.03rem;
word-wrap: break-word;
max-width: 31rem;
}
.ship,
.name {
font-weight: 500;
}
.ship.talk:before {
content: "...";
margin-left: -1.3rem;
margin-right: 0.3rem;
width: 1rem;
margin-top: -0.4rem;
vertical-align: middle;
display: inline-block;
line-height: 0.2rem;
letter-spacing: -0.1rem;
}
#writing-container {
bottom: 4rem;
margin-bottom: 1rem;
}
#messages-container,
#writing-container {
margin-left: 12rem;
}
.writing #length {
display: inline;
margin-left: 1rem;
margin-top: 1.2rem;
}
#writing {
font-size: 0.8rem;
}
#writing,
input.join {
min-height: 1.2rem;
padding: 0.3rem 0.6rem;
margin-left: -0.6rem;
outline: none;
background-color: #f9f9f9;
}
#writing:focus,
input.join:focus {
background-color: #eee;
}
.pending {
color: #ccc;
}
#scrolling {
display: none;
}
.scrolling #scrolling {
position: fixed;
bottom: 3rem;
left: 2rem;
height: 1rem;
padding: 1rem;
height: 2rem;
background-color: #f9f9f9;
font-weight: 500;
font-size: 0.8rem;
text-transform: uppercase;
}
@media (max-width: 40rem) {
#c {
left: 0;
margin-left: 0;
width: 24rem;
}
#messages-container,
#writing-container {
margin-left: 1rem;
}
#stations-container,
#station-container {
position: relative;
float: left;
}
#stations-container {
width: 8rem;
}
#station-container {
left: auto;
}
.station {
width: 5rem;
}
.attr {
display: block;
text-align: left;
width: 2rem;
margin-right: 1rem;
}
.message {
height: 1.6rem;
}
.join-ctrl input,
.stations,
.iden,
#station {
font-size: 0.5rem;
}
.join-ctrl input {
width: 6rem;
}
.station .remove {
display: inline;
font-size: 0.6rem;
line-height: 0.6rem;
}
.ship.talk:before {
margin-left: -0.3rem;
margin-right: 0;
}
.attr {
width: 4rem;
}
.iden > div {
display: block;
}
.attr > .time {
display: none;
}
.mess {
max-width: 12rem;
margin-bottom: 1rem;
}
#writing {
max-width: 12rem;
}
#station {
width: 8rem;
}
}

5901
main/pub/radio/src/main.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
;html
;head
;title: Radio Tests
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js");
;script(type "text/javascript", src "/gep/hart.js");
==
;body
;script(type "text/javascript", src "/gen/main/lib/urb.js");
;script(type "text/javascript", src "/gen/main/pub/src/radio/main.js");
==
==

View File

@ -0,0 +1,14 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/galen/Documents/Projects/urbit.tlon/chat/pub/src/radio/main.coffee":[function(require,module,exports){
$(function() {
return window.urb.subscribe({
appl: "radio",
path: "/"
}, function(err, res) {
console.log('updates');
return console.log(arguments);
});
});
},{}]},{},["/Users/galen/Documents/Projects/urbit.tlon/chat/pub/src/radio/main.coffee"]);

View File

@ -0,0 +1,27 @@
::
::
:::: /hook/hymn/fab/chat/pub/
::
^- manx
;html
;head
;meta(charset "utf-8");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/react/0.12.1/react.js");
;script(type "text/javascript", src "/gen/main/pub/talk/src/dep/director.js");
;meta(name "viewport", content "width=432, initial-scale=1");
;script(type "text/javascript", src "//use.typekit.net/fkv0sjk.js");
;script:'''
try{Typekit.load();}catch(e){}
'''
;link(type "text/css", rel "stylesheet", href "/gen/main/pub/talk/src/main.css");
;script(type "text/javascript", src "/gop/hart.js");
;title: Radio
==
;body
;div#c;
;script(type "text/javascript", src "/gen/main/lib/urb.js");
;script(type "text/javascript", src "/gen/main/pub/talk/src/main.js");
==
==

File diff suppressed because one or more lines are too long

406
main/pub/talk/src/main.css Normal file
View File

@ -0,0 +1,406 @@
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/bauregular.otf");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/bauregularitalic.otf");
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/baumedium.otf");
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/baumediumitalic.otf");
font-weight: 500;
font-style: italic;
}
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/baubold.otf");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "bau";
src: url("http://office-for.com/lib/etc/bau/baubolditalic.otf");
font-weight: 600;
font-style: italic;
}
.iden,
.audi,
.time,
#length {
font-family: "source-code-pro";
}
.join-ctrl input {
font-family: "bau";
}
input {
-webkit-appearance: none;
border-radius: 0;
}
html,
body {
height: 100%;
font-family: "bau";
}
#length,
.time {
font-size: 0.6rem;
letter-spacing: 0;
font-weight: 200;
}
input.join,
.iden,
.audi,
#station {
font-size: 0.7rem;
}
html,
body {
font-size: 18px;
}
body {
background-color: #fefefe;
padding: 0;
margin: 0;
}
.hidden {
display: none;
}
#c {
top: 0;
background-color: #fff;
}
#stations-container {
position: absolute;
top: 1rem;
left: 50%;
width: 24rem;
margin-left: -12rem;
font-size: 4rem;
}
#station-container {
position: fixed;
top: 0;
left: 50%;
width: 28rem;
max-height: 2.9rem;
overflow: hidden;
margin-left: -14rem;
padding-top: 1rem;
background-color: #fff;
border-bottom: 3px solid #ededed;
transition: max-height 0.15s ease-out;
}
#station-container:hover {
max-height: 12rem;
transition: max-height 0.25s ease-in;
}
#stations-container,
#messages-container {
vertical-align: top;
}
#messaging-container {
position: absolute;
top: 4rem;
left: 50%;
width: 24rem;
margin-left: -12rem;
margin-bottom: 4rem;
}
#station > div {
display: inline-block;
float: left;
}
#station-meta {
margin-right: 1rem;
margin-bottom: 1rem;
}
#sources-container {
width: 6rem;
}
#members {
margin-left: 2rem;
}
#station .iden {
display: block;
}
.station {
display: inline-block;
width: 9rem;
margin-bottom: 0.3rem;
cursor: pointer;
font-weight: 200;
}
#stations .station {
display: block;
width: 24rem;
}
.station .name {
border-bottom: 6px solid transparent;
}
.station .name:hover {
border-bottom: 6px solid #000;
}
.station > div {
display: inline-block;
}
.toggle {
width: 0.4rem;
height: 0.4rem;
border: 2px solid #000;
margin-right: 0.6rem;
}
.toggle.active {
background-color: #000;
}
.station .remove {
display: none;
float: right;
margin-left: 1rem;
font-weight: 600;
color: #f00;
}
.station:hover .remove {
display: inline;
}
#sources-container .station {
font-family: "source-code-pro";
font-weight: 500;
text-transform: lowercase;
}
.sour-ctrl {
margin-bottom: 0.16rem;
}
.join-ctrl input,
.sour-ctrl input {
border: none;
font-weight: 400;
}
.sour-ctrl input::-webkit-input-placeholder {
font-family: "bau";
font-size: 1rem;
font-weight: 200;
margin-left: 0.6rem;
color: #0003ff;
}
.message {
padding-top: 0.3rem;
margin-bottom: 0.6rem;
}
#messages .message:last-child {
margin-bottom: 1rem;
}
#messages .message .time {
opacity: 0;
}
#messages .message:last-child .time,
#messages .message:hover .time {
opacity: 1;
}
.time {
margin-right: 0.6rem;
}
.member {
width: 12rem;
margin: 0.3rem 0.6rem 0.3rem 0;
}
#messages {
height: auto;
}
.mess,
.iden,
.attr > div,
#station .member div,
#writing {
display: inline-block;
}
.iden > div {
display: inline;
}
.mess,
#writing,
#length {
vertical-align: top;
}
.attr .iden {
margin-left: 1rem;
}
.attr > div {
margin-right: 0.3rem;
}
.mess {
font-size: 0.9rem;
line-height: 1.6rem;
letter-spacing: 0.03rem;
word-wrap: break-word;
max-width: 31rem;
}
.ship {
font-weight: 600;
}
.ship.talk:before {
content: "...";
margin-left: -1.3rem;
margin-right: 0.3rem;
width: 1rem;
margin-top: -0.4rem;
vertical-align: middle;
display: inline-block;
line-height: 0.2rem;
letter-spacing: -0.1rem;
}
#writing-container {
bottom: 4rem;
margin-bottom: 1rem;
}
.writing {
padding-top: 0.3rem;
}
.writing #length {
display: inline;
margin-left: 1rem;
margin-top: 1.2rem;
}
#writing {
font-size: 0.9rem;
min-height: 1.3rem;
min-width: 1.3rem;
padding: 0;
outline: none;
background-color: #20c567;
}
#writing:focus {
background-color: #fff;
}
#station h1 {
display: inline-block;
margin: 0;
font-weight: 200;
font-size: 2rem;
text-transform: lowercase;
}
input.join {
font-size: 4rem;
background-color: #fff;
outline: none;
width: 24rem;
}
#station input.join {
font-family: "source-code-pro";
font-size: 0.7rem;
line-height: 1rem;
width: 12rem;
}
input.join::-webkit-input-placeholder {
color: #0003ff;
}
input.join:focus::-webkit-input-placeholder {
color: #fff;
}
.pending {
color: #ccc;
}
a.up {
height: 2rem;
margin-top: 0.6rem;
vertical-align: middle;
display: inline-block;
}
.arow-up {
display: inline-block;
margin-right: 1rem;
width: 0;
height: 0;
border-left: 9px solid transparent;
border-right: 9px solid transparent;
border-bottom: 9px solid #ff6b00;
}
#scrolling {
display: none;
}
.scrolling #scrolling {
position: fixed;
bottom: 3rem;
left: 2rem;
height: 1rem;
padding: 1rem;
height: 2rem;
background-color: #f9f9f9;
font-weight: 500;
font-size: 0.8rem;
text-transform: uppercase;
}
@media (max-width: 40rem) {
#c {
left: 0;
margin-left: 0;
width: 24rem;
}
#messages-container,
#writing-container {
margin-left: 1rem;
}
#stations-container,
#station-container {
position: relative;
float: left;
}
#stations-container {
width: 8rem;
}
#station-container {
left: auto;
}
.station {
width: 5rem;
}
.attr {
display: block;
text-align: left;
width: 2rem;
margin-right: 1rem;
}
.message {
height: 1.6rem;
}
.stations,
.iden,
#station {
font-size: 0.5rem;
}
.station .remove {
display: inline;
font-size: 0.6rem;
line-height: 0.6rem;
}
.ship.talk:before {
margin-left: -0.3rem;
margin-right: 0;
}
.attr {
width: 4rem;
}
.iden > div {
display: block;
}
.attr > .time {
display: none;
}
.mess {
max-width: 12rem;
margin-bottom: 1rem;
}
#writing {
max-width: 12rem;
}
}

5924
main/pub/talk/src/main.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
(list)

View File

@ -1 +1 @@
[her=ship mes=?(~ [tex=tape ~])]
[her=ship mes=$|(~ [tex=tape ~])]

View File

@ -1,22 +1,39 @@
|%
++ down (list barb) :: markdown structure
++ barb :: block elements
$% [%had p=@ud q=(list shin) r=(unit tape)] :: depth, contents, id
[%hem p=manx] :: html tag
[%hot ~] :: horizontal rule
[%lie p=down] :: list element
[%lit p=? q=down] :: list
[%par p=(list shin)] :: paragraph
[%pre p=wall] :: preformatted text
[%quo p=down] :: blockquote
== ::
++ shin :: span elements
$% [%cod p=tape] :: inline code
[%cut ~] :: break
[%emp p=?(%bent %bold %both) q=(list shin)] :: emphasis
[%ike p=(list shin)] :: strikethrough
[%lin p=(list shin) q=tape r=(unit tape)] :: link
[%tex p=tape] :: text
== ::
++ down (list elem)
++ kids (list inline)
++ inline
=+ ^= inlik
$% [%emph p=?] :: strong?
[%delt ~] :: strikethrough
[%link p=tape q=(unit tape)]
[%blot p=tape q=(unit tape)] :: image
==
=+ ^= inlin
$% [%$ p=tape]
[%line ~]
[%code p=tape]
[%htmt p=cord] :: XX (each marx mane)
==
$&([p=inlik q=kids] inlin)
::
::
++ elem $&(tops node)
++ tops :: childful block
$: $= p
$% [%bloq ~]
[%list p=? q=$|(char [p=@u q=char])] :: tight, ordered?
[%item ~]
==
q=down
==
:: ++ mist |*(a=_,* ,[i=a t=$|(~ (mist a))]) :: .=(%mist +(%list))
++ node :: childless block
$% [%para p=kids]
[%hrul ~]
[%head p=@u q=kids]
[%code p=(unit ,[p=char q=@u r=tape]) q=wain] :: info, contents
[%html p=wain]
[%defn ~] :: empty para
==
--

View File

@ -2,3 +2,4 @@ $% [%do p=@t]
[%exp p=@t q=tank]
[%say p=@t]
==

45
main/sur/radio/core.hook Normal file
View File

@ -0,0 +1,45 @@
::
:::: /hook/core/radio/sur
::
|%
++ audience (map station delivery) :: destination/state
++ atlas (map ship status) :: presence map
++ command :: effect on party
$% [%design (pair span (unit config))] :: configure/destroy
[%publish (list thought)] :: originate
[%review (list thought)] :: deliver
[%ping (map station presence)] :: declare status
== ::
++ config :: party configuration
$: sources=(set station) :: pulls from
cordon=(each (set ship) (set ship)) :: white/blacklist
== ::
++ cousin (pair ship span) :: domestic flow
++ delivery ?(%pending %received %rejected %released) :: delivery state
++ human :: human identifier
$: true=(unit (trel ,@t (unit ,@t) ,@t)) :: true name
hand=(unit ,@t) :: handle
== ::
++ partner :: foreign flow
$% [%twitter p=@t] :: twitter
== ::
++ presence ?(%hear %talk) :: status type
++ report :: unified rush/rust
$% [%house (set span)] :: meta-changes
[%grams (pair ,@ud (list telegram))] :: thoughts
[%group (pair atlas (map station atlas))] :: presence
[%config config] :: reconfigure
== ::
++ serial ,@uvH :: unique identity
++ station (each cousin partner) :: interlocutor
++ status (pair presence human) :: participant
++ speech :: party action
$% [%own p=@t] :: @ or /me
[%exp p=@t q=(unit tank)] :: program output
[%say p=@t] :: normal line
[%inv p=ship q=span] :: invite to
== ::
++ statement (pair ,@da speech) :: when this
++ telegram (pair ship thought) :: who which whom what
++ thought (trel serial audience statement) :: which whom what
--

79
main/sur/rodeo/core.hook Normal file
View File

@ -0,0 +1,79 @@
::
:::: /hook/core/rodeo/sur
!:
|%
++ ache |*([a=$+(* *) b=$+(* *)] $%([| p=b] [& p=a])) :: PM 314
++ audience (map partner (pair envelope delivery)) :: destination/state
++ atlas (map ship status) :: presence map
++ bouquet (set flavor) :: complete aroma
++ command :: effect on party
$% [%design (pair span (unit config))] :: configure/destroy
[%publish (list thought)] :: originate
[%review (list thought)] :: deliver
== ::
++ config :: party configuration
$: sources=(set partner) :: pulls from
caption=cord :: about
cordon=control :: restricted to
== ::
++ control (pair posture (set ship)) :: access control
++ delivery :: delivery state
$? %pending :: undelivered
%received :: delivered
%rejected :: undeliverable
%released :: sent one-way
%accepted :: fully processed
== ::
++ envelope (pair ,? (unit partner)) :: visible, sender
++ flavor path :: content flavor
++ human :: human identifier
$: true=(unit (trel ,@t (unit ,@t) ,@t)) :: true name
hand=(unit ,@t) :: handle
== ::
++ passport :: foreign flow
$% [%twitter p=@t] :: twitter
== ::
++ posture :: security posture
$? %black :: public
%white :: private
%green :: readonly
%brown :: writeonly
== ::
++ presence ?(%gone %hear %talk) :: status type
++ register (pair atlas (map partner atlas)) :: ping me, ping srcs
++ report :: radio update
$% [%config config] :: reconfigure
:: [%folder (list report)] :: multiple
[%grams (pair ,@ud (list telegram))] :: beginning, thoughts
[%group register] :: presence
[%house (map span (pair posture cord))] :: station set
== ::
++ speech :: narrative action
:: XX unify %own and %say to %lin
::
$% [%lan p=span q=@t] :: local announce
[%exp p=@t] :: hoon line
[%non ~] :: no content (yo)
[%ext p=@tas q=*] :: extended action
[%fat p=torso q=speech] :: attachment
:: [%inv p=station] :: invite to station
[%ire p=serial q=speech] :: in-reply-to
[%lin p=? q=@t] :: no=@, text line
[%mor p=(list speech)] :: XX deleteme
== ::
++ serial ,@uvH :: unique identity
++ partner (each station passport) :: interlocutor
++ status (pair presence human) :: participant
++ statement (trel ,@da bouquet speech) :: when this
++ station (pair ship span) :: domestic flow
++ telegram (pair ship thought) :: who which whom what
++ thought (trel serial audience statement) :: which whom what
++ torso :: attachment
$% [%name (pair ,@t torso)] :: named attachment
[%text (list ,@t)] :: text lines
[%tank (list tank)] :: tank list
== ::
:: markdown
:: image
:: mime object
--

View File

@ -1 +1,7 @@
,[pax=path jof=$%([%line p=span] [%res p=span] [%cmd p=char])]
$: pax=path ::
$= jof ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::
== == ::

View File

@ -1 +1,4 @@
,[p=[p=cord q=prom r=cord] q=(list cord) r=(list ?(tank [%stem p=tank q=tank]))]
$: p=[p=cord q=prom r=cord]
q=(list cord)
r=(list ?(tank [%stem p=@da q=tank r=tank]))
==

View File

@ -0,0 +1,16 @@
|%
++ twit-do => twit ,[p=span q=command] :: user and action
++ twit-stat ,[id=@u who=@ta now=@da txt=@t] :: recieved tweet
++ twit
|%
++ keys :: twitter-key type
$: con=[tok=@t sec=@t] :: user key pair
acc=[tok=@t sec=@t] :: app key pair
==
::
++ command :: poke action
$% [%auth p=keys] :: set API keys
[%post p=@uvI q=cord] :: post a tweet
==
--
--

View File

@ -1,3 +1,3 @@
/=main=/try/
/=try=/
This is the try desk. Feel free to try out whatever you want here.
This is the try desk. Feel free to try out whatever you want here.