From 2140ad4bbee0f3d8c7999a03864e1014e7697878 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 23 Feb 2016 18:28:52 -0500 Subject: [PATCH 01/14] finish 151izing dojo --- app/dojo.hoon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index b033053e1..59d0ba31e 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -221,7 +221,7 @@ (sear plex:vez (stag %conl poor:vez)) :: ++ dp-iden-url - (cook |=([a=(unit iden) b=purl] [(fall a *iden) b]) auru:epur) + (cook |=({a/(unit iden) b/purl} [(fall a *iden) b]) auru:epur) :: ++ dp-model ;~(plug dp-server dp-config) :: ++dojo-model ++ dp-path (tope he-beam) :: ++path @@ -509,8 +509,8 @@ :- "HTTP {}" %+ weld (turn q.hit |=({a/@t b/@t} "{(trip a)}: {(trip b)}")) - :- "" - (turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip) + :- i="" + t=(turn `wain`?~(r.hit ~ (lore q.u.r.hit)) trip) == :: ++ dy-show-span-noun From 31dbd75f423e854eb178c7636e23ee325fccaaa3 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 23 Feb 2016 20:15:36 -0500 Subject: [PATCH 02/14] eyre changes for lens --- app/dojo.hoon | 7 +++++++ arvo/eyre.hoon | 29 ++++++++++++++++++++++------- arvo/zuse.hoon | 6 +++--- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index 6a73fc30f..f8740d9a8 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -995,6 +995,13 @@ ++ poke-sole-action |= act/sole-action ~| poke+act %. act (wrap he-span):arm +:: +++ poke-json + |= jon/json + ^- {(list move) _+>.$} + ~& jon=jon + [~ +>.$] +:: ++ made (wrap he-made):arm ++ sigh-httr (wrap he-sigh):arm ++ sigh-tang |=({a/wire b/tang} ~|(`term`(cat 3 'sigh-' -.a) (mean b))) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index f7e8c45bf..53754568f 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -20,7 +20,7 @@ == == :: $: $e :: to self $% {$thud $~} :: proxied death - {$this p/? q/clip r/httq} :: proxied request + {$this p/? q/? r/clip s/httq} :: proxied request {$meta vase:{$them (unit httr)}} :: type check == == :: $: $f :: to %ford @@ -133,6 +133,7 @@ {$bugs p/?($as $to) $~} {$beam p/beam} {$deps p/?($put $delt) q/@uvH} + {$lens p/json} {$mess p/dock q/mark r/wire s/json} {$poll p/{i/@uvH t/(list @uvH)}} {$spur p/spur} @@ -600,8 +601,8 @@ :: $this :: inbound request %- emule |. ^+ ..apex - =* sec p.kyz :: ? :: https bit - =* heq r.kyz :: httq :: request content + =* sec q.kyz :: ? :: https bit + =* heq s.kyz :: httq :: request content =+ ryp=`quri`(rash q.heq zest:epur) =+ maf=(eat-headers r.heq) =+ ^= pul ^- purl @@ -614,7 +615,7 @@ =. p.p.pul |(p.p.pul ?=(hoke r.p.pul)) =+ her=(host-to-ship r.p.pul) ?: |(?=($~ her) =(our u.her)) - (handle pul [q.+.kyz |] [p.heq maf s.heq]) + (handle pul [p.+.kyz r.+.kyz |] [p.heq maf s.heq]) =+ han=(sham hen) =. pox (~(put by pox) han hen) (ames-gram u.her [%get ~] han +.kyz) @@ -971,7 +972,7 @@ :: ++ handle |= $: {hat/hart pok/pork quy/quay} :: purl parsed url - {cip/clip aut/?} :: client ip nonymous? + {lop/? cip/clip aut/?} :: client ip nonymous? {mef/meth maf/math bod/(unit octs)} :: method+headers+body == =< apex @@ -1052,7 +1053,9 @@ :: ++ parse ^- (each perk httr) - |^ =+ hit=as-magic-filename + |^ =+ pol=as-loopback + ?^ pol [%& u.pol] + =+ hit=as-magic-filename ?^ hit [%| u.hit] ?: is-spur [%& %spur (flop q.pok)] @@ -1064,6 +1067,11 @@ ?^ hem [%& u.hem] ~|(strange-path+q.pok !!) :: + ++ as-loopback + ^- (unit perk) + ?. lop ~ + `lens+(need grab-json) + :: ++ as-magic-filename ^- (unit httr) ?+ [(fall p.pok %$) q.pok] ~ @@ -1252,10 +1260,17 @@ $put (new-deps q.hem %| ire) $delt (del-deps q.hem %| ire) == + :: + $lens + $(hem [%mess [our %dojo] %json /lens p.hem]) + :: :- %| + :: =^ orx ..ya ?:(is-anon new-view:for-client [(need grab-oryx) ..ya]) + :: =+ vew=(ire-ix (oryx-to-ixor orx)) + :: ((teba new-mess.vew) [our %dojo] /lens %json %json !>(`json`p.hem)) :: $mess :- %| - =^ orx ..ya ?:(is-anon new-view:for-client [(need grab-oryx) ..ya]) + =^ orx ..ya new-view:for-client =+ vew=(ire-ix (oryx-to-ixor orx)) ((teba new-mess.vew) p.hem r.hem q.hem %json !>(`json`s.hem)) :: diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 4e018177b..60ec7d6b5 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2177,9 +2177,9 @@ $? {{$lon $~} p/hole} :: login request {{$aut $~} p/hole} :: login reply {{$hat $~} p/hole q/hart} :: login redirect - {{$get $~} p/@uvH q/{? clip httq}} :: remote request + {{$get $~} p/@uvH q/{? ? clip httq}} :: remote request {{$got $~} p/@uvH q/httr} :: remote response - {{$gib $~} p/@uvH} :: remote cancel + {{$gib $~} p/@uvH} :: remote cancel == :: :::: :: ++ kiss-eyre :: in request ->$ @@ -2190,7 +2190,7 @@ {$serv p/$@(desk beam)} :: set serving root {$them p/(unit hiss)} :: outbound request {$they p/@ud q/httr} :: inbound response - {$this p/? q/clip r/httq} :: inbound request + {$this p/? q/? r/clip s/httq} :: inbound request {$thud $~} :: inbound cancel {$wegh $~} :: report memory {$west p/sack q/fuz:gram} :: network request From c0c67969f3748050768486f4be1983ca0cba0a7e Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 26 Feb 2016 20:13:00 -0500 Subject: [PATCH 03/14] checkpoint, w/lens protocl --- app/dojo.hoon | 8 +++++++- arvo/eyre.hoon | 3 +-- arvo/ford.hoon | 2 +- mar/lens/command.hoon | 46 +++++++++++++++++++++++++++++++++++++++++++ sur/lens.hoon | 32 ++++++++++++++++++++++++++++++ 5 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 mar/lens/command.hoon create mode 100644 sur/lens.hoon diff --git a/app/dojo.hoon b/app/dojo.hoon index c9af7f0b0..d2a7cc40a 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -2,7 +2,7 @@ :::: /hoon/dojo/app :: :::: :: :: :: /? 314 :: arvo kelvin -/- sole :: console structures +/- sole, lens :: console structures /+ sole :: console library [. sole] :: :: :: @@ -1000,6 +1000,12 @@ |= act/sole-action ~| poke+act %. act (wrap he-span):arm :: +++ poke-lens-command + |= com/command:lens + ^- {(list move) _+>.$} + ~& com=`*`com + [~ +>.$] +:: ++ poke-json |= jon/json ^- {(list move) _+>.$} diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 53754568f..5e972b860 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -1262,7 +1262,7 @@ == :: $lens - $(hem [%mess [our %dojo] %json /lens p.hem]) + $(hem [%mess [our %dojo] %lens-command /lens p.hem]) :: :- %| :: =^ orx ..ya ?:(is-anon new-view:for-client [(need grab-oryx) ..ya]) :: =+ vew=(ire-ix (oryx-to-ixor orx)) @@ -1902,4 +1902,3 @@ q.hin [mos ..^$] -- - diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 77f2e455d..325c5492b 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -1674,7 +1674,7 @@ =- (flaw cof leaf+"{} data with bad diff" -) [>type=p.q.coy< >want=p:!>(*(urge cord))< ~] =+ pac=(role (lurk (lore u.txt) u.dif)) - (fine cof `gage`[%& p.cay [%atom %t ~] (end 3 (dec (met 3 pac)) pac)]) + (fine cof `gage`[%& p.cay [%atom %t ~] pac]) :: %+ cope (fang cof p.cay) |= {cof/cafe pro/vase} diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon new file mode 100644 index 000000000..42a80754b --- /dev/null +++ b/mar/lens/command.hoon @@ -0,0 +1,46 @@ +/- lens +!: +|_ com/command:lens +++ grab + |% + ++ noun command:lens + ++ json + |= jon/^json + ^- command:lens + %- need + %. jon + => [. jo] + =< %- ot :~ + flags+(ot merge-input+bo fan-output+bo ~) + sources+(ar source) + transformers+(ar transformer) + sinks+(ar sink) + == + |% + ++ source + ^- $-(^json (unit source:lens)) + %- of :~ + data+so:jo + dojo+so:jo + clay+(su (easy /sentinel/path)) :: XX parse-to-pah + url+(su auri:urlp) + api+(su ;~(plug sym ;~(pfix col prn))) + get-api+(su ;~(plug sym ;~(pfix col auri:urlp))) + listen-api+(su ;~(plug sym ;~(pfix col sym))) + == + ++ transformer (of as+so hoon+so ~):jo + ++ sink + ^- $-(^json (unit sink:lens)) + %- of :~ + stdout+|=(^json (some ~)) + output-file+so:jo + output-clay+(su (easy /sentinel/path)) + url+(su auri:urlp) + to-api+(su ;~(plug sym ;~(pfix col prn))) + send-api+(su ;~(plug sym ;~(pfix col auri:urlp))) + command+so:jo + app+(su sym) + == + -- + -- +-- diff --git a/sur/lens.hoon b/sur/lens.hoon new file mode 100644 index 000000000..796dd01f2 --- /dev/null +++ b/sur/lens.hoon @@ -0,0 +1,32 @@ +|% +++ command + $: flags/{merge-input/? fan-output/?} + sources/(list source) + transformers/(list transformer) + sinks/(list sink) + == +++ source + $% {$data data/@} + {$dojo command/@t} + {$clay pax/path} + {$url url/purl} + {$api api/term command/@t} + {$get-api api/term endpoint/purl} + {$listen-api api/term event/term} + == +++ transformer + $% {$as mar/mark} + {$hoon code/@t} + == +++ sink + $% {$stdout $~} + {$output-file pax/@t} + + {$output-clay pax/path} + {$url url/purl} + {$to-api api/term command/@t} + {$send-api api/term endpoint/purl} + {$command command/@t} + {$app app/term} + == +-- From e983d7c1e30be5750f81c73c3b0fb04e4673ded8 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 3 Mar 2016 17:23:09 -0500 Subject: [PATCH 04/14] better eyre lens handling --- app/dojo.hoon | 11 +++--- arvo/eyre.hoon | 90 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 78 insertions(+), 23 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index d2a7cc40a..74819bdca 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -950,6 +950,11 @@ $clr he-pine(buf "") == :: + ++ he-lens + |= com/command:lens + ^+ +> + (he-plan [%show %0] [0 %ur '' (rash 'http://example.com' auri:epur)]) + :: ++ he-lame :: handle error |= {wut/term why/tang} ^+ +> @@ -1001,10 +1006,8 @@ (wrap he-span):arm :: ++ poke-lens-command - |= com/command:lens - ^- {(list move) _+>.$} - ~& com=`*`com - [~ +>.$] + |= com/command:lens ~| poke-lens+com %. com + (wrap he-lens):arm :: ++ poke-json |= jon/json diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 5e972b860..c99ee2a2f 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -63,7 +63,7 @@ {$ow p/ixor $~} :: dying view {$on $~} :: dependency == :: -++ whir-of {p/knot:ship q/term r/wire} :: path in dock +++ whir-of {p/knot:ship q/term r/?($mess $lens) s/wire} :: path in dock ++ whir-se ?($core vi-arm) :: build/call ++ vi-arm $? $out :: ++out mod request @@ -71,6 +71,22 @@ $bak :: ++bak auth response $in :: ++in handle code == :: +++ sole-effect :: app to sole + $% {$bel $~} :: beep + {$blk p/@ud q/@c} :: blink+match char at + {$clr $~} :: clear screen + {$det *} :: sole-change :: edit command + {$err p/@ud} :: error point + {$mor p/(list sole-effect)} :: multiple effects + {$nex $~} :: save clear command + {$pro *} :: sole-prompt :: set prompt + {$sag p/path q/*} :: save to jamfile + {$sav p/path q/@} :: save to file + {$tan p/(list tank)} :: classic tank + :: {$taq p/tanq} :: modern tank + {$txt p/tape} :: text line + {$url p/@t} :: activate url + == :: -- :: |% :: models ++ bolo :: eyre state @@ -178,7 +194,7 @@ ?~ quy [%$ %n ~]~ [[%$ %t p.i.quy] [%$ %t q.i.quy] $(quy t.quy)] :: -++ gsig |=({a/dock b/path} [(scot %p p.a) q.a b]) +++ gsig |=({a/dock b/?($mess $lens) c/path} [(scot %p p.a) q.a b c]) ++ session-from-cookies |= {nam/@t maf/math} ^- (unit hole) @@ -599,7 +615,7 @@ =. our ?~(hov p.kyz (min u.hov p.kyz)) +>.$(hov [~ our], top [[our %home ud+0] /web]) :: - $this :: inbound request + $this :: inbound request %- emule |. ^+ ..apex =* sec q.kyz :: ? :: https bit =* heq s.kyz :: httq :: request content @@ -745,10 +761,20 @@ =+ cuf=`cuft`+>.sih ?- -.cuf ?($coup $reap) + ?: ?=($lens r.q.tee) + ~& hen=hen^hcuf=-.cuf + ?. ?=($coup -.cuf) + +>.$ + +>.$ + :: abet:(give-json:(ire-ix p.tee) 200 ~ (joba %okey-dokey %b &)) (get-ack:(ire-ix p.tee) q.tee ?~(p.cuf ~ `[-.cuf u.p.cuf])) :: $doff !! $diff + ?: ?=($lens r.q.tee) + ~& [%lens-diffing (sole-effect q.q.p.cuf)] + =+ fec=((hard sole-effect) q.q.p.cuf) + (get-lens:(ire-ix p.tee) q.tee fec) ?. ?=($json p.p.cuf) :: ~> %slog.`%*(. >[%backing p.p.cuf %q-p-cuf]< &3.+> (sell q.p.cuf)) (back tee %json p.cuf) @@ -886,7 +912,9 @@ :: ++ back :: %ford bounce |= {tea/whir mar/mark cay/cage} - (pass-note tea (ford-req -.top [%dude |.(>[hen tea mar -.cay]<) [%cast mar $+cay]])) + %+ pass-note tea + %+ ford-req -.top + [%dude |.(>[%eyre-back hen tea mar -.cay]<) [%cast mar $+cay]] :: ++ cast-thou |= {mar/mark cay/cage} @@ -972,7 +1000,7 @@ :: ++ handle |= $: {hat/hart pok/pork quy/quay} :: purl parsed url - {lop/? cip/clip aut/?} :: client ip nonymous? + {lop/? cip/clip aut/?} :: client ip nonymous? {mef/meth maf/math bod/(unit octs)} :: method+headers+body == =< apex @@ -1262,15 +1290,15 @@ == :: $lens - $(hem [%mess [our %dojo] %lens-command /lens p.hem]) - :: :- %| - :: =^ orx ..ya ?:(is-anon new-view:for-client [(need grab-oryx) ..ya]) - :: =+ vew=(ire-ix (oryx-to-ixor orx)) - :: ((teba new-mess.vew) [our %dojo] /lens %json %json !>(`json`p.hem)) + :: $(hem [%mess [our %dojo] %lens-command /lens p.hem]) + :- %| + =^ orx ..ya new-view:for-client + =+ vew=(ire-ix (oryx-to-ixor orx)) + ((teba new-lens.vew) p.hem) :: $mess :- %| - =^ orx ..ya new-view:for-client + =^ orx ..ya ?:(is-anon new-view:for-client [(need grab-oryx) ..ya]) =+ vew=(ire-ix (oryx-to-ixor orx)) ((teba new-mess.vew) p.hem r.hem q.hem %json !>(`json`s.hem)) :: @@ -1521,7 +1549,7 @@ ++ give-json (teba ^give-json) ++ pass-note (teba ^pass-note) ++ hurl-note - |= {a/{dock path} b/note} ^+ ..ix + |= {a/{dock ?($mess $lens) path} b/note} ^+ ..ix =: med (~(put to med) hen) hen `~ == @@ -1541,33 +1569,57 @@ |= a/even ^+ eve [+(p.eve) (~(put by q.eve) p.eve a)] :: + ++ new-lens + |= jon/json ^+ ..ix + =. +>.$ + %+ pass-note + [%of ire (gsig [our %dojo] lens+/)] + [%g %deal [him our] %dojo %peer /sole] :: XX maybe peel json? + =. +>.$ + %+ pass-note + [%of ire (gsig [our %dojo] lens+/)] + [%g %deal [him our] %dojo %punk %lens-command %json !>(`json`jon)] + abet + :: ++ new-mess |= {a/dock b/wire c/mark d/cage} ^+ ..ix - (hurl-note [a b] [%g %deal [him -.a] +.a %punk c d]) + (hurl-note [a mess+b] [%g %deal [him -.a] +.a %punk c d]) :: ++ add-subs |= {a/dock $json b/wire c/path} ^+ ..ix ?: (~(has in sus) +<) ~|(duplicate+c !!) =. sus (~(put in sus) +<) - (hurl-note [a b] [%g %deal [him -.a] +.a %peel %json c]) + (hurl-note [a mess+b] [%g %deal [him -.a] +.a %peel %json c]) :: ++ pul-subs |= {a/dock $json b/wire c/path} ^+ ..ix =. sus (~(del in sus) +<) - (hurl-note [a b] [%g %deal [him -.a] +.a %pull ~]) + (hurl-note [a mess+b] [%g %deal [him -.a] +.a %pull ~]) :: ++ del-subs :: XX per path? |= {a/dock $json b/wire c/path} ^+ ..ix =. ..ix (pul-subs +<) (nice-json:pop-duct:(ire-ix ire)) :: XX gall ack :: + ++ get-lens + |= {a/whir-of fec/sole-effect} ^+ ..ix + ?. ?=($tan -.fec) + ..ix + =+ txt=(role (turn (flop p.fec) |=(a/tank (crip ~(ram re a))))) + =+ jon=`json`a+[s+txt]~ + =. +>.$ + %+ pass-note + `whir`[%of ire (gsig [our %dojo] lens+/)] + `note`[%g %deal [him our] %dojo %pull ~] + abet:(give-json 200 ~ jon) + :: ++ get-rush |= {a/whir-of b/json} ^+ ..ix - (get-even [%rush [[(slav %p p.a) q.a] r.a] (joba %json b)]) + (get-even [%rush [[(slav %p p.a) q.a] s.a] (joba %json b)]) :: ++ get-quit |= a/whir-of ^+ ..ix - (get-even [%quit [[(slav %p p.a) q.a] r.a]]) + (get-even [%quit [[(slav %p p.a) q.a] s.a]]) :: ++ get-ack |= {a/whir-of b/(unit {term tang})} ^+ ..ix @@ -1587,7 +1639,7 @@ ++ give-even |= {pol/? num/@u ven/even} ^+ done =: q.eve (~(del by q.eve) (dec num)) :: TODO ponder a-2 - mow ?.(?=($rush -.ven) mow mow:(pass-took p.ven)) + mow ?.(?=($rush -.ven) mow mow:(pass-took [- %mess +]:p.ven)) == ?> pol :: XX eventstream %^ give-json 200 ~ @@ -1604,7 +1656,7 @@ (pass-note of+/[ire] [%b %rest era]) :: ++ pass-took - |= a/{p/dock wire} + |= a/{p/dock ?($mess $lens) wire} %+ pass-note(hen `~) [%of ire (gsig a)] [%g %deal [him -.p.a] +.p.a %pump ~] From a8910dea9622a3a1cfb72f6680551af9d484238b Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 7 Mar 2016 17:06:17 -0500 Subject: [PATCH 05/14] waypoint --- app/dojo.hoon | 51 +++++++++++++++++++++++++++++++++++++++++-- arvo/eyre.hoon | 35 +++++++++++++++++++++-------- mar/lens/command.hoon | 9 ++++++-- sur/lens.hoon | 5 ++--- 4 files changed, 84 insertions(+), 16 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index 74819bdca..9374be4b2 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -87,7 +87,7 @@ ++ card :: general card $% {$diff $sole-effect sole-effect} :: {$send wire {ship term} clap} :: - {$hiss wire {$~ iden} mark {$hiss hiss}} :: + {$hiss wire {$~ iden} mark {$hiss hiss}} :: {$exec wire @p (unit {beak silk})} :: {$deal wire sock term club} :: {$info wire @p toro} :: @@ -953,7 +953,54 @@ ++ he-lens |= com/command:lens ^+ +> - (he-plan [%show %0] [0 %ur '' (rash 'http://example.com' auri:epur)]) + :: (he-plan [%show %0] [0 %ur '' (rash 'http://example.com' auri:epur)]) + ?. ?=(^ sources.com) + ~|(%no-source !!) + ?. ?=(^ sinks.com) + ~|(%no-sink !!) + =+ ^- source/dojo-build + ?- -.i.sources.com + $data [%ex %sand %t data.i.sources.com] + $dojo (rash command.i.sources.com dp-build:dp) + $clay + :- %ex + :* %wish + [%base %noun] + :+ %cons + [%rock %tas %cx] + %+ rash pax.i.sources.com + rood:(vang | /(scot %p our.hid)/home/(scot %da now.hid)) + == + :: + $url [%ur '' url.i.sources.com] + $api !! + $get-api + :* %ex + %wish + [%wing ~[%json]] + :* %conl + [%rock %tas %gx] + [%sand %ta (scot %p our.hid)] + [%sand %tas api.i.sources.com] + [%sand %ta (scot %da now.hid)] + (turn endpoint.i.sources.com |=(a/@t [%sand %ta a])) + == + == + :: + $listen-api !! + == + =+ ^- sink/dojo-sink + ?- -.i.sinks.com + $stdout [%show %0] + $output-file [%show %0] + $output-clay [%file (need (tome pax.i.sinks.com))] + $url [%http %post '' url.i.sinks.com] + $to-api !! + $send-api !! + $command (rash command.i.sinks.com dp-sink:dp) + $app [%poke our.hid app.i.sinks.com] + == + (he-plan sink [0 source]) :: ++ he-lame :: handle error |= {wut/term why/tang} diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index c99ee2a2f..ab3250995 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -763,6 +763,9 @@ ?($coup $reap) ?: ?=($lens r.q.tee) ~& hen=hen^hcuf=-.cuf + ?: ?=(^ p.cuf) + %- (slog >%eyre-unto-error< >-.cuf< u.p.cuf) + +>.$ ?. ?=($coup -.cuf) +>.$ +>.$ @@ -1603,15 +1606,29 @@ :: ++ get-lens |= {a/whir-of fec/sole-effect} ^+ ..ix - ?. ?=($tan -.fec) - ..ix - =+ txt=(role (turn (flop p.fec) |=(a/tank (crip ~(ram re a))))) - =+ jon=`json`a+[s+txt]~ - =. +>.$ - %+ pass-note - `whir`[%of ire (gsig [our %dojo] lens+/)] - `note`[%g %deal [him our] %dojo %pull ~] - abet:(give-json 200 ~ jon) + ?+ -.fec ..ix + $tan + =+ txt=(role (turn (flop p.fec) |=(a/tank (crip ~(ram re a))))) + =+ jon=`json`a+[s+txt]~ + =. +>.$ + %+ pass-note + `whir`[%of ire (gsig [our %dojo] lens+/)] + `note`[%g %deal [him our] %dojo %pull ~] + abet:(give-json 200 ~ jon) + :: + $txt + =+ jon=`json`a+[s+(crip p.fec)]~ + =. +>.$ + %+ pass-note + `whir`[%of ire (gsig [our %dojo] lens+/)] + `note`[%g %deal [him our] %dojo %pull ~] + abet:(give-json 200 ~ jon) + :: + $mor + |- ^+ ..ix + ?~ p.fec ..ix + $(p.fec t.p.fec, ..ix ^$(fec i.p.fec)) + == :: ++ get-rush |= {a/whir-of b/json} ^+ ..ix diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon index 42a80754b..3c77a7d2e 100644 --- a/mar/lens/command.hoon +++ b/mar/lens/command.hoon @@ -22,10 +22,15 @@ %- of :~ data+so:jo dojo+so:jo - clay+(su (easy /sentinel/path)) :: XX parse-to-pah + clay+so:jo url+(su auri:urlp) api+(su ;~(plug sym ;~(pfix col prn))) - get-api+(su ;~(plug sym ;~(pfix col auri:urlp))) + :- %get-api + %- su + ;~ plug + sym + ;~(pfix col (more fas (cook crip (star ;~(less fas prn))))) + == listen-api+(su ;~(plug sym ;~(pfix col sym))) == ++ transformer (of as+so hoon+so ~):jo diff --git a/sur/lens.hoon b/sur/lens.hoon index 796dd01f2..60a51a0db 100644 --- a/sur/lens.hoon +++ b/sur/lens.hoon @@ -8,10 +8,10 @@ ++ source $% {$data data/@} {$dojo command/@t} - {$clay pax/path} + {$clay pax/@t} {$url url/purl} {$api api/term command/@t} - {$get-api api/term endpoint/purl} + {$get-api api/term endpoint/(list @t)} {$listen-api api/term event/term} == ++ transformer @@ -21,7 +21,6 @@ ++ sink $% {$stdout $~} {$output-file pax/@t} - {$output-clay pax/path} {$url url/purl} {$to-api api/term command/@t} From 3454ca9c725501f657e5319757568f88ec9b8f60 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Tue, 8 Mar 2016 20:19:28 -0500 Subject: [PATCH 06/14] dojo.hoon has most all functionality --- app/dojo.hoon | 72 ++++++++++++++++++++++++++++++------------- app/gh.hoon | 5 +-- arvo/eyre.hoon | 11 ++++--- mar/gh/poke.hoon | 4 +-- mar/lens/command.hoon | 19 ++++++++---- sur/lens.hoon | 15 ++++----- 6 files changed, 82 insertions(+), 44 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index 9374be4b2..f6848b5f0 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -32,7 +32,7 @@ {$pill p/path} :: noun to unix pill :: {$tree p/path} :: noun to unix tree {$file p/beam} :: save to clay - {$http p/?($post $put) q/iden r/purl} :: http outbound + {$http p/?($post $put) q/iden r/purl} :: http outbound {$poke p/goal} :: poke app {$show p/?($0 $1 $2 $3)} :: print val+span+twig {$verb p/term} :: store variable @@ -953,26 +953,36 @@ ++ he-lens |= com/command:lens ^+ +> - :: (he-plan [%show %0] [0 %ur '' (rash 'http://example.com' auri:epur)]) - ?. ?=(^ sources.com) - ~|(%no-source !!) - ?. ?=(^ sinks.com) - ~|(%no-sink !!) - =+ ^- source/dojo-build - ?- -.i.sources.com - $data [%ex %sand %t data.i.sources.com] - $dojo (rash command.i.sources.com dp-build:dp) + =+ ^- source/dojo-source + =| num/@ + =- ?. ?=($send-api -.sink.com) :: XX num is incorrect + sor + :- 0 + :+ %as `mark`(cat 3 api.sink.com '-poke') + :- 1 + :+ %do + :+ %gill [%base %noun] + :^ %cont [%rock %tas %post] + [%rock %$ endpoint.sink.com] + [%make ~[[%.y 6]] ~] + sor + ^= sor + |- ^- dojo-source + :- num + ?- -.source.com + $data [%ex %sand %t data.source.com] + $dojo (rash command.source.com dp-build:dp) $clay :- %ex :* %wish [%base %noun] :+ %cons [%rock %tas %cx] - %+ rash pax.i.sources.com + %+ rash pax.source.com rood:(vang | /(scot %p our.hid)/home/(scot %da now.hid)) == :: - $url [%ur '' url.i.sources.com] + $url [%ur '' url.source.com] $api !! $get-api :* %ex @@ -981,26 +991,46 @@ :* %conl [%rock %tas %gx] [%sand %ta (scot %p our.hid)] - [%sand %tas api.i.sources.com] + [%sand %tas api.source.com] [%sand %ta (scot %da now.hid)] - (turn endpoint.i.sources.com |=(a/@t [%sand %ta a])) + (turn endpoint.source.com |=(a/@t [%sand %ta a])) == == :: $listen-api !! + $as + :* %as mar.source.com + $(num +(num), source.com next.source.com) + == + :: + $hoon + :* %do + %+ rash code.source.com + tall:(vang | /(scot %p our.hid)/home/(scot %da now.hid)) + $(num +(num), source.com next.source.com) + == + :: + $tuple + :- %tu + |- ^- (list dojo-source) + ?~ next.source.com + ~ + =. num +(num) + :- ^$(source.com i.next.source.com) + $(next.source.com t.next.source.com) == =+ ^- sink/dojo-sink - ?- -.i.sinks.com + ?- -.sink.com $stdout [%show %0] $output-file [%show %0] - $output-clay [%file (need (tome pax.i.sinks.com))] - $url [%http %post '' url.i.sinks.com] + $output-clay [%file (need (tome pax.sink.com))] + $url [%http %post '' url.sink.com] $to-api !! - $send-api !! - $command (rash command.i.sinks.com dp-sink:dp) - $app [%poke our.hid app.i.sinks.com] + $send-api [%poke our.hid api.sink.com] + $command (rash command.sink.com dp-sink:dp) + $app [%poke our.hid app.sink.com] == - (he-plan sink [0 source]) + (he-plan sink source) :: ++ he-lame :: handle error |= {wut/term why/tang} diff --git a/app/gh.hoon b/app/gh.hoon index 197cce3a6..b31e5dd51 100644 --- a/app/gh.hoon +++ b/app/gh.hoon @@ -173,11 +173,12 @@ :: into poke semantics. :: ++ poke-gh-poke - |= {method/meth endpoint/path jon/json} + |= {method/meth endpoint/(list @t) jon/json} ^- {(list move) _+>.$} :_ +>.$ :_ ~ :* ost.hid %hiss /poke/[method] `~ %httr %hiss - (scan "https://api.github.com{<`path`endpoint>}" auri:epur) + ~| stuff="https://api.github.com{<(path endpoint)>}" + (scan "https://api.github.com{<(path endpoint)>}" auri:epur) method ~ `(taco (crip (pojo jon))) == :: diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index ab3250995..d75373f96 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -764,8 +764,11 @@ ?: ?=($lens r.q.tee) ~& hen=hen^hcuf=-.cuf ?: ?=(^ p.cuf) - %- (slog >%eyre-unto-error< >-.cuf< u.p.cuf) - +>.$ + =+ tag=`tang`[>%eyre-unto-error< >-.cuf< u.p.cuf] + %- (slog tag) + =+ txt=(role (turn (flop tag) |=(a/tank (crip ~(ram re a))))) + =+ jon=`json`s+txt + (give-json 200 ~ jon) ?. ?=($coup -.cuf) +>.$ +>.$ @@ -1609,7 +1612,7 @@ ?+ -.fec ..ix $tan =+ txt=(role (turn (flop p.fec) |=(a/tank (crip ~(ram re a))))) - =+ jon=`json`a+[s+txt]~ + =+ jon=`json`s+txt =. +>.$ %+ pass-note `whir`[%of ire (gsig [our %dojo] lens+/)] @@ -1617,7 +1620,7 @@ abet:(give-json 200 ~ jon) :: $txt - =+ jon=`json`a+[s+(crip p.fec)]~ + =+ jon=`json`s+(crip p.fec) =. +>.$ %+ pass-note `whir`[%of ire (gsig [our %dojo] lens+/)] diff --git a/mar/gh/poke.hoon b/mar/gh/poke.hoon index e1b5725cd..32f404678 100644 --- a/mar/gh/poke.hoon +++ b/mar/gh/poke.hoon @@ -1,6 +1,6 @@ -|_ {method/meth endpoint/path jon/json} +|_ {method/meth endpoint/(list @t) jon/json} ++ grab |% - ++ noun {method/meth endpoint/path jon/json} + ++ noun {method/meth endpoint/(list @t) jon/json} -- -- diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon index 3c77a7d2e..34e29d1fb 100644 --- a/mar/lens/command.hoon +++ b/mar/lens/command.hoon @@ -11,14 +11,14 @@ %. jon => [. jo] =< %- ot :~ - flags+(ot merge-input+bo fan-output+bo ~) - sources+(ar source) - transformers+(ar transformer) - sinks+(ar sink) + source+source + sink+sink == |% ++ source ^- $-(^json (unit source:lens)) + |= jon/^json + %. jon %- of :~ data+so:jo dojo+so:jo @@ -32,8 +32,10 @@ ;~(pfix col (more fas (cook crip (star ;~(less fas prn))))) == listen-api+(su ;~(plug sym ;~(pfix col sym))) + as+(ot mark+(su sym) next+source ~) + hoon+(ot code+so:jo next+source ~) + tuple+(ar source) == - ++ transformer (of as+so hoon+so ~):jo ++ sink ^- $-(^json (unit sink:lens)) %- of :~ @@ -42,7 +44,12 @@ output-clay+(su (easy /sentinel/path)) url+(su auri:urlp) to-api+(su ;~(plug sym ;~(pfix col prn))) - send-api+(su ;~(plug sym ;~(pfix col auri:urlp))) + :- %send-api + %- su + ;~ plug + sym + ;~(pfix col (more fas (cook crip (star ;~(less fas prn))))) + == command+so:jo app+(su sym) == diff --git a/sur/lens.hoon b/sur/lens.hoon index 60a51a0db..44071bce2 100644 --- a/sur/lens.hoon +++ b/sur/lens.hoon @@ -1,9 +1,7 @@ |% ++ command - $: flags/{merge-input/? fan-output/?} - sources/(list source) - transformers/(list transformer) - sinks/(list sink) + $: source/source + sink/sink == ++ source $% {$data data/@} @@ -12,19 +10,18 @@ {$url url/purl} {$api api/term command/@t} {$get-api api/term endpoint/(list @t)} + {$as mar/mark next/source} :: can't be at the + {$hoon code/@t next/source} :: end since they + {$tuple next/(list source)} :: don't bunt well {$listen-api api/term event/term} == -++ transformer - $% {$as mar/mark} - {$hoon code/@t} - == ++ sink $% {$stdout $~} {$output-file pax/@t} {$output-clay pax/path} {$url url/purl} {$to-api api/term command/@t} - {$send-api api/term endpoint/purl} + {$send-api api/term endpoint/(list @t)} {$command command/@t} {$app app/term} == From 4144a1a8c87709ae9f82305590cabb9145169261 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 11 Mar 2016 19:37:11 -0500 Subject: [PATCH 07/14] %lens-command fix --- mar/lens/command.hoon | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mar/lens/command.hoon b/mar/lens/command.hoon index 34e29d1fb..a6e47b639 100644 --- a/mar/lens/command.hoon +++ b/mar/lens/command.hoon @@ -18,6 +18,9 @@ ++ source ^- $-(^json (unit source:lens)) |= jon/^json + =+ tuple=%.(jon (ar source)) + ?^ tuple + `[%tuple u.tuple] %. jon %- of :~ data+so:jo @@ -34,7 +37,6 @@ listen-api+(su ;~(plug sym ;~(pfix col sym))) as+(ot mark+(su sym) next+source ~) hoon+(ot code+so:jo next+source ~) - tuple+(ar source) == ++ sink ^- $-(^json (unit sink:lens)) From 841a32a3c12371e85b0ec6dbce8d877b51322eba Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Wed, 16 Mar 2016 15:26:02 -0400 Subject: [PATCH 08/14] improvements to match urb --- app/dojo.hoon | 6 +++--- arvo/eyre.hoon | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index f6848b5f0..4d56cda4f 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -165,7 +165,7 @@ ++ dp-sink ;~ pose ;~(plug (cold %file tar) dp-beam) - ;~(plug (cold %flat pat) (most fas qut)) + ;~(plug (cold %flat pat) (most fas sym)) ;~(plug (cold %pill dot) (most fas sym)) ;~(plug (cold %http lus) (easy %post) dp-iden-url) ;~(plug (cold %http hep) (easy %put) dp-iden-url) @@ -1019,10 +1019,10 @@ :- ^$(source.com i.next.source.com) $(next.source.com t.next.source.com) == - =+ ^- sink/dojo-sink + =+ |- ^- sink/dojo-sink ?- -.sink.com $stdout [%show %0] - $output-file [%show %0] + $output-file $(sink.com [%command (cat 3 '@' pax.sink.com)]) $output-clay [%file (need (tome pax.sink.com))] $url [%http %post '' url.sink.com] $to-api !! diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index d75373f96..808c7638f 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -1626,6 +1626,15 @@ `whir`[%of ire (gsig [our %dojo] lens+/)] `note`[%g %deal [him our] %dojo %pull ~] abet:(give-json 200 ~ jon) + :: + $sav + =+ ^= jon + (jobe file+s+(crip <`path`p.fec>) data+s+(crip (sifo q.fec)) ~) + =. +>.$ + %+ pass-note + `whir`[%of ire (gsig [our %dojo] lens+/)] + `note`[%g %deal [him our] %dojo %pull ~] + abet:(give-json 200 ~ jon) :: $mor |- ^+ ..ix From 3e85a672673aa09bcc1dacf79b86750de9260ce8 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 24 Mar 2016 18:42:39 -0400 Subject: [PATCH 09/14] added :pipe --- app/pipe.hoon | 82 +++++++++++++++++++++++++++++++++++++++ app/talk.hoon | 12 ++++++ arvo/gall.hoon | 18 +++++++++ mar/gh/issue-comment.hoon | 14 ++++++- mar/gh/issues.hoon | 81 +++++++++++++++++++++++++++++++++++++- mar/talk/speeches.hoon | 23 +++++++++++ sur/talk.hoon | 1 + 7 files changed, 229 insertions(+), 2 deletions(-) create mode 100644 app/pipe.hoon create mode 100644 mar/talk/speeches.hoon diff --git a/app/pipe.hoon b/app/pipe.hoon new file mode 100644 index 000000000..dbab65670 --- /dev/null +++ b/app/pipe.hoon @@ -0,0 +1,82 @@ +/+ talk +!: +=> |% + ++ move (pair bone card) + ++ card + $% {$peel wire dock mark path} + {$poke wire dock $talk-command command:talk} + == + -- +:: +|_ {hid/bowl connections/(set {app/term source/path station/knot})} +++ poke-noun + |= arg/* + ^- {(list move) _+>.$} + ?: ?=($list arg) + %- %- slog + %+ turn (~(tap in connections)) + |= {app/term source/path station/knot} + leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" + [~ +>.$] + =+ ((soft {$cancel app/term source/path station/knot}) arg) + ?^ - + ?. (~(has in connections) [app.u source.u station.u]) + %- %- slog :~ + leaf+"no connection:" + leaf+"{(trip app.u)}{<`path`source.u>} ---> {(trip station.u)}" + == + [~ +>.$] + %- %- slog :~ + leaf+"canceling:" + leaf+"{(trip app.u)}{<`path`source.u>} ---> {(trip station.u)}" + == + [~ +>.$(connections (~(del in connections) [app.u source.u station.u]))] + =+ ((hard {app/term source/path station/knot}) arg) + (poke-pipe-arg app source station) +:: +++ poke-pipe-arg + |= {app/term source/path station/knot} + ^- {(list move) _+>.$} + :_ +>.$(connections (~(put in connections) [app source station])) + :_ ~ + ~& [%peeling app source station] + :* ost.hid %peel [%subscribe app station source] + [our.hid app] %talk-speeches source + == +:: +++ diff-talk-speeches + |= {way/wire speeches/(list speech:talk)} + ^- {(list move) _+>.$} + ?> ?=({$subscribe @ @ *} way) + =+ app=(slav %tas i.t.way) + =+ station=i.t.t.way + =+ source=t.t.t.way + ?. (~(has in connections) [app source station]) + %- %- slog :~ + leaf+"pipe dropping:" + leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" + == + [~ +>.$] + :_ +>.$ :_ ~ + :* ost.hid %poke [%relay app station source] + [our.hid %talk] %talk-command + %publish + |- ^- (list thought:talk) + ?~ speeches + ~ + :_ $(speeches t.speeches, eny.hid (shax (cat 3 %pipe eny.hid))) + :* `@uvH`(end (sub 'H' 'A') 1 eny.hid) + [[[%& our.hid station] *envelope:talk %pending] ~ ~] + now.hid *(set flavor:talk) i.speeches + == + == +:: +++ coup-relay + |= {way/wire saw/(unit tang)} + ^- {(list move) _+>.$} + ?> ?=({@ @ @ *} way) + ?~ saw + [~ +>.$] + %- (slog leaf+"pipe relay failure in:" >way< u.saw) + [~ +>.$] +-- diff --git a/app/talk.hoon b/app/talk.hoon index b5054d92a..c10ebc05a 100644 --- a/app/talk.hoon +++ b/app/talk.hoon @@ -2018,6 +2018,15 @@ $url url+(crip (earf p.sep)) $mor mor+(turn p.sep |=(speech ^$(sep +<))) $fat [%mor $(sep q.sep) tan+(tr-rend-tors p.sep) ~] + $api + :- %tan + :_ ~ + :+ %rose + [": " ~ ~] + :~ leaf+"[{(trip id.sep)} on {(trip service.sep)}]" + leaf+(trip body.sep) + leaf+(earn url.sep) + == == :: ++ tr-rend-tors @@ -2090,6 +2099,9 @@ :: $app (tr-chow 64 "[{(trip p.sep)}]: {(trip q.sep)}") + :: + $api + (tr-chow 64 "[{(trip id.sep)}@{(trip service.sep)}]: {(trip summary.sep)}") == -- :: diff --git a/arvo/gall.hoon b/arvo/gall.hoon index 2813a00c5..d7efcf501 100644 --- a/arvo/gall.hoon +++ b/arvo/gall.hoon @@ -1,4 +1,5 @@ !: :: %gall, agent execution + !? 163 :::: |= pit/vase @@ -782,6 +783,7 @@ (ap-move-pass -.q.vax +<.q.vax cav) $diff (ap-move-diff -.q.vax cav) $hiss (ap-move-hiss -.q.vax cav) + $peel (ap-move-peel -.q.vax cav) $peer (ap-move-peer -.q.vax cav) $pull (ap-move-pull -.q.vax cav) $poke (ap-move-poke -.q.vax cav) @@ -871,6 +873,22 @@ :- p.p.yep [%send q.p.yep r.p.yep %poke p.q.gaw paw] :: + ++ ap-move-peel :: pass %peel + |= {sto/bone vax/vase} + ^- {(each cove tang) _+>} + =^ yep +>.$ (ap-move-mess vax) + :_ +>.$ + ?: ?=($| -.yep) yep + =+ mar=((soft mark) +>-.q.vax) + ?~ mar + [%| (ap-suck "peel: malformed mark")] + =+ pux=((soft path) +>+.q.vax) + ?. &(?=(^ pux) (levy u.pux (sane %ta))) + [%| (ap-suck "peel: malformed path")] + :^ %& sto %pass + :- p.p.yep + [%send q.p.yep r.p.yep %peel u.mar u.pux] + :: ++ ap-move-peer :: pass %peer |= {sto/bone vax/vase} ^- {(each cove tang) _+>} diff --git a/mar/gh/issue-comment.hoon b/mar/gh/issue-comment.hoon index c926b3b91..9df5ae26c 100644 --- a/mar/gh/issue-comment.hoon +++ b/mar/gh/issue-comment.hoon @@ -1,7 +1,19 @@ :: Converts the result of an 'issues' event into a issues:gh. /- gh -/+ gh-parse +/+ gh-parse, talk |_ issue-comment/issue-comment:gh +++ grow + |% + ++ talk-speeches + ^- (list speech:talk) + :_ ~ + :* %api %github + login.sender.issue-comment + (end 3 64 body.comment.issue-comment) + body.comment.issue-comment + (need (epur url.comment.issue-comment)) + == + -- ++ grab |% ++ json diff --git a/mar/gh/issues.hoon b/mar/gh/issues.hoon index 22e0455b5..fbb0b2be6 100644 --- a/mar/gh/issues.hoon +++ b/mar/gh/issues.hoon @@ -1,7 +1,86 @@ :: Converts the result of an 'issues' event into a issues:gh. /- gh -/+ gh-parse +/+ gh-parse, talk |_ issues/issues:gh +++ grow + |% + ++ talk-speeches + ^- (list speech:talk) + :_ ~ + :* %api %github + login.sender.issues + =- [- - (need (epur url.issue.issues))] + ?- -.action.issues + $assigned + ;: (cury cat 3) + 'assigned issue #' + (scot %ud number.issue.issues) + ' to ' + login.assignee.action.issues + ' (' + title.issue.issues + ')' + == + :: + $unassigned + ;: (cury cat 3) + 'unassigned issue #' + (scot %ud number.issue.issues) + ' from ' + login.assignee.action.issues + ' (' + title.issue.issues + ')' + == + :: + $labeled + ;: (cury cat 3) + 'labeled issue #' + (scot %ud number.issue.issues) + ' as ' + name.label.action.issues + ' (' + title.issue.issues + ')' + == + :: + $unlabeled + ;: (cury cat 3) + 'unlabeled issue #' + (scot %ud number.issue.issues) + ' as ' + name.label.action.issues + ' (' + title.issue.issues + ')' + == + :: + $opened + ;: (cury cat 3) + 'opened issue #' + (scot %ud number.issue.issues) + ': ' + title.issue.issues + == + :: + $closed + ;: (cury cat 3) + 'closed issue #' + (scot %ud number.issue.issues) + ': ' + title.issue.issues + == + :: + $reopened + ;: (cury cat 3) + 'reopened issue #' + (scot %ud number.issue.issues) + ': ' + title.issue.issues + == + == + == + -- ++ grab |% ++ json diff --git a/mar/talk/speeches.hoon b/mar/talk/speeches.hoon new file mode 100644 index 000000000..7ed93dc8a --- /dev/null +++ b/mar/talk/speeches.hoon @@ -0,0 +1,23 @@ +:: +:::: /hoon/speeches/talk/mar + :: +/? 310 +/- talk +/+ talk,map-to-json +!: +=+ talk +|_ gam/(list speech) +:: +++ grab + |% + ++ noun (list speech) + -- +:: +++ grad + |% + ++ form %talk-speeches + ++ diff |=((list speech) +<) + ++ pact |=((list speech) +<) + ++ join |=({(list speech) (list speech)} `(unit mime)`~) + -- +-- diff --git a/sur/talk.hoon b/sur/talk.hoon index 692175961..839c01315 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -65,6 +65,7 @@ {$lin p/? q/@t} :: no/@ text line {$mor p/(list speech)} :: multiplex {$app p/@tas q/@t} :: app message + {$api service/@tas id/@t summary/@t body/@t url/purl} :: api message == :: ++ serial @uvH :: unique identity ++ partner (each station passport) :: interlocutor From 402361d9c5a3b4cbb1ddaace8f73967b85468bc2 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Thu, 24 Mar 2016 19:55:10 -0400 Subject: [PATCH 10/14] refactor into generators --- app/pipe.hoon | 46 ++++++++++++++++++++++++--------------- gen/pipe/cancel.hoon | 6 +++++ gen/pipe/connect.hoon | 6 +++++ gen/pipe/list.hoon | 6 +++++ mar/gh/issue-comment.hoon | 10 ++++++--- mar/gh/issues.hoon | 14 ++++++------ 6 files changed, 60 insertions(+), 28 deletions(-) create mode 100644 gen/pipe/cancel.hoon create mode 100644 gen/pipe/connect.hoon create mode 100644 gen/pipe/list.hoon diff --git a/app/pipe.hoon b/app/pipe.hoon index dbab65670..e15d5b1d9 100644 --- a/app/pipe.hoon +++ b/app/pipe.hoon @@ -13,28 +13,38 @@ |= arg/* ^- {(list move) _+>.$} ?: ?=($list arg) - %- %- slog - %+ turn (~(tap in connections)) - |= {app/term source/path station/knot} - leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" - [~ +>.$] + (poke-pipe-list ~) =+ ((soft {$cancel app/term source/path station/knot}) arg) ?^ - - ?. (~(has in connections) [app.u source.u station.u]) - %- %- slog :~ - leaf+"no connection:" - leaf+"{(trip app.u)}{<`path`source.u>} ---> {(trip station.u)}" - == - [~ +>.$] - %- %- slog :~ - leaf+"canceling:" - leaf+"{(trip app.u)}{<`path`source.u>} ---> {(trip station.u)}" - == - [~ +>.$(connections (~(del in connections) [app.u source.u station.u]))] + (poke-pipe-cancel app.u source.u station.u) =+ ((hard {app/term source/path station/knot}) arg) - (poke-pipe-arg app source station) + (poke-pipe-connect app source station) :: -++ poke-pipe-arg +++ poke-pipe-list + |= $~ + ^- {(list move) _+>.$} + %- %- slog + %+ turn (~(tap in connections)) + |= {app/term source/path station/knot} + leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" + [~ +>.$] +:: +++ poke-pipe-cancel + |= {app/term source/path station/knot} + ^- {(list move) _+>.$} + ?. (~(has in connections) [app source station]) + %- %- slog :~ + leaf+"no connection:" + leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" + == + [~ +>.$] + %- %- slog :~ + leaf+"canceling:" + leaf+"{(trip app)}{<`path`source>} ---> {(trip station)}" + == + [~ +>.$(connections (~(del in connections) [app source station]))] +:: +++ poke-pipe-connect |= {app/term source/path station/knot} ^- {(list move) _+>.$} :_ +>.$(connections (~(put in connections) [app source station])) diff --git a/gen/pipe/cancel.hoon b/gen/pipe/cancel.hoon new file mode 100644 index 000000000..5af20d361 --- /dev/null +++ b/gen/pipe/cancel.hoon @@ -0,0 +1,6 @@ +!: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{app/term source/path station/knot $~} $~} + == +[%pipe-cancel app source station] diff --git a/gen/pipe/connect.hoon b/gen/pipe/connect.hoon new file mode 100644 index 000000000..0195e6ce7 --- /dev/null +++ b/gen/pipe/connect.hoon @@ -0,0 +1,6 @@ +!: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{app/term source/path station/knot $~} $~} + == +[%pipe-connect app source station] diff --git a/gen/pipe/list.hoon b/gen/pipe/list.hoon new file mode 100644 index 000000000..72400477d --- /dev/null +++ b/gen/pipe/list.hoon @@ -0,0 +1,6 @@ +!: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {$~ $~} + == +[%pipe-list ~] diff --git a/mar/gh/issue-comment.hoon b/mar/gh/issue-comment.hoon index 9df5ae26c..082491296 100644 --- a/mar/gh/issue-comment.hoon +++ b/mar/gh/issue-comment.hoon @@ -9,9 +9,13 @@ :_ ~ :* %api %github login.sender.issue-comment - (end 3 64 body.comment.issue-comment) - body.comment.issue-comment - (need (epur url.comment.issue-comment)) + =- [- - (need (epur url.comment.issue-comment))] + ;: (cury cat 3) + 'on issue #' + `@t`(rsh 3 2 (scot %ui number.issue.issue-comment)) + ': ' + body.comment.issue-comment + == == -- ++ grab diff --git a/mar/gh/issues.hoon b/mar/gh/issues.hoon index fbb0b2be6..ccb8398e2 100644 --- a/mar/gh/issues.hoon +++ b/mar/gh/issues.hoon @@ -14,7 +14,7 @@ $assigned ;: (cury cat 3) 'assigned issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ' to ' login.assignee.action.issues ' (' @@ -25,7 +25,7 @@ $unassigned ;: (cury cat 3) 'unassigned issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ' from ' login.assignee.action.issues ' (' @@ -36,7 +36,7 @@ $labeled ;: (cury cat 3) 'labeled issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ' as ' name.label.action.issues ' (' @@ -47,7 +47,7 @@ $unlabeled ;: (cury cat 3) 'unlabeled issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ' as ' name.label.action.issues ' (' @@ -58,7 +58,7 @@ $opened ;: (cury cat 3) 'opened issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ': ' title.issue.issues == @@ -66,7 +66,7 @@ $closed ;: (cury cat 3) 'closed issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ': ' title.issue.issues == @@ -74,7 +74,7 @@ $reopened ;: (cury cat 3) 'reopened issue #' - (scot %ud number.issue.issues) + (rsh 3 2 (scot %ui number.issue.issues)) ': ' title.issue.issues == From 39f1bfc01af96f09aaf9b810500950d6b5cd7d95 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Fri, 25 Mar 2016 20:47:22 -0400 Subject: [PATCH 11/14] reworked api speech type --- mar/gh/issue-comment.hoon | 15 ++++++++++++--- mar/gh/issues.hoon | 39 ++++++++++++++++++++++++++++++++++++--- mar/talk/report.hoon | 11 +++++++++++ sur/talk.hoon | 10 +++++++++- 4 files changed, 68 insertions(+), 7 deletions(-) diff --git a/mar/gh/issue-comment.hoon b/mar/gh/issue-comment.hoon index 082491296..36b110020 100644 --- a/mar/gh/issue-comment.hoon +++ b/mar/gh/issue-comment.hoon @@ -7,15 +7,24 @@ ++ talk-speeches ^- (list speech:talk) :_ ~ - :* %api %github - login.sender.issue-comment - =- [- - (need (epur url.comment.issue-comment))] + =+ ^= txt ;: (cury cat 3) 'on issue #' `@t`(rsh 3 2 (scot %ui number.issue.issue-comment)) ': ' body.comment.issue-comment == + :* %api %github + login.sender.issue-comment + (need (epur url.sender.issue-comment)) + txt + txt + (need (epur url.comment.issue-comment)) + %- jobe :~ + repository+s+name.repository.issue-comment + number+(jone number.issue.issue-comment) + title+s+title.issue.issue-comment + == == -- ++ grab diff --git a/mar/gh/issues.hoon b/mar/gh/issues.hoon index ccb8398e2..3c9973eff 100644 --- a/mar/gh/issues.hoon +++ b/mar/gh/issues.hoon @@ -7,9 +7,7 @@ ++ talk-speeches ^- (list speech:talk) :_ ~ - :* %api %github - login.sender.issues - =- [- - (need (epur url.issue.issues))] + =+ ^= txt ?- -.action.issues $assigned ;: (cury cat 3) @@ -79,6 +77,41 @@ title.issue.issues == == + :* %api %github + login.sender.issues + (need (epur url.sender.issues)) + txt txt + (need (epur url.issue.issues)) + %- jobe + %+ welp + :~ repository+s+name.repository.issues + number+(jone number.issue.issues) + title+s+title.issue.issues + action+s+-.action.issues + == + ?- -.action.issues + $assigned + :~ assignee+s+login.assignee.action.issues + assignee-url+s+url.assignee.action.issues + == + :: + $unassigned + :~ assignee+s+login.assignee.action.issues + assignee-url+s+url.assignee.action.issues + == + :: + $labeled + :~ label+s+name.label.action.issues + == + :: + $unlabeled + :~ label+s+name.label.action.issues + == + :: + $opened ~ + $closed ~ + $reopened ~ + == == -- ++ grab diff --git a/mar/talk/report.hoon b/mar/talk/report.hoon index c785b7988..4d04921c4 100644 --- a/mar/talk/report.hoon +++ b/mar/talk/report.hoon @@ -91,6 +91,17 @@ $app (jobe txt+[%s q.a] src+[%s p.a] ~) $fat (jobe tor+(tors p.a) taf+$(a q.a) ~) $mor a+(turn p.a spec) + $api + %- jobe :~ + service+s+service.a + id+s+id.a + ~& url=`*`id-url.a + id-url+s+(crip (earn id-url.a)) + summary+s+summary.a + body+s+body.a + url+s+(crip (earn url.a)) + meta+meta.a + == :: %inv (jobe ship+(jope p.a) party+[%s q.a] ~) == :: diff --git a/sur/talk.hoon b/sur/talk.hoon index 839c01315..0c03d955d 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -65,7 +65,15 @@ {$lin p/? q/@t} :: no/@ text line {$mor p/(list speech)} :: multiplex {$app p/@tas q/@t} :: app message - {$api service/@tas id/@t summary/@t body/@t url/purl} :: api message + $: $api :: api message + service/@tas :: service name + id/@t :: id on the service + id-url/purl :: link to id + summary/@t :: summary of event + body/@t :: body of event + url/purl :: link to event + meta/json :: other data for web + == :: == :: ++ serial @uvH :: unique identity ++ partner (each station passport) :: interlocutor From 856ce757070d09b182545397668cbf1264d5b881 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 31 Mar 2016 12:49:59 -0700 Subject: [PATCH 12/14] split %chis IPC-request back out of %this urbit/urbit@3d05538 --- arvo/eyre.hoon | 31 ++++++++++++++----------------- arvo/zuse.hoon | 5 +++-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 05904f58c..75f44e731 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -20,7 +20,7 @@ == == :: $: $e :: to self $% {$thud $~} :: proxied death - {$this p/? q/? r/clip s/httq} :: proxied request + {$this p/? r/clip s/httq} :: proxied request {$meta vase:{$them (unit httr)}} :: type check == == :: $: $f :: to %ford @@ -616,10 +616,10 @@ =. our ?~(hov p.kyz (min u.hov p.kyz)) +>.$(hov [~ our], top [[our %home ud+0] /web]) :: - $this :: inbound request + ?($chis $this) :: inbound request %- emule |. ^+ ..apex - =* sec q.kyz :: ? :: https bit - =* heq s.kyz :: httq :: request content + =* sec p.kyz :: ? :: https bit + =* heq r.kyz :: httq :: request content =+ ryp=`quri`(rash q.heq zest:epur) =+ maf=(eat-headers r.heq) =+ ^= pul ^- purl @@ -630,9 +630,11 @@ [[sec (rash i.hot thor:epur)] p.ryp q.ryp] == =. p.p.pul |(p.p.pul ?=(hoke r.p.pul)) + ?: ?=($chis -.kyz) :: IPC escape hatch + ~(lens handle pul [q.+.kyz |] [p.heq maf s.heq]) =+ her=(host-to-ship r.p.pul) ?: |(?=($~ her) =(our u.her)) - (handle pul [p.+.kyz r.+.kyz |] [p.heq maf s.heq]) + ~(apex handle pul [q.+.kyz |] [p.heq maf s.heq]) =+ han=(sham hen) =. pox (~(put by pox) han hen) (ames-gram u.her [%get ~] han +.kyz) @@ -1016,12 +1018,10 @@ :: :: ++ handle - |= $: {hat/hart pok/pork quy/quay} :: purl parsed url - {lop/? cip/clip aut/?} :: client ip nonymous? + |_ $: {hat/hart pok/pork quy/quay} :: purl parsed url + {cip/clip aut/?} :: client ip nonymous? {mef/meth maf/math bod/(unit octs)} :: method+headers+body == - =< apex - |% ++ abet ..handle ++ done . ++ teba |*(a/$-(* ..handle) |*(b/* %_(done ..handle (a b)))) @@ -1048,6 +1048,10 @@ ?: ?=($| -.pez) p.pez (resolve ~ p.pez) :: + ++ lens + =< abet + (process-parsed [%lens (need grab-json)]) + :: ++ resolve |= {cug/(list @t) pez/pest} ^+ done ?~ pez done @@ -1098,9 +1102,7 @@ :: ++ parse ^- (each perk httr) - |^ =+ pol=as-loopback - ?^ pol [%& u.pol] - =+ hit=as-magic-filename + |^ =+ hit=as-magic-filename ?^ hit [%| u.hit] ?: is-spur [%& %spur (flop q.pok)] @@ -1112,11 +1114,6 @@ ?^ hem [%& u.hem] ~|(strange-path+q.pok !!) :: - ++ as-loopback - ^- (unit perk) - ?. lop ~ - `lens+(need grab-json) - :: ++ as-magic-filename ^- (unit httr) ?+ [(fall p.pok %$) q.pok] ~ diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index 59c6baf0e..1e83bba07 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2177,7 +2177,7 @@ $? {{$lon $~} p/hole} :: login request {{$aut $~} p/hole} :: login reply {{$hat $~} p/hole q/hart} :: login redirect - {{$get $~} p/@uvH q/{? ? clip httq}} :: remote request + {{$get $~} p/@uvH q/{? clip httq}} :: remote request {{$got $~} p/@uvH q/httr} :: remote response {{$gib $~} p/@uvH} :: remote cancel == :: @@ -2190,7 +2190,8 @@ {$serv p/$@(desk beam)} :: set serving root {$them p/(unit hiss)} :: outbound request {$they p/@ud q/httr} :: inbound response - {$this p/? q/? r/clip s/httq} :: inbound request + {$chis p/? q/clip r/httq} :: IPC inbound request + {$this p/? q/clip r/httq} :: inbound request {$thud $~} :: inbound cancel {$wegh $~} :: report memory {$west p/sack q/fuz:gram} :: network request From 3aa4baaf39d9f67aad8a7e48d3f8a75c59b2909d Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 31 Mar 2016 13:56:22 -0700 Subject: [PATCH 13/14] state adapter --- arvo/eyre.hoon | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 75f44e731..ef52c977d 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -91,7 +91,7 @@ -- :: |% :: models ++ bolo :: eyre state - $: $4 :: version + $: $5 :: version gub/@t :: random identity hov/(unit ship) :: master for remote top/beam :: ford serve prefix @@ -1968,8 +1968,12 @@ ~ :: ++ load :: take previous state - |= old/bolo - ..^$(+>- old) + =+ bolo-4={$4 _%*(+ *bolo lyv *(map duct ^))} + |= old/?(bolo bolo-4) + ?- -.old + $5 ..^$(+>- old) + $4 $(old [%5 +.old(lyv ~)]) :: minor leak + == :: ++ scry |= {fur/(unit (set monk)) ren/@tas who/ship syd/desk lot/coin tyl/path} From 4e12caea2d59ba6ca165d511b668a08342796d59 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 31 Mar 2016 13:57:00 -0700 Subject: [PATCH 14/14] move ->lens-json conversion to mar/sole-effect, lens ack logic inside ++ix --- arvo/eyre.hoon | 102 +++++++++++-------------------------------- mar/lens/json.hoon | 12 +++++ mar/sole/effect.hoon | 16 +++++++ 3 files changed, 54 insertions(+), 76 deletions(-) create mode 100644 mar/lens/json.hoon diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index ef52c977d..a3feacbb7 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -72,22 +72,6 @@ $bak :: ++bak auth response $in :: ++in handle code == :: -++ sole-effect :: app to sole - $% {$bel $~} :: beep - {$blk p/@ud q/@c} :: blink+match char at - {$clr $~} :: clear screen - {$det *} :: sole-change :: edit command - {$err p/@ud} :: error point - {$mor p/(list sole-effect)} :: multiple effects - {$nex $~} :: save clear command - {$pro *} :: sole-prompt :: set prompt - {$sag p/path q/*} :: save to jamfile - {$sav p/path q/@} :: save to file - {$tan p/(list tank)} :: classic tank - :: {$taq p/tanq} :: modern tank - {$txt p/tape} :: text line - {$url p/@t} :: activate url - == :: -- :: |% :: models ++ bolo :: eyre state @@ -150,7 +134,6 @@ {$bugs p/?($as $to) $~} {$beam p/beam} {$deps p/?($put $delt) q/@uvH} - {$lens p/json} {$mess p/dock q/mark r/wire s/json} {$poll p/{i/@uvH t/(list @uvH)}} {$spur p/spur} @@ -769,26 +752,11 @@ =+ cuf=`cuft`+>.sih ?- -.cuf ?($coup $reap) - ?: ?=($lens r.q.tee) - ~& hen=hen^hcuf=-.cuf - ?: ?=(^ p.cuf) - =+ tag=`tang`[>%eyre-unto-error< >-.cuf< u.p.cuf] - %- (slog tag) - =+ txt=(role (turn (flop tag) |=(a/tank (crip ~(ram re a))))) - =+ jon=`json`s+txt - (give-json 200 ~ jon) - ?. ?=($coup -.cuf) - +>.$ - +>.$ - :: abet:(give-json:(ire-ix p.tee) 200 ~ (joba %okey-dokey %b &)) + ~? ?=($lens r.q.tee) hen=hen^hcuf=-.cuf (get-ack:(ire-ix p.tee) q.tee ?~(p.cuf ~ `[-.cuf u.p.cuf])) :: $doff !! $diff - ?: ?=($lens r.q.tee) - ~& [%lens-diffing (sole-effect q.q.p.cuf)] - =+ fec=((hard sole-effect) q.q.p.cuf) - (get-lens:(ire-ix p.tee) q.tee fec) ?. ?=($json p.p.cuf) :: ~> %slog.`%*(. >[%backing p.p.cuf %q-p-cuf]< &3.+> (sell q.p.cuf)) (back tee %json p.cuf) @@ -946,7 +914,7 @@ ++ new-deps |= {a/@uvH b/(each duct ixor)} ^+ +>.$ :: ~& new-deps+[a b] - ?: =(`@`0 a) +>.$ + ?: =(`@`~ a) +>.$ =+ had=(~(has by liz) a) =. liz (~(put ju liz) a b) ?: had +>.$ @@ -1050,7 +1018,10 @@ :: ++ lens =< abet - (process-parsed [%lens (need grab-json)]) + :: (process-parsed [%mess [our %dojo] %lens-command /lens (need grab-json)]) + =^ orx ..ya new-view:(logon:for-client our) + =+ vew=(ire-ix (oryx-to-ixor orx)) + ((teba new-lens.vew) (need grab-json)) :: ++ resolve |= {cug/(list @t) pez/pest} ^+ done @@ -1302,13 +1273,6 @@ $put (new-deps q.hem %| ire) $delt (del-deps q.hem %| ire) == - :: - $lens - :: $(hem [%mess [our %dojo] %lens-command /lens p.hem]) - :- %| - =^ orx ..ya new-view:for-client - =+ vew=(ire-ix (oryx-to-ixor orx)) - ((teba new-lens.vew) p.hem) :: $mess :- %| @@ -1586,7 +1550,7 @@ =. +>.$ %+ pass-note [%of ire (gsig [our %dojo] lens+/)] - [%g %deal [him our] %dojo %peer /sole] :: XX maybe peel json? + [%g %deal [him our] %dojo %peel %lens-json /sole] =. +>.$ %+ pass-note [%of ire (gsig [our %dojo] lens+/)] @@ -1614,42 +1578,18 @@ (nice-json:pop-duct:(ire-ix ire)) :: XX gall ack :: ++ get-lens - |= {a/whir-of fec/sole-effect} ^+ ..ix - ?+ -.fec ..ix - $tan - =+ txt=(role (turn (flop p.fec) |=(a/tank (crip ~(ram re a))))) - =+ jon=`json`s+txt - =. +>.$ - %+ pass-note - `whir`[%of ire (gsig [our %dojo] lens+/)] - `note`[%g %deal [him our] %dojo %pull ~] - abet:(give-json 200 ~ jon) - :: - $txt - =+ jon=`json`s+(crip p.fec) - =. +>.$ - %+ pass-note - `whir`[%of ire (gsig [our %dojo] lens+/)] - `note`[%g %deal [him our] %dojo %pull ~] - abet:(give-json 200 ~ jon) - :: - $sav - =+ ^= jon - (jobe file+s+(crip <`path`p.fec>) data+s+(crip (sifo q.fec)) ~) - =. +>.$ - %+ pass-note - `whir`[%of ire (gsig [our %dojo] lens+/)] - `note`[%g %deal [him our] %dojo %pull ~] - abet:(give-json 200 ~ jon) - :: - $mor - |- ^+ ..ix - ?~ p.fec ..ix - $(p.fec t.p.fec, ..ix ^$(fec i.p.fec)) - == + |= {a/whir-of fec/json} ^+ ..ix + ?~ fec ..ix :: nulled event we don't care about + =. +>.$ + %+ pass-note + `whir`[%of ire (gsig [our %dojo] lens+/)] + `note`[%g %deal [him our] %dojo %pull ~] + abet:(give-json 200 ~ fec) :: ++ get-rush |= {a/whir-of b/json} ^+ ..ix + ?: ?=($lens r.a) + (get-lens a b) (get-even [%rush [[(slav %p p.a) q.a] s.a] (joba %json b)]) :: ++ get-quit @@ -1658,10 +1598,20 @@ :: ++ get-ack |= {a/whir-of b/(unit {term tang})} ^+ ..ix + ?: ?=($lens r.a) + (ack-lens b) ?: =(~ med) ~& resp-lost+ire ..ix ?~ b (nice-json:pop-duct) (mean-json:pop-duct 500 b) :: + ++ ack-lens + |= a/(unit (pair term tang)) ^+ ..ix + ?~ a + ..ix :: (give-json 200 ~ (joba %okey-dokey %b &)) + =+ tag=(flop `tang`[>[%eyre-lens-fail p.u.a]< q.u.a]) + %- (slog tag) + abet:(give-json 500 ~ (jape (wush 160 tag))) + :: ++ get-even |= ven/even ^+ ..ix =+ num=p.eve diff --git a/mar/lens/json.hoon b/mar/lens/json.hoon new file mode 100644 index 000000000..21cc07cd1 --- /dev/null +++ b/mar/lens/json.hoon @@ -0,0 +1,12 @@ +:: +:::: /hoon/json/lens/mar + :: +/? 310 +!: +:::: ~fyr + :: +|_ jon/json +++ grab |% ++ noun json + -- +++ grow |% ++ json jon +-- -- diff --git a/mar/sole/effect.hoon b/mar/sole/effect.hoon index ca30c1fed..080621fb8 100644 --- a/mar/sole/effect.hoon +++ b/mar/sole/effect.hoon @@ -41,6 +41,22 @@ -- ++ grow |% + ++ lens-json :: json for cli client + ^- ?($~ ^json) :: null = ignore + ?+ -.sef ~ + $tan s+(role (turn (flop p.sef) |=(a/tank (crip ~(ram re a))))) + $txt s+(crip p.sef) + $sav + (jobe file+s+(crip <`path`p.sef>) data+s+(crip (sifo q.sef)) ~) + :: + $mor + =+ all=(turn p.sef |=(a/sole-effect lens-json(sef a))) + =. all (skip all |=(a/^json ?=($~ a))) + ?~ all ~ + ?~ t.all i.all + ~|(multiple-effects+`(list ^json)`all !!) + == + :: ++ json ^- ^json ?+ -.sef