Merge pull request #1803 from urbit/odyssey-chat-cli

Implement chat-cli
This commit is contained in:
Logan 2019-10-08 15:46:07 -07:00 committed by GitHub
commit 801bec7917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1257 additions and 57 deletions

1204
pkg/arvo/app/chat-cli.hoon Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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)

View File

@ -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

View 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))]~)
|=(^ ~)
--

View File

@ -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