mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
More cleanups; remove some clearly unused files.
This commit is contained in:
parent
6d5564b7d6
commit
49647965ef
21
ape/bit.hoon
21
ape/bit.hoon
@ -33,7 +33,7 @@ $: cred+(unit {app-secret+@t client-id+@t})
|
||||
{$unto $coup p+(unit tang)}
|
||||
==
|
||||
++ mesa
|
||||
$% {$bit-addr-request ~}
|
||||
$% {$bit-addr-request $~}
|
||||
{$bit-addr-made @t}
|
||||
{$talk-command command}
|
||||
==
|
||||
@ -46,7 +46,7 @@ $: cred+(unit {app-secret+@t client-id+@t})
|
||||
++ redirect-uri [hostname `/~~/home/pub/bit/fab ~]
|
||||
++ hostname ^- hart
|
||||
?+ (clan our.hid) !!
|
||||
$czar [| ?+(our.hid `8.443 %~fyr `8.444) `/localhost]
|
||||
$czar [| ?+(our.hid `8.443 $~fyr `8.444) `/localhost]
|
||||
$duke [| `8.444 `/org/urbit/(crip +:<our.hid>)]
|
||||
==
|
||||
++ auth-url
|
||||
@ -134,7 +134,7 @@ $: cred+(unit {app-secret+@t client-id+@t})
|
||||
|= code+cord
|
||||
=. oauth-code.vat
|
||||
[~ code]
|
||||
?< ?=(~ cred.vat)
|
||||
?< ?=($~ cred.vat)
|
||||
=+ req=[code [client-id app-secret]:u.cred.vat redirect-uri]
|
||||
[[ost.hid %hiss / %oauth-tokens bit-get-token/req]~ +>.$]
|
||||
::
|
||||
@ -161,11 +161,14 @@ $: cred+(unit {app-secret+@t client-id+@t})
|
||||
?~ nt.arg
|
||||
:* to/s/to.arg
|
||||
'amount_currency_iso'^s/(need cur.arg)
|
||||
'amount_string'^s/(need amtwo.arg) ~]
|
||||
:* to/s/to.arg
|
||||
amount/s/(need amtwo.arg)
|
||||
'amount_string'^s/(need amtwo.arg) ~
|
||||
==
|
||||
'amount_string'^s/(need amtwo.arg)
|
||||
~
|
||||
==
|
||||
:* to/s/to.arg
|
||||
amount/s/(need amtwo.arg)
|
||||
'amount_string'^s/(need amtwo.arg)
|
||||
~
|
||||
==
|
||||
=+ ^= pst
|
||||
(jobe transaction/(jobe info) ~)
|
||||
[[(old-api /send /transactions/'send_money' %post pst) ~] +>.$]
|
||||
@ -201,7 +204,7 @@ $: cred+(unit {app-secret+@t client-id+@t})
|
||||
^- move
|
||||
=+ ^= thotz
|
||||
%+ turn act
|
||||
|= sp=speech ^- thought
|
||||
|= sp+speech ^- thought
|
||||
=+ ^= tail
|
||||
:- ^- audience
|
||||
:+ :- ^- partner
|
||||
|
@ -4,5 +4,5 @@
|
||||
|_ [bowl ~]
|
||||
++ poke-noun |=(span (onwards [%peer / [our %twit] /user/[+<]]))
|
||||
++ onwards |*({mark *} [[ost +<]~ +>.$])
|
||||
++ diff-twit-feed |=({* a=(list twit-stat)} ?~(a `+>.$ ~&(i.a $(a t.a))))
|
||||
++ diff-twit-feed |=({* a+(list twit-stat)} ?~(a `+>.$ ~&(i.a $(a t.a))))
|
||||
--
|
||||
|
138
ape/work.hoon
138
ape/work.hoon
@ -11,12 +11,12 @@
|
||||
|%
|
||||
++ move (pair bone card) :: all actions
|
||||
++ card :: general card
|
||||
$% [%diff %work-report client] ::
|
||||
[%peer wire dock path] ::
|
||||
[%poke wire dock pear] ::
|
||||
$% {$diff $work-report client} ::
|
||||
{$peer wire dock path} ::
|
||||
{$poke wire dock pear} ::
|
||||
== ::
|
||||
++ pear :: poke fruit
|
||||
$% [%talk-command command:talk] ::
|
||||
$% {$talk-command command:talk} ::
|
||||
== ::
|
||||
--
|
||||
!:
|
||||
@ -24,24 +24,24 @@
|
||||
::
|
||||
|_ $: bowl
|
||||
client
|
||||
connected=$@ :: subscribed to talk
|
||||
count=@ud :: # messages from talk
|
||||
unordered=(map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
|
||||
connected+? :: subscribed to talk
|
||||
count+@ud :: # messages from talk
|
||||
unordered+(map {@uvH @u} (pair ship flesh:work-stuff:talk))
|
||||
==
|
||||
++ at
|
||||
|= client-task
|
||||
=| moves=(list move)
|
||||
=| moves+(list move)
|
||||
|%
|
||||
++ abet
|
||||
^- [(list move) $+>.$]
|
||||
^- {(list move) _+>.$}
|
||||
[(flop moves) +>.$(tasks (~(put by tasks) id.tax +<.$))]
|
||||
::
|
||||
++ abut
|
||||
^- [(list move) $+>.$]
|
||||
^- {(list move) _+>.$}
|
||||
[(flop moves) +>.$]
|
||||
::
|
||||
++ send-audience
|
||||
|= [to=(set station:talk) action=duty:work-stuff:talk]
|
||||
|= {to+(set station:talk) action+duty:work-stuff:talk}
|
||||
%_ +>.$
|
||||
eny (sham eny action)
|
||||
moves
|
||||
@ -56,19 +56,19 @@
|
||||
|- ^- (list thought)
|
||||
:_ ~
|
||||
:+ (shaf %task eny)
|
||||
%- mo ^- (list ,[partner envelope delivery])
|
||||
%- mo ^- (list {partner envelope delivery})
|
||||
%+ turn (~(tap in to))
|
||||
|=(sat=station [[%& sat] [*envelope %pending]])
|
||||
|=(sat+station [[%& sat] [*envelope %pending]])
|
||||
[now *bouquet [%tax action]]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ send
|
||||
|= action=duty:work-stuff:talk
|
||||
|= action+duty:work-stuff:talk
|
||||
(send-audience audience action)
|
||||
::
|
||||
++ send-archive
|
||||
|= to=(set station:talk)
|
||||
|= to+(set station:talk)
|
||||
(send-audience to %archive id.tax)
|
||||
::
|
||||
++ send-create (send %create tax)
|
||||
@ -80,28 +80,28 @@
|
||||
[%change id.tax +<]
|
||||
++ send-update |*(* (send %update id.tax +<))
|
||||
++ process-update
|
||||
|= up=update
|
||||
|= up+update
|
||||
^+ +>
|
||||
?- -.up
|
||||
%add ?>(?=(%comment +<.up) (send-change %add-comment our +>.up))
|
||||
%doer
|
||||
$add ?>(?=($comment +<.up) (send-change %add-comment our +>.up))
|
||||
$doer
|
||||
?- +<.up
|
||||
%release (send-change %set-doer ~)
|
||||
%claim (send-change %set-doer `our)
|
||||
$release (send-change %set-doer ~)
|
||||
$claim (send-change %set-doer `our)
|
||||
==
|
||||
::
|
||||
%set
|
||||
$set
|
||||
?- +<.up
|
||||
%audience (process-audience to.up)
|
||||
%date-due (send-change %set-date-due +>.up)
|
||||
%title (send-change %set-title +>.up)
|
||||
%description (send-change %set-description +>.up)
|
||||
%tags (send-change %set-tags +>.up)
|
||||
%done (send-change %set-done +>.up)
|
||||
$audience (process-audience to.up)
|
||||
$date-due (send-change %set-date-due +>.up)
|
||||
$title (send-change %set-title +>.up)
|
||||
$description (send-change %set-description +>.up)
|
||||
$tags (send-change %set-tags +>.up)
|
||||
$done (send-change %set-done +>.up)
|
||||
==
|
||||
==
|
||||
++ process-audience
|
||||
|= to=(set station:talk)
|
||||
|= to+(set station:talk)
|
||||
^+ +>
|
||||
=. +>.$ (send-archive (~(dif in audience) to))
|
||||
=. +>.$ (send-audience (~(dif in to) audience) %create tax)
|
||||
@ -114,28 +114,28 @@
|
||||
=< $
|
||||
%- unit
|
||||
$: client
|
||||
$@
|
||||
?
|
||||
@ud
|
||||
(map ,[@uvH @u] (pair ship flesh:work-stuff:talk))
|
||||
(map {@uvH @u} (pair ship flesh:work-stuff:talk))
|
||||
==
|
||||
^- [(list move) $+>.$]
|
||||
^- {(list move) _+>.$}
|
||||
initialize(+<+ ?~(old +<+.+>.$ u.old))
|
||||
::
|
||||
++ initialize
|
||||
^- [(list move) _.]
|
||||
^- {(list move) _.}
|
||||
?: connected
|
||||
[~ .]
|
||||
:_ .(connected %&) :_ ~
|
||||
[ost %peer /peering [our %talk] /f/(main:talk our)/(scot %ud count)]
|
||||
::
|
||||
++ process-duty
|
||||
|= [when=@da her=ship from=(set station:talk) action=duty:work-stuff:talk]
|
||||
^- [(list move) $+>.$]
|
||||
|= {when+@da her+ship from+(set station:talk) action+duty:work-stuff:talk}
|
||||
^- {(list move) _+>.$}
|
||||
=- =^ mof con mirror-to-web:con
|
||||
[(welp mof mos) con]
|
||||
^- [mos=(list move) con=$+>.$]
|
||||
^- {mos+(list move) con+_+>.$}
|
||||
?- -.action
|
||||
%create
|
||||
$create
|
||||
=+ existing-task=(~(get by tasks) id.tax.action)
|
||||
?: ?& ?=(^ existing-task)
|
||||
!=(tax.action tax.u.existing-task)
|
||||
@ -164,7 +164,7 @@
|
||||
=. sort ?^(existing-task sort [id.tax.action sort])
|
||||
[~ +>.$]
|
||||
::
|
||||
%archive
|
||||
$archive
|
||||
=+ tax=(~(get by tasks) id.action)
|
||||
?~ tax
|
||||
~& :* %archive-for-nonexistent-task
|
||||
@ -189,7 +189,7 @@
|
||||
==
|
||||
[~ +>.$]
|
||||
::
|
||||
%change
|
||||
$change
|
||||
=+ tax=(~(get by tasks) id.action)
|
||||
?~ tax
|
||||
~& :* %change-for-nonexistent-task
|
||||
@ -208,7 +208,7 @@
|
||||
[~ +>.$]
|
||||
abet:(send-update:(at u.tax) +(version.tax.u.tax) her meat.action)
|
||||
::
|
||||
%update
|
||||
$update
|
||||
=+ tax=(~(get by tasks) id.action)
|
||||
?~ tax
|
||||
~& :* %update-for-nonexistent-task
|
||||
@ -250,13 +250,13 @@
|
||||
=. version.tax.u.tax version.action
|
||||
=. date-modified.tax.u.tax when
|
||||
?- -.meat.action
|
||||
%set-doer tax.u.tax(doer her.meat.action)
|
||||
%set-date-due tax.u.tax(date-due wen.meat.action)
|
||||
%set-tags tax.u.tax(tags tag.meat.action)
|
||||
%set-title tax.u.tax(title til.meat.action)
|
||||
%set-description tax.u.tax(description des.meat.action)
|
||||
%set-done tax.u.tax(done ?.(don.meat.action ~ `when))
|
||||
%add-comment
|
||||
$set-doer tax.u.tax(doer her.meat.action)
|
||||
$set-date-due tax.u.tax(date-due wen.meat.action)
|
||||
$set-tags tax.u.tax(tags tag.meat.action)
|
||||
$set-title tax.u.tax(title til.meat.action)
|
||||
$set-description tax.u.tax(description des.meat.action)
|
||||
$set-done tax.u.tax(done ?.(don.meat.action ~ `when))
|
||||
$add-comment
|
||||
%= tax.u.tax
|
||||
discussion [[when [who com]:meat.action] discussion.tax.u.tax]
|
||||
==
|
||||
@ -272,65 +272,65 @@
|
||||
==
|
||||
::
|
||||
++ mirror-to-web
|
||||
^- [(list move) _.]
|
||||
~& [%mirroring sort=(turn sort |=(a=@uv `@uv`(rsh 2 25 a)))]
|
||||
^- {(list move) _.}
|
||||
~& [%mirroring sort=(turn sort |=(a+@uv `@uv`(rsh 2 25 a)))]
|
||||
:_ .
|
||||
%+ murn (~(tap by sup))
|
||||
|= [ust=bone her=ship pax=path]
|
||||
|= {ust+bone her+ship pax+path}
|
||||
^- (unit move)
|
||||
?:(?=([%sole *] pax) ~ `[ust full-report])
|
||||
?:(?=({$sole *} pax) ~ `[ust full-report])
|
||||
::
|
||||
++ full-report [%diff %work-report tasks sort]
|
||||
++ peer-repo |=(path [[ost full-report]~ +>.$])
|
||||
++ coup
|
||||
|= [way=wire saw=(unit tang)]
|
||||
^- [(list move) $+>.$]
|
||||
?> ?=(~ saw)
|
||||
|= {way+wire saw+(unit tang)}
|
||||
^- {(list move) _+>.$}
|
||||
?> ?=($~ saw)
|
||||
[~ +>.$]
|
||||
::
|
||||
++ quit-peering |=(way=wire ?>(?=(~ way) initialize(connected |)))
|
||||
++ quit-peering |=(way+wire ?>(?=($~ way) initialize(connected |)))
|
||||
++ reap-peering
|
||||
|= [way=wire saw=(unit tang)]
|
||||
^- [(list move) $+>.$]
|
||||
?> ?=([~ ~] +<)
|
||||
|= {way+wire saw+(unit tang)}
|
||||
^- {(list move) _+>.$}
|
||||
?> ?=({$~ $~} +<)
|
||||
[~ +>.$]
|
||||
::
|
||||
++ poke-work-command
|
||||
|= cod=command
|
||||
|= cod+command
|
||||
?. =(our src)
|
||||
~|([%wrong-user our=our src=src] !!)
|
||||
?- -.cod
|
||||
%sort mirror-to-web(sort p.cod)
|
||||
%old
|
||||
$sort mirror-to-web(sort p.cod)
|
||||
$old
|
||||
=^ mow +>.$
|
||||
=+ (at (~(got by tasks) id.cod))
|
||||
abet:(process-update:- dif.cod)
|
||||
=^ mov +>.$ mirror-to-web
|
||||
[(welp mov mow) +>.$]
|
||||
%new
|
||||
$new
|
||||
=. +>.cod +>.cod(date-created now, version 0, date-modified now)
|
||||
abut:send-create:(at | +.cod)
|
||||
==
|
||||
::
|
||||
:: XX test the disconnection case
|
||||
++ diff-talk-report
|
||||
|= [way=wire rep=report:talk]
|
||||
^- [(list move) $+>.$]
|
||||
?> ?=(%grams -.rep)
|
||||
|- ^- [(list move) $+>.^$]
|
||||
|= {way+wire rep+report:talk}
|
||||
^- {(list move) _+>.$}
|
||||
?> ?=($grams -.rep)
|
||||
|- ^- {(list move) _+>.^$}
|
||||
?~ q.rep [~ +>.^$]
|
||||
=. count +(count)
|
||||
=* her p.i.q.rep
|
||||
=* when p.r.q.i.q.rep
|
||||
=* said r.r.q.i.q.rep
|
||||
?. ?=(%tax -.said)
|
||||
?. ?=($tax -.said)
|
||||
$(p.rep +(p.rep), q.rep t.q.rep)
|
||||
=+ ^- from=(set station:talk)
|
||||
=+ ^- from+(set station:talk)
|
||||
%- sa ^- (list station:talk)
|
||||
%+ murn (~(tap by q.q.i.q.rep))
|
||||
=> talk
|
||||
|= [par=partner *]
|
||||
`(unit station)`?.(?=(%& -.par) ~ `p.par)
|
||||
|= {par+partner *}
|
||||
`(unit station)`?.(?=($& -.par) ~ `p.par)
|
||||
=^ mos +>.^$ (process-duty when her from +.said)
|
||||
=^ mof +>.^$ $(p.rep +(p.rep), q.rep t.q.rep)
|
||||
[(weld mos mof) +>.^$]
|
||||
|
@ -1,107 +0,0 @@
|
||||
:: App construction utilities
|
||||
::
|
||||
:::: /hoon/sh-utils/lib
|
||||
::
|
||||
|%
|
||||
++ append
|
||||
|* a=*
|
||||
|* b=*
|
||||
[b a]
|
||||
::
|
||||
++ hapt (pair ship path)
|
||||
--
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|%
|
||||
++ args-done |*(ref=_,[(list) ^] (add-exit (add-nice ref))) :: accept args
|
||||
::
|
||||
++ add-exit :: add "kill self" kiss
|
||||
|* ref=_,[(list) ^]
|
||||
%+ add-resp [%pass / %g %cide %$]
|
||||
ref
|
||||
::
|
||||
++ add-nice :: return "succcess" response
|
||||
|* ref=_,[(list) ^]
|
||||
%+ add-resp [%give %nice ~]
|
||||
ref
|
||||
::
|
||||
++ add-subs :: add gall subscription
|
||||
|* [hat=[hapt ship path] ref=_,[(list) ^]]
|
||||
(add-resp [%pass /show %g %show hat] ref)
|
||||
::
|
||||
++ args-into-gate :: poke--args from gate: output and exit
|
||||
|* [con=[* [hide *] *] gat=_,[@ *]]
|
||||
%- args-done
|
||||
%^ gate-outs con
|
||||
|=(a=$+<.gat [%rush (gat a)])
|
||||
,_`con
|
||||
::
|
||||
++ args-into-resp :: compute gifts with gate and exit
|
||||
|* [con=[* [hide *] *] gat=_,(pole ,[@ *])]
|
||||
%- args-done
|
||||
|* [ost=bone * arg=$+<.gat]
|
||||
:_ con
|
||||
%. (gat arg)
|
||||
|* a=(pole ,[@ *])
|
||||
?~ a ~
|
||||
a(- [ost %give -.a], + $(a +.a))
|
||||
::
|
||||
++ add-output :: send gift to /out
|
||||
|* [con=[* [hide *] *] ote=[@ *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
=+ sus=(~(tap in `(set bone)`(~(get ju pus.hid) /out)))
|
||||
=+ mof=(turn sus (append [%give ote]))
|
||||
|= $+<.ref
|
||||
=+ neu=(ref +<)
|
||||
neu(- (welp mof -.neu))
|
||||
::
|
||||
++ add-resp :: add response move to requesting bone
|
||||
|* [mof=[@ @ *] ref=_,[(list) ^]]
|
||||
|* [ost=bone $?@(+<.ref ~ +<+.ref)]
|
||||
=+ neu=(ref +<)
|
||||
neu(- [[ost mof] -.neu])
|
||||
::
|
||||
++ gate-give :: respond with computed gift
|
||||
|* [gat=_,[@ *] ref=_,[(list) ^]]
|
||||
(gate-move |*($+<.gat [%give (gat +<)]) ref)
|
||||
::
|
||||
++ gate-bang :: respond with computed note
|
||||
|* [gat=_,[@ @ *] ref=_,[(list) ^]]
|
||||
(gate-move |*($+<.gat [%pass /bang (gat +<)]) ref)
|
||||
::
|
||||
++ gate-mess :: respond with local message
|
||||
|* [con=[* [hide *] *] gat=_,[@ @ *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
%- gate-move :_ ref
|
||||
|* $+<.gat
|
||||
=+ `[imp=path mez=cage]`(gat +<)
|
||||
[%pass /poke %g %mess [our.hid imp] our.hid mez]
|
||||
::
|
||||
++ gate-move :: respond with computed move
|
||||
|* [gat=_,(mold) ref=_,[(list) ^]]
|
||||
|* [ost=bone * arg=$+<.gat]
|
||||
((add-resp (gat arg) ref) +<)
|
||||
::
|
||||
::
|
||||
++ gate-outs :: send computed gift to /out
|
||||
|* [con=[* [hide *] *] gat=_,[@ *] ref=_,[(list) ^]]
|
||||
|* [ost=bone * arg=$+<.gat]
|
||||
((add-output con (gat arg) ref) +<)
|
||||
::
|
||||
++ listen-in :: recieve standard input
|
||||
|* [con=[* [hide *] *] ref=_,[(list) ^]]
|
||||
=> .(+<- `[* [hid=hide *] *]`con)
|
||||
(add-subs [[our +.imp] our /in/[-.imp]]:hid ref)
|
||||
::
|
||||
++ print
|
||||
|* [con=[* [hide *] *] tap=tape]
|
||||
(add-output con [%rush %tang [%leaf tap] ~] ,_[~ con])
|
||||
::
|
||||
++ verify :: type-check with context and move
|
||||
|* [con=^ mof=[@ *]]
|
||||
|* ref=_,[(list ,_mof) _con]
|
||||
|* $+<.ref
|
||||
^- [(list ,_mof) _con]
|
||||
(ref +<)
|
||||
--
|
@ -1,3 +0,0 @@
|
||||
:: Alias
|
||||
/+ sh-utils
|
||||
.
|
@ -1 +0,0 @@
|
||||
,[mov=(mold) ~]
|
@ -1 +0,0 @@
|
||||
,[input=path output=path ~]
|
@ -1 +0,0 @@
|
||||
,[p=@t q=@ud ~]
|
@ -1 +0,0 @@
|
||||
,[pax=path dat=@ ~]
|
@ -1 +0,0 @@
|
||||
,[input=path output=path ~]
|
@ -1 +0,0 @@
|
||||
,[(list ,@tas)]
|
@ -1 +0,0 @@
|
||||
,[pax=path ~]
|
@ -1 +0,0 @@
|
||||
,[syd=@tas her=@p sud=@tas ~]
|
@ -1 +0,0 @@
|
||||
,[her=@p num=?(~ [p=@ud ~])]
|
@ -1 +0,0 @@
|
||||
,[syd=@tas her=@p sud=@tas ~]
|
@ -1 +0,0 @@
|
||||
,[~]
|
Loading…
Reference in New Issue
Block a user