mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
Merge pull request #1803 from urbit/odyssey-chat-cli
Implement chat-cli
This commit is contained in:
commit
801bec7917
1204
pkg/arvo/app/chat-cli.hoon
Normal file
1204
pkg/arvo/app/chat-cli.hoon
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
:: chat-store: data store that holds linear sequences of chat messages
|
||||
::
|
||||
/+ *chat-json
|
||||
/+ *chat-json, *chat-eval
|
||||
|%
|
||||
+$ move [bone card]
|
||||
::
|
||||
@ -187,6 +187,10 @@
|
||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
||||
?~ mailbox
|
||||
[~ this]
|
||||
=* letter letter.envelope.act
|
||||
=? letter &(?=(%code -.letter) ?=(~ output.letter))
|
||||
=/ =hoon (ream expression.letter)
|
||||
letter(output (eval bol hoon))
|
||||
=: length.config.u.mailbox +(length.config.u.mailbox)
|
||||
number.envelope.act length.config.u.mailbox
|
||||
envelopes.u.mailbox (snoc envelopes.u.mailbox envelope.act)
|
||||
|
@ -1,4 +1,5 @@
|
||||
/- *chat-store, *chat-view
|
||||
/+ chat-eval
|
||||
|%
|
||||
::
|
||||
++ slan |=(mod/@tas |=(txt/@ta (need (slaw mod txt))))
|
||||
@ -36,19 +37,8 @@
|
||||
%- need
|
||||
?~ exp [~ '' ~]
|
||||
:+ ~ u.exp
|
||||
=+ res=((ot output+(ar dank) ~) a)
|
||||
?^ res u.res
|
||||
:: XX revisit
|
||||
::
|
||||
:: this double-virtualizes and clams to disable .^
|
||||
:: the subject of the eval should include [our now eny]
|
||||
::
|
||||
;; (list tank)
|
||||
=< +>
|
||||
%+ mong
|
||||
:- mute
|
||||
|.([(sell (slap !>(..^zuse) (ream u.exp)))]~)
|
||||
|=(^ ~)
|
||||
::NOTE when sending, if output is an empty list, chat-store will evaluate
|
||||
(fall ((ot output+(ar dank) ~) a) ~)
|
||||
::
|
||||
++ lett
|
||||
|= =letter
|
||||
|
16
pkg/arvo/lib/chat/eval.hoon
Normal file
16
pkg/arvo/lib/chat/eval.hoon
Normal file
@ -0,0 +1,16 @@
|
||||
|%
|
||||
++ eval
|
||||
|= [=bowl:gall =hoon]
|
||||
^- (list tank)
|
||||
=/ subj=[our=@p now=@da eny=@uvJ]
|
||||
:+ our.bowl
|
||||
now.bowl
|
||||
(shaz (cat 3 (mix [now eny]:bowl) %eny))
|
||||
::
|
||||
;; (list tank)
|
||||
=< +>
|
||||
%+ mong
|
||||
:- mute
|
||||
|.([(sell (slap (slop !>(subj) !>(..zuse)) hoon))]~)
|
||||
|=(^ ~)
|
||||
--
|
@ -76,56 +76,42 @@
|
||||
|= [our/ship lit/?]
|
||||
%- ~(gas in *(set well:gall))
|
||||
^- (list well:gall)
|
||||
?: lit
|
||||
:~ [%home %dojo]
|
||||
[%home %azimuth-tracker]
|
||||
==
|
||||
=+ myr=(clan:title our)
|
||||
:: boot all default apps off the home desk
|
||||
::
|
||||
?: ?=($pawn myr)
|
||||
:~ [%home %lens]
|
||||
[%base %hall]
|
||||
[%base %talk]
|
||||
[%base %dojo]
|
||||
[%base %modulo]
|
||||
[%home %launch]
|
||||
[%home %publish]
|
||||
[%home %clock]
|
||||
[%home %weather]
|
||||
[%home %group-store]
|
||||
[%home %group-hook]
|
||||
[%home %permission-store]
|
||||
[%home %permission-group-hook]
|
||||
[%home %chat-store]
|
||||
[%home %chat-hook]
|
||||
[%home %chat-view]
|
||||
==
|
||||
:~ [%home %lens]
|
||||
[%home %acme]
|
||||
[%home %dns]
|
||||
[%home %dojo]
|
||||
[%home %hall]
|
||||
[%home %talk]
|
||||
[%home %modulo]
|
||||
[%home %launch]
|
||||
[%home %publish]
|
||||
[%home %clock]
|
||||
[%home %weather]
|
||||
[%home %group-store]
|
||||
[%home %group-hook]
|
||||
[%home %permission-store]
|
||||
[%home %permission-group-hook]
|
||||
[%home %chat-store]
|
||||
[%home %chat-hook]
|
||||
[%home %chat-view]
|
||||
[%home %azimuth-tracker]
|
||||
=- (turn - |=(a=term home+a))
|
||||
^- (list term)
|
||||
?: lit
|
||||
:~ %dojo
|
||||
%azimuth-tracker
|
||||
==
|
||||
%+ welp
|
||||
?: ?=(%pawn (clan:title our)) ~
|
||||
:~ %acme
|
||||
%dns
|
||||
%azimuth-tracker
|
||||
==
|
||||
:~ %lens
|
||||
%dojo
|
||||
%modulo
|
||||
%launch
|
||||
%publish
|
||||
%clock
|
||||
%weather
|
||||
%group-store
|
||||
%group-hook
|
||||
%permission-store
|
||||
%permission-group-hook
|
||||
%chat-store
|
||||
%chat-hook
|
||||
%chat-view
|
||||
%chat-cli
|
||||
==
|
||||
::
|
||||
++ deft-fish :: default connects
|
||||
|= our/ship
|
||||
%- ~(gas in *(set gill:gall))
|
||||
^- (list gill:gall)
|
||||
[[our %talk] [our %dojo] ~]
|
||||
[[our %chat-cli] [our %dojo] ~]
|
||||
::
|
||||
++ make :: initial part
|
||||
|= our/ship
|
||||
|
Loading…
Reference in New Issue
Block a user