Merge branch 'khrc' of github.com:urbit/urbit into ipc-redux-kh
39
.github/ISSUE_TEMPLATE/kernel-or-runtime-bug-report.md
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
---
|
||||||
|
name: Kernel or runtime bug report
|
||||||
|
about: Use this template to file a bug for low-level system components, e.g. Hoon,
|
||||||
|
Arvo, Zuse, the vanes, Vere, etc.
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- A good bug report, description of a crash, etc., should ideally be *reproducible*, with clear steps as to how another developer can replicate and examine your problem. That said, this isn't always possible; some bugs depend on having created a complicated or unusual state, or can otherwise simply be difficult to trigger again (say, you encountered it in the last continuity era).
|
||||||
|
|
||||||
|
Your issue should thus at a minimum be *informative*. The best advice here is probably "don't write bad issues," where "bad" is a matter of judgment and taste. Issues that the maintainers don't judge to be sufficiently useful or informative may be closed. -->
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behaviour:
|
||||||
|
1. ...
|
||||||
|
2. ...
|
||||||
|
3. ...
|
||||||
|
|
||||||
|
**Expected behaviour**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**System (please supply the following information, if relevant):**
|
||||||
|
- OS: [e.g. macOS, linux64, FreeBSD]
|
||||||
|
- Vere and Urbit OS versions
|
||||||
|
- Your ship's `%base` hash (use `.^(@uv %cz /=base=)` to check)
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
|
|
||||||
|
**Notify maintainers**
|
||||||
|
If you happen to know who the appropriate maintainers are, consider mentioning them with an @ here. You may want to use `git blame` to see who has last touched any relevant code.
|
124
MAINTAINERS.md
@ -1,5 +1,117 @@
|
|||||||
# Maintainers' Guide
|
# Maintainers' Guide
|
||||||
|
|
||||||
|
## Branch organization
|
||||||
|
|
||||||
|
The essence of this branching scheme is that you create "release branches" of
|
||||||
|
independently releasable units of work. These can then be released by their
|
||||||
|
maintainers when ready.
|
||||||
|
|
||||||
|
### Master branch
|
||||||
|
|
||||||
|
Master is what's released on the network. Deployment instructions are in the
|
||||||
|
next section, but tagged releases should always come from this branch.
|
||||||
|
|
||||||
|
### Feature branches
|
||||||
|
|
||||||
|
Anyone can create feature branches. For those with commit access to
|
||||||
|
urbit/urbit, you're welcome to create them in this repo; otherwise, fork the
|
||||||
|
repo and create them there.
|
||||||
|
|
||||||
|
Usually, new development should start from master, but if your work depends on
|
||||||
|
work in another feature branch or release branch, start from there.
|
||||||
|
|
||||||
|
If, after starting your work, you need changes that are in master, merge it into
|
||||||
|
your branch. If you need changes that are in a release branch or feature
|
||||||
|
branch, merge it into your branch, but understand that your work now depends on
|
||||||
|
that release branch, which means it won't be released until that one is
|
||||||
|
released.
|
||||||
|
|
||||||
|
### Release branches
|
||||||
|
|
||||||
|
Release branches are code that is ready to release. All release branch names
|
||||||
|
should start with `release/`.
|
||||||
|
|
||||||
|
All code must be reviewed before being pushed to a release branch. Thus,
|
||||||
|
feature branches should be PR'd against a release branch, not master.
|
||||||
|
|
||||||
|
Create new release branches as needed. You don't need a new one for every PR,
|
||||||
|
since many changes are relatively small and can be merged together with little
|
||||||
|
risk. However, once you merge two branches, they're now coupled and will only
|
||||||
|
be released together -- unless one of the underlying commits is separately put
|
||||||
|
on a release branch.
|
||||||
|
|
||||||
|
Here's a worked example. The rule is to make however many branches are useful,
|
||||||
|
and no more. This example is not prescriptive, the developers making the
|
||||||
|
changes may add, remove, or rename branches in this flow at will.
|
||||||
|
|
||||||
|
Suppose you (plural, the dev community at large) complete some work in a
|
||||||
|
userspace app, and you put it in `release/next-userspace`. Separately, you make
|
||||||
|
a small JS change. If you PR it to `release/next-userspace`, then it will only
|
||||||
|
be released at the same time as the app changes. Maybe this is fine, or maybe
|
||||||
|
you want this change to go out quickly, and the change in
|
||||||
|
`release/next-userspace` is relatively risky, so you don't want to push it out
|
||||||
|
on Friday afternoon. In this case, put the change in another release branch,
|
||||||
|
say `release/next-js`. Now either can be released independently.
|
||||||
|
|
||||||
|
Suppose you do further work that you want to PR to `release/next-userspace`, but
|
||||||
|
it depends on your fixes in `release/next-js`. Simply merge `release/next-js`
|
||||||
|
into either your feature branch or `release/next-userspace` and PR your finished
|
||||||
|
work to `release/next-userspace`. Now there is a one-way coupling:
|
||||||
|
`release/next-userspace` contains `release/next-js`, so releasing it will
|
||||||
|
implicitly release `release/next-js`. However, you can still release
|
||||||
|
`release/next-js` independently.
|
||||||
|
|
||||||
|
This scheme extends to other branches, like `release/next-kernel` or
|
||||||
|
`release/os1.1` or `release/ford-fusion`. Some branches may be long-lived and
|
||||||
|
represent simply the "next" release of something, while others will have a
|
||||||
|
definite lifetime that corresponds to development of a particular feature or
|
||||||
|
numbered release.
|
||||||
|
|
||||||
|
Since they are "done", release branches should be considered "public", in the
|
||||||
|
sense that others may depend on them at will. Thus, never rebase a release
|
||||||
|
branch.
|
||||||
|
|
||||||
|
When cutting a new release, you can filter branches with `git branch --list
|
||||||
|
'release/*'` or by typing "release/" in the branch filter on Github. This will
|
||||||
|
give you the list of branches which have passed review and may be merged to
|
||||||
|
master and released. When choosing which branches to release, make sure you
|
||||||
|
understand the risks of releasing them immediately. If merging these produces
|
||||||
|
nontrivial conflicts, consider asking the developers on those branches to merge
|
||||||
|
between themselves. In many cases a developer can do this directly, but if it's
|
||||||
|
sufficiently nontrivial, this may be a reviewed PR of one release branch into
|
||||||
|
another.
|
||||||
|
|
||||||
|
### Non-OTAable release branches
|
||||||
|
|
||||||
|
In some cases, work is completed which cannot be OTA'd as written. For example,
|
||||||
|
the code may lack state adapters, or it may not properly handle outstanding
|
||||||
|
subscriptions. It could also be code which is planned to be released only upon
|
||||||
|
a breach (network-wide or rolling).
|
||||||
|
|
||||||
|
In this case, the code may be PR'd to a `na-release/` branch. All rules are the
|
||||||
|
same as for release branches, except that the code does not need to apply
|
||||||
|
cleanly to an existing ship. If you later write state adapter or otherwise make
|
||||||
|
it OTAable, then you may PR it to a release branch.
|
||||||
|
|
||||||
|
### Other cases
|
||||||
|
|
||||||
|
Outside contributors can generally target their PRs against master unless
|
||||||
|
specifically instructed. Maintainers should retarget those branches as
|
||||||
|
appropriate.
|
||||||
|
|
||||||
|
If a commit is not something that goes into a release (eg changes to README or
|
||||||
|
CI), it may be committed straight to master.
|
||||||
|
|
||||||
|
If a hotfix is urgent, it may be PR'd straight to master. This should only be
|
||||||
|
done if you reasonably expect that it will be released soon and before anything
|
||||||
|
else is released.
|
||||||
|
|
||||||
|
If a series of commits that you want to release is on a release branch, but you
|
||||||
|
really don't want to release the whole branch, you must cherry-pick them onto
|
||||||
|
another release branch. Cherry-picking isn't ideal because those commits will
|
||||||
|
be duplicated in the history, but it won't have any serious side effects.
|
||||||
|
|
||||||
|
|
||||||
## Hotfixes
|
## Hotfixes
|
||||||
|
|
||||||
Here lies an informal guide for making hotfix releases and deploying them to
|
Here lies an informal guide for making hotfix releases and deploying them to
|
||||||
@ -119,6 +231,9 @@ this:
|
|||||||
```
|
```
|
||||||
urbit-vx.y.z
|
urbit-vx.y.z
|
||||||
|
|
||||||
|
Note that this Vere release will by default boot fresh ships using an Urbit OS
|
||||||
|
va.b.c pill.
|
||||||
|
|
||||||
Release binaries:
|
Release binaries:
|
||||||
|
|
||||||
(linux64)
|
(linux64)
|
||||||
@ -138,9 +253,11 @@ Contributions:
|
|||||||
|
|
||||||
The same schpeel re: release candidates applies here.
|
The same schpeel re: release candidates applies here.
|
||||||
|
|
||||||
Do not include implicit Urbit OS changes in Vere releases. This used to be
|
Note that the release notes indicate which version of Urbit OS the Vere release
|
||||||
done, historically, but shouldn't be any longer. If there are Urbit OS and
|
will use by default when booting fresh ships. Do not include implicit Urbit OS
|
||||||
Vere changes to be released, make two releases.
|
changes in Vere releases; this used to be done, historically, but shouldn't be
|
||||||
|
any longer. If there are Urbit OS and Vere changes to be released, make two
|
||||||
|
separate releases.
|
||||||
|
|
||||||
### Deploy the update
|
### Deploy the update
|
||||||
|
|
||||||
@ -170,4 +287,3 @@ Post an announcement to urbit-dev. The tag annotation, basically, is fine here
|
|||||||
-- I usually add the %base hash (for Urbit OS releases) and the release binary
|
-- I usually add the %base hash (for Urbit OS releases) and the release binary
|
||||||
URLs (for Vere releases). Check the urbit-dev archives for examples of these
|
URLs (for Vere releases). Check the urbit-dev archives for examples of these
|
||||||
announcements.
|
announcements.
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:4259ef9a7112459948d2cb032266b1c2aa66b5cb34c83d1f5ee9ef1f1b7aebc3
|
oid sha256:801eb8574daff9f0ac88e2e40dab09d95bd8d667df953e971501a1f8db4fd039
|
||||||
size 10687559
|
size 10394205
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:50c17bcd19004751c4c13c62ea37a8e70d42377c36bce50318992653943ae50e
|
oid sha256:9d131da321b891c126f62cc587c5e27c257695ff9ae15e502356159fba7f9bf3
|
||||||
size 1234008
|
size 1234415
|
||||||
|
@ -87,8 +87,9 @@
|
|||||||
|= [state=app-state our=ship dap=term]
|
|= [state=app-state our=ship dap=term]
|
||||||
^- card:agent:gall
|
^- card:agent:gall
|
||||||
=/ args=vase !>
|
=/ args=vase !>
|
||||||
:* %watch /[dap]
|
:+ %watch /[dap]
|
||||||
url.state =(%czar (clan:title our)) ~m5
|
^- config:eth-watcher
|
||||||
|
:* url.state =(%czar (clan:title our)) ~m5 ~m30
|
||||||
launch:contracts:azimuth
|
launch:contracts:azimuth
|
||||||
~[azimuth:contracts:azimuth]
|
~[azimuth:contracts:azimuth]
|
||||||
(topics whos.state)
|
(topics whos.state)
|
||||||
|
@ -9,22 +9,22 @@
|
|||||||
:: we concat the ship onto the head of the path,
|
:: we concat the ship onto the head of the path,
|
||||||
:: and trust it to take care of the rest.
|
:: and trust it to take care of the rest.
|
||||||
::
|
::
|
||||||
/- *chat-store, *chat-view, *chat-hook,
|
/- view=chat-view, hook=chat-hook,
|
||||||
*permission-store, *group-store, *invite-store,
|
*permission-store, *group-store, *invite-store,
|
||||||
sole-sur=sole
|
*rw-security, sole
|
||||||
/+ sole-lib=sole, chat-eval, default-agent, verb, dbug,
|
/+ shoe, default-agent, verb, dbug, store=chat-store
|
||||||
auto=language-server-complete
|
|
||||||
::
|
::
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:shoe
|
||||||
::
|
::
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
$% state-1
|
$% state-2
|
||||||
|
state-1
|
||||||
state-0
|
state-0
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ state-1
|
+$ state-2
|
||||||
$: %1
|
$: %2
|
||||||
grams=(list mail) :: all messages
|
grams=(list mail) :: all messages
|
||||||
known=(set [target serial]) :: known message lookup
|
known=(set [target serial]) :: known message lookup
|
||||||
count=@ud :: (lent grams)
|
count=@ud :: (lent grams)
|
||||||
@ -34,12 +34,25 @@
|
|||||||
settings=(set term) :: frontend flags
|
settings=(set term) :: frontend flags
|
||||||
width=@ud :: display width
|
width=@ud :: display width
|
||||||
timez=(pair ? @ud) :: timezone adjustment
|
timez=(pair ? @ud) :: timezone adjustment
|
||||||
cli=state=sole-share:sole-sur :: console state
|
==
|
||||||
|
::
|
||||||
|
+$ state-1
|
||||||
|
$: %1
|
||||||
|
grams=(list mail) :: all messages
|
||||||
|
known=(set [target serial:store]) :: known message lookup
|
||||||
|
count=@ud :: (lent grams)
|
||||||
|
bound=(map target glyph) :: bound circle glyphs
|
||||||
|
binds=(jug glyph target) :: circle glyph lookup
|
||||||
|
audience=(set target) :: active targets
|
||||||
|
settings=(set term) :: frontend flags
|
||||||
|
width=@ud :: display width
|
||||||
|
timez=(pair ? @ud) :: timezone adjustment
|
||||||
|
cli=state=sole-share:sole :: console state
|
||||||
eny=@uvJ :: entropy
|
eny=@uvJ :: entropy
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ state-0
|
+$ state-0
|
||||||
$: grams=(list [[=ship =path] envelope]) :: all messages
|
$: grams=(list [[=ship =path] envelope:store]) :: all messages
|
||||||
known=(set [[=ship =path] serial]) :: known message lookup
|
known=(set [[=ship =path] serial]) :: known message lookup
|
||||||
count=@ud :: (lent grams)
|
count=@ud :: (lent grams)
|
||||||
bound=(map [=ship =path] glyph) :: bound circle glyphs
|
bound=(map [=ship =path] glyph) :: bound circle glyphs
|
||||||
@ -48,11 +61,11 @@
|
|||||||
settings=(set term) :: frontend flags
|
settings=(set term) :: frontend flags
|
||||||
width=@ud :: display width
|
width=@ud :: display width
|
||||||
timez=(pair ? @ud) :: timezone adjustment
|
timez=(pair ? @ud) :: timezone adjustment
|
||||||
cli=state=sole-share:sole-sur :: console state
|
cli=state=sole-share:sole :: console state
|
||||||
eny=@uvJ :: entropy
|
eny=@uvJ :: entropy
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ mail [source=target envelope]
|
+$ mail [source=target envelope:store]
|
||||||
+$ target [in-group=? =ship =path]
|
+$ target [in-group=? =ship =path]
|
||||||
::
|
::
|
||||||
+$ glyph char
|
+$ glyph char
|
||||||
@ -62,7 +75,7 @@
|
|||||||
::
|
::
|
||||||
+$ command
|
+$ command
|
||||||
$% [%target (set target)] :: set messaging target
|
$% [%target (set target)] :: set messaging target
|
||||||
[%say letter] :: send message
|
[%say letter:store] :: send message
|
||||||
[%eval cord hoon] :: send #-message
|
[%eval cord hoon] :: send #-message
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
@ -91,18 +104,20 @@
|
|||||||
== ::
|
== ::
|
||||||
::
|
::
|
||||||
--
|
--
|
||||||
=| state-1
|
=| state-2
|
||||||
=* state -
|
=* state -
|
||||||
::
|
::
|
||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
%+ verb |
|
%+ verb |
|
||||||
^- agent:gall
|
%- (agent:shoe command)
|
||||||
|
^- (shoe:shoe command)
|
||||||
=<
|
=<
|
||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
talk-core +>
|
talk-core +>
|
||||||
tc ~(. talk-core(eny eny.bowl) bowl)
|
tc ~(. talk-core bowl)
|
||||||
def ~(. (default-agent this %|) bowl)
|
def ~(. (default-agent this %|) bowl)
|
||||||
|
des ~(. (default:shoe this command) bowl)
|
||||||
::
|
::
|
||||||
++ on-init
|
++ on-init
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
@ -124,18 +139,9 @@
|
|||||||
=^ cards state
|
=^ cards state
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%noun (poke-noun:tc !<(* vase))
|
%noun (poke-noun:tc !<(* vase))
|
||||||
%sole-action (poke-sole-action:tc !<(sole-action:sole-sur vase))
|
|
||||||
==
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-watch
|
|
||||||
|= =path
|
|
||||||
^- (quip card _this)
|
|
||||||
=^ cards state (peer:tc path)
|
|
||||||
[cards this]
|
|
||||||
::
|
|
||||||
++ on-leave on-leave:def
|
|
||||||
++ on-peek on-peek:def
|
|
||||||
++ on-agent
|
++ on-agent
|
||||||
|= [=wire =sign:agent:gall]
|
|= [=wire =sign:agent:gall]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
@ -153,14 +159,39 @@
|
|||||||
::
|
::
|
||||||
%fact
|
%fact
|
||||||
?+ p.cage.sign ~|([%chat-cli-bad-sub-mark wire p.cage.sign] !!)
|
?+ p.cage.sign ~|([%chat-cli-bad-sub-mark wire p.cage.sign] !!)
|
||||||
%chat-update (diff-chat-update:tc wire !<(chat-update q.cage.sign))
|
%chat-update (diff-chat-update:tc wire !<(update:store q.cage.sign))
|
||||||
%invite-update (handle-invite-update:tc !<(invite-update q.cage.sign))
|
%invite-update (handle-invite-update:tc !<(invite-update q.cage.sign))
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
|
++ on-watch on-watch:def
|
||||||
|
++ on-leave on-leave:def
|
||||||
|
++ on-peek on-peek:def
|
||||||
++ on-arvo on-arvo:def
|
++ on-arvo on-arvo:def
|
||||||
++ on-fail on-fail:def
|
++ on-fail on-fail:def
|
||||||
|
::
|
||||||
|
++ command-parser
|
||||||
|
|= sole-id=@ta
|
||||||
|
parser:sh:tc
|
||||||
|
::
|
||||||
|
++ tab-list
|
||||||
|
|= sole-id=@ta
|
||||||
|
tab-list:sh:tc
|
||||||
|
::
|
||||||
|
++ on-command
|
||||||
|
|= [sole-id=@ta =command]
|
||||||
|
=^ cards state
|
||||||
|
(work:sh:tc command)
|
||||||
|
[cards this]
|
||||||
|
::
|
||||||
|
++ on-connect
|
||||||
|
|= sole-id=@ta
|
||||||
|
^- (quip card _this)
|
||||||
|
[[prompt:sh-out:tc ~] this]
|
||||||
|
::
|
||||||
|
++ can-connect can-connect:des
|
||||||
|
++ on-disconnect on-disconnect:des
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
@ -183,13 +214,9 @@
|
|||||||
?: (~(has by wex.bowl) [/chat-store our-self %chat-store]) ~
|
?: (~(has by wex.bowl) [/chat-store our-self %chat-store]) ~
|
||||||
~[connect]
|
~[connect]
|
||||||
::
|
::
|
||||||
^- state-1
|
^- state-2
|
||||||
?- -.u.old
|
=? u.old ?=(?(~ ^) -.u.old)
|
||||||
%1
|
^- state-1
|
||||||
=? width.u.old =(0 width.u.old) 80
|
|
||||||
u.old(bound (~(gas by *(map target glyph)) ~(tap by bound.u.old)))
|
|
||||||
::
|
|
||||||
?(~ ^)
|
|
||||||
:- %1
|
:- %1
|
||||||
%= u.old
|
%= u.old
|
||||||
grams ~ ::NOTE this only impacts historic message lookup in chat-cli
|
grams ~ ::NOTE this only impacts historic message lookup in chat-cli
|
||||||
@ -221,21 +248,30 @@
|
|||||||
|= t=[ship path]
|
|= t=[ship path]
|
||||||
`target`[| t]
|
`target`[| t]
|
||||||
==
|
==
|
||||||
==
|
::
|
||||||
|
=? u.old ?=(%1 -.u.old)
|
||||||
|
^- state-2
|
||||||
|
=, u.old
|
||||||
|
:* %2
|
||||||
|
grams known count
|
||||||
|
bound binds audience
|
||||||
|
settings width timez
|
||||||
|
==
|
||||||
|
::
|
||||||
|
?> ?=(%2 -.u.old)
|
||||||
|
u.old
|
||||||
:: +catch-up: process all chat-store state
|
:: +catch-up: process all chat-store state
|
||||||
::
|
::
|
||||||
++ catch-up
|
++ catch-up
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?. .^(? %gu /(scot %p our.bowl)/chat-store/(scot %da now.bowl))
|
=/ =inbox:store
|
||||||
[~ state]
|
(scry-for inbox:store %chat-store /all)
|
||||||
=/ =inbox
|
|
||||||
(scry-for inbox %chat-store /all)
|
|
||||||
|- ^- (quip card _state)
|
|- ^- (quip card _state)
|
||||||
?~ inbox [~ state]
|
?~ inbox [~ state]
|
||||||
=* path p.n.inbox
|
=* path p.n.inbox
|
||||||
=* mailbox q.n.inbox
|
=* mailbox q.n.inbox
|
||||||
=/ =target (path-to-target path)
|
=/ =target (path-to-target path)
|
||||||
=^ cards-n state (read-envelopes target envelopes.mailbox)
|
=^ cards-n state (read-envelopes target (flop envelopes.mailbox))
|
||||||
=^ cards-l state $(inbox l.inbox)
|
=^ cards-l state $(inbox l.inbox)
|
||||||
=^ cards-r state $(inbox r.inbox)
|
=^ cards-r state $(inbox r.inbox)
|
||||||
[:(weld cards-n cards-l cards-r) state]
|
[:(weld cards-n cards-l cards-r) state]
|
||||||
@ -249,7 +285,8 @@
|
|||||||
^- card
|
^- card
|
||||||
[%pass /invites %agent [our.bowl %invite-store] %watch /invitatory/chat]
|
[%pass /invites %agent [our.bowl %invite-store] %watch /invitatory/chat]
|
||||||
::
|
::
|
||||||
++ our-self (name:title our.bowl)
|
::TODO better moon support. (name:title our.bowl)
|
||||||
|
++ our-self our.bowl
|
||||||
:: +target-to-path: prepend ship to the path
|
:: +target-to-path: prepend ship to the path
|
||||||
::
|
::
|
||||||
++ target-to-path
|
++ target-to-path
|
||||||
@ -284,28 +321,6 @@
|
|||||||
?: ?=(%catch-up a)
|
?: ?=(%catch-up a)
|
||||||
catch-up
|
catch-up
|
||||||
[~ state]
|
[~ state]
|
||||||
:: +poke-sole-action: handle cli input
|
|
||||||
::
|
|
||||||
++ poke-sole-action
|
|
||||||
::TODO use id.act to support multiple separate sessions
|
|
||||||
|= [act=sole-action:sole-sur]
|
|
||||||
^- (quip card _state)
|
|
||||||
(sole:sh-in act)
|
|
||||||
:: +peer: accept only cli subscriptions from ourselves
|
|
||||||
::
|
|
||||||
++ peer
|
|
||||||
|= =path
|
|
||||||
^- (quip card _state)
|
|
||||||
?. (team:title our-self src.bowl)
|
|
||||||
~| [%peer-talk-stranger src.bowl]
|
|
||||||
!!
|
|
||||||
?. ?=([%sole *] path)
|
|
||||||
~| [%peer-talk-strange path]
|
|
||||||
!!
|
|
||||||
:: display a fresh prompt
|
|
||||||
:- [prompt:sh-out ~]
|
|
||||||
:: start with fresh sole state
|
|
||||||
state(state.cli *sole-share:sole-sur)
|
|
||||||
:: +handle-invite-update: get new invites
|
:: +handle-invite-update: get new invites
|
||||||
::
|
::
|
||||||
++ handle-invite-update
|
++ handle-invite-update
|
||||||
@ -317,17 +332,17 @@
|
|||||||
:: +diff-chat-update: get new mailboxes & messages
|
:: +diff-chat-update: get new mailboxes & messages
|
||||||
::
|
::
|
||||||
++ diff-chat-update
|
++ diff-chat-update
|
||||||
|= [=wire upd=chat-update]
|
|= [=wire upd=update:store]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?+ -.upd [~ state]
|
?+ -.upd [~ state]
|
||||||
%create (notice-create (path-to-target path.upd))
|
%create (notice-create (path-to-target path.upd))
|
||||||
%delete [[(show-delete:sh-out (path-to-target path.upd)) ~] state]
|
%delete [[(show-delete:sh-out (path-to-target path.upd)) ~] state]
|
||||||
%message (read-envelope (path-to-target path.upd) envelope.upd)
|
%message (read-envelope (path-to-target path.upd) envelope.upd)
|
||||||
%messages (read-envelopes (path-to-target path.upd) envelopes.upd)
|
%messages (read-envelopes (path-to-target path.upd) (flop envelopes.upd))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ read-envelopes
|
++ read-envelopes
|
||||||
|= [=target envs=(list envelope)]
|
|= [=target envs=(list envelope:store)]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?~ envs [~ state]
|
?~ envs [~ state]
|
||||||
=^ cards-i state (read-envelope target i.envs)
|
=^ cards-i state (read-envelope target i.envs)
|
||||||
@ -413,7 +428,7 @@
|
|||||||
:: +read-envelope: add envelope to state and show it to user
|
:: +read-envelope: add envelope to state and show it to user
|
||||||
::
|
::
|
||||||
++ read-envelope
|
++ read-envelope
|
||||||
|= [=target =envelope]
|
|= [=target =envelope:store]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?: (~(has in known) [target uid.envelope])
|
?: (~(has in known) [target uid.envelope])
|
||||||
::NOTE we no-op only because edits aren't possible
|
::NOTE we no-op only because edits aren't possible
|
||||||
@ -425,132 +440,16 @@
|
|||||||
count +(count)
|
count +(count)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:: +sh-in: handle user input
|
:: +sh: shoe handling
|
||||||
::
|
::
|
||||||
++ sh-in
|
++ sh
|
||||||
::NOTE interestingly, adding =, sh-out breaks compliation
|
|
||||||
|%
|
|%
|
||||||
:: +sole: apply sole action
|
|
||||||
::
|
|
||||||
++ sole
|
|
||||||
|= act=sole-action:sole-sur
|
|
||||||
^- (quip card _state)
|
|
||||||
?- -.dat.act
|
|
||||||
%det (edit +.dat.act)
|
|
||||||
%clr [~ state]
|
|
||||||
%ret obey
|
|
||||||
%tab (tab +.dat.act)
|
|
||||||
==
|
|
||||||
:: +tab-list: static list of autocomplete entries
|
|
||||||
++ tab-list
|
|
||||||
^- (list (option:auto tank))
|
|
||||||
:~
|
|
||||||
[%join leaf+";join ~ship/chat-name (glyph)"]
|
|
||||||
[%leave leaf+";leave ~ship/chat-name"]
|
|
||||||
::
|
|
||||||
[%create leaf+";create [type] /chat-name (glyph)"]
|
|
||||||
[%delete leaf+";delete /chat-name"]
|
|
||||||
[%invite leaf+";invite /chat-name ~ships"]
|
|
||||||
[%banish leaf+";banish /chat-name ~ships"]
|
|
||||||
::
|
|
||||||
[%bind leaf+";bind [glyph] ~ship/chat-name"]
|
|
||||||
[%unbind leaf+";unbind [glyph]"]
|
|
||||||
[%what leaf+";what (~ship/chat-name) (glyph)"]
|
|
||||||
::
|
|
||||||
[%settings leaf+";settings"]
|
|
||||||
[%set leaf+";set key (value)"]
|
|
||||||
[%unset leaf+";unset key"]
|
|
||||||
::
|
|
||||||
[%chats leaf+";chats"]
|
|
||||||
[%help leaf+";help"]
|
|
||||||
==
|
|
||||||
++ tab
|
|
||||||
|= pos=@ud
|
|
||||||
^- (quip card _state)
|
|
||||||
?: ?| =(~ buf.state.cli)
|
|
||||||
!=(';' -.buf.state.cli)
|
|
||||||
==
|
|
||||||
:_ state
|
|
||||||
[(effect:sh-out [%bel ~]) ~]
|
|
||||||
::
|
|
||||||
=+ (get-id:auto pos (tufa buf.state.cli))
|
|
||||||
=/ needle=term
|
|
||||||
(fall id '')
|
|
||||||
?: &(!=(pos 1) =(0 (met 3 needle)))
|
|
||||||
[~ state] :: autocomplete empty command iff user at start of command
|
|
||||||
=/ options=(list (option:auto tank))
|
|
||||||
(search-prefix:auto needle tab-list)
|
|
||||||
=/ advance=term
|
|
||||||
(longest-match:auto options)
|
|
||||||
=/ to-send=tape
|
|
||||||
(trip (rsh 3 (met 3 needle) advance))
|
|
||||||
=/ send-pos
|
|
||||||
(add pos (met 3 (fall forward '')))
|
|
||||||
=| moves=(list card)
|
|
||||||
=? moves ?=(^ options)
|
|
||||||
[(tab:sh-out options) moves]
|
|
||||||
=| fxs=(list sole-effect:sole-sur)
|
|
||||||
|- ^- (quip card _state)
|
|
||||||
?~ to-send
|
|
||||||
[(flop moves) state]
|
|
||||||
=^ char state.cli
|
|
||||||
(~(transmit sole-lib state.cli) [%ins send-pos `@c`i.to-send])
|
|
||||||
%_ $
|
|
||||||
moves [(effect:sh-out %det char) moves]
|
|
||||||
send-pos +(send-pos)
|
|
||||||
to-send t.to-send
|
|
||||||
==
|
|
||||||
:: +edit: apply sole edit
|
|
||||||
::
|
|
||||||
:: called when typing into the cli prompt.
|
|
||||||
:: applies the change and does sanitizing.
|
|
||||||
::
|
|
||||||
++ edit
|
|
||||||
|= cal=sole-change:sole-sur
|
|
||||||
^- (quip card _state)
|
|
||||||
=^ inv state.cli (~(transceive sole-lib state.cli) cal)
|
|
||||||
=+ fix=(sanity inv buf.state.cli)
|
|
||||||
?~ lit.fix
|
|
||||||
[~ state]
|
|
||||||
:: just capital correction
|
|
||||||
?~ err.fix
|
|
||||||
(slug fix)
|
|
||||||
:: allow interior edits and deletes
|
|
||||||
?. &(?=($del -.inv) =(+(p.inv) (lent buf.state.cli)))
|
|
||||||
[~ state]
|
|
||||||
(slug fix)
|
|
||||||
:: +sanity: check input sanity
|
|
||||||
::
|
|
||||||
:: parses cli prompt using +read.
|
|
||||||
:: if invalid, produces error correction description, for use with +slug.
|
|
||||||
::
|
|
||||||
++ sanity
|
|
||||||
|= [inv=sole-edit:sole-sur buf=(list @c)]
|
|
||||||
^- [lit=(list sole-edit:sole-sur) err=(unit @u)]
|
|
||||||
=+ res=(rose (tufa buf) read)
|
|
||||||
?: ?=(%& -.res) [~ ~]
|
|
||||||
[[inv]~ `p.res]
|
|
||||||
:: +slug: apply error correction to prompt input
|
|
||||||
::
|
|
||||||
++ slug
|
|
||||||
|= [lit=(list sole-edit:sole-sur) err=(unit @u)]
|
|
||||||
^- (quip card _state)
|
|
||||||
?~ lit [~ state]
|
|
||||||
=^ lic state.cli
|
|
||||||
%- ~(transmit sole-lib state.cli)
|
|
||||||
^- sole-edit:sole-sur
|
|
||||||
?~(t.lit i.lit [%mor lit])
|
|
||||||
:_ state
|
|
||||||
:_ ~
|
|
||||||
%+ effect:sh-out %mor
|
|
||||||
:- [%det lic]
|
|
||||||
?~(err ~ [%err u.err]~)
|
|
||||||
:: +read: command parser
|
:: +read: command parser
|
||||||
::
|
::
|
||||||
:: parses the command line buffer.
|
:: parses the command line buffer.
|
||||||
:: produces commands which can be executed by +work.
|
:: produces commands which can be executed by +work.
|
||||||
::
|
::
|
||||||
++ read
|
++ parser
|
||||||
|^
|
|^
|
||||||
%+ knee *command |. ~+
|
%+ knee *command |. ~+
|
||||||
=- ;~(pose ;~(pfix mic -) message)
|
=- ;~(pose ;~(pfix mic -) message)
|
||||||
@ -733,7 +632,7 @@
|
|||||||
::
|
::
|
||||||
++ text
|
++ text
|
||||||
%+ cook crip
|
%+ cook crip
|
||||||
(plus ;~(less (jest '•') next))
|
(plus next)
|
||||||
:: +expr: parse expression into [cord hoon]
|
:: +expr: parse expression into [cord hoon]
|
||||||
::
|
::
|
||||||
++ expr
|
++ expr
|
||||||
@ -742,33 +641,29 @@
|
|||||||
%+ stag (crip q.tub)
|
%+ stag (crip q.tub)
|
||||||
wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%])
|
wide:(vang & [&1:% &2:% (scot %da now.bowl) |3:%])
|
||||||
--
|
--
|
||||||
:: +obey: apply result
|
:: +tab-list: command descriptions
|
||||||
::
|
::
|
||||||
:: called upon hitting return in the prompt.
|
++ tab-list
|
||||||
:: if input is invalid, +slug is called.
|
^- (list [@t tank])
|
||||||
:: otherwise, the appropriate work is done and
|
:~
|
||||||
:: the command (if any) gets echoed to the user.
|
[%join leaf+";join ~ship/chat-name (glyph)"]
|
||||||
::
|
[%leave leaf+";leave ~ship/chat-name"]
|
||||||
++ obey
|
::
|
||||||
^- (quip card _state)
|
[%create leaf+";create [type] /chat-name (glyph)"]
|
||||||
=+ buf=buf.state.cli
|
[%delete leaf+";delete /chat-name"]
|
||||||
=+ fix=(sanity [%nop ~] buf)
|
[%invite leaf+";invite /chat-name ~ships"]
|
||||||
?^ lit.fix
|
[%banish leaf+";banish /chat-name ~ships"]
|
||||||
(slug fix)
|
::
|
||||||
=+ jub=(rust (tufa buf) read)
|
[%bind leaf+";bind [glyph] ~ship/chat-name"]
|
||||||
?~ jub [[(effect:sh-out %bel ~) ~] state]
|
[%unbind leaf+";unbind [glyph]"]
|
||||||
=^ cal state.cli (~(transmit sole-lib state.cli) [%set ~])
|
[%what leaf+";what (~ship/chat-name) (glyph)"]
|
||||||
=^ cards state (work u.jub)
|
::
|
||||||
:_ state
|
[%settings leaf+";settings"]
|
||||||
%+ weld
|
[%set leaf+";set key (value)"]
|
||||||
^- (list card)
|
[%unset leaf+";unset key"]
|
||||||
:: echo commands into scrollback
|
::
|
||||||
?. =(`0 (find ";" buf)) ~
|
[%chats leaf+";chats"]
|
||||||
[(note:sh-out (tufa `(list @)`buf)) ~]
|
[%help leaf+";help"]
|
||||||
:_ cards
|
|
||||||
%+ effect:sh-out %mor
|
|
||||||
:~ [%nex ~]
|
|
||||||
[%det cal]
|
|
||||||
==
|
==
|
||||||
:: +work: run user command
|
:: +work: run user command
|
||||||
::
|
::
|
||||||
@ -853,7 +748,7 @@
|
|||||||
%channel %channel
|
%channel %channel
|
||||||
?(%village %village-with-group) %village
|
?(%village %village-with-group) %village
|
||||||
==
|
==
|
||||||
?^ (scry-for (unit mailbox) %chat-store [%mailbox real-path])
|
?^ (scry-for (unit mailbox:store) %chat-store [%mailbox real-path])
|
||||||
=- [[- ~] state]
|
=- [[- ~] state]
|
||||||
%- print:sh-out
|
%- print:sh-out
|
||||||
"{(spud path)} already exists!"
|
"{(spud path)} already exists!"
|
||||||
@ -864,7 +759,7 @@
|
|||||||
=- [[- moz] state]
|
=- [[- moz] state]
|
||||||
%^ act %do-create %chat-view
|
%^ act %do-create %chat-view
|
||||||
:- %chat-view-action
|
:- %chat-view-action
|
||||||
!> ^- chat-view-action
|
!> ^- action:view
|
||||||
:* %create
|
:* %create
|
||||||
(rsh 3 1 (spat path))
|
(rsh 3 1 (spat path))
|
||||||
''
|
''
|
||||||
@ -882,7 +777,7 @@
|
|||||||
=- [[- ~] state]
|
=- [[- ~] state]
|
||||||
%^ act %do-delete %chat-view
|
%^ act %do-delete %chat-view
|
||||||
:- %chat-view-action
|
:- %chat-view-action
|
||||||
!> ^- chat-view-action
|
!> ^- action:view
|
||||||
[%delete (target-to-path | our-self path)]
|
[%delete (target-to-path | our-self path)]
|
||||||
:: +change-permission: modify permissions on a local chat
|
:: +change-permission: modify permissions on a local chat
|
||||||
::
|
::
|
||||||
@ -941,7 +836,7 @@
|
|||||||
:: gives ugly %chat-hook-reap
|
:: gives ugly %chat-hook-reap
|
||||||
%^ act %do-join %chat-view
|
%^ act %do-join %chat-view
|
||||||
:- %chat-view-action
|
:- %chat-view-action
|
||||||
!> ^- chat-view-action
|
!> ^- action:view
|
||||||
[%join ship.target (target-to-path target) (fall ask-history %.y)]
|
[%join ship.target (target-to-path target) (fall ask-history %.y)]
|
||||||
:: +leave: unsync & destroy mailbox
|
:: +leave: unsync & destroy mailbox
|
||||||
::
|
::
|
||||||
@ -954,22 +849,22 @@
|
|||||||
"can't ;leave local chats, maybe use ;delete instead"
|
"can't ;leave local chats, maybe use ;delete instead"
|
||||||
%^ act %do-leave %chat-hook
|
%^ act %do-leave %chat-hook
|
||||||
:- %chat-hook-action
|
:- %chat-hook-action
|
||||||
!> ^- chat-hook-action
|
!> ^- action:hook
|
||||||
[%remove (target-to-path target)]
|
[%remove (target-to-path target)]
|
||||||
:: +say: send messages
|
:: +say: send messages
|
||||||
::
|
::
|
||||||
++ say
|
++ say
|
||||||
|= =letter
|
|= =letter:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
~! bowl
|
~! bowl
|
||||||
=/ =serial (shaf %msg-uid eny.bowl)
|
=/ =serial (shaf %msg-uid eny.bowl)
|
||||||
:_ state(eny (shax eny.bowl))
|
:_ state
|
||||||
^- (list card)
|
^- (list card)
|
||||||
%+ turn ~(tap in audience)
|
%+ turn ~(tap in audience)
|
||||||
|= =target
|
|= =target
|
||||||
%^ act %out-message %chat-hook
|
%^ act %out-message %chat-hook
|
||||||
:- %chat-action
|
:- %chat-action
|
||||||
!> ^- chat-action
|
!> ^- action:store
|
||||||
:+ %message (target-to-path target)
|
:+ %message (target-to-path target)
|
||||||
[serial *@ our-self now.bowl letter]
|
[serial *@ our-self now.bowl letter]
|
||||||
:: +eval: run hoon, send code and result as message
|
:: +eval: run hoon, send code and result as message
|
||||||
@ -978,7 +873,7 @@
|
|||||||
::
|
::
|
||||||
++ eval
|
++ eval
|
||||||
|= [txt=cord exe=hoon]
|
|= [txt=cord exe=hoon]
|
||||||
(say %code txt (eval:chat-eval bowl exe))
|
(say %code txt (eval:store bowl exe))
|
||||||
:: +lookup-glyph: print glyph info for all, glyph or target
|
:: +lookup-glyph: print glyph info for all, glyph or target
|
||||||
::
|
::
|
||||||
++ lookup-glyph
|
++ lookup-glyph
|
||||||
@ -1041,7 +936,7 @@
|
|||||||
::
|
::
|
||||||
++ set-width
|
++ set-width
|
||||||
|= w=@ud
|
|= w=@ud
|
||||||
[~ state(width w)]
|
[~ state(width (max 40 w))]
|
||||||
:: +set-timezone: configure timestamp printing adjustment
|
:: +set-timezone: configure timestamp printing adjustment
|
||||||
::
|
::
|
||||||
++ set-timezone
|
++ set-timezone
|
||||||
@ -1121,23 +1016,16 @@
|
|||||||
--
|
--
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
:: +sh-out: output to the cli
|
:: +sh-out: ouput to session
|
||||||
::
|
::
|
||||||
++ sh-out
|
++ sh-out
|
||||||
|%
|
|%
|
||||||
:: +effect: console effect card
|
:: +effect: console effect card for all listeners
|
||||||
::
|
::
|
||||||
++ effect
|
++ effect
|
||||||
|= fec=sole-effect:sole-sur
|
|= effect=sole-effect:sole
|
||||||
^- card
|
^- card
|
||||||
::TODO don't hard-code session id 'drum' here
|
[%shoe ~ %sole effect]
|
||||||
[%give %fact ~[/sole/drum] %sole-effect !>(fec)]
|
|
||||||
:: +tab: print tab-complete list
|
|
||||||
::
|
|
||||||
++ tab
|
|
||||||
|= options=(list [cord tank])
|
|
||||||
^- card
|
|
||||||
(effect %tab options)
|
|
||||||
:: +print: puts some text into the cli as-is
|
:: +print: puts some text into the cli as-is
|
||||||
::
|
::
|
||||||
++ print
|
++ print
|
||||||
@ -1190,7 +1078,7 @@
|
|||||||
:: and the %notify flag is set, emit a bell.
|
:: and the %notify flag is set, emit a bell.
|
||||||
::
|
::
|
||||||
++ show-envelope
|
++ show-envelope
|
||||||
|= [=target =envelope]
|
|= [=target =envelope:store]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
%+ weld
|
%+ weld
|
||||||
^- (list card)
|
^- (list card)
|
||||||
@ -1310,13 +1198,14 @@
|
|||||||
:: +mr: render messages
|
:: +mr: render messages
|
||||||
::
|
::
|
||||||
++ mr
|
++ mr
|
||||||
|
=, sole
|
||||||
|_ $: source=target
|
|_ $: source=target
|
||||||
envelope
|
envelope:store
|
||||||
==
|
==
|
||||||
:: +activate: produce sole-effect for printing message details
|
:: +activate: produce sole-effect for printing message details
|
||||||
::
|
::
|
||||||
++ render-activate
|
++ render-activate
|
||||||
^- sole-effect:sole-sur
|
^- sole-effect
|
||||||
~[%mor [%tan meta] body]
|
~[%mor [%tan meta] body]
|
||||||
:: +meta: render message metadata (serial, timestamp, author, target)
|
:: +meta: render message metadata (serial, timestamp, author, target)
|
||||||
::
|
::
|
||||||
@ -1329,7 +1218,7 @@
|
|||||||
:: +body: long-form render of message contents
|
:: +body: long-form render of message contents
|
||||||
::
|
::
|
||||||
++ body
|
++ body
|
||||||
|- ^- sole-effect:sole-sur
|
|- ^- sole-effect
|
||||||
?- -.letter
|
?- -.letter
|
||||||
?(%text %me)
|
?(%text %me)
|
||||||
=/ pre=tape ?:(?=(%me -.letter) "@ " "")
|
=/ pre=tape ?:(?=(%me -.letter) "@ " "")
|
||||||
@ -1341,7 +1230,7 @@
|
|||||||
%code
|
%code
|
||||||
=/ texp=tape ['>' ' ' (trip expression.letter)]
|
=/ texp=tape ['>' ' ' (trip expression.letter)]
|
||||||
:- %mor
|
:- %mor
|
||||||
|- ^- (list sole-effect:sole-sur)
|
|- ^- (list sole-effect)
|
||||||
?: =("" texp) [tan+output.letter ~]
|
?: =("" texp) [tan+output.letter ~]
|
||||||
=/ newl (find "\0a" texp)
|
=/ newl (find "\0a" texp)
|
||||||
?~ newl [txt+texp $(texp "")]
|
?~ newl [txt+texp $(texp "")]
|
||||||
@ -1454,8 +1343,13 @@
|
|||||||
~(glyph tr source)
|
~(glyph tr source)
|
||||||
=/ lis=(list tape)
|
=/ lis=(list tape)
|
||||||
%+ simple-wrap
|
%+ simple-wrap
|
||||||
~| [%weird-text `@`+.letter]
|
=/ result=(each tape tang)
|
||||||
`tape``(list @)`(tuba (trip +.letter))
|
%- mule |.
|
||||||
|
`(list @)`(tuba (trip +.letter))
|
||||||
|
?- -.result
|
||||||
|
%& p.result
|
||||||
|
%| "[[msg rendering error]]"
|
||||||
|
==
|
||||||
(sub wyd (min (div wyd 2) (lent pef)))
|
(sub wyd (min (div wyd 2) (lent pef)))
|
||||||
=+ lef=(lent pef)
|
=+ lef=(lent pef)
|
||||||
=+ ?:((gth (lent lis) 0) (snag 0 lis) "")
|
=+ ?:((gth (lent lis) 0) (snag 0 lis) "")
|
||||||
@ -1487,6 +1381,8 @@
|
|||||||
^- (list tape)
|
^- (list tape)
|
||||||
?~ txt ~
|
?~ txt ~
|
||||||
=/ [end=@ud nex=?]
|
=/ [end=@ud nex=?]
|
||||||
|
=+ ret=(find "\0a" (scag +(wid) `tape`txt))
|
||||||
|
?^ ret [u.ret &]
|
||||||
?: (lte (lent txt) wid) [(lent txt) &]
|
?: (lte (lent txt) wid) [(lent txt) &]
|
||||||
=+ ace=(find " " (flop (scag +(wid) `tape`txt)))
|
=+ ace=(find " " (flop (scag +(wid) `tape`txt)))
|
||||||
?~ ace [wid |]
|
?~ ace [wid |]
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
:: mirror chat data from foreign to local based on read permissions
|
:: mirror chat data from foreign to local based on read permissions
|
||||||
:: allow sending chat messages to foreign paths based on write perms
|
:: allow sending chat messages to foreign paths based on write perms
|
||||||
::
|
::
|
||||||
/- *permission-store, *chat-hook, *invite-store, *metadata-store,
|
/- *permission-store, *invite-store, *metadata-store,
|
||||||
*permission-hook, *group-store, *permission-group-hook ::TMP for upgrade
|
*permission-hook, *group-store, *permission-group-hook, ::TMP for upgrade
|
||||||
/+ *chat-json, *chat-eval, default-agent, verb, dbug
|
hook=chat-hook,
|
||||||
|
view=chat-view
|
||||||
|
/+ default-agent, verb, dbug, store=chat-store
|
||||||
|
~% %chat-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
::
|
::
|
||||||
@ -20,29 +23,30 @@
|
|||||||
==
|
==
|
||||||
+$ state-0 [%0 state-base]
|
+$ state-0 [%0 state-base]
|
||||||
+$ state-base
|
+$ state-base
|
||||||
$: =synced
|
$: =synced:hook
|
||||||
invite-created=_|
|
invite-created=_|
|
||||||
allow-history=(map path ?)
|
allow-history=(map path ?)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ poke
|
+$ poke
|
||||||
$% [%chat-action chat-action]
|
$% [%chat-action action:store]
|
||||||
[%permission-action permission-action]
|
[%permission-action permission-action]
|
||||||
[%invite-action invite-action]
|
[%invite-action invite-action]
|
||||||
[%chat-view-action chat-view-action]
|
[%chat-view-action action:view]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ fact
|
+$ fact
|
||||||
$% [%chat-update chat-update]
|
$% [%chat-update update:store]
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
=| state-1
|
=| state-1
|
||||||
=* state -
|
=* state -
|
||||||
::
|
::
|
||||||
%+ verb |
|
|
||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
|
%+ verb |
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
=<
|
=<
|
||||||
|
~% %chat-hook-agent-core ..poke-json ~
|
||||||
|_ bol=bowl:gall
|
|_ bol=bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
chat-core +>
|
chat-core +>
|
||||||
@ -106,8 +110,8 @@
|
|||||||
++ recreate-chat
|
++ recreate-chat
|
||||||
|= [host=ship chat=path new-chat=path]
|
|= [host=ship chat=path new-chat=path]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
=/ old-mailbox=mailbox
|
=/ old-mailbox=mailbox:store
|
||||||
(need (scry:cc (unit mailbox) %chat-store [%mailbox chat]))
|
(need (scry:cc (unit mailbox:store) %chat-store [%mailbox chat]))
|
||||||
=* enves envelopes.old-mailbox
|
=* enves envelopes.old-mailbox
|
||||||
:~ (chat-poke:cc [%delete new-chat])
|
:~ (chat-poke:cc [%delete new-chat])
|
||||||
(chat-poke:cc [%delete chat])
|
(chat-poke:cc [%delete chat])
|
||||||
@ -115,7 +119,7 @@
|
|||||||
(chat-poke:cc [%messages new-chat enves])
|
(chat-poke:cc [%messages new-chat enves])
|
||||||
(chat-poke:cc [%read new-chat])
|
(chat-poke:cc [%read new-chat])
|
||||||
%^ make-poke %chat-hook %chat-hook-action
|
%^ make-poke %chat-hook %chat-hook-action
|
||||||
!> ^- chat-hook-action
|
!> ^- action:hook
|
||||||
?: =(our.bol host) [%add-owned new-chat %.y]
|
?: =(our.bol host) [%add-owned new-chat %.y]
|
||||||
[%add-synced host new-chat %.y]
|
[%add-synced host new-chat %.y]
|
||||||
==
|
==
|
||||||
@ -222,23 +226,25 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|
~/ %chat-hook-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
=^ cards state
|
=^ cards state
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%json (poke-json:cc !<(json vase))
|
%json (poke-json:cc !<(json vase))
|
||||||
%chat-action (poke-chat-action:cc !<(chat-action vase))
|
%chat-action (poke-chat-action:cc !<(action:store vase))
|
||||||
%noun
|
%noun
|
||||||
?: =(%store-load q.vase)
|
?: =(%store-load q.vase)
|
||||||
[loaded-cards.state state(loaded-cards ~)]
|
[loaded-cards.state state(loaded-cards ~)]
|
||||||
[~ state]
|
[~ state]
|
||||||
::
|
::
|
||||||
%chat-hook-action
|
%chat-hook-action
|
||||||
(poke-chat-hook-action:cc !<(chat-hook-action vase))
|
(poke-chat-hook-action:cc !<(action:hook vase))
|
||||||
==
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-watch
|
++ on-watch
|
||||||
|
~/ %chat-hook-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?+ path (on-watch:def path)
|
?+ path (on-watch:def path)
|
||||||
@ -248,6 +254,7 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ on-agent
|
++ on-agent
|
||||||
|
~/ %chat-hook-agent
|
||||||
|= [=wire =sign:agent:gall]
|
|= [=wire =sign:agent:gall]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?+ -.sign (on-agent:def wire sign)
|
?+ -.sign (on-agent:def wire sign)
|
||||||
@ -265,7 +272,7 @@
|
|||||||
?+ p.cage.sign (on-agent:def wire sign)
|
?+ p.cage.sign (on-agent:def wire sign)
|
||||||
%chat-update
|
%chat-update
|
||||||
=^ cards state
|
=^ cards state
|
||||||
(fact-chat-update:cc wire !<(chat-update q.cage.sign))
|
(fact-chat-update:cc wire !<(update:store q.cage.sign))
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
%invite-update
|
%invite-update
|
||||||
@ -287,15 +294,16 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
|
~% %chat-hook-library ..card ~
|
||||||
|_ bol=bowl:gall
|
|_ bol=bowl:gall
|
||||||
::
|
::
|
||||||
++ poke-json
|
++ poke-json
|
||||||
|= jon=json
|
|= jon=json
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
(poke-chat-action (json-to-action jon))
|
(poke-chat-action (action:dejs:store jon))
|
||||||
::
|
::
|
||||||
++ poke-chat-action
|
++ poke-chat-action
|
||||||
|= act=chat-action
|
|= act=action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%message -.act)
|
?> ?=(%message -.act)
|
||||||
:: local
|
:: local
|
||||||
@ -306,7 +314,7 @@
|
|||||||
=* letter letter.envelope.act
|
=* letter letter.envelope.act
|
||||||
=? letter &(?=(%code -.letter) ?=(~ output.letter))
|
=? letter &(?=(%code -.letter) ?=(~ output.letter))
|
||||||
=/ =hoon (ream expression.letter)
|
=/ =hoon (ream expression.letter)
|
||||||
letter(output (eval bol hoon))
|
letter(output (eval:store bol hoon))
|
||||||
=/ ship (~(got by synced) path.act)
|
=/ ship (~(got by synced) path.act)
|
||||||
=/ appl ?:(=(ship our.bol) %chat-store %chat-hook)
|
=/ appl ?:(=(ship our.bol) %chat-store %chat-hook)
|
||||||
[%pass / %agent [ship appl] %poke %chat-action !>(act)]~
|
[%pass / %agent [ship appl] %poke %chat-action !>(act)]~
|
||||||
@ -322,7 +330,7 @@
|
|||||||
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]~
|
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]~
|
||||||
::
|
::
|
||||||
++ poke-chat-hook-action
|
++ poke-chat-hook-action
|
||||||
|= act=chat-hook-action
|
|= act=action:hook
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?- -.act
|
?- -.act
|
||||||
%add-owned
|
%add-owned
|
||||||
@ -346,7 +354,7 @@
|
|||||||
=/ chat-path [%mailbox path.act]
|
=/ chat-path [%mailbox path.act]
|
||||||
:_ state
|
:_ state
|
||||||
[%pass chat-path %agent [ship.act %chat-hook] %watch chat-path]~
|
[%pass chat-path %agent [ship.act %chat-hook] %watch chat-path]~
|
||||||
=/ mailbox=(unit mailbox) (chat-scry path.act)
|
=/ mailbox=(unit mailbox:store) (chat-scry path.act)
|
||||||
=/ chat-history=path
|
=/ chat-history=path
|
||||||
:- %backlog
|
:- %backlog
|
||||||
%+ weld path.act
|
%+ weld path.act
|
||||||
@ -357,17 +365,23 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
%remove
|
%remove
|
||||||
=/ ship (~(get by synced) path.act)
|
=/ ship=(unit ship)
|
||||||
?~ ship [~ state]
|
=/ ship (~(get by synced) path.act)
|
||||||
|
?^ ship ship
|
||||||
|
=? path.act ?=([%'~' *] path.act) t.path.act
|
||||||
|
?~ path.act ~
|
||||||
|
(slaw %p i.path.act)
|
||||||
|
?~ ship
|
||||||
|
~& [dap.bol %unknown-host-cannot-leave path.act]
|
||||||
|
[~ state]
|
||||||
?: &(!=(u.ship src.bol) ?!((team:title our.bol src.bol)))
|
?: &(!=(u.ship src.bol) ?!((team:title our.bol src.bol)))
|
||||||
[~ state]
|
[~ state]
|
||||||
=. synced (~(del by synced) path.act)
|
=. synced (~(del by synced) path.act)
|
||||||
:_ state
|
:_ state
|
||||||
%- zing
|
:* [%give %kick ~[[%mailbox path.act]] ~]
|
||||||
:~ (pull-wire [%backlog (weld path.act /0)])
|
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
||||||
(pull-wire [%mailbox path.act])
|
(pull-wire u.ship [%mailbox path.act])
|
||||||
[%give %kick ~[[%mailbox path.act]] ~]~
|
(pull-backlog-subscriptions u.ship path.act)
|
||||||
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]~
|
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -393,56 +407,31 @@
|
|||||||
^- (list card)
|
^- (list card)
|
||||||
?> ?=(^ pax)
|
?> ?=(^ pax)
|
||||||
=/ last (dec (lent pax))
|
=/ last (dec (lent pax))
|
||||||
=/ backlog-start=(unit @ud)
|
=/ backlog-latest=(unit @ud) (rush (snag last `(list @ta)`pax) dem:ag)
|
||||||
%+ rush
|
|
||||||
(snag last `(list @ta)`pax)
|
|
||||||
dem:ag
|
|
||||||
=/ pas `path`(oust [last 1] `(list @ta)`pax)
|
=/ pas `path`(oust [last 1] `(list @ta)`pax)
|
||||||
?> ?=([* ^] pas)
|
?> ?=([* ^] pas)
|
||||||
?> (~(has by synced) pas)
|
?> (~(has by synced) pas)
|
||||||
:: check if read is permitted
|
|
||||||
?> (is-permitted src.bol pas)
|
?> (is-permitted src.bol pas)
|
||||||
|
=/ envs envelopes:(need (chat-scry pas))
|
||||||
|
=/ length (lent envs)
|
||||||
|
=/ latest
|
||||||
|
?~ backlog-latest length
|
||||||
|
?: (gth u.backlog-latest length) length
|
||||||
|
(sub length u.backlog-latest)
|
||||||
|
=. envs (scag latest envs)
|
||||||
|
=/ =vase !>([%messages pas 0 latest envs])
|
||||||
%- zing
|
%- zing
|
||||||
:~ [%give %fact ~ %chat-update !>([%create pas])]~
|
:~ [%give %fact ~ %chat-update !>([%create pas])]~
|
||||||
?. ?&(?=(^ backlog-start) (~(has by allow-history) pas)) ~
|
?. ?&(?=(^ backlog-latest) (~(has by allow-history) pas)) ~
|
||||||
(paginate-messages pas (need (chat-scry pas)) u.backlog-start)
|
[%give %fact ~ %chat-update vase]~
|
||||||
[%give %kick [%backlog pax]~ `src.bol]~
|
[%give %kick [%backlog pax]~ `src.bol]~
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ paginate-messages
|
|
||||||
|= [=path =mailbox start=@ud]
|
|
||||||
^- (list card)
|
|
||||||
=/ cards=(list card) ~
|
|
||||||
=/ end (lent envelopes.mailbox)
|
|
||||||
?: |((gte start end) =(end 0))
|
|
||||||
cards
|
|
||||||
=. envelopes.mailbox (slag start `(list envelope)`envelopes.mailbox)
|
|
||||||
|- ^- (list card)
|
|
||||||
?~ envelopes.mailbox
|
|
||||||
cards
|
|
||||||
?: (lte end 5.000)
|
|
||||||
=. cards
|
|
||||||
%+ snoc cards
|
|
||||||
%- messages-fact
|
|
||||||
[path start (lent envelopes.mailbox) envelopes.mailbox]
|
|
||||||
$(envelopes.mailbox ~)
|
|
||||||
=. cards
|
|
||||||
%+ snoc cards
|
|
||||||
%- messages-fact
|
|
||||||
:^ path start
|
|
||||||
(add start 5.000)
|
|
||||||
(scag 5.000 `(list envelope)`envelopes.mailbox)
|
|
||||||
=: start (add start 5.000)
|
|
||||||
end (sub end 5.000)
|
|
||||||
==
|
|
||||||
$(envelopes.mailbox (slag 5.000 `(list envelope)`envelopes.mailbox))
|
|
||||||
::
|
|
||||||
++ fact-invite-update
|
++ fact-invite-update
|
||||||
|= [wir=wire fact=invite-update]
|
|= [wir=wire fact=invite-update]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
:_ state
|
:_ state
|
||||||
?+ -.fact ~
|
?+ -.fact ~
|
||||||
::
|
|
||||||
%accepted
|
%accepted
|
||||||
=/ ask-history ?~((chat-scry path.invite.fact) %.y %.n)
|
=/ ask-history ?~((chat-scry path.invite.fact) %.y %.n)
|
||||||
=* shp ship.invite.fact
|
=* shp ship.invite.fact
|
||||||
@ -497,72 +486,72 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ fact-chat-update
|
++ fact-chat-update
|
||||||
|= [wir=wire fact=chat-update]
|
|= [wir=wire =update:store]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?: (team:title our.bol src.bol)
|
?: (team:title our.bol src.bol)
|
||||||
(handle-local fact)
|
(handle-local update)
|
||||||
(handle-foreign fact)
|
(handle-foreign update)
|
||||||
::
|
::
|
||||||
++ handle-local
|
++ handle-local
|
||||||
|= fact=chat-update
|
|= =update:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?+ -.fact [~ state]
|
?+ -.update [~ state]
|
||||||
%delete
|
%delete
|
||||||
?. (~(has by synced) path.fact) [~ state]
|
?. (~(has by synced) path.update) [~ state]
|
||||||
=. synced (~(del by synced) path.fact)
|
=. synced (~(del by synced) path.update)
|
||||||
:_ state
|
:_ state
|
||||||
:~ [%pass [%mailbox path.fact] %agent [our.bol %chat-store] %leave ~]
|
:~ [%pass [%mailbox path.update] %agent [our.bol %chat-store] %leave ~]
|
||||||
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%message
|
%message
|
||||||
:_ state
|
:_ state
|
||||||
[%give %fact [%mailbox path.fact]~ %chat-update !>(fact)]~
|
[%give %fact [%mailbox path.update]~ %chat-update !>(update)]~
|
||||||
::
|
::
|
||||||
%messages
|
%messages
|
||||||
:_ state
|
:_ state
|
||||||
[%give %fact [%mailbox path.fact]~ %chat-update !>(fact)]~
|
[%give %fact [%mailbox path.update]~ %chat-update !>(update)]~
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ handle-foreign
|
++ handle-foreign
|
||||||
|= fact=chat-update
|
|= =update:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?+ -.fact [~ state]
|
?+ -.update [~ state]
|
||||||
%create
|
%create
|
||||||
:_ state
|
:_ state
|
||||||
?> ?=([* ^] path.fact)
|
?> ?=([* ^] path.update)
|
||||||
=/ shp (~(get by synced) path.fact)
|
=/ shp (~(get by synced) path.update)
|
||||||
?~ shp ~
|
?~ shp ~
|
||||||
?. =(src.bol u.shp) ~
|
?. =(src.bol u.shp) ~
|
||||||
[(chat-poke [%create path.fact])]~
|
[(chat-poke [%create path.update])]~
|
||||||
::
|
::
|
||||||
%delete
|
%delete
|
||||||
?> ?=([* ^] path.fact)
|
?> ?=([* ^] path.update)
|
||||||
=/ shp (~(get by synced) path.fact)
|
=/ shp (~(get by synced) path.update)
|
||||||
?~ shp [~ state]
|
?~ shp [~ state]
|
||||||
?. =(u.shp src.bol) [~ state]
|
?. =(u.shp src.bol) [~ state]
|
||||||
=. synced (~(del by synced) path.fact)
|
=. synced (~(del by synced) path.update)
|
||||||
:_ state
|
:_ state
|
||||||
:- (chat-poke [%delete path.fact])
|
:- (chat-poke [%delete path.update])
|
||||||
:~ [%pass [%mailbox path.fact] %agent [src.bol %chat-hook] %leave ~]
|
:~ [%pass [%mailbox path.update] %agent [src.bol %chat-hook] %leave ~]
|
||||||
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
[%give %fact [/synced]~ %chat-hook-update !>([%initial synced])]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%message
|
%message
|
||||||
:_ state
|
:_ state
|
||||||
?> ?=([* ^] path.fact)
|
?> ?=([* ^] path.update)
|
||||||
=/ shp (~(get by synced) path.fact)
|
=/ shp (~(get by synced) path.update)
|
||||||
?~ shp ~
|
?~ shp ~
|
||||||
?. =(src.bol u.shp) ~
|
?. =(src.bol u.shp) ~
|
||||||
[(chat-poke [%message path.fact envelope.fact])]~
|
[(chat-poke [%message path.update envelope.update])]~
|
||||||
::
|
::
|
||||||
%messages
|
%messages
|
||||||
:_ state
|
:_ state
|
||||||
?> ?=([* ^] path.fact)
|
?> ?=([* ^] path.update)
|
||||||
=/ shp (~(get by synced) path.fact)
|
=/ shp (~(get by synced) path.update)
|
||||||
?~ shp ~
|
?~ shp ~
|
||||||
?. =(src.bol u.shp) ~
|
?. =(src.bol u.shp) ~
|
||||||
[(chat-poke [%messages path.fact envelopes.fact])]~
|
[(chat-poke [%messages path.update envelopes.update])]~
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ kick
|
++ kick
|
||||||
@ -577,7 +566,8 @@
|
|||||||
~& store-kick+wir
|
~& store-kick+wir
|
||||||
?. (~(has by synced) t.wir) [~ state]
|
?. (~(has by synced) t.wir) [~ state]
|
||||||
~& %chat-store-resubscribe
|
~& %chat-store-resubscribe
|
||||||
=/ mailbox=(unit mailbox) (chat-scry t.wir)
|
=/ mailbox=(unit mailbox:store)
|
||||||
|
(chat-scry t.wir)
|
||||||
:_ state
|
:_ state
|
||||||
[%pass wir %agent [our.bol %chat-store] %watch [%mailbox t.wir]]~
|
[%pass wir %agent [our.bol %chat-store] %watch [%mailbox t.wir]]~
|
||||||
::
|
::
|
||||||
@ -586,7 +576,7 @@
|
|||||||
?. (~(has by synced) t.wir) [~ state]
|
?. (~(has by synced) t.wir) [~ state]
|
||||||
~& %chat-hook-resubscribe
|
~& %chat-hook-resubscribe
|
||||||
=/ =ship (~(got by synced) t.wir)
|
=/ =ship (~(got by synced) t.wir)
|
||||||
=/ mailbox=(unit mailbox) (chat-scry t.wir)
|
=/ mailbox=(unit mailbox:store) (chat-scry t.wir)
|
||||||
=/ chat-history
|
=/ chat-history
|
||||||
%+ welp backlog+t.wir
|
%+ welp backlog+t.wir
|
||||||
?~(mailbox /0 /(scot %ud (lent envelopes.u.mailbox)))
|
?~(mailbox /0 /(scot %ud (lent envelopes.u.mailbox)))
|
||||||
@ -594,15 +584,15 @@
|
|||||||
[%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
|
[%pass chat-history %agent [ship %chat-hook] %watch chat-history]~
|
||||||
::
|
::
|
||||||
[%backlog @ @ *]
|
[%backlog @ @ *]
|
||||||
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
|
=/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
|
||||||
?. (~(has by synced) pax) [~ state]
|
?. (~(has by synced) chat) [~ state]
|
||||||
=/ =ship
|
=/ =ship
|
||||||
?: =('~' i.t.wir)
|
?: =('~' i.t.wir)
|
||||||
(slav %p i.t.t.wir)
|
(slav %p i.t.t.wir)
|
||||||
(slav %p i.t.wir)
|
(slav %p i.t.wir)
|
||||||
=. pax ?~((chat-scry pax) wir [%mailbox pax])
|
=/ =path ?~((chat-scry chat) wir [%mailbox chat])
|
||||||
:_ state
|
:_ state
|
||||||
[%pass pax %agent [ship %chat-hook] %watch pax]~
|
[%pass path %agent [ship %chat-hook] %watch path]~
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ watch-ack
|
++ watch-ack
|
||||||
@ -614,22 +604,23 @@
|
|||||||
(poke-chat-hook-action %remove t.wir)
|
(poke-chat-hook-action %remove t.wir)
|
||||||
::
|
::
|
||||||
[%backlog @ @ @ *]
|
[%backlog @ @ @ *]
|
||||||
=/ pax `path`(oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
|
=/ chat=path (oust [(dec (lent t.wir)) 1] `(list @ta)`t.wir)
|
||||||
%. (poke-chat-hook-action %remove pax)
|
:_ state
|
||||||
|
%. ~[(chat-view-poke %delete chat)]
|
||||||
%- slog
|
%- slog
|
||||||
:* leaf+"chat-hook failed subscribe on {(spud pax)}"
|
:* leaf+"chat-hook failed subscribe on {(spud chat)}"
|
||||||
leaf+"stack trace:"
|
leaf+"stack trace:"
|
||||||
u.saw
|
u.saw
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ chat-poke
|
++ chat-poke
|
||||||
|= act=chat-action
|
|= act=action:store
|
||||||
^- card
|
^- card
|
||||||
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
|
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
|
||||||
::
|
::
|
||||||
++ chat-view-poke
|
++ chat-view-poke
|
||||||
|= act=chat-view-action
|
|= act=action:view
|
||||||
^- card
|
^- card
|
||||||
[%pass / %agent [our.bol %chat-view] %poke %chat-view-action !>(act)]
|
[%pass / %agent [our.bol %chat-view] %poke %chat-view-action !>(act)]
|
||||||
::
|
::
|
||||||
@ -638,11 +629,6 @@
|
|||||||
^- card
|
^- card
|
||||||
[%pass / %agent [our.bol %invite-store] %poke %invite-action !>(act)]
|
[%pass / %agent [our.bol %invite-store] %poke %invite-action !>(act)]
|
||||||
::
|
::
|
||||||
++ messages-fact
|
|
||||||
|= [=path start=@ud end=@ud envelopes=(list envelope)]
|
|
||||||
^- card
|
|
||||||
[%give %fact ~ %chat-update !>([%messages path start end envelopes])]
|
|
||||||
::
|
|
||||||
++ sec-to-perm
|
++ sec-to-perm
|
||||||
|= [pax=path =kind]
|
|= [pax=path =kind]
|
||||||
^- permission-action
|
^- permission-action
|
||||||
@ -650,8 +636,8 @@
|
|||||||
::
|
::
|
||||||
++ chat-scry
|
++ chat-scry
|
||||||
|= pax=path
|
|= pax=path
|
||||||
^- (unit mailbox)
|
^- (unit mailbox:store)
|
||||||
%^ scry (unit mailbox)
|
%^ scry (unit mailbox:store)
|
||||||
%chat-store
|
%chat-store
|
||||||
[%mailbox pax]
|
[%mailbox pax]
|
||||||
::
|
::
|
||||||
@ -732,13 +718,23 @@
|
|||||||
(snoc `^path`path %noun)
|
(snoc `^path`path %noun)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ pull-wire
|
++ pull-backlog-subscriptions
|
||||||
|= pax=path
|
|= [target=ship chat=path]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
?> ?=(^ pax)
|
%+ murn ~(tap by wex.bol)
|
||||||
=/ shp (~(get by synced) t.pax)
|
|= [[=wire =ship =term] [acked=? =path]]
|
||||||
?~ shp ~
|
^- (unit card)
|
||||||
?: =(u.shp our.bol)
|
?. ?& =(ship target)
|
||||||
[%pass pax %agent [our.bol %chat-store] %leave ~]~
|
?=([%backlog *] wire)
|
||||||
[%pass pax %agent [u.shp %chat-hook] %leave ~]~
|
=(`1 (find chat wire))
|
||||||
|
==
|
||||||
|
~
|
||||||
|
`(pull-wire target wire)
|
||||||
|
::
|
||||||
|
++ pull-wire
|
||||||
|
|= [=ship =wire]
|
||||||
|
^- card
|
||||||
|
?: =(ship our.bol)
|
||||||
|
[%pass wire %agent [our.bol %chat-store] %leave ~]
|
||||||
|
[%pass wire %agent [ship %chat-hook] %leave ~]
|
||||||
--
|
--
|
||||||
|
@ -1,30 +1,34 @@
|
|||||||
:: chat-store: data store that holds linear sequences of chat messages
|
:: chat-store: data store that holds linear sequences of chat messages
|
||||||
::
|
::
|
||||||
/+ *chat-json, *chat-eval, default-agent, verb, dbug
|
/+ store=chat-store, default-agent, verb, dbug
|
||||||
|
~% %chat-store-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
$% state-zero
|
$% state-zero
|
||||||
state-one
|
state-one
|
||||||
|
state-two
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ state-zero [%0 =inbox]
|
+$ state-zero [%0 =inbox:store]
|
||||||
+$ state-one [%1 =inbox]
|
+$ state-one [%1 =inbox:store]
|
||||||
|
+$ state-two [%2 =inbox:store]
|
||||||
::
|
::
|
||||||
+$ diff
|
+$ diff
|
||||||
$% [%chat-initial inbox]
|
$% [%chat-initial inbox:store]
|
||||||
[%chat-configs chat-configs]
|
[%chat-configs configs:store]
|
||||||
[%chat-update chat-update]
|
[%chat-update update:store]
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
=| state-one
|
=| state-two
|
||||||
=* state -
|
=* state -
|
||||||
::
|
::
|
||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
%+ verb |
|
%+ verb |
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
=<
|
=<
|
||||||
|
~% %chat-store-agent-core ..peek-x-envelopes ~
|
||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
chat-core +>
|
chat-core +>
|
||||||
@ -36,23 +40,29 @@
|
|||||||
++ on-load
|
++ on-load
|
||||||
|= old-vase=vase
|
|= old-vase=vase
|
||||||
=/ old !<(versioned-state old-vase)
|
=/ old !<(versioned-state old-vase)
|
||||||
?: ?=(%1 -.old)
|
?: ?=(%2 -.old)
|
||||||
[~ this(state old)]
|
[~ this(state old)]
|
||||||
:_ this(state [%1 inbox.old])
|
=/ reversed-inbox=inbox:store
|
||||||
[%pass /lo-chst %agent [our.bowl %chat-hook] %poke %noun !>(%store-load)]~
|
%- ~(run by inbox.old)
|
||||||
|
|= =mailbox:store
|
||||||
|
^- mailbox:store
|
||||||
|
[config.mailbox (flop envelopes.mailbox)]
|
||||||
|
[~ this(state [%2 reversed-inbox])]
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|
~/ %chat-store-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?> (team:title our.bowl src.bowl)
|
?> (team:title our.bowl src.bowl)
|
||||||
=^ cards state
|
=^ cards state
|
||||||
?+ mark (on-poke:def mark vase)
|
?+ mark (on-poke:def mark vase)
|
||||||
%json (poke-json:cc !<(json vase))
|
%json (poke-json:cc !<(json vase))
|
||||||
%chat-action (poke-chat-action:cc !<(chat-action vase))
|
%chat-action (poke-chat-action:cc !<(action:store vase))
|
||||||
==
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
++ on-watch
|
++ on-watch
|
||||||
|
~/ %chat-store-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
|^
|
|^
|
||||||
@ -61,7 +71,7 @@
|
|||||||
?+ path (on-watch:def path)
|
?+ path (on-watch:def path)
|
||||||
[%keys ~] (give %chat-update !>([%keys ~(key by inbox)]))
|
[%keys ~] (give %chat-update !>([%keys ~(key by inbox)]))
|
||||||
[%all ~] (give %chat-initial !>(inbox))
|
[%all ~] (give %chat-initial !>(inbox))
|
||||||
[%configs ~] (give %chat-configs !>((inbox-to-configs inbox)))
|
[%configs ~] (give %chat-configs !>((inbox-to-configs:store inbox)))
|
||||||
[%updates ~] ~
|
[%updates ~] ~
|
||||||
[%mailbox @ *]
|
[%mailbox @ *]
|
||||||
?> (~(has by inbox) t.path)
|
?> (~(has by inbox) t.path)
|
||||||
@ -77,11 +87,12 @@
|
|||||||
::
|
::
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
++ on-peek
|
++ on-peek
|
||||||
|
~/ %chat-store-peek
|
||||||
|= =path
|
|= =path
|
||||||
^- (unit (unit cage))
|
^- (unit (unit cage))
|
||||||
?+ path (on-peek:def path)
|
?+ path (on-peek:def path)
|
||||||
[%x %all ~] ``noun+!>(inbox)
|
[%x %all ~] ``noun+!>(inbox)
|
||||||
[%x %configs ~] ``noun+!>((inbox-to-configs inbox))
|
[%x %configs ~] ``noun+!>((inbox-to-configs:store inbox))
|
||||||
[%x %keys ~] ``noun+!>(~(key by inbox))
|
[%x %keys ~] ``noun+!>(~(key by inbox))
|
||||||
[%x %envelopes *] (peek-x-envelopes:cc t.t.path)
|
[%x %envelopes *] (peek-x-envelopes:cc t.t.path)
|
||||||
[%x %mailbox *]
|
[%x %mailbox *]
|
||||||
@ -104,6 +115,7 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
|
~% %chat-store-library ..card ~
|
||||||
|_ bol=bowl:gall
|
|_ bol=bowl:gall
|
||||||
::
|
::
|
||||||
++ peek-x-envelopes
|
++ peek-x-envelopes
|
||||||
@ -147,10 +159,10 @@
|
|||||||
++ poke-json
|
++ poke-json
|
||||||
|= jon=json
|
|= jon=json
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
(poke-chat-action (json-to-action jon))
|
(poke-chat-action (action:dejs:store jon))
|
||||||
::
|
::
|
||||||
++ poke-chat-action
|
++ poke-chat-action
|
||||||
|= action=chat-action
|
|= =action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?- -.action
|
?- -.action
|
||||||
%create (handle-create action)
|
%create (handle-create action)
|
||||||
@ -166,62 +178,61 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ handle-create
|
++ handle-create
|
||||||
|= act=chat-action
|
|= =action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%create -.act)
|
?> ?=(%create -.action)
|
||||||
?: (~(has by inbox) path.act) [~ state]
|
?: (~(has by inbox) path.action) [~ state]
|
||||||
:- (send-diff path.act act)
|
:- (send-diff path.action action)
|
||||||
state(inbox (~(put by inbox) path.act *mailbox))
|
state(inbox (~(put by inbox) path.action *mailbox:store))
|
||||||
::
|
::
|
||||||
++ handle-delete
|
++ handle-delete
|
||||||
|= act=chat-action
|
|= =action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%delete -.act)
|
?> ?=(%delete -.action)
|
||||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
=/ mailbox=(unit mailbox:store)
|
||||||
|
(~(get by inbox) path.action)
|
||||||
?~ mailbox [~ state]
|
?~ mailbox [~ state]
|
||||||
:- (send-diff path.act act)
|
:- (send-diff path.action action)
|
||||||
state(inbox (~(del by inbox) path.act))
|
state(inbox (~(del by inbox) path.action))
|
||||||
::
|
::
|
||||||
++ handle-message
|
++ handle-message
|
||||||
|= act=chat-action
|
|= =action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%message -.act)
|
?> ?=(%message -.action)
|
||||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
=/ mailbox=(unit mailbox:store)
|
||||||
|
(~(get by inbox) path.action)
|
||||||
?~ mailbox
|
?~ mailbox
|
||||||
[~ state]
|
[~ state]
|
||||||
=. letter.envelope.act (evaluate-letter [author letter]:envelope.act)
|
=. letter.envelope.action (evaluate-letter [author letter]:envelope.action)
|
||||||
=^ envelope u.mailbox (append-envelope u.mailbox envelope.act)
|
=^ envelope u.mailbox (prepend-envelope u.mailbox envelope.action)
|
||||||
:- (send-diff path.act act(envelope envelope))
|
:- (send-diff path.action action(envelope envelope))
|
||||||
state(inbox (~(put by inbox) path.act u.mailbox))
|
state(inbox (~(put by inbox) path.action u.mailbox))
|
||||||
::
|
::
|
||||||
++ handle-messages
|
++ handle-messages
|
||||||
|= act=chat-action
|
|= act=action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%messages -.act)
|
?> ?=(%messages -.act)
|
||||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
=/ mailbox=(unit mailbox:store)
|
||||||
|
(~(get by inbox) path.act)
|
||||||
?~ mailbox
|
?~ mailbox
|
||||||
[~ state]
|
[~ state]
|
||||||
=/ evaluated-envelopes=(list envelope) ~
|
=. envelopes.act (flop envelopes.act)
|
||||||
|
=| evaluated-envelopes=(list envelope:store)
|
||||||
|- ^- (quip card _state)
|
|- ^- (quip card _state)
|
||||||
?~ envelopes.act
|
?~ envelopes.act
|
||||||
:_ state(inbox (~(put by inbox) path.act u.mailbox))
|
:_ state(inbox (~(put by inbox) path.act u.mailbox))
|
||||||
%+ send-diff path.act
|
%+ send-diff path.act
|
||||||
:* %messages
|
[%messages path.act 0 (lent evaluated-envelopes) evaluated-envelopes]
|
||||||
path.act
|
|
||||||
(sub length.config.u.mailbox (lent evaluated-envelopes))
|
|
||||||
length.config.u.mailbox
|
|
||||||
evaluated-envelopes
|
|
||||||
==
|
|
||||||
=. letter.i.envelopes.act (evaluate-letter [author letter]:i.envelopes.act)
|
=. letter.i.envelopes.act (evaluate-letter [author letter]:i.envelopes.act)
|
||||||
=^ envelope u.mailbox (append-envelope u.mailbox i.envelopes.act)
|
=^ envelope u.mailbox (prepend-envelope u.mailbox i.envelopes.act)
|
||||||
=. evaluated-envelopes (snoc evaluated-envelopes envelope)
|
=. evaluated-envelopes [envelope evaluated-envelopes]
|
||||||
$(envelopes.act t.envelopes.act)
|
$(envelopes.act t.envelopes.act)
|
||||||
::
|
::
|
||||||
++ handle-read
|
++ handle-read
|
||||||
|= act=chat-action
|
|= act=action:store
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?> ?=(%read -.act)
|
?> ?=(%read -.act)
|
||||||
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
|
=/ mailbox=(unit mailbox:store) (~(get by inbox) path.act)
|
||||||
?~ mailbox
|
?~ mailbox
|
||||||
[~ state]
|
[~ state]
|
||||||
=. read.config.u.mailbox length.config.u.mailbox
|
=. read.config.u.mailbox length.config.u.mailbox
|
||||||
@ -229,33 +240,33 @@
|
|||||||
state(inbox (~(put by inbox) path.act u.mailbox))
|
state(inbox (~(put by inbox) path.act u.mailbox))
|
||||||
::
|
::
|
||||||
++ evaluate-letter
|
++ evaluate-letter
|
||||||
|= [author=ship =letter]
|
|= [author=ship =letter:store]
|
||||||
^- ^letter
|
^- letter:store
|
||||||
=? letter
|
=? letter
|
||||||
?& ?=(%code -.letter)
|
?& ?=(%code -.letter)
|
||||||
?=(~ output.letter)
|
?=(~ output.letter)
|
||||||
(team:title our.bol author)
|
(team:title our.bol author)
|
||||||
==
|
==
|
||||||
=/ =hoon (ream expression.letter)
|
=/ =hoon (ream expression.letter)
|
||||||
letter(output (eval bol hoon))
|
letter(output (eval:store bol hoon))
|
||||||
letter
|
letter
|
||||||
::
|
::
|
||||||
++ append-envelope
|
++ prepend-envelope
|
||||||
|= [=mailbox =envelope]
|
|= [=mailbox:store =envelope:store]
|
||||||
^+ [envelope mailbox]
|
^+ [envelope mailbox]
|
||||||
=. number.envelope +(length.config.mailbox)
|
=. number.envelope +(length.config.mailbox)
|
||||||
=: length.config.mailbox +(length.config.mailbox)
|
=: length.config.mailbox +(length.config.mailbox)
|
||||||
envelopes.mailbox (snoc envelopes.mailbox envelope)
|
envelopes.mailbox [envelope envelopes.mailbox]
|
||||||
==
|
==
|
||||||
[envelope mailbox]
|
[envelope mailbox]
|
||||||
::
|
::
|
||||||
++ update-subscribers
|
++ update-subscribers
|
||||||
|= [pax=path update=chat-update]
|
|= [pax=path =update:store]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
[%give %fact ~[pax] %chat-update !>(update)]~
|
[%give %fact ~[pax] %chat-update !>(update)]~
|
||||||
::
|
::
|
||||||
++ send-diff
|
++ send-diff
|
||||||
|= [pax=path upd=chat-update]
|
|= [pax=path upd=update:store]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
%- zing
|
%- zing
|
||||||
:~ (update-subscribers /all upd)
|
:~ (update-subscribers /all upd)
|
||||||
|
@ -8,8 +8,12 @@
|
|||||||
*metadata-store,
|
*metadata-store,
|
||||||
*permission-group-hook,
|
*permission-group-hook,
|
||||||
*chat-hook,
|
*chat-hook,
|
||||||
*metadata-hook
|
*metadata-hook,
|
||||||
/+ *server, *chat-json, default-agent, verb, dbug
|
*rw-security,
|
||||||
|
hook=chat-hook
|
||||||
|
/+ *server, default-agent, verb, dbug,
|
||||||
|
store=chat-store,
|
||||||
|
view=chat-view
|
||||||
/= index
|
/= index
|
||||||
/^ octs
|
/^ octs
|
||||||
/; as-octs:mimes:html
|
/; as-octs:mimes:html
|
||||||
@ -42,14 +46,15 @@
|
|||||||
/^ (map knot @)
|
/^ (map knot @)
|
||||||
/: /===/app/chat/img /_ /png/
|
/: /===/app/chat/img /_ /png/
|
||||||
::
|
::
|
||||||
|
~% %chat-view-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
::
|
::
|
||||||
+$ poke
|
+$ poke
|
||||||
$% [%launch-action [@tas path @t]]
|
$% [%launch-action [@tas path @t]]
|
||||||
[%chat-action chat-action]
|
[%chat-action action:store]
|
||||||
[%group-action group-action]
|
[%group-action group-action]
|
||||||
[%chat-hook-action chat-hook-action]
|
[%chat-hook-action action:hook]
|
||||||
[%permission-hook-action permission-hook-action]
|
[%permission-hook-action permission-hook-action]
|
||||||
[%permission-group-hook-action permission-group-hook-action]
|
[%permission-group-hook-action permission-group-hook-action]
|
||||||
==
|
==
|
||||||
@ -58,6 +63,7 @@
|
|||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
=<
|
=<
|
||||||
|
~% %chat-view-agent-core ..poke-handle-http-request ~
|
||||||
|_ bol=bowl:gall
|
|_ bol=bowl:gall
|
||||||
+* this .
|
+* this .
|
||||||
chat-core +>
|
chat-core +>
|
||||||
@ -73,6 +79,7 @@
|
|||||||
[%pass /chat-view %agent [our.bol %launch] %poke launcha]
|
[%pass /chat-view %agent [our.bol %launch] %poke launcha]
|
||||||
==
|
==
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|
~/ %chat-view-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
@ -86,14 +93,15 @@
|
|||||||
::
|
::
|
||||||
%json
|
%json
|
||||||
:_ this
|
:_ this
|
||||||
(poke-chat-view-action:cc (json-to-view-action !<(json vase)))
|
(poke-chat-view-action:cc (action:dejs:view !<(json vase)))
|
||||||
::
|
::
|
||||||
%chat-view-action
|
%chat-view-action
|
||||||
:_ this
|
:_ this
|
||||||
(poke-chat-view-action:cc !<(chat-view-action vase))
|
(poke-chat-view-action:cc !<(action:view vase))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ on-watch
|
++ on-watch
|
||||||
|
~/ %chat-view-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
@ -104,7 +112,7 @@
|
|||||||
:: create inbox with 20 messages max per mailbox and send that along
|
:: create inbox with 20 messages max per mailbox and send that along
|
||||||
:: then quit the subscription
|
:: then quit the subscription
|
||||||
:_ this
|
:_ this
|
||||||
[%give %fact ~ %json !>((inbox-to-json truncated-inbox-scry))]~
|
[%give %fact ~ %json !>((inbox:enjs:store truncated-inbox-scry))]~
|
||||||
?: =(/configs path)
|
?: =(/configs path)
|
||||||
[[%give %fact ~ %json !>(*json)]~ this]
|
[[%give %fact ~ %json !>(*json)]~ this]
|
||||||
(on-watch:def path)
|
(on-watch:def path)
|
||||||
@ -112,23 +120,17 @@
|
|||||||
++ message-limit 20
|
++ message-limit 20
|
||||||
::
|
::
|
||||||
++ truncated-inbox-scry
|
++ truncated-inbox-scry
|
||||||
^- inbox
|
^- inbox:store
|
||||||
=/ =inbox .^(inbox %gx /=chat-store/(scot %da now.bol)/all/noun)
|
=/ =inbox:store
|
||||||
|
.^(inbox:store %gx /=chat-store/(scot %da now.bol)/all/noun)
|
||||||
%- ~(run by inbox)
|
%- ~(run by inbox)
|
||||||
|= =mailbox
|
|= =mailbox:store
|
||||||
^- ^mailbox
|
^- mailbox:store
|
||||||
[config.mailbox (truncate-envelopes envelopes.mailbox)]
|
[config.mailbox (scag message-limit envelopes.mailbox)]
|
||||||
::
|
|
||||||
++ truncate-envelopes
|
|
||||||
|= envelopes=(list envelope)
|
|
||||||
^- (list envelope)
|
|
||||||
=/ length (lent envelopes)
|
|
||||||
?: (lth length message-limit)
|
|
||||||
envelopes
|
|
||||||
(slag (sub length message-limit) envelopes)
|
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ on-agent
|
++ on-agent
|
||||||
|
~/ %chat-view-agent
|
||||||
|= [=wire =sign:agent:gall]
|
|= [=wire =sign:agent:gall]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?+ -.sign (on-agent:def wire sign)
|
?+ -.sign (on-agent:def wire sign)
|
||||||
@ -140,11 +142,12 @@
|
|||||||
?+ p.cage.sign (on-agent:def wire sign)
|
?+ p.cage.sign (on-agent:def wire sign)
|
||||||
%chat-update
|
%chat-update
|
||||||
:_ this
|
:_ this
|
||||||
(diff-chat-update:cc !<(chat-update q.cage.sign))
|
(diff-chat-update:cc !<(update:store q.cage.sign))
|
||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ on-arvo
|
++ on-arvo
|
||||||
|
~/ %chat-view-arvo
|
||||||
|= [=wire =sign-arvo]
|
|= [=wire =sign-arvo]
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?. ?=(%bound +<.sign-arvo)
|
?. ?=(%bound +<.sign-arvo)
|
||||||
@ -159,6 +162,7 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
::
|
::
|
||||||
|
~% %chat-view-library ..card ~
|
||||||
|_ bol=bowl:gall
|
|_ bol=bowl:gall
|
||||||
::
|
::
|
||||||
++ poke-handle-http-request
|
++ poke-handle-http-request
|
||||||
@ -184,7 +188,7 @@
|
|||||||
=/ envelopes (envelope-scry [(scot %ud start) (scot %ud end) pax])
|
=/ envelopes (envelope-scry [(scot %ud start) (scot %ud end) pax])
|
||||||
%- json-response:gen
|
%- json-response:gen
|
||||||
%- json-to-octs
|
%- json-to-octs
|
||||||
%- update-to-json
|
%- update:enjs:store
|
||||||
[%messages pax start end envelopes]
|
[%messages pax start end envelopes]
|
||||||
::
|
::
|
||||||
[%'~chat' *] (html-response:gen index)
|
[%'~chat' *] (html-response:gen index)
|
||||||
@ -194,10 +198,10 @@
|
|||||||
|= jon=json
|
|= jon=json
|
||||||
^- (list card)
|
^- (list card)
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
(poke-chat-view-action (json-to-view-action jon))
|
(poke-chat-view-action (action:dejs:view jon))
|
||||||
::
|
::
|
||||||
++ poke-chat-view-action
|
++ poke-chat-view-action
|
||||||
|= act=chat-view-action
|
|= act=action:view
|
||||||
^- (list card)
|
^- (list card)
|
||||||
|^
|
|^
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
@ -261,8 +265,8 @@
|
|||||||
?> ?=([%'~' ^] app-path.act)
|
?> ?=([%'~' ^] app-path.act)
|
||||||
:: retrieve old data
|
:: retrieve old data
|
||||||
::
|
::
|
||||||
=/ data=(unit mailbox)
|
=/ data=(unit mailbox:store)
|
||||||
(scry-for (unit mailbox) %chat-store [%mailbox app-path.act])
|
(scry-for (unit mailbox:store) %chat-store [%mailbox app-path.act])
|
||||||
?~ data
|
?~ data
|
||||||
~& [%cannot-groupify-nonexistent app-path.act]
|
~& [%cannot-groupify-nonexistent app-path.act]
|
||||||
~
|
~
|
||||||
@ -336,7 +340,10 @@
|
|||||||
++ create-group
|
++ create-group
|
||||||
|= [=path app-path=path sec=rw-security ships=(set ship) title=@t desc=@t]
|
|= [=path app-path=path sec=rw-security ships=(set ship) title=@t desc=@t]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
?^ (group-scry path) ~
|
?^ (group-scry path)
|
||||||
|
:~ (create-security path %village)
|
||||||
|
(permission-hook-poke [%add-owned path path])
|
||||||
|
==
|
||||||
:: do not create a managed group if this is a sig path or a blacklist
|
:: do not create a managed group if this is a sig path or a blacklist
|
||||||
::
|
::
|
||||||
?: =(sec %channel)
|
?: =(sec %channel)
|
||||||
@ -422,9 +429,9 @@
|
|||||||
::
|
::
|
||||||
++ chat-scry
|
++ chat-scry
|
||||||
|= pax=path
|
|= pax=path
|
||||||
^- (unit mailbox)
|
^- (unit mailbox:store)
|
||||||
=. pax ;:(weld /=chat-store/(scot %da now.bol)/mailbox pax /noun)
|
=. pax ;:(weld /=chat-store/(scot %da now.bol)/mailbox pax /noun)
|
||||||
.^((unit mailbox) %gx pax)
|
.^((unit mailbox:store) %gx pax)
|
||||||
::
|
::
|
||||||
++ maybe-group-from-chat
|
++ maybe-group-from-chat
|
||||||
|= app-path=path
|
|= app-path=path
|
||||||
@ -479,10 +486,10 @@
|
|||||||
--
|
--
|
||||||
::
|
::
|
||||||
++ diff-chat-update
|
++ diff-chat-update
|
||||||
|= upd=chat-update
|
|= upd=update:store
|
||||||
^- (list card)
|
^- (list card)
|
||||||
=/ updates-json (update-to-json upd)
|
=/ updates-json (update:enjs:store upd)
|
||||||
=/ configs-json (configs-to-json configs-scry)
|
=/ configs-json (configs:enjs:store configs-scry)
|
||||||
:~ [%give %fact ~[/primary] %json !>(updates-json)]
|
:~ [%give %fact ~[/primary] %json !>(updates-json)]
|
||||||
[%give %fact ~[/configs] %json !>(configs-json)]
|
[%give %fact ~[/configs] %json !>(configs-json)]
|
||||||
==
|
==
|
||||||
@ -490,7 +497,7 @@
|
|||||||
:: +utilities
|
:: +utilities
|
||||||
::
|
::
|
||||||
++ chat-poke
|
++ chat-poke
|
||||||
|= act=chat-action
|
|= act=action:store
|
||||||
^- card
|
^- card
|
||||||
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
|
[%pass / %agent [our.bol %chat-store] %poke %chat-action !>(act)]
|
||||||
::
|
::
|
||||||
@ -505,7 +512,7 @@
|
|||||||
[%pass / %agent [our.bol %permission-store] %poke %permission-action !>(act)]
|
[%pass / %agent [our.bol %permission-store] %poke %permission-action !>(act)]
|
||||||
::
|
::
|
||||||
++ chat-hook-poke
|
++ chat-hook-poke
|
||||||
|= act=chat-hook-action
|
|= act=action:hook
|
||||||
^- card
|
^- card
|
||||||
[%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action !>(act)]
|
[%pass / %agent [our.bol %chat-hook] %poke %chat-hook-action !>(act)]
|
||||||
::
|
::
|
||||||
@ -525,12 +532,12 @@
|
|||||||
::
|
::
|
||||||
++ envelope-scry
|
++ envelope-scry
|
||||||
|= pax=path
|
|= pax=path
|
||||||
^- (list envelope)
|
^- (list envelope:store)
|
||||||
(scry-for (list envelope) %chat-store [%envelopes pax])
|
(scry-for (list envelope:store) %chat-store [%envelopes pax])
|
||||||
::
|
::
|
||||||
++ configs-scry
|
++ configs-scry
|
||||||
^- chat-configs
|
^- configs:store
|
||||||
(scry-for chat-configs %chat-store /configs)
|
(scry-for configs:store %chat-store /configs)
|
||||||
::
|
::
|
||||||
++ group-scry
|
++ group-scry
|
||||||
|= pax=path
|
|= pax=path
|
||||||
|
BIN
pkg/arvo/app/chat/img/CodeEval.png
Normal file
After Width: | Height: | Size: 611 B |
BIN
pkg/arvo/app/chat/img/ImageUpload.png
Normal file
After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
@ -26,5 +26,6 @@
|
|||||||
<script src="/~channel/channel.js"></script>
|
<script src="/~channel/channel.js"></script>
|
||||||
<script src="/~modulo/session.js"></script>
|
<script src="/~modulo/session.js"></script>
|
||||||
<script src="/~chat/js/index.js"></script>
|
<script src="/~chat/js/index.js"></script>
|
||||||
|
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -417,14 +417,17 @@
|
|||||||
:* to
|
:* to
|
||||||
(mul windup-years yer:yo)
|
(mul windup-years yer:yo)
|
||||||
stars
|
stars
|
||||||
(div (mul unlock-years yer:yo) stars)
|
|
||||||
1
|
1
|
||||||
|
(div (mul unlock-years yer:yo) stars)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ register-conditional
|
++ register-conditional
|
||||||
|= [to=address [b1=@ud b2=@ud b3=@ud] unlock-years-per-batch=@ud]
|
|= [to=address [b1=@ud b2=@ud b3=@ud] unlock-years-per-batch=@ud]
|
||||||
%- register-conditional:dat
|
%- register-conditional:dat
|
||||||
=- [`address`to b1 b2 b3 `@ud`- 1]
|
:* to
|
||||||
(div (mul unlock-years-per-batch yer:yo) :(add b1 b2 b3))
|
b1 b2 b3
|
||||||
|
1
|
||||||
|
(div (mul unlock-years-per-batch yer:yo) :(add b1 b2 b3))
|
||||||
|
==
|
||||||
::
|
::
|
||||||
--
|
--
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
*metadata-hook,
|
*metadata-hook,
|
||||||
*metadata-store
|
*metadata-store
|
||||||
/+ *contact-json, default-agent, dbug
|
/+ *contact-json, default-agent, dbug
|
||||||
|
~% %contact-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
::
|
::
|
||||||
@ -18,7 +19,7 @@
|
|||||||
+$ state-zero [%0 state-base]
|
+$ state-zero [%0 state-base]
|
||||||
+$ state-one [%1 state-base]
|
+$ state-one [%1 state-base]
|
||||||
+$ state-base
|
+$ state-base
|
||||||
$: synced=(map path ship)
|
$: =synced
|
||||||
invite-created=_|
|
invite-created=_|
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
@ -76,6 +77,7 @@
|
|||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
?+ path (on-watch:def path)
|
?+ path (on-watch:def path)
|
||||||
[%contacts *] [(watch-contacts:cc t.path) this]
|
[%contacts *] [(watch-contacts:cc t.path) this]
|
||||||
|
[%synced *] [(watch-synced:cc t.path) this]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ on-agent
|
++ on-agent
|
||||||
@ -123,30 +125,29 @@
|
|||||||
++ poke-contact-action
|
++ poke-contact-action
|
||||||
|= act=contact-action
|
|= act=contact-action
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
|^
|
|
||||||
:_ state
|
:_ state
|
||||||
?+ -.act !!
|
?+ -.act !!
|
||||||
%edit (handle-contact-action path.act ship.act act)
|
%edit (handle-contact-action path.act ship.act act)
|
||||||
%add (handle-contact-action path.act ship.act act)
|
%add (handle-contact-action path.act ship.act act)
|
||||||
%remove (handle-contact-action path.act ship.act act)
|
%remove (handle-contact-action path.act ship.act act)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ handle-contact-action
|
++ handle-contact-action
|
||||||
|= [=path =ship act=contact-action]
|
|= [=path =ship act=contact-action]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
:: local
|
:: local
|
||||||
?: (team:title our.bol src.bol)
|
?: (team:title our.bol src.bol)
|
||||||
=/ shp ?:(=(path /~/default) our.bol (~(got by synced) path))
|
?. (~(has by synced) path) ~
|
||||||
=/ appl ?:(=(shp our.bol) %contact-store %contact-hook)
|
=/ shp ?:(=(path /~/default) our.bol (~(got by synced) path))
|
||||||
[%pass / %agent [shp appl] %poke %contact-action !>(act)]~
|
=/ appl ?:(=(shp our.bol) %contact-store %contact-hook)
|
||||||
:: foreign
|
[%pass / %agent [shp appl] %poke %contact-action !>(act)]~
|
||||||
=/ shp (~(got by synced) path)
|
:: foreign
|
||||||
?. |(=(shp our.bol) =(src.bol ship)) ~
|
=/ shp (~(got by synced) path)
|
||||||
:: scry group to check if ship is a member
|
?. |(=(shp our.bol) =(src.bol ship)) ~
|
||||||
=/ =group (need (group-scry path))
|
:: scry group to check if ship is a member
|
||||||
?. (~(has in group) shp) ~
|
=/ =group (need (group-scry path))
|
||||||
[%pass / %agent [our.bol %contact-store] %poke %contact-action !>(act)]~
|
?. (~(has in group) shp) ~
|
||||||
--
|
[%pass / %agent [our.bol %contact-store] %poke %contact-action !>(act)]~
|
||||||
::
|
::
|
||||||
++ poke-hook-action
|
++ poke-hook-action
|
||||||
|= act=contact-hook-action
|
|= act=contact-hook-action
|
||||||
@ -159,7 +160,9 @@
|
|||||||
[~ state]
|
[~ state]
|
||||||
=. synced (~(put by synced) path.act our.bol)
|
=. synced (~(put by synced) path.act our.bol)
|
||||||
:_ state
|
:_ state
|
||||||
[%pass contact-path %agent [our.bol %contact-store] %watch contact-path]~
|
:~ [%pass contact-path %agent [our.bol %contact-store] %watch contact-path]
|
||||||
|
[%give %fact [/synced]~ %contact-hook-update !>([%initial synced])]
|
||||||
|
==
|
||||||
::
|
::
|
||||||
%add-synced
|
%add-synced
|
||||||
?> (team:title our.bol src.bol)
|
?> (team:title our.bol src.bol)
|
||||||
@ -167,7 +170,9 @@
|
|||||||
=. synced (~(put by synced) path.act ship.act)
|
=. synced (~(put by synced) path.act ship.act)
|
||||||
=/ contact-path [%contacts path.act]
|
=/ contact-path [%contacts path.act]
|
||||||
:_ state
|
:_ state
|
||||||
[%pass contact-path %agent [ship.act %contact-hook] %watch contact-path]~
|
:~ [%pass contact-path %agent [ship.act %contact-hook] %watch contact-path]
|
||||||
|
[%give %fact [/synced]~ %contact-hook-update !>([%initial synced])]
|
||||||
|
==
|
||||||
::
|
::
|
||||||
%remove
|
%remove
|
||||||
=/ ship (~(get by synced) path.act)
|
=/ ship (~(get by synced) path.act)
|
||||||
@ -178,13 +183,20 @@
|
|||||||
%- zing
|
%- zing
|
||||||
:~ (pull-wire [%contacts path.act])
|
:~ (pull-wire [%contacts path.act])
|
||||||
[%give %kick ~[[%contacts path.act]] ~]~
|
[%give %kick ~[[%contacts path.act]] ~]~
|
||||||
|
[%give %fact [/synced]~ %contact-hook-update !>([%initial synced])]~
|
||||||
==
|
==
|
||||||
?. |(=(u.ship src.bol) (team:title our.bol src.bol))
|
?. |(=(u.ship src.bol) (team:title our.bol src.bol))
|
||||||
:: if neither ship = source or source = us, do nothing
|
:: if neither ship = source or source = us, do nothing
|
||||||
[~ state]
|
[~ state]
|
||||||
:: delete a foreign ship's path
|
:: delete a foreign ship's path
|
||||||
:- (pull-wire [%contacts path.act])
|
=/ cards
|
||||||
state(synced (~(del by synced) path.act))
|
(handle-contact-action path.act our.bol [%remove path.act our.bol])
|
||||||
|
:_ state(synced (~(del by synced) path.act))
|
||||||
|
%- zing
|
||||||
|
:~ (pull-wire [%contacts path.act])
|
||||||
|
[%give %fact [/synced]~ %contact-hook-update !>([%initial synced])]~
|
||||||
|
cards
|
||||||
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ watch-contacts
|
++ watch-contacts
|
||||||
@ -196,10 +208,13 @@
|
|||||||
=/ =group (need (group-scry pax))
|
=/ =group (need (group-scry pax))
|
||||||
?> (~(has in group) src.bol)
|
?> (~(has in group) src.bol)
|
||||||
=/ contacts (need (contacts-scry pax))
|
=/ contacts (need (contacts-scry pax))
|
||||||
:~ :*
|
[%give %fact ~ %contact-update !>([%contacts pax contacts])]~
|
||||||
%give %fact ~ %contact-update
|
::
|
||||||
!>([%contacts pax contacts])
|
++ watch-synced
|
||||||
== ==
|
|= pax=path
|
||||||
|
^- (list card)
|
||||||
|
?> (team:title our.bol src.bol)
|
||||||
|
[%give %fact ~ %contact-hook-update !>([%initial synced])]~
|
||||||
::
|
::
|
||||||
++ watch-ack
|
++ watch-ack
|
||||||
|= [wir=wire saw=(unit tang)]
|
|= [wir=wire saw=(unit tang)]
|
||||||
@ -307,13 +322,15 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
%add
|
%add
|
||||||
=/ owner (~(got by synced) path.fact)
|
=/ owner (~(get by synced) path.fact)
|
||||||
?> |(=(owner src.bol) =(src.bol ship.fact))
|
?~ owner ~
|
||||||
|
?> |(=(u.owner src.bol) =(src.bol ship.fact))
|
||||||
~[(contact-poke [%add path.fact ship.fact contact.fact])]
|
~[(contact-poke [%add path.fact ship.fact contact.fact])]
|
||||||
::
|
::
|
||||||
%remove
|
%remove
|
||||||
=/ owner (~(got by synced) path.fact)
|
=/ owner (~(get by synced) path.fact)
|
||||||
?> |(=(owner src.bol) =(src.bol ship.fact))
|
?~ owner ~
|
||||||
|
?> |(=(u.owner src.bol) =(src.bol ship.fact))
|
||||||
%+ welp
|
%+ welp
|
||||||
:~ (group-poke [%remove [ship.fact ~ ~] path.fact])
|
:~ (group-poke [%remove [ship.fact ~ ~] path.fact])
|
||||||
(contact-poke [%remove path.fact ship.fact])
|
(contact-poke [%remove path.fact ship.fact])
|
||||||
@ -352,7 +369,8 @@
|
|||||||
|= =path
|
|= =path
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?. (~(has by synced) path)
|
?. (~(has by synced) path)
|
||||||
[~ state]
|
:_ state
|
||||||
|
[(contact-poke [%delete path])]~
|
||||||
:_ state(synced (~(del by synced) path))
|
:_ state(synced (~(del by synced) path))
|
||||||
:~ [%pass [%contacts path] %agent [our.bol %contact-store] %leave ~]
|
:~ [%pass [%contacts path] %agent [our.bol %contact-store] %leave ~]
|
||||||
[(contact-poke [%delete path])]
|
[(contact-poke [%delete path])]
|
||||||
|
@ -5,18 +5,33 @@
|
|||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
$% state-zero
|
$% state-zero
|
||||||
|
state-one
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ rolodex-0 (map path contacts-0)
|
||||||
|
+$ contacts-0 (map ship contact-0)
|
||||||
|
+$ avatar-0 [content-type=@t octs=[p=@ud q=@t]]
|
||||||
|
+$ contact-0
|
||||||
|
$: nickname=@t
|
||||||
|
email=@t
|
||||||
|
phone=@t
|
||||||
|
website=@t
|
||||||
|
notes=@t
|
||||||
|
color=@ux
|
||||||
|
avatar=(unit avatar-0)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ state-zero
|
+$ state-zero
|
||||||
$: %0
|
$: %0
|
||||||
=rolodex
|
rolodex=rolodex-0
|
||||||
==
|
==
|
||||||
+$ diff
|
+$ state-one
|
||||||
$% [%contact-update contact-update]
|
$: %1
|
||||||
|
=rolodex
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
=| state-zero
|
=| state-one
|
||||||
=* state -
|
=* state -
|
||||||
%- agent:dbug
|
%- agent:dbug
|
||||||
^- agent:gall
|
^- agent:gall
|
||||||
@ -30,8 +45,26 @@
|
|||||||
++ on-init on-init:def
|
++ on-init on-init:def
|
||||||
++ on-save !>(state)
|
++ on-save !>(state)
|
||||||
++ on-load
|
++ on-load
|
||||||
|= old=vase
|
|= old-vase=vase
|
||||||
`this(state !<(state-zero old))
|
=/ old !<(versioned-state old-vase)
|
||||||
|
?: ?=(%1 -.old)
|
||||||
|
[~ this(state old)]
|
||||||
|
=/ new-rolodex=^rolodex
|
||||||
|
%- ~(run by rolodex.old)
|
||||||
|
|= cons=contacts-0
|
||||||
|
^- contacts
|
||||||
|
%- ~(run by cons)
|
||||||
|
|= con=contact-0
|
||||||
|
^- contact
|
||||||
|
:* nickname.con
|
||||||
|
email.con
|
||||||
|
phone.con
|
||||||
|
website.con
|
||||||
|
notes.con
|
||||||
|
color.con
|
||||||
|
~
|
||||||
|
==
|
||||||
|
[~ this(state [%1 new-rolodex])]
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
@ -142,7 +175,7 @@
|
|||||||
|= [=path =ship]
|
|= [=path =ship]
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
=/ contacts (~(got by rolodex) path)
|
=/ contacts (~(got by rolodex) path)
|
||||||
?> (~(has by contacts) ship)
|
?. (~(has by contacts) ship) [~ state]
|
||||||
=. contacts (~(del by contacts) ship)
|
=. contacts (~(del by contacts) ship)
|
||||||
:- (send-diff path [%remove path ship])
|
:- (send-diff path [%remove path ship])
|
||||||
state(rolodex (~(put by rolodex) path contacts))
|
state(rolodex (~(put by rolodex) path contacts))
|
||||||
|
@ -147,9 +147,9 @@
|
|||||||
::
|
::
|
||||||
%delete
|
%delete
|
||||||
%+ weld
|
%+ weld
|
||||||
:~ (group-poke [%unbundle path.act])
|
:~ (contact-hook-poke [%remove path.act])
|
||||||
|
(group-poke [%unbundle path.act])
|
||||||
(contact-poke [%delete path.act])
|
(contact-poke [%delete path.act])
|
||||||
(contact-hook-poke [%remove path.act])
|
|
||||||
==
|
==
|
||||||
(delete-metadata path.act)
|
(delete-metadata path.act)
|
||||||
::
|
::
|
||||||
@ -181,21 +181,19 @@
|
|||||||
::
|
::
|
||||||
:: avatar images
|
:: avatar images
|
||||||
::
|
::
|
||||||
:: [%'~groups' %avatar @ *]
|
[%'~groups' %avatar @ *]
|
||||||
:: =/ pax=path `path`t.t.site.url
|
=/ =path (flop t.t.site.url)
|
||||||
:: ?~ pax not-found:gen
|
?~ path not-found:gen
|
||||||
:: =/ pas `path`(flop pax)
|
=/ contact (contact-scry `^path`(snoc (flop t.path) name))
|
||||||
:: ?~ pas not-found:gen
|
?~ contact not-found:gen
|
||||||
:: =/ pav `path`(flop t.pas)
|
?~ avatar.u.contact not-found:gen
|
||||||
:: ~& pav+pav
|
?- -.u.avatar.u.contact
|
||||||
:: ~& name+name
|
%url [[307 ['location' url.u.avatar.u.contact]~] ~]
|
||||||
:: =/ contact (contact-scry `path`(weld pav [name]~))
|
%octt
|
||||||
:: ?~ contact not-found:gen
|
=/ max-3-days ['cache-control' 'max-age=259200']
|
||||||
:: ?~ avatar.u.contact not-found:gen
|
=/ content-type ['content-type' content-type.u.avatar.u.contact]
|
||||||
:: =* avatar u.avatar.u.contact
|
[[200 [content-type max-3-days ~]] `octs.u.avatar.u.contact]
|
||||||
:: =/ decoded (de:base64 q.octs.avatar)
|
==
|
||||||
:: ?~ decoded not-found:gen
|
|
||||||
:: [[200 ['content-type' content-type.avatar]~] `u.decoded]
|
|
||||||
::
|
::
|
||||||
[%'~groups' *] (html-response:gen index)
|
[%'~groups' *] (html-response:gen index)
|
||||||
==
|
==
|
||||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 880 B |
BIN
pkg/arvo/app/contacts/img/ImageUpload.png
Normal file
After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
@ -13,5 +13,6 @@
|
|||||||
<script src="/~channel/channel.js"></script>
|
<script src="/~channel/channel.js"></script>
|
||||||
<script src="/~modulo/session.js"></script>
|
<script src="/~modulo/session.js"></script>
|
||||||
<script src="/~groups/js/index.js"></script>
|
<script src="/~groups/js/index.js"></script>
|
||||||
|
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1.12.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
898
pkg/arvo/app/dbug.hoon
Normal file
@ -0,0 +1,898 @@
|
|||||||
|
:: dbug: debug dashboard server
|
||||||
|
::
|
||||||
|
/- spider
|
||||||
|
/+ server, default-agent, verb, dbug
|
||||||
|
::
|
||||||
|
|%
|
||||||
|
+$ state-0 [%0 passcode=(unit @t)]
|
||||||
|
+$ card card:agent:gall
|
||||||
|
--
|
||||||
|
::
|
||||||
|
=| state-0
|
||||||
|
=* state -
|
||||||
|
::
|
||||||
|
%+ verb |
|
||||||
|
%- agent:dbug
|
||||||
|
^- agent:gall
|
||||||
|
=<
|
||||||
|
|_ =bowl:gall
|
||||||
|
+* this .
|
||||||
|
do ~(. +> bowl)
|
||||||
|
def ~(. (default-agent this %|) bowl)
|
||||||
|
::
|
||||||
|
++ on-init
|
||||||
|
^- (quip card _this)
|
||||||
|
:_ this
|
||||||
|
[%pass /connect %arvo %e %connect [~ /'~debug'] dap.bowl]~
|
||||||
|
::
|
||||||
|
++ on-save !>(state)
|
||||||
|
::
|
||||||
|
++ on-load
|
||||||
|
|= old=vase
|
||||||
|
^- (quip card _this)
|
||||||
|
[~ this(state !<(state-0 old))]
|
||||||
|
::
|
||||||
|
++ on-watch
|
||||||
|
|= =path
|
||||||
|
^- (quip card _this)
|
||||||
|
?. ?=([%http-response *] path)
|
||||||
|
(on-watch:def path)
|
||||||
|
[~ this]
|
||||||
|
::
|
||||||
|
++ on-poke
|
||||||
|
|= [=mark =vase]
|
||||||
|
^- (quip card _this)
|
||||||
|
?: ?=(%noun mark)
|
||||||
|
?> (team:title [our src]:bowl)
|
||||||
|
=/ code !<((unit @t) vase)
|
||||||
|
=/ msg=tape
|
||||||
|
?~ code
|
||||||
|
"Removing passcode access for debug interface."
|
||||||
|
"""
|
||||||
|
Enabling passcode access for debug interface. Anyone with this code can
|
||||||
|
view your applications' state, the people you've talked to, etc. Only
|
||||||
|
share with people you trust. To disable, run :dbug ~
|
||||||
|
"""
|
||||||
|
%- (slog leaf+msg ~)
|
||||||
|
[~ this(passcode code)]
|
||||||
|
?. ?=(%handle-http-request mark)
|
||||||
|
(on-poke:def mark vase)
|
||||||
|
=+ !<([eyre-id=@ta =inbound-request:eyre] vase)
|
||||||
|
:_ this
|
||||||
|
%+ give-simple-payload:app:server eyre-id
|
||||||
|
%+ authorize-http-request:do inbound-request
|
||||||
|
handle-http-request:do
|
||||||
|
::
|
||||||
|
++ on-arvo
|
||||||
|
|= [=wire =sign-arvo]
|
||||||
|
^- (quip card _this)
|
||||||
|
?. ?=([%e %bound *] sign-arvo)
|
||||||
|
(on-arvo:def wire sign-arvo)
|
||||||
|
~? !accepted.sign-arvo
|
||||||
|
[dap.bowl "bind rejected!" binding.sign-arvo]
|
||||||
|
[~ this]
|
||||||
|
::
|
||||||
|
++ on-peek on-peek:def
|
||||||
|
++ on-leave on-leave:def
|
||||||
|
++ on-agent on-agent:def
|
||||||
|
++ on-fail on-fail:def
|
||||||
|
--
|
||||||
|
::
|
||||||
|
|_ =bowl:gall
|
||||||
|
::
|
||||||
|
:: serving
|
||||||
|
::
|
||||||
|
++ authorize-http-request
|
||||||
|
=, server
|
||||||
|
:: if no passcode configured, only allow host ship to view
|
||||||
|
::
|
||||||
|
?~ passcode require-authorization:app
|
||||||
|
|= $: =inbound-request:eyre
|
||||||
|
handler=$-(inbound-request:eyre simple-payload:http)
|
||||||
|
==
|
||||||
|
?: authenticated.inbound-request
|
||||||
|
(handler inbound-request)
|
||||||
|
:: else, allow randos access,
|
||||||
|
:: on the condition they provide a correct ?passcode= url parameter
|
||||||
|
::
|
||||||
|
=; pass=(unit @t)
|
||||||
|
?: =(passcode pass)
|
||||||
|
(handler inbound-request)
|
||||||
|
(require-authorization:app inbound-request handler)
|
||||||
|
=/ from-url=(unit @t)
|
||||||
|
=- (~(get by -) 'passcode')
|
||||||
|
%- ~(gas by *(map @t @t))
|
||||||
|
args:(parse-request-line url.request.inbound-request)
|
||||||
|
?^ from-url from-url
|
||||||
|
:: try the referer field instead
|
||||||
|
::
|
||||||
|
=/ ref-url=(unit @t)
|
||||||
|
(get-header:http 'referer' header-list.request.inbound-request)
|
||||||
|
?~ ref-url ~
|
||||||
|
?~ (find "passcode={(trip u.passcode)}" (trip u.ref-url)) ~
|
||||||
|
passcode
|
||||||
|
::
|
||||||
|
++ handle-http-request
|
||||||
|
=, server
|
||||||
|
|= =inbound-request:eyre
|
||||||
|
^- simple-payload:http
|
||||||
|
=/ =request-line
|
||||||
|
%- parse-request-line
|
||||||
|
url.request.inbound-request
|
||||||
|
=* req-head header-list.request.inbound-request
|
||||||
|
::TODO handle POST
|
||||||
|
?. ?=(%'GET' method.request.inbound-request)
|
||||||
|
not-found:gen
|
||||||
|
(handle-get-request req-head request-line)
|
||||||
|
::
|
||||||
|
++ handle-get-request
|
||||||
|
=, server
|
||||||
|
|= [headers=header-list:http request-line]
|
||||||
|
^- simple-payload:http
|
||||||
|
=? site ?=([%'~debug' *] site) t.site
|
||||||
|
?~ ext
|
||||||
|
$(ext `%html, site [%index ~]) ::NOTE hack
|
||||||
|
:: if not json, serve static file
|
||||||
|
::
|
||||||
|
?. ?=([~ %json] ext)
|
||||||
|
=/ file=(unit octs)
|
||||||
|
(get-file-at /app/debug site u.ext)
|
||||||
|
?~ file not-found:gen
|
||||||
|
?+ u.ext not-found:gen
|
||||||
|
%html (html-response:gen u.file)
|
||||||
|
%js (js-response:gen u.file)
|
||||||
|
%css (css-response:gen u.file)
|
||||||
|
%png (png-response:gen u.file)
|
||||||
|
==
|
||||||
|
:: get data matching the json and convert it
|
||||||
|
::
|
||||||
|
=; json=(unit json)
|
||||||
|
?~ json not-found:gen
|
||||||
|
%- json-response:gen
|
||||||
|
=, html
|
||||||
|
(as-octt:mimes (en-json u.json))
|
||||||
|
=, enjs:format
|
||||||
|
?+ site ~
|
||||||
|
:: /apps.json: {appname: running?}
|
||||||
|
::
|
||||||
|
[%apps ~]
|
||||||
|
%- some
|
||||||
|
%- pairs
|
||||||
|
%+ turn all:apps
|
||||||
|
|= app=term
|
||||||
|
[app b+(running:apps app)]
|
||||||
|
::
|
||||||
|
:: /app/[appname]...
|
||||||
|
::
|
||||||
|
[%app @ *]
|
||||||
|
=* app i.t.site
|
||||||
|
::TODO ?. (dbugable:apps app) ~
|
||||||
|
=/ rest=^path t.t.site
|
||||||
|
?+ rest ~
|
||||||
|
:: /app/[appname].json: {state: }
|
||||||
|
::
|
||||||
|
~
|
||||||
|
%- some
|
||||||
|
%- pairs
|
||||||
|
:~ :- 'simpleState'
|
||||||
|
%- tank
|
||||||
|
=; head=(unit ^tank)
|
||||||
|
(fall head leaf+"unversioned")
|
||||||
|
:: try to print the state version
|
||||||
|
::
|
||||||
|
=/ version=(unit vase)
|
||||||
|
(slew 2 (state:apps app))
|
||||||
|
?~ version ~
|
||||||
|
?. ?=(%atom -.p.u.version) ~
|
||||||
|
`(sell u.version)
|
||||||
|
::
|
||||||
|
:- 'subscriptions'
|
||||||
|
%- pairs
|
||||||
|
=+ (subscriptions:apps app)
|
||||||
|
|^ ~['in'^(incoming in) 'out'^(outgoing out)]
|
||||||
|
::
|
||||||
|
++ incoming
|
||||||
|
|= =bitt:gall
|
||||||
|
^- json
|
||||||
|
:- %a
|
||||||
|
%+ turn ~(tap by bitt)
|
||||||
|
|= [d=duct [s=^ship p=^path]]
|
||||||
|
%- pairs
|
||||||
|
:~ 'duct'^a+(turn d path)
|
||||||
|
'ship'^(ship s)
|
||||||
|
'path'^(path p)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ outgoing
|
||||||
|
|= =boat:gall
|
||||||
|
^- json
|
||||||
|
:- %a
|
||||||
|
%+ turn ~(tap by boat)
|
||||||
|
|= [[w=wire s=^ship t=term] [a=? p=^path]]
|
||||||
|
%- pairs
|
||||||
|
:~ 'wire'^(path w)
|
||||||
|
'ship'^(ship s)
|
||||||
|
'app'^s+t
|
||||||
|
'acked'^b+a
|
||||||
|
'path'^(path p)
|
||||||
|
==
|
||||||
|
--
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /app/[appname]/state.json
|
||||||
|
:: /app/[appname]/state/[query].json
|
||||||
|
::
|
||||||
|
[%state ?(~ [@ ~])]
|
||||||
|
%- some
|
||||||
|
=- (pairs 'state'^(tank -) ~)
|
||||||
|
%+ state-at:apps app
|
||||||
|
?~ t.rest ~
|
||||||
|
(slaw %t i.t.rest)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /spider.json
|
||||||
|
::
|
||||||
|
[%spider %threads ~]
|
||||||
|
%- some
|
||||||
|
:: turn flat stack descriptors into object (tree) representing stacks
|
||||||
|
::
|
||||||
|
|^ (tree-to-json build-thread-tree)
|
||||||
|
::
|
||||||
|
+$ tree
|
||||||
|
$~ ~
|
||||||
|
(map tid:spider tree)
|
||||||
|
::
|
||||||
|
++ build-thread-tree
|
||||||
|
%+ roll tree:threads
|
||||||
|
|= [stack=(list tid:spider) =tree]
|
||||||
|
?~ stack tree
|
||||||
|
%+ ~(put by tree) i.stack
|
||||||
|
%_ $
|
||||||
|
stack t.stack
|
||||||
|
tree (~(gut by tree) i.stack ~)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ tree-to-json
|
||||||
|
|= =tree
|
||||||
|
o+(~(run by tree) tree-to-json)
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: /azimuth/status
|
||||||
|
::
|
||||||
|
:: /ames/peer.json
|
||||||
|
::
|
||||||
|
[%ames %peer ~]
|
||||||
|
=/ [known=(list [^ship *]) alien=(list [^ship *])]
|
||||||
|
%+ skid ~(tap by peers:v-ames)
|
||||||
|
|= [^ship kind=?(%alien %known)]
|
||||||
|
?=(%known kind)
|
||||||
|
%- some
|
||||||
|
%- pairs
|
||||||
|
::NOTE would do (cork head ship) but can't get that to compile...
|
||||||
|
:~ 'known'^a+(turn (turn known head) ship)
|
||||||
|
'alien'^a+(turn (turn alien head) ship)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /ames/peer/[shipname].json
|
||||||
|
::
|
||||||
|
[%ames %peer @ ~]
|
||||||
|
=/ who=^ship
|
||||||
|
(rash i.t.t.site fed:ag)
|
||||||
|
%- some
|
||||||
|
=, v-ames
|
||||||
|
(peer-to-json (peer who))
|
||||||
|
::
|
||||||
|
:: /behn/timers.json
|
||||||
|
::
|
||||||
|
[%behn %timers ~]
|
||||||
|
%- some
|
||||||
|
:- %a
|
||||||
|
%+ turn timers:v-behn
|
||||||
|
|= [date=@da =duct]
|
||||||
|
%- pairs
|
||||||
|
:~ 'date'^(time date)
|
||||||
|
'duct'^a+(turn duct path)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /clay/commits.json
|
||||||
|
::
|
||||||
|
[%clay %commits ~]
|
||||||
|
(some commits-json:v-clay)
|
||||||
|
::
|
||||||
|
:: /eyre/bindings.json
|
||||||
|
::
|
||||||
|
[%eyre %bindings ~]
|
||||||
|
%- some
|
||||||
|
:- %a
|
||||||
|
%+ turn bindings:v-eyre
|
||||||
|
=, eyre
|
||||||
|
|= [binding =duct =action]
|
||||||
|
%- pairs
|
||||||
|
:~ 'location'^s+(cat 3 (fall site '*') (spat path))
|
||||||
|
'action'^(render-action:v-eyre action)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /eyre/connections.json
|
||||||
|
::
|
||||||
|
[%eyre %connections ~]
|
||||||
|
%- some
|
||||||
|
:- %a
|
||||||
|
%+ turn ~(tap by connections:v-eyre)
|
||||||
|
|= [=duct outstanding-connection:eyre]
|
||||||
|
%- pairs
|
||||||
|
:~ 'duct'^a+(turn duct path)
|
||||||
|
'action'^(render-action:v-eyre action)
|
||||||
|
::
|
||||||
|
:- 'request'
|
||||||
|
%- pairs
|
||||||
|
=, inbound-request
|
||||||
|
:~ 'authenticated'^b+authenticated
|
||||||
|
'secure'^b+secure
|
||||||
|
'source'^s+(scot %if +.address)
|
||||||
|
:: ?- -.address
|
||||||
|
:: %ipv4 %if
|
||||||
|
:: %ipv6 %is
|
||||||
|
:: ==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'response'
|
||||||
|
%- pairs
|
||||||
|
:~ 'sent'^(numb bytes-sent)
|
||||||
|
::
|
||||||
|
:- 'header'
|
||||||
|
?~ response-header ~
|
||||||
|
=, u.response-header
|
||||||
|
%- pairs
|
||||||
|
:~ 'status-code'^(numb status-code)
|
||||||
|
::
|
||||||
|
:- 'headers'
|
||||||
|
:- %a
|
||||||
|
%+ turn headers
|
||||||
|
|=([k=@t v=@t] s+:((cury cat 3) k ': ' v))
|
||||||
|
==
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /eyre/authentication.json
|
||||||
|
::
|
||||||
|
[%eyre %authentication ~]
|
||||||
|
%- some
|
||||||
|
:- %a
|
||||||
|
%+ turn
|
||||||
|
%+ sort ~(tap by sessions:auth-state:v-eyre)
|
||||||
|
|= [[@uv a=@da] [@uv b=@da]]
|
||||||
|
(gth a b)
|
||||||
|
|= [cookie=@uv session:eyre]
|
||||||
|
%- pairs
|
||||||
|
:~ 'cookie'^s+(end 3 4 (rsh 3 2 (scot %x (shax cookie))))
|
||||||
|
'expiry'^(time expiry-time)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: /eyre/channels.json
|
||||||
|
::
|
||||||
|
[%eyre %channels ~]
|
||||||
|
%- some
|
||||||
|
:- %a
|
||||||
|
=+ channel-state:v-eyre
|
||||||
|
%+ turn ~(tap by session)
|
||||||
|
|= [key=@t channel:eyre]
|
||||||
|
%- pairs
|
||||||
|
:~ 'session'^s+key
|
||||||
|
'connected'^b+!-.state
|
||||||
|
'expiry'^?-(-.state %& (time date.p.state), %| ~)
|
||||||
|
'next-id'^(numb next-id)
|
||||||
|
'unacked'^a+(turn (sort (turn ~(tap in events) head) dor) numb)
|
||||||
|
::
|
||||||
|
:- 'subscriptions'
|
||||||
|
:- %a
|
||||||
|
%+ turn ~(tap by subscriptions)
|
||||||
|
|= [=wire [=^ship app=term =^path *]]
|
||||||
|
%- pairs
|
||||||
|
:~ 'wire'^(^path wire)
|
||||||
|
'ship'^(^ship ship)
|
||||||
|
'app'^s+app
|
||||||
|
'path'^(^path path)
|
||||||
|
==
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ get-file-at
|
||||||
|
|= [base=path file=path ext=@ta]
|
||||||
|
^- (unit octs)
|
||||||
|
?. ?=(?(%html %css %js %png) ext)
|
||||||
|
~
|
||||||
|
=/ =path
|
||||||
|
:* (scot %p our.bowl)
|
||||||
|
q.byk.bowl
|
||||||
|
(scot %da now.bowl)
|
||||||
|
(snoc (weld base file) ext)
|
||||||
|
==
|
||||||
|
?. .^(? %cu path) ~
|
||||||
|
%- some
|
||||||
|
%- as-octs:mimes:html
|
||||||
|
.^(@ %cx path)
|
||||||
|
::
|
||||||
|
:: applications
|
||||||
|
::
|
||||||
|
++ apps
|
||||||
|
|%
|
||||||
|
++ all
|
||||||
|
^- (list term)
|
||||||
|
%+ murn
|
||||||
|
(scry (list path) %ct %home /app)
|
||||||
|
|= =path
|
||||||
|
^- (unit term)
|
||||||
|
?. ?=([%app @ %hoon ~] path) ~
|
||||||
|
`i.t.path
|
||||||
|
::
|
||||||
|
++ running
|
||||||
|
|= app=term
|
||||||
|
(scry ? %gu app ~)
|
||||||
|
::
|
||||||
|
++ dbugable
|
||||||
|
|= app=term
|
||||||
|
^- ?
|
||||||
|
!! ::TODO how to check if it supports the /dbug scries?
|
||||||
|
::
|
||||||
|
++ state
|
||||||
|
|= app=term
|
||||||
|
^- vase
|
||||||
|
(scry-dbug vase app /state)
|
||||||
|
::
|
||||||
|
++ state-at
|
||||||
|
|= [app=term what=(unit @t)]
|
||||||
|
^- tank
|
||||||
|
=/ state=vase (state app)
|
||||||
|
?~ what (sell state)
|
||||||
|
=/ result=(each vase tang)
|
||||||
|
%- mule |.
|
||||||
|
%+ slap
|
||||||
|
(slop state !>([bowl=bowl ..zuse]))
|
||||||
|
(ream u.what)
|
||||||
|
?- -.result
|
||||||
|
%& (sell p.result)
|
||||||
|
%| (head p.result)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ subscriptions
|
||||||
|
=, gall
|
||||||
|
|= app=term
|
||||||
|
^- [out=boat in=bitt]
|
||||||
|
(scry-dbug ,[boat bitt] app /subscriptions)
|
||||||
|
::
|
||||||
|
++ scry-dbug
|
||||||
|
|* [=mold app=term =path]
|
||||||
|
(scry mold %gx app (snoc `^path`[%dbug path] %noun))
|
||||||
|
::
|
||||||
|
::TODO but why? we can't tell if it's on or not
|
||||||
|
++ poke-verb-toggle
|
||||||
|
|= app=term
|
||||||
|
^- card
|
||||||
|
(poke /verb/[app] app %verb !>(%loud))
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: threads
|
||||||
|
::
|
||||||
|
++ threads
|
||||||
|
|%
|
||||||
|
::NOTE every (list tid:spider) represents a stack,
|
||||||
|
:: with a unique tid at the end
|
||||||
|
++ tree
|
||||||
|
(scry (list (list tid:spider)) %gx %spider /tree/noun)
|
||||||
|
::
|
||||||
|
++ poke-kill
|
||||||
|
|= =tid:spider
|
||||||
|
^- card
|
||||||
|
(poke /spider/kill/[tid] %spider %spider-stop !>([tid |]))
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: ames
|
||||||
|
::
|
||||||
|
++ v-ames
|
||||||
|
|%
|
||||||
|
++ peers
|
||||||
|
(scry (map ship ?(%alien %known)) %a %peers ~)
|
||||||
|
::
|
||||||
|
++ peer
|
||||||
|
|= who=ship
|
||||||
|
(scry ship-state:ames %a %peer /(scot %p who))
|
||||||
|
::
|
||||||
|
++ peer-to-json
|
||||||
|
=, ames
|
||||||
|
=, enjs:format
|
||||||
|
|= =ship-state
|
||||||
|
|^ ^- json
|
||||||
|
%+ frond -.ship-state
|
||||||
|
?- -.ship-state
|
||||||
|
%alien (alien +.ship-state)
|
||||||
|
%known (known +.ship-state)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ alien
|
||||||
|
|= alien-agenda
|
||||||
|
%- pairs
|
||||||
|
:~ 'messages'^(numb (lent messages))
|
||||||
|
'packets'^(numb ~(wyt in packets))
|
||||||
|
'heeds'^(set-array heeds from-duct)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:: json for known peer is structured to closely match the peer-state type.
|
||||||
|
:: where an index is specified, the array is generally sorted by those.
|
||||||
|
::
|
||||||
|
:: { life: 123,
|
||||||
|
:: route: { direct: true, lane: 'something' },
|
||||||
|
:: qos: { kind: 'status', last-contact: 123456 }, // ms timestamp
|
||||||
|
:: flows: { forward: [snd, rcv, ...], backward: [snd, rcv, ...] }
|
||||||
|
:: -> snd:
|
||||||
|
:: { bone: 123, // index
|
||||||
|
:: duct: ['/paths', ...]
|
||||||
|
:: current: 123,
|
||||||
|
:: next: 123,
|
||||||
|
:: unsent-messages: [123, ...], // size in bytes
|
||||||
|
:: queued-message-acks: [{
|
||||||
|
:: message-num: 123, // index
|
||||||
|
:: ack: 'ok'
|
||||||
|
:: }, ...],
|
||||||
|
:: packet-pump-state: {
|
||||||
|
:: next-wake: 123456, // ms timestamp
|
||||||
|
:: live: [{
|
||||||
|
:: message-num: 123, // index
|
||||||
|
:: fragment-num: 123, // index
|
||||||
|
:: num-fragments: 123,
|
||||||
|
:: last-sent: 123456, // ms timestamp
|
||||||
|
:: retries: 123,
|
||||||
|
:: skips: 123
|
||||||
|
:: }, ...],
|
||||||
|
:: metrics: {
|
||||||
|
:: rto: 123, // seconds
|
||||||
|
:: rtt: 123, // seconds
|
||||||
|
:: rttvar: 123,
|
||||||
|
:: ssthresh: 123,
|
||||||
|
:: num-live: 123,
|
||||||
|
:: cwnd: 123,
|
||||||
|
:: counter: 123
|
||||||
|
:: }
|
||||||
|
:: }
|
||||||
|
:: }
|
||||||
|
:: -> rcv:
|
||||||
|
:: { bone: 123, // index
|
||||||
|
:: duct: ['/paths', ...] // index
|
||||||
|
:: last-acked: 123,
|
||||||
|
:: last-heard: 123,
|
||||||
|
:: pending-vane-ack: [123, ...],
|
||||||
|
:: live-messages: [{
|
||||||
|
:: message-num: 123, // index
|
||||||
|
:: num-received: 122,
|
||||||
|
:: num-fragments: 123,
|
||||||
|
:: fragments: [123, ...]
|
||||||
|
:: }, ...],
|
||||||
|
:: nax: [123, ...]
|
||||||
|
:: }
|
||||||
|
:: nax: [{
|
||||||
|
:: bone: 123, // index
|
||||||
|
:: duct: ['/paths', ...],
|
||||||
|
:: message-num: 123
|
||||||
|
:: }, ...],
|
||||||
|
:: heeds: [['/paths', ...] ...]
|
||||||
|
:: }
|
||||||
|
::
|
||||||
|
++ known
|
||||||
|
|= peer-state
|
||||||
|
%- pairs
|
||||||
|
:~ 'life'^(numb life)
|
||||||
|
::
|
||||||
|
:- 'route'
|
||||||
|
%+ maybe route
|
||||||
|
|= [direct=? =lane]
|
||||||
|
%- pairs
|
||||||
|
:~ 'direct'^b+direct
|
||||||
|
::
|
||||||
|
:- 'lane'
|
||||||
|
?- -.lane
|
||||||
|
%& (ship p.lane)
|
||||||
|
::
|
||||||
|
%|
|
||||||
|
?~ l=((soft ,[=@tas =@if =@ud]) (cue p.lane))
|
||||||
|
s+(scot %x p.lane)
|
||||||
|
=, u.l
|
||||||
|
(tape "%{(trip tas)}, {(scow %if if)}, {(scow %ud ud)}")
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'qos'
|
||||||
|
%- pairs
|
||||||
|
:~ 'kind'^s+-.qos
|
||||||
|
'last-contact'^(time last-contact.qos)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'flows'
|
||||||
|
|^ =/ mix=(list flow)
|
||||||
|
=- (sort - dor)
|
||||||
|
%+ welp
|
||||||
|
(turn ~(tap by snd) (tack %snd))
|
||||||
|
(turn ~(tap by rcv) (tack %rcv))
|
||||||
|
=/ [forward=(list flow) backward=(list flow)]
|
||||||
|
%+ skid mix
|
||||||
|
|= [=bone *]
|
||||||
|
=(0 (mod bone 2))
|
||||||
|
%- pairs
|
||||||
|
:~ ['forward' a+(turn forward build)]
|
||||||
|
['backward' a+(turn backward build)]
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ flow
|
||||||
|
$: =bone
|
||||||
|
::
|
||||||
|
$= state
|
||||||
|
$% [%snd message-pump-state]
|
||||||
|
[%rcv message-sink-state]
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ tack
|
||||||
|
|* =term
|
||||||
|
|* [=bone =noun]
|
||||||
|
[bone [term noun]]
|
||||||
|
::
|
||||||
|
++ build
|
||||||
|
|= flow
|
||||||
|
^- json
|
||||||
|
%+ frond -.state
|
||||||
|
?- -.state
|
||||||
|
%snd (snd-with-bone ossuary bone +.state)
|
||||||
|
%rcv (rcv-with-bone ossuary bone +.state)
|
||||||
|
==
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:- 'nax'
|
||||||
|
:- %a
|
||||||
|
%+ turn (sort ~(tap in nax) dor) :: sort by bone
|
||||||
|
|= [=bone =message-num]
|
||||||
|
%- pairs
|
||||||
|
:* 'message-num'^(numb message-num)
|
||||||
|
(bone-to-pairs bone ossuary)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
'heeds'^(set-array heeds from-duct)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ snd-with-bone
|
||||||
|
|= [=ossuary =bone message-pump-state]
|
||||||
|
^- json
|
||||||
|
%- pairs
|
||||||
|
:* 'current'^(numb current)
|
||||||
|
'next'^(numb next)
|
||||||
|
::
|
||||||
|
:- 'unsent-messages' :: as byte sizes
|
||||||
|
(set-array unsent-messages (cork (cury met 3) numb))
|
||||||
|
::
|
||||||
|
'unsent-fragments'^(numb (lent unsent-fragments)) :: as lent
|
||||||
|
::
|
||||||
|
:- 'queued-message-acks'
|
||||||
|
:- %a
|
||||||
|
%+ turn (sort ~(tap by queued-message-acks) dor) :: sort by msg nr
|
||||||
|
|= [=message-num =ack]
|
||||||
|
%- pairs
|
||||||
|
:~ 'message-num'^(numb message-num)
|
||||||
|
'ack'^s+-.ack
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'packet-pump-state'
|
||||||
|
%- pairs
|
||||||
|
=, packet-pump-state
|
||||||
|
:~ 'next-wake'^(maybe next-wake time)
|
||||||
|
::
|
||||||
|
:- 'live'
|
||||||
|
:- %a
|
||||||
|
%+ turn (sort ~(tap in live) dor) :: sort by msg nr & frg nr
|
||||||
|
|= [live-packet-key live-packet-val]
|
||||||
|
%- pairs
|
||||||
|
:~ 'message-num'^(numb message-num)
|
||||||
|
'fragment-num'^(numb fragment-num)
|
||||||
|
'num-fragments'^(numb num-fragments)
|
||||||
|
'last-sent'^(time last-sent)
|
||||||
|
'retries'^(numb retries)
|
||||||
|
'skips'^(numb skips)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
:- 'metrics'
|
||||||
|
%- pairs
|
||||||
|
=, metrics
|
||||||
|
:~ 'rto'^(numb (div rto ~s1)) ::TODO milliseconds?
|
||||||
|
'rtt'^(numb (div rtt ~s1))
|
||||||
|
'rttvar'^(numb (div rttvar ~s1))
|
||||||
|
'ssthresh'^(numb ssthresh)
|
||||||
|
'num-live'^(numb num-live)
|
||||||
|
'cwnd'^(numb cwnd)
|
||||||
|
'counter'^(numb counter)
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
(bone-to-pairs bone ossuary)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ rcv-with-bone
|
||||||
|
|= [=ossuary =bone message-sink-state]
|
||||||
|
^- json
|
||||||
|
%- pairs
|
||||||
|
:* 'last-acked'^(numb last-acked)
|
||||||
|
'last-heard'^(numb last-heard)
|
||||||
|
::
|
||||||
|
:- 'pending-vane-ack'
|
||||||
|
=- a+(turn - numb)
|
||||||
|
(sort (turn ~(tap in pending-vane-ack) head) dor) :: sort by msg #
|
||||||
|
::
|
||||||
|
:- 'live-messages'
|
||||||
|
:- %a
|
||||||
|
%+ turn (sort ~(tap by live-messages) dor) :: sort by msg #
|
||||||
|
|= [=message-num partial-rcv-message]
|
||||||
|
%- pairs
|
||||||
|
:~ 'message-num'^(numb message-num)
|
||||||
|
'num-received'^(numb num-received)
|
||||||
|
'num-fragments'^(numb num-fragments)
|
||||||
|
'fragments'^(set-array ~(key by fragments) numb)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
'nax'^a+(turn (sort ~(tap in nax) dor) numb)
|
||||||
|
::
|
||||||
|
(bone-to-pairs bone ossuary)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ bone-to-pairs
|
||||||
|
|= [=bone ossuary]
|
||||||
|
^- (list [@t json])
|
||||||
|
:~ 'bone'^(numb bone)
|
||||||
|
'duct'^(from-duct (~(gut by by-bone) bone ~))
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ maybe
|
||||||
|
|* [unit=(unit) enjs=$-(* json)]
|
||||||
|
^- json
|
||||||
|
?~ unit ~
|
||||||
|
(enjs u.unit)
|
||||||
|
::
|
||||||
|
++ set-array
|
||||||
|
|* [set=(set) enjs=$-(* json)]
|
||||||
|
^- json
|
||||||
|
a+(turn ~(tap in set) enjs)
|
||||||
|
::
|
||||||
|
++ from-duct
|
||||||
|
|= =duct
|
||||||
|
a+(turn duct path)
|
||||||
|
--
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: behn
|
||||||
|
::
|
||||||
|
++ v-behn
|
||||||
|
|%
|
||||||
|
++ timers
|
||||||
|
(scry ,(list [date=@da =duct]) %b %timers ~)
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: clay
|
||||||
|
::
|
||||||
|
::TODO depends on new clay changes (%s care)
|
||||||
|
++ v-clay
|
||||||
|
=, clay
|
||||||
|
|%
|
||||||
|
++ start-path /(scot %p our.bowl)/home/(scot %da now.bowl)
|
||||||
|
::
|
||||||
|
+$ commit
|
||||||
|
[=tako parents=(list tako) children=(list tako) wen=@da content-hash=@uvI]
|
||||||
|
::
|
||||||
|
++ commits-json
|
||||||
|
^- json
|
||||||
|
=+ .^(desks=(set desk) %cd start-path)
|
||||||
|
=/ heads=(list [tako desk])
|
||||||
|
%+ turn ~(tap in desks)
|
||||||
|
|= =desk
|
||||||
|
=+ .^(=dome %cv /(scot %p our.bowl)/[desk]/(scot %da now.bowl))
|
||||||
|
=/ =tako (~(got by hit.dome) let.dome)
|
||||||
|
[tako desk]
|
||||||
|
=/ yakis=(set yaki)
|
||||||
|
%- silt
|
||||||
|
^- (list yaki)
|
||||||
|
%- zing
|
||||||
|
%+ turn heads
|
||||||
|
|= [=tako =desk]
|
||||||
|
(trace-tako tako)
|
||||||
|
=/ commits=(list commit) (yakis-to-commits ~(tap in yakis))
|
||||||
|
=, enjs:format
|
||||||
|
%: pairs
|
||||||
|
head+(pairs (turn heads |=([=tako =desk] (scot %uv tako)^s+desk)))
|
||||||
|
commits+(commits-to-json commits)
|
||||||
|
~
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ yakis-to-commits
|
||||||
|
|= yakis=(list yaki)
|
||||||
|
^- (list commit)
|
||||||
|
%+ turn yakis
|
||||||
|
|= =yaki
|
||||||
|
:* r.yaki p.yaki
|
||||||
|
=/ candidates
|
||||||
|
%+ turn
|
||||||
|
(skim yakis |=(can=^yaki (lien p.can |=(=tako =(r.yaki tako)))))
|
||||||
|
|= can=^yaki
|
||||||
|
r.can
|
||||||
|
~(tap in (silt candidates))
|
||||||
|
t.yaki
|
||||||
|
.^(@uvI %cs (weld start-path /hash/(scot %uv r.yaki)))
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ trace-tako
|
||||||
|
|= =tako
|
||||||
|
~+
|
||||||
|
^- (list yaki)
|
||||||
|
=+ .^(=yaki %cs (weld start-path /yaki/(scot %uv tako)))
|
||||||
|
:- yaki
|
||||||
|
(zing (turn p.yaki trace-tako))
|
||||||
|
::
|
||||||
|
++ commits-to-json
|
||||||
|
|= commits=(list commit)
|
||||||
|
^- json
|
||||||
|
:- %a
|
||||||
|
%+ turn
|
||||||
|
%+ sort commits
|
||||||
|
|= [a=commit b=commit]
|
||||||
|
(gte wen.a wen.b)
|
||||||
|
|= =commit
|
||||||
|
(commit-to-json commit)
|
||||||
|
::
|
||||||
|
++ commit-to-json
|
||||||
|
|= =commit
|
||||||
|
^- json
|
||||||
|
=, enjs:format
|
||||||
|
%: pairs
|
||||||
|
'commitHash'^(tako-to-json tako.commit)
|
||||||
|
parents+a+(turn parents.commit tako-to-json)
|
||||||
|
children+a+(turn children.commit tako-to-json)
|
||||||
|
'contentHash'^(tako-to-json content-hash.commit)
|
||||||
|
~
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ tako-to-json
|
||||||
|
|= =tako
|
||||||
|
^- json
|
||||||
|
s+(scot %uv tako)
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: eyre
|
||||||
|
::
|
||||||
|
++ v-eyre
|
||||||
|
=, eyre
|
||||||
|
|%
|
||||||
|
++ bindings
|
||||||
|
(scry ,(list [=binding =duct =action]) %e %bindings ~)
|
||||||
|
::
|
||||||
|
++ connections
|
||||||
|
(scry ,(map duct outstanding-connection) %e %connections ~)
|
||||||
|
::
|
||||||
|
++ auth-state
|
||||||
|
(scry authentication-state %e %authentication-state ~)
|
||||||
|
::
|
||||||
|
++ channel-state
|
||||||
|
(scry ^channel-state %e %channel-state ~)
|
||||||
|
::
|
||||||
|
++ render-action
|
||||||
|
|= =action
|
||||||
|
^- json
|
||||||
|
:- %s
|
||||||
|
?+ -.action -.action
|
||||||
|
%gen :((cury cat 3) '+' (spat [desk path]:generator.action))
|
||||||
|
%app (cat 3 ':' app.action)
|
||||||
|
==
|
||||||
|
--
|
||||||
|
::
|
||||||
|
:: helpers
|
||||||
|
::
|
||||||
|
++ poke
|
||||||
|
|= [=wire app=term =mark =vase]
|
||||||
|
^- card
|
||||||
|
[%pass wire %agent [our.bowl app] %poke mark vase]
|
||||||
|
::
|
||||||
|
++ scry
|
||||||
|
|* [=mold care=term =desk =path]
|
||||||
|
.^(mold care (scot %p our.bowl) desk (scot %da now.bowl) path)
|
||||||
|
--
|
1
pkg/arvo/app/debug/css/index.css
Normal file
20
pkg/arvo/app/debug/index.html
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Debug Dashboard</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<link rel="stylesheet" href="/~debug/css/index.css" />
|
||||||
|
<link rel="icon" type="image/png" href="/~launch/img/Favicon.png">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="w-100 h-100">
|
||||||
|
<div id="root" class="w-100 h-100">
|
||||||
|
</div>
|
||||||
|
<script src="/~channel/channel.js"></script>
|
||||||
|
<script src="/~modulo/session.js"></script>
|
||||||
|
<script src="/~debug/js/index.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
1
pkg/arvo/app/debug/js/index.js
Normal file
1
pkg/arvo/app/debug/js/tile.js
Normal file
@ -12,9 +12,10 @@
|
|||||||
=> |% :: external structures
|
=> |% :: external structures
|
||||||
++ id @tasession :: session id
|
++ id @tasession :: session id
|
||||||
++ house :: all state
|
++ house :: all state
|
||||||
$: $5
|
$: $6
|
||||||
egg/@u :: command count
|
egg/@u :: command count
|
||||||
hoc/(map id session) :: conversations
|
hoc/(map id session) :: conversations
|
||||||
|
acl/(set ship) :: remote access whitelist
|
||||||
== ::
|
== ::
|
||||||
++ session :: per conversation
|
++ session :: per conversation
|
||||||
$: say/sole-share :: command-line state
|
$: say/sole-share :: command-line state
|
||||||
@ -1349,9 +1350,12 @@
|
|||||||
!>(state)
|
!>(state)
|
||||||
::
|
::
|
||||||
++ on-load
|
++ on-load
|
||||||
|= =old-state=vase
|
|= old=vase
|
||||||
=/ old-state !<(house old-state-vase)
|
?: ?=(%6 +<.old)
|
||||||
`..on-init(state old-state)
|
`..on-init(state !<(house old))
|
||||||
|
=/ old-5 !<([%5 egg=@u hoc=(map id session)] old)
|
||||||
|
=/ =house [%6 egg.old-5 hoc.old-5 *(set ship)]
|
||||||
|
`..on-init(state house)
|
||||||
::
|
::
|
||||||
++ on-poke
|
++ on-poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
@ -1359,6 +1363,7 @@
|
|||||||
=^ moves state
|
=^ moves state
|
||||||
^- (quip card:agent:gall house)
|
^- (quip card:agent:gall house)
|
||||||
?+ mark ~|([%dojo-poke-bad-mark mark] !!)
|
?+ mark ~|([%dojo-poke-bad-mark mark] !!)
|
||||||
|
::
|
||||||
%sole-action
|
%sole-action
|
||||||
=/ act !<(sole-action vase)
|
=/ act !<(sole-action vase)
|
||||||
he-abet:(~(he-type he hid id.act ~ (~(got by hoc) id.act)) act)
|
he-abet:(~(he-type he hid id.act ~ (~(got by hoc) id.act)) act)
|
||||||
@ -1367,8 +1372,17 @@
|
|||||||
=+ !<([=id =command:lens] vase)
|
=+ !<([=id =command:lens] vase)
|
||||||
he-abet:(~(he-lens he hid id ~ (~(got by hoc) id)) command)
|
he-abet:(~(he-lens he hid id ~ (~(got by hoc) id)) command)
|
||||||
::
|
::
|
||||||
%json
|
%allow-remote-login
|
||||||
~& jon=!<(json vase)
|
=/ who !<(@p vase)
|
||||||
|
`state(acl (~(put in acl) who))
|
||||||
|
::
|
||||||
|
%revoke-remote-login
|
||||||
|
=/ who !<(@p vase)
|
||||||
|
:_ state(acl (~(del in acl) who))
|
||||||
|
[%give %kick ~ `who]~
|
||||||
|
::
|
||||||
|
%list-remote-logins
|
||||||
|
~& acl
|
||||||
`state
|
`state
|
||||||
::
|
::
|
||||||
%wipe
|
%wipe
|
||||||
@ -1390,8 +1404,9 @@
|
|||||||
++ on-watch
|
++ on-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card:agent:gall _..on-init)
|
^- (quip card:agent:gall _..on-init)
|
||||||
~? !=(our.hid src.hid) [%dojo-peer-stranger src.hid]
|
?> ?| (team:title our.hid src.hid)
|
||||||
?> (team:title our.hid src.hid)
|
(~(has in acl) src.hid)
|
||||||
|
==
|
||||||
?> ?=([%sole @ ~] path)
|
?> ?=([%sole @ ~] path)
|
||||||
=/ id i.t.path
|
=/ id i.t.path
|
||||||
=? hoc (~(has by hoc) id)
|
=? hoc (~(has by hoc) id)
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
=> |%
|
=> |%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ app-state
|
+$ app-state
|
||||||
$: %3
|
$: %4
|
||||||
dogs=(map path watchdog)
|
dogs=(map path watchdog)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ context [=path dog=watchdog]
|
+$ context [=path dog=watchdog]
|
||||||
+$ watchdog
|
+$ watchdog
|
||||||
$: config
|
$: config
|
||||||
running=(unit =tid:spider)
|
running=(unit [since=@da =tid:spider])
|
||||||
=number:block
|
=number:block
|
||||||
=pending-logs
|
=pending-logs
|
||||||
=history
|
=history
|
||||||
@ -98,7 +98,7 @@
|
|||||||
::
|
::
|
||||||
=? old-state ?=(%2 -.old-state)
|
=? old-state ?=(%2 -.old-state)
|
||||||
%- (slog leaf+"upgrading eth-watcher from %2" ~)
|
%- (slog leaf+"upgrading eth-watcher from %2" ~)
|
||||||
^- app-state
|
^- app-state-3
|
||||||
%= old-state
|
%= old-state
|
||||||
- %3
|
- %3
|
||||||
dogs
|
dogs
|
||||||
@ -109,10 +109,52 @@
|
|||||||
==
|
==
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
[cards-1 this(state ?>(?=(%3 -.old-state) old-state))]
|
=? old-state ?=(%3 -.old-state)
|
||||||
|
%- (slog leaf+"upgrading eth-watcher from %3" ~)
|
||||||
|
^- app-state
|
||||||
|
%= old-state
|
||||||
|
- %4
|
||||||
|
dogs
|
||||||
|
%- ~(run by dogs.old-state)
|
||||||
|
|= dog=watchdog-3
|
||||||
|
%= dog
|
||||||
|
-
|
||||||
|
=, -.dog
|
||||||
|
[url eager refresh-rate (mul refresh-rate 6) from contracts topics]
|
||||||
|
::
|
||||||
|
running
|
||||||
|
?~ running.dog ~
|
||||||
|
`[now.bowl u.running.dog]
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
[cards-1 this(state ?>(?=(%4 -.old-state) old-state))]
|
||||||
::
|
::
|
||||||
+$ app-states
|
+$ app-states
|
||||||
$%(app-state-0 app-state-1 app-state-2 app-state)
|
$%(app-state-0 app-state-1 app-state-2 app-state-3 app-state)
|
||||||
|
::
|
||||||
|
+$ app-state-3
|
||||||
|
$: %3
|
||||||
|
dogs=(map path watchdog-3)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ watchdog-3
|
||||||
|
$: config-3
|
||||||
|
running=(unit =tid:spider)
|
||||||
|
=number:block
|
||||||
|
=pending-logs
|
||||||
|
=history
|
||||||
|
blocks=(list block)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ config-3
|
||||||
|
$: url=@ta
|
||||||
|
eager=?
|
||||||
|
refresh-rate=@dr
|
||||||
|
from=number:block
|
||||||
|
contracts=(list address:ethereum)
|
||||||
|
=topics
|
||||||
|
==
|
||||||
::
|
::
|
||||||
+$ app-state-2
|
+$ app-state-2
|
||||||
$: %2
|
$: %2
|
||||||
@ -175,11 +217,11 @@
|
|||||||
?- -.poke
|
?- -.poke
|
||||||
%watch
|
%watch
|
||||||
:: fully restart the watchdog if it doesn't exist yet,
|
:: fully restart the watchdog if it doesn't exist yet,
|
||||||
:: or if the new config changes more than just the url or refresh rate.
|
:: or if result-altering parts of the config changed.
|
||||||
=/ restart=?
|
=/ restart=?
|
||||||
?| !(~(has by dogs.state) path.poke)
|
?| !(~(has by dogs.state) path.poke)
|
||||||
?! .= ->+:(~(got by dogs.state) path.poke)
|
?! .= ->+>+:(~(got by dogs.state) path.poke)
|
||||||
+>.config.poke
|
+>+>.config.poke
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
=/ already (~(has by dogs.state) path.poke)
|
=/ already (~(has by dogs.state) path.poke)
|
||||||
@ -197,7 +239,7 @@
|
|||||||
?=(^ running.u.dog)
|
?=(^ running.u.dog)
|
||||||
==
|
==
|
||||||
~
|
~
|
||||||
=/ =cage [%spider-stop !>([u.running.u.dog &])]
|
=/ =cage [%spider-stop !>([tid.u.running.u.dog &])]
|
||||||
:_ ~
|
:_ ~
|
||||||
`card`[%pass [%starting path.poke] %agent [our.bowl %spider] %poke cage]
|
`card`[%pass [%starting path.poke] %agent [our.bowl %spider] %poke cage]
|
||||||
=/ new-dog
|
=/ new-dog
|
||||||
@ -385,25 +427,34 @@
|
|||||||
::
|
::
|
||||||
%- (slog leaf+"eth-watcher failed; will retry" ~)
|
%- (slog leaf+"eth-watcher failed; will retry" ~)
|
||||||
[[(wait path now.bowl refresh-rate.dog)]~ this]
|
[[(wait path now.bowl refresh-rate.dog)]~ this]
|
||||||
:: start a new thread that checks for updates
|
:: maybe kill a timed-out update thread, maybe start a new one
|
||||||
::
|
::
|
||||||
=^ cards-1=(list card) dog
|
=^ stop-cards=(list card) dog
|
||||||
:: if still running, kill it and restart
|
:: if still running beyond timeout time, kill it
|
||||||
::
|
::
|
||||||
?~ running.dog
|
?. ?& ?=(^ running.dog)
|
||||||
|
::
|
||||||
|
%+ gth now.bowl
|
||||||
|
(add since.u.running.dog timeout-time.dog)
|
||||||
|
==
|
||||||
`dog
|
`dog
|
||||||
::
|
::
|
||||||
%- (slog leaf+"eth-watcher still running; will restart" ~)
|
%- (slog leaf+"eth-watcher {(spud path)} timed out; will restart" ~)
|
||||||
=/ =cage [%spider-stop !>([u.running.dog |])]
|
=/ =cage [%spider-stop !>([tid.u.running.dog |])]
|
||||||
:_ dog(running ~)
|
:_ dog(running ~)
|
||||||
:~ (leave-spider path our.bowl)
|
:~ (leave-spider path our.bowl)
|
||||||
[%pass [%starting path] %agent [our.bowl %spider] %poke cage]
|
[%pass [%starting path] %agent [our.bowl %spider] %poke cage]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
=^ cards-2=(list card) dog
|
=^ start-cards=(list card) dog
|
||||||
|
:: if not (or no longer) running, start a new thread
|
||||||
|
::
|
||||||
|
?^ running.dog
|
||||||
|
`dog
|
||||||
|
::
|
||||||
=/ new-tid=@ta
|
=/ new-tid=@ta
|
||||||
(cat 3 'eth-watcher--' (scot %uv eny.bowl))
|
(cat 3 'eth-watcher--' (scot %uv eny.bowl))
|
||||||
:_ dog(running `new-tid)
|
:_ dog(running `[now.bowl new-tid])
|
||||||
=/ args
|
=/ args
|
||||||
:^ ~ `new-tid %eth-watcher
|
:^ ~ `new-tid %eth-watcher
|
||||||
!>(`watchpup`[- number pending-logs blocks]:dog)
|
!>(`watchpup`[- number pending-logs blocks]:dog)
|
||||||
@ -411,7 +462,7 @@
|
|||||||
(poke-spider path our.bowl %spider-start !>(args))
|
(poke-spider path our.bowl %spider-start !>(args))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
:- [(wait path now.bowl refresh-rate.dog) (weld cards-1 cards-2)]
|
:- [(wait path now.bowl refresh-rate.dog) (weld stop-cards start-cards)]
|
||||||
this(dogs.state (~(put by dogs.state) path dog))
|
this(dogs.state (~(put by dogs.state) path dog))
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
::
|
::
|
||||||
++ node-url 'http://eth-mainnet.urbit.org:8545'
|
++ node-url 'http://eth-mainnet.urbit.org:8545'
|
||||||
++ refresh-rate ~h1
|
++ refresh-rate ~h1
|
||||||
|
++ timeout-time ~h2
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
=| state-0
|
=| state-0
|
||||||
@ -207,6 +208,7 @@
|
|||||||
:* node-url
|
:* node-url
|
||||||
|
|
|
|
||||||
refresh-rate
|
refresh-rate
|
||||||
|
timeout-time
|
||||||
public:mainnet-contracts
|
public:mainnet-contracts
|
||||||
~[azimuth delegated-sending]:mainnet-contracts
|
~[azimuth delegated-sending]:mainnet-contracts
|
||||||
~
|
~
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
::
|
::
|
||||||
/- *group-store, *group-hook
|
/- *group-store, *group-hook
|
||||||
/+ default-agent, verb, dbug
|
/+ default-agent, verb, dbug
|
||||||
|
~% %group-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
::
|
::
|
||||||
@ -37,18 +38,12 @@
|
|||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
=/ old !<(state-zero vase)
|
=/ old !<(state-zero vase)
|
||||||
:_ this(state old)
|
:_ this(state old)
|
||||||
%+ murn
|
%+ murn ~(tap by synced.old)
|
||||||
~(tap by synced.old)
|
|
||||||
|= [=path =ship]
|
|= [=path =ship]
|
||||||
^- (unit card)
|
^- (unit card)
|
||||||
=/ =wire
|
=/ =wire [(scot %p ship) %group path]
|
||||||
[(scot %p ship) %group path]
|
=/ =term ?:(=(our.bowl ship) %group-store %group-hook)
|
||||||
=/ =term
|
?: (~(has by wex.bowl) [wire ship term]) ~
|
||||||
?: =(our.bowl ship)
|
|
||||||
%group-store
|
|
||||||
%group-hook
|
|
||||||
?: (~(has by wex.bowl) [wire ship term])
|
|
||||||
~
|
|
||||||
`[%pass wire %agent [ship term] %watch [%group path]]
|
`[%pass wire %agent [ship term] %watch [%group path]]
|
||||||
::
|
::
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
@ -172,10 +167,9 @@
|
|||||||
%remove [(update-subscribers [%group pax.diff] diff) state]
|
%remove [(update-subscribers [%group pax.diff] diff) state]
|
||||||
::
|
::
|
||||||
%unbundle
|
%unbundle
|
||||||
:_ state(synced (~(del by synced.state) pax.diff))
|
=/ ship (~(get by synced.state) pax.diff)
|
||||||
%+ snoc
|
?~ ship [~ state]
|
||||||
(update-subscribers [%group pax.diff] diff)
|
(poke-group-hook-action [%remove pax.diff])
|
||||||
[%give %kick [%group pax.diff]~ ~]
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ handle-foreign
|
++ handle-foreign
|
||||||
@ -184,7 +178,6 @@
|
|||||||
?- -.diff
|
?- -.diff
|
||||||
%keys [~ state]
|
%keys [~ state]
|
||||||
%bundle [~ state]
|
%bundle [~ state]
|
||||||
::
|
|
||||||
%path
|
%path
|
||||||
:_ state
|
:_ state
|
||||||
?~ pax.diff ~
|
?~ pax.diff ~
|
||||||
@ -218,23 +211,26 @@
|
|||||||
[(group-poke pax.diff diff)]~
|
[(group-poke pax.diff diff)]~
|
||||||
::
|
::
|
||||||
%remove
|
%remove
|
||||||
:_ state
|
?~ pax.diff [~ state]
|
||||||
?~ pax.diff ~
|
|
||||||
=/ ship (~(get by synced.state) pax.diff)
|
=/ ship (~(get by synced.state) pax.diff)
|
||||||
?~ ship ~
|
?~ ship [~ state]
|
||||||
?. =(src.bol u.ship) ~
|
?. =(src.bol u.ship) [~ state]
|
||||||
[(group-poke pax.diff diff)]~
|
?. (~(has in members.diff) our.bol)
|
||||||
|
:_ state
|
||||||
|
[(group-poke pax.diff diff)]~
|
||||||
|
=/ changes (poke-group-hook-action [%remove pax.diff])
|
||||||
|
:_ +.changes
|
||||||
|
%+ welp -.changes
|
||||||
|
:~ (group-poke pax.diff diff)
|
||||||
|
(group-poke pax.diff [%unbundle pax.diff])
|
||||||
|
==
|
||||||
::
|
::
|
||||||
%unbundle
|
%unbundle
|
||||||
?~ pax.diff
|
?~ pax.diff [~ state]
|
||||||
[~ state]
|
|
||||||
=/ ship (~(get by synced.state) pax.diff)
|
=/ ship (~(get by synced.state) pax.diff)
|
||||||
?~ ship
|
?~ ship [~ state]
|
||||||
[~ state]
|
?. =(src.bol u.ship) [~ state]
|
||||||
?. =(src.bol u.ship)
|
(poke-group-hook-action [%remove pax.diff])
|
||||||
[~ state]
|
|
||||||
:_ state(synced (~(del by synced.state) pax.diff))
|
|
||||||
[(group-poke pax.diff diff)]~
|
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ group-poke
|
++ group-poke
|
||||||
@ -261,5 +257,4 @@
|
|||||||
?: =(u.shp our.bol)
|
?: =(u.shp our.bol)
|
||||||
[%pass wir %agent [our.bol %group-store] %leave ~]~
|
[%pass wir %agent [our.bol %group-store] %leave ~]~
|
||||||
[%pass wir %agent [u.shp %group-hook] %leave ~]~
|
[%pass wir %agent [u.shp %group-hook] %leave ~]~
|
||||||
::
|
|
||||||
--
|
--
|
||||||
|
@ -43,9 +43,9 @@
|
|||||||
!:
|
!:
|
||||||
=> |% ::
|
=> |% ::
|
||||||
++ hood-old :: unified old-state
|
++ hood-old :: unified old-state
|
||||||
{?($1 $2 $3) lac/(map @tas hood-part-old)} ::
|
{?($1 $2 $3 $4 $5) lac/(map @tas hood-part-old)}
|
||||||
++ hood-1 :: unified state
|
++ hood-1 :: unified state
|
||||||
{$3 lac/(map @tas hood-part)} ::
|
{$5 lac/(map @tas hood-part)} ::
|
||||||
++ hood-good :: extract specific
|
++ hood-good :: extract specific
|
||||||
=+ hed=$:hood-head
|
=+ hed=$:hood-head
|
||||||
|@ ++ $
|
|@ ++ $
|
||||||
@ -140,7 +140,7 @@
|
|||||||
`..on-init
|
`..on-init
|
||||||
::
|
::
|
||||||
++ on-save
|
++ on-save
|
||||||
!>([%3 lac])
|
!>([%5 lac])
|
||||||
::
|
::
|
||||||
++ on-load
|
++ on-load
|
||||||
|= =old-state=vase
|
|= =old-state=vase
|
||||||
@ -150,7 +150,9 @@
|
|||||||
?- -.old-state
|
?- -.old-state
|
||||||
%1 ((wrap on-load):from-drum:(help hid) %1)
|
%1 ((wrap on-load):from-drum:(help hid) %1)
|
||||||
%2 ((wrap on-load):from-drum:(help hid) %2)
|
%2 ((wrap on-load):from-drum:(help hid) %2)
|
||||||
%3 `lac
|
%3 ((wrap on-load):from-drum:(help hid) %3)
|
||||||
|
%4 ((wrap on-load):from-drum:(help hid) %4)
|
||||||
|
%5 `lac
|
||||||
==
|
==
|
||||||
[cards ..on-init]
|
[cards ..on-init]
|
||||||
::
|
::
|
||||||
|
@ -151,7 +151,7 @@
|
|||||||
?+ site.request-line
|
?+ site.request-line
|
||||||
not-found:gen
|
not-found:gen
|
||||||
::
|
::
|
||||||
~
|
[~ ~]
|
||||||
=/ hym=manx
|
=/ hym=manx
|
||||||
%+ index
|
%+ index
|
||||||
[%b first-time]
|
[%b first-time]
|
||||||
|
@ -1,5 +1,17 @@
|
|||||||
class Channel {
|
class Channel {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this.init();
|
||||||
|
this.deleteOnUnload();
|
||||||
|
|
||||||
|
// a way to handle channel errors
|
||||||
|
//
|
||||||
|
//
|
||||||
|
this.onChannelError = (err) => {
|
||||||
|
console.error('event source error: ', err);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
// unique identifier: current time and random number
|
// unique identifier: current time and random number
|
||||||
//
|
//
|
||||||
this.uid =
|
this.uid =
|
||||||
@ -40,8 +52,10 @@ class Channel {
|
|||||||
// disconnect function may be called exactly once.
|
// disconnect function may be called exactly once.
|
||||||
//
|
//
|
||||||
this.outstandingSubscriptions = new Map();
|
this.outstandingSubscriptions = new Map();
|
||||||
|
}
|
||||||
|
|
||||||
this.deleteOnUnload();
|
setOnChannelError(onError = (err) => {}) {
|
||||||
|
this.onChannelError = onError;
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteOnUnload() {
|
deleteOnUnload() {
|
||||||
@ -164,8 +178,11 @@ class Channel {
|
|||||||
this.lastEventId = e.lastEventId;
|
this.lastEventId = e.lastEventId;
|
||||||
|
|
||||||
let obj = JSON.parse(e.data);
|
let obj = JSON.parse(e.data);
|
||||||
if (obj.response == "poke") {
|
let pokeFuncs = this.outstandingPokes.get(obj.id);
|
||||||
let funcs = this.outstandingPokes.get(obj.id);
|
let subFuncs = this.outstandingSubscriptions.get(obj.id);
|
||||||
|
|
||||||
|
if (obj.response == "poke" && !!pokeFuncs) {
|
||||||
|
let funcs = pokeFuncs;
|
||||||
if (obj.hasOwnProperty("ok")) {
|
if (obj.hasOwnProperty("ok")) {
|
||||||
funcs["success"]();
|
funcs["success"]();
|
||||||
} else if (obj.hasOwnProperty("err")) {
|
} else if (obj.hasOwnProperty("err")) {
|
||||||
@ -175,19 +192,20 @@ class Channel {
|
|||||||
}
|
}
|
||||||
this.outstandingPokes.delete(obj.id);
|
this.outstandingPokes.delete(obj.id);
|
||||||
|
|
||||||
} else if (obj.response == "subscribe") {
|
} else if (obj.response == "subscribe" ||
|
||||||
|
(obj.response == "poke" && !!subFuncs)) {
|
||||||
|
let funcs = subFuncs;
|
||||||
// on a response to a subscribe, we only notify the caller on err
|
// on a response to a subscribe, we only notify the caller on err
|
||||||
//
|
//
|
||||||
let funcs = this.outstandingSubscriptions.get(obj.id);
|
|
||||||
if (obj.hasOwnProperty("err")) {
|
if (obj.hasOwnProperty("err")) {
|
||||||
funcs["err"](obj.err);
|
funcs["err"](obj.err);
|
||||||
this.outstandingSubscriptions.delete(obj.id);
|
this.outstandingSubscriptions.delete(obj.id);
|
||||||
}
|
}
|
||||||
} else if (obj.response == "diff") {
|
} else if (obj.response == "diff") {
|
||||||
let funcs = this.outstandingSubscriptions.get(obj.id);
|
let funcs = subFuncs;
|
||||||
funcs["event"](obj.json);
|
funcs["event"](obj.json);
|
||||||
} else if (obj.response == "quit") {
|
} else if (obj.response == "quit") {
|
||||||
let funcs = this.outstandingSubscriptions.get(obj.id);
|
let funcs = subFuncs;
|
||||||
funcs["quit"](obj);
|
funcs["quit"](obj);
|
||||||
this.outstandingSubscriptions.delete(obj.id);
|
this.outstandingSubscriptions.delete(obj.id);
|
||||||
} else {
|
} else {
|
||||||
@ -196,8 +214,9 @@ class Channel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.eventSource.onerror = e => {
|
this.eventSource.onerror = e => {
|
||||||
console.error("eventSource error:", e);
|
|
||||||
this.delete();
|
this.delete();
|
||||||
|
this.init();
|
||||||
|
this.onChannelError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
:: link-listen-hook: get your friends' bookmarks
|
:: link-listen-hook: get your friends' bookmarks
|
||||||
::
|
::
|
||||||
:: keeps track of a listening=(set app-path). automatically adds to that
|
:: keeps track of a listening=(set app-path). users can manually add to and
|
||||||
:: whenever new %link resources get added in the metadata-store. users
|
:: remove from this set.
|
||||||
:: can manually remove from and add back to this set.
|
|
||||||
::
|
::
|
||||||
:: for all ships in groups associated with those resources, we subscribe to
|
:: for all ships in groups associated with those resources, we subscribe to
|
||||||
:: their link's local-pages and annotations at the resource path (through
|
:: their link's local-pages and annotations at the resource path (through
|
||||||
@ -18,6 +17,7 @@
|
|||||||
/- link-listen-hook, *metadata-store, *link, group-store
|
/- link-listen-hook, *metadata-store, *link, group-store
|
||||||
/+ mdl=metadata, default-agent, verb, dbug
|
/+ mdl=metadata, default-agent, verb, dbug
|
||||||
::
|
::
|
||||||
|
~% %link-listen-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
$% [%0 state-0]
|
$% [%0 state-0]
|
||||||
@ -289,21 +289,11 @@
|
|||||||
|= upd=metadata-update
|
|= upd=metadata-update
|
||||||
^- (quip card _state)
|
^- (quip card _state)
|
||||||
?+ -.upd [~ state]
|
?+ -.upd [~ state]
|
||||||
%associations
|
|
||||||
=/ socs=(list [=group-path resource])
|
|
||||||
~(tap in ~(key by associations.upd))
|
|
||||||
=| cards=(list card)
|
|
||||||
|- ::TODO try for +roll maybe?
|
|
||||||
?~ socs [cards state]
|
|
||||||
=^ more-cards state
|
|
||||||
=, i.socs
|
|
||||||
?. =(%link app-name) [~ state]
|
|
||||||
%- handle-metadata-update
|
|
||||||
[%add group-path [%link app-path] *metadata]
|
|
||||||
$(socs t.socs, cards (weld cards more-cards))
|
|
||||||
::
|
|
||||||
%add
|
%add
|
||||||
?> =(%link app-name.resource.upd)
|
?> =(%link app-name.resource.upd)
|
||||||
|
:: auto-listen to collections in unmanaged groups only
|
||||||
|
::
|
||||||
|
?. ?=([%'~' ^] group-path.upd) [~ state]
|
||||||
=, resource.upd
|
=, resource.upd
|
||||||
=^ update listening
|
=^ update listening
|
||||||
^- (quip card _listening)
|
^- (quip card _listening)
|
||||||
@ -372,9 +362,11 @@
|
|||||||
=* loop-whos $
|
=* loop-whos $
|
||||||
?~ whos loop-socs(socs t.socs)
|
?~ whos loop-socs(socs t.socs)
|
||||||
=^ caz state
|
=^ caz state
|
||||||
?: ?=(%remove -.upd)
|
?. ?=(%remove -.upd)
|
||||||
(leave-from-peer i.socs pax.upd i.whos)
|
(listen-to-peer i.socs pax.upd i.whos)
|
||||||
(listen-to-peer i.socs pax.upd i.whos)
|
?: =(our.bowl i.whos)
|
||||||
|
(handle-listen-action %leave i.socs)
|
||||||
|
(leave-from-peer i.socs pax.upd i.whos)
|
||||||
loop-whos(whos t.whos, cards (weld cards caz))
|
loop-whos(whos t.whos, cards (weld cards caz))
|
||||||
::
|
::
|
||||||
:: link subscriptions
|
:: link subscriptions
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
::
|
::
|
||||||
/- group-store, *metadata-store
|
/- group-store, *metadata-store
|
||||||
/+ *link, metadata, default-agent, verb, dbug
|
/+ *link, metadata, default-agent, verb, dbug
|
||||||
|
~% %link-proxy-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ state-0
|
+$ state-0
|
||||||
$: %0
|
$: %0
|
||||||
@ -113,8 +114,6 @@
|
|||||||
`t.t.path
|
`t.t.path
|
||||||
~
|
~
|
||||||
?~ target |
|
?~ target |
|
||||||
~? !.^(? %gu (scot %p our.bowl) %metadata-store (scot %da now.bowl) ~)
|
|
||||||
%woah-md-s-not-booted ::TODO fallback if needed
|
|
||||||
%+ lien (groups-from-resource:md %link u.target)
|
%+ lien (groups-from-resource:md %link u.target)
|
||||||
|= =group-path
|
|= =group-path
|
||||||
^- ?
|
^- ?
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
:: link-view: frontend endpoints
|
:: link-view: frontend endpoints
|
||||||
::
|
::
|
||||||
:: endpoints, mapping onto link-store's paths. p is for page as in pagination.
|
:: endpoints, mapping onto link-store's paths. p is for page as in pagination.
|
||||||
:: updates only work for page 0.
|
:: only the /0/submissions endpoint provides updates.
|
||||||
:: as with link-store, urls are expected to use +wood encoding.
|
:: as with link-store, urls are expected to use +wood encoding.
|
||||||
::
|
::
|
||||||
:: /json/[p]/submissions pages for all groups
|
:: /json/0/submissions initial + updates for all
|
||||||
:: /json/[p]/submissions/[some-group] page for one group
|
:: /json/[p]/submissions/[collection] page for one collection
|
||||||
:: /json/[p]/discussions/[wood-url]/[some-group] page for url in group
|
:: /json/[p]/discussions/[wood-url]/[collection] page for url in collection
|
||||||
:: /json/[n]/submission/[wood-url]/[some-group] nth matching submission
|
:: /json/[n]/submission/[wood-url]/[collection] nth matching submission
|
||||||
:: /json/seen mark-as-read updates
|
:: /json/seen mark-as-read updates
|
||||||
::
|
::
|
||||||
/- *link-view,
|
/- *link-view,
|
||||||
*invite-store, group-store,
|
*invite-store, group-store,
|
||||||
|
link-listen-hook,
|
||||||
group-hook, permission-hook, permission-group-hook,
|
group-hook, permission-hook, permission-group-hook,
|
||||||
metadata-hook, contact-view
|
metadata-hook, contact-view
|
||||||
/+ *link, metadata, *server, default-agent, verb, dbug
|
/+ *link, metadata, *server, default-agent, verb, dbug
|
||||||
|
~% %link-view-top ..is ~
|
||||||
::
|
::
|
||||||
|%
|
|%
|
||||||
+$ state-0
|
+$ state-0
|
||||||
@ -153,20 +155,22 @@
|
|||||||
++ on-fail on-fail:def
|
++ on-fail on-fail:def
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|
~% %link-view-logic ..card ~
|
||||||
|_ =bowl:gall
|
|_ =bowl:gall
|
||||||
+* md ~(. metadata bowl)
|
+* md ~(. metadata bowl)
|
||||||
::
|
::
|
||||||
++ page-size 25
|
++ page-size 25
|
||||||
++ get-paginated
|
++ get-paginated
|
||||||
|* [p=(unit @ud) l=(list)]
|
|* [page=(unit @ud) list=(list)]
|
||||||
^- [total=@ud pages=@ud page=_l]
|
^- [total=@ud pages=@ud page=_list]
|
||||||
:+ (lent l)
|
=/ l=@ud (lent list)
|
||||||
%+ add (div (lent l) page-size)
|
:+ l
|
||||||
(min 1 (mod (lent l) page-size))
|
%+ add (div l page-size)
|
||||||
?~ p l
|
(min 1 (mod l page-size))
|
||||||
%+ scag page-size
|
?~ page list
|
||||||
%+ slag (mul u.p page-size)
|
%+ swag
|
||||||
l
|
[(mul u.page page-size) page-size]
|
||||||
|
list
|
||||||
::
|
::
|
||||||
++ page-to-json
|
++ page-to-json
|
||||||
=, enjs:format
|
=, enjs:format
|
||||||
@ -311,6 +315,13 @@
|
|||||||
%metadata-hook-action
|
%metadata-hook-action
|
||||||
!> ^- metadata-hook-action:metadata-hook
|
!> ^- metadata-hook-action:metadata-hook
|
||||||
[%add-owned group-path]
|
[%add-owned group-path]
|
||||||
|
::
|
||||||
|
:: watch the collection ourselves
|
||||||
|
::
|
||||||
|
%^ do-poke %link-listen-hook
|
||||||
|
%link-listen-action
|
||||||
|
!> ^- action:link-listen-hook
|
||||||
|
[%watch path]
|
||||||
==
|
==
|
||||||
?: ?=(%group -.members) ~
|
?: ?=(%group -.members) ~
|
||||||
:: if the group is "real", make contact-view do the heavy lifting
|
:: if the group is "real", make contact-view do the heavy lifting
|
||||||
@ -480,9 +491,12 @@
|
|||||||
:: }
|
:: }
|
||||||
::
|
::
|
||||||
++ give-initial-submissions
|
++ give-initial-submissions
|
||||||
|= [p=@ud =path]
|
~/ %link-view-initial-submissions
|
||||||
|
|= [p=@ud =requested=path]
|
||||||
^- (list card)
|
^- (list card)
|
||||||
:_ ?: =(0 p) ~
|
:_ :: only keep the base case alive (for updates), kick all others
|
||||||
|
::
|
||||||
|
?: &(=(0 p) ?=(~ requested-path)) ~
|
||||||
[%give %kick ~ ~]~
|
[%give %kick ~ ~]~
|
||||||
=; =json
|
=; =json
|
||||||
[%give %fact ~ %json !>(json)]
|
[%give %fact ~ %json !>(json)]
|
||||||
@ -490,9 +504,9 @@
|
|||||||
%- pairs:enjs:format
|
%- pairs:enjs:format
|
||||||
%+ turn
|
%+ turn
|
||||||
%~ tap by
|
%~ tap by
|
||||||
%+ scry-for (map ^path submissions)
|
%+ scry-for (map path submissions)
|
||||||
[%submissions path]
|
[%submissions requested-path]
|
||||||
|= [=^path =submissions]
|
|= [=path =submissions]
|
||||||
^- [@t json]
|
^- [@t json]
|
||||||
:- (spat path)
|
:- (spat path)
|
||||||
=; =json
|
=; =json
|
||||||
@ -505,6 +519,15 @@
|
|||||||
%~ wyt in
|
%~ wyt in
|
||||||
%+ scry-for (set url)
|
%+ scry-for (set url)
|
||||||
[%unseen path]
|
[%unseen path]
|
||||||
|
?: &(=(0 p) ?=(~ requested-path))
|
||||||
|
:: for a broad-scope initial result, only give total counts
|
||||||
|
::
|
||||||
|
=, enjs:format
|
||||||
|
%- pairs
|
||||||
|
=+ l=(lent submissions)
|
||||||
|
:~ 'totalItems'^(numb l)
|
||||||
|
'totalPages'^(numb (div l page-size))
|
||||||
|
==
|
||||||
%^ page-to-json p
|
%^ page-to-json p
|
||||||
%+ get-paginated `p
|
%+ get-paginated `p
|
||||||
submissions
|
submissions
|
||||||
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
@ -5,6 +5,7 @@
|
|||||||
::
|
::
|
||||||
/- *metadata-store, *metadata-hook
|
/- *metadata-store, *metadata-hook
|
||||||
/+ default-agent, dbug
|
/+ default-agent, dbug
|
||||||
|
~% %metadata-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ card card:agent:gall
|
+$ card card:agent:gall
|
||||||
+$ versioned-state
|
+$ versioned-state
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
/- *permission-hook
|
/- *permission-hook
|
||||||
/+ *permission-json, default-agent, verb, dbug
|
/+ *permission-json, default-agent, verb, dbug
|
||||||
::
|
::
|
||||||
|
~% %permission-hook-top ..is ~
|
||||||
|%
|
|%
|
||||||
+$ state
|
+$ state
|
||||||
$% [%0 state-0]
|
$% [%0 state-0]
|
||||||
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
96
pkg/arvo/app/s3-store.hoon
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/- *s3
|
||||||
|
/+ s3-json, default-agent, verb, dbug
|
||||||
|
~% %s3-top ..is ~
|
||||||
|
|%
|
||||||
|
+$ card card:agent:gall
|
||||||
|
+$ versioned-state
|
||||||
|
$% state-zero
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ state-zero [%0 =credentials =configuration]
|
||||||
|
--
|
||||||
|
::
|
||||||
|
=| state-zero
|
||||||
|
=* state -
|
||||||
|
::
|
||||||
|
%- agent:dbug
|
||||||
|
%+ verb |
|
||||||
|
^- agent:gall
|
||||||
|
~% %s3-agent-core ..card ~
|
||||||
|
|_ =bowl:gall
|
||||||
|
+* this .
|
||||||
|
def ~(. (default-agent this %|) bowl)
|
||||||
|
::
|
||||||
|
++ on-init on-init:def
|
||||||
|
++ on-save !>(state)
|
||||||
|
++ on-load
|
||||||
|
|= old-vase=vase
|
||||||
|
[~ this(state !<(state-zero old-vase))]
|
||||||
|
::
|
||||||
|
++ on-poke
|
||||||
|
~/ %s3-poke
|
||||||
|
|= [=mark =vase]
|
||||||
|
^- (quip card _this)
|
||||||
|
|^
|
||||||
|
?> (team:title our.bowl src.bowl)
|
||||||
|
=^ cards state
|
||||||
|
?+ mark (on-poke:def mark vase)
|
||||||
|
%s3-action (poke-action !<(action vase))
|
||||||
|
==
|
||||||
|
[cards this]
|
||||||
|
::
|
||||||
|
++ poke-action
|
||||||
|
|= act=action
|
||||||
|
^- (quip card _state)
|
||||||
|
:- [%give %fact [/all]~ %s3-update !>(act)]~
|
||||||
|
?- -.act
|
||||||
|
%set-endpoint
|
||||||
|
state(endpoint.credentials endpoint.act)
|
||||||
|
::
|
||||||
|
%set-access-key-id
|
||||||
|
state(access-key-id.credentials access-key-id.act)
|
||||||
|
::
|
||||||
|
%set-secret-access-key
|
||||||
|
state(secret-access-key.credentials secret-access-key.act)
|
||||||
|
::
|
||||||
|
%set-current-bucket
|
||||||
|
%_ state
|
||||||
|
current-bucket.configuration bucket.act
|
||||||
|
buckets.configuration (~(put in buckets.configuration) bucket.act)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
%add-bucket
|
||||||
|
state(buckets.configuration (~(put in buckets.configuration) bucket.act))
|
||||||
|
::
|
||||||
|
%remove-bucket
|
||||||
|
state(buckets.configuration (~(del in buckets.configuration) bucket.act))
|
||||||
|
==
|
||||||
|
--
|
||||||
|
::
|
||||||
|
++ on-watch
|
||||||
|
~/ %s3-watch
|
||||||
|
|= =path
|
||||||
|
^- (quip card _this)
|
||||||
|
|^
|
||||||
|
?> (team:title our.bowl src.bowl)
|
||||||
|
=/ cards=(list card)
|
||||||
|
?+ path (on-watch:def path)
|
||||||
|
[%all ~]
|
||||||
|
:~ (give %s3-update !>([%credentials credentials]))
|
||||||
|
(give %s3-update !>([%configuration configuration]))
|
||||||
|
==
|
||||||
|
==
|
||||||
|
[cards this]
|
||||||
|
::
|
||||||
|
++ give
|
||||||
|
|= =cage
|
||||||
|
^- card
|
||||||
|
[%give %fact ~ cage]
|
||||||
|
--
|
||||||
|
::
|
||||||
|
++ on-leave on-leave:def
|
||||||
|
++ on-peek on-peek:def
|
||||||
|
++ on-agent on-agent:def
|
||||||
|
++ on-arvo on-arvo:def
|
||||||
|
++ on-fail on-fail:def
|
||||||
|
--
|
70
pkg/arvo/app/shoe.hoon
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
:: shoe: example usage of /lib/shoe
|
||||||
|
::
|
||||||
|
:: the app supports one command: "demo".
|
||||||
|
:: running this command renders some text on all sole clients.
|
||||||
|
::
|
||||||
|
/+ shoe, verb, dbug, default-agent
|
||||||
|
|%
|
||||||
|
+$ state-0 [%0 ~]
|
||||||
|
+$ command ~
|
||||||
|
::
|
||||||
|
+$ card card:shoe
|
||||||
|
--
|
||||||
|
=| state-0
|
||||||
|
=* state -
|
||||||
|
::
|
||||||
|
%+ verb |
|
||||||
|
%- agent:dbug
|
||||||
|
^- agent:gall
|
||||||
|
%- (agent:shoe command)
|
||||||
|
^- (shoe:shoe command)
|
||||||
|
|_ =bowl:gall
|
||||||
|
+* this .
|
||||||
|
def ~(. (default-agent this %|) bowl)
|
||||||
|
des ~(. (default:shoe this command) bowl)
|
||||||
|
::
|
||||||
|
++ on-init on-init:def
|
||||||
|
++ on-save !>(state)
|
||||||
|
++ on-load
|
||||||
|
|= old=vase
|
||||||
|
^- (quip card _this)
|
||||||
|
[~ this]
|
||||||
|
::
|
||||||
|
++ on-poke on-poke:def
|
||||||
|
++ on-watch on-watch:def
|
||||||
|
++ on-leave on-leave:def
|
||||||
|
++ on-peek on-peek:def
|
||||||
|
++ on-agent on-agent:def
|
||||||
|
++ on-arvo on-arvo:def
|
||||||
|
++ on-fail on-fail:def
|
||||||
|
::
|
||||||
|
++ command-parser
|
||||||
|
|= sole-id=@ta
|
||||||
|
^+ |~(nail *(like command))
|
||||||
|
(cold ~ (jest 'demo'))
|
||||||
|
::
|
||||||
|
++ tab-list
|
||||||
|
|= sole-id=@ta
|
||||||
|
^- (list [@t tank])
|
||||||
|
:~ ['demo' leaf+"run example command"]
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ on-command
|
||||||
|
|= [sole-id=@ta =command]
|
||||||
|
^- (quip card _this)
|
||||||
|
=- [[%shoe ~ %sole -]~ this]
|
||||||
|
=/ =tape "{(scow %p src.bowl)} ran the command"
|
||||||
|
?. =(src our):bowl
|
||||||
|
[%txt tape]
|
||||||
|
[%klr [[`%br ~ `%g] [(crip tape)]~]~]
|
||||||
|
::
|
||||||
|
++ can-connect
|
||||||
|
|= sole-id=@ta
|
||||||
|
^- ?
|
||||||
|
?| =(~zod src.bowl)
|
||||||
|
(team:title [our src]:bowl)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
++ on-connect on-connect:des
|
||||||
|
++ on-disconnect on-disconnect:des
|
||||||
|
--
|
Before Width: | Height: | Size: 679 B After Width: | Height: | Size: 679 B |
@ -1,3 +1,4 @@
|
|||||||
|
:: Produce a pill for aqua
|
||||||
/+ pill
|
/+ pill
|
||||||
::
|
::
|
||||||
:- %say
|
:- %say
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Scry into an aqua ship
|
||||||
/- aquarium
|
/- aquarium
|
||||||
/+ ph-util
|
/+ ph-util
|
||||||
=, aquarium
|
=, aquarium
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: List azimuth sources
|
||||||
:- %say
|
:- %say
|
||||||
|= [[now=@da *] *]
|
|= [[now=@da *] *]
|
||||||
:- %noun
|
:- %noun
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Kick azimuth-tracker
|
||||||
:- %say
|
:- %say
|
||||||
|= *
|
|= *
|
||||||
[%azimuth-tracker-poke %listen ~ %| %azimuth-tracker]
|
[%azimuth-tracker-poke %listen ~ %| %azimuth-tracker]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Add a source for azimuth-tracker
|
||||||
=> |%
|
=> |%
|
||||||
+$ src
|
+$ src
|
||||||
$% [%ship =ship ~]
|
$% [%ship =ship ~]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Change node url for azimuth-tracker
|
||||||
:- %say
|
:- %say
|
||||||
|= [* [url=@ta ~] ~]
|
|= [* [url=@ta ~] ~]
|
||||||
[%azimuth-tracker-poke %watch url]
|
[%azimuth-tracker-poke %watch url]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Produce a brass pill
|
||||||
::
|
::
|
||||||
:::: /hoon/brass/gen
|
:::: /hoon/brass/gen
|
||||||
::
|
::
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
:: all in subs matching the parameters
|
:: all in subs matching the parameters
|
||||||
:: direction: %incoming or %outgoing
|
:: direction: %incoming or %outgoing
|
||||||
:: specifics:
|
:: specifics:
|
||||||
|
:: ~ all subscriptions
|
||||||
:: [%ship ~ship] subscriptions to/from this ship
|
:: [%ship ~ship] subscriptions to/from this ship
|
||||||
:: [%path /path] subscriptions on path containing /path
|
:: [%path /path] subscriptions on path containing /path
|
||||||
:: [%wire /wire] subscriptions on wire containing /wire
|
:: [%wire /wire] subscriptions on wire containing /wire
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Hoon style sample
|
||||||
::
|
::
|
||||||
:: this is a sample file designed to set conventions for
|
:: this is a sample file designed to set conventions for
|
||||||
:: high-quality conventional hoon.
|
:: high-quality conventional hoon.
|
||||||
|
9
pkg/arvo/gen/dojo/acl.hoon
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
:: acl: list the ships that are allowed to link to dojo
|
||||||
|
::
|
||||||
|
/? 310
|
||||||
|
::
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[~ ~]
|
||||||
|
==
|
||||||
|
[%list-remote-logins ~]
|
9
pkg/arvo/gen/dojo/allow-remote-login.hoon
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
:: allow-remote-login: allow a ship to link to dojo
|
||||||
|
::
|
||||||
|
/? 310
|
||||||
|
::
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[[=ship ~] ~]
|
||||||
|
==
|
||||||
|
[%allow-remote-login ship]
|
10
pkg/arvo/gen/dojo/revoke-remote-login.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: revoke-remote-login: revoke a ship's right to link to dojo,
|
||||||
|
:: kicking the ship if it is currently linked
|
||||||
|
::
|
||||||
|
/? 310
|
||||||
|
::
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[[=ship ~] ~]
|
||||||
|
==
|
||||||
|
[%revoke-remote-login ship]
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Produce a glass pill
|
||||||
::
|
::
|
||||||
:::: /hoon/glass/gen
|
:::: /hoon/glass/gen
|
||||||
::
|
::
|
||||||
|
5
pkg/arvo/gen/hood/ames-wake.hoon
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
:: Set timers for any ames flows that lack them
|
||||||
|
::
|
||||||
|
:- %say
|
||||||
|
|= [^ ~ ~]
|
||||||
|
[%helm-ames-wake ~]
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Cancel autocommit
|
||||||
::
|
::
|
||||||
:::: /hoon/cancel-autocommit/hood/gen
|
:::: /hoon/cancel-autocommit/hood/gen
|
||||||
::
|
::
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Cancel automass
|
||||||
::
|
::
|
||||||
:::: /hoon/cancel-automass/hood/gen
|
:::: /hoon/cancel-automass/hood/gen
|
||||||
::
|
::
|
||||||
|
14
pkg/arvo/gen/hood/gall-sear.hoon
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
:: Clear ship from pending queues
|
||||||
|
::
|
||||||
|
:::: /hoon/gall-sear/hood/gen
|
||||||
|
::
|
||||||
|
/? 310
|
||||||
|
::
|
||||||
|
::::
|
||||||
|
!:
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ bec=beak]
|
||||||
|
[=ship ~]
|
||||||
|
~
|
||||||
|
==
|
||||||
|
[%kiln-gall-sear ship]
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Serve static files
|
||||||
/? 309
|
/? 309
|
||||||
::
|
::
|
||||||
/= pre-process
|
/= pre-process
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Produce an ivory pill
|
||||||
::
|
::
|
||||||
:::: /hoon/ivory/gen
|
:::: /hoon/ivory/gen
|
||||||
::
|
::
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Produce a metal pill
|
||||||
::
|
::
|
||||||
:::: /hoon/metal/gen
|
:::: /hoon/metal/gen
|
||||||
::
|
::
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
/- ph
|
|
||||||
:- %say
|
|
||||||
|= [* ~ ~]
|
|
||||||
:- %ph-command
|
|
||||||
^- cli:ph
|
|
||||||
[%cancel ~]
|
|
@ -1,6 +0,0 @@
|
|||||||
/- ph
|
|
||||||
:- %say
|
|
||||||
|= [* ~ ~]
|
|
||||||
:- %ph-command
|
|
||||||
^- cli:ph
|
|
||||||
[%init ~]
|
|
@ -1,6 +0,0 @@
|
|||||||
/- ph
|
|
||||||
:- %say
|
|
||||||
|= [* ~ ~]
|
|
||||||
:- %ph-command
|
|
||||||
^- cli:ph
|
|
||||||
[%print ~]
|
|
@ -1,6 +0,0 @@
|
|||||||
/- ph
|
|
||||||
:- %say
|
|
||||||
|= [* ~ ~]
|
|
||||||
:- %ph-command
|
|
||||||
^- cli:ph
|
|
||||||
[%run-all ~]
|
|
@ -1,6 +0,0 @@
|
|||||||
/- ph
|
|
||||||
:- %say
|
|
||||||
|= [* [lab=term ~] ~]
|
|
||||||
:- %ph-command
|
|
||||||
^- cli:ph
|
|
||||||
[%run lab]
|
|
10
pkg/arvo/gen/s3-store/add-bucket.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|add-bucket: add new bucket to S3 store
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[bucket=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%add-bucket bucket]
|
10
pkg/arvo/gen/s3-store/remove-bucket.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|remove-bucket: remove bucket from S3 store
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[bucket=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%remove-bucket bucket]
|
10
pkg/arvo/gen/s3-store/set-access-key-id.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|set-access-key-id: set S3 access key ID
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[access-key-id=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%set-access-key-id access-key-id]
|
10
pkg/arvo/gen/s3-store/set-current-bucket.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|set-current-bucket: set current bucket for S3
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[bucket=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%set-current-bucket bucket]
|
10
pkg/arvo/gen/s3-store/set-endpoint.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|set-endpoint: set S3 endpoint
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[endpoint=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%set-endpoint endpoint]
|
10
pkg/arvo/gen/s3-store/set-secret-access-key.hoon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
:: s3-store|set-secret-access-key: set S3 secret access key
|
||||||
|
::
|
||||||
|
/- *s3
|
||||||
|
:- %say
|
||||||
|
|= $: [now=@da eny=@uvJ =beak]
|
||||||
|
[[secret-access-key=@t ~] ~]
|
||||||
|
==
|
||||||
|
:- %s3-action
|
||||||
|
^- action
|
||||||
|
[%set-secret-access-key secret-access-key]
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Kill a thread
|
||||||
:- %say
|
:- %say
|
||||||
|= *
|
|= *
|
||||||
[%spider-kill ~]
|
[%spider-kill ~]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Poke a thread
|
||||||
:- %say
|
:- %say
|
||||||
|= [* [=@ta =mark =vase ~] ~]
|
|= [* [=@ta =mark =vase ~] ~]
|
||||||
[%spider-input ta mark vase]
|
[%spider-input ta mark vase]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Start a thread
|
||||||
:- %say
|
:- %say
|
||||||
|= [* [name=term vase=$@(~ [vase ~])] ~]
|
|= [* [name=term vase=$@(~ [vase ~])] ~]
|
||||||
[%spider-start ~ ~ name ?~(vase *^vase -.vase)]
|
[%spider-start ~ ~ name ?~(vase *^vase -.vase)]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Stop a thread
|
||||||
:- %say
|
:- %say
|
||||||
|= [* [tid=@ta ~] ~]
|
|= [* [tid=@ta ~] ~]
|
||||||
[%spider-stop tid |]
|
[%spider-stop tid |]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: List running threads
|
||||||
/- spider
|
/- spider
|
||||||
:- %say
|
:- %say
|
||||||
|= [[now=@da *] ~ *]
|
|= [[now=@da *] ~ *]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
:: Run tests
|
||||||
/+ test-runner
|
/+ test-runner
|
||||||
/= all-tests
|
/= all-tests
|
||||||
/^ (map path (list test-arm:test-runner))
|
/^ (map path (list test-arm:test-runner))
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
:: Find list of currently running Behn timers
|
||||||
:- %say
|
:- %say
|
||||||
|= *
|
|= *
|
||||||
:- %tang
|
:- %tang
|
||||||
[.^(tank %b %) ~]
|
[>.^((list [date=@da =duct]) %b /=timers=)< ~]
|
||||||
|