Merge pull request #452 from Fang-/remaint-merge-talk

Hall (New Talk): the PR
This commit is contained in:
Ted Blackman 2017-12-07 11:14:58 -08:00 committed by GitHub
commit 60cffd62ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 6415 additions and 3621 deletions

91
app/fora.hoon Normal file
View File

@ -0,0 +1,91 @@
::
:: /app/fora/hoon
::
::TODO maybe stop relying on %hood one day.
::
/- hall
/+ hall, time-to-id
=, format
=, title
::
|%
++ move (pair bone card)
++ card
$% {$poke wire dock poke}
{$exec wire @p $~ {beak silk:ford}}
{$info wire @p toro:clay}
==
++ poke
$% {$hall-action action:hall}
{$write-fora-post spur ship cord cord}
{$write-comment spur ship cord}
==
--
::
|_ {bol/bowl:gall $~}
::
++ prep
|= old/(unit $~)
^- (quip move _..prep)
?^ old [~ ..prep(+<+ u.old)]
:_ ..prep
:~ (act %create %fora-posts 'fora posts' %journal)
(act %create %fora-comments 'fora comments' %journal)
==
::
++ act
|= a/action:hall
^- move
[ost.bol %poke / [our.bol %hall] %hall-action a]
::
++ ra-base-hart .^(hart:eyre %e /(scot %p our.bol)/host/(scot %da now.bol))
::
++ poke-fora-post
|= {pax/path sup/spur hed/@t txt/@t}
^- (quip move _+>)
:_ +>
:~ %- act
:+ %phrase [[our.bol %fora-posts] ~ ~]
:_ ~
:+ %app dap.bol
:+ %fat
:+ %name
(crip "post by {(cite src.bol)}: {(trip hed)}")
text+(to-wain txt)
=. pax (welp pax /posts/(crip "{<now.bol>}~"))
[%url [ra-base-hart `pax ~] ~]
::
:* ost.bol
%poke
/fora-post
[our.bol %hood]
[%write-fora-post sup src.bol hed txt]
==
==
::
++ poke-fora-comment
|= {pax/path sup/spur txt/@t}
^- (quip move _+>)
:_ +>
:~ ^- move
%- act
:+ %phrase [[our.bol %fora-comments] ~ ~]
:_ ~
:+ %app dap.bol
^- speech:hall
:+ %fat
:+ %name
=+ nam=?~(sup "" (trip i.sup))
(crip "comment by {(cite src.bol)} on /{nam}")
text+(to-wain txt)
=+ fra=(crip (time-to-id now.bol))
[%url [ra-base-hart `pax ~] `fra]
::
:* ost.bol
%poke
/fora-comment
[our.bol %hood]
[%write-comment sup src.bol txt]
==
==
--

2502
app/hall.hoon Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
:::: /hoon/hood/app :: ::
:: :: ::
/? 310 :: zuse version
/+ sole, talk, :: libraries
/+ sole, :: libraries
:: XX these should really be separate apps, as
:: none of them interact with each other in
:: any fashion; however, to reduce boot-time

View File

@ -1,10 +1,10 @@
/+ talk
/+ hall
::
=> |%
++ move (pair bone card)
++ card
$% {$peel wire dock mark path}
{$poke wire dock $talk-command command:talk}
{$poke wire dock $hall-command command:hall}
==
--
::
@ -52,11 +52,11 @@
:_ ~
~& [%peeling app source station]
:* ost.hid %peel [%subscribe app station source]
[our.hid app] %talk-speeches source
[our.hid app] %hall-speeches source
==
::
++ diff-talk-speeches
|= {way/wire speeches/(list speech:talk)}
++ diff-hall-speeches
|= {way/wire speeches/(list speech:hall)}
^- {(list move) _+>.$}
?> ?=({$subscribe @ @ *} way)
=+ app=(slav %tas i.t.way)
@ -70,15 +70,15 @@
[~ +>.$]
:_ +>.$ :_ ~
:* ost.hid %poke [%relay app station source]
[our.hid %talk] %talk-command
[our.hid %hall] %hall-command
%publish
|- ^- (list thought:talk)
|- ^- (list thought:hall)
?~ 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
[[[%& our.hid station] *envelope:hall %pending] ~ ~]
now.hid *(set flavor:hall) i.speeches
==
==
::

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
:::: /hoon/twit/app
::
/- plan-acct
/+ twitter, talk
/+ twitter, hall
::
:::: ~fyr
::
@ -47,7 +47,7 @@
++ api-call {response-mark $twit-req {endpoint quay}} :: full hiss payload
++ response-mark ?($twit-post $twit-feed $twit-cred) :: sigh options
++ app-message
$? {{ship $talk} $talk-command command:talk} :: chat message
$? {{ship $hall} $hall-action action:hall} :: chat message
{{ship $hood} $write-plan-account user:eyre plan-acct} :: registration
== ::
++ sign :: arvo response
@ -315,5 +315,5 @@
?. =(pax a) ~
(turn b |=(c/gift [ost c]))
::
++ show-url ~(said-url talk `bowl:gall`+<-)
++ show-url ~(said-url hall `bowl:gall`+<-)
--

13
gen/hall/load-legacy.hoon Normal file
View File

@ -0,0 +1,13 @@
:: Load legacy messages from backup
::
:::: /gen/hall/load-old/hoon
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ byk/beak}
{{man/knot $~} $~}
==
[%load-legacy man]

View File

@ -1,6 +1,6 @@
:: Load channel messages from backup
::
:::: /hoon/load/talk/gen
:::: /hoon/load/hall/gen
::
/? 310
::
@ -10,4 +10,4 @@
|= $: {now/@da eny/@uvJ byk/beak}
{{man/knot $~} $~}
==
[%talk-load man]
[%hall-load man]

View File

@ -1,6 +1,6 @@
:: Enable channel logging to clay
::
:::: /hoon/log/talk/gen
:::: /hoon/log/hall/gen
::
/? 310
::
@ -10,4 +10,4 @@
|= $: {now/@da eny/@uvJ byk/beak}
{{man/knot $~} $~}
==
[%talk-log man]
[%hall-log man]

View File

@ -1,6 +1,6 @@
:: Save channel messages to backup
::
:::: /hoon/save/talk/gen
:::: /hoon/save/hall/gen
::
/? 310
::
@ -10,4 +10,4 @@
|= $: {now/@da eny/@uvJ byk/beak}
{{man/knot $~} $~}
==
[%talk-save man]
[%hall-save man]

View File

@ -1,6 +1,6 @@
:: Disable channel logging to clay
::
:::: /hoon/unlog/talk/gen
:::: /hoon/unlog/hall/gen
::
/? 310
::
@ -10,4 +10,4 @@
|= $: {now/@da eny/@uvJ byk/beak}
{{man/knot $~} $~}
==
[%talk-unlog man]
[%hall-unlog man]

View File

@ -23,7 +23,7 @@
:- ?- b
$~ "/" :: XX !! maybe?
{$hood ^} "|{(path-heps t.b)}"
^ "+{(path-heps b)}" :: XX deal with :talk|foo
^ "+{(path-heps b)}" :: XX deal with :hall|foo
==
=/ c (to-wain:format a)
?~ c "~"

View File

@ -1,10 +0,0 @@
:: Set upstream sources for channel
::
:::: /hoon/federate/talk/gen
::
/? 310
/- talk
:- %say
|= {^ {dest/knot sources/(list station:talk)} $~}
:- %talk-command
[%design dest ~ (silt (turn sources |=(station:talk [%& +<]))) '' %black ~]

605
lib/hall-json.hoon Normal file
View File

@ -0,0 +1,605 @@
::
:::: /lib/hall-json/hoon
::
/- hall
/+ old-zuse
=, hall
::
|_ bol/bowl:gall
++ en-tape ::> sur to tape
|%
++ circ ::> circle
|= a/circle
:(weld (scow %p hos.a) "/" (trip nom.a))
::
++ rang ::> range
|= a/range
?~ a ~
;: weld
"/" (scow hed.u.a)
?~ tal.u.a ~
(scow u.tal.u.a)
==
::
++ sorc ::> source
|= a/source
(weld (circ cir.a) (rang ran.a))
--
::
++ de-tape ::> tape to sur (parse)
|%
++ circ ::> circle
;~((glue fas) ;~(pfix sig fed:ag) urt:ab)
::
++ rang ::> range
=/ pont
;~ pose
(stag %ud dim:ag)
%+ stag %da
%+ sear
|= a/coin
^- (unit @da)
?. ?=({$$ $da @da} a) ~
`q.p.a
nuck:so
==
=+ ;~ pose
(cook some ;~(pfix fas pont))
(easy ~)
==
;~ pose
(cook some ;~(plug ;~(pfix fas pont) -))
(easy ~)
==
::
++ sorc ::> source
;~(plug circ rang)
--
::
++ enjs ::> sur to json
=, enjs:format
|%
::TODO these first few should probably make their way
:: into the stdlib...
++ sa ::> set as array
|* {a/(set) b/$-(* json)}
^- json
[%a (turn ~(tap in a) b)]
::
++ mo ::> map as object
|* {a/(map) b/$-(* @t) c/$-(* json)}
^- json
=- (pairs (turn ~(tap by a) -))
|* {k/* v/*} [(b k) (c v)]
::
++ lank ::> tank as string arr
|= a/tank
^- json
a+(turn (wash [0 1.024] a) tape)
::
++ dank ::> tank
|= a/tank
?: ?=($leaf -.a) (frond %leaf (tape p.a))
%+ frond -.a
%- pairs
?- -.a
$palm
:+ :- %style
%- pairs :~
mid+(tape p.p.a)
cap+(tape q.p.a)
open+(tape r.p.a)
close+(tape s.p.a)
==
lines+a+(turn q.a dank)
~
$rose
:+ :- %style
%- pairs :~
mid+(tape p.p.a)
open+(tape q.p.a)
close+(tape r.p.a)
==
lines+a+(turn q.a dank)
~
==
::
++ cord ::> string from cord
|= a/@t
s+a
::
++ mabe ::> null or value
|* {a/(unit) b/$-(* json)}
^- json
?~(a ~ (b u.a))
::
::> ||
::> || %query-models
::> ||
::> models relating to queries, their results and updates.
::+|
::
++ pici ::> prize-client
|= a/prize-client
^- json
%- pairs :~
:- %gys
=- (pairs ~(tap by (~(run by gys.a) -)))
|=((set (set circle)) (sa +< audi))
::
nis+(mo nis.a (cury scot %p) cord)
==
::
++ ruci ::> rumor-client
|= a/rumor-client
^- json
%+ frond -.a
?- -.a
$glyph (digy +.a)
$nick (dini +.a)
==
::
++ pack ::> package
|= a/package
^- json
%- pairs :~
nes+a+(turn nes.a enve) ::TODO maybe map
cos+(loby cos.a)
pes+(crow pes.a)
==
::
++ digy ::> diff-glyph
|= a/diff-glyph
^- json
%- pairs :~
bin+b+bin.a
gyf+s+gyf.a
aud+(audi aud.a)
==
::
++ dini ::> diff-nick
|= a/diff-nick
^- json
(pairs who+(ship who.a) nic+s+nic.a ~)
::
++ ruso ::> rumor-story
|= a/rumor-story
^- json
%+ frond -.a
?+ -.a !!
$new (conf cof.a)
:: $bear not needed
$config (pairs cir+(circ cir.a) dif+(dico dif.a) ~)
$status %- pairs :~
cir+(circ cir.a)
who+(ship who.a)
dif+(disa dif.a)
==
$remove b+&
$gram (enve nev.a)
==
::
++ dico ::> diff-config
|= a/diff-config
^- json
%+ frond -.a
?- -.a
$full (conf cof.a)
$source (pairs add+b+add.a src+(sorc src.a) ~)
$caption s+cap.a
$filter (filt fit.a)
$secure s+sec.a
$permit (pairs add+b+add.a sis+(sa sis.a ship) ~)
$remove b+&
==
::
++ disa ::> diff-status
|= a/diff-status
^- json
%+ frond -.a
?- -.a
$full (stat sat.a)
$presence s+pec.a
$human (dihu dif.a)
$remove b+&
==
::
++ dihu ::> diff-human
|= a/diff-human
^- json
%+ frond -.a
?- -.a
$full (huma man.a)
$handle (frond %han (mabe han.a cord))
$true (frond %tru (mabe tru.a trun))
==
::
::> ||
::> || %circles
::> ||
::> messaging targets and their metadata
::+|
::
++ circ ::> circle
|= a/circle
^- json
s+(crip (circ:en-tape a))
::
++ loby ::> lobby
|= a/lobby
%- pairs :~
loc+(conf loc.a)
rem+(mo rem.a (cork circ:en-tape crip) conf)
==
::
++ conf ::> config
|= a/config
^- json
%- pairs :~
src+(sa src.a sorc)
cap+s+cap.a
fit+(filt fit.a)
con+(cont con.a)
==
::
++ sorc ::> source
|= a/source
^- json
s+(crip (sorc:en-tape a))
::
++ filt ::> filter
|= a/filter
^- json
(pairs cas+b+cas.a utf+b+utf.a ~)
::
++ cont ::> control
|= a/control
^- json
(pairs sec+s+sec.a sis+(sa sis.a ship) ~)
::
++ crow ::> crowd
|= a/crowd
^- json
%- pairs :~
loc+(grop loc.a)
rem+(mo rem.a (cork circ:en-tape crip) grop)
==
::
++ grop ::> group
|= a/group
^- json
(mo a (cury scot %p) stat)
::
++ stat ::> status
|= a/status
^- json
(pairs pec+s+pec.a man+(huma man.a) ~)
::
++ huma ::> human
|= a/human
^- json
(pairs han+(mabe han.a cord) tru+(mabe tru.a trun) ~)
::
++ trun ::> truename
|= a/truename
^- json
(pairs fir+s+fir.a mid+(mabe mid.a cord) las+s+las.a ~)
::
::> ||
::> || %message-data
::> ||
::> structures for containing main message data
::+|
::
++ enve ::> envelope
|= a/envelope
^- json
(pairs num+(numb num.a) gam+(gram gam.a) ~)
::
++ gram ::> telegram
|= a/telegram
^- json
%- pairs :~
aut+(ship aut.a)
::TODO can we avoid this code duplication somehow?
uid+s+(scot %uv uid.a)
aud+(audi aud.a)
wen+(time wen.a)
sep+(spec sep.a)
==
::
++ thot ::> thought
|= a/thought
^- json
%- pairs :~
uid+s+(scot %uv uid.a)
aud+(audi aud.a)
wen+(time wen.a)
sep+(spec sep.a)
==
::
++ spec ::> speech
|= a/speech
^- json
:: only %url has just a single piece of data.
?: ?=($url -.a)
(frond %url s+(crip (apix:en-purl:html url.a)))
%+ frond -.a
%- pairs
?- -.a
$lin ~[pat+b+pat.a msg+s+msg.a]
$exp ~[exp+s+exp.a res+a+(turn res.a lank)]
$ire ~[top+s+(scot %uv top.a) sep+(spec sep.a)] ::TODO @uv as number?
$fat ~[tac+(atta tac.a) sep+(spec sep.a)]
$inv ~[inv+b+inv.a cir+(circ cir.a)]
$app ~[app+s+app.a sep+(spec sep.a)]
==
::
++ atta ::> attache
|= a/attache
^- json
%+ frond -.a
?- -.a
$name (pairs nom+s+nom.a tac+(atta tac.a) ~)
$text s+(of-wain:format +.a)
$tank a+(turn +.a lank)
==
::
::> ||
::> || %message-metadata
::> ||
::> structures for containing message metadata
::+|
::
++ audi ::> audience
|= a/audience
^- json
(sa a circ)
--
::
++ dejs ::> json to sur
=, dejs-soft:format
|%
::TODO these first few should maybe make their way
:: into the stdlib...
++ re ::> recursive reparsers
|* {gar/* sef/_|.(fist)}
|= jon/json
^- (unit _gar)
=- ~! gar ~! (need -) -
((sef) jon)
::
++ as ::> array as set
|* a/fist
(cu ~(gas in *(set _(need *a))) (ar a))
::
++ dank ::> tank
^- $-(json (unit tank))
%+ re *tank |. ~+
%- of :~
leaf+sa
palm+(ot style+(ot mid+sa cap+sa open+sa close+sa ~) lines+(ar dank) ~)
rose+(ot style+(ot mid+sa open+sa close+sa ~) lines+(ar dank) ~)
==
::
::> ||
::> || %query-models
::> ||
::> models relating to queries, their results and updates.
::+|
::
++ pici ::> prize-client
^- $-(json (unit prize-client))
%- ot :~
gys+(om (as (as circ)))
nis+(op fed:ag so)
==
::
++ ruci ::> rumor-client
^- $-(json (unit rumor-client))
%- of :~
glyph+digy
nick+dini
==
::
++ pack ::> package
^- $-(json (unit package))
%- ot :~
nes+(ar enve)
cos+loby
pes+crow
==
::
++ digy ::> diff-glyph
^- $-(json (unit diff-glyph))
(ot bin+bo gyf+so aud+audi ~)
::
++ dini ::> diff-nick
^- $-(json (unit diff-nick))
(ot who+(su fed:ag) nic+so ~)
::
++ ruso ::> rumor-story
^- $-(json (unit rumor-story))
%- of :~
new+conf
:: bear not needed
config+(ot cir+circ dif+dico ~)
status+(ot cir+circ who+(su fed:ag) dif+disa ~)
remove+ul
gram+(ot src+circ nev+enve ~)
==
::
++ dico ::> diff-config
^- $-(json (unit diff-config))
%- of :~
full+conf
source+(ot add+bo src+sorc ~)
caption+so
filter+filt
secure+secu
permit+(ot add+bo sis+(as (su fed:ag)) ~)
remove+ul
==
::
++ disa ::> diff-status
^- $-(json (unit diff-status))
%- of :~
full+(ot pec+pres man+huma ~)
presence+pres
human+dihu
remove+ul
==
::
++ dihu ::> diff-human
^- $-(json (unit diff-human))
%- of :~
full+huma
handle+(mu so)
true+(mu trun)
==
::
::> ||
::> || %circles
::> ||
::> messaging targets and their metadata.
::+|
::
::TODO maybe just an object?
++ circ ::> circle
^- $-(json (unit circle))
(su circ:de-tape)
::
++ loby ::> lobby
^- $-(json (unit lobby))
(ot loc+conf rem+(op circ:de-tape conf) ~)
::
++ conf ::> config
^- $-(json (unit config))
%- ot :~
src+(as sorc)
cap+so
fit+filt
con+cont
==
::
::TODO maybe just an object?
++ sorc ::> source
^- $-(json (unit source))
(su sorc:de-tape)
::
++ filt ::> filter
^- $-(json (unit filter))
(ot cas+bo utf+bo ~)
::
++ cont ::> control
^- $-(json (unit control))
(ot sec+secu sis+(as (su fed:ag)) ~)
::
++ secu ::> security
^- $-(json (unit security))
(su (perk %channel %village %journal %mailbox ~))
::
++ crow ::> crowd
^- $-(json (unit crowd))
(ot loc+grop rem+(op circ:de-tape grop) ~)
::
++ grop ::> group
^- $-(json (unit group))
(op fed:ag stat)
::
++ stat ::> status
^- $-(json (unit status))
(ot pec+pres man+huma ~)
::
++ pres ::> presence
^- $-(json (unit presence))
(su (perk %gone %idle %hear %talk ~))
::
++ huma ::> human
^- $-(json (unit human))
(ot han+(mu so) tru+(mu trun) ~)
::
++ trun ::> truename
^- $-(json (unit truename))
(ot fir+so mid+(mu so) las+so ~)
::
::> ||
::> || %message-data
::> ||
::> structures for containing main message data.
::+|
::
++ enve ::> envelope
^- $-(json (unit envelope))
(ot num+ni gam+gram ~)
::
++ gram ::> telegram
^- $-(json (unit telegram))
%- ot :~
aut+(su fed:ag)
::TODO can we do anything about this duplication?
uid+seri
aud+audi
wen+di
sep+spec
==
::
++ thot ::> thought
^- $-(json (unit thought))
%- ot :~
uid+seri
aud+audi
wen+di
sep+spec
==
::
++ spec ::> speech
^- $-(json (unit speech))
%+ re *speech |. ~+
%- of :~
lin+(ot pat+bo msg+so ~)
url+(su aurf:de-purl:html)
exp+eval
ire+(ot top+seri sep+spec ~)
fat+(ot tac+atta sep+spec ~)
inv+(ot inv+bo cir+circ ~)
app+(ot app+so sep+spec ~)
==
::
++ eval ::> %exp speech
::> extract contents of an %exp speech, evaluating
::> the {exp} if there is no {res} yet.
::
|= a/json
^- (unit {cord (list tank)})
=+ exp=((ot exp+so ~) a)
?~ exp ~
:+ ~ u.exp
=+ res=((ot res+(ar dank) ~) a)
?^ res u.res
p:(mule |.([(sell (slap !>(..zuse:old-zuse) (ream u.exp)))]~)) ::TODO oldz
::
++ atta ::> attache
^- $-(json (unit attache))
%+ re *attache |. ~+
%- of :~
name+(ot nom+so tac+atta ~)
text+(cu to-wain:format so)
tank+(ar dank)
==
::
::> ||
::> || %message-metadata
::> ||
:: structures for containing message metadata.
::+|
::
++ seri ::> serial
^- $-(json (unit serial))
(ci (slat %uv) so)
::
++ audi ::> audience
^- $-(json (unit audience))
(as circ)
--
--

200
lib/hall-legacy.hoon Normal file
View File

@ -0,0 +1,200 @@
::
/? 310
/- hall
/+ old-zuse
[old-zuse .]
=>
|%
++ audience (map partner (pair envelope delivery)) :: destination+state
++ bouquet (set flavor) :: complete aroma
++ 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
++ passport :: foreign flow
$% {$twitter p/@t} :: twitter
== ::
++ presence ?($gone $hear $talk) :: status type
++ speech :: narrative action
$% {$lan p/knot 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
{$url p/purf} :: parsed url
{$ire p/serial q/speech} :: in-reply-to
{$lin p/? q/@t} :: no/@ text line
{$mor p/(list speech)} :: multiplex
{$app p/@tas q/@t} :: app message
$: $api :: api message
service/@tas :: service name
id/@t :: id on the service
id-url/purf :: link to id
summary/@t :: summary of event
body/@t :: body of event
url/purf :: link to event
meta/json :: other data for web
== ::
== ::
++ serial @uvH :: unique identity
++ partner (each station passport) :: interlocutor
++ statement (trel @da bouquet speech) :: when this
++ station (pair ship knot) :: 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
== ::
--
|%
++ from-json
=> [jo ..telegram]
|= a/^json ^- (list telegram:hall)
=- %- zing
%+ turn
(need ((ar (ot ship+(su fed:ag) thought+thot ~)) a))
convert-telegram
|%
++ of
|* a/(pole {@tas fist})
|= b/^json
%. ((of:jo a) b)
%- slog
?+ b ~
{$o *}
%+ murn `(list {@tas fist})`a
|= {c/term d/fist} ^- (unit tank)
=+ (~(get by p.b) c)
?~ - ~
=+ (d u)
?~ - (some >[c u]<)
~
==
++ op :: parse keys of map
|* {fel/rule wit/fist}
%+ cu malt
%+ ci
|= a/(map cord _(need *wit))
^- (unit (list _[(wonk *fel) (need *wit)]))
(zl (turn ~(tap by a) (head-rush fel)))
(om wit)
::
++ as :: array as set
|* a/fist
(cu ~(gas in *(set _(need *a))) (ar a))
::
++ ke :: callbacks
|* {gar/* sef/_|.(fist)}
|= jon/^json
^- (unit _gar)
=- ~! gar ~! (need -) -
((sef) jon)
::
++ lake |*(a/_* $-(^json (unit a)))
++ head-rush
|* a/rule
|* {cord *}
=+ nit=(rush +<- a)
?~ nit ~
(some [u.nit +>->])
::
++ thot
^- $-(^json (unit thought))
%- ot :~
serial+`$-(^json (unit serial))`(ci (slat %uv) so)
audience+`$-(^json (unit audience))`audi
statement+`$-(^json (unit statement))`stam
==
::
++ audi `$-(^json (unit audience))`(op parn memb)
++ auri (op parn (ci (soft presence) so))
++ memb ^- $-(^json (unit (pair envelope delivery)))
(ot envelope+lope delivery+(ci (soft delivery) so) ~)
++ lope (ot visible+bo sender+(mu (su parn)) ~)
::
++ parn
^- $-(nail (like partner))
%+ pick
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft passport)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ stam (ot date+di bouquet+(as (ar so)) speech+spec ~)
++ spec
%+ ke *speech |. ~+
%- of :~
lin+(ot say+bo txt+so ~)
url+(ot txt+(su aurf:urlp) ~)
exp+(ot txt+so ~)
app+(ot txt+so src+so ~)
fat+(ot tor+tors taf+spec ~)
ext+(ot nom+so txe+blob ~)
non+ul
mor+(ar spec)
:: inv+(ot ship+(su fed:ag) party+(su urs:ab) ~)
==
++ tors
%+ ke *torso |. ~+
%- of :~
name+(ot nom+so mon+tors ~)
text+(cu to-wain:format so)
tank+(ot dat+(cu (hard (list tank)) blob) ~)
==
::
++ blob (cu cue (su fel:ofis))
::
::
++ convert-telegram
|= t/telegram
^- (list telegram:hall)
=+ aud=(convert-audience q.q.t)
%+ turn (convert-speech r.r.q.t)
|= s/speech:hall
[p.t p.q.t aud p.r.q.t s]
::
++ convert-audience
|= a/audience
^- audience:hall
%- sy
^- (list circle:hall)
%+ murn ~(tap in ~(key by a))
|= p/partner
^- (unit circle:hall)
?- -.p
$& :+ ~ p.p.p
?: ?| =(q.p.p 'porch')
=(q.p.p 'court')
=(q.p.p 'floor')
==
%inbox
q.p.p
$| ~
==
::
++ convert-speech
|= s/speech
^- (list speech:hall)
?+ -.s ~&([%ignoring -.s] ~)
$lin [%lin !p.s q.s]~
$url [%url p.s]~
$exp [%exp p.s ~]~
$ire %+ turn (convert-speech q.s)
|= i/speech:hall
[%ire p.s i]
$app [%app p.s [%lin | q.s]]~
$fat ?: &(?=($exp -.q.s) ?=($tank -.p.s))
[%exp p.q.s +.p.s]~
=+ ses=(convert-speech q.s)
=? ses =(0 (lent ses)) [%lin | '']~
[[%fat p.s (snag 0 ses)] (slag 1 ses)]
$mor (zing (turn p.s convert-speech))
==
--
--

239
lib/hall.hoon Normal file
View File

@ -0,0 +1,239 @@
::
:::: /lib/hall/hoon
::
/- hall
::
::::
::
[. ^hall]
|_ bol/bowl:gall
::
::TODO add to zuse?
++ true-self
|= who/ship
?. ?=($earl (clan:title who)) who
(sein:title who)
::
++ above
|= who/ship
?: ?=($czar (clan:title who)) ~zod
(sein:title who)
::
++ said-url :: app url
|= url/purl:eyre
:^ ost.bol %poke /said-url
:+ [our.bol %hall] %hall-action
^- action
:+ %phrase
[[our.bol %inbox] ~ ~]
[%app dap.bol %lin | (crip (en-purl:html url))]~ :: XX
::
++ said :: app message
|= mes/(list tank)
:- %hall-action
^- action
:- %phrase
:- [[our.bol %inbox] ~ ~]
|- ^- (list speech)
?~ mes ~
:_ $(mes t.mes)
^- speech
[%app dap.bol %lin | (crip ~(ram re i.mes))]
::
++ uniq
^- {serial _eny.bol}
[(shaf %serial eny.bol) (shax eny.bol)]
::
++ range-to-path ::< msg range to path
::> turns a range structure into a path used for
::> subscriptions.
::
|= ran/range
^- path
?~ ran ~
%+ welp
/(scot -.hed.u.ran +.hed.u.ran)
?~ tal.u.ran ~
/(scot -.u.tal.u.ran +.u.tal.u.ran)
::
++ path-to-range ::< path to msg range
::> turns the tail of a subscription path into a
::> range structure, skipping over non-range terms.
::
|= pax/path
^- range
?~ pax ~
:: skip past non-number parts of path.
?: ?=({$~ $~} [(slaw %da i.pax) (slaw %ud i.pax)])
$(pax t.pax)
:+ ~
=+ hed=(slaw %da i.pax)
?^ hed [%da u.hed]
[%ud (slav %ud i.pax)]
?~ t.pax ~
:- ~
=+ tal=(slaw %da i.t.pax)
?^ tal [%da u.tal]
[%ud (slav %ud i.t.pax)]
::
++ change-glyphs ::< ...
::>
::
|= {gys/(jug char audience) bin/? gyf/char aud/audience}
^+ gys
:: simple bind.
?: bin (~(put ju gys) gyf aud)
:: unbind all of glyph.
?~ aud (~(del by gys) gyf)
:: unbind single.
(~(del ju gys) gyf aud)
::
++ change-nicks ::< change nick map
::> changes a nickname in a map, adding if it doesn't
::> yet exist, removing if the nickname is empty.
::
|= {nis/(map ship cord) who/ship nic/cord}
^+ nis
?: =(nic '')
(~(del by nis) who)
(~(put by nis) who nic)
::
++ change-config ::< apply config diff
::> applies a config diff to the given config.
::
|= {cof/config dif/diff-config}
^+ cof
?- -.dif
$full cof.dif
$caption cof(cap cap.dif)
$filter cof(fit fit.dif)
$remove cof
::
$source
%= cof
src
%. src.dif
?: add.dif
~(put in src.cof)
~(del in src.cof)
==
::
$permit
%= cof
sis.con
%. sis.dif
?: add.dif
~(uni in sis.con.cof)
~(dif in sis.con.cof)
==
::
$secure
%= cof
sec.con
sec.dif
::
sis.con
?. .= ?=(?($white $green) sec.dif)
?=(?($white $green) sec.con.cof)
~
sis.con.cof
==
==
::
++ change-status ::< apply status diff
::> applies a status diff to the given status.
::
|= {sat/status dif/diff-status}
^+ sat
?- -.dif
$full sat.dif
$presence sat(pec pec.dif)
$remove sat
::
$human
%= sat
man
?- -.dif.dif
$full man.dif.dif
$true [han.man.sat tru.dif.dif]
$handle [han.dif.dif tru.man.sat]
==
==
==
::
::TODO annotate all!
++ depa :: de-pathing core
=> |% ++ grub * :: result
++ weir (list coin) :: parsed wire
++ fist $-(weir grub) :: reparser instance
--
|%
::
++ al
|* {hed/$-(coin *) tal/fist}
|= wir/weir ^+ [*hed *tal]
?~ wir !!
[(hed i.wir) (tal t.wir)]
::
++ at
|* typ/{@tas (pole @tas)}
=+ [i-typ t-typ]=typ
|= wer/weir
^- (tup:dray:wired i-typ t-typ) ::< ie, (tup %p %tas ~) is {@p @tas}
?~ wer !!
?~ t-typ
?^ t.wer !!
((do i-typ) i.wer)
:- ((do i-typ) i.wer)
(^$(typ t-typ) t.wer)
::
++ mu :: true unit
|* wit/fist
|= wer/weir
?~(wer ~ (some (wit wer)))
::
++ af :: object as frond
|* buk/(pole {cord fist})
|= wer/weir
?> ?=({{$$ $tas @tas} *} wer)
?~ buk !!
=+ [[tag wit] t-buk]=buk
?: =(tag q.p.i.wer)
[tag ~|(tag+`@tas`tag (wit t.wer))]
?~ t-buk ~|(bad-tag+`@tas`q.p.i.wer !!)
(^$(buk t-buk) wer)
::
++ or
=+ tmp=|-($@(@tas {@tas $})) ::TODO typ/that syntax-errors...
|* typ/tmp
|= con/coin
::^- _(snag *@ (turn (limo typ) |*(a/@tas [a (odo:raid:wired a)])))
?> ?=($$ -.con)
=/ i-typ ?@(typ typ -.typ)
?: =(i-typ p.p.con)
:- i-typ
^- (odo:raid:wired i-typ)
q.p.con
?@ typ ~|(%bad-odor !!)
(^$(typ +.typ) con)
::
++ do
|* typ/@tas
=/ typecheck `@tas`typ
|= con/coin
^- (odo:raid:wired typ)
?. ?=($$ -.con) ~|(%not-dime !!)
?. =(typ p.p.con) ~|(bad-odor+`@tas`p.p.con !!)
q.p.con
::
++ ul :: null
|=(wer/weir ?~(wer ~ !!))
::
++ un
|* wit/$-(coin *)
|= wer/weir ^+ *wit
?~ wer !!
?^ t.wer !!
(wit i.wer)
--
--

View File

@ -2,7 +2,7 @@
:::: /hoon/drum/hood/lib :: ::
:: :: ::
/? 310 :: version
/- sole
/- sole, hall
/+ sole
[. ^sole]
:: :: ::
@ -79,8 +79,8 @@
^- (list well:gall)
=+ myr=(clan:title our)
?: ?=($pawn myr)
[[%base %talk] [%base %dojo] ~]
[[%home %talk] [%home %dojo] ~]
[[%base %hall] [%base %talk] [%base %dojo] ~]
[[%home %hall] [%home %talk] [%home %dojo] ~]
::
++ deft-fish :: default connects
|= our/ship
@ -119,7 +119,7 @@
=> |% :: arvo structures
++ pear :: request
$% {$sole-action p/sole-action} ::
{$talk-command command:talk} ::
{$hall-command command:hall} ::
== ::
++ lime :: update
$% {$dill-blit dill-blit:dill} ::
@ -350,7 +350,7 @@
++ se-dump :: print tanks
|= tac/(list tank)
^+ +>
?. se-ably (se-talk tac)
?. se-ably (se-hall tac)
=/ wol/wall
(zing (turn (flop tac) |=(a/tank (~(win re a) [0 edg]))))
|- ^+ +>.^$
@ -427,13 +427,13 @@
|= mov/move
%_(+> moz [mov moz])
::
++ se-talk
++ se-hall
|= tac/(list tank)
^+ +>
:: XX talk should be usable for stack traces, see urbit#584 which this change
:: XX hall should be usable for stack traces, see urbit#584 which this change
:: closed for the problems there
((slog (flop tac)) +>)
::(se-emit 0 %poke /drum/talk [our.hid %talk] (said:talk our.hid %drum now.hid eny.hid tac))
::(se-emit 0 %poke /drum/hall [our.hid %hall] (said:hall our.hid %drum now.hid eny.hid tac))
::
++ se-text :: return text
|= txt/tape
@ -441,7 +441,7 @@
?. ((sane %t) (crip txt)) :: XX upstream validation
~& bad-text+<`*`txt>
+>
?. se-ably (se-talk [%leaf txt]~)
?. se-ably (se-hall [%leaf txt]~)
(se-blit %out (tuba txt))
::
++ se-poke :: send a poke

View File

@ -3,7 +3,6 @@
:: :: ::
/? 310 :: version
/- sole
/+ talk
[. sole]
:: :: ::
:::: :: ::
@ -59,7 +58,6 @@
++ move (pair bone card) :: user-level move
++ pear :: poke fruit
$% {$hood-unsync desk ship desk} ::
{$talk-command command:talk} ::
{$ask-mail cord} ::
{$helm-hi cord} ::
== ::
@ -163,12 +161,6 @@
=+ fil=.^(@ %cx (welp way /hoon))
[%flog /reload [%veer ?:(=('z' tip) %$ tip) way fil]]
::
++ poke-invite :: send invite; fake
|= {who/@p myl/@t} =< abet
%^ emit %poke /helm/invite
:- [our %talk]
(said:talk our %helm now eny [%leaf "invited: {<who>} at {(trip myl)}"]~)
::
++ poke-reset :: reset system
|= hood-reset =< abet
%- emil

View File

@ -73,7 +73,7 @@
{$warp wire sock riff} ::
== ::
++ pear :: poke fruit
$% {$talk-command command:talk} ::
$% {$hall-command command:hall} ::
{$kiln-merge kiln-merge} ::
{$helm-reload (list term)} ::
{$helm-reset $~} ::
@ -329,7 +329,7 @@
|= mes/(list tank)
((slog mes) ..spam)
:: %- emit :: XX not displayed/immediately
:: [%poke /kiln/spam [our %talk] (said our %kiln now eny mes)]
:: [%poke /kiln/spam [our %hall] (said our %kiln now eny mes)]
::
++ auto
|= kiln-sync

View File

@ -2,7 +2,7 @@
:::: /hoon/womb/hood/lib :: ::
:: :: ::
/? 310 :: version
/+ talk, old-phon
/+ hall, old-phon
=, wired
=, title
:: :: ::
@ -75,7 +75,7 @@
== ::
++ welcome :: welcome message
$: intro/tape :: in invite email
hello/tape :: as talk message
hello/tape :: as hall message
== ::
++ reference :: affiliate credit
(unit (each @p mail)) :: ship or email

View File

@ -1,45 +0,0 @@
::
:::: /hoon/talk/lib
::
:: This file is in the public domain.
::
/? 310
/- talk
::
::::
::
[. ^talk]
|_ bol/bowl:gall
++ main :: main story
|= our/ship ^- cord
=+ can=(clan:title our)
?+ can %porch
$czar %court
$king %floor
==
::
++ said-url :: app url
|= url/purl:eyre
:^ ost.bol %poke /said-url
:+ [our.bol %talk] %talk-command
^- command
:- %publish
:_ ~
^- thought
:+ (shaf %thot eny.bol)
[[[%& our.bol (main our.bol)] [*envelope %pending]] ~ ~]
[now.bol *bouquet [%app dap.bol (crip (en-purl:html url))]] :: XX
::
++ said :: app message
|= {our/@p dap/term now/@da eny/@uvJ mes/(list tank)}
:- %talk-command
^- command
:- %publish
|- ^- (list thought)
?~ mes ~
:_ $(mes t.mes, eny (sham eny mes))
^- thought
:+ (shaf %thot eny)
[[[%& our (main our)] [*envelope %pending]] ~ ~]
[now *bouquet [%app dap (crip ~(ram re i.mes))]]
--

View File

@ -1,5 +1,5 @@
::
:::: /hoon/comment/talk/mar
:::: /mar/fora/comment/hoon
::
/? 310
/+ old-zuse

View File

@ -1,5 +1,5 @@
::
:::: /hoon/fora-post/talk/mar
:::: /mar/fora/post/hoon
::
/? 310
/+ old-zuse

View File

@ -1,12 +1,12 @@
:: Converts the result of an 'issues' event into a issues:gh.
/- gh
/+ gh-parse, talk, old-zuse
/+ gh-parse, hall, old-zuse
=, old-zuse
|_ issue-comment/issue-comment:gh
++ grow
|%
++ talk-speeches
^- (list speech:talk)
++ hall-speeches
^- (list speech:hall)
:_ ~
=+ ^= txt
;: (cury cat 3)

View File

@ -1,12 +1,12 @@
:: Converts the result of an 'issues' event into a issues:gh.
/- gh
/+ gh-parse, talk, old-zuse
/+ gh-parse, hall, old-zuse
=, old-zuse
|_ issues/issues:gh
++ grow
|%
++ talk-speeches
^- (list speech:talk)
++ hall-speeches
^- (list speech:hall)
:_ ~
=+ ^= txt
?- -.action.issues
@ -78,7 +78,7 @@
title.issue.issues
==
==
^- speech:talk
^- speech:hall
:* %api %github
login.sender.issues
(rash html-url.sender.issues aurf:urlp)

66
mar/hall/action.hoon Normal file
View File

@ -0,0 +1,66 @@
::
:::: /mar/hall/action/hoon
::
/- hall
/+ hall-json
::
|_ act/action:hall
::
++ grab ::> convert from
|%
++ noun action:hall ::< from %noun
++ json ::> from %json
=> [. dejs:hall-json] ::TODO =,
=, dejs-soft:format
|= a/json
^- action:hall
=- (need ((of -) a))
:~ create+(ot nom+so des+so sec+secu ~)
delete+(ot nom+so why+(mu so) ~)
depict+(ot nom+so des+so ~)
filter+(ot nom+so fit+filt ~)
permit+(ot nom+so inv+bo sis+(as (su fed:ag)) ~)
source+(ot nom+so sub+bo srs+(as sorc) ~)
::
convey+(ar thot)
phrase+(ot aud+audi ses+(ar spec:dejs:hall-json) ~)
::
notify+(ot aud+audi pes+(mu pres) ~)
naming+(ot aud+audi man+huma ~)
::
glyph+(ot gyf+so aud+audi bin+bo ~)
nick+(ot who+(su fed:ag) nic+so ~)
::
public+(ot add+bo cir+circ ~)
==
--
::
++ grow ::> convert to
|%
++ json ::> to %json
=> [. enjs:hall-json] ::TODO =,
=, enjs:format
%+ frond -.act
::> only %convey has just a single piece of data.
?: ?=($convey -.act) a+(turn tos.act thot)
%- pairs
?- -.act
$create ~[nom+s+nom.act des+s+des.act sec+s+sec.act]
$delete ~[nom+s+nom.act why+(mabe why.act cord:enjs)]
$depict ~[nom+s+nom.act des+s+des.act]
$filter ~[nom+s+nom.act fit+(filt fit.act)]
$permit ~[nom+s+nom.act inv+b+inv.act sis+(sa sis.act ship)]
$source ~[nom+s+nom.act sub+b+sub.act srs+(sa srs.act sorc)]
::
$phrase ~[aud+(audi aud.act) ses+a+(turn ses.act spec:enjs)]
::
$notify ~[aud+(audi aud.act) pes+(mabe pes.act cord:enjs)]
$naming ~[aud+(audi aud.act) man+(huma man.act)]
::
$glyph ~[gyf+s+gyf.act aud+(sa aud.act circ) bin+b+bin.act]
$nick ~[who+(ship who.act) nic+s+nic.act]
::
$public ~[add+b+add.act cir+(circ cir.act)]
==
--
--

15
mar/hall/command.hoon Normal file
View File

@ -0,0 +1,15 @@
::
:::: /mar/hall/command/hoon
::
/? 310
/- hall
/+ hall-json
::
=, hall
|_ cod/command
::
++ grab :: convert from
|%
++ noun command :: from %noun
--
--

42
mar/hall/prize.hoon Normal file
View File

@ -0,0 +1,42 @@
::
:::: /mar/hall/prize/hoon
::
/- hall
/+ hall-json
::
|_ piz/prize:hall
::
++ grab ::> convert from
|%
++ noun prize:hall ::< from %noun
++ json ::> from %json
=> [. dejs:hall-json] ::TODO =,
=, dejs-soft:format
|= a/json
^- prize:hall
=- (need ((of -) a))
:~ client+pici
circles+(as so)
public+(as circ)
:: burden not needed
:: report not needed
circle+pack
==
--
::
++ grow ::> convert to
|%
++ json ::> to %json
=> [. enjs:hall-json] ::TODO =,
=, enjs:format
%+ frond -.piz
?+ -.piz !!
$client (pici +.piz)
$circles (sa cis.piz cord:enjs:hall-json)
$public (sa cis.piz circ)
:: burden not needed
:: report not needed
$circle (pack +.piz)
==
--
--

40
mar/hall/rumor.hoon Normal file
View File

@ -0,0 +1,40 @@
::
:::: /mar/hall/rumor/hoon
::
/- hall
/+ hall-json
::
|_ rum/rumor:hall
::
++ grab ::> convert from
|%
++ noun rumor:hall ::< from %noun
++ json ::> from %json
=> [. dejs:hall-json] ::TODO =,
=, dejs-soft:format
|= a/json
^- rumor:hall
=- (need ((of -) a))
:~ client+ruci
circles+(ot add+bo cir+so ~)
public+(ot add+bo cir+circ ~)
:: burden not needed
circle+ruso
==
--
::
++ grow ::> convert to
|%
++ json ::> to %json
=> [. enjs:hall-json] ::TODO =,
=, enjs:format
%+ frond -.rum
?+ -.rum !!
$client (ruci rum.rum)
$circles (pairs add+b+add.rum cir+s+cir.rum ~)
$public (pairs add+b+add.rum cir+(circ cir.rum) ~)
:: burden not needed
$circle (ruso rum.rum)
==
--
--

View File

@ -1,11 +1,11 @@
::
:::: /hoon/speeches/talk/mar
:::: /mar/hall/speeches/hoon
::
/? 310
/- talk
/+ talk,map-to-json
/- hall
/+ hall,map-to-json
::
=+ talk
=+ hall
|_ gam/(list speech)
::
++ grab
@ -15,7 +15,7 @@
::
++ grad
|%
++ form %talk-speeches
++ form %hall-speeches
++ diff |=((list speech) +<)
++ pact |=((list speech) +<)
++ join |=({(list speech) (list speech)} `(unit mime)`~)

41
mar/hall/telegrams.hoon Normal file
View File

@ -0,0 +1,41 @@
::
:::: /mar/hall/telegrams/hoon
::
/- hall
/+ hall-json
::
|_ gaz/(list telegram:hall)
::
++ grab ::> convert from
|%
++ noun (list telegram:hall) ::< from %noun
::
++ mime ::> from %mime
|= ^mime
(json (rash q.q apex:de-json:html))
::
++ json ::> from %json
=, dejs-soft:format
|= a/json
^- (list telegram:hall)
(need ((ar gram:dejs:hall-json) a))
--
::
++ grow ::> convert to
|%
++ mime ::> to %mime
:- /text/json
(as-octs:mimes:html (crip (en-json:html json)))
::
++ json a+(turn gaz gram:enjs:hall-json) ::< to %json
--
::
++ grad
|%
++ form %hall-telegrams
++ diff |=((list telegram:hall) +<)
++ pact |=((list telegram:hall) +<)
++ join |= {(list telegram:hall) (list telegram:hall)}
`(unit mime)`~
--
--

View File

@ -1,127 +0,0 @@
::
:::: /hoon/command/talk/mar
::
/? 310
/- talk
/+ old-zuse
::
=, talk
|_ cod/command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=, old-zuse
=, jo
|= 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 malt
%+ ci
|= a/(map cord _(need *wit))
=, unity
^- (unit (list _[(wonk *fel) (need *wit)]))
(drop-list (turn ~(tap by a) (head-rush fel)))
(om wit)
::
++ ke :: callbacks
|* {gar/* sef/_|.(fist)}
|= jon/json
^- (unit _gar)
=- ~! gar ~! (need -) -
((sef) jon)
::
++ as :: array as set
|* a/fist
(cu ~(gas in *(set _(need *a))) (ar 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
|* {cord *}
=+ nit=(rush +<- a)
?~ nit ~
(some [u.nit +>->])
::
::
++ thot
^- $-(json (unit thought))
%- ot :~
serial+ceri
audience+audi
statement+stam
==
::
++ ceri
^- $-(json (unit serial))
(ci (slat %uv) so)
::
++ audi
^- $-(json (unit audience))
(op parn memb)
::
++ 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}
::
++ speech-or-eval $?(speech {$eval p/@t} {$mor p/(list speech-or-eval)})
++ eval
|= a/(trel @da bouquet speech-or-eval)
^- statement
%= a r ^- speech
|-
?: ?=($mor -.r.a)
[%mor (turn p.r.a |=(b/speech-or-eval ^$(r.a b)))]
?. ?=($eval -.r.a) r.a
=- [%fat tank+- %exp p.r.a]
=+ pax=[&1:% &2:% (scot %da p.a) |3:%]
p:(mule |.([(sell (slap !>(..zuse) (rain pax p.r.a)))]~))
==
::
++ stam
^- $-(json (unit statement))
%+ cu eval
(ot date+di bouquet+(as (ar so)) speech+spec ~)
::
++ spec
%+ ke *speech-or-eval |.
%- of
:~ lin+(ot say+bo txt+so ~)
url+(su aurf:urlp)
eval+so
mor+(ar spec)
:: 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

@ -1,150 +0,0 @@
::
:::: /hoon/report/talk/mar
::
/? 310
/- talk
/+ talk, old-zuse
::
=, talk
=, mimes:html
=, html
=, format
=, old-zuse
|_ rep/report
::
++ grab :: convert from
|%
++ noun report :: clam from %noun
--
++ grow
|%
++ mime [/text/json (as-octs (crip (en-json json)))]
++ json
=> +
|^ %+ joba -.rep
?- -.rep
$cabal (cabl +.rep)
$house a+(turn ~(tap by +.rep) jose)
$glyph ((jome |=(a/char a) nack) +.rep)
$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/knot [%s a])
++ jose
|= {a/knot 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 (jape (of-wall (wash 0^80 a))))
++ jode |=(a/time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
++ 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)])
::
::
++ nack |=(a/(set (set partner)) [%a (turn ~(tap in a) sorc)])
++ 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/knot s+c))))
::
++ parn
|= a/partner ^- cord
?- -.a
$& (stat p.a)
$| %- crip
?- -.p.a
$twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
==
::
++ stat
|= a/station ^- cord
(crip "{<p.a>}/{(trip q.a)}")
::
++ stam
|= statement
(jobe date+(jode p) bouquet+(bouq q) speech+(spec r) ~)
::
++ spec
|= a/speech
%+ joba -.a
?+ -.a ~|(stub+-.a !!)
$lin (jobe txt+[%s q.a] say+[%b p.a] ~)
$url (joba txt+[%s (crip (earf p.a))])
$exp (joba txt+[%s p.a])
$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
id-url+s+(crip (earf id-url.a))
summary+s+summary.a
body+s+body.a
url+s+(crip (earf url.a))
meta+meta.a
==
:: %inv (jobe ship+(jope p.a) party+[%s q.a] ~)
==
::
++ tors
|= a/torso
%+ joba -.a
?- -.a
$text [%s (of-wain +.a)]
$tank [%a (turn +.a joke)]
$name (jobe nom+s+p.a mon+$(a 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] ~)
~
::
++ cabl
|= cabal
%- jobe :~
loc+(conf loc)
ham+((jome stat conf) ham)
==
::
++ sorc
|= a/(set partner) ^- json
[%a (turn ~(tap in a) |=(b/partner s+(parn b)))]
::
++ conf
|= config
%- jobe :~
sources+(sorc sources)
caption+[%s caption]
=- cordon+(jobe posture+[%s -.cordon] list+[%a -] ~)
(turn ~(tap in q.cordon) jope) :: XX jase
==
--
-- --

View File

@ -1,191 +0,0 @@
::
:::: /hoon/telegrams/talk/mar
::
/? 310
/- talk
/+ talk, map-to-json, old-zuse
::
=, talk
=, mimes:html
=, format
=, html
=, old-zuse
|_ gam/(list telegram)
::
++ grab
|%
++ noun (list telegram)
++ mime |=(^mime (json (rash q.q apex:de-json)))
++ json
=> [dejs talk old-zuse]
|= a/json ^- (list telegram)
%. a
|^ (ar (ot ship+(su fed:ag) thought+thot ~))
:: ++ of
:: |* a/(pole {@tas fist})
:: |= b/json
:: %. ((of:jo a) b)
:: %- slog
:: ?+ b ~
:: {$o *}
:: %+ murn `(list {@tas fist})`a
:: |= {c/term d/fist} ^- (unit tank)
:: =+ (~(get by p.b) c)
:: ?~ - ~
:: =+ (d u)
:: ?~ - (some >[c u]<)
:: ~
:: ==
::
++ as :: array as set
|* a/fist
(cu ~(gas in *(set _*a)) (ar a))
::
++ ke :: callbacks
|* {gar/* sef/_|.(fist)}
|= jon/json
^+ gar
=- ~! gar ~! (need -) -
((sef) jon)
::
++ head-rush
|* a/rule
|* {cord *}
=+ nit=(rush +<- a)
?~ nit ~
(some [u.nit +>->])
::
++ thot
^- $-(json thought)
%- ot :~
serial+`$-(json serial)`(ci (slat %uv) so)
audience+`$-(json audience)`audi
statement+`$-(json statement)`stam
==
::
++ audi `$-(json audience)`(op parn memb)
++ auri (op parn (ci (soft presence) so))
++ memb ^- $-(json (pair envelope delivery))
(ot envelope+lope delivery+(cu (hard delivery) so) ~)
++ lope (ot visible+bo sender+(mu (su parn)) ~)
::
++ parn
^- $-(nail (like partner))
%+ pick
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft passport)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ stam (ot date+di bouquet+(as (ar so)) speech+spec ~)
++ spec
%+ ke *speech |. ~+
%- of :~
lin+(ot say+bo txt+so ~)
url+(ot txt+(su aurf:urlp) ~)
exp+(ot txt+so ~)
app+(ot txt+so src+so ~)
fat+(ot tor+tors taf+spec ~)
ext+(ot nom+so txe+blob ~)
non+ul
mor+(ar spec)
:: inv+(ot ship+(su fed:ag) party+(su urs:ab) ~)
==
++ tors
%+ ke *torso |. ~+
%- of :~
name+(ot nom+so mon+tors ~)
text+(cu to-wain so)
tank+(ot dat+(cu (hard (list tank)) blob) ~)
==
::
++ blob (cu cue (su fel:ofis))
--
--
::
++ grow
|%
++ mime [/text/json (as-octs (crip (en-json json)))]
++ json
=> +
|^
:- %a
%+ turn gam
|= telegram
(jobe ship+(jope p) thought+(thot q) ~)
::
++ 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 (jape (of-wall (wash 0^80 a))))
++ jode |=(a/time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1)))
::
++ thot
|= thought
(jobe serial+(jape <p>) audience+(audi q) statement+(stam r) ~)
::
++ audi (map-to-json parn jove)
++ bouq
|= a/bouquet
a+(turn ~(tap in a) |=(b/path a+(turn b |=(c/knot s+c))))
::
++ parn
|= a/partner ^- cord
?- -.a
$& (stat p.a)
$| %- crip
?- -.p.a
$twitter "{(trip -.p.a)}/{(trip p.p.a)}"
==
==
::
++ stat
|= a/station ^- cord
(crip "{<p.a>}/{(trip q.a)}")
::
++ stam
|= statement
(jobe date+(jode p) bouquet+(bouq q) speech+(spec r) ~)
::
++ spec
|= a/speech
%+ joba -.a
?+ -.a ~|(stub+-.a !!)
$lin (jobe txt+[%s q.a] say+[%b p.a] ~)
$url (joba txt+(jape (earf p.a)))
$exp (joba txt+[%s p.a])
$app (jobe txt+[%s q.a] src+[%s p.a] ~)
$fat (jobe tor+(tors p.a) taf+$(a q.a) ~)
$ext (jobe nom+[%s p.a] txe+(jape (sifo (jam +.a))) ~)
$non ~
$mor :- %a
|- ^- (list json)
?~ p.a ~
[^$(a i.p.a) $(p.a t.p.a)]
:: $inv (jobe ship+(jope p.a) party+[%s q.a] ~)
==
::
++ tors
|= a/torso
%+ joba -.a
?- -.a
$text [%s (of-wain +.a)]
$tank (jobe txt+[%a (turn +.a joke)] dat+(jape (sifo (jam +.a))) ~)
$name (jobe nom+s+p.a mon+$(a q.a) ~)
==
::
--
--
::
++ grad
|%
++ form %talk-telegrams
++ diff |=((list telegram) +<)
++ pact |=((list telegram) +<)
++ join |=({(list telegram) (list telegram)} `(unit mime)`~)
--
--

View File

@ -2,7 +2,7 @@
::
:::: /hoon/feed/twit/mar
::
/- talk
/- hall
/+ twitter, httr-to-json, old-zuse
=, old-zuse
=, format
@ -16,10 +16,10 @@
++ grow
|%
++ tank >[fed]<
++ talk-speeches
++ hall-speeches
=+ r=render:twitter
%+ turn fed
|= a/post:twitter ^- speech:talk
|= a/post:twitter ^- speech:hall
:* %api %twitter
who.a
(user-url.r who.a)

259
sur/hall.hoon Normal file
View File

@ -0,0 +1,259 @@
::
:::: /sur/hall/hoon
::
|%
::
::TODO use different words for different kinds of burdens
::TODO rename det/delta in most place? they may be (different kinds of) deltas,
:: but location in control flow already indicates delta-ness.
::
::> ||
::> || %wrappers
::> ||
::> wrapper molds, for semantic clarity.
::+|
::
::TODO rename
++ naem term ::< circle name
++ nick cord ::< local nickname
::
::> ||
::> || %query-models
::> ||
::> models relating to queries, their results and updates.
::+|
::
++ query ::> query paths
$% {$client $~} ::< shared ui state
{$circles who/ship} ::< readable circles
{$public $~} ::< public memberships
{$burden who/ship} ::TODO eventually, nom/naem. ::< duties to share
{$report $~} ::< duty reports
{$peers nom/naem} ::< readers of story
$: $circle ::> story query
nom/naem ::< circle name
wer/(unit circle) ::< from source
wat/(set circle-data) ::< data to get
ran/range ::< query duration
== ::
::TODO in the future, we may want much more ::
:: detailed querying abilities. ::
== ::
++ circle-data ::> kinds of circle data
$? $grams ::< messages
$group-l ::< local presence
$group-r ::< remote presences
$config-l ::< local config
$config-r ::< remote configs
== ::
++ range ::> inclusive msg range
%- unit ::< ~ means everything
$: hed/place ::< start of range
tal/(unit place) ::< opt end of range
== ::
++ place ::> range indicators
$% {$da @da} ::< date
{$ud @ud} ::< message number
== ::
++ prize ::> query result
$% {$client prize-client} ::< /client
{$circles cis/(set naem)} ::< /circles
{$public cis/(set circle)} ::< /public
{$burden sos/(map naem burden)} ::< /burden
{$report $~} ::< /report
{$peers pes/(jar ship query)} ::< /peers
{$circle package} ::< /circle
== ::
++ prize-client ::> shared ui state
$: gys/(jug char audience) ::< glyph bindings
nis/(map ship nick) ::< local nicknames
== ::
++ rumor ::> query result change
$% {$client rum/rumor-client} ::< /client
{$circles add/? cir/naem} ::< /circles
{$public add/? cir/circle} ::< /public
{$burden nom/naem rum/rumor-story} ::< /burden
{$peers add/? who/ship qer/query} ::< /peers
{$circle rum/rumor-story} ::< /circle
== ::
++ rumor-client ::> changed ui state
$% {$glyph diff-glyph} ::< un/bound glyph
{$nick diff-nick} ::< changed nickname
== ::
++ shipment ::> standard payload
$: cos/lobby ::< loc & rem configs
pes/crowd ::< loc & rem presences
== ::
++ burden ::> full story state
$: gaz/(list telegram) ::< all messages
shipment ::< metadata
== ::
++ package ::> story state
$: nes/(list envelope) ::< messages
shipment ::< metadata
== ::
++ diff-glyph {bin/? gyf/char aud/audience} ::< un/bound glyph
++ diff-nick {who/ship nic/nick} ::< changed nickname
++ diff-story ::> story change
$% {$new cof/config} ::< new story
{$bear bur/burden} ::< new inherited story
{$peer add/? who/ship qer/query} ::< gain/lose subscriber
{$config cir/circle dif/diff-config} ::< new/changed config
{$status cir/circle who/ship dif/diff-status} ::< new/changed status
{$remove $~} ::< removed story
== ::
++ rumor-story ::> story rumor
$? diff-story ::< both in & outward
$% {$gram src/circle nev/envelope} ::< new/changed message
== == ::
++ diff-config ::> config change
$% {$full cof/config} ::< set w/o side-effects
{$source add/? src/source} ::< add/rem sources
{$caption cap/cord} ::< changed description
{$filter fit/filter} ::< changed filter
{$secure sec/security} ::< changed security
{$permit add/? sis/(set ship)} ::< add/rem to b/w-list
{$remove $~} ::< removed config
== ::
++ diff-status ::> status change
$% {$full sat/status} ::< fully changed status
{$presence pec/presence} ::< changed presence
{$human dif/diff-human} ::< changed name
{$remove $~} ::< removed status
== ::
++ diff-human ::> name change
$% {$full man/human} ::< fully changed name
{$handle han/(unit cord)} ::< changed handle
{$true tru/(unit truename)} ::< changed true name
== ::
::
::> ||
::> || %client-communication
::> ||
::> hall interfaces for clients.
::+|
::
++ action ::> user action
$% :: circle configuration ::
{$create nom/naem des/cord sec/security} ::< create circle
{$delete nom/naem why/(unit cord)} ::< delete + announce
{$depict nom/naem des/cord} ::< change description
{$filter nom/naem fit/filter} ::< change message rules
{$permit nom/naem inv/? sis/(set ship)} ::< invite/banish
{$source nom/naem sub/? srs/(set source)} ::< un/sub to/from src
:: messaging ::
{$convey tos/(list thought)} ::< post exact
{$phrase aud/audience ses/(list speech)} ::< post easy
:: personal metadata ::
{$notify aud/audience pes/(unit presence)} ::< our presence update
{$naming aud/audience man/human} ::< our name update
:: changing shared ui ::
{$glyph gyf/char aud/audience bin/?} ::< un/bind a glyph
{$nick who/ship nic/nick} ::< new identity
:: misc changes ::
{$public add/? cir/circle} ::< show/hide membership
== ::
::
::> ||
::> || %hall-communication
::> ||
::> structures for communicating between halls.
::+|
::
++ command ::> effect on story
$% {$publish tos/(list thought)} ::< deliver
{$present nos/(set naem) dif/diff-status} ::< status update
{$bearing $~} ::< prompt to listen
== ::
::
::> ||
::> || %circles
::> ||
::> messaging targets and their metadata.
::+|
::
++ circle {hos/ship nom/naem} ::< native target
:: circle configurations. ::
++ lobby {loc/config rem/(map circle config)} ::< our & srcs configs
++ config ::> circle config
$: src/(set source) ::< active sources
cap/cord ::< description
fit/filter ::< message rules
con/control ::< restrictions
== ::
++ source {cir/circle ran/range} ::< subscription target
++ filter ::> content filters
$: cas/? ::< dis/allow capitals
utf/? ::< dis/allow non-ascii
::TODO maybe message length
== ::
++ control {sec/security sis/(set ship)} ::< access control
++ security ::> security mode
$? $channel ::< blacklist
$village ::< whitelist
$journal ::< pub r, whitelist w
$mailbox ::< our r, blacklist w
== ::
:: participant metadata. ::
++ crowd {loc/group rem/(map circle group)} ::< our & srcs presences
++ group (map ship status) ::< presence map
++ status {pec/presence man/human} ::< participant
++ presence ::> status type
$? $gone ::< absent
$idle ::< idle
$hear ::< present
$talk ::< typing
== ::
++ human ::> human identifier
$: han/(unit cord) ::< handle
tru/(unit truename) ::< true name
== ::
++ truename {fir/cord mid/(unit cord) las/cord} ::< real-life name
::
::> ||
::> || %message-data
::> ||
::> structures for containing main message data.
::+|
::
::TODO some structure for extra message state
:: local (to clients): delivery state, read flags
:: remote (to halls): sequence nr
++ envelope {num/@ud gam/telegram} ::< outward message
++ telegram {aut/ship thought} ::< whose message
++ thought ::> inner message
$: uid/serial ::< unique identifier
aud/audience ::< destinations
wen/@da ::< timestamp
sep/speech ::< content
== ::
++ speech ::> content body
$% {$lin pat/? msg/cord} ::< no/@ text line
{$url url/purf:eyre} ::< parsed url
{$exp exp/cord res/(list tank)} ::< hoon line
{$ire top/serial sep/speech} ::< in reply to
{$fat tac/attache sep/speech} ::< attachment
{$app app/term sep/speech} ::< app message
{$inv inv/? cir/circle} ::< inv/ban for circle
== ::
++ attache ::> attachment
$% {$name nom/cord tac/attache} ::< named attachment
{$text (list cord)} ::< text lines
{$tank (list tank)} ::< tank list
== ::
::
::> ||
::> || %message-metadata
::> ||
:: structures for containing message metadata.
::+|
::
++ serial @uvH ::< unique identifier
++ audience (set circle) ::< destinations
++ tracking (map circle delivery) ::> delivery per target
++ delivery ::> delivery state
$? $pending ::< undelivered
$accepted ::< received
$rejected ::< denied
== ::
--

View File

@ -1,90 +0,0 @@
::
:::: /hoon/talk/sur
::
|%
++ 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 knot (unit config))} :: configure+destroy
{$publish (list thought)} :: originate
{$review (list thought)} :: deliver
== ::
++ cabal :: metaconfiguration
$: loc/config :: local config
ham/(map station config) :: neighborhood configs
== ::
++ 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 :: channel
$white :: chamber
$green :: journal
$brown :: mailbox
== ::
++ presence ?($gone $hear $talk) :: status type
++ register (pair atlas (map partner atlas)) :: ping me, ping srcs
++ shelf (map knot (pair posture cord)) :: ship shape
++ report :: talk update
$% {$cabal cabal} :: config neighborhood
:: {$folder (list report)} :: multiple
{$grams (pair @ud (list telegram))} :: beginning thoughts
{$group register} :: presence
{$house shelf} :: station set
{$glyph (jug char (set partner))} :: relevant binding
== ::
++ speech :: narrative action
$% {$lan p/knot 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
{$url p/purf:eyre} :: parsed url
{$ire p/serial q/speech} :: in-reply-to
{$lin p/? q/@t} :: no/@ text line
{$mor p/(list speech)} :: multiplex
{$app p/@tas q/@t} :: app message
$: $api :: api message
service/@tas :: service name
id/@t :: id on the service
id-url/purf:eyre :: link to id
summary/@t :: summary of event
body/@t :: body of event
url/purf:eyre :: link to event
meta/json :: other data for web
== ::
== ::
++ serial @uvH :: unique identity
++ partner (each station passport) :: interlocutor
++ status (pair presence human) :: participant
++ statement (trel @da bouquet speech) :: when this
++ station (pair ship knot) :: 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
== ::
--

View File

@ -3,8 +3,8 @@
font-family: 'scp'; }
div.input.valid-false {
color: #E20B0B;
border-color: #E20B0B; }
color: #FF0808;
border-color: #FF0808; }
.grams {
list-style-type: none;
@ -138,7 +138,7 @@ input.action {
font-size: .8rem; }
input.action.valid-false {
color: #E20B0B; }
color: #FF0808; }
input.action::-webkit-input-placeholder {
color: #000;
@ -196,7 +196,7 @@ input.action:focus:-ms-input-placeholder {
margin-left: .6rem;
font-weight: 600;
font-size: .8rem;
color: #E20B0B; }
color: #FF0808; }
.menu .room:hover .close {
display: inline; }
.menu .room.disabled {

File diff suppressed because it is too large Load Diff

View File

@ -78,7 +78,7 @@ module.exports = {
pax: pax,
sup: sup,
txt: txt
}, "talk-comment", "talk", (function(_this) {
}, "fora-comment", "fora", (function(_this) {
return function(err, res) {
if (err == null) {
return _this.clearData();
@ -92,7 +92,7 @@ module.exports = {
sup: sup,
hed: hed,
txt: txt
}, "talk-fora-post", "talk", (function(_this) {
}, "fora-post", "fora", (function(_this) {
return function(err, res) {
if (err == null) {
_this.clearData();