Merge branch 'master' of github.com:urbit/urbit into king-haskell

This commit is contained in:
Benjamin Summers 2020-02-05 15:44:11 -08:00
commit faec933b56
207 changed files with 3438 additions and 3751 deletions

View File

@ -23,3 +23,4 @@ Matilde Park <matilde@park.computer> <matilde@tlon.io>
pilfer-pandex <pilfer-pandex@users.noreply.github.com> <47340789+pilfer-pandex@users.noreply.github.com>
Robert <robert@tlon.io>
Ted Blackman <ted@tlon.io> <ted@3scan.com>
pkova <pyry.kovanen@gmail.com> <pkova@users.noreply.github.com>

21
LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Urbit
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

178
MAINTAINERS.md Normal file
View File

@ -0,0 +1,178 @@
# Maintainers' Guide
## Hotfixes
Here lies an informal guide for making hotfix releases and deploying them to
the network.
Take [this recent PR][1], as an example. This constituted a great hotfix.
It's a single commit, targeting a problem that existed on the network at the
time. Here's it should be released and deployed OTA.
[1]: https://github.com/urbit/urbit/pull/2025
### If the thing is acceptable to merge, merge it to master
Unless it's very trivial, it should probably have a single "credible looking"
review from somebody else on it.
You can just merge the PR in GitHub. As I, `~nidsut-tomdun`, am a l33t
h4x0r, I use a custom merge commit format, gotten by:
```
git merge --no-ff --signoff --log BRANCH
```
with the commit message:
```
Merge branch FOO (#PR_NUM)
* FOO:
bar: ...
baz: ...
Signed-off-by: Jared Tobin <jared@tlon.io>
```
All this extra wankery is hardly required, but IMO it's nice to have the
commit log information in the merge commit, which GitHub's "Merge PR" button
doesn't do (at least by default).
The script at `sh/merge-with-custom-message` can be used to make this simple(r)
to do. I use `git mu` as an alias for it, locally.
### Apply the changes to this era's release branch
This corresponds to the 'vx.y' part of the most recent 'urbit vx.y.z' release.
At the time of writing, we're on v0.10 (and I'll use this branch as a running
example):
If the branch doesn't yet exist, just create it via:
```
git checkout -b v0.10 master
```
If you can get away with merging master to v0.10 without pulling in any
superfluous commits, feel free to do that. Otherwise, you'll want to cherry
pick the commits like so:
```
git cherry-pick -x TARGET_COMMITS
```
Use the `-x` flag to `git-cherry-pick`, because this will indicate in the
commit message where the things originally came from.
Create Landscape or alternative pill builds, if or as appropriate (i.e., if
anything in Landscape changed -- don't trust the compiled JS/CSS that's
included in the commit).
You may also want to create a brass pill, in particular, as it's convenient for
tooling to be able to boot directly from a given release.
### Tag the resulting commit
What you should do here depends on the type of release being made.
First, for Arvo releases:
If it's a very trivial hotfix that you know isn't going to break
anything, tag it as `arvo.yyyy.mm.dd`. Use an annotated tag, i.e.
```
git tag -a arvo.yyyy.mm.dd
```
The tag format should look something like this:
```
arvo.yyyy.mm.dd
This release contains Arvo changes that will be pushed to the live
network as an over-the-air update.
Release notes:
[..]
Contributions:
[..]
```
You can get the "contributions" section by the shortlog between the
last release and this release:
```
git log --pretty=short --no-merges \
LAST_RELEASE..v0.10 | git shortlog
```
I originally tried to curate this list somewhat, but now just paste it
verbatim. If it's too noisy, yell at your colleagues to improve their commit
messages.
Try to include a high-level summary of the changes in the "release notes"
section. You should be able to do this by simply looking at the git log and
skimming the commit descriptions (or perhaps copying some of them in verbatim).
If the commit descriptions are too poor to easily do this, then again, yell at
your fellow contributors to make them better in the future.
If it's *not* a trivial hotfix, you should probably make any number of release
candidate tags (e.g. `arvo.yyyy.mm.dd.rc-1`, `arvo.yyyy.mm.dd.rc-2`, ..), test
them, and after you confirm one of them is good, tag the release as
`arvo.yyyy.mm.dd`.
For Vere releases:
Tag the release as `vx.y.z`. The tag format should look something
like this:
```
urbit vx.y.z
This release contains Vere changes, so users should update their
binaries.
This is not a breaching release, so users should not create new
piers.
Release notes:
[..]
Contributions:
[..]
```
The same schpeel re: release candidates applies here.
You should probably avoid putting both Arvo and Vere changes into Vere
releases.
### Deploy the update
For Arvo updates, this means copying the files into ~zod's %base desk. For
consistency, I download the release tarball and then rsync the files in:
```
$ wget https://github.com/urbit/urbit/archive/arvo.yyyy.mm.dd.tar.gz
$ tar xzf arvo.yyyy.mm.dd.tar.gz
$ herb zod -p hood -d "+hood/mount /=base="
$ rsync -zr --delete urbit-arvo.yyyy.mm.dd/pkg/arvo/ zod/base
$ herb zod -p hood -d "+hood/commit %base"
```
For Vere updates, this means shutting down each desired ship, installing the
new binary, and restarting the pier with it.
### Announce the update
Post an announcement to urbit-dev. The tag annotation, basically, is fine here
-- I usually add the %base hash (for Arvo releases) and the release binary URLs
(for Vere releaes). Check the urbit-dev archives for examples of these
announcements.

View File

@ -10,7 +10,7 @@ A personal server operating function.
[azim]: https://etherscan.io/address/0x223c067f8cf28ae173ee5cafea60ca44c335fecb
[aens]: https://etherscan.io/address/azimuth.eth
[brid]: https://github.com/urbit/bridge/releases
[brid]: https://github.com/urbit/bridge
[arvo]: https://github.com/urbit/urbit/tree/master/pkg/arvo
## Install

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:18d492d912068e7fefef48006105d39c1c8f56aa756b7aeae48387c2254c1b91
size 7153239
oid sha256:407a763f44eb91db0dd4a1ec2dbd12ed4332b48decefd3999c4313844daa2c0b
size 7226043

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d2c08caf6f69f9fa349003da923d0b6507a8b6df763a0ee491f195a937630843
size 9620244
oid sha256:df629686e06b0c56db132076439b03d095bb235fc1a77668022d110559d9b840
size 9650987

2
pkg/arvo/.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
.gitattributes export-ignore
tests export-ignore

3
pkg/arvo/.gitignore vendored
View File

@ -1,3 +0,0 @@
/sec/**/*.atom
*.swp
*.swo

View File

@ -1,80 +0,0 @@
language: node_js
node_js:
- 4
before_install:
# pwd: ~/urbit/arvo
- cd .travis/
- bash check-trailing-whitespace.sh
- cd ../../
# pwd: ~/urbit
# building vere directly in lieu of a working debian package script
- wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
- unzip ninja-linux.zip
- sudo mv ninja /usr/bin/
install:
# pwd: ~/urbit
- pip3 install --user -I meson==0.44.1
- git clone https://github.com/urbit/urbit
- cd ./urbit
# pwd: ~/urbit/urbit
- git checkout $(cat ../arvo/.travis/pin-vere-commit.txt)
- ./scripts/bootstrap
- ./scripts/build
- sudo ninja -C build install
- cd ../arvo
# pwd: ~/urbit/arvo
before_script:
- cd .travis
# pwd: ~/urbit/arvo/.travis
- npm install
- bash get-or-build-pill.sh
# https://github.com/travis-ci/travis-ci/issues/2570
script:
- ulimit -c unlimited -S
- npm run -s test; bash print-core-backtrace.sh $?
before_deploy: "[ -d piers ] || { mkdir piers && tar cvzSf piers/zod-$TRAVIS_COMMIT.tgz zod/; }"
addons:
apt:
packages:
- python3
- python3-pip
- libgmp3-dev
- libsigsegv-dev
- openssl
- libssl-dev
- libncurses5-dev
- gcc
- libcurl4-gnutls-dev
- unzip
- gdb
deploy:
- skip_cleanup: true
provider: gcs
access_key_id: GOOGTADOPP55X5ZTH3IKAXQW
secret_access_key:
secure: lALZvAW22oBMCXafvDOkqKDkdP0K8bGKlSb6uhh54z+2bJu49+5vrfxgA9YLcExGiz8uFttzNYhEoAQEjb96DPHAHvH2iJrwieKltrWM4hLkGuSHVSCBIIm+Qe4BVRSVJPQ1rtO1ausNr0XuzO6BVnKY7NCrz8la2XNjm5+miQdtrJUnrfy2JsM/c/Bkwjj3Tc4op9Ne+7Xzc9DI6LB97XiJx5PgeOx1WeZi9IKQ3IhPBHBzBpBrJ4lWxb4PFvDUqNzSk1wuMGy/sH73IFhGcz3CZRZYbeICDdwmHcUnkdPxG6+RLH+YLhSxx175R+HdaARRQvRANxvY9KNJ11NKmV3Rs9q7fZgWZbrptuB0CDMhfZ/Aiz9tgHGV0UVhYHb8n614fDIKzpXwIy5DPjCKpxPoZRVzABQcdzPTvxnZtZDbarsfdfq0vh9xXNPLGuFYZQnZ6iEpv17qp/2TbeCBSMKIxwIG3LQTwr0a4wKL1T/YIZm6oiN6NycHhMHaczQIRANKw9e7oqbgnXu/WnqHIxyTY2CCvzVOgipRmKKa7jz7CcSoP883XZ9o7WAOnfJY+T4ofpdkzHn1ElNXPjDPpX7CUkowNFH4DZk2Ljwe0CgxPOF6ygnsNrqqs4XoNQaBnHGXMq20Upg6OK9MBmZibtlX9STCeSAt4WudekpEOPU=
bucket: ci-piers.urbit.org
local-dir: piers/
acl: public-read
on:
repo: urbit/arvo
all_branches: true
- skip_cleanup: true
provider: gcs
access_key_id: GOOGTADOPP55X5ZTH3IKAXQW
secret_access_key:
secure: lALZvAW22oBMCXafvDOkqKDkdP0K8bGKlSb6uhh54z+2bJu49+5vrfxgA9YLcExGiz8uFttzNYhEoAQEjb96DPHAHvH2iJrwieKltrWM4hLkGuSHVSCBIIm+Qe4BVRSVJPQ1rtO1ausNr0XuzO6BVnKY7NCrz8la2XNjm5+miQdtrJUnrfy2JsM/c/Bkwjj3Tc4op9Ne+7Xzc9DI6LB97XiJx5PgeOx1WeZi9IKQ3IhPBHBzBpBrJ4lWxb4PFvDUqNzSk1wuMGy/sH73IFhGcz3CZRZYbeICDdwmHcUnkdPxG6+RLH+YLhSxx175R+HdaARRQvRANxvY9KNJ11NKmV3Rs9q7fZgWZbrptuB0CDMhfZ/Aiz9tgHGV0UVhYHb8n614fDIKzpXwIy5DPjCKpxPoZRVzABQcdzPTvxnZtZDbarsfdfq0vh9xXNPLGuFYZQnZ6iEpv17qp/2TbeCBSMKIxwIG3LQTwr0a4wKL1T/YIZm6oiN6NycHhMHaczQIRANKw9e7oqbgnXu/WnqHIxyTY2CCvzVOgipRmKKa7jz7CcSoP883XZ9o7WAOnfJY+T4ofpdkzHn1ElNXPjDPpX7CUkowNFH4DZk2Ljwe0CgxPOF6ygnsNrqqs4XoNQaBnHGXMq20Upg6OK9MBmZibtlX9STCeSAt4WudekpEOPU=
bucket: bootstrap.urbit.org
local-dir: built-pill/
acl: public-read
on:
condition: "-d built-pill/"
repo: urbit/arvo
all_branches: true

View File

@ -1,2 +0,0 @@
# Don't show in diffs or auto-merge
package-lock.json binary

View File

@ -1 +0,0 @@
node_modules/

View File

@ -1,11 +0,0 @@
#!/bin/bash
whitespace=$(find .. -path ../.git -prune -o \
-type f -exec egrep -l " +$" {} \;);
if [ ! -z $whitespace ]
then
echo 'found trailing whitespace in:';
echo $whitespace;
exit 1;
fi

View File

@ -1,64 +0,0 @@
#!/bin/bash
set -euo pipefail
set -x
# add urbit-runner to $PATH
PATH=./node_modules/.bin/:$PATH
# XX use -s instead of hash pill
HASH=$(git -C .. log -1 HEAD --format=%H -- sys/)
export PILL_NAME="git-${HASH:0:10}"
if [ ! ${PILL_FORCE:-} ]; then
: Trying pill for commit
wget https://bootstrap.urbit.org/$PILL_NAME.pill -O urbit.pill && exit 0
fi
# if wget failed
if [ ${TRAVIS_COMMIT:-} ] && [ $TRAVIS_COMMIT != $HASH ]; then
: Directory sys/ not modified in commit $TRAVIS_COMMIT
: FIXME ignoring, as current sys/ commits are unlikely to contain the pill-build code
:
# : For auto-build please tag and push $HASH
# exit 1
fi
mkdir prev
{
: Pilling: trying pinned fakezod
wget -i pin-parent-pill-pier.url -O - | tar xvz -C prev/ &&
: Downloaded prev/zod &&
urbit-runner -S prev/zod <<' .'
|autoload |
|mount %
.
[ $? = 0 ] && cp -r ../sys prev/zod/home/ &&
cp ../gen/solid.hoon prev/zod/home/gen/ &&
cp ../lib/pill.hoon prev/zod/home/lib/
} || {
: Pilling: Parent-pill pier not available, trying preceding pill commit
HASH2=$(git -C .. log -2 $HASH --format=%H -- sys/ | tail -1)
PILL_NAME2="git-${HASH2:0:10}"
wget https://bootstrap.urbit.org/$PILL_NAME2.pill -O prev/urbit.pill &&
([ -d prev/zod ] && rm -r prev/zod || true) &&
urbit-runner -A .. -B prev/urbit.pill -cSF zod prev/zod <<' .'
%booted-prev-zod
.
} || {
: Pilling: Out of ideas
exit 1
}
: Pier created, soliding actual pill
urbit-runner -S prev/zod <<.
|label %home %$PILL_NAME
.urbit/pill +solid /==/$PILL_NAME/sys, =dub &
.
cp prev/zod/.urb/put/urbit.pill urbit.pill
mkdir built-pill; cp urbit.pill built-pill/$PILL_NAME.pill
:
: Created $PILL_NAME.pill, to be uploaded if tests pass
:

View File

@ -1,753 +0,0 @@
{
"name": "arvo-tests",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"requires": {
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
}
},
"array-differ": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
"integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE="
},
"array-union": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
"requires": {
"array-uniq": "^1.0.1"
}
},
"array-uniq": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
"integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY="
},
"arrify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
},
"aws4": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"requires": {
"tweetnacl": "^0.14.3"
}
},
"bluebird": {
"version": "2.11.0",
"resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
"integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"co": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
},
"colors": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.3.2.tgz",
"integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ=="
},
"combined-stream": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"core-js": {
"version": "2.5.7",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz",
"integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw=="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"del": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
"integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
"requires": {
"globby": "^5.0.0",
"is-path-cwd": "^1.0.0",
"is-path-in-cwd": "^1.0.0",
"object-assign": "^4.0.1",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0",
"rimraf": "^2.2.8"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"emitter-mixin": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/emitter-mixin/-/emitter-mixin-0.0.3.tgz",
"integrity": "sha1-WUjLKG8uSO3DslGnz8H3iDOW1lw="
},
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
"integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
"requires": {
"prr": "~1.0.1"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"extend": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz",
"integrity": "sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w="
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
},
"fast-deep-equal": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"requires": {
"assert-plus": "^1.0.0"
}
},
"glob": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"globby": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
"integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
"requires": {
"array-union": "^1.0.1",
"arrify": "^1.0.0",
"glob": "^7.0.3",
"object-assign": "^4.0.1",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"graceful-fs": {
"version": "4.1.15",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
},
"har-validator": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz",
"integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==",
"requires": {
"ajv": "^5.3.0",
"har-schema": "^2.0.0"
}
},
"hoek": {
"version": "4.2.1",
"resolved": "http://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
"integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA=="
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"is-path-cwd": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
"integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0="
},
"is-path-in-cwd": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
"integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
"requires": {
"is-path-inside": "^1.0.0"
}
},
"is-path-inside": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
"integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
"requires": {
"path-is-inside": "^1.0.1"
}
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
},
"isemail": {
"version": "2.2.1",
"resolved": "http://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz",
"integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"items": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/items/-/items-2.1.1.tgz",
"integrity": "sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg="
},
"joi": {
"version": "9.2.0",
"resolved": "http://registry.npmjs.org/joi/-/joi-9.2.0.tgz",
"integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=",
"requires": {
"hoek": "4.x.x",
"isemail": "2.x.x",
"items": "2.x.x",
"moment": "2.x.x",
"topo": "2.x.x"
}
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
},
"json-schema-traverse": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"junk": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/junk/-/junk-1.0.3.tgz",
"integrity": "sha1-h75jSIZJy9ym9Tqzm+yczSNH9ZI="
},
"maximatch": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/maximatch/-/maximatch-0.1.0.tgz",
"integrity": "sha1-hs2NawTJ8wfAWmuUGZBtA2D7E6I=",
"requires": {
"array-differ": "^1.0.0",
"array-union": "^1.0.1",
"arrify": "^1.0.0",
"minimatch": "^3.0.0"
}
},
"mime-db": {
"version": "1.37.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
"integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg=="
},
"mime-types": {
"version": "2.1.21",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz",
"integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==",
"requires": {
"mime-db": "~1.37.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
}
},
"moment": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
"integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
},
"nan": {
"version": "2.3.5",
"resolved": "http://registry.npmjs.org/nan/-/nan-2.3.5.tgz",
"integrity": "sha1-gioNwmYpDOTNOhIoLKPn42Rmigg="
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"path-is-inside": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
"integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM="
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
},
"pify": {
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"pinkie": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
},
"pinkie-promise": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
"requires": {
"pinkie": "^2.0.0"
}
},
"promise": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
"integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
"requires": {
"asap": "~2.0.3"
}
},
"promise-streams": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/promise-streams/-/promise-streams-2.1.1.tgz",
"integrity": "sha1-cwnx02mDMOp/rasZIvE5iSKayFo=",
"requires": {
"bluebird": "^2.10.2"
}
},
"prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY="
},
"psl": {
"version": "1.1.29",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
"integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ=="
},
"pty.js": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/pty.js/-/pty.js-0.3.1.tgz",
"integrity": "sha1-gfW+0zLW5eeraFaI0boDc0ENUbU=",
"requires": {
"extend": "~1.2.1",
"nan": "2.3.5"
}
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
},
"recursive-copy": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/recursive-copy/-/recursive-copy-2.0.9.tgz",
"integrity": "sha512-0AkHV+QtfS/1jW01z3m2t/TRTW56Fpc+xYbsoa/bqn8BCYPwmsaNjlYmUU/dyGg9w8MmGoUWihU5W+s+qjxvBQ==",
"requires": {
"del": "^2.2.0",
"emitter-mixin": "0.0.3",
"errno": "^0.1.2",
"graceful-fs": "^4.1.4",
"junk": "^1.0.1",
"maximatch": "^0.1.0",
"mkdirp": "^0.5.1",
"pify": "^2.3.0",
"promise": "^7.0.1",
"slash": "^1.0.0"
}
},
"request": {
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
},
"dependencies": {
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
}
}
},
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"requires": {
"glob": "^7.0.5"
}
},
"rx": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
"integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"slash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU="
},
"split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"requires": {
"through": "2"
}
},
"sshpk": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz",
"integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==",
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"stream-snitch": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/stream-snitch/-/stream-snitch-0.0.3.tgz",
"integrity": "sha1-iXp48TonFPqESqd74VR3qJbYUqk="
},
"through": {
"version": "2.3.8",
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"topo": {
"version": "2.0.2",
"resolved": "http://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
"integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
"requires": {
"hoek": "4.x.x"
}
},
"tough-cookie": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"requires": {
"psl": "^1.1.24",
"punycode": "^1.4.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"urbit-runner": {
"version": "github:urbit/runner-js#ee2455015dc4ea243d0e0ec623975632c9249c4e",
"from": "github:urbit/runner-js#ee24550",
"requires": {
"colors": "^1.1.2",
"escape-string-regexp": "^1.0.5",
"once": "^1.4.0",
"promise-streams": "^2.1.1",
"pty.js": "^0.3.1",
"recursive-copy": "^2.0.7",
"split": "^1.0.1",
"stream-snitch": "0.0.3",
"wait-on": "^2.0.2"
}
},
"uuid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
},
"wait-on": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/wait-on/-/wait-on-2.1.2.tgz",
"integrity": "sha512-Jm6pzZkbswtcRUXohxY1Ek5MrL16AwHj83drgW2FTQuglHuhZhVMyBLPIYG0rL1wvr5rdC1uzRuU/7Bc+B9Pwg==",
"requires": {
"core-js": "^2.4.1",
"joi": "^9.2.0",
"minimist": "^1.2.0",
"request": "^2.78.0",
"rx": "^4.1.0"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
}
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}
}
}

View File

@ -1,14 +0,0 @@
{
"name": "arvo-tests",
"version": "1.0.0",
"description": "Test harness for Urbit arvo distribution",
"scripts": {
"test": "node test.js"
},
"private": true,
"author": "~fyr",
"license": "MIT",
"dependencies": {
"urbit-runner": "github:urbit/runner-js#ee24550"
}
}

View File

@ -1 +0,0 @@
https://ci-piers.urbit.org/zod-d71780001aed3ba464d8b24f223f6bc597236718.tgz

View File

@ -1 +0,0 @@
d0401f0034e348ec1db498f2c7884194d99b6de4

View File

@ -1,17 +0,0 @@
#!/bin/bash
set -euo pipefail
set -x
RESULT=$1
if [[ ${RESULT} -eq 0 ]]; then
exit 0
else
for i in $(find ./ -maxdepth 1 -name 'core*' -print)
do
gdb urbit core* -ex "thread apply all bt" -ex "set pagination 0" -batch
done
fi
echo "build failed with status code $RESULT"
exit $RESULT

View File

@ -1,134 +0,0 @@
'use strict';
var fs = require('fs')
var runner = require('urbit-runner')
var Urbit = runner.Urbit;
var ERROR = runner.ERROR;
var actions = runner.actions
var args = ['-B', 'urbit.pill', '-A', '..', '-cSF', 'zod', 'zod'];
var urbit = new Urbit(args);
// XX upstream this into runner-js
//
function rePill(urb) {
return new Promise(function(resolve,reject){
fs.stat('./built-pill/', function(err, stat) {
if (err) return resolve()
fs.readdir('./built-pill/', function(err, files) {
if (err || (1 !== files.length)) {
return resolve()
}
var name = files[0].replace(/\.pill$/, '')
urb.note('re-soliding pill')
return urb.expect(/dojo> /)
.then(function(){
return urb.line('|label %home %' + name)
})
.then(function(){
return urb.expect(/dojo> /)
})
.then(function(){
return urb.line('.latest/pill +solid /==/' + name + '/sys')
})
.then(function(){
return urb.expectEcho("%resolid")
})
.then(function(){
return urb.resetListeners();
})
.then(function(){
var write = fs.createWriteStream('./built-pill/' + name + '.pill')
var read = fs.createReadStream('./zod/.urb/put/latest.pill')
read.on('error', function(err){
return reject(err)
})
write.on('error', function(err){
return reject(err)
})
write.on('finish', function(){
return resolve()
})
return read.pipe(write)
})
// XX find a better way to add this to the promise chain
//
.then(function(){
return barMass(urb);
})
.catch(function(err){
return reject(err)
});
})
})
})
}
// XX upstream this into runner-js
//
function barMass(urb) {
return urb.line("|mass")
.then(function(){
return urb.expectEcho("%ran-mass")
.then(function(){ return urb.resetListeners(); })
})
}
function aqua(urb) {
return urb.line("|start %ph")
.then(function(){
return urb.line(":ph|init");
})
.then(function(){
return urb.line(":aqua &pill +solid");
})
.then(function(){
urb.every(/TEST [^ ]* FAILED/, function(arg){
throw Error(arg);
});
return urb.line(":ph|run %hi");
})
.then(function(){
return urb.expectEcho("ALL TESTS SUCCEEDED")
.then(function(){ return urb.resetListeners(); })
})
}
Promise.resolve(urbit)
.then(actions.safeBoot)
.then(function(){
return barMass(urbit);
})
.then(actions.test)
.then(actions.testCores)
.then(actions.testRenderers)
.then(function(){
return barMass(urbit);
})
.then(function(){
return aqua(urbit);
})
.then(function(){
return rePill(urbit);
})
.then(function(){
return urbit.expect(/dojo> /);
})
.then(function(){
return urbit.exit(0);
})
.catch(function(err){
return urbit.waitSilent()
.then(function(){
urbit.warn('Test aborted:', err);
return urbit.exit(1);
});
});

View File

@ -256,8 +256,8 @@
%- zing
%+ turn ufs
|= uf=unix-effect
:~ [%give %fact `/effect %aqua-effect !>(`aqua-effect`[ship uf])]
[%give %fact `/effect/[-.q.uf] %aqua-effect !>(`aqua-effect`[ship uf])]
:~ [%give %fact ~[/effect] %aqua-effect !>(`aqua-effect`[ship uf])]
[%give %fact ~[/effect/[-.q.uf]] %aqua-effect !>(`aqua-effect`[ship uf])]
==
::
=. this
@ -265,7 +265,7 @@
%- emit-cards
%+ turn ~(tap by unix-effects)
|= [=ship ufs=(list unix-effect)]
[%give %fact `path %aqua-effects !>(`aqua-effects`[ship (flop ufs)])]
[%give %fact ~[path] %aqua-effects !>(`aqua-effects`[ship (flop ufs)])]
::
=. this
%- emit-cards
@ -275,28 +275,28 @@
=/ =path /effect/(scot %p ship)
%+ turn ufs
|= uf=unix-effect
[%give %fact `path %aqua-effect !>(`aqua-effect`[ship uf])]
[%give %fact ~[path] %aqua-effect !>(`aqua-effect`[ship uf])]
::
=. this
%- emit-cards
%+ turn ~(tap by unix-effects)
|= [=ship ufs=(list unix-effect)]
=/ =path /effects/(scot %p ship)
[%give %fact `path %aqua-effects !>(`aqua-effects`[ship (flop ufs)])]
[%give %fact ~[path] %aqua-effects !>(`aqua-effects`[ship (flop ufs)])]
::
=. this
%- emit-cards
%+ turn ~(tap by unix-events)
|= [=ship ve=(list unix-timed-event)]
=/ =path /events/(scot %p ship)
[%give %fact `path %aqua-events !>(`aqua-events`[ship (flop ve)])]
[%give %fact ~[path] %aqua-events !>(`aqua-events`[ship (flop ve)])]
::
=. this
%- emit-cards
%+ turn ~(tap by unix-boths)
|= [=ship bo=(list unix-both)]
=/ =path /boths/(scot %p ship)
[%give %fact `path %aqua-boths !>(`aqua-boths`[ship (flop bo)])]
[%give %fact ~[path] %aqua-boths !>(`aqua-boths`[ship (flop bo)])]
::
[(flop cards) all-state]
::

View File

@ -57,16 +57,16 @@
`[who id %rift num]
?: =(changed-keys i.topics.event-log)
=/ who=@ (decode-topics t.topics.event-log ~[%uint])
=+ ^- [enc=octs aut=octs sut=@ud rev=@ud]
=/ [enc=octs aut=octs sut=@ud rev=@ud]
%+ decode-results data.event-log
~[[%bytes-n 32] [%bytes-n 32] %uint %uint]
`[who id %keys rev sut (pass-from-eth:azimuth enc aut sut)]
?: =(lost-sponsor i.topics.event-log)
=+ ^- [who=@ pos=@]
=/ [who=@ pos=@]
(decode-topics t.topics.event-log ~[%uint %uint])
`[who id %spon ~]
?: =(escape-accepted i.topics.event-log)
=+ ^- [who=@ wer=@]
=/ [who=@ wer=@]
(decode-topics t.topics.event-log ~[%uint %uint])
`[who id %spon `wer]
~& [%bad-topic event-log]
@ -78,8 +78,8 @@
?~ udiffs
~
=/ =path /(scot %p ship.i.udiffs)
:* [%give %fact `/ %azimuth-udiff !>(i.udiffs)]
[%give %fact `path %azimuth-udiff !>(i.udiffs)]
:* [%give %fact ~[/] %azimuth-udiff !>(i.udiffs)]
[%give %fact ~[path] %azimuth-udiff !>(i.udiffs)]
$(udiffs t.udiffs)
==
::

View File

@ -12,7 +12,7 @@
/- *chat-store, *chat-view, *chat-hook,
*permission-store, *group-store, *invite-store,
sole-sur=sole
/+ sole-lib=sole, chat-eval, default-agent, verb,
/+ sole-lib=sole, chat-eval, default-agent, verb, dbug,
auto=language-server-complete
::
|%
@ -70,9 +70,11 @@
--
=| state
=* all-state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
%+ verb |
^- agent:gall
|_ =bowl:gall
+* this .
talk-core +>
@ -102,7 +104,7 @@
^- (quip card _this)
=^ cards all-state
?+ mark (on-poke:def mark vase)
%noun (poke-noun:tc mark !<(* vase))
%noun (poke-noun:tc !<(* vase))
%sole-action (poke-sole-action:tc !<(sole-action:sole-sur vase))
==
[cards this]
@ -122,7 +124,7 @@
?- -.sign
%poke-ack [- all-state]:(on-agent:def wire sign)
%watch-ack [- all-state]:(on-agent:def wire sign)
%kick ~& %chat-cli-kicked `all-state
%kick [?:(?=([%chat-store ~] wire) ~[connect:tc] ~) all-state]
%fact
?+ p.cage.sign ~|([%chat-cli-bad-sub-mark wire p.cage.sign] !!)
%chat-update (diff-chat-update:tc wire !<(chat-update q.cage.sign))
@ -141,7 +143,10 @@
|= old=(unit state)
^- (quip card state)
?^ old
[~ u.old]
:_ u.old
?: (~(has by wex.bowl) [/chat-store our-self %chat-store])
~
~[connect]
=^ cards all-state
%_ catch-up
audience [[our-self /] ~ ~]
@ -1041,7 +1046,7 @@
|= fec=sole-effect:sole-sur
^- card
::TODO don't hard-code session id 'drum' here
[%give %fact `/sole/drum %sole-effect !>(fec)]
[%give %fact ~[/sole/drum] %sole-effect !>(fec)]
:: +tab: print tab-complete list
::
++ tab
@ -1352,6 +1357,7 @@
~(glyph tr source)
=/ lis=(list tape)
%+ simple-wrap
~| [%weird-text `@`+.letter]
`tape``(list @)`(tuba (trip +.letter))
(sub wyd (min (div wyd 2) (lent pef)))
=+ lef=(lent pef)
@ -1383,7 +1389,7 @@
|= [txt=tape wid=@ud]
^- (list tape)
?~ txt ~
=+ ^- [end=@ud nex=?]
=/ [end=@ud nex=?]
?: (lte (lent txt) wid) [(lent txt) &]
=+ ace=(find " " (flop (scag +(wid) `tape`txt)))
?~ ace [wid |]

View File

@ -3,7 +3,7 @@
:: allow sending chat messages to foreign paths based on write perms
::
/- *permission-store, *chat-hook, *invite-store
/+ *chat-json, default-agent, verb
/+ *chat-json, default-agent, verb, dbug
|%
+$ card card:agent:gall
::
@ -31,6 +31,8 @@
--
=| state-zero
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
@ -77,7 +79,7 @@
?+ -.sign (on-agent:def wire sign)
%watch-ack
=^ cards state
(watch-ack:cc wire p.sign)
(watch-ack:cc wire p.sign)
[cards this]
::
%kick
@ -186,7 +188,7 @@
:~ (pull-wire [%backlog (weld path.act /0)])
(pull-wire [%mailbox path.act])
(delete-permission [%chat path.act])
[%give %kick `[%mailbox path.act] ~]~
[%give %kick [%mailbox path.act]~ ~]~
==
?. |(=(u.ship src.bol) (team:title our.bol src.bol))
:: if neither ship = source or source = us, do nothing
@ -229,7 +231,7 @@
?: ?&(?=(^ backlog-start) (~(got by allow-history) pas))
(paginate-messages pas u.box u.backlog-start)
~
[%give %kick `[%backlog pax] `src.bol]~
[%give %kick [%backlog pax]~ `src.bol]~
==
::
++ paginate-messages
@ -302,7 +304,7 @@
:: if ship is not permitted, kick their subscription
=/ mail-path
(oust [(dec (lent t.pax)) (lent t.pax)] `(list @t)`t.pax)
[%give %kick `[%mailbox mail-path] `ship]~
[%give %kick [%mailbox mail-path]~ `ship]~
::
++ fact-chat-update
|= [wir=wire fact=chat-update]
@ -327,11 +329,11 @@
::
%message
:_ state
[%give %fact `[%mailbox path.fact] %chat-update !>(fact)]~
[%give %fact [%mailbox path.fact]~ %chat-update !>(fact)]~
::
%messages
:_ state
[%give %fact `[%mailbox path.fact] %chat-update !>(fact)]~
[%give %fact [%mailbox path.fact]~ %chat-update !>(fact)]~
==
::
++ handle-foreign

View File

@ -1,6 +1,6 @@
:: chat-store: data store that holds linear sequences of chat messages
::
/+ *chat-json, *chat-eval, default-agent
/+ *chat-json, *chat-eval, default-agent, verb, dbug
|%
+$ card card:agent:gall
+$ versioned-state
@ -21,6 +21,9 @@
::
=| state-zero
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ =bowl:gall
@ -245,7 +248,7 @@
++ update-subscribers
|= [pax=path update=chat-update]
^- (list card)
[%give %fact `pax %chat-update !>(update)]~
[%give %fact ~[pax] %chat-update !>(update)]~
::
++ send-diff
|= [pax=path upd=chat-update]

View File

@ -6,7 +6,7 @@
*group-store,
*permission-group-hook,
*chat-hook
/+ *server, *chat-json, default-agent
/+ *server, *chat-json, default-agent, verb, dbug
/= index
/^ octs
/; as-octs:mimes:html
@ -51,6 +51,8 @@
[%permission-group-hook-action permission-group-hook-action]
==
--
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ bol=bowl:gall
@ -137,7 +139,7 @@
==
==
::
++ on-arvo
++ on-arvo
|= [=wire =sign-arvo]
^- (quip card _this)
?. ?=(%bound +<.sign-arvo)
@ -176,7 +178,7 @@
=/ pax t.t.t.t.site.url
=/ envelopes (envelope-scry [(scot %ud start) (scot %ud end) pax])
%- json-response:gen
%- json-to-octs
%- json-to-octs
%- update-to-json
[%messages pax start end envelopes]
::
@ -239,8 +241,8 @@
^- (list card)
=/ updates-json (update-to-json upd)
=/ configs-json (configs-to-json configs-scry)
:~ [%give %fact `/primary %json !>(updates-json)]
[%give %fact `/configs %json !>(configs-json)]
:~ [%give %fact ~[/primary] %json !>(updates-json)]
[%give %fact ~[/configs] %json !>(configs-json)]
==
::
:: +utilities

File diff suppressed because one or more lines are too long

View File

@ -12,12 +12,12 @@
<link rel="stylesheet" href="/~chat/css/index.css" />
<link rel="icon" type="image/png" href="/~launch/img/Favicon.png">
<link rel="manifest"
href='data:application/manifest+json,{
"name": "Chat",
"short_name": "Chat",
"description": "A%20Chat%20application%20for%20your%20Urbit%20ship.",
"display": "standalone",
"background_color": "%23FFFFFF",
href='data:application/manifest+json,{
"name": "Chat",
"short_name": "Chat",
"description": "A%20Chat%20application%20for%20your%20Urbit%20ship.",
"display": "standalone",
"background_color": "%23FFFFFF",
"theme_color": "%23000000"}' />
</head>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -28,7 +28,7 @@
++ give-result
|= [=the=path =cage]
^- card
[%give %fact `the-path cage]
[%give %fact ~[the-path] cage]
--
::
^- agent:gall

View File

@ -538,7 +538,7 @@
$poke
%- he-card(poy ~)
:* %pass
/poke
/poke
%agent
p.p.mad
%poke
@ -830,7 +830,7 @@
++ he-diff :: emit update
|= fec/sole-effect
^+ +>
(he-card %give %fact `/sole/[id] %sole-effect !>(fec))
(he-card %give %fact ~[/sole/[id]] %sole-effect !>(fec))
::
++ he-stop :: abort work
^+ .
@ -968,7 +968,7 @@
++ he-lens
|= com/command:lens
^+ +>
=+ ^- source/dojo-source
=/ source=dojo-source
=| num/@
=- ?. ?=($send-api -.sink.com) :: XX num is incorrect
sor
@ -1109,7 +1109,7 @@
|= pos=@ud
^+ +>
=* res +>
=+ ^- [back-pos=@ud fore-pos=@ud txt=tape]
=/ [back-pos=@ud fore-pos=@ud txt=tape]
(insert-magic:auto (add (lent buf) pos) :(weld buf (tufa buf.say)))
=/ id-len (sub fore-pos back-pos)
=/ fore-pos-diff (sub fore-pos pos)
@ -1141,11 +1141,11 @@
:: If couldn't search (eg cursor not in appropriate position), do
:: nothing.
::
?: ?=(~ tl)
?: ?=(~ tl)
res
:: If no options, ring the bell
::
?: =([~ ~] tl)
?: =([~ ~] tl)
(he-diff %bel ~)
:: If only one option, don't print unless the option is already
:: typed in.

View File

@ -0,0 +1,297 @@
:: eth-sender: utility for signing & sending eth-txs
::
:: usage:
::
:: sign txs for gasses of 2 and 11 gwei; (~ for default gwei set)
:: store at path
:: :eth-sender [%sign %/txs %/txs/eth-txs %/pk/txt ~[2 0]]
::
:: read nonce range from signed transactions at path
:: :eth-sender [%read %txs/txt]
::
:: send all but first 50 txs from path to mainnet,
:: waiting for confirms every 4 txs
:: :eth-sender [%send %/txs/txt 4 `index+50 ~]
::
/+ default-agent, verb
::
|%
++ state-0
$: %0
~
==
::
+$ tx-range
$: how=?(%nonce %index) :: tx nonce / index in file
wat=$@(@ud [start=@ud end=@ud]) :: inclusive. end optional
==
::
+$ command
$% [%sign out=path in=path key=path gweis=(list @ud)]
[%read =path]
::
$: %send
txs=path
step-size=@ud
range=(unit tx-range)
nodes=(list [id=@tas url=@t])
==
==
::
+$ card card:agent:gall
--
::
=| state-0
=* state -
%+ verb |
=<
|_ =bowl:gall
+* this .
do ~(. +> bowl)
def ~(. (default-agent this %|) bowl)
::
++ on-init on-init:def
++ on-save !>(state)
++ on-load on-load:def
::
++ on-poke
|= [=mark =vase]
^- (quip card _this)
?. ?=(%noun mark) [~ this]
=/ =command !<(command vase)
?- -.command
%read
~& (read-transactions:do +.command)
[~ this]
::
%sign
:_ this
(sign-transactions:do +.command)
::
%send
:_ this
(send-transactions:do +.command)
==
::
++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card _this)
?. ?=([%send *] wire)
(on-agent:def wire sign)
?- -.sign
%poke-ack
?~ p.sign
[~ this]
%- (slog leaf+"{(trip dap.bowl)} couldn't start thread" u.p.sign)
:_ this
[(leave-spider:do wire our.bowl)]~
::
%watch-ack
?~ p.sign
[~ this]
=/ =tank leaf+"{(trip dap.bowl)} couldn't start listen to thread"
%- (slog tank u.p.sign)
[~ this]
::
%kick
[~ this]
::
%fact
?+ p.cage.sign (on-agent:def wire sign)
%thread-fail
=+ !<([=term =tang] q.cage.sign)
%- (slog leaf+"{(trip dap.bowl)} failed" leaf+<term> tang)
[~ this]
::
%thread-done
~& ['all submitted to' t.wire]
[~ this]
==
==
::
++ on-peek on-peek:def
++ on-watch on-watch:def
++ on-leave on-leave:def
++ on-arvo on-arvo:def
++ on-fail on-fail:def
--
::
|_ =bowl:gall
++ poke-spider
|= [=path our=@p =cage]
^- card
[%pass path %agent [our %spider] %poke cage]
::
++ watch-spider
|= [=path our=@p =sub=path]
^- card
[%pass path %agent [our %spider] %watch sub-path]
::
++ leave-spider
|= [=path our=@p]
^- card
[%pass path %agent [our %spider] %leave ~]
::
++ start-txs-send
|= [[node-id=@tas node=@t] step=@ud txs=(list @ux)]
^- (list card)
=/ tid=@ta
:((cury cat 3) dap.bowl '--' node-id '--' (scot %uv eny.bowl))
=/ args
:^ ~ `tid %eth-send-txs
!>([node step txs])
:~ (watch-spider /send/[tid] our.bowl /thread-result/[tid])
(poke-spider /send/[tid] our.bowl %spider-start !>(args))
==
::
::
++ get-file
|= =path
~| path
.^ (list cord)
%cx
(scot %p our.bowl)
%home
(scot %da now.bowl)
path
==
::
++ write-file-wain
|= [=path tox=(list cord)]
^- card
?> ?=([@ desk @ *] path)
=- [%pass [%write path] %arvo %c %info -]
:- i.t.path
=- &+[t.t.t.path -]~
=/ y .^(arch %cy path)
?~ fil.y
ins+txt+!>(tox)
mut+txt+!>(tox)
::
++ write-file-transactions
|= [=path tox=(list transaction:rpc:ethereum)]
^- card
?> ?=([@ desk @ *] path)
=- [%pass [%write path] %arvo %c %info -]
:- i.t.path
=- &+[t.t.t.path -]~
=/ y .^(arch %cy path)
?~ fil.y
ins+eth-txs+!>(tox)
mut+eth-txs+!>(tox)
::
::
++ read-transactions
|= =path
^- tape
=+ tox=.^((list cord) %cx path)
=+ [first last]=(read-nonces tox)
%+ weld
"Found nonces {(scow %ud first)} through {(scow %ud last)}"
" in {(scow %ud (lent tox))} transactions."
::
++ read-nonces
|= tox=(list cord)
|^ ^- [@ud @ud]
?: =(~ tox) ::NOTE tmi
[0 0]
:- (read-nonce (snag 0 tox))
(read-nonce (snag (dec (lent tox)) tox))
::
++ read-nonce
|= tex=cord
^- @ud
%+ snag 0
%- decode-atoms:rlp:ethereum
(tape-to-ux (trip tex))
--
::
::
++ sign-transactions
|= [out=path in=path key=path gasses=(list @ud)]
^- (list card)
%+ turn
?. =(~ gasses) gasses
:: default gwei set
~[4 8 12 20 32]
|= gas=@ud
%+ write-file-wain
:: add gas amount to path
=+ end=(dec (lent out))
=- (weld (scag end out) -)
?: =(0 gas) [(snag end out) /txt]
:_ /txt
(cat 3 (snag end out) (crip '-' ((d-co:co 1) gas)))
::
%- sign
:+ in key
:: modify tx gas if non-zero gwei specified
?: =(0 gas) ~
`(mul gas 1.000.000.000)
::
++ sign
=, rpc:ethereum
|= [in=path key=path gas=(unit @ud)]
^- (list cord)
?> ?=([@ @ @ *] key)
=/ pkf (get-file t.t.t.key)
?> ?=(^ pkf)
=/ pk (rash i.pkf ;~(pfix (jest '0x') hex))
=/ txs .^((list transaction) %cx in)
=/ enumerated
=/ n 1
|- ^- (list [@ud transaction])
?~ txs
~
[[n i.txs] $(n +(n), txs t.txs)]
%+ turn enumerated
|= [n=@ud tx=transaction]
~? =(0 (mod n 100)) [%signing n]
=? gas-price.tx ?=(^ gas) u.gas
(crip '0' 'x' ((x-co:co 0) (sign-transaction:key:ethereum tx pk)))
::
++ send-transactions
|= [=path step=@ud range=(unit tx-range) nodes=(list [id=@tas url=@t])]
^- (list card)
=? nodes =(~ nodes)
:~ geth+'http://eth-mainnet.urbit.org:8545'
==
~& 'loading txs...'
=/ tox=(list cord) .^((list cord) %cx path)
=? tox ?=(^ range)
(txs-in-range tox u.range)
=/ txs=(list @ux)
%+ turn tox
(cork trip tape-to-ux)
~& ['sending txs:' (lent txs)]
%- zing
%+ turn nodes
|= node=[@tas @t]
(start-txs-send node step txs)
::
++ txs-in-range
|= [tox=(list cord) =tx-range]
^+ tox
=* ran wat.tx-range
?- how.tx-range
%index
?@ ran
(slag ran tox)
%+ slag start.ran
(scag end.ran tox)
::
%nonce
=+ [first last]=(read-nonces tox)
?: !=((lent tox) +((sub last first)))
~| ['probably non-contiguous set of transactions' -]
!!
?@ ran
(slag (sub ran first) tox)
%+ slag (sub start.ran first)
(scag (sub +(end.ran) first) tox)
==
::
++ tape-to-ux
|= t=tape
(scan t ;~(pfix (jest '0x') hex))
--

View File

@ -337,7 +337,7 @@
:_ dog(history actual-history)
%+ turn actual-vows
|= =id:block
[%give %fact `[%logs path] %eth-watcher-diff !>([%disavow id])]
[%give %fact [%logs path]~ %eth-watcher-diff !>([%disavow id])]
::
++ release-logs
|= [=path dog=watchdog]
@ -362,7 +362,7 @@
%+ turn loglist
|= =event-log:rpc:ethereum
^- card
[%give %fact `[%logs path] %eth-watcher-diff !>([%log event-log])]
[%give %fact [%logs path]~ %eth-watcher-diff !>([%log event-log])]
=^ cards-2 dog $(numbers t.numbers)
[(weld cards-1 cards-2) dog]
--

View File

@ -357,11 +357,11 @@
0x4763.8e3c.ddee.2204.81e4.c3f9.183d.639c.
0efe.a7f0.5fcd.2df4.1888.5572.9f71.5419
~
=+ ^- [of=@ pool=@] ::TODO =/
=/ [of=@ pool=@]
~| t.topics.log
%+ decode-topics:abi:ethereum t.topics.log
~[%uint %uint]
=+ ^- [by=@ gift=@ to=@] ::TODO =/
=/ [by=@ gift=@ to=@]
~| data.log
%+ decode-topics:abi:ethereum
%+ rash data.log

View File

@ -1,7 +1,7 @@
:: group-hook: allow syncing group data from foreign paths to local paths
::
/- *group-store, *group-hook
/+ default-agent
/+ default-agent, verb, dbug
|%
+$ card card:agent:gall
::
@ -19,6 +19,9 @@
::
=| state-zero
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ =bowl:gall
@ -126,7 +129,7 @@
:_ state(synced (~(del by synced.state) path.act))
%+ snoc
(pull-wire group-wire path.act)
[%give %kick `[%group path.act] ~]
[%give %kick [%group path.act]~ ~]
?: |(=(u.ship src.bol) (team:title our.bol src.bol))
:: delete a foreign ship's path
=/ group-wire [(scot %p u.ship) %group path.act]
@ -150,7 +153,7 @@
:_ state(synced (~(del by synced.state) pax.diff))
%+ snoc
(update-subscribers [%group pax.diff] diff)
[%give %kick `[%group pax.diff] ~]
[%give %kick [%group pax.diff]~ ~]
==
::
++ handle-foreign
@ -212,7 +215,7 @@
++ update-subscribers
|= [pax=path diff=group-update]
^- (list card)
[%give %fact `pax %group-update !>(diff)]~
[%give %fact ~[pax] %group-update !>(diff)]~
::
++ pull-wire
|= [wir=wire pax=path]

View File

@ -1,7 +1,7 @@
:: group-store: data store for groups of ships
:: group-store: data store for groups of ships
::
/- *group-store
/+ default-agent
/+ default-agent, verb, dbug
|%
+$ card card:agent:gall
::
@ -22,12 +22,15 @@
::
=| state-zero
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ =bowl:gall
+* this .
group-core +>
gc ~(. group-core bowl)
gc ~(. group-core bowl)
def ~(. (default-agent this %|) bowl)
::
++ on-init on-init:def
@ -75,9 +78,9 @@
[%x *] ``noun+!>((~(get by groups) t.path))
==
::
++ on-agent on-agent:def
++ on-arvo on-arvo:def
++ on-fail on-fail:def
++ on-agent on-agent:def
++ on-arvo on-arvo:def
++ on-fail on-fail:def
--
::
|_ bol=bowl:gall
@ -148,7 +151,7 @@
++ update-subscribers
|= [pax=path act=group-action]
^- (list card)
[%give %fact `pax %group-update !>(act)]~
[%give %fact ~[pax] %group-update !>(act)]~
::
++ send-diff
|= [pax=path act=group-action]

View File

@ -54,7 +54,7 @@
?: (team:title our.bowl src.bowl)
:: outgoing. we must be inviting another ship. send them the invite.
::
?> !(team:title our.bowl ship.invite.act)
?> !(team:title our.bowl recipient.invite.act)
[(invite-hook-poke:do recipient.invite.act act)]~
:: else incoming. ensure invitatory exists and invite is not a duplicate.
::

View File

@ -169,7 +169,7 @@
++ update-subscribers
|= [pax=path upd=invite-update]
^- card
[%give %fact `pax %invite-update !>(upd)]
[%give %fact ~[pax] %invite-update !>(upd)]
::
++ send-diff
|= [pax=path upd=invite-update]

View File

@ -59,7 +59,7 @@
?> ?=(%invite-update p.cage.sign)
:~ :*
%give %fact
`/primary %json
~[/primary] %json
!>((update-to-json !<(invite-update q.cage.sign)))
== ==
==

View File

@ -1,8 +1,10 @@
/- lsp-sur=language-server
/+ *server,
auto=language-server-complete,
lsp-parser=language-server-parser,
easy-print=language-server-easy-print,
rune-snippet=language-server-rune-snippet,
build=language-server-build,
default-agent
|%
+$ card card:agent:gall
@ -29,10 +31,20 @@
+$ position
[row=@ud col=@ud]
::
+$ all-state bufs=(map uri=@t buf=wall)
+$ state-zero
$: %0
bufs=(map uri=@t buf=wall)
builds=(map uri=@t =vase)
ford-diagnostics=(map uri=@t (list diagnostic:lsp-sur))
preludes=(map uri=@t type)
==
+$ versioned-state
$%
state-zero
==
--
^- agent:gall
=| all-state
=| state-zero
=* state -
=<
|_ =bowl:gall
@ -57,7 +69,7 @@
|= old-state=vase
^- (quip card _this)
~& > %lsp-upgrade
[~ this(state !<(all-state old-state))]
[~ this(state *state-zero)]
::
++ on-poke
^+ on-poke:*agent:gall
@ -65,26 +77,31 @@
^- (quip card _this)
=^ cards state
?+ mark (on-poke:def mark vase)
%handle-http-request
(handle-http-request:lsp !<([eyre-id=@ta inbound-request:eyre] vase))
%language-server-rpc-notification
(on-notification:lsp !<(all:notification:lsp-sur vase))
%language-server-rpc-request
(on-request:lsp !<(all:request:lsp-sur vase))
==
[cards this]
::
++ on-watch
|= =path
?: ?=([%primary ~] path)
`this
?. ?=([%http-response @ ~] path)
(on-watch:def path)
`this
++ on-leave on-leave:def
++ on-peek on-peek:def
++ on-peek on-peek:def
++ on-agent on-agent:def
++ on-arvo
^+ on-arvo:*agent:gall
|= [=wire =sign-arvo]
^- (quip card _this)
=^ cards state
?+ wire (on-arvo:def wire sign-arvo)
[%connect ~] ?>(?=(%bound +<.sign-arvo) `state)
?+ sign-arvo (on-arvo:def wire sign-arvo)
[%e %bound *] `state
[%f *] (handle-build:lsp wire +.sign-arvo)
==
[cards this]
::
@ -93,107 +110,116 @@
::
|_ bow=bowl:gall
::
++ parser
=, dejs:format
|^
%: ot
uri+so
:- %data
%- of
:~ sync+sync
completion+position
commit+ni
hover+position
==
~
==
::
++ sync
%- ar
%: ou
range+(uf ~ (pe ~ range))
'rangeLength'^(uf ~ (pe ~ ni))
text+(un so)
~
==
::
++ range
%: ot
start+position
end+position
~
==
::
++ position
%: ot
line+ni
character+ni
~
==
--
::
++ json-response
|= [eyre-id=@ta jon=json]
^- (list card)
(give-simple-payload:app eyre-id (json-response:gen (json-to-octs jon)))
::
:: +handle-http-request: received on a new connection established
++ give-rpc-notification
|= res=out:notification:lsp-sur
^- (list card)
:_ ~
[%give %fact ~[/primary] %language-server-rpc-notification !>(res)]
::
++ handle-http-request
|= [eyre-id=@ta =inbound-request:eyre]
++ on-notification
|= not=all:notification:lsp-sur
^- (quip card _state)
?> ?=(^ body.request.inbound-request)
=/ =lsp-req
%- parser
(need (de-json:html q.u.body.request.inbound-request))
=/ buf (~(gut by bufs) uri.lsp-req *wall)
=^ cards buf
?- +<.lsp-req
%sync (handle-sync buf eyre-id +>.lsp-req)
%completion (handle-completion buf eyre-id +>.lsp-req)
%commit (handle-commit buf eyre-id uri.lsp-req)
%hover (handle-hover buf eyre-id +>.lsp-req)
=^ cards state
?+ -.not [~ state]
%text-document--did-open (handle-did-open +.not)
%text-document--did-change (handle-did-change +.not)
%text-document--did-save (handle-did-save +.not)
%text-document--did-close (handle-did-close +.not)
%exit handle-exit
==
[cards state]
++ on-request
|= req=all:request:lsp-sur
^- (quip card _state)
=^ cards state
?+ -.req [~ state]
%text-document--hover (handle-hover req)
%text-document--completion (handle-completion req)
==
=. bufs
(~(put by bufs) uri.lsp-req buf)
[cards state]
::
++ regen-diagnostics
|= buf=wall
^- json
=/ t=tape
++ get-subject
|= uri=@t
^- type
(~(gut by preludes) uri -:!>(..zuse))
::
++ handle-completion
|= com=text-document--completion:request:lsp-sur
^- (quip card _state)
:_ state
%^ give-rpc-response %text-document--completion id.com
=/ buf=wall
(~(got by bufs) uri.com)
=/ txt=tape
(zing (join "\0a" buf))
=/ parse
(lily:auto t (lsp-parser *beam))
?: ?=(%| -.parse)
(format-diagnostic p.parse)
=, enjs:format
%- pairs
:~ good+b+&
=/ pos
(get-pos buf row.com col.com)
=/ rune (rune-snippet (swag [(safe-sub pos 2) 2] txt))
?^ rune rune
=/ tab-list
%^ tab-list-tape:auto
(~(gut by preludes) uri.com -:!>(..zuse))
pos txt
?: ?=(%| -.tab-list) ~
?~ p.tab-list ~
?~ u.p.tab-list ~
(turn u.p.tab-list make-completion-item)
::
++ make-completion-item
|= [name=term =type]
^- completion-item:lsp-sur
=/ doc
%- crip
;: weld
"`"
~(ram re ~(duck easy-print type))
"`"
==
[name 1 doc '' name 1]
::
++ give-rpc-response
|= res=all:response:lsp-sur
^- (list card)
:_ ~
[%give %fact ~[/primary] %language-server-rpc-response !>(res)]
::
++ handle-exit
^- (quip card _state)
~& > %lsp-shutdown
:_ *state-zero
%- zing
%+ turn
~(tap in ~(key by builds))
|= uri=@t
:+ [%pass /ford/[uri] %arvo %f %kill ~]
[%pass /ford/[uri]/deps %arvo %f %kill ~]
~
::
++ handle-did-close
|= [uri=@t version=(unit @)]
^- (quip card _state)
=. bufs
(~(del by bufs) uri)
=. ford-diagnostics
(~(del by ford-diagnostics) uri)
=. builds
(~(del by builds) uri)
:_ state
:~
[%pass /ford/[uri] %arvo %f %kill ~]
[%pass /ford/[uri]/deps %arvo %f %kill ~]
==
::
++ format-diagnostic
|= [row=@ col=@]
^- json
=, enjs:format
%- pairs
:~ good+b+|
:+ %diagnostics %a :_ ~
=/ loc (pairs line+(numb (dec row)) character+(numb col) ~)
%- pairs
:~ range+(pairs start+loc end+loc ~)
severity+n+'1'
message+s+'syntax error'
==
==
::
++ handle-commit
|= [buf=wall eyre-id=@ta uri=@t]
^- [(list card) wall]
:_ buf
=/ jon
(regen-diagnostics buf)
:_ (json-response eyre-id jon)
++ handle-did-save
|= [uri=@t version=(unit @)]
^- (quip card _state)
:_ state
:_ (give-rpc-notification (get-diagnostics uri))
:*
%pass
/commit
@ -204,33 +230,141 @@
!>([q.byk.bow |])
==
::
++ handle-did-change
|= [document=versioned-doc-id:lsp-sur changes=(list change:lsp-sur)]
^- (quip card _state)
=/ updated=wall
(sync-buf (~(got by bufs) uri.document) changes)
=. bufs
(~(put by bufs) uri.document updated)
`state
::
++ handle-build
|= [=path =gift:able:ford]
^- (quip card _state)
?. ?=([%made *] gift)
[~ state]
?. ?=([%complete *] result.gift)
[~ state]
=/ uri=@t
(snag 1 path)
=/ =build-result:ford
build-result.result.gift
?+ build-result [~ state]
::
[%success %plan *]
=. preludes
(~(put by preludes) uri -:vase.build-result)
[~ state]
::
[%success %core *]
=. builds
(~(put by builds) uri vase.build-result)
=. ford-diagnostics
(~(del by ford-diagnostics) uri)
:_ state
(give-rpc-notification (get-diagnostics uri))
::
[%error *]
=/ error-ranges=(list =range:lsp-sur)
(get-errors-from-tang:build uri message.build-result)
?~ error-ranges
[~ state]
=. ford-diagnostics
%+ ~(put by ford-diagnostics)
uri
[i.error-ranges 1 'Build Error']~
:_ state
(give-rpc-notification (get-diagnostics uri))
==
::
++ get-diagnostics
|= uri=@t
^- out:notification:lsp-sur
:+ %text-document--publish-diagnostics
uri
%+ weld
(~(gut by ford-diagnostics) uri ~)
(get-parser-diagnostics uri)
::
++ get-build-deps
|= [=path buf=wall]
^- schematic:ford
=/ parse=(like scaffold:ford)
%+ (lsp-parser [byk.bow path]) [1 1]
(zing (join "\0a" buf))
=/ =scaffold:ford
?~ q.parse *scaffold:ford
p.u.q.parse
:* %plan
[[our.bow %home] (flop path)]
*coin
scaffold(sources `(list hoon)`~[[%cnts ~[[%& 1]] ~]])
==
::
++ handle-did-open
|= item=text-document-item:lsp-sur
^- (quip card _state)
=/ buf=wall
(to-wall (trip text.item))
=. bufs
(~(put by bufs) uri.item buf)
=/ =path
(uri-to-path:build uri.item)
=/ =schematic:ford
[%core [our.bow %home] (flop path)]
=/ dep-schematic=schematic:ford
(get-build-deps path buf)
:_ state
%+ weld
(give-rpc-notification (get-diagnostics uri.item))
^- (list card)
:~
[%pass /ford/[uri.item] %arvo %f %build live=%.y schematic]
[%pass /ford/[uri.item]/deps %arvo %f %build live=%.y dep-schematic]
==
::
++ get-parser-diagnostics
|= uri=@t
^- (list diagnostic:lsp-sur)
=/ t=tape
(zing (join "\0a" `wall`(~(got by bufs) uri)))
=/ parse
(lily:auto t (lsp-parser *beam))
?. ?=(%| -.parse)
~
=/ loc=position:lsp-sur
[(dec -.p.parse) +.p.parse]
:_ ~
[[loc loc] 1 'Syntax Error']
::
++ handle-hover
|= [buf=wall eyre-id=@ta row=@ud col=@ud]
^- [(list card) wall]
|= hov=text-document--hover:request:lsp-sur
^- (quip card _state)
:_ state
%^ give-rpc-response %text-document--hover id.hov
=/ buf=wall
(~(got by bufs) uri.hov)
=/ txt
(zing (join "\0a" buf))
=+ (get-id:auto (get-pos buf row col) txt)
?~ id
[(json-response eyre-id *json) buf]
=/ match=(unit (option:auto type))
(search-exact:auto u.id (get-identifiers:auto -:!>(..zuse)))
?~ match
[(json-response eyre-id *json) buf]
=/ contents
%- crip
;: weld
"`"
~(ram re ~(duck easy-print detail.u.match))
"`"
==
:_ buf
%+ json-response eyre-id
%- pairs:enjs:format
[contents+s+contents ~]
=/ tab-list
%^ tab-list-tape:auto
(~(gut by preludes) uri.hov -:!>(..zuse))
(get-pos buf row.hov col.hov)
txt
?: ?=(%| -.tab-list) ~
?~ p.tab-list ~
?~ u.p.tab-list ~
:- ~
%- crip
;: weld
"`"
~(ram re ~(duck easy-print detail.i.u.p.tab-list))
"`"
==
::
++ handle-sync
|= [buf=wall eyre-id=@ta changes=(list change)]
:- (json-response eyre-id *json)
++ sync-buf
|= [buf=wall changes=(list change:lsp-sur)]
|- ^- wall
?~ changes
buf
@ -277,48 +411,4 @@
0
(sub a b)
::
++ handle-completion
|= [buf=wall eyre-id=@ta row=@ud col=@ud]
^- [(list card) wall]
=/ =tape (zing (join "\0a" buf))
=/ pos (get-pos buf row col)
:_ buf
:: Check if we're on a rune
::
=/ rune (swag [(safe-sub pos 2) 2] tape)
?: (~(has by runes:rune-snippet) rune)
(json-response eyre-id (rune-snippet rune))
:: Don't run on large files because it's slow
::
?: (gth (lent buf) 1.000)
=, enjs:format
(json-response eyre-id (pairs good+b+& result+~ ~))
::
=/ tl
(tab-list-tape:auto -:!>(..zuse) pos tape)
=, enjs:format
%+ json-response eyre-id
?: ?=(%| -.tl)
(format-diagnostic p.tl)
?~ p.tl
*json
%- pairs
:~ good+b+&
::
:- %result
%- pairs
:~ 'isIncomplete'^b+&
::
:- %items
:- %a
=/ lots (gth (lent u.p.tl) 10)
%- flop
%+ turn (scag 50 u.p.tl)
|= [=term =type]
?: lots
(frond label+s+term)
=/ detail (crip ~(ram re ~(duck easy-print type)))
(pairs label+s+term detail+s+detail ~)
==
==
--

View File

@ -153,7 +153,7 @@
=/ dat=(unit [json url=@t]) (~(get by data) name)
?~ dat [~ this]
:_ this(data (~(put by data) name [jon url.u.dat]))
[%give %fact `/main %json !>((frond:enjs:format name jon))]~
[%give %fact ~[/main] %json !>((frond:enjs:format name jon))]~
::
++ on-arvo
|= [wir=wire sin=sign-arvo]

View File

@ -83,7 +83,7 @@
%+ give-simple-payload:app eyre-id.u.job.state
[[200 ~] `(as-octt:mimes:html "\"Imported data\"")]
::
[%export ~]
[%export ~]
?+ -.sign (on-agent:def wire sign)
%watch-ack
?~ p.sign
@ -94,7 +94,8 @@
::
%fact
=^ cards this (take-export !<(* q.cage.sign))
:_ this :_ cards
:_ this(job.state ~)
:_ cards
?> ?=(^ job.state)
?> ?=(%export -.source.com.u.job.state)
[%pass /export %agent [our.bowl app.source.com.u.job.state] %leave ~]
@ -135,7 +136,7 @@
=/ enc (en:base64 octs)
(pairs:enjs:format file+s+output data+s+enc ~)
::
:_ this(job.state ~)
:_ this
%+ give-simple-payload:app eyre-id.u.job.state
(json-response:gen (json-to-octs jon))
::

View File

@ -165,14 +165,14 @@
++ kick-proxy
|= [who=ship =path]
^- card
[%give %kick `path `who]
[%give %kick ~[path] `who]
::
++ handle-proxy-sign
|= [=path =sign:agent:gall]
^- (quip card _state)
?- -.sign
%poke-ack ~|([dap.bowl %unexpected-poke-ack path] !!)
%fact [[%give %fact `path cage.sign]~ state]
%fact [[%give %fact ~[path] cage.sign]~ state]
%kick [[(proxy-pass-link-store path %watch path)]~ state]
::
%watch-ack

View File

@ -120,10 +120,9 @@
%- parse-request-line
url.request.inbound-request
=* req-head header-list.request.inbound-request
=- ::TODO =; [cards=(list card) =simple-payload:http]
=; [cards=(list card) =simple-payload:http]
%+ weld cards
(give-simple-payload:app eyre-id simple-payload)
^- [cards=(list card) =simple-payload:http]
?+ method.request.inbound-request [~ not-found:gen]
%'OPTIONS'
[~ (include-cors-headers req-head [[200 ~] `*octs])]
@ -138,7 +137,7 @@
++ handle-post
|= [request-headers=header-list:http =request-line body=(unit octs)]
^- [(list card) simple-payload:http]
=- ::TODO =; [success=? cards=(list card)]
=; [success=? cards=(list card)]
:- cards
%+ include-cors-headers
request-headers
@ -146,7 +145,6 @@
:: sending this response right away... but link-store pokes can't
:: actually fail right now, so it's fine.
[[?:(success 200 400) ~] `*octs]
^- [success=? cards=(list card)]
?~ body [| ~]
?+ request-line [| ~]
[[~ [%'~link' %add ^]] ~]

View File

@ -131,7 +131,7 @@
:_ state
:_ cards
:+ %give %fact
:+ `[%local-pages path]
:+ [%local-pages path]~
%link-update
!>([%local-pages path [page]~])
:: +hear-submission: record page someone else saved
@ -154,7 +154,7 @@
:_ state
:_ ~
:+ %give %fact
:+ `[%submissions path]
:+ [%submissions path]~
%link-update
!>([%submissions path [submission]~])
::

View File

@ -5,7 +5,7 @@
:: configured for them as `access-control`.
::
/- *permission-hook
/+ *permission-json, default-agent
/+ *permission-json, default-agent, verb, dbug
::
|%
+$ state
@ -26,6 +26,8 @@
=| state-0
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ =bowl:gall
@ -140,7 +142,7 @@
==
:: delete the permission path and its subscriptions from this hook.
::
:- :- [%give %kick `[%permission path.act] ~]
:- :- [%give %kick [%permission path.act]~ ~]
(leave-permission path.act)
%_ state
synced (~(del by synced) path.act)
@ -278,7 +280,7 @@
^- (list card)
%+ turn ~(tap in access-paths)
|= access-path=path
[%give %kick `[%permission access-path] `check-ship]
[%give %kick [%permission access-path]~ `check-ship]
::
++ permission-scry
|= pax=path
@ -313,7 +315,7 @@
++ update-subscribers
|= [=path upd=permission-update]
^- card
[%give %fact `path %permission-update !>(upd)]
[%give %fact ~[path] %permission-update !>(upd)]
::
++ leave-permission
|= =path

View File

@ -1,7 +1,7 @@
:: permission-store: track black- and whitelists of ships
::
/- *permission-store
/+ default-agent
/+ default-agent, verb, dbug
::
|%
+$ card card:agent:gall
@ -17,6 +17,9 @@
--
=| state-zero
=* state -
::
%- agent:dbug
%+ verb |
^- agent:gall
=<
|_ =bowl:gall
@ -184,7 +187,7 @@
++ update-subscribers
|= [pax=path upd=permission-update]
^- (list card)
[%give %fact `pax %permission-update !>(upd)]~
[%give %fact ~[pax] %permission-update !>(upd)]~
::
++ send-diff
|= [pax=path upd=permission-update]

View File

@ -243,7 +243,7 @@
++ write-file
=, space:userlib
|= [pax=path cay=cage]
^- card
^- card
=. pax (weld our-beak pax)
[%pass (weld /write-file pax) %arvo %c %info (foal pax cay)]
::
@ -730,15 +730,15 @@
++ affection-primary
|= del=delta
^- (list card)
[%give %fact `/primary %publish-rumor !>(del)]~
[%give %fact ~[/primary] %publish-rumor !>(del)]~
:: +affection: rumors to interested
::
++ affection
|= del=delta
^- (list card)
=/ wir=wire /collection/[col.del]
:~ [%give %fact `/primary %publish-rumor !>(del)]
[%give %fact `wir %publish-rumor !>(del)]
:~ [%give %fact ~[/primary] %publish-rumor !>(del)]
[%give %fact ~[wir] %publish-rumor !>(del)]
==
::
++ get-post-by-index
@ -1263,7 +1263,7 @@
=/ upd=update [%invite %.y src.bol coll.act title.act]
:_ state
%+ welp make-tile-moves
[%give %fact `/primary %publish-update !>(upd)]~
[%give %fact ~[/primary] %publish-update !>(upd)]~
::
:: %reject-invite: remove invite from list, acceptance is handled by
:: %subscribe action
@ -1276,7 +1276,7 @@
=/ upd=update [%invite %.n who.act coll.act u.title]
:_ state
%+ welp make-tile-moves
[%give %fact `/primary %publish-update !>(upd)]~
[%give %fact ~[/primary] %publish-update !>(upd)]~
::
:: %serve:
::
@ -1406,7 +1406,7 @@
[%pass wir %agent [who.act %publish] %watch wir]~
?~ title ~
=/ upd=update [%invite %.n who.act coll.act u.title]
[%give %fact `/primary %publish-update !>(upd)]~
[%give %fact ~[/primary] %publish-update !>(upd)]~
==
::
:: %unsubscribe: unsub from a foreign blog, delete all state related to it
@ -1435,7 +1435,7 @@
:- [%pass wir %agent [who.act %publish] %leave ~]
%+ welp make-tile-moves
=/ rum=rumor [%remove who.act coll.act ~]
[%give %fact `/primary %publish-rumor !>(rum)]~
[%give %fact ~[/primary] %publish-rumor !>(rum)]~
::
:: %read: notify that we've seen a post
::
@ -1445,7 +1445,7 @@
%+ welp make-tile-moves
::
=/ upd=update [%unread %.n (sy [who.act coll.act post.act] ~)]
[%give %fact `/primary %publish-update !>(upd)]~
[%give %fact ~[/primary] %publish-update !>(upd)]~
::
==
::
@ -1597,7 +1597,7 @@
::
++ make-tile-moves
^- (list card)
[%give %fact `/publishtile %json !>(make-tile-json)]~
[%give %fact ~[/publishtile] %json !>(make-tile-json)]~
::
++ make-tile-json
^- json

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,3 @@
:: Thread manager
::
/- spider
/+ libstrand=strand, default-agent, verb
=, strand=strand:libstrand
@ -127,9 +125,6 @@
|- ^- (quip card _this)
?~ yarns
`this
?. ?=([@ ~] i.yarns)
$(yarns t.yarns)
~| killing=i.yarns
=^ cards-1 state
(handle-stop-thread:sc (yarn-to-tid i.yarns) |)
=^ cards-2 this
@ -139,8 +134,6 @@
++ on-poke
|= [=mark =vase]
^- (quip card _this)
?: ?=(%spider-kill mark)
(on-load on-save)
=^ cards state
?+ mark (on-poke:def mark vase)
%spider-input (on-poke-input:sc !<(input vase))
@ -357,15 +350,12 @@
^- ^card
?+ card card
[%pass * *] [%pass [%thread tid p.card] q.card]
[%give %fact *]
?~ path.p.card
card
card(path.p `[%thread tid u.path.p.card])
::
[%give %kick *]
?~ path.p.card
card
card(path.p `[%thread tid u.path.p.card])
[%give ?(%fact %kick) *]
=- card(paths.p -)
%+ turn paths.p.card
|= =path
^- ^path
[%thread tid path]
==
=. cards (weld cards cards.r)
=^ final-cards=(list card) state
@ -391,13 +381,14 @@
++ thread-say-fail
|= [=tid =term =tang]
^- (list card)
:~ [%give %fact `/thread-result/[tid] %thread-fail !>([term tang])]
[%give %kick `/thread-result/[tid] ~]
:~ [%give %fact ~[/thread-result/[tid]] %thread-fail !>([term tang])]
[%give %kick ~[/thread-result/[tid]] ~]
==
::
++ thread-fail
|= [=yarn =term =tang]
^- (quip card ^state)
%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
=/ =tid (yarn-to-tid yarn)
=/ fail-cards (thread-say-fail tid term tang)
=^ cards state (thread-clean yarn)
@ -409,8 +400,8 @@
:: %- (slog leaf+"strand {<yarn>} finished" (sell vase) ~)
=/ =tid (yarn-to-tid yarn)
=/ done-cards=(list card)
:~ [%give %fact `/thread-result/[tid] %thread-done vase]
[%give %kick `/thread-result/[tid] ~]
:~ [%give %fact ~[/thread-result/[tid]] %thread-done vase]
[%give %kick ~[/thread-result/[tid]] ~]
==
=^ cards state (thread-clean yarn)
[(weld done-cards cards) state]

View File

@ -101,7 +101,7 @@
=/ lismov [%pass /[(scot %da now.bol)] %arvo %i %request req out]~
?~ timer
:- [[%pass /timer %arvo %b %wait (add now.bol ~h3)] lismov]
%= state
%= state
location str
timer `(add now.bol ~h3)
==
@ -135,7 +135,7 @@
currently+(~(got by p.u.ujon) 'currently')
daily+(~(got by p.u.ujon) 'daily')
==
:- [%give %fact `/weathertile %json !>(jon)]~
:- [%give %fact ~[/weathertile] %json !>(jon)]~
%= state
data jon
time now.bol

32
pkg/arvo/gen/dbug.hoon Normal file
View File

@ -0,0 +1,32 @@
:: +dbug: tell /lib/dbug app to print some generic state
::
:: :app +dbug
:: the entire bowl
:: :app +dbug [direction] [specifics]
:: all in subs matching the parameters
:: direction: %incoming or %outgoing
:: specifics:
:: [%ship ~ship] subscriptions to/from this ship
:: [%path /path] subscriptions on path containing /path
:: [%wire /wire] subscriptions on wire containing /wire
:: [%term %name] subscriptions to app %name
::
/+ *dbug
::
:- %say
|= $: :: environment
::
*
:: inline arguments
::
args=?(~ [what=?(%bowl %state) ~] [=what =about ~])
:: named arguments
::
~
==
:- %dbug
?- args
~ [%bowl *about]
[@ ~] [what.args *about]
[@ * ~] [what about]:args
==

View File

@ -19,7 +19,7 @@
==
;body
;h1:"Ran generator"
:: ;p:"Executing on {<(scot %p our)>}."
;p:"Executing on {<(scot %p p.bek)>}."
;p:"The method was {<(trip method)>}."
;p:"The url was {<(trip url)>}."
==

View File

@ -15,7 +15,7 @@
~(tap by dir:.^(arch %cy (welp top /sys/vane)))
?. =(1 (met 3 tam))
tam
=+ ^- zaz=(list [p=knot ~])
=/ zaz=(list [p=knot ~])
(skim van |=([a=term ~] =(tam (end 3 1 a))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz

View File

@ -59,7 +59,7 @@
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
::
|^ |= bs=octs ^- cord
=+ ^- [padding=@ blocks=(list word24)]
=/ [padding=@ blocks=(list word24)]
(octs-to-blocks bs)
(crip (flop (unpad padding (encode-blocks blocks))))
::

View File

@ -114,7 +114,7 @@
~| %know-no-private-key
!!
:: derive child at i
=+ ^- [left=@ right=@] ::TODO =/ w/o face
=/ [left=@ right=@]
=- [(cut 3 [32 32] -) (cut 3 [0 32] -)]
%+ hmac-sha512l [32 cad]
:- 37
@ -143,7 +143,7 @@
~| %cant-derive-hardened-public-key
!!
:: derive child at i
=+ ^- [left=@ right=@] ::TODO =/ w/o face
=/ [left=@ right=@]
=- [(cut 3 [32 32] -) (cut 3 [0 32] -)]
%+ hmac-sha512l [32 cad]
37^(can 3 ~[4^i 33^(ser-p pub)])

116
pkg/arvo/lib/dbug.hoon Normal file
View File

@ -0,0 +1,116 @@
:: dbug: agent wrapper for generic debugging tools
::
:: usage: %-(agent:dbug your-agent)
::
|%
+$ what
$? %bowl
%state
%incoming
%outgoing
==
::
+$ about
$% [%ship =ship]
[%path =path]
[%wire =wire]
[%term =term]
==
::
++ agent
|= =agent:gall
^- agent:gall
|_ =bowl:gall
+* this .
ag ~(. agent bowl)
::
++ on-poke
|= [=mark =vase]
^- (quip card:agent:gall agent:gall)
?. ?=(%dbug mark)
=^ cards agent (on-poke:ag mark vase)
[cards this]
=/ dbug
!<([=what =about] vase)
=; out=^vase
((slog (sell out) ~) [~ this])
?- what.dbug
%bowl !>(bowl)
%state on-save:ag
::
%incoming
!>
%+ murn ~(tap by sup.bowl)
|= sub=[=duct [=ship =path]]
^- (unit _sub)
=; relevant=?
?:(relevant `sub ~)
?- -.about.dbug
%ship =(ship.sub ship.about.dbug)
%path ?=(^ (find path.about.dbug path.sub))
%wire %+ lien duct.sub
|=(=wire ?=(^ (find wire.about.dbug wire)))
%term !!
==
::
%outgoing
!>
%+ murn ~(tap by wex.bowl)
|= sub=[[=wire =ship =term] [acked=? =path]]
^- (unit _sub)
=; relevant=?
?:(relevant `sub ~)
?- -.about.dbug
%ship =(ship.sub ship.about.dbug)
%path ?=(^ (find path.about.dbug path.sub))
%wire ?=(^ (find wire.about.dbug wire.sub))
%term =(term.sub term.about.dbug)
==
==
::
++ on-init
^- (quip card:agent:gall agent:gall)
=^ cards agent on-init:ag
[cards this]
::
++ on-save on-save:ag
::
++ on-load
|= old-state=vase
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-load:ag old-state)
[cards this]
::
++ on-watch
|= =path
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-watch:ag path)
[cards this]
::
++ on-leave
|= =path
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-leave:ag path)
[cards this]
::
++ on-peek on-peek:ag
::
++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-agent:ag wire sign)
[cards this]
::
++ on-arvo
|= [=wire =sign-arvo]
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-arvo:ag wire sign-arvo)
[cards this]
::
++ on-fail
|= [=term =tang]
^- (quip card:agent:gall agent:gall)
=^ cards agent (on-fail:ag term tang)
[cards this]
--
--

View File

@ -185,7 +185,7 @@
:: nex: offset of value bytes from fuz
:: len: length of value bytes
::
=+ ^- [nex=@ len=@]
=/ [nex=@ len=@]
:: faz: meaningful bits in fuz
::
=/ faz (end 0 7 fuz)

View File

@ -21,7 +21,7 @@
%+ strand-fail:strandio
%unexpected-multiple-results
[>(lent res)< ~]
:: +request-batch-rpc-strict: send rpc request, with retry
:: +request-batch-rpc-strict: send rpc requests, with retry
::
:: sends a batch request. produces results for all requests in the batch,
:: but only if all of them are successful.
@ -32,8 +32,39 @@
`10
attempt-request
::
+$ result [id=@t =json]
+$ results (list result)
+$ results (list [id=@t =json])
::
++ attempt-request
=/ m (strand:strandio ,(unit results))
^- form:m
;< responses=(list response:rpc:jstd) bind:m
(request-batch-rpc-loose url reqs)
=- ?~ err
(pure:m `res)
(pure:m ~)
%+ roll responses
|= $: rpc=response:rpc:jstd
[res=results err=(list [id=@t code=@t message=@t])]
==
?: ?=(%error -.rpc)
[res [+.rpc err]]
?. ?=(%result -.rpc)
[res [['' 'ethio-rpc-fail' (crip <rpc>)] err]]
[[+.rpc res] err]
--
:: +request-batch-rpc-loose: send rpc requests, with retry
::
:: sends a batch request. produces results for all requests in the batch,
:: including the ones that are unsuccessful.
::
++ request-batch-rpc-loose
|= [url=@ta reqs=(list [id=(unit @t) req=request:rpc:ethereum])]
|^ %+ (retry:strandio results)
`10
attempt-request
::
+$ result response:rpc:jstd
+$ results (list response:rpc:jstd)
::
++ attempt-request
=/ m (strand:strandio ,(unit results))
@ -71,18 +102,7 @@
((ar:dejs-soft:format parse-one-response) u.jon)
?~ array
(strand-fail:strandio %rpc-result-incomplete-batch >u.jon< ~)
=- ?~ err
(pure:m `res)
(pure:m ~)
%+ roll u.array
|= $: rpc=response:rpc:jstd
[res=results err=(list [id=@t code=@t message=@t])]
==
?: ?=(%error -.rpc)
[res [+.rpc err]]
?. ?=(%result -.rpc)
[res [['' 'ethio-rpc-fail' (crip <rpc>)] err]]
[[+.rpc res] err]
(pure:m array)
::
++ parse-one-response
|= =json
@ -98,6 +118,7 @@
=, dejs-soft:format
(ot id+so error+(ot code+no message+so ~) ~)
--
::
:: +read-contract: calls a read function on a contract, produces result hex
::
++ read-contract

View File

@ -291,7 +291,7 @@
?~ biz (flop moz)
:_ (flop moz)
=/ =dill-blit:dill ?~(t.biz i.biz [%mor (flop biz)])
[%give %fact `/drum %dill-blit !>(dill-blit)]
[%give %fact ~[/drum] %dill-blit !>(dill-blit)]
::
++ se-adit :: update servers
^+ .
@ -478,7 +478,7 @@
::
++ se-blit-sys :: output to system
|= bil/dill-blit:dill ^+ +>
(se-emit %give %fact `/drum %dill-blit !>(bil))
(se-emit %give %fact ~[/drum] %dill-blit !>(bil))
::
++ se-show :: show buffer, raw
|= lin/(pair @ud stub)

View File

@ -146,7 +146,7 @@
=. nam
?. =(1 (met 3 nam))
nam
=+ ^- zaz/(list {p/knot ~})
=/ zaz/(list {p/knot ~})
(skim van |=({a/term ~} =(nam (end 3 1 a))))
?> ?=({{@ ~} ~} zaz)
`term`p.i.zaz

View File

@ -312,11 +312,11 @@
++ take-agent
|= [=wire =sign:agent:gall]
?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!)
[%kiln %fancy *] ?> ?=(%poke-ack -.sign)
[%kiln %fancy *] ?> ?=(%poke-ack -.sign)
(take-coup-fancy t.t.wire p.sign)
[%kiln %reload *] ?> ?=(%poke-ack -.sign)
(take-coup-reload t.t.wire p.sign)
[%kiln %spam *] ?> ?=(%poke-ack -.sign)
[%kiln %spam *] ?> ?=(%poke-ack -.sign)
(take-coup-spam t.t.wire p.sign)
==
::
@ -378,7 +378,7 @@
++ take-mere-sync ::
|= {way/wire mes/(each (set path) (pair term tang))}
?> ?=({@ @ @ *} way)
=+ ^- hos/kiln-sync
=/ hos/kiln-sync
:* syd=(slav %tas i.way)
her=(slav %p i.t.way)
sud=(slav %tas i.t.t.way)
@ -388,7 +388,7 @@
++ take-writ-find-ship ::
|= {way/wire rot/riot}
?> ?=({@ @ @ *} way)
=+ ^- hos/kiln-sync
=/ hos/kiln-sync
:* syd=(slav %tas i.way)
her=(slav %p i.t.way)
sud=(slav %tas i.t.t.way)
@ -398,7 +398,7 @@
++ take-writ-sync ::
|= {way/wire rot/riot}
?> ?=({@ @ @ *} way)
=+ ^- hos/kiln-sync
=/ hos/kiln-sync
:* syd=(slav %tas i.way)
her=(slav %p i.t.way)
sud=(slav %tas i.t.t.way)
@ -549,7 +549,7 @@
::
++ work :: state machine
|= syd/desk
=+ ^- per-desk
=/ ,per-desk
%+ ~(gut by rem) syd
=+ *per-desk
%_(- cas [%da now])
@ -644,7 +644,7 @@
[%scry %c %x [[our syd] (flop pax)]]
=/ dali=schematic [%diff [our syd] base alis]
=/ dbob=schematic [%diff [our syd] base bobs]
=+ ^- for/mark
=/ for=mark
=+ (slag (dec (lent pax)) pax)
?~(- %$ i.-)
^- schematic
@ -713,7 +713,7 @@
=+ "failed to mash"
lose:(spam leaf+- message.build-result.result)
?> ?=([%complete %success %list *] result)
=+ ^- can/(list (pair path (unit miso)))
=/ can=(list (pair path (unit miso)))
%+ turn results.build-result.result
|= res=build-result:ford
^- (pair path (unit miso))
@ -731,7 +731,7 @@
=+ annotated=(turn `(list (pair path *))`-.notated head)
=+ unnotated=(turn `(list (pair path *))`+.notated head)
=+ `desk`(cat 3 syd '-scratch')
=+ ^- tan/(list tank)
=/ tan=(list tank)
%- zing
^- (list (list tank))
:~ %- tape-to-tanks

View File

@ -0,0 +1,61 @@
/- *language-server
::
|%
++ parse-error
|= =tape
^- (unit [=path =range])
=/ parse-pair
%+ cook
|=([row=@ud col=@ud] [(dec row) col])
(ifix [lac rac] ;~((glue ace) dem dem))
=/ parse-path
%+ cook
|=(p=path (slag 3 p))
(ifix [net (jest '::')] (more net urs:ab))
=/ parse-full
;~(plug parse-path ;~(sfix ;~((glue dot) parse-pair parse-pair) ban))
(rust tape parse-full)
::
++ get-errors-from-tang
|= [uri=@t =tang]
^- (list range)
=/ =path
(uri-to-path uri)
%+ murn tang
|= =tank
^- (unit range)
?. ?=([%leaf *] tank)
~
=/ error
(parse-error p.tank)
?~ error
~
?: =(path path.u.error)
`range.u.error
~
::
++ uri-to-path
|= uri=@t
^- path
=/ pier-root=(set cord)
%- sy
['app' 'gen' 'lib' 'mar' 'ren' 'sur' 'sys' 'test' ~]
=/ path=(list cord)
(parse-uri uri)
|-
?< ?=(~ path)
?: (~(has in pier-root) i.path)
`^path`path
$(path t.path)
::
++ parse-uri
|= uri=@t
=- (fall - /fail)
%+ rush uri
%+ more
;~(pose (plus fas) dot)
%+ cook
crip
(star ;~(pose col hep alf))
::
--

View File

@ -4,7 +4,7 @@
=/ debug |
|%
+* option [item]
[=term detail=item]
[term=cord detail=item]
::
:: Like +rose except also produces line number
::
@ -73,7 +73,7 @@
|* [sid=term options=(list (option))]
=/ match
%+ skim options
|= [id=term *]
|= [id=cord *]
=(sid id)
?~ match
~
@ -82,17 +82,18 @@
:: Get all the identifiers that start with sid.
::
++ search-prefix
|* [sid=term ids=(list (option))]
|* [sid=cord ids=(list (option))]
^+ ids
%+ skim ids
|= [id=term *]
|= [id=cord *]
^- ?(%.y %.n)
=(sid (end 3 (met 3 sid) id))
::
:: Get the longest prefix of a list of identifiers.
::
++ longest-match
|= matches=(list (option))
^- term
^- cord
?~ matches
''
=/ n 1

View File

@ -116,7 +116,7 @@
::
{$face *}
=^ cox gid $(q.ham q.q.ham)
:_(gid [%palm [['/' ~] ~ ~ ~] [%leaf (trip p.q.ham)] cox ~])
:_(gid [%palm [['=' ~] ~ ~ ~] [%leaf (trip p.q.ham)] cox ~])
::
{$list *}
=^ cox gid $(q.ham q.q.ham)
@ -128,7 +128,7 @@
::
{$plot *}
=^ coz gid (many p.q.ham)
:_(gid [%rose [[' ' ~] ['{' ~] ['}' ~]] coz])
:_(gid [%rose [[' ' ~] ['[' ~] [']' ~]] coz])
::
{$pear *}
:_(gid [%leaf '$' ~(rend co [%$ p.q.ham q.q.ham])])

View File

@ -0,0 +1,301 @@
/- lsp=language-server
|%
::
++ util
|%
++ get-json-string
|= [jon=(map @t json) key=@t]
^- (unit cord)
=/ cord-jon=(unit json)
(~(get by jon) key)
?~ cord-jon
~
?> ?=([%s *] u.cord-jon)
`p.u.cord-jon
--
::
::
++ dejs
=, dejs:format
|%
++ request
|= jon=json
?> ?=([%o *] jon)
=/ method=cord
%- method
(trip (need (get-json-string:util p.jon 'method')))
=/ id=cord
(need (get-json-string:util p.jon 'id'))
=/ params=json
(~(got by p.jon) 'params')
^- all:request:lsp
|^
?+ method [%unknown jon]
%text-document--hover (text-document--hover params id)
%text-document--completion (text-document--completion params id)
==
::
++ text-document--hover
|= [params=json id=cord]
^- text-document--hover:request:lsp
:+ %text-document--hover
id
%. params
%: ot
position+position
'textDocument'^text-document-id
~
==
::
++ text-document--completion
|= [params=json id=cord]
:+ %text-document--completion id
%. params
%: ot
position+position
'textDocument'^text-document-id
~
==
--
::
++ notification
|= jon=json
?> ?=([%o *] jon)
=/ method=cord
%- method
(trip (need (get-json-string:util p.jon 'method')))
=/ params=json
(~(got by p.jon) 'params')
^- all:notification:lsp
|^
?+ method [%unknown jon]
%text-document--did-change
(text-document--did-change params)
%text-document--did-open
(text-document--did-open params)
%text-document--did-save
(text-document--did-save params)
%text-document--did-close
(text-document--did-close params)
==
::
++ text-document--did-save
|= jon=json
^- text-document--did-save:notification:lsp
?> ?=([%o *] jon)
=/ doc-id
(~(got by p.jon) 'textDocument')
:- %text-document--did-save
(text-document-id doc-id)
::
++ text-document--did-close
|= jon=json
^- text-document--did-close:notification:lsp
?> ?=([%o *] jon)
=/ doc-id
(~(got by p.jon) 'textDocument')
:- %text-document--did-close
(text-document-id doc-id)
::
++ text-document--did-change
|= jon=json
^- text-document--did-change:notification:lsp
:- %text-document--did-change
%. jon
%: ot
'textDocument'^text-document-id
'contentChanges'^text-document-changes
~
==
::
++ text-document--did-open
|= jon=json
^- text-document--did-open:notification:lsp
?> ?=([%o *] jon)
:- %text-document--did-open
(text-document-item (~(got by p.jon) 'textDocument'))
--
:: Utilities
::
++ text-document-item
|= jon=json
^- text-document-item:lsp
%. jon
%: ot
uri+so
version+(mu ni)
text+so
~
==
::
++ text-document-id
%: ou
uri+(un so)
version+(uf ~ (pe ~ ni))
~
==
::
++ text-document-changes
%- ar
%: ou
range+(uf ~ (pe ~ range))
'rangeLength'^(uf ~ (pe ~ ni))
text+(un so)
~
==
::
++ method
|= =tape
^- cord
%- crip %- zing
%+ join "--"
^- (list ^tape)
%+ turn
^- (list (list ^tape))
%+ scan
tape
%+ more
fas
;~ plug
(star low)
(star ;~(plug (cook |=(a=@ (add a 32)) hig) (star low)))
==
|= words=(list ^tape)
^- ^tape
(zing (join "-" words))
::
++ range
%: ot
start+position
end+position
~
==
::
++ position
%: ot
line+ni
character+ni
~
==
--
::
++ enjs
=, enjs:format
|%
++ text-document--publish-diagnostics
|= pub=text-document--publish-diagnostics:notification:lsp
^- json
%: pairs
uri+s+uri.pub
diagnostics+a+(turn diagnostics.pub diagnostic)
~
==
++ notification
|= notification=all:notification:lsp
^- json
=/ params=json
?+ -.notification !!
%text-document--publish-diagnostics
(text-document--publish-diagnostics notification)
==
~! -.notification
=/ method=cord (crip (unparse-method -.notification))
%: pairs
method+s+method
params+params
~
==
::
++ response
|= res=all:response:lsp
^- json
|^
?- -.res
%text-document--hover (text-document--hover res)
%text-document--completion (text-document--completion res)
==
::
++ wrap-in-id
|= [id=cord res=json]
%: pairs
id+s+id
result+res
~
==
++ text-document--hover
|= hov=text-document--hover:response:lsp
%+ wrap-in-id id.hov
%+ frond 'contents'
?~ contents.hov
~
s+u.contents.hov
::
++ text-document--completion
|= com=text-document--completion:response:lsp
%+ wrap-in-id id.com
[%a (turn completion.com completion-item)]
--
++ unparse-method
|= =cord
^- ^tape
%+ rash cord
%+ cook |=(l=(list ^tape) (zing (join "/" l)))
%+ more (jest '--')
%+ cook
|= tapes=(list ^tape)
^- ^tape
?~ tapes ~
%- zing
:- i.tapes
%+ turn t.tapes
|= t=^tape
^- ^tape
?~ t ~
[`@tD`(sub i.t 32) t.t]
%+ more
;~(less (jest '--') hep)
(star alf)
::
++ completion-item
|= com=completion-item:lsp
^- json
%: pairs
label+s+label.com
detail+s+detail.com
kind+(numb kind.com)
'documentation'^s+doc.com
'insertText'^s+insert-text.com
'insertTextFormat'^(numb insert-text-format.com)
~
==
::
++ position
|= =position:lsp
^- json
%: pairs
line+(numb row.position)
character+(numb col.position)
~
==
::
++ range
|= =range:lsp
^- json
%: pairs
start+(position start.range)
end+(position end.range)
~
==
::
++ diagnostic
|= diag=diagnostic:lsp
^- json
%: pairs
range+(range range.diag)
severity+(numb severity.diag)
message+s+message.diag
~
==
::
--
--

View File

@ -1,3 +1,5 @@
/- lsp-sur=language-server
/+ auto=language-server-complete
=>
|%
++ snippet
@ -11,37 +13,36 @@
==
::
++ runes
^~
%- malt
:~ :- "|$"
^- (list (option:auto tape))
:~ :- '|$'
"""
$\{1:sample}
$\{2:body}
"""
:- "|_"
:- '|_'
"""
$\{1:sample}
++ $\{2:arm}
$\{3:body}
--
"""
:- "|:"
:- '|:'
"""
$\{1:sample}
$\{2:body}
"""
:- "|%"
:- '|%'
"""
++ $\{1:arm}
$\{2:body}
--
"""
:- "|."
:- '|.'
"""
$\{1:body}
"""
:- "|^"
:- '|^'
"""
$\{1:body}
@ -50,492 +51,486 @@
$\{3:body}
--
"""
:- "|-"
:- '|-'
"""
$\{1:body}
"""
:- "|~"
:- '|~'
"""
$\{1:sample}
$\{2:body}
"""
:- "|*"
:- '|*'
"""
$\{1:sample}
$\{2:body}
"""
:- "|="
:- '|='
"""
$\{1:sample}
$\{2:body}
"""
:- "|@"
:- '|@'
"""
++ $\{1:arm}
$\{2:body}
--
"""
:- "|?"
:- '|?'
"""
$\{1:sample}
"""
::
:- ":_"
:- ':_'
"""
$\{1:tail}
$\{2:head}
"""
:- ":^"
:- ':^'
"""
$\{1:car}
$\{2:cadr}
$\{3:caddr}
$\{4:cddr}
"""
:- ":-"
:- ':-'
"""
$\{1:tail}
$\{2:head}
"""
:- ":+"
:- ':+'
"""
$\{1:car}
$\{2:cadr}
$\{3:cddr}
"""
:- ":~"
:- ':~'
"""
$\{1:item}
==
"""
:- ":*"
:- ':*'
"""
$\{1:item}
==
"""
::
:- "%_"
:- '%_'
"""
$\{1:target}
$\{2:wing} $\{3:new-value}
$\{2:wing} $\{3:new-value}
==
"""
:- "%."
:- '%.'
"""
$\{1:arg}
$\{2:gate}
"""
:- "%-"
:- '%-'
"""
$\{1:gate}
$\{2:arg}
"""
:- "%:"
:- '%:'
"""
$\{1:gate}
$\{2:args}
==
"""
:- "%*"
:- '%*'
"""
$\{1:target-wing} $\{2:from}
$\{3:wing} $\{4:new-value}
$\{3:wing} $\{4:new-value}
==
"""
:- "%^"
:- '%^'
"""
$\{1:gate}
$\{2:arg1}
$\{3:arg2}
$\{4:arg3}
"""
:- "%+"
:- '%+'
"""
$\{1:gate}
$\{2:arg1}
$\{3:arg2}
"""
:- "%~"
:- '%~'
"""
$\{1:arm}
$\{2:core}
$\{3:arg}
"""
:- "%="
:- '%='
"""
$\{1:target}
$\{2:wing} $\{3:new-value}
$\{2:wing} $\{3:new-value}
==
"""
::
:- ".^"
:- '.^'
"""
$\{1:mold}
$\{2:path}
"""
:- ".+"
:- '.+'
"""
$\{1:atom}
"""
:- ".*"
:- '.*'
"""
$\{1:subject}
$\{2:formula}
"""
:- ".="
:- '.='
"""
$\{1:a}
$\{2:b}
"""
:- ".?"
:- '.?'
"""
$\{1:noun}
"""
::
:- "^|"
:- '^|'
"""
$\{1:iron-core}
"""
:- "^%"
:- '^%'
"""
$\{1:body}
"""
:- "^."
:- '^.'
"""
$\{1:a}
$\{2:b}
"""
:- "^+"
:- '^+'
"""
$\{1:like}
$\{2:body}
"""
:- "^-"
:- '^-'
"""
$\{1:type}
$\{2:body}
"""
:- "^&"
:- '^&'
"""
$\{1:zinc-core}
"""
:- "^~"
:- '^~'
"""
$\{1:constant}
"""
:- "^="
:- '^='
"""
$\{1:face}
$\{2:body}
"""
:- "^?"
:- '^?'
"""
$\{1:lead-core}
"""
:- "^*"
:- '^*'
"""
$\{1:type}
"""
:- "^:"
:- '^:'
"""
$\{1:type}
"""
::
:- "~|"
:- '~|'
"""
$\{1:trace}
$\{2:body}
"""
:- "~_"
:- '~_'
"""
$\{1:tank}
$\{2:body}
"""
:- "~%"
:- '~%'
"""
$\{1:name}
$\{2:parent}
~
$\{3:body}
"""
:- "~/"
:- '~/'
"""
$\{1:name}
$\{2:body}
"""
:- "~<"
:- '~<'
"""
$\{1:hint}
$\{2:body}
"""
:- "~>"
:- '~>'
"""
$\{1:hint}
$\{2:body}
"""
:- "~$"
:- '~$'
"""
$\{1:name}
$\{2:body}
"""
:- "~+"
:- '~+'
"""
$\{1:body}
"""
:- "~&"
:- '~&'
"""
$\{1:printf}
$\{2:body}
"""
:- "~="
:- '~='
"""
$\{1:a}
$\{2:b}
"""
:- "~?"
:- '~?'
"""
$\{1:condition}
$\{2:printf}
$\{3:body}
"""
:- "~!"
:- '~!'
"""
$\{1:type}
$\{2:body}
"""
::
:- ";="
:- ';='
"""
$\{1:manx}
==
"""
:- ";:"
:- ';:'
"""
$\{1:gate}
$\{2:args}
==
"""
:- ";/"
:- ';/'
"""
$\{1:tape}
"""
:- ";<"
:- ';<'
"""
$\{1:type} bind:m $\{2:body1}
$\{3:body2}
"""
:- ";~"
:- ';~'
"""
$\{1:gate}
$\{2:args}
==
"""
:- ";;"
:- ';;'
"""
$\{1:type}
$\{2:body}
"""
::
:- "=|"
:- '=|'
"""
$\{1:type}
$\{2:body}
"""
:- "=:"
:- '=:'
"""
$\{1:wing} $\{2:value}
==
$\{3:body}
"""
:- "=/"
:- '=/'
"""
$\{1:face}
$\{2:value}
$\{3:body}
"""
:- "=;"
:- '=;'
"""
$\{1:face}
$\{2:body}
$\{3:value}
"""
:- "=."
:- '=.'
"""
$\{1:wing}
$\{2:value}
$\{3:body}
"""
:- "=?"
:- '=?'
"""
$\{1:wing} $\{2:condition}
$\{3:value}
$\{4:body}
"""
:- "=<"
:- '=<'
"""
$\{1:formula}
$\{2:subject}
"""
:- "=-"
:- '=-'
"""
$\{1:body}
$\{2:value}
"""
:- "=>"
:- '=>'
"""
$\{1:subject}
$\{2:formula}
"""
:- "=^"
:- '=^'
"""
$\{1:face} $\{2:wing}
$\{3:computation}
$\{4:body}
"""
:- "=+"
:- '=+'
"""
$\{1:value}
$\{2:body}
"""
:- "=~"
:- '=~'
"""
$\{1:body}
"""
:- "=*"
:- '=*'
"""
$\{1:alias} $\{2:value}
$\{3:body}
"""
:- "=,"
:- '=,'
"""
$\{1:alias}
$\{3:body}
"""
::
:- "?|"
:- '?|'
"""
$\{1:condition}
==
"""
:- "?-"
:- '?-'
"""
$\{1:case}
$\{2:type} $\{3:value}
$\{2:type} $\{3:value}
==
"""
:- "?:"
:- '?:'
"""
$\{1:if}
$\{2:then}
$\{3:else}
"""
:- "?."
:- '?.'
"""
$\{1:if}
$\{2:else}
$\{3:then}
"""
:- "?^"
:- '?^'
"""
$\{1:value}
$\{2:if-cell}
$\{3:if-atom}
"""
:- "?<"
:- '?<'
"""
$\{1:assertion}
$\{2:body}
"""
:- "?>"
:- '?>'
"""
$\{1:assertion}
$\{2:body}
"""
:- "?+"
:- '?+'
"""
$\{1:case} $\{2:else}
$\{3:type} $\{4:value}
$\{1:case} $\{2:else}
$\{3:type} $\{4:value}
==
"""
:- "?&"
:- '?&'
"""
$\{1:condition}
==
"""
:- "?@"
:- '?@'
"""
$\{1:value}
$\{2:if-atom}
$\{3:if-cell}
"""
:- "?~"
:- '?~'
"""
$\{1:value}
$\{2:if-null}
$\{3:if-nonnull}
"""
:- "?#"
:- '?#'
"""
$\{1:skin}
$\{2:wing}
"""
:- "?="
:- '?='
"""
$\{1:type}
$\{2:wing}
"""
:- "?!"
:- '?!'
"""
$\{1:loobean}
"""
::
:- "!,"
:- '!,'
"""
*hoon
$\{1:ast}
"""
:- "!>"
:- '!>'
"""
$\{1:value}
"""
:- "!;"
:- '!;'
"""
$\{1:type}
$\{2:body}
"""
:- "!="
:- '!='
"""
$\{1:body}
"""
:- "!@"
:- '!@'
"""
$\{1:wing}
$\{2:if-exists}
$\{3:if-not-exists}
"""
:- "!?"
:- '!?'
"""
$\{1:version}
$\{2:body}
"""
:- "!!"
:- '!!'
""
==
--
|= rune=tape
=, enjs:format
^- json
%- pairs
:~ good+b+&
:- %result
%- pairs
:~ 'isIncomplete'^b+&
:- %items
:- %a :_ ~
~| [%unrecognized-rune rune]
%+ snippet
rune
(~(got by runes) rune)
== ==
^- (list completion-item:lsp-sur)
=? rune =(' ' (snag 0 rune))
(slag 1 rune)
~& rune
%+ turn (search-prefix:auto (crip rune) runes)
|= [name=cord snippet=tape]
^- completion-item:lsp-sur
[name 1 '' '' (crip snippet) 2]

View File

@ -49,9 +49,9 @@
[%http-response-header !>(response-header.simple-payload)]
=/ data-cage
[%http-response-data !>(data.simple-payload)]
:~ [%give %fact `/http-response/[eyre-id] header-cage]
[%give %fact `/http-response/[eyre-id] data-cage]
[%give %kick `/http-response/[eyre-id] ~]
:~ [%give %fact ~[/http-response/[eyre-id]] header-cage]
[%give %fact ~[/http-response/[eyre-id]] data-cage]
[%give %kick ~[/http-response/[eyre-id]] ~]
==
--
++ gen

View File

@ -83,7 +83,7 @@
++ wush
|= [wid=@u tan=tang]
^- tape
%- of-wall:format
%- of-wall:format
%+ turn (flop tan)
|= =tank
~! wid

View File

@ -4,7 +4,7 @@
++ grab
|%
++ noun chat-action
++ json
++ json
|= jon=^json
(json-to-action jon)
--

View File

@ -19,7 +19,7 @@
++ add-owned
%- ot
:~ [%path pa]
[%security sec]
[%security sec]
[%allow-history bo]
==
::

View File

@ -4,7 +4,7 @@
++ grab
|%
++ noun chat-view-action
++ json
++ json
|= jon=^json
(json-to-view-action jon)
--

View File

@ -4,7 +4,7 @@
++ grab
|%
++ noun invite-action
++ json
++ json
|= jon=^json
(json-to-action jon)
--

View File

@ -0,0 +1,16 @@
/- *language-server
/+ lsp-json=language-server-json
|_ not=all:notification
++ grab
|%
++ noun not
++ json
|= jon=^json
(notification:dejs:lsp-json jon)
--
++ grow
|%
++ json
(notification:enjs:lsp-json not)
--
--

View File

@ -0,0 +1,11 @@
/- *language-server
/+ lsp-json=language-server-json
|_ req=all:request
++ grab
|%
++ noun req
++ json
|= jon=^json
(request:dejs:lsp-json jon)
--
--

View File

@ -0,0 +1,15 @@
/- *language-server
/+ lsp=language-server-json
|_ res=all:response
::
++ grow
|%
++ json (response:enjs:lsp res)
--
::
++ grab
|%
++ noun all:response
--
::
--

View File

@ -4,7 +4,7 @@
++ grab
|%
++ noun permission-action
++ json
++ json
|= jon=^json
=< (parse-permission-action jon)
|%

View File

@ -4,7 +4,7 @@
++ grab
|%
++ noun permission-group-hook-action
++ json
++ json
|= jon=^json
(json-to-perm-group-hook-action jon)
--

View File

@ -43,10 +43,10 @@
:* %+ rash creator.txs
;~(pfix (jest 'creator: ~') fed:ag)
::
%+ rash collection.txs
%+ rash collection.txs
;~(pfix (jest 'collection: ') (cook crip (star next)))
::
%+ rash post.txs
%+ rash post.txs
;~(pfix (jest 'post: ') (cook crip (star next)))
::
%+ rash date-created.txs

View File

@ -46,10 +46,10 @@
:* %+ rash owner.txs
;~(pfix (jest 'owner: ~') fed:ag)
::
%+ rash title.txs
%+ rash title.txs
;~(pfix (jest 'title: ') (cook crip (star next)))
::
%+ rash filename.txs
%+ rash filename.txs
;~(pfix (jest 'filename: ') (cook crip (star next)))
::
%+ rash comments.txs

View File

@ -13,14 +13,14 @@
%+ frond -.rum
?- -.rum
%collection
%- pairs
%- pairs
:~ [%coll s+col.rum]
[%who (ship who.rum)]
[%data (collection-build-to-json dat.rum)]
==
::
%post
%- pairs
%- pairs
:~ [%coll s+col.rum]
[%post s+pos.rum]
[%who (ship who.rum)]
@ -28,7 +28,7 @@
==
::
%comments
%- pairs
%- pairs
:~ [%coll s+col.rum]
[%post s+pos.rum]
[%who (ship who.rum)]

View File

@ -23,7 +23,7 @@
|- ^- {rem/@u res/marl}
?~ mal [lim ~]
?~ lim [0 ~]
=+ ^- {lam/@u hed/manx}
=/ {lam/@u hed/manx}
?: ?=(_;/(**) i.mal)
[lim ;/(tay)]:(deword lim v.i.a.g.i.mal)
[rem ele(c res)]:[ele=i.mal $(mal c.i.mal)]

View File

@ -119,7 +119,7 @@
[i.bob $(ali t.ali, bob t.bob)]
?: (gth p.i.ali (lent p.i.bob))
[i.bob $(p.i.ali (sub p.i.ali (lent p.i.bob)), bob t.bob)]
=+ ^- {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
=/ {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
(resolve ali bob)
[fic $(ali ali, bob bob)]
:: ~ :: here, alice is good for a while, but not for the whole
@ -128,7 +128,7 @@
%|
?- -.i.bob
%|
=+ ^- {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
=/ {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
(resolve ali bob)
[fic $(ali ali, bob bob)]
::
@ -137,7 +137,7 @@
[i.ali $(ali t.ali, bob t.bob)]
?: (gth p.i.bob (lent p.i.ali))
[i.ali $(ali t.ali, p.i.bob (sub p.i.bob (lent p.i.ali)))]
=+ ^- {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
=/ {fic/(unce cord) ali/(urge cord) bob/(urge cord)}
(resolve ali bob)
[fic $(ali ali, bob bob)]
==

View File

@ -2,7 +2,7 @@
/+ publish
/= result
/^ (list comment:publish)
/;
/;
|= comments=(map knot comment:publish)
^- (list [comment-info:publish @t])
%+ sort ~(val by comments)

View File

@ -3,7 +3,7 @@
/= args /$ ,[beam *]
/= result
/^ [post-info:publish manx @t]
/;
/;
|= $: post-front=(map knot cord)
post-content=manx
post-raw=wain

View File

@ -5,7 +5,7 @@
:: if ship is foreign, delete any local
:: group at that path and mirror the
:: foreign group at our local path
::
::
[%remove =path] :: remove the path.
==
--

View File

@ -0,0 +1,114 @@
|%
::
+$ versioned-doc-id
[uri=@t version=(unit @)]
::
++ request
|%
+$ all
$%
text-document--hover
text-document--completion
unknown
==
+$ text-document--hover
[%text-document--hover id=cord position versioned-doc-id]
+$ text-document--completion
[%text-document--completion id=cord position versioned-doc-id]
+$ unknown
[%unknown json]
--
++ response
|%
+$ all
$%
text-document--hover
text-document--completion
==
+$ text-document--hover
[%text-document--hover id=cord contents=(unit @t)]
+$ text-document--completion
[%text-document--completion id=cord completion=(list completion-item)]
--
::
+$ completion-item
$:
label=cord
kind=@ud
detail=cord
doc=cord
insert-text=cord
insert-text-format=@ud
==
::
+$ diagnostic
[=range severity=@ud message=@t]
::
+$ position
[row=@ud col=@ud]
::
+$ text-document-item
[uri=@t version=(unit @) text=@t]
::
++ notification
|%
::
+$ in
$%
text-document--did-change
text-document--did-open
text-document--did-save
text-document--did-close
exit
unknown
==
::
+$ out
$%
text-document--publish-diagnostics
==
::
+$ all
$%
out
in
==
::
+$ text-document--did-change
[%text-document--did-change versioned-doc-id changes=(list change)]
::
+$ text-document--did-open
[%text-document--did-open text-document-item]
::
+$ text-document--did-save
[%text-document--did-save versioned-doc-id]
::
+$ text-document--did-close
[%text-document--did-close versioned-doc-id]
::
+$ exit
[%exit ~]
::
+$ unknown
[%unknown =json]
::
+$ text-document--publish-diagnostics
[%text-document--publish-diagnostics uri=@t diagnostics=(list diagnostic)]
::
--
::
+$ change
$: range=(unit range)
range-length=(unit @ud)
text=@t
==
::
+$ range
$: start=position
end=position
==
::
--

View File

@ -2238,7 +2238,7 @@
::
::
++ fl :: arb. precision fp
=+ ^- {{p/@u v/@s w/@u} r/$?($n $u $d $z $a) d/$?($d $f $i)}
=/ {{p/@u v/@s w/@u} r/$?($n $u $d $z $a) d/$?($d $f $i)}
[[113 -16.494 32.765] %n %d]
:: p=precision: number of bits in arithmetic form; must be at least 2
:: v=min exponent: minimum value of e
@ -4108,7 +4108,7 @@
::
++ fa :: base58check
=+ key='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
=+ ^- yek/@ux ~+
=/ yek/@ux ~+
=- yek:(roll (rip 3 key) -)
=+ [a=*char b=*@ yek=`@ux`(fil 3 256 0xff)]
|.
@ -7897,7 +7897,7 @@
::
|= gen/hoon
^- hoon
=+ ^- wing
=/ ,wing
?: =(1 dom)
hay
(weld hay `wing`[[%& dom] ~])
@ -9869,7 +9869,7 @@
?~ fid ~
?: ?=({%| %& *} fid)
$(q.zot t.q.zot, p.heg p.p.fid)
=+ ^- vat/(pair type nock)
=/ vat/(pair type nock)
?- -.fid
%& (fine %& p.fid)
%| (fine %| p.p.fid)
@ -14254,6 +14254,7 @@
[%name term %spec spec %base %noun]
wyde
==
::
%+ cook
|= [=term =(unit spec)]
^- skin
@ -14265,6 +14266,12 @@
::
(punt ;~(pfix ;~(pose net tis) wyde))
==
::
%+ cook
|= =spec
^- skin
[%spec spec %base %noun]
wyde
==
++ tall :: full tall form
%+ knee *hoon

View File

@ -1,55 +1,89 @@
:: Ames extends Arvo's %pass/%give move semantics across the network.
::
:: A "forward flow" message, which is like a request, is passed to
:: Ames from a local vane. Ames transmits the message to the peer's
:: Ames, which passes the message to the destination vane.
:: Ames receives packets as Arvo events and emits packets as Arvo
:: effects. The runtime is responsible for transferring the bytes in
:: an Ames packet across a physical network to another ship.
::
:: Once the peer has processed the "forward flow" message, it sends a
:: message acknowledgment over the wire back to the local Ames. This
:: ack can either be positive or negative, in which case we call it a
:: "nack". (Don't confuse Ames nacks with TCP nacks, which are a
:: different concept).
:: The runtime tells Ames which physical address a packet came from,
:: represented as an opaque atom. Ames can emit a packet effect to
:: one of those opaque atoms or to the Urbit address of a galaxy
:: (root node), which the runtime is responsible for translating to a
:: physical address. One runtime implementation sends UDP packets
:: using IPv4 addresses for ships and DNS lookups for galaxies, but
:: other implementations may overlay over other kinds of networks.
::
:: When the local Ames receives either a positive message ack or a
:: combination of a nack and nack-trace (explained in more detail
:: A local vane can pass Ames a %plea request message. Ames
:: transmits the message over the wire to the peer ship's Ames, which
:: passes the message to the destination vane.
::
:: Once the peer has processed the %plea message, it sends a
:: message-acknowledgment packet over the wire back to the local
:: Ames. This ack can either be positive to indicate the request was
:: processed, or negative to indicate the request failed, in which
:: case it's called a "nack". (Don't confuse Ames nacks with TCP
:: nacks, which are a different concept).
::
:: When the local Ames receives either a positive message-ack or a
:: combination of a nack and naxplanation (explained in more detail
:: below), it gives an %done move to the local vane that had
:: requested the original "forward flow" message be sent.
:: requested the original %plea message be sent.
::
:: A "backward flow" message, which is similar to a response or a
:: subscription update, is given to Ames from a local vane. Ames
:: transmits the message to the peer's Ames, which gives the message
:: to the destination vane.
:: A local vane can give Ames zero or more %boon response messages in
:: response to a %plea, on the same duct that Ames used to pass the
:: %plea to the vane. Ames transmits a %boon over the wire to the
:: peer's Ames, which gives it to the destination vane on the same
:: duct the vane had used to pass the original %plea to Ames.
::
:: Ames will give a %memo to a vane upon hearing the message from a
:: remote. This message is a "backward flow" message, forming one of
:: potentially many responses to a "forward flow" message that a
:: local vane had passed to our local Ames, and which local Ames had
:: relayed to the remote. Ames gives the %memo on the same duct the
:: local vane had originally used to pass Ames the "forward flow"
:: message.
:: %boon messages are acked automatically by the receiver Ames. They
:: cannot be nacked, and Ames only uses the ack internally, without
:: notifying the client vane that gave Ames the %boon.
::
:: Backward flow messages are acked automatically by the receiver.
:: They cannot be nacked, and Ames only uses the ack internally,
:: without notifying the client vane.
:: If the Arvo event that completed receipt of a %boon message
:: crashes, Ames instead sends the client vane a %lost message
:: indicating the %boon was missed.
::
:: Forward flow messages can be nacked, in which case the peer will
:: send both a message-nack packet and a nack-trace message, which is
:: sent on a special diagnostic flow so as not to interfere with
:: normal operation. The nack-trace is sent as a full Ames message,
:: instead of just a packet, because the contained error information
:: can be arbitrarily large.
:: %plea messages can be nacked, in which case the peer will send
:: both a message-nack packet and a naxplanation message, which is
:: sent in a way that does not interfere with normal operation. The
:: naxplanation is sent as a full Ames message, instead of just a
:: packet, because the contained error information can be arbitrarily
:: large. A naxplanation can only give rise to a positive ack --
:: never ack an ack, and never nack a naxplanation.
::
:: Once the local Ames has received the nack-trace, it knows the peer
:: has received the full message and failed to process it. This
:: means if we later hear an ack packet on the failed message, we can
:: ignore it.
:: Ames guarantees a total ordering of messages within a "flow",
:: identified in other vanes by a duct and over the wire by a "bone":
:: an opaque number. Each flow has a FIFO queue of %plea requests
:: from the requesting ship to the responding ship and a FIFO queue
:: of %boon's in the other direction.
::
:: Also, due to Ames's exactly-once delivery semantics, we know that
:: when we receive a nack-trace for message n, we know the peer has
:: positively acked all messages m+1 through n-1, where m is the last
:: message for which we heard a nack-trace. If we haven't heard acks
:: on all those messages, we apply positive acks when we hear the
:: nack-trace.
:: Message order across flows is not specified and may vary based on
:: network conditions.
::
:: Ames guarantees that a message will only be delivered once to the
:: destination vane.
::
:: Ames encrypts every message using symmetric-key encryption by
:: performing an elliptic curve Diffie-Hellman using our private key
:: and the public key of the peer. For ships in the Jael PKI
:: (public-key infrastructure), Ames looks up the peer's public key
:: from Jael. Comets (128-bit ephemeral addresses) are not
:: cryptographic assets and must self-attest over Ames by sending a
:: single self-signed packet containing their public key.
::
:: When a peer suffers a continuity breach, Ames removes all
:: messaging state related to it. Ames does not guarantee that all
:: messages will be fully delivered to the now-stale peer. From
:: Ames's perspective, the newly restarted peer is a new ship.
:: Ames's guarantees are not maintained across a breach.
::
:: A vane can pass Ames a %heed $task to request Ames track a peer's
:: responsiveness. If our %boon's to it start backing up locally,
:: Ames will give a %clog back to the requesting vane containing the
:: unresponsive peer's urbit address. This interaction does not use
:: ducts as unique keys. Stop tracking a peer by sending Ames a
:: %jilt $task.
::
:: Debug output can be adjusted using %sift and %spew $task's.
::
:: protocol-version: current version of the ames wire protocol
::
@ -530,7 +564,15 @@
:: The first bone is 0. They increment by 4, since each flow includes
:: a bit for each message determining forward vs. backward and a
:: second bit for whether the message is on the normal flow or the
:: associated diagnostic flow (for nack-traces).
:: associated diagnostic flow (for naxplanations).
::
:: The least significant bit of a $bone is:
:: 1 if "forward", i.e. we send %plea's on this flow, or
:: 0 if "backward", i.e. we receive %plea's on this flow.
::
:: The second-least significant bit is 1 if the bone is a
:: naxplanation bone, and 0 otherwise. Only naxplanation
:: messages can be sent on a naxplanation bone, as %boon's.
::
+$ ossuary
$: =next=bone
@ -542,43 +584,40 @@
:: Messages queue up in |message-pump's .unsent-messages until they
:: can be packetized and fed into |packet-pump for sending. When we
:: pop a message off .unsent-messages, we push as many fragments as
:: we can into |packet-pump, then place the remaining in
:: .unsent-fragments.
:: we can into |packet-pump, which sends every packet it eats.
:: Packets rejected by |packet-pump are placed in .unsent-fragments.
::
:: When we hear a packet ack, we send it to |packet-pump. If we
:: haven't seen it before, |packet-pump reports the fresh ack.
:: When we hear a packet ack, we send it to |packet-pump to be
:: removed from its queue of unacked packets.
::
:: When we hear a message ack (positive or negative), we treat that
:: as though all fragments have been acked. If this message is not
:: .current, then it's a future message and .current has not yet been
:: acked, so we place the ack in .queued-message-acks.
:: .current, then this ack is for a future message and .current has
:: not yet been acked, so we place the ack in .queued-message-acks.
::
:: If we hear a message ack before we've sent all the
:: fragments for that message, clear .unsent-fragments. If the
:: message ack was positive, print it out because it indicates the
:: peer is not behaving properly.
:: If we hear a message ack before we've sent all the fragments for
:: that message, clear .unsent-fragments and have |packet-pump delete
:: all sent fragments from the message. If this early message ack was
:: positive, print it out because it indicates the peer is not
:: behaving properly.
::
:: If the ack is for the current message, emit the message ack,
:: increment .current, and check if this next message is in
:: .queued-message-acks. If it is, emit the message (n)ack,
:: increment .current, and check the next message. Repeat until
:: .current is not fully acked.
::
:: When we hear a message nack, we send it to |packet-pump, which
:: deletes all packets from that message. If .current gets nacked,
:: clear .unsent-fragments and go into the same flow as when we hear
:: the last packet ack on a message.
:: If the ack is for the current message, have |packet-pump delete
:: all packets from the message, give the message ack back
:: to the client vane, increment .current, and check if this next
:: message is in .queued-message-acks. If it is, emit the message
:: (n)ack, increment .current, and check the next message. Repeat
:: until .current is not fully acked.
::
:: The following equation is always true:
:: .next - .current == number of messages in flight
::
:: At the end of a task, |message-pump sends a %halt task to
:: |packet-pump, which can trigger a timer to be set or cleared based
:: on congestion control calculations. When it fires, the timer will
:: generally cause one or more packets to be resent.
:: on congestion control calculations. When the timer fires, it will
:: generally cause a packet to be re-sent.
::
:: Message sequence numbers start at 1 so the first message will be
:: greater than .last-acked.message-sink-state on the receiver.
:: Message sequence numbers start at 1 so that the first message will
:: be greater than .last-acked.message-sink-state on the receiver.
::
:: current: sequence number of earliest message sent or being sent
:: next: sequence number of next message to send
@ -618,7 +657,14 @@
:: algorithm. The information signals and their responses are
:: identical to those of the "NewReno" variant of Reno; the
:: implementation differs because Ames acknowledgments differ from
:: TCP's and because we're using functional data structures.
:: TCP's, because this code uses functional data structures, and
:: because TCP's sequence numbers reset when a peer becomes
:: unresponsive, whereas Ames sequence numbers only change when a
:: ship breaches.
::
:: A deviation from Reno is +fast-resend-after-ack, which re-sends
:: timed-out packets when a peer starts responding again after a
:: period of unresponsiveness.
::
:: If .skips reaches 3, we perform a fast retransmit and fast
:: recovery. This corresponds to Reno's handling of "three duplicate
@ -697,8 +743,6 @@
==
:: $note: request to other vane
::
:: TODO: specialize gall interface for subscription management
::
:: Ames passes a %plea note to another vane when it receives a
:: message on a "forward flow" from a peer, originally passed from
:: one of the peer's vanes to the peer's Ames.
@ -729,13 +773,6 @@
== == ==
:: $sign: response from other vane
::
:: A vane gives a %boon sign to Ames on a duct on which it had
:: previously received a message on a "forward flow". Ames will
:: transmit the message to the peer that had originally sent the
:: message on the forward flow. The peer's Ames will then give the
:: message to the remote vane from which the forward flow message
:: originated.
::
+$ sign
$~ [%b %wake ~]
$% $: %b
@ -881,11 +918,7 @@
++ call
|= [=duct type=* wrapped-task=(hobo task)]
::
=/ =task
?. ?=(%soft -.wrapped-task)
wrapped-task
~| our^%ames-fail-soft
;;(task p.wrapped-task)
=/ =task ((harden task) wrapped-task)
:: %born: set .unix-duct and start draining .queued-events
::
?: ?=(%born -.task)
@ -1019,11 +1052,7 @@
|= [=duct type=* wrapped-task=(hobo task)]
^- [(list move) _ames-gate]
::
=/ =task
?. ?=(%soft -.wrapped-task)
wrapped-task
~| %ames-bad-task^p.wrapped-task
;;(task p.wrapped-task)
=/ =task ((harden task) wrapped-task)
::
=/ event-core (per-event [our now eny scry-gate] duct ames-state)
::
@ -1126,11 +1155,70 @@
--
:: +scry: dereference namespace
::
:: The ones producing vases are expected to be used like this:
::
:: &tang [(sell .^(vase %a /=peer=/~zod)) ~]
::
++ scry
|= [fur=(unit (set monk)) ren=@tas why=shop syd=desk lot=coin tyl=path]
^- (unit (unit cage))
?. =(lot [%$ %da now]) ~
?. =(%$ ren) [~ ~]
?. =([%& our] why)
[~ ~]
?+ syd ~
%peer
?. ?=([@ ~] tyl) [~ ~]
=/ who (slaw %p i.tyl)
?~ who [~ ~]
=/ per (~(get by peers.ames-state) u.who)
=/ res
?- per
~ %unknown
[~ %alien *] %alien
[~ %known *]
=, u.per
:* %known
symkeymug=(mug symmetric-key)
life=life
pubkey=public-key
sponsor=sponsor
route=route
qos=qos
ossuary=ossuary
snd=~(key by snd)
rcv=~(key by rcv)
nax=nax
heeds=heeds
==
==
``noun+!>(!>(res))
::
[~ ~]
%bones
?. ?=([@ ~] tyl) [~ ~]
=/ who (slaw %p i.tyl)
?~ who [~ ~]
=/ per (~(get by peers.ames-state) u.who)
?. ?=([~ %known *] per) [~ ~]
=/ res
=, u.per
[snd=~(key by snd) rcv=~(key by rcv)]
``noun+!>(res)
::
%snd-bone
?. ?=([@ @ ~] tyl) [~ ~]
=/ who (slaw %p i.tyl)
?~ who [~ ~]
=/ ost (slaw %ud i.t.tyl)
?~ ost [~ ~]
=/ per (~(get by peers.ames-state) u.who)
?. ?=([~ %known *] per) [~ ~]
=/ mps (~(get by snd.u.per) u.ost)
?~ mps [~ ~]
=/ res
u.mps
``noun+!>(!>(res))
==
--
:: helpers
::
@ -1381,10 +1469,15 @@
?> =(rcvr-life.shut-packet our-life.channel)
:: non-galaxy: update route with heard lane or forwarded lane
::
=? route.peer-state
?& !=(%czar (clan:title her.channel))
!=([~ %& *] route.peer-state)
==
=? route.peer-state
?: =(%czar (clan:title her.channel))
%.n
=/ is-old-direct=? ?=([~ %& *] route.peer-state)
=/ is-new-direct=? ?=(~ origin.packet)
:: old direct takes precedence over new indirect
::
|(is-new-direct !is-old-direct)
::
?~ origin.packet
`[direct=%.y lane]
`[direct=%.n u.origin.packet]
@ -1512,6 +1605,7 @@
::
:: Abandon all pretense of continuity and delete all messaging state
:: associated with .ship, including sent and unsent messages.
:: Also cancel all timers related to .ship.
::
++ on-publ-breach
|= =ship
@ -2053,7 +2147,11 @@
++ send-shut-packet
|= =shut-packet
^+ peer-core
:: swizzle bone just before sending; TODO document
:: swizzle last bone bit before sending
::
:: The peer has the opposite perspective from ours about what
:: kind of flow this is (forward/backward), so flip the bit
:: here.
::
=. bone.shut-packet (mix 1 bone.shut-packet)
::
@ -2201,7 +2299,7 @@
:: +on-sink-boon: handle response message received by |message-sink
::
:: .bone must be mapped in .ossuary.peer-state, or we crash.
:: This means a malformed message will kill a channel. We
:: This means a malformed message will kill a flow. We
:: could change this to a no-op if we had some sort of security
:: reporting.
::
@ -2491,7 +2589,7 @@
^+ message-pump
=/ top-live
(peek:packet-queue:*make-packet-pump live.packet-pump-state.state)
?. |(?=(~ top-live) (gte current.state message-num.key.u.top-live))
?. |(?=(~ top-live) (lte current.state message-num.key.u.top-live))
~| [%strange-current current=current.state key.u.top-live]
!!
message-pump
@ -2654,7 +2752,7 @@
:: +on-hear: handle ack on a live packet
::
:: If the packet was in our queue, delete it and update our
:: metrics. Otherwise, no-op.
:: metrics, possibly re-sending skipped packets. Otherwise, no-op.
::
++ on-hear
|= [=message-num =fragment-num]

View File

@ -251,10 +251,7 @@
==
^- [(list move) _behn-gate]
::
=/ =task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
;;(task:able p.wrapped-task)
=/ =task:able ((harden task:able) wrapped-task)
::
=/ event-core (per-event [our now hen] state)
::

View File

@ -44,12 +44,13 @@
::
:: Type of request.
::
:: %d produces a set of desks, %p gets file permissions, %u checks for
:: existence, %v produces a ++dome of all desk data, %w gets @ud and @da
:: variants for the given case, %x gets file contents, %y gets a directory
:: listing, and %z gets a recursive hash of the file contents and children.
:: %d produces a set of desks, %p gets file permissions, %t gets all paths
:: with the specified prefix, %u checks for existence, %v produces a ++dome
:: of all desk data, %w gets @ud and @da variants for the given case, %x
:: gets file contents, %y gets a directory listing, and %z gets a recursive
:: hash of the file contents and children.
::
:: ++ care ?($d $p $u $v $w $x $y $z)
:: ++ care ?($d $p $t $u $v $w $x $y $z)
::
:: Keeps track of subscribers.
::
@ -879,7 +880,7 @@
;< res=made-result:ford bind:m expect-ford
;< hashes=(map path lobe) bind:m
|= clad-input
=+ ^- cat/(list (pair path cage))
=/ cat=(list (pair path cage))
%+ turn (made-result-to-cages:util res)
|= {pax/cage cay/cage}
?. ?=($path p.pax)
@ -924,7 +925,7 @@
|= [wen=@da =dork]
=/ m (clad ,[=suba _this-cor])
^- form:m
=+ ^- sim=(list (pair path misu))
=/ sim=(list (pair path misu))
;: weld
^- (list (pair path misu))
(turn del.dork |=(pax/path [pax %del ~]))
@ -972,7 +973,7 @@
=/ message (made-result-as-error:ford res)
(clad-fail %checkout-fail leaf+"clay patch failed" message)
::
=+ ^- cat/(list (trel path lobe cage))
=/ cat/(list (trel path lobe cage))
%+ turn (made-result-to-cages:util res)
|= {pax/cage cay/cage}
?. ?=($path-hash p.pax)
@ -992,7 +993,7 @@
=+ must=(must-ergo:util our syd mon (turn suba head))
?: =(~ must)
(pure:m mim)
=+ ^- all-paths/(set path)
=/ all-paths/(set path)
%+ roll
(turn ~(tap by must) (corl tail tail))
|= {pak/(set path) acc/(set path)}
@ -2295,7 +2296,7 @@
|= [local=? disc=disc:ford pax=path lob=lobe]
^- schematic:ford
::
=+ ^- hat/(map path lobe)
=/ hat/(map path lobe)
?: =(let.dom 0)
~
q:(aeon-to-yaki let.dom)
@ -2631,7 +2632,7 @@
::
=* ruf |4.+6.^$
::
=+ ^- [mow=(list move) hun=(unit duct) rede]
=/ [mow=(list move) hun=(unit duct) rede]
?. =(our her)
:: no duct, foreign +rede or default
::
@ -2993,7 +2994,7 @@
++ start-request
|= [for=(unit ship) rav=rave]
^+ ..start-request
=+ ^- [new-sub=(unit rove) sub-results=(list sub-result)]
=/ [new-sub=(unit rove) sub-results=(list sub-result)]
(try-fill-sub for (rave-to-rove rav))
=. ..start-request (send-sub-results sub-results [hen ~ ~])
?~ new-sub
@ -3392,7 +3393,7 @@
:: drop forgotten roves
::
$(old-subs t.old-subs)
=+ ^- [new-sub=(unit rove) sub-results=(list sub-result)]
=/ [new-sub=(unit rove) sub-results=(list sub-result)]
(try-fill-sub wove.i.old-subs)
=. ..wake (send-sub-results sub-results ducts.i.old-subs)
=. new-subs
@ -3752,7 +3753,7 @@
|= {a/(unit tako) b/tako}
^- {(set yaki) (set plop)}
=+ old=?~(a ~ (reachable-takos:util u.a))
=+ ^- yal/(set tako)
=/ yal/(set tako)
%- silt
%+ skip
~(tap in (reachable-takos:util b))
@ -3890,12 +3891,18 @@
:: at any of its children.
::
++ read-u
|= {yon/aeon pax/path}
^- (unit (unit (each {$null (hypo ~)} lobe)))
=+ tak=(~(get by hit.dom) yon)
?~ tak
|= [yon=aeon pax=path]
^- (unit (unit (each [%flag (hypo ?)] lobe)))
:: if asked for a future version, we don't have an answer
::
?~ tak=(~(get by hit.dom) yon)
~
``[%& %null [%atom %n ~] ~]
:: look up the yaki snapshot based on the version
::
=/ yak=yaki (tako-to-yaki u.tak)
:: produce the result based on whether or not there's a file at :pax
::
``[%& %flag -:!>(*?) (~(has by q.yak) pax)]
::
:: Gets the dome (desk state) at a particular aeon.
::
@ -3977,7 +3984,7 @@
=+ yak=(tako-to-yaki u.tak)
=+ len=(lent pax)
:: ~& read-z+[yon=yon qyt=~(wyt by q.yak) pax=pax]
=+ ^- descendants/(list (pair path lobe))
=/ descendants/(list (pair path lobe))
:: ~& %turning
:: =- ~& %turned -
%+ turn
@ -4061,11 +4068,7 @@
==
^- [(list move) _..^$]
::
=/ req=task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
;;(task:able p.wrapped-task)
::
=/ req=task:able ((harden task:able) wrapped-task)
:: only one of these should be going at once, so queue
::
?: ?=(?(%info %merg %mont) -.req)
@ -4199,7 +4202,7 @@
=+ bem=(~(get by mon.ruf) des.req)
?: &(?=(~ bem) !=(%$ des.req))
~|([%bad-mount-point-from-unix des.req] !!)
=+ ^- bem/beam
=/ bem/beam
?^ bem
u.bem
[[our %base %ud 1] ~]
@ -4208,7 +4211,7 @@
!! :: fire next in queue
?: =(0 let.dom.u.dos)
=+ cos=(mode-to-soba ~ s.bem all.req fis.req)
=+ ^- [one=soba two=soba]
=/ [one=soba two=soba]
%+ skid cos
|= [a=path b=miso]
?& ?=(%ins -.b)
@ -4601,7 +4604,7 @@
~
=+ mad=(malt mod)
=+ len=(lent pax)
=+ ^- descendants/(list path)
=/ descendants/(list path)
%+ turn
%+ skim ~(tap by hat)
|= {paf/path lob/lobe}

View File

@ -516,10 +516,7 @@
wrapped-task=(hobo task:able)
==
^+ [*(list move) ..^$]
=/ task=task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
;;(task:able p.wrapped-task)
=/ task=task:able ((harden task:able) wrapped-task)
:: the boot event passes thru %dill for initial duct distribution
::
?: ?=(%boot -.task)

View File

@ -637,7 +637,7 @@
this.outstandingSubscriptions.set(
id,
{
err: connectionErrFunc,
err: connectionErrFunc,
event: eventFunc,
quit: quitFunc
}
@ -1985,11 +1985,7 @@
|= [=duct type=* wrapped-task=(hobo task:able)]
^- [(list move) _http-server-gate]
::
=/ task=task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
~| [%p-wrapped-task p.wrapped-task]
;;(task:able p.wrapped-task)
=/ task=task:able ((harden task:able) wrapped-task)
:: %crud: notifies us of an event failure
::
?: ?=(%crud -.task)

View File

@ -838,7 +838,9 @@
|* [tracker=(request-tracker) request=*]
^- (list duct)
::
~(tap in waiting:(~(got by tracker) request))
?~ val=(~(get by tracker) request)
~
~(tap in waiting.u.val)
:: +put-request: associates a +duct with a request
::
++ put-request
@ -1538,7 +1540,7 @@
::
|- ^+ state
::
=/ client-status=build-status (~(got by builds.state) build)
=/ client-status=build-status (got-build build)
=/ subs=(list ^build) ~(tap in ~(key by subs.client-status))
::
|- ^+ state
@ -1586,14 +1588,14 @@
|= [=build =anchor]
^+ builds.state
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
=/ subs=(list ^build) ~(tap in ~(key by subs.build-status))
=/ client=^build build
::
|- ^+ builds.state
?~ subs builds.state
::
=/ sub-status=^build-status (~(got by builds.state) i.subs)
=/ sub-status=^build-status (got-build i.subs)
::
=. clients.sub-status
(~(del ju clients.sub-status) anchor client)
@ -1612,7 +1614,7 @@
|= =build
^+ state
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
=/ new-anchors
~(tap in (~(put in ~(key by clients.build-status)) [%duct duct]))
=/ subs ~(tap in ~(key by subs.build-status))
@ -1642,14 +1644,14 @@
|= [=anchor =build]
^+ builds.state
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
=/ subs=(list ^build) ~(tap in ~(key by subs.build-status))
=/ client=^build build
::
|- ^+ builds.state
?~ subs builds.state
::
=/ sub-status=^build-status (~(got by builds.state) i.subs)
=/ sub-status=^build-status (got-build i.subs)
::
=/ already-had-anchor=? (~(has by clients.sub-status) anchor)
::
@ -1687,9 +1689,7 @@
++ copy-node
^+ state
::
=/ old-build-status=build-status
~| old-client=(build-to-tape old-client)
(~(got by builds.state) old-client)
=/ old-build-status=build-status (got-build old-client)
::
=/ old-subs=(list build) ~(tap in ~(key by subs.old-build-status))
=/ new-subs=(list build) (turn old-subs |=(a=build a(date new-date)))
@ -1837,7 +1837,7 @@
=. state (add-build build)
:: ignore blocked builds
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
?: ?=(%blocked -.state.build-status)
=. state (add-anchors-to-build-subs build)
::
@ -1887,10 +1887,7 @@
?~ old-build
(add-build-to-next build)
::
=/ old-build-status=^build-status
~| [%missing-old-build (build-to-tape u.old-build)]
~| [%build-state (turn ~(tap in ~(key by builds.state)) build-to-tape)]
(~(got by builds.state) u.old-build)
=/ old-build-status=^build-status (got-build u.old-build)
:: selectively promote scry builds
::
:: We can only promote a scry if it's not forced and we ran the same
@ -1918,7 +1915,7 @@
?. ?=([~ %value *] old-build-record)
(add-build-to-next build)
::
=. old-build-status (~(got by builds.state) u.old-build)
=. old-build-status (got-build u.old-build)
::
=/ old-subs=(list ^build) ~(tap in ~(key by subs.old-build-status))
=/ new-subs=(list ^build)
@ -5482,6 +5479,13 @@
::
::+| utilities
::
:: +got-build: lookup :build in state, asserting presence
::
++ got-build
|= =build
^- build-status
~| [%ford-missing-build build=(build-to-tape build) duct=duct]
(~(got by builds.state) build)
:: +add-build: store a fresh, unstarted build in the state
::
++ add-build
@ -5554,9 +5558,7 @@
|= [=build update-func=$-(build-status build-status)]
^- [build-status builds=_builds.state]
::
=/ original=build-status
~| [%update-build (build-to-tape build)]
(~(got by builds.state) build)
=/ original=build-status (got-build build)
=/ mutant=build-status (update-func original)
::
[mutant (~(put by builds.state) build mutant)]
@ -5615,9 +5617,7 @@
|= =build
^+ [unblocked builds.state]
::
=/ =build-status
~| [%unblocking (build-to-tape build)]
(~(got by builds.state) build)
=/ =build-status (got-build build)
::
=/ clients=(list ^build) ~(tap in (~(get ju clients.build-status) [%duct duct]))
::
@ -5661,7 +5661,7 @@
::
=/ duct-status (~(got by ducts.state) duct)
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
?: (~(has in requesters.build-status) [%duct duct])
(on-root-build-complete build)
::
@ -5698,7 +5698,7 @@
::
res
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
=/ =duct-status (~(got by ducts.state) duct)
:: make sure we have something to send
::
@ -5807,7 +5807,7 @@
|= =build
^+ ..execute
::
=/ =build-status (~(got by builds.state) build)
=/ =build-status (got-build build)
::
=/ orphans=(list ^build)
%+ murn ~(tap by subs.build-status)
@ -5817,6 +5817,11 @@
?: verified.build-relation
~
`sub
:: dequeue orphans in case we were about to run them
::
=/ orphan-set (~(gas in *(set ^build)) orphans)
=. next-builds (~(dif in next-builds) orphan-set)
=. candidate-builds (~(dif in candidate-builds) orphan-set)
:: remove links to orphans in :build's +build-status
::
=^ build-status builds.state
@ -5914,9 +5919,7 @@
?: ?=(%pin -.schematic.build)
~
::
=/ subs
~| [%collect-live-resource (build-to-tape build)]
~(tap in ~(key by subs:(~(got by builds.state) build)))
=/ subs ~(tap in ~(key by subs:(got-build build)))
=| resources=(jug disc resource)
|-
?~ subs
@ -5942,7 +5945,7 @@
:: only recurse on blocked sub-builds
::
=/ subs=(list ^build)
%+ murn ~(tap by subs:(~(got by builds.state) build))
%+ murn ~(tap by subs:(got-build build))
|= [sub=^build =build-relation]
^- (unit ^build)
::
@ -6108,6 +6111,7 @@
:: and a namespace function
::
|= [our=ship now=@da eny=@uvJ scry-gate=sley]
=* ford-gate .
:: allow jets to be registered within this core
::
~% %ford ..is ~
@ -6127,12 +6131,8 @@
++ call
|= [=duct type=* wrapped-task=(hobo task:able)]
^- [(list move) _ford-gate]
:: unwrap :task from :wrapped-task
::
=/ task=task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
;;(task:able p.wrapped-task)
=/ task=task:able ((harden task:able) wrapped-task)
:: we wrap +per-event with a call that binds our event args
::
=* this-event (per-event [our duct now scry-gate] state.ax)
@ -6265,22 +6265,29 @@
++ take-rebuilds
^- [(list move) ford-state]
::
~| [%ford-take-rebuilds wire=wire duct=duct]
?> ?=([@tas %wris *] sign)
=* case-sign p.sign
=* care-paths-sign q.sign
=+ [ship desk date]=(raid:wired t.wire ~[%p %tas %da])
=/ disc [ship desk]
:: ignore spurious clay updates
::
:: Due to asynchronicity of Clay notifications, we might get a
:: subscription update on an already-canceled duct. This is
:: normal; no-op.
::
?~ duct-status=(~(get by ducts.state.ax) duct)
[~ state.ax]
::
=/ =subscription
~| [%ford-take-bad-clay-sub wire=wire duct=duct]
=/ =duct-status (~(got by ducts.state.ax) duct)
?> ?=(%live -.live.duct-status)
?> ?=(^ last-sent.live.duct-status)
?> ?=(^ subscription.u.last-sent.live.duct-status)
u.subscription.u.last-sent.live.duct-status
?> ?=(%live -.live.u.duct-status)
(need subscription:(need last-sent.live.u.duct-status))
::
=/ ducts=(list ^duct)
~| [%ford-take-missing-subscription subscription]
:: sanity check; there must be at least one duct per subscription
::
=- ?<(=(~ -) -)
(get-request-ducts pending-subscriptions.state.ax subscription)
::
=| moves=(list move)
@ -6298,13 +6305,12 @@
++ take-unblocks
^- [(list move) ford-state]
::
~| [%ford-take-unblocks wire=wire duct=duct]
?> ?=([@tas %writ *] sign)
=* riot-sign p.sign
:: scry-request: the +scry-request we had previously blocked on
::
=/ =scry-request
~| [%ford-take-bad-scry-request wire=wire duct=duct]
(need (path-to-scry-request t.wire))
=/ =scry-request (need (path-to-scry-request t.wire))
:: scry-result: parse a (unit cage) from :sign
::
:: If the result is `~`, the requested resource was not available.
@ -6313,9 +6319,9 @@
?~ riot-sign
~
`r.u.riot-sign
:: if spurious Clay response, :ducts will be empty, causing no-op
::
=/ ducts=(list ^duct)
~| [%ford-take-missing-scry-request scry-request]
(get-request-ducts pending-scrys.state.ax scry-request)
::
=| moves=(list move)
@ -6332,12 +6338,16 @@
--
:: +load: migrate old state to new state (called on vane reload)
::
:: Trim builds completely in case a change to our code invalidated an
:: old build result.
::
++ load
|= old=axle
^+ ..^$
^+ ford-gate
::
~! %loading
..^$(ax old)
=. ax old
=. ford-gate +:(call ~[/ford-load-self] *type %trim 0)
ford-gate
:: +stay: produce current state
::
++ stay `axle`ax
@ -6346,9 +6356,4 @@
++ scry
|= *
[~ ~]
:: %utilities
::
::+|
::
++ ford-gate ..$
--

View File

@ -54,7 +54,7 @@
++ state
$: :: state version
::
%2
%3
:: agents by ship
::
=agents
@ -904,7 +904,7 @@
%give
=/ =gift:agent p.card
?: ?=(%kick -.gift)
=/ ducts=(list duct) (ap-ducts-from-path path.gift ship.gift)
=/ ducts=(list duct) (ap-ducts-from-paths paths.gift ship.gift)
%+ turn ducts
|= =duct
~? &(=(duct system-duct.agents.state) !=(agent-name %hood))
@ -914,7 +914,7 @@
?. ?=(%fact -.gift)
[agent-duct %give %unto gift]~
::
=/ ducts=(list duct) (ap-ducts-from-path path.gift ~)
=/ ducts=(list duct) (ap-ducts-from-paths paths.gift ~)
=/ =cage cage.gift
%+ turn ducts
|= =duct
@ -1010,6 +1010,17 @@
::
++ ap-agent-core
~(. agent.current-agent ap-construct-bowl)
:: +ap-ducts-from-paths: get ducts subscribed to paths
::
++ ap-ducts-from-paths
|= [target-paths=(list path) target-ship=(unit ship)]
^- (list duct)
?: &(?=(~ target-paths) ?=(~ target-ship))
~[agent-duct]
%- zing
%+ turn target-paths
|= =path
(ap-ducts-from-path `path target-ship)
:: +ap-ducts-from-path: get ducts subscribed to path
::
++ ap-ducts-from-path
@ -1465,12 +1476,7 @@
^- [(list move) _gall-payload]
::
~| [%gall-call-failed duct q.hic]
:: make sure our task is hard
::
=/ =task:able
?. ?=(%soft -.q.hic)
q.hic
;; task:able p.q.hic
=/ =task:able ((harden task:able) q.hic)
::
=/ initialised (mo-abed:mo duct)
?- -.task
@ -1567,16 +1573,177 @@
=? all-state ?=(%1 -.all-state)
(state-1-to-2 all-state)
::
?> ?=(%2 -.all-state)
=? all-state ?=(%2 -.all-state)
(state-2-to-3 all-state)
::
?> ?=(%3 -.all-state)
gall-payload(state all-state)
::
:: +all-state: upgrade path
::
++ all-state $%(state-0 state-1 ^state)
++ all-state $%(state-0 state-1 state-2 ^state)
::
++ state-2-to-3
|= =state-2
^- ^state
%= state-2
- %3
running.agents-2
%- ~(run by running.agents-2.state-2)
|= =running-agent-2
^- running-agent
%= running-agent-2
agent-2 (agent-2-to-3 agent-2.running-agent-2)
==
==
::
++ agent-2-to-3
|= =agent-2
^- agent
=> |%
++ cards-2-to-3
|= cards=(list card:^agent-2)
^- (list card:agent)
%+ turn cards
|= =card:^agent-2
^- card:agent
?. ?=([%give ?(%fact %kick) *] card) card
%=(card path.p (drop path.p.card))
--
|_ =bowl:gall
+* this .
pass ~(. agent-2 bowl)
++ on-init
=^ cards agent-2 on-init:pass
[(cards-2-to-3 cards) this]
::
++ on-save
on-save:pass
::
++ on-load
|= old-state=vase
=^ cards agent-2 (on-load:pass old-state)
[(cards-2-to-3 cards) this]
::
++ on-poke
|= [=mark =vase]
=^ cards agent-2 (on-poke:pass mark vase)
[(cards-2-to-3 cards) this]
::
++ on-watch
|= =path
=^ cards agent-2 (on-watch:pass path)
[(cards-2-to-3 cards) this]
::
++ on-leave
|= =path
=^ cards agent-2 (on-leave:pass path)
[(cards-2-to-3 cards) this]
::
++ on-peek
|= =path
(on-peek:pass path)
::
++ on-agent
|= [=wire =sign:agent:gall]
=^ cards agent-2 (on-agent:pass wire sign)
[(cards-2-to-3 cards) this]
::
++ on-arvo
|= [=wire =sign-arvo]
=^ cards agent-2 (on-arvo:pass wire sign-arvo)
[(cards-2-to-3 cards) this]
::
++ on-fail
|= [=term =tang]
=^ cards agent-2 (on-fail:pass term tang)
[(cards-2-to-3 cards) this]
--
::
++ state-2
$: %2
=agents-2
==
::
++ agents-2
$: system-duct=duct
outstanding=(map [wire duct] (qeu remote-request))
contacts=(set ship)
running=(map term running-agent-2)
blocked=(map term blocked)
==
::
++ running-agent-2
$: cache=worm
control-duct=duct
live=?
=stats
=subscribers
=agent-2
=beak
marks=(map duct mark)
==
::
++ agent-2
=< form
|%
+$ step (quip card form)
+$ card (wind note gift)
+$ note note:agent
+$ task task:agent
+$ sign sign:agent
+$ gift
$% [%fact path=(unit path) =cage]
[%kick path=(unit path) ship=(unit ship)]
[%watch-ack p=(unit tang)]
[%poke-ack p=(unit tang)]
==
++ form
$_ ^|
|_ bowl
++ on-init
*(quip card _^|(..on-init))
::
++ on-save
*vase
::
++ on-load
|~ old-state=vase
*(quip card _^|(..on-init))
::
++ on-poke
|~ [mark vase]
*(quip card _^|(..on-init))
::
++ on-watch
|~ path
*(quip card _^|(..on-init))
::
++ on-leave
|~ path
*(quip card _^|(..on-init))
::
++ on-peek
|~ path
*(unit (unit cage))
::
++ on-agent
|~ [wire sign]
*(quip card _^|(..on-init))
::
++ on-arvo
|~ [wire sign-arvo]
*(quip card _^|(..on-init))
::
++ on-fail
|~ [term tang]
*(quip card _^|(..on-init))
--
--
::
++ state-1-to-2
|= =state-1
^- ^state
^- state-2
%= state-1
- %2
+.agents-1 [~ +.agents-1.state-1]
@ -1590,7 +1757,7 @@
++ agents-1
$: system-duct=duct
contacts=(set ship)
running=(map term running-agent)
running=(map term running-agent-2)
blocked=(map term blocked)
==
::
@ -1602,7 +1769,7 @@
running.agents-0
%- ~(run by running.agents-0.state-0)
|= =running-agent-0
^- running-agent
^- running-agent-2
%= running-agent-0
agent-0 (agent-0-to-1 agent-0.running-agent-0)
==
@ -1610,7 +1777,7 @@
::
++ agent-0-to-1
|= =agent-0
^- agent
^- agent-2
|_ =bowl:gall
+* this .
pass ~(. agent-0 bowl)
@ -1692,7 +1859,7 @@
+$ card (wind note gift)
+$ note note:agent
+$ task task:agent
+$ gift gift:agent
+$ gift gift:agent-2
+$ sign sign:agent
++ form
$_ ^|

View File

@ -306,11 +306,7 @@
|= [=duct type=* wrapped-task=(hobo task:able)]
^- [(list move) _light-gate]
::
=/ task=task:able
?. ?=(%soft -.wrapped-task)
wrapped-task
~| [%p-wrapped-task p.wrapped-task]
;;(task:able p.wrapped-task)
=/ task=task:able ((harden task:able) wrapped-task)
:: %crud: notifies us of an event failure
::
?: ?=(%crud -.task)

View File

@ -968,10 +968,7 @@
hic/(hypo (hobo task:able))
==
^- [(list move) _..^$]
=/ =task:able
?. ?=($soft -.q.hic)
q.hic
(task:able p.q.hic)
=/ =task:able ((harden task:able) q.hic)
=^ did lex
abet:(~(call of [our now eny] lex) hen task)
[did ..^$]

File diff suppressed because it is too large Load Diff

View File

@ -1887,8 +1887,8 @@
[%poke-as =mark =cage]
==
+$ gift
$% [%fact path=(unit path) =cage]
[%kick path=(unit path) ship=(unit ship)]
$% [%fact paths=(list path) =cage]
[%kick paths=(list path) ship=(unit ship)]
[%watch-ack p=(unit tang)]
[%poke-ack p=(unit tang)]
==
@ -4946,7 +4946,7 @@
$(rob (put-word rob col -), sin +(sin))
::
:: c1, c2: prns for picking reference block
=+ ^- [c1=@ c2=@] ::TODO =/ w/o face
=/ [c1=@ c2=@]
?: do-i (snag sin rands)
=+ =- (snag - rob)
?: =(0 col) (dec columns)
@ -6632,7 +6632,7 @@
[~ ~]
?^ t.rax
[p.pok [ire q.pok]]:[pok=$(rax t.rax) ire=i.rax]
=+ ^- raf/(like term)
=/ raf/(like term)
=> |=(a/@ ((sand %tas) (crip (flop (trip a)))))
(;~(sfix (sear . sym) dot) [1^1 (flop (trip i.rax))])
?~ q.raf
@ -7814,7 +7814,7 @@
~? ?=(~ mined.log) %processing-unmined-event
::
?: =(i.topics.log owner-changed)
=+ ^- [who=@ wer=address]
=/ [who=@ wer=address]
(decode-topics t.topics.log ~[%uint %address])
`[who %owner wer]
::
@ -7824,12 +7824,12 @@
`[who %activated who]
::
?: =(i.topics.log spawned)
=+ ^- [pre=@ who=@]
=/ [pre=@ who=@]
(decode-topics t.topics.log ~[%uint %uint])
`[pre %spawned who]
::
?: =(i.topics.log escape-requested)
=+ ^- [who=@ wer=@]
=/ [who=@ wer=@]
(decode-topics t.topics.log ~[%uint %uint])
`[who %escape `wer]
::
@ -7838,18 +7838,18 @@
`[who %escape ~]
::
?: =(i.topics.log escape-accepted)
=+ ^- [who=@ wer=@]
=/ [who=@ wer=@]
(decode-topics t.topics.log ~[%uint %uint])
`[who %sponsor & wer]
::
?: =(i.topics.log lost-sponsor)
=+ ^- [who=@ pos=@]
=/ [who=@ pos=@]
(decode-topics t.topics.log ~[%uint %uint])
`[who %sponsor | pos]
::
?: =(i.topics.log changed-keys)
=/ who=@ (decode-topics t.topics.log ~[%uint])
=+ ^- [enc=octs aut=octs sut=@ud rev=@ud]
=/ [enc=octs aut=octs sut=@ud rev=@ud]
%+ decode-results data.log
~[[%bytes-n 32] [%bytes-n 32] %uint %uint]
`[who %keys rev (pass-from-eth enc aut sut)]
@ -7860,22 +7860,22 @@
`[who %continuity num]
::
?: =(i.topics.log changed-management-proxy)
=+ ^- [who=@ sox=address]
=/ [who=@ sox=address]
(decode-topics t.topics.log ~[%uint %address])
`[who %management-proxy sox]
::
?: =(i.topics.log changed-voting-proxy)
=+ ^- [who=@ tox=address]
=/ [who=@ tox=address]
(decode-topics t.topics.log ~[%uint %address])
`[who %voting-proxy tox]
::
?: =(i.topics.log changed-spawn-proxy)
=+ ^- [who=@ sox=address]
=/ [who=@ sox=address]
(decode-topics t.topics.log ~[%uint %address])
`[who %spawn-proxy sox]
::
?: =(i.topics.log changed-transfer-proxy)
=+ ^- [who=@ tox=address]
=/ [who=@ tox=address]
(decode-topics t.topics.log ~[%uint %address])
`[who %transfer-proxy tox]
::
@ -8044,42 +8044,124 @@
$% [%l l=(list item)]
[%b b=byts]
==
:: +encode-atoms: encode list of atoms as a %l of %b items
::
:: treat atoms as list of items
++ encode-atoms
|= l=(list @)
^- @
%+ encode %l
%+ turn l
|=(a=@ b+[(met 3 a) a])
::
++ encode
|= in=item
^- @
?- -.in
%b
?: &(=(1 wid.b.in) (lth dat.b.in 0x80))
dat.b.in
%^ cat 3 dat.b.in
::TODO unsure if this should pass wid or (met 3 dat)...
(encode-length wid.b.in 0x80)
|^ ^- @
?- -.in
%b
?: &(=(1 wid.b.in) (lte dat.b.in 0x7f))
dat.b.in
=- (can 3 ~[b.in [(met 3 -) -]])
(encode-length wid.b.in 0x80)
::
%l
=/ out=@
%+ roll l.in
|= [ni=item en=@]
(cat 3 (encode ni) en)
%^ cat 3 out
(encode-length (met 3 out) 0xc0)
==
::
%l
=/ out=@
%+ roll l.in
|= [ni=item en=@]
(cat 3 (encode ni) en)
%^ cat 3 out
(encode-length (met 3 out) 0xc0)
==
++ encode-length
|= [len=@ off=@]
?: (lth len 56) (add len off)
=- (cat 3 len -)
:(add (met 3 len) off 55)
--
:: +decode-atoms: decode expecting a %l of %b items, producing atoms within
::
++ encode-length
|= [len=@ off=@]
?: (lth len 56) (add len off)
=- (cat 3 len -)
:(add (met 3 len) off 55)
::
::TODO decode
++ decode-atoms
|= dat=@
^- (list @)
=/ i=item (decode dat)
~| [%unexpected-data i]
?> ?=(%l -.i)
%+ turn l.i
|= i=item
~| [%unexpected-list i]
?> ?=(%b -.i)
dat.b.i
::
++ decode
|= dat=@
^- item
=/ bytes=(list @) (flop (rip 3 dat))
=? bytes ?=(~ bytes) ~[0]
|^ item:decode-head
::
++ decode-head
^- [done=@ud =item]
?~ bytes
~| %rlp-unexpected-end
!!
=* byt i.bytes
:: byte in 0x00-0x79 range encodes itself
::
?: (lte byt 0x79)
:- 1
[%b 1^byt]
:: byte in 0x80-0xb7 range encodes string length
::
?: (lte byt 0xb7)
=+ len=(sub byt 0x80)
:- +(len)
:- %b
len^(get-value 1 len)
:: byte in 0xb8-0xbf range encodes string length length
::
?: (lte byt 0xbf)
=+ led=(sub byt 0xb7)
=+ len=(get-value 1 led)
:- (add +(led) len)
:- %b
len^(get-value +(led) len)
:: byte in 0xc0-f7 range encodes list length
::
?: (lte byt 0xf7)
=+ len=(sub byt 0xc0)
:- +(len)
:- %l
%. len
decode-list(bytes (slag 1 `(list @)`bytes))
:: byte in 0xf8-ff range encodes list length length
::
?: (lte byt 0xff)
=+ led=(sub byt 0xf7)
=+ len=(get-value 1 led)
:- (add +(led) len)
:- %l
%. len
decode-list(bytes (slag +(led) `(list @)`bytes))
~| [%rip-not-bloq-3 `@ux`byt]
!!
::
++ decode-list
|= rem=@ud
^- (list item)
?: =(0 rem) ~
=+ ^- [don=@ud =item] ::TODO =/
decode-head
:- item
%= $
rem (sub rem don)
bytes (slag don bytes)
==
::
++ get-value
|= [at=@ud to=@ud]
^- @
(rep 3 (flop (swag [at to] bytes)))
--
--
::
:: abi en/decoding

Some files were not shown because too many files have changed in this diff Show More