mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-29 09:53:13 +03:00
Merge remote-tracking branch 'origin/v0.8.0.rc' into philip/kale
This commit is contained in:
commit
45360f8e3a
@ -92,16 +92,17 @@ source files that are denoted by comments and are actually indented one
|
||||
level.
|
||||
|
||||
Hoon will be a less familiar language to many contributors. More details are
|
||||
forthcoming; for now, the `%ford` vane (in [`sys/vane/ford.hoon`][ford]) is
|
||||
some of the highest quality code in the kernel.
|
||||
forthcoming; for now, the `%ford` vane (in
|
||||
[`pkg/arvo/sys/vane/ford.hoon`][ford]) is some of the highest quality code in
|
||||
the kernel.
|
||||
|
||||
[ford]: https://github.com/urbit/arvo/blob/master/sys/vane/ford.hoon
|
||||
[ford]: https://github.com/urbit/urbit/blob/master/pkg/arvo/sys/vane/ford.hoon
|
||||
|
||||
## Kernel development
|
||||
|
||||
Working on either C or non-kernel Hoon should not bring any surprises, but the
|
||||
Hoon kernel (anything under `sys/` in [urbit/arvo][arvo]) is bootstrapped from
|
||||
a so-called *pill*, and must be recompiled if any changes are made. This should
|
||||
Hoon kernel (anything under [`pkg/arvo/sys/`][sys]) is bootstrapped from a
|
||||
so-called *pill*, and must be recompiled if any changes are made. This should
|
||||
happen automatically when you make changes, but if it doesn't, the command to
|
||||
manually recompile and install the new kernel is `|reset` in `dojo`. This
|
||||
rebuilds from the `sys` directory in the `home` desk in `%clay`.
|
||||
@ -110,14 +111,15 @@ Currently, `|reset` does not reload apps like `dojo` itself, which will still
|
||||
reference the old kernel. To force them to reload, make a trivial edit to their
|
||||
main source file (under the `app` directory) in `%clay`.
|
||||
|
||||
[arvo]: https://github.com/urbit/arvo
|
||||
[arvo]: https://github.com/urbit/urbit/tree/master/pkg/arvo
|
||||
[sys]: https://github.com/urbit/urbit/tree/master/pkg/arvo/sys
|
||||
|
||||
## The kernel and pills
|
||||
|
||||
Urbit bootstraps itself using a binary blob called a pill (you can see it being
|
||||
fetched from `bootstrap.urbit.org` on boot). This is the compiled version of
|
||||
the kernel (which you can find in the `sys` directory of [urbit/arvo][arvo]),
|
||||
along with a complete copy of the `urbit/arvo` repository as source.
|
||||
the kernel (which you can find in the `sys` directory of [Arvo][arvo]), along
|
||||
with a complete copy of the Arvo source.
|
||||
|
||||
The procedure for creating a pill is often called "soliding." It is somewhat
|
||||
similar to `|reset`, but instead of replacing your running kernel, it writes
|
||||
@ -136,21 +138,31 @@ You can boot a new ship from your local pill with `-B`:
|
||||
$ urbit -F zod -B path/to/urbit.pill my-fake-zod
|
||||
```
|
||||
|
||||
Ordinarily, `https://bootstrap.urbit.org/latest.pill` will be updated
|
||||
to match whatever's on the HEAD of `master` in the `urbit/arvo` repository.
|
||||
Older pills are indexed by the first 10 characters of the `git` SHA1 of the
|
||||
relevant commit, i.e. as `git-[sha1].pill`. The continuous integration build
|
||||
of the `urbit/arvo` repository uploads these pills for any successful build of
|
||||
a commit or pull request that affects the `sys/` directory.
|
||||
Pills are cached at `https://bootstrap.urbit.org` and are indexed by the first
|
||||
10 characters of the `git` SHA1 of the relevant commit, i.e. as
|
||||
`git-[sha1].pill`. The continuous integration build uploads these pills for
|
||||
any successful build of a commit or pull request that affects the
|
||||
`pkg/arvo/sys/` directory.
|
||||
|
||||
You can boot from one of these pills by passing the path to an Arvo working
|
||||
copy with `-A` (and `-s` for *search*):
|
||||
|
||||
```
|
||||
$ git clone https://github.com/urbit/arvo
|
||||
$ urbit -F zod -A path/to/arvo -s my-fake-zod
|
||||
$ git clone https://github.com/urbit/urbit
|
||||
$ urbit -F zod -sA urbit/pkg/arvo -s my-fake-zod
|
||||
```
|
||||
|
||||
Pills are also cached in version control via [git LFS][git-lfs]. You can find
|
||||
the latest solid pill (as well as the latest so-called *brass* and *ivory*
|
||||
pills) in the `bin/` directory at the repository root:
|
||||
|
||||
```
|
||||
$ git lfs init
|
||||
$ git lfs pull
|
||||
```
|
||||
|
||||
[git-lfs]: https://git-lfs.github.com
|
||||
|
||||
## What to work on
|
||||
|
||||
If you are not thinking of contributing with a specific goal in mind, the
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:944f2731331e4bd7f28f9ce6c7669973306033954b75d3729164a199bd7fd037
|
||||
size 5356354
|
||||
oid sha256:e534cb57dc8b2bee35004d843c7e0b2d028ba699e86d47a58efac4b065ce2f1b
|
||||
size 6047224
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:847a5166d8d5106a0c909c914cc96ee6bcb47afef6ebdd6c05bebcd8b01ae87a
|
||||
size 5859838
|
||||
oid sha256:96b1f1ad730789b1d557aac66b847047c98341bcf436e1927f40f082a728d641
|
||||
size 3816083
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:63a265d1a1ead1dfa16df00d7259904045e9bc328ec0d88bd386cc7edefc107c
|
||||
size 8567769
|
||||
oid sha256:fe90d4e81ee2671519735e17661176cdf577492cae36bed4c407c832d25e5178
|
||||
size 8504341
|
||||
|
@ -12,6 +12,7 @@ crossenv.make_derivation rec {
|
||||
"--disable-shared"
|
||||
"--disable-manual"
|
||||
"--disable-ldap"
|
||||
"--with-ssl=${openssl}"
|
||||
];
|
||||
|
||||
src = crossenv.nixpkgs.fetchurl {
|
||||
|
@ -20,6 +20,8 @@ shutdown () {
|
||||
|
||||
trap shutdown EXIT
|
||||
|
||||
herb ./ship -p hood -d '+hood/mass'
|
||||
|
||||
# Start the test app
|
||||
herb ./ship -p hood -d '+hood/start %test'
|
||||
|
||||
@ -28,6 +30,8 @@ herb ./ship -d '~& ~ ~& %start-test-cores ~'
|
||||
herb ./ship -p test -d ':- %cores /'
|
||||
herb ./ship -d '~& %finish-test-cores ~'
|
||||
|
||||
herb ./ship -p hood -d '+hood/mass'
|
||||
|
||||
# Run the %renders tests
|
||||
herb ./ship -d '~& ~ ~& %start-test-renders ~'
|
||||
herb ./ship -p test -d ':- %renders /'
|
||||
@ -37,6 +41,8 @@ herb ./ship -d '~& %finish-test-renders ~'
|
||||
herb ./ship -d '+test, =seed `@uvI`(shaz %reproducible)' |
|
||||
tee test-generator-output
|
||||
|
||||
herb ./ship -p hood -d '+hood/mass'
|
||||
|
||||
shutdown
|
||||
|
||||
# Collect output
|
||||
|
@ -11,5 +11,5 @@ make all -j8
|
||||
make test
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp urbit $out/bin/$exename
|
||||
cp urbit-worker $out/bin/$exename-worker
|
||||
cp ./build/urbit $out/bin/$exename
|
||||
cp ./build/urbit-worker $out/bin/$exename-worker
|
||||
|
@ -11,7 +11,7 @@ let
|
||||
|
||||
deps =
|
||||
with pkgs;
|
||||
[ curl gmp libsigsegv ncurses openssl zlib lmdb ];
|
||||
[ curl gmp libsigsegv ncurses openssl zlib lmdb cacert xxd ];
|
||||
|
||||
vendor =
|
||||
[ argon2 softfloat3 ed25519 ent ge-additions h2o scrypt uv murmur3 secp256k1 sni ];
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ env_name, env, deps }:
|
||||
|
||||
{ ent, ge-additions, name ? "urbit", debug ? false }:
|
||||
{ ent, ge-additions, cacert, xxd, name ? "urbit", debug ? false }:
|
||||
|
||||
let
|
||||
|
||||
@ -21,10 +21,12 @@ env.make_derivation {
|
||||
CPU_DEBUG = debug;
|
||||
EVENT_TIME_DEBUG = false;
|
||||
NCURSES = env.ncurses;
|
||||
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
|
||||
name = "${name}-${env_name}";
|
||||
exename = name;
|
||||
src = ../../../pkg/urbit;
|
||||
cross_inputs = crossdeps ++ vendor ++ [ ent ];
|
||||
builder = ./release.sh;
|
||||
name = "${name}-${env_name}";
|
||||
exename = name;
|
||||
src = ../../../pkg/urbit;
|
||||
native_inputs = [ xxd ];
|
||||
cross_inputs = crossdeps ++ vendor ++ [ ent ];
|
||||
builder = ./release.sh;
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ PKG_CONFIG=pkg-config-cross \
|
||||
HOST=$host \
|
||||
bash ./configure
|
||||
|
||||
make urbit urbit-worker -j8
|
||||
make build/urbit build/urbit-worker -j8
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp -r $NCURSES/share/terminfo $out/bin/$exename-terminfo
|
||||
cp urbit $out/bin/$exename
|
||||
cp urbit-worker $out/bin/$exename-worker
|
||||
cp ./build/urbit $out/bin/$exename
|
||||
cp ./build/urbit-worker $out/bin/$exename-worker
|
||||
|
@ -21,7 +21,8 @@ let
|
||||
|
||||
urbit = env:
|
||||
import ./pkgs/urbit/release.nix env
|
||||
{ ent = ent env; ge-additions = ge-additions env; debug = false; name = "urbit"; };
|
||||
{ ent = ent env; ge-additions = ge-additions env; cacert = nixpkgs.cacert;
|
||||
xxd = nixpkgs.xxd; debug = false; name = "urbit"; };
|
||||
|
||||
builds-for-platform = plat:
|
||||
plat.deps // {
|
||||
|
@ -55,4 +55,3 @@ I would like to get to a place where any direct scrying of the filesystem is dis
|
||||
Implicit in having a standard way to write tests and a standard `+test` runner is the idea that all functionality on the current desk should be tested.
|
||||
|
||||
Let's say I'm shipping a program on Urbit and I use multiple third-party libraries. Each of those libraries should have their own test suites placed in `%/tests/`. When I `|merge` their desks into my application desk, having a standard test runner means that all their tests and all my application tests get run. If you're depending on a library, you want to make sure that the tests for your dependencies run when you test your application.
|
||||
|
@ -147,7 +147,7 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire =binding:eyre app=term]
|
||||
$% [%serve wire =binding:eyre =generator:eyre]
|
||||
[%http-response =http-event:http]
|
||||
[%poke wire dock poke]
|
||||
[%request wire request:http outbound-config:iris]
|
||||
@ -328,10 +328,13 @@
|
||||
rod=(unit order)
|
||||
:: next-order: queued domains for validation
|
||||
::
|
||||
next-order=(unit (map turf [idx=@ud valid=?]))
|
||||
next-order=(unit [try=@ud dom=(map turf [idx=@ud valid=?])])
|
||||
:: cey: certificate key XX move?
|
||||
::
|
||||
cey=key:rsa
|
||||
:: challenges: domain-validation challenge tokens
|
||||
::
|
||||
challenges=(set @t)
|
||||
==
|
||||
--
|
||||
::
|
||||
@ -522,7 +525,7 @@
|
||||
~| %validate-domain-effect-fail
|
||||
?. ?=(^ next-order) ~|(%no-next-order !!)
|
||||
=/ pending
|
||||
(skip ~(tap by u.next-order) |=([turf @ud valid=?] valid))
|
||||
(skip ~(tap by dom.u.next-order) |=([turf @ud valid=?] valid))
|
||||
?: =(~ pending)
|
||||
new-order:effect
|
||||
=/ next=[=turf idx=@ud valid=?]
|
||||
@ -582,7 +585,7 @@
|
||||
?. ?=(^ reg.act) ~|(%no-account !!)
|
||||
?. ?=(^ liv) ~|(%no-live-config !!)
|
||||
=< new-order:effect
|
||||
(queue-next-order & dom.u.liv)
|
||||
(queue-next-order 1 & dom.u.liv)
|
||||
:: +new-order: create a new certificate order
|
||||
::
|
||||
++ new-order
|
||||
@ -595,7 +598,7 @@
|
||||
:- %identifiers
|
||||
:- %a
|
||||
%+ turn
|
||||
~(tap in ~(key by `(map turf *)`u.next-order))
|
||||
~(tap in ~(key by `(map turf *)`dom.u.next-order))
|
||||
|=(a=turf [%o (my type+s+'dns' value+s+(en-turf:html a) ~)])
|
||||
==
|
||||
=/ wire-params [try %new-order /(scot %da now.bow)]
|
||||
@ -605,20 +608,19 @@
|
||||
++ cancel-order
|
||||
^+ this
|
||||
~| %cancel-order-effect-fail
|
||||
:: ?> ?=(^ rod)
|
||||
:: XX get failure reason
|
||||
::
|
||||
=/ try=@ud ?~(rod 1 try.u.rod)
|
||||
=* order ?>(?=(^ rod) u.rod) :: XX TMI
|
||||
:: backoff faster than usual
|
||||
::
|
||||
=/ lul=@dr (min ~h1 (backoff (add 4 try)))
|
||||
=/ lul=@dr (min ~h1 (backoff (add 5 try.order)))
|
||||
:: XX get failure reason
|
||||
::
|
||||
=/ msg=cord
|
||||
(cat 3 'retrying certificate request in ' (scot %dr lul))
|
||||
=. ..this (emit (notify msg ~))
|
||||
=. ..this (retry:effect try %new-order / lul)
|
||||
:: domains might already be validated
|
||||
::
|
||||
=. ..this (queue-next-order & ?>(?=(^ rod) dom.u.rod))
|
||||
=. ..this (queue-next-order +(try.order) & dom.order)
|
||||
cancel-current-order
|
||||
:: +finalize-order: finalize completed order
|
||||
::
|
||||
@ -753,13 +755,13 @@
|
||||
=/ idx (slav %ud i.t.wire)
|
||||
=/ valid |(=(200 p.rep) =(307 p.rep))
|
||||
=/ item=(list [=turf idx=@ud valid=?])
|
||||
(skim ~(tap by u.next-order) |=([turf idx=@ud ?] =(^idx idx)))
|
||||
(skim ~(tap by dom.u.next-order) |=([turf idx=@ud ?] =(^idx idx)))
|
||||
?. ?& ?=([^ ~] item)
|
||||
!valid.i.item
|
||||
==
|
||||
this
|
||||
=. u.next-order
|
||||
(~(put by u.next-order) turf.i.item [idx valid])
|
||||
=. dom.u.next-order
|
||||
(~(put by dom.u.next-order) turf.i.item [idx valid])
|
||||
?. valid
|
||||
?: (lth try 10)
|
||||
=/ lul=@dr (min ~h1 (backoff try))
|
||||
@ -773,7 +775,7 @@
|
||||
' via http at ' (en-turf:html turf.i.item) ':80'
|
||||
==
|
||||
(emit(next-order ~) (notify msg [(sell !>(rep)) ~]))
|
||||
?: ?=(~ (skip ~(val by u.next-order) |=([@ud valid=?] valid)))
|
||||
?: ?=(~ (skip ~(val by dom.u.next-order) |=([@ud valid=?] valid)))
|
||||
new-order:effect
|
||||
(validate-domain:effect +(idx))
|
||||
:: +directory: accept ACME service directory, trigger registration
|
||||
@ -860,12 +862,21 @@
|
||||
::
|
||||
=/ bod=order:body
|
||||
(order:grab (need (de-json:html q:(need r.rep))))
|
||||
=/ dom=(set turf) ~(key by u.next-order)
|
||||
=/ dom=(set turf) ~(key by dom.u.next-order)
|
||||
:: XX maybe generate key here?
|
||||
::
|
||||
=/ csr=@ux +:(en:der:pkcs10 cey ~(tap in dom))
|
||||
=/ dor=order
|
||||
[dom try=1 sas=%wake exp.bod ego (need fin.bod) cey csr [aut.bod ~ ~]]
|
||||
:* dom
|
||||
try.u.next-order
|
||||
sas=%wake
|
||||
exp.bod
|
||||
ego
|
||||
(need fin.bod)
|
||||
cey
|
||||
csr
|
||||
[aut.bod ~ ~]
|
||||
==
|
||||
get-authz:effect(rod `dor, next-order ~)
|
||||
:: +finalize-order: order finalized, poll for certificate
|
||||
::
|
||||
@ -1016,6 +1027,9 @@
|
||||
pending t.pending.aut.u.rod
|
||||
active `[idx tau]
|
||||
==
|
||||
:: XX space leak, should be pruned on order completion or timeout
|
||||
::
|
||||
=. challenges (~(put in challenges) tok.cal)
|
||||
test-trial:effect(aut.u.rod rod-aut)
|
||||
:: XX check/finalize-authz ??
|
||||
::
|
||||
@ -1188,49 +1202,21 @@
|
||||
:: XX delete-trial?
|
||||
::
|
||||
==
|
||||
:: +poke-handle-http-request: receive incoming http request
|
||||
:: +peek: read from app state
|
||||
::
|
||||
:: Used to serve the domain validation challenge
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
~& [%handle-http +<]
|
||||
=/ url=(unit (pair pork:eyre quay:eyre))
|
||||
%+ rush
|
||||
url.request.inbound-request
|
||||
;~(plug ;~(pose apat:de-purl:html (easy *pork:eyre)) yque:de-purl:html)
|
||||
::
|
||||
?. ?=(^ url)
|
||||
~| [%invalid-url url.request.inbound-request] !!
|
||||
?. ?=([%'.well-known' %acme-challenge @ ~] q.p.u.url)
|
||||
~| [%unknown-url url.request.inbound-request] !!
|
||||
::
|
||||
:: XX these crashes should be restored
|
||||
:: but %eyre doesn't get an error notification from %gall
|
||||
::
|
||||
:: ?. ?=(^ reg.act) ~|(%no-account !!)
|
||||
:: ?. ?=(^ rod) ~|(%no-active-order !!)
|
||||
:: ?. ?=(^ active.aut.u.rod) ~|(%no-active-authz !!)
|
||||
?. ?& ?=(^ reg.act)
|
||||
?=(^ rod)
|
||||
?=(^ active.aut.u.rod)
|
||||
==
|
||||
=/ =move [ost.bow %http-response %start [%500 ~] ~ %.y]
|
||||
[[move ~] this]
|
||||
::
|
||||
=/ challenge i.t.t.q.p.u.url
|
||||
=* aut u.active.aut.u.rod
|
||||
?. =(tok.cal.aut challenge)
|
||||
=/ =move [ost.bow %http-response %start [%404 ~] ~ %.y]
|
||||
[[move ~] this]
|
||||
=/ =move
|
||||
=/ hed ['content-type' '/text/plain']~
|
||||
=/ bod
|
||||
%- some %- as-octs:mimes:html
|
||||
(rap 3 [tok.cal.aut '.' (pass:thumb:jwk key.act) ~])
|
||||
[ost.bow %http-response %start [%200 hed] bod %.y]
|
||||
[[move ~] this]
|
||||
++ peek
|
||||
|= =path
|
||||
^- (unit (unit [%noun (unit @t)]))
|
||||
?+ path
|
||||
~
|
||||
::
|
||||
[%x %domain-validation @t ~]
|
||||
=* token i.t.t.path
|
||||
:^ ~ ~ %noun
|
||||
?. (~(has in challenges) token)
|
||||
~
|
||||
(some (rap 3 [token '.' (pass:thumb:jwk key.act) ~]))
|
||||
==
|
||||
:: +wake: timer wakeup event
|
||||
::
|
||||
++ wake
|
||||
@ -1308,11 +1294,15 @@
|
||||
|= old=(unit acme)
|
||||
^- (quip move _this)
|
||||
?~ old
|
||||
=/ =binding:eyre
|
||||
[~ /'.well-known'/acme-challenge]
|
||||
=/ =generator:eyre
|
||||
[q.byk.bow /gen/acme/domain-validation/hoon ~]
|
||||
=/ =move
|
||||
[ost.bow %connect /acme [~ /'.well-known'/acme-challenge] %acme]
|
||||
[ost.bow %serve /acme binding generator]
|
||||
[[move ~] this]
|
||||
[~ this(+<+ u.old)]
|
||||
:: +bound: response to %connect binding request
|
||||
:: +bound: response to %serve binding request
|
||||
::
|
||||
++ bound
|
||||
|= [=wire accepted=? =binding:eyre]
|
||||
@ -1351,10 +1341,11 @@
|
||||
:: +queue-next-order: enqueue domains for validation
|
||||
::
|
||||
++ queue-next-order
|
||||
|= [valid=? dom=(set turf)]
|
||||
|= [try=@ud valid=? dom=(set turf)]
|
||||
^+ this
|
||||
%= this next-order
|
||||
:- ~
|
||||
:+ ~
|
||||
try
|
||||
%+ roll
|
||||
~(tap in dom)
|
||||
|= [=turf state=(map turf [idx=@ud valid=?])]
|
||||
@ -1382,7 +1373,7 @@
|
||||
~|(%acme-empty-certificate-order !!)
|
||||
?: ?=(?(%earl %pawn) (clan:title our.bow))
|
||||
this
|
||||
=. ..this (queue-next-order | dom)
|
||||
=. ..this (queue-next-order 1 | dom)
|
||||
=. ..this cancel-current-order
|
||||
:: notify :hall
|
||||
::
|
||||
|
@ -67,7 +67,7 @@
|
||||
::
|
||||
++ pe
|
||||
|= who=ship
|
||||
=+ (fall (~(get by piers) who) *pier)
|
||||
=+ (~(gut by piers) who *pier)
|
||||
=* pier-data -
|
||||
|%
|
||||
++ abet-pe
|
||||
|
@ -80,7 +80,7 @@
|
||||
::
|
||||
++ pe
|
||||
|= who=ship
|
||||
=+ (fall (~(get by piers) who) *pier)
|
||||
=+ (~(gut by piers) who *pier)
|
||||
=* pier-data -
|
||||
|%
|
||||
++ abet-pe
|
||||
|
@ -72,7 +72,7 @@
|
||||
::
|
||||
++ pe
|
||||
|= who=ship
|
||||
=+ (fall (~(get by piers) who) *pier)
|
||||
=+ (~(gut by piers) who *pier)
|
||||
=* pier-data -
|
||||
|%
|
||||
::
|
||||
|
@ -1,154 +0,0 @@
|
||||
::
|
||||
:::: /hoon/ask/app
|
||||
::
|
||||
/? 310
|
||||
/+ sole, prey
|
||||
=, sole
|
||||
|%
|
||||
++ card
|
||||
$% {$diff $sole-effect sole-effect}
|
||||
==
|
||||
++ invited ?($new $sent $ignored)
|
||||
++ email @t
|
||||
--
|
||||
::
|
||||
=, gall
|
||||
|_ $: bow/bowl
|
||||
adr/(map email {time invited})
|
||||
sos/(map bone sole-share)
|
||||
wom/(unit ship)
|
||||
admins/(set ship)
|
||||
==
|
||||
++ prompt
|
||||
^- sole-prompt
|
||||
?~ wom [& %ask-ship ":womb-ship? ~"]
|
||||
=/ new new-adrs
|
||||
?~ new [& %$ "<listening> (0) [l,a,i,w,?]"]
|
||||
[& %$ ": approve {<ask.i.new>}? ({<(lent new)>}) [y,n,l,a,i,w,?]"]
|
||||
::
|
||||
++ peer-sole
|
||||
|= path
|
||||
^- (quip {bone card} _+>)
|
||||
~| [%not-in-whitelist src.bow]
|
||||
?> |((~(has in admins) src.bow) =(our.bow src.bow))
|
||||
:_ +>.$(sos (~(put by sos) ost.bow *sole-share))
|
||||
=- [(effect %mor pro+prompt -)]~
|
||||
=+ all=adrs
|
||||
[(render all) (turn all put-mail)]
|
||||
::
|
||||
++ render :: show list of invites
|
||||
|= a/(list {time email invited}) ^- sole-effect
|
||||
?: =(~ a) txt+"~"
|
||||
tan+(flop (turn a message))
|
||||
::
|
||||
++ adrs
|
||||
=- (sort - |=([a=[=time *] b=[=time *]] (lth time.a time.b)))
|
||||
%+ turn ~(tap by adr)
|
||||
|=({a/email b/time c/invited} [tym=b ask=a inv=c])
|
||||
::
|
||||
++ new-adrs (skim adrs |=({@ @ inv/invited} =(%new inv)))
|
||||
++ ignored-adrs (skim adrs |=({@ @ inv/invited} =(%ignored inv)))
|
||||
++ effect |=(fec/sole-effect [ost.bow %diff %sole-effect fec])
|
||||
++ message
|
||||
|= {now/time ask/@t inv/invited} ^- tank
|
||||
=. now (sub now (mod now ~s1))
|
||||
leaf+"ask: {<inv>} {<now>} {(trip ask)}"
|
||||
::
|
||||
++ put-mail |=({@ ask/@t inv/invited} =+(pax=(rash ask unix-path) [%sav pax `@t`inv]))
|
||||
++ unix-path :: split into path of "name" and "extension"
|
||||
;~ (glue dot)
|
||||
(cook crip (star ;~(less dot next)))
|
||||
;~(plug (cook crip (star next)) (easy ~))
|
||||
==
|
||||
::
|
||||
++ poke-ask-admins
|
||||
|= a/(set ship)
|
||||
?> =(our.bow src.bow)
|
||||
`+>.$(admins a)
|
||||
::
|
||||
++ poke-ask-mail
|
||||
|= ask/@t
|
||||
^- (quip {bone card} _+>)
|
||||
~| have-mail+ask
|
||||
?< (~(has by adr) ask)
|
||||
=. adr (~(put by adr) ask now.bow %new) :: XX electroplating
|
||||
:_ +>.$
|
||||
=/ new [now.bow ask %new]
|
||||
=+ [mez=[(message new)]~ pro=prompt sav=(put-mail new)]
|
||||
%+ turn (prey /sole bow)
|
||||
|=({ost/bone ^} (effect(ost.bow ost) %mor tan+mez pro+prompt sav ~))
|
||||
::
|
||||
++ poke-sole-action
|
||||
|= act/sole-action
|
||||
^- (quip {bone card} _+>)
|
||||
=/ som (~(got by sos) ost.bow)
|
||||
?- -.act
|
||||
$clr `+>.$
|
||||
$ret
|
||||
?^ wom [[(effect mor+help)]~ +>.$] :: show help
|
||||
?: =(~ buf.som) [[(effect txt+"Please enter womb ship")]~ +>.$]
|
||||
=/ try (rose (tufa buf.som) fed:ag)
|
||||
?. ?=({%& ^} try)
|
||||
[[(effect bel+~)]~ +>.$]
|
||||
=> .(wom p.try) :: XX TMI
|
||||
(transmit set+~ pro+prompt ~) :: XX handle multiple links?
|
||||
::
|
||||
$det :: reject all input
|
||||
=^ inv som (~(transceive sole som) +.act)
|
||||
=. sos (~(put by sos) ost.bow som)
|
||||
?~ wom
|
||||
=/ try (rose (tufa buf.som) fed:ag)
|
||||
?: -.try `+>.$
|
||||
(transmit inv bel+~ ~)
|
||||
?: =(`*`"?" buf.som) (transmit inv help)
|
||||
?: =(`*`"a" buf.som) (transmit inv (render adrs) ~)
|
||||
?: =(`*`"l" buf.som) (transmit inv (render new-adrs) ~)
|
||||
?: =(`*`"i" buf.som) (transmit inv (render ignored-adrs) ~)
|
||||
?: =(`*`"n" buf.som)
|
||||
=/ new new-adrs
|
||||
?~ new (transmit inv bel+~ ~)
|
||||
=. inv.i.new %ignored
|
||||
=. adr (~(put by adr) ask.i.new [tym inv]:i.new)
|
||||
(transmit inv tan+[(message i.new)]~ pro+prompt ~)
|
||||
?: =(`*`"y" buf.som)
|
||||
=/ new new-adrs
|
||||
?~ new (transmit inv bel+~ ~)
|
||||
=. inv.i.new %sent :: XX pending
|
||||
=- [[(invite ask.i.new) -<] ->]
|
||||
=. adr (~(put by adr) ask.i.new [tym inv]:i.new)
|
||||
(transmit inv tan+[(message i.new)]~ pro+prompt ~)
|
||||
?: =(`*`"w" buf.som)
|
||||
=> .(wom ~) :: XX TMI
|
||||
(transmit inv pro+prompt ~)
|
||||
(transmit inv bel+~ ~)
|
||||
==
|
||||
++ transmit
|
||||
|= {inv/sole-edit mor/(list sole-effect)}
|
||||
=/ som (~(got by sos) ost.bow)
|
||||
=^ det som (~(transmit sole som) inv)
|
||||
=. sos (~(put by sos) ost.bow som)
|
||||
[[(effect mor+[det+det mor])]~ +>.$]
|
||||
::
|
||||
++ help
|
||||
^- (list sole-effect)
|
||||
=- (scan - (more (just '\0a') (stag %txt (star prn))))
|
||||
%+ welp
|
||||
?~ [new-adrs] ""
|
||||
"""
|
||||
y - invite current ask
|
||||
n - ignore current ask
|
||||
|
||||
"""
|
||||
"""
|
||||
l - list new asks
|
||||
i - list ignored asks
|
||||
a - list all asks
|
||||
w - reset womb ship
|
||||
? - print help
|
||||
"""
|
||||
::
|
||||
++ invite
|
||||
|= ask/email
|
||||
~| %ask-stub-invite
|
||||
!!
|
||||
--
|
@ -50,26 +50,59 @@
|
||||
++ prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
=/ launchnoun [%noun [%chat /chattile '/~chat/js/tile.js']]
|
||||
=/ launcha/poke
|
||||
[%launch-action [%chat /chattile '/~chat/js/tile.js']]
|
||||
?~ old
|
||||
=/ inboxpat /circle/inbox/config/group
|
||||
=/ circlespat /circles/[(scot %p our.bol)]
|
||||
=/ inboxwir /circle/[(scot %p our.bol)]/inbox/config/group
|
||||
=/ inboxi/poke
|
||||
:- %hall-action
|
||||
[%source %inbox %.y (silt [[our.bol %i] ~]~)]
|
||||
:_ this
|
||||
[%source %inbox %.y (silt [[our.bol %i] ~]~)]
|
||||
=/ fakeannounce=poke
|
||||
:- %hall-action
|
||||
[%create %hall-internal-announcements '' %village]
|
||||
=/ announce=poke
|
||||
:- %hall-action
|
||||
[%create %announcements 'Announcements from Tlon' %journal]
|
||||
=/ help=poke
|
||||
:- %hall-action
|
||||
[%create %urbit-help 'Get help about Urbit' %channel]
|
||||
=/ dev=poke
|
||||
:- %hall-action
|
||||
[%create %urbit-dev 'Chat about developing on Urbit' %channel]
|
||||
=/ sourcefakeannounce/poke
|
||||
:- %hall-action
|
||||
[%source %inbox %.y (silt [[our.bol %hall-internal-announcements] ~]~)]
|
||||
=/ sourceannounce/poke
|
||||
:- %hall-action
|
||||
[%source %inbox %.y (silt [[~marzod %announcements] ~]~)]
|
||||
=/ hallactions=(list move)
|
||||
?: =((clan:title our.bol) %czar)
|
||||
~
|
||||
?: =(our.bol ~marzod)
|
||||
~& %marzod-chat
|
||||
:- [ost.bol %poke /announce [our.bol %hall] announce]
|
||||
[ost.bol %poke /announce [our.bol %hall] sourceannounce]~
|
||||
?: =(our.bol ~dopzod)
|
||||
~& %dopzod-chat
|
||||
:- [ost.bol %poke /announce [our.bol %hall] dev]
|
||||
[ost.bol %poke /announce [our.bol %hall] help]~
|
||||
:- [ost.bol %poke /announce [our.bol %hall] fakeannounce]
|
||||
:- [ost.bol %poke /announce [our.bol %hall] sourcefakeannounce]
|
||||
[ost.bol %poke /announce [our.bol %hall] sourceannounce]~
|
||||
=/ moves=(list move)
|
||||
:~ [ost.bol %peer inboxwir [our.bol %hall] inboxpat]
|
||||
[ost.bol %peer circlespat [our.bol %hall] circlespat]
|
||||
[ost.bol %connect / [~ /'~chat'] %chat]
|
||||
[ost.bol %poke /chat [our.bol %hall] inboxi]
|
||||
[ost.bol %poke /chat [our.bol %launch] launchnoun]
|
||||
[ost.bol %poke /chat [our.bol %launch] launcha]
|
||||
==
|
||||
:- [ost.bol %poke /chat [our.bol %launch] launchnoun]~
|
||||
:_ this
|
||||
%+ weld moves hallactions
|
||||
:- [ost.bol %poke /chat [our.bol %launch] launcha]~
|
||||
this(sta u.old)
|
||||
::
|
||||
::
|
||||
::
|
||||
++ construct-tile-json
|
||||
|= str=streams
|
||||
^- json
|
||||
@ -100,7 +133,6 @@
|
||||
++ peer-primary
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
~& (lent (prey:pubsub:userlib /primary bol))
|
||||
=* messages messages.str.sta
|
||||
=/ lismov/(list move)
|
||||
%+ murn ~(tap by messages)
|
||||
@ -151,10 +183,11 @@
|
||||
|= [=bone *]
|
||||
[bone %diff %chat-update upd]
|
||||
::
|
||||
=/ jon/json (construct-tile-json str)
|
||||
=/ tile-updates/(list move)
|
||||
%+ turn (prey:pubsub:userlib /chattile bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %json (construct-tile-json str)]
|
||||
[bone %diff %json jon]
|
||||
::
|
||||
%+ weld
|
||||
updates
|
||||
@ -262,7 +295,6 @@
|
||||
|= [shp=@p stat=status:hall]
|
||||
shp
|
||||
(~(put by acc) cir newset)
|
||||
~& nes.piz
|
||||
=/ str
|
||||
%= str.sta
|
||||
messages (~(put by messages) circle nes.piz)
|
||||
@ -451,7 +483,6 @@
|
||||
(send-chat-update [[%delete affectedcir] str])
|
||||
:: if we get a delete from another ship, delete our fake circle copy
|
||||
::
|
||||
~& %deletefake
|
||||
=/ deletefake/poke
|
||||
:- %hall-action
|
||||
[%delete nom.fakecir ~]
|
||||
@ -463,6 +494,18 @@
|
||||
%+ weld
|
||||
(send-chat-update [[%inbox newinbox] str])
|
||||
(send-chat-update [[%delete affectedcir] str])
|
||||
::
|
||||
:: %remove: remove a circle
|
||||
::
|
||||
%remove
|
||||
=/ str
|
||||
%= str.sta
|
||||
configs (~(del by configs.str.sta) circ)
|
||||
messages (~(del by messages.str.sta) circ)
|
||||
peers (~(del by peers.str.sta) circ)
|
||||
==
|
||||
:- (send-chat-update [[%delete circ] str])
|
||||
this(str.sta str)
|
||||
::
|
||||
==
|
||||
:: end of branching on dif.sto type
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -15,7 +15,7 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ poke
|
||||
$% [%noun [@tas path @t]]
|
||||
$% [%launch-action [@tas path @t]]
|
||||
==
|
||||
::
|
||||
+$ card
|
||||
@ -39,11 +39,12 @@
|
||||
++ prep
|
||||
|= old=(unit ~)
|
||||
^- (quip move _this)
|
||||
=/ launchnoun [%noun [%clock /tile '/~clock/js/tile.js']]
|
||||
=/ launcha
|
||||
[%launch-action [%clock /tile '/~clock/js/tile.js']]
|
||||
:_ this
|
||||
:~
|
||||
[ost.bol %connect / [~ /'~clock'] %clock]
|
||||
[ost.bol %poke /clock [our.bol %launch] launchnoun]
|
||||
[ost.bol %poke /clock [our.bol %launch] launcha]
|
||||
==
|
||||
::
|
||||
++ peer-tile
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,610 +0,0 @@
|
||||
::
|
||||
:::: /app/collections/hoon
|
||||
::
|
||||
/? 309
|
||||
/- hall
|
||||
/+ collections
|
||||
::
|
||||
:: cols:
|
||||
::
|
||||
:: run collections-item renderer on children of /web/collections
|
||||
:: combine with a bunted config in a +collection structure defined in
|
||||
:: /lib/collections because the top level collection has no config file
|
||||
::
|
||||
:: whenever any of the clay files that compose this renderer change, this app
|
||||
:: will recompile and the +prep arm will fire. we then check which files
|
||||
:: changed and notify the corresponding hall circle of that change
|
||||
::
|
||||
/= cols
|
||||
/^ collection:collections
|
||||
/; |= a=(map knot item:collections)
|
||||
[*config:collections a]
|
||||
/: /===/web/collections /_ /collections-item/
|
||||
::
|
||||
=, collections
|
||||
=, space:userlib
|
||||
::
|
||||
:: state:
|
||||
::
|
||||
:: stores the collection built by above by :cols so that we can compare old
|
||||
:: and new versions whenever the rendered data changes
|
||||
::
|
||||
~% %landscape ..^is ~
|
||||
|_ [bol=bowl:gall sta=state]
|
||||
::
|
||||
:: +this: app core subject
|
||||
::
|
||||
++ this .
|
||||
::
|
||||
:: +prep:
|
||||
::
|
||||
:: on initial boot, create top level hall circle for collections, called %c
|
||||
::
|
||||
:: on subsequent compiles, call +ta-update:ta on the old collection data,
|
||||
:: then update state to store the new collection data
|
||||
::
|
||||
++ prep
|
||||
~/ %land-prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
?~ old
|
||||
:_ this
|
||||
;: welp
|
||||
=< ta-done
|
||||
(~(ta-hall-create-circle ta ~ bol) /c 'collections')
|
||||
::
|
||||
:~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
|
||||
::
|
||||
:: ?. =(%duke (clan:title our.bol))
|
||||
:: ~
|
||||
:: :_ ~
|
||||
:: :* ost.bol %poke /client-action [our.bol %hall]
|
||||
:: %hall-action %source %inbox &
|
||||
:: (sy [[(^sein:title our.bol) %urbit-meta] ~]~)
|
||||
:: ==
|
||||
==
|
||||
==
|
||||
?- -.u.old
|
||||
%0
|
||||
=/ mow=(list move)
|
||||
=< ta-done
|
||||
(~(ta-update ta ~ bol) col.u.old cols)
|
||||
:- mow
|
||||
%= this
|
||||
sta [%0 cols str.u.old]
|
||||
==
|
||||
==
|
||||
::
|
||||
:: +mack:
|
||||
::
|
||||
:: recieve acknowledgement for permissions changes, print error if it failed
|
||||
::
|
||||
++ mack
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
[~ this]
|
||||
(mean u.err)
|
||||
::
|
||||
:: +coup: recieve acknowledgement for poke, print error if it failed
|
||||
::
|
||||
++ coup
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
?~ err
|
||||
[~ this]
|
||||
(mean u.err)
|
||||
::
|
||||
:: +poke-collections-action:
|
||||
::
|
||||
:: the main interface for creating and deleting collections and items
|
||||
::
|
||||
++ poke-collections-action
|
||||
~/ %coll-poke-collections-action
|
||||
|= act=action
|
||||
^- (quip move _this)
|
||||
?: =(who.act our.bol)
|
||||
:_ this
|
||||
=< ta-done
|
||||
(~(ta-act ta ~ bol) act)
|
||||
:: forward poke if its not meant for us
|
||||
::
|
||||
:_ this
|
||||
:_ ~
|
||||
:* ost.bol %poke
|
||||
/forward-collections-action
|
||||
[who.act %collections]
|
||||
%collections-action act
|
||||
==
|
||||
::
|
||||
:: +poke-json
|
||||
::
|
||||
:: utility for setting whether or not to display the onboarding page
|
||||
::
|
||||
++ poke-json
|
||||
~/ %coll-poke-json
|
||||
|= jon=json
|
||||
^- (quip move _this)
|
||||
?: ?=([%o [[%onboard %b ?] ~ ~]] jon)
|
||||
:_ this
|
||||
=< ta-done
|
||||
(~(ta-write ta ~ bol) /web/landscape/onboard/json [%json !>(jon)])
|
||||
[~ this]
|
||||
::
|
||||
:: +poke-collections-command
|
||||
::
|
||||
++ poke-collections-command
|
||||
|= cod=command
|
||||
^- (quip move _this)
|
||||
?- -.cod
|
||||
%chat-invite
|
||||
:_ this
|
||||
:- :* ost.bol
|
||||
%poke
|
||||
/permit
|
||||
[our.bol %hall]
|
||||
%hall-action
|
||||
%permit
|
||||
nom.cod
|
||||
%.y
|
||||
who.cod
|
||||
==
|
||||
%+ turn ~(tap in who.cod)
|
||||
|= guy=@p
|
||||
^- move
|
||||
:* ost.bol
|
||||
%poke
|
||||
/invite
|
||||
[our.bol %hall]
|
||||
%hall-action
|
||||
%phrase
|
||||
aud=(sy [guy %i] ~)
|
||||
ses=[%inv & our.bol nom.cod]~
|
||||
==
|
||||
::
|
||||
%collection-invite
|
||||
:_ this
|
||||
:- :* ost.bol
|
||||
%poke
|
||||
/permit
|
||||
[our.bol %hall]
|
||||
%hall-action
|
||||
%permit
|
||||
nom.cod
|
||||
%.y
|
||||
who.cod
|
||||
==
|
||||
%+ turn ~(tap in who.cod)
|
||||
|= guy=@p
|
||||
^- move
|
||||
:* ost.bol
|
||||
%poke
|
||||
/invite
|
||||
[our.bol %hall]
|
||||
%hall-action
|
||||
%phrase
|
||||
aud=(sy [guy %i] ~)
|
||||
ses=[%app col.cod [%inv & our.bol nom.cod]]~
|
||||
==
|
||||
==
|
||||
::
|
||||
:: +peer:
|
||||
::
|
||||
++ peer
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
=/ response=streams
|
||||
?+ wir
|
||||
%= str.sta
|
||||
env.inbox (scag 1.000 env.inbox.str.sta)
|
||||
==
|
||||
:: negative range from latest
|
||||
::
|
||||
[%primary @t ~]
|
||||
=/ val=@ (slav %ud i.t.wir)
|
||||
%= str.sta
|
||||
env.inbox (scag val env.inbox.str.sta)
|
||||
==
|
||||
:: negative range from offset
|
||||
::
|
||||
[%primary @t @t ~]
|
||||
=/ offset=@ (slav %ud i.t.wir)
|
||||
=/ num=@ (slav %ud i.t.t.wir)
|
||||
%= str.sta
|
||||
env.inbox (swag [offset num] env.inbox.str.sta)
|
||||
==
|
||||
::
|
||||
==
|
||||
:_ this
|
||||
[ost.bol %diff %collections-prize response]~
|
||||
::
|
||||
:: +reap: recieve acknowledgement for peer, retry on failure
|
||||
::
|
||||
++ reap
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
::~& reap+[wir =(~ err)]
|
||||
?~ err
|
||||
:: XX send message to users inbox
|
||||
[~ this]
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
|
||||
::
|
||||
%inbox
|
||||
:_ this
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
|
||||
::
|
||||
%invites
|
||||
:_ this
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
|
||||
::
|
||||
%our
|
||||
?< ?=(~ t.wir)
|
||||
:_ this
|
||||
[ost.bol %peer /our/[i.t.wir] [our.bol %hall] /circle/[i.t.wir]/config]~
|
||||
==
|
||||
::
|
||||
:: +quit:
|
||||
::
|
||||
++ quit
|
||||
|= wir=wire
|
||||
^- (quip move _this)
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
%circles
|
||||
:_ this
|
||||
[ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]~
|
||||
::
|
||||
%inbox
|
||||
:_ this
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]~
|
||||
::
|
||||
%invites
|
||||
:_ this
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]~
|
||||
::
|
||||
%our
|
||||
?< ?=(~ t.wir)
|
||||
:_ this
|
||||
[ost.bol %peer /our/[i.t.wir] [our.bol %hall] /circle/[i.t.wir]/config]~
|
||||
==
|
||||
::
|
||||
:: +diff-hall-prize:
|
||||
::
|
||||
++ diff-hall-prize
|
||||
|= [wir=wire piz=prize:hall]
|
||||
^- (quip move _this)
|
||||
::
|
||||
::
|
||||
::~& prize+[wir piz]
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
:: %circles: subscribe to the configuration of each of our circles
|
||||
::
|
||||
%circles
|
||||
?> ?=(%circles -.piz)
|
||||
=/ noms=(set name:hall) (~(dif in cis.piz) (sy ~[%inbox %i %public]))
|
||||
:_ this(our-circles.str.sta (~(uni in our-circles.str.sta) noms))
|
||||
^- (list move)
|
||||
%+ turn ~(tap in noms)
|
||||
|= nom=name:hall
|
||||
^- move
|
||||
[ost.bol %peer /our/[nom] [our.bol %hall] /circle/[nom]/config]
|
||||
::
|
||||
:: %inbox: fill inbox config, messages and remote configs with prize data
|
||||
::
|
||||
%inbox
|
||||
?> ?=(%circle -.piz)
|
||||
:- ~
|
||||
%= this
|
||||
con.inbox.str.sta `loc.cos.piz
|
||||
::
|
||||
env.inbox.str.sta nes.piz
|
||||
::
|
||||
circles.str.sta
|
||||
%- ~(uni in circles.str.sta)
|
||||
^- (map circle:hall (unit config:hall))
|
||||
(~(run by rem.cos.piz) |=(a=config:hall `a))
|
||||
==
|
||||
::
|
||||
:: %invites: fill invite messages with prize data
|
||||
::
|
||||
%invites
|
||||
?> ?=(%circle -.piz)
|
||||
:- ~
|
||||
%= this
|
||||
invites.str.sta nes.piz
|
||||
==
|
||||
::
|
||||
:: %our:
|
||||
::
|
||||
%our
|
||||
?> ?=(%circle -.piz)
|
||||
=/ nom=name:hall &2:wir
|
||||
:: XX todo: send rumor or let config-change handle it?
|
||||
::
|
||||
:- ~
|
||||
%= this
|
||||
circles.str.sta
|
||||
(~(put by circles.str.sta) [our.bol nom] `loc.cos.piz)
|
||||
::
|
||||
our-circles.str.sta (~(put in our-circles.str.sta) nom)
|
||||
==
|
||||
==
|
||||
::
|
||||
:: +diff-hall-rumor
|
||||
::
|
||||
++ diff-hall-rumor
|
||||
|= [wir=wire rum=rumor:hall]
|
||||
^- (quip move _this)
|
||||
::~& rumor+[wir rum]
|
||||
?~ wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
=; upd=[mow=(list move) sta=_this]
|
||||
:_ sta.upd
|
||||
%+ welp mow.upd
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %hall-rumor rum]
|
||||
?+ i.wir
|
||||
(mean [leaf+"invalid wire for diff: {(spud wir)}"]~)
|
||||
::
|
||||
:: %circles:
|
||||
::
|
||||
%circles
|
||||
::~& %circles
|
||||
?> ?=(%circles -.rum)
|
||||
=? dms.str.sta
|
||||
?& (is-dm-circle our.bol cir.rum)
|
||||
!(~(has by dms.str.sta) cir.rum)
|
||||
==
|
||||
(~(put by dms.str.sta) cir.rum our.bol ~)
|
||||
?: add.rum
|
||||
:_ this(our-circles.str.sta (~(put in our-circles.str.sta) cir.rum))
|
||||
[ost.bol %peer /our/[cir.rum] [our.bol %hall] /circle/[cir.rum]/config]~
|
||||
:_ this(our-circles.str.sta (~(del in our-circles.str.sta) cir.rum))
|
||||
[ost.bol %pull /our/[cir.rum] [our.bol %hall] ~]~
|
||||
::
|
||||
:: %inbox:
|
||||
::
|
||||
%inbox
|
||||
?> ?=(%circle -.rum)
|
||||
?+ -.rum.rum
|
||||
::~& inbox-unprocessed-rumor+rum.rum
|
||||
[~ this]
|
||||
::
|
||||
:: %remove:
|
||||
::
|
||||
%remove
|
||||
::~& %inbox-remove
|
||||
::~& %removed-story
|
||||
[~ this]
|
||||
::
|
||||
:: %gram: inbox has recieved messages
|
||||
::
|
||||
%gram
|
||||
::~& %inbox-gram
|
||||
:: XX TODO: handle stack trace message when foreign circle is killed?
|
||||
::
|
||||
?: (is-dm-circle src.rum.rum)
|
||||
=/ dms=[ini=ship env=(list envelope:hall)]
|
||||
(~(got by dms.str.sta) nom.src.rum.rum)
|
||||
=. env.dms [nev.rum.rum env.dms]
|
||||
:- ~
|
||||
%= this
|
||||
env.inbox.str.sta [nev.rum.rum env.inbox.str.sta]
|
||||
dms.str.sta (~(put by dms.str.sta) nom.src.rum.rum dms)
|
||||
==
|
||||
:- ~ ::(send-rumor [%new-msg %inbox nev.rum.rum])
|
||||
this(env.inbox.str.sta [nev.rum.rum env.inbox.str.sta])
|
||||
::
|
||||
:: %config: inbox config has changed
|
||||
::
|
||||
%config
|
||||
=* circ cir.rum.rum
|
||||
?+ -.dif.rum.rum
|
||||
::~& inbox-unprocessed-config+dif.rum.rum
|
||||
[~ this]
|
||||
::
|
||||
:: %remove: circle has been erased
|
||||
::
|
||||
%remove
|
||||
::~& %inbox-config-remove
|
||||
:- ~ ::(send-rumor %config-change cir.rum.rum ~)
|
||||
%= this
|
||||
circles.str.sta
|
||||
(~(del by circles.str.sta) cir.rum.rum)
|
||||
==
|
||||
::
|
||||
:: %source: the sources of our inbox have changed
|
||||
::
|
||||
%source
|
||||
::~& %inbox-config-source
|
||||
?. =(circ [our.bol %inbox])
|
||||
[~ this]
|
||||
:: we've added a source to our inbox
|
||||
::
|
||||
?> ?=(^ con.inbox.str.sta)
|
||||
?: add.dif.rum.rum
|
||||
=/ conf=config:hall
|
||||
%= u.con.inbox.str.sta
|
||||
src (~(put in src.u.con.inbox.str.sta) src.dif.rum.rum)
|
||||
==
|
||||
:- ~ ::(send-rumor %config-change [our.bol %inbox] `conf)
|
||||
%= this
|
||||
con.inbox.str.sta `conf
|
||||
::
|
||||
circles.str.sta
|
||||
?: (~(has by circles.str.sta) cir.src.dif.rum.rum)
|
||||
circles.str.sta
|
||||
(~(put by circles.str.sta) cir.src.dif.rum.rum ~)
|
||||
==
|
||||
:: we've removed a source from our inbox
|
||||
::
|
||||
=/ conf=config:hall
|
||||
%= u.con.inbox.str.sta
|
||||
src (~(del in src.u.con.inbox.str.sta) src.dif.rum.rum)
|
||||
==
|
||||
::~& inbox+conf
|
||||
:- ~ ::(send-rumor %config-change [our.bol %inbox] `conf)
|
||||
%= this
|
||||
con.inbox.str.sta `conf
|
||||
::
|
||||
circles.str.sta
|
||||
?: =(our.bol hos.cir.src.dif.rum.rum)
|
||||
circles.str.sta
|
||||
(~(del by circles.str.sta) cir.src.dif.rum.rum)
|
||||
==
|
||||
::
|
||||
:: %full: recieved a full config update for one of our sources
|
||||
::
|
||||
%full
|
||||
::~& %inbox-config-full
|
||||
=* conf cof.dif.rum.rum
|
||||
:- ~ ::(send-rumor %config-change circ `conf)
|
||||
%= this
|
||||
circles.str.sta (~(put by circles.str.sta) circ `conf)
|
||||
==
|
||||
::
|
||||
:: %read: recieved a read reciept
|
||||
::
|
||||
%read
|
||||
?. =([our.bol %inbox] cir.rum.rum)
|
||||
[~ this]
|
||||
?> ?=(^ con.inbox.str.sta)
|
||||
:- ~
|
||||
%= this
|
||||
red.u.con.inbox.str.sta red.dif.rum.rum
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
:: %invites:
|
||||
::
|
||||
%invites
|
||||
::~& %invites
|
||||
?> ?=(%circle -.rum)
|
||||
?> ?=(%gram -.rum.rum)
|
||||
?+ -.sep.gam.nev.rum.rum
|
||||
[~ this(invites.str.sta [nev.rum.rum invites.str.sta])]
|
||||
::
|
||||
%inv
|
||||
=/ circ=circle:hall cir.sep.gam.nev.rum.rum
|
||||
?: (is-dm-circle circ)
|
||||
=/ who=(set ship) (sy (rash nom.circ (more dot fed:ag)))
|
||||
=/ act=poke [%hall-action %newdm who]
|
||||
:- [ost.bol %poke /join-dm [our.bol %hall] act]~
|
||||
%= this
|
||||
invites.str.sta [nev.rum.rum invites.str.sta]
|
||||
dms.str.sta (~(put by dms.str.sta) nom.circ hos.circ ~)
|
||||
==
|
||||
=/ act=poke [%hall-action %source %inbox & (sy [circ ~] ~)]
|
||||
:- ~
|
||||
this(invites.str.sta [nev.rum.rum invites.str.sta])
|
||||
==
|
||||
::
|
||||
:: %our:
|
||||
::
|
||||
%our
|
||||
?> ?=(%circle -.rum)
|
||||
?+ -.rum.rum
|
||||
::~& our-unprocessed-rumor+rum.rum
|
||||
[~ this]
|
||||
::
|
||||
:: %remove:
|
||||
::
|
||||
%remove
|
||||
::~& %our-remove
|
||||
[~ this]
|
||||
::
|
||||
:: %config:
|
||||
::
|
||||
%config
|
||||
=* circ cir.rum.rum
|
||||
=* diff dif.rum.rum
|
||||
?+ -.diff
|
||||
::~& our-unprocessed-config+diff
|
||||
[~ this]
|
||||
::
|
||||
:: %full: recieved a full config update for one of our sources
|
||||
::
|
||||
%full
|
||||
::~& %our-config-full
|
||||
=* conf cof.dif.rum.rum
|
||||
:- ~ ::(send-rumor %config-change circ `conf)
|
||||
%= this
|
||||
circles.str.sta (~(put by circles.str.sta) circ `conf)
|
||||
==
|
||||
::
|
||||
:: %read: recieved a read reciept
|
||||
::
|
||||
%read
|
||||
=/ conf (need (~(got by circles.str.sta) circ))
|
||||
=. red.conf red.dif.rum.rum
|
||||
:- ~
|
||||
%= this
|
||||
circles.str.sta (~(put by circles.str.sta) circ `conf)
|
||||
==
|
||||
==
|
||||
==
|
||||
==
|
||||
::
|
||||
:: +send-rumor: send a rumor to all subscribers
|
||||
::
|
||||
++ send-rumor
|
||||
|= rum=rumor
|
||||
::~& send-rumor+rum
|
||||
^- (list move)
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [=bone *]
|
||||
[bone %diff %collections-rumor rum]
|
||||
::
|
||||
:: +poke-noun: debugging stuff
|
||||
::
|
||||
++ poke-noun
|
||||
|= a=@tas
|
||||
^- (quip move _this)
|
||||
?+ a
|
||||
[~ this]
|
||||
::
|
||||
%check-all-subs
|
||||
~& 'here are all incoming subs'
|
||||
~& ^- (list (pair ship path))
|
||||
%+ turn ~(tap by sup.bol)
|
||||
|= [b=bone s=ship p=path]
|
||||
^- (pair ship path)
|
||||
[s p]
|
||||
[~ this]
|
||||
::
|
||||
%print-state
|
||||
~& str.sta
|
||||
[~ this]
|
||||
::
|
||||
%rebuild-subs
|
||||
:_ this
|
||||
:~ [ost.bol %peer /circles [our.bol %hall] /circles/[(scot %p our.bol)]]
|
||||
[ost.bol %peer /inbox [our.bol %hall] /circle/inbox/config/grams]
|
||||
[ost.bol %peer /invites [our.bol %hall] /circle/i/grams]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ is-dm-circle
|
||||
|= circ=circle:hall
|
||||
^- ?
|
||||
?= ^
|
||||
(rush nom.circ (more dot fed:ag))
|
||||
--
|
@ -49,7 +49,7 @@
|
||||
++ poke-noun
|
||||
|= [what=?(%save %load) =name]
|
||||
^- (quip move _+>)
|
||||
=+ eye=(fall (~(get by eyes) name) *eye)
|
||||
=+ eye=(~(gut by eyes) name *eye)
|
||||
?- what
|
||||
%save
|
||||
=/ pax=path
|
||||
|
@ -1,104 +0,0 @@
|
||||
::
|
||||
:: /app/fora/hoon
|
||||
::
|
||||
::TODO maybe stop relying on %hood one day.
|
||||
::
|
||||
/- hall
|
||||
/+ hall, time-to-id
|
||||
=, format
|
||||
=, title
|
||||
::
|
||||
|%
|
||||
++ move (pair bone card)
|
||||
++ card
|
||||
$% {$poke wire dock poke}
|
||||
{$info wire @p toro:clay}
|
||||
==
|
||||
++ poke
|
||||
$% {$hall-action action:hall}
|
||||
{$write-fora-post spur ship cord cord}
|
||||
{$write-comment spur ship cord}
|
||||
==
|
||||
--
|
||||
::
|
||||
|_ {bol/bowl:gall ~}
|
||||
::
|
||||
++ prep
|
||||
|= old/(unit ~)
|
||||
^- (quip move _..prep)
|
||||
?^ old [~ ..prep(+<+ u.old)]
|
||||
:_ ..prep
|
||||
:~ (act %create %fora-posts 'fora posts' %journal)
|
||||
(act %create %fora-comments 'fora comments' %journal)
|
||||
==
|
||||
::
|
||||
++ act
|
||||
|= a/action:hall
|
||||
^- move
|
||||
[ost.bol %poke / [our.bol %hall] %hall-action a]
|
||||
::
|
||||
++ ra-base-hart .^(hart:eyre %e /(scot %p our.bol)/host/(scot %da now.bol))
|
||||
::
|
||||
++ poke-fora-post
|
||||
|= {pax/path sup/spur hed/@t txt/@t}
|
||||
^- (quip move _+>)
|
||||
:_ +>
|
||||
::
|
||||
:: if txt is blank then return no moves.
|
||||
::
|
||||
?: ?=(^ (rush txt spac:de-json:html)) ~
|
||||
::
|
||||
:: otherwise, post the content.
|
||||
::
|
||||
:~ %- act
|
||||
:+ %phrase [[our.bol %fora-posts] ~ ~]
|
||||
:_ ~
|
||||
:+ %app dap.bol
|
||||
:+ %fat
|
||||
:+ %name
|
||||
(crip "post by {(cite src.bol)}: {(trip hed)}")
|
||||
text+(to-wain txt)
|
||||
=. pax (welp pax /posts/(crip "{<now.bol>}~"))
|
||||
[%url [ra-base-hart `pax ~] ~]
|
||||
::
|
||||
:* ost.bol
|
||||
%poke
|
||||
/fora-post
|
||||
[our.bol %hood]
|
||||
[%write-fora-post sup src.bol hed txt]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ poke-fora-comment
|
||||
|= {pax/path sup/spur txt/@t}
|
||||
^- (quip move _+>)
|
||||
:_ +>
|
||||
::
|
||||
:: if txt is blank then return no moves.
|
||||
::
|
||||
?: ?=(^ (rush txt spac:de-json:html)) ~
|
||||
::
|
||||
:: otherwise, post the content.
|
||||
::
|
||||
:~ ^- move
|
||||
%- act
|
||||
:+ %phrase [[our.bol %fora-comments] ~ ~]
|
||||
:_ ~
|
||||
:+ %app dap.bol
|
||||
^- speech:hall
|
||||
:+ %fat
|
||||
:+ %name
|
||||
=+ nam=?~(sup "" (trip i.sup))
|
||||
(crip "comment by {(cite src.bol)} on /{nam}")
|
||||
text+(to-wain txt)
|
||||
=+ fra=(crip (time-to-id now.bol))
|
||||
[%url [ra-base-hart `pax ~] `fra]
|
||||
::
|
||||
:* ost.bol
|
||||
%poke
|
||||
/fora-comment
|
||||
[our.bol %hood]
|
||||
[%write-comment sup src.bol txt]
|
||||
==
|
||||
==
|
||||
--
|
@ -827,7 +827,7 @@
|
||||
|- ^+ ..ta-take
|
||||
?~ sos ..ta-take
|
||||
=. ..ta-take
|
||||
=+ (fall (~(get by stories) p.i.sos) *story)
|
||||
=+ (~(gut by stories) p.i.sos *story)
|
||||
=> (~(so-bear so p.i.sos ~ -) q.i.sos)
|
||||
=. acs (flop acs)
|
||||
|- ^+ ..ta-take
|
||||
@ -838,7 +838,7 @@
|
||||
::TODO runtime error
|
||||
::%+ roll ~(tap by sos.piz)
|
||||
::|= {{n/name b/burden} _..ta-take}
|
||||
::=+ (fall (~(get by stories) n) *story)
|
||||
::=+ (~(gut by stories) n *story)
|
||||
::so-done:(~(so-bear so n ~ -) b)
|
||||
::
|
||||
$circle
|
||||
@ -870,7 +870,7 @@
|
||||
$new
|
||||
=? +> !(~(has by stories) nom.rum)
|
||||
(ta-delta %story +.rum)
|
||||
=> =+ (fall (~(get by stories) nom.rum) *story)
|
||||
=> =+ (~(gut by stories) nom.rum *story)
|
||||
%- ~(so-bear so nom.rum ~ -)
|
||||
[~ [cof.rum.rum ~] [~ ~]]
|
||||
=. acs (flop acs)
|
||||
@ -880,7 +880,7 @@
|
||||
$(acs t.acs)
|
||||
::TODO runtime error
|
||||
::=< so-done
|
||||
::%- ~(so-bear so nom.rum ~ (fall (~(get by stories) nom.rum) *story))
|
||||
::%- ~(so-bear so nom.rum ~ (~(gut by stories) nom.rum *story))
|
||||
::[~ [cof.rum.rum ~] [~ ~]]
|
||||
==
|
||||
::
|
||||
@ -1160,7 +1160,7 @@
|
||||
=/ old/(unit status)
|
||||
?: =(cir.rum so-cir) (~(get by locals) who.rum)
|
||||
=- (~(get by -) who.rum)
|
||||
(fall (~(get by remotes) cir.rum) *group)
|
||||
(~(gut by remotes) cir.rum *group)
|
||||
:: ignore if it won't result in change.
|
||||
?. ?| &(?=($remove -.dif.rum) ?=(^ old))
|
||||
?=(~ old)
|
||||
@ -1225,7 +1225,7 @@
|
||||
=? deltas !=(`gou (~(get by remotes) wer))
|
||||
%+ welp deltas
|
||||
=+ gop=~(tap by gou)
|
||||
=+ hav=(fall (~(get by remotes) wer) *group)
|
||||
=+ hav=(~(gut by remotes) wer *group)
|
||||
=| l/(list delta)
|
||||
|- ^+ l
|
||||
?~ gop l
|
||||
@ -1617,7 +1617,7 @@
|
||||
%+ roll nes
|
||||
|= {nev/envelope max/@ud}
|
||||
?:((gth num.nev max) num.nev max)
|
||||
?. (gth num (fall (~(get by sequence) src) 0))
|
||||
?. (gth num (~(gut by sequence) src 0))
|
||||
+>.$
|
||||
(so-delta-our %sequent src num)
|
||||
::
|
||||
@ -1631,7 +1631,7 @@
|
||||
|= {src/circle nev/envelope}
|
||||
^+ +>
|
||||
=. +> (so-learn src gam.nev)
|
||||
?. (gth num.nev (fall (~(get by sequence) src) 0))
|
||||
?. (gth num.nev (~(gut by sequence) src 0))
|
||||
+>
|
||||
(so-delta-our %sequent src num.nev)
|
||||
::
|
||||
@ -1719,7 +1719,7 @@
|
||||
$mailbox !(~(has in sis.con.shape) her) :: author blacklist
|
||||
$custom :: custom rule
|
||||
=/ rul/$-({ship ?($r $w) bowl:gall} ?)
|
||||
(fall (~(get by custom-rules) nom) |=(* |))
|
||||
(~(gut by custom-rules) nom |=(* |))
|
||||
(rul her %w bol)
|
||||
==
|
||||
::
|
||||
@ -1736,7 +1736,7 @@
|
||||
$mailbox (team:title our.bol her) :: our team
|
||||
$custom :: custom rule
|
||||
=/ rul/$-({ship ?($r $w) bowl:gall} ?)
|
||||
(fall (~(get by custom-rules) nom) |=(* |))
|
||||
(~(gut by custom-rules) nom |=(* |))
|
||||
(rul her %r bol)
|
||||
==
|
||||
--
|
||||
@ -1877,7 +1877,7 @@
|
||||
%+ roll ses
|
||||
|= {s/serial o/_outbox}
|
||||
=? o ?=(~ o) outbox
|
||||
=+ t=(fall (~(get by o) s) *tracking)
|
||||
=+ t=(~(gut by o) s *tracking)
|
||||
%+ ~(put by o) s
|
||||
(~(put by t) cir %pending)
|
||||
%+ da-emit ost.bol
|
||||
@ -1960,7 +1960,7 @@
|
||||
?+ -.det
|
||||
=< sa-done
|
||||
%. det
|
||||
=+ (fall (~(get by stories) nom) *story)
|
||||
=+ (~(gut by stories) nom *story)
|
||||
~(sa-change sa nom -)
|
||||
::
|
||||
$new (da-create nom +.det)
|
||||
@ -2134,7 +2134,7 @@
|
||||
(~(del by locals) who.det)
|
||||
%+ ~(put by locals) who.det
|
||||
%+ change-status:hall-lib
|
||||
(fall (~(get by locals) who.det) *status)
|
||||
(~(gut by locals) who.det *status)
|
||||
dif.det
|
||||
==
|
||||
==
|
||||
@ -2149,7 +2149,7 @@
|
||||
|= {src/circle num/@ud}
|
||||
^+ +>
|
||||
=- +>.$(sourced -)
|
||||
=+ sed=(fall (~(get by sourced) src) ~)
|
||||
=+ sed=(~(gut by sourced) src ~)
|
||||
?^ (find ~[num] sed) sourced
|
||||
(~(put by sourced) src [num sed])
|
||||
::
|
||||
@ -2197,7 +2197,7 @@
|
||||
+>(mirrors (~(del by mirrors) cir.det))
|
||||
=/ new/config
|
||||
%+ change-config:hall-lib
|
||||
(fall (~(get by mirrors) cir.det) *config)
|
||||
(~(gut by mirrors) cir.det *config)
|
||||
dif.det
|
||||
+>.$(mirrors (~(put by mirrors) cir.det new))
|
||||
::
|
||||
@ -2205,9 +2205,9 @@
|
||||
%_ +>.$
|
||||
remotes
|
||||
%+ ~(put by remotes) cir.det
|
||||
=+ ole=(fall (~(get by remotes) cir.det) *group)
|
||||
=+ ole=(~(gut by remotes) cir.det *group)
|
||||
?: ?=($remove -.dif.det) (~(del by ole) who.det)
|
||||
=+ old=(fall (~(get by ole) who.det) *status)
|
||||
=+ old=(~(gut by ole) who.det *status)
|
||||
(~(put by ole) who.det (change-status:hall-lib old dif.det))
|
||||
==
|
||||
==
|
||||
@ -3297,7 +3297,7 @@
|
||||
?~ aud.t ~&(%strange-aud [our.bol %inbox])
|
||||
n.aud.t
|
||||
%+ ~(put by s) src
|
||||
[c (fall (~(get by s) src) ~)]
|
||||
[c (~(gut by s) src ~)]
|
||||
soy(count c, known k, sourced s)
|
||||
?: =(a 'refederate')
|
||||
~& 'refederating. may take a while...'
|
||||
|
@ -129,7 +129,6 @@
|
||||
:: :: ::
|
||||
++ coup-drum-phat (wrap take-coup-phat):from-drum
|
||||
++ coup-helm-hi (wrap coup-hi):from-helm
|
||||
++ coup-helm-ask (wrap coup-ask):from-helm
|
||||
++ coup-kiln-fancy (wrap take-coup-fancy):from-kiln
|
||||
++ coup-kiln-reload (wrap take-coup-reload):from-kiln
|
||||
++ coup-kiln-spam (wrap take-coup-spam):from-kiln
|
||||
@ -160,13 +159,9 @@
|
||||
++ poke-helm-reset (wrap poke-reset):from-helm
|
||||
++ poke-helm-serve (wrap poke-serve):from-helm
|
||||
++ poke-helm-send-hi (wrap poke-send-hi):from-helm
|
||||
++ poke-helm-send-ask (wrap poke-send-ask):from-helm
|
||||
++ poke-helm-verb (wrap poke-verb):from-helm
|
||||
++ poke-helm-rekey (wrap poke-rekey):from-helm
|
||||
++ poke-helm-nuke (wrap poke-nuke):from-helm
|
||||
++ poke-helm-tlon-add-fora (wrap poke-tlon-add-fora):from-helm
|
||||
++ poke-helm-tlon-add-stream (wrap poke-tlon-add-stream):from-helm
|
||||
++ poke-helm-tlon-init-stream (wrap poke-tlon-init-stream):from-helm
|
||||
++ poke-helm-automass (wrap poke-automass):from-helm
|
||||
++ poke-helm-cancel-automass (wrap poke-cancel-automass):from-helm
|
||||
++ poke-helm-bonk (wrap poke-bonk):from-helm
|
||||
@ -192,10 +187,6 @@
|
||||
++ poke-kiln-permission (wrap poke-permission):from-kiln
|
||||
++ poke-write-sec-atom (wrap poke-sec-atom):from-write
|
||||
++ poke-write-paste (wrap poke-paste):from-write
|
||||
++ poke-write-comment (wrap poke-comment):from-write
|
||||
++ poke-write-fora-post (wrap poke-fora-post):from-write
|
||||
++ poke-write-plan-info (wrap poke-plan-info):from-write
|
||||
++ poke-write-plan-account (wrap poke-plan-account):from-write
|
||||
++ poke-write-tree (wrap poke-tree):from-write
|
||||
++ poke-write-wipe (wrap poke-wipe):from-write
|
||||
++ quit-drum-phat (wrap quit-phat):from-drum
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
/+ *server, collections
|
||||
/+ *server, launch
|
||||
/= index
|
||||
/^ $-(marl manx)
|
||||
/: /===/app/launch/index /!noun/
|
||||
@ -21,23 +20,7 @@
|
||||
/^ (map knot @)
|
||||
/: /===/app/launch/img /_ /png/
|
||||
::
|
||||
|%
|
||||
::
|
||||
+$ move [bone card]
|
||||
::
|
||||
+$ card
|
||||
$% [%http-response =http-event:http]
|
||||
[%connect wire binding:eyre term]
|
||||
[%peer wire dock path]
|
||||
[%diff %json json]
|
||||
==
|
||||
+$ tile [name=@tas subscribe=path]
|
||||
+$ tile-data (map @tas [jon=json url=@t])
|
||||
+$ state
|
||||
$% [%0 tiles=(set tile) data=tile-data path-to-tile=(map path @tas)]
|
||||
==
|
||||
::
|
||||
--
|
||||
=, launch
|
||||
::
|
||||
|_ [bol=bowl:gall sta=state]
|
||||
::
|
||||
@ -46,32 +29,37 @@
|
||||
++ prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
~& 'launch prep'
|
||||
?~ old
|
||||
:_ this
|
||||
[ost.bol %connect / [~ /] %launch]~
|
||||
[~ this(sta u.old)]
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
++ poke-launch-action
|
||||
|= act=action:launch
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
++ poke-noun
|
||||
|= [name=@tas subscribe=path url=@t]
|
||||
^- (quip move _this)
|
||||
=/ beforedata (~(get by data.sta) name)
|
||||
=/ beforedata (~(get by data.sta) name.act)
|
||||
=/ newdata
|
||||
?~ beforedata
|
||||
(~(put by data.sta) name [*json url])
|
||||
(~(put by data.sta) name [jon.u.beforedata url])
|
||||
:- [ost.bol %peer subscribe [our.bol name] subscribe]~
|
||||
(~(put by data.sta) name.act [*json url.act])
|
||||
(~(put by data.sta) name.act [jon.u.beforedata url.act])
|
||||
:- [ost.bol %peer subscribe.act [our.bol name.act] subscribe.act]~
|
||||
%= this
|
||||
tiles.sta (~(put in tiles.sta) [name subscribe])
|
||||
tiles.sta (~(put in tiles.sta) [name.act subscribe.act])
|
||||
data.sta newdata
|
||||
path-to-tile.sta (~(put by path-to-tile.sta) subscribe name)
|
||||
path-to-tile.sta (~(put by path-to-tile.sta) subscribe.act name.act)
|
||||
==
|
||||
::
|
||||
++ peer-main
|
||||
|= [pax=path]
|
||||
^- (quip move _this)
|
||||
=/ data/json
|
||||
%- pairs:enjs:format
|
||||
%+ turn ~(tap by data.sta)
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
[key jon]
|
||||
:_ this
|
||||
[ost.bol %diff %json data]~
|
||||
::
|
||||
++ diff-json
|
||||
|= [pax=path jon=json]
|
||||
^- (quip move _this)
|
||||
@ -89,17 +77,6 @@
|
||||
data.sta (~(put by data.sta) name [jon url.u.data])
|
||||
==
|
||||
::
|
||||
++ peer-main
|
||||
|= [pax=path]
|
||||
^- (quip move _this)
|
||||
=/ data/json
|
||||
%- pairs:enjs:format
|
||||
%+ turn ~(tap by data.sta)
|
||||
|= [key=@tas [jon=json url=@t]]
|
||||
[key jon]
|
||||
:_ this
|
||||
[ost.bol %diff %json data]~
|
||||
::
|
||||
++ generate-script-marl
|
||||
|= data=tile-data
|
||||
^- marl
|
||||
@ -113,9 +90,9 @@
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ name=@t
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
@ -148,4 +125,9 @@
|
||||
[ost.bol %http-response (png-response:app img)]~
|
||||
==
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
^- (quip move _this)
|
||||
[~ this]
|
||||
::
|
||||
--
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,37 +1,37 @@
|
||||
::
|
||||
:: /app/write.hoon
|
||||
:: /app/publish.hoon
|
||||
::
|
||||
/- hall, *write
|
||||
/+ *server, *write
|
||||
/- hall, *publish
|
||||
/+ *server, *publish
|
||||
::
|
||||
/= index
|
||||
/^ $-(json manx)
|
||||
/: /===/app/write/index /!noun/
|
||||
/: /===/app/publish/index /!noun/
|
||||
::
|
||||
/= js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/write/js/index /js/
|
||||
/| /: /===/app/publish/js/index /js/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= css
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/write/css/index /css/
|
||||
/| /: /===/app/publish/css/index /css/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= tile-js
|
||||
/^ octs
|
||||
/; as-octs:mimes:html
|
||||
/| /: /===/app/write/js/tile /js/
|
||||
/| /: /===/app/publish/js/tile /js/
|
||||
/~ ~
|
||||
==
|
||||
::
|
||||
/= images
|
||||
/^ (map knot @)
|
||||
/: /===/app/write/img /_ /png/
|
||||
/: /===/app/publish/img /_ /png/
|
||||
::
|
||||
|%
|
||||
::
|
||||
@ -54,26 +54,46 @@
|
||||
::
|
||||
+$ poke
|
||||
$% [%hall-action action:hall]
|
||||
[%write-action action]
|
||||
[%noun @tas path @t]
|
||||
[%publish-action action]
|
||||
[%launch-action @tas path @t]
|
||||
==
|
||||
::
|
||||
+$ diff
|
||||
$% [%hall-rumor rumor:hall]
|
||||
[%json json]
|
||||
[%write-collection collection]
|
||||
[%write-rumor rumor]
|
||||
[%write-update update]
|
||||
[%publish-collection collection]
|
||||
[%publish-rumor rumor]
|
||||
[%publish-update update]
|
||||
==
|
||||
::
|
||||
--
|
||||
::
|
||||
|_ [bol=bowl:gall sat=state]
|
||||
|_ [bol=bowl:gall %0 sat=state]
|
||||
::
|
||||
++ this .
|
||||
:: +our-beak: beak for this app, with case set to current invocation date
|
||||
::
|
||||
++ our-beak /(scot %p our.bol)/[q.byk.bol]/(scot %da now.bol)
|
||||
:: +prep: set up eyre connection and modulo tile; adapt state
|
||||
::
|
||||
++ prep
|
||||
=> |%
|
||||
++ states
|
||||
$% [%0 s=state]
|
||||
==
|
||||
--
|
||||
|= old=(unit states)
|
||||
^- (quip move _this)
|
||||
?~ old
|
||||
:_ this
|
||||
:~ [ost.bol %connect / [~ /'~publish'] %publish]
|
||||
:* ost.bol %poke /publish [our.bol %launch]
|
||||
%launch-action %publish /publishtile '/~publish/tile.js'
|
||||
==
|
||||
==
|
||||
?- -.u.old
|
||||
%0 [~ this(sat s.u.old)]
|
||||
==
|
||||
::
|
||||
++ ships-to-whom
|
||||
|= ships=(set @p)
|
||||
@ -86,7 +106,7 @@
|
||||
++ get-contributors
|
||||
|= coll=@tas
|
||||
^- [mod=?(%white %black) who=(set @p)]
|
||||
=/ pax (weld our-beak /web/write/[coll])
|
||||
=/ pax (weld our-beak /web/publish/[coll])
|
||||
=/ pem=[r=dict:clay w=dict:clay] .^([dict:clay dict:clay] %cp pax)
|
||||
:- mod.rul.w.pem
|
||||
(resolve-real rul.w.pem)
|
||||
@ -180,21 +200,6 @@
|
||||
[' ==' ~]
|
||||
==
|
||||
::
|
||||
++ prep
|
||||
|= old=(unit *)
|
||||
^- (quip move _this)
|
||||
~& write-prep+act.bol
|
||||
?~ old
|
||||
:_ this(sat *state)
|
||||
:~ [ost.bol %connect / [~ /'~publish'] %write]
|
||||
:* ost.bol %poke /publish [our.bol %launch]
|
||||
%noun %write /publishtile '/~publish/tile.js'
|
||||
==
|
||||
==
|
||||
::
|
||||
:: [~ this(sat *state)]
|
||||
[~ this(sat (state u.old))]
|
||||
::
|
||||
++ poke-noun
|
||||
|= a=*
|
||||
^- (quip move _this)
|
||||
@ -202,23 +207,10 @@
|
||||
[~ this]
|
||||
?+ a
|
||||
[~ this]
|
||||
::
|
||||
%test
|
||||
=/ whoms (ships-to-whom (sy ~zod ~bus ~marzod ~binzod ~))
|
||||
=/ ships (whom-to-ships whoms)
|
||||
~& whoms
|
||||
~& ships
|
||||
[~ this]
|
||||
::
|
||||
%print-bowl
|
||||
~& bol
|
||||
[~ this]
|
||||
::
|
||||
%update-tile
|
||||
[make-tile-moves this]
|
||||
::
|
||||
%flush-state
|
||||
[~ this(sat *state)]
|
||||
::
|
||||
%print-state
|
||||
~& sat
|
||||
@ -345,7 +337,7 @@
|
||||
::
|
||||
=/ old=(unit collection) (~(get by pubs.sat) col.del)
|
||||
?~ old
|
||||
~|([%cant-delete-nonexistent-blog who.del col.del] !!)
|
||||
[~ da-this]
|
||||
=. pubs.sat (~(del by pubs.sat) col.del)
|
||||
:- ~(tap in ~(key by pos.u.old))
|
||||
(da-emil (affection del))
|
||||
@ -353,10 +345,10 @@
|
||||
::
|
||||
=/ old=(unit collection) (~(get by subs.sat) who.del col.del)
|
||||
?~ old
|
||||
~|([%cant-delete-nonexistent-blog who.del col.del] !!)
|
||||
[~ da-this]
|
||||
=. subs.sat (~(del by subs.sat) who.del col.del)
|
||||
:- ~(tap in ~(key by pos.u.old))
|
||||
(da-emit [ost.bol %pull /collection/[col.del] [who.del %write] ~])
|
||||
(da-emit [ost.bol %pull /collection/[col.del] [who.del %publish] ~])
|
||||
:: iterate through post ids collected before, removing each from
|
||||
:: secondary indices in state
|
||||
::
|
||||
@ -376,9 +368,9 @@
|
||||
(~(get by pubs.sat) col.del)
|
||||
(~(get by subs.sat) who.del col.del)
|
||||
?~ old
|
||||
~|([%cant-delete-nonexistent-blog who.del col.del] !!)
|
||||
da-this
|
||||
?. (~(has in ~(key by pos.u.old)) u.pos.del)
|
||||
~|([%cant-delete-nonexistent-post who.del col.del pos.del] !!)
|
||||
da-this
|
||||
=/ new=collection
|
||||
%= u.old
|
||||
pos (~(del by pos.u.old) u.pos.del)
|
||||
@ -421,25 +413,29 @@
|
||||
?~ col
|
||||
da-this
|
||||
=/ new=collection u.col
|
||||
=/ pin-ids=(list @) (fand [post]~ pin.order.u.col)
|
||||
=. pin.order.u.col
|
||||
=/ pin-ids=(list @) (fand [post]~ pin.order.new)
|
||||
=. pin.order.new
|
||||
|-
|
||||
?~ pin-ids
|
||||
pin.order.u.col
|
||||
pin.order.new
|
||||
%= $
|
||||
pin.order.u.col (oust [i.pin-ids 1] pin.order.u.col)
|
||||
pin.order.new (oust [i.pin-ids 1] pin.order.new)
|
||||
pin-ids t.pin-ids
|
||||
==
|
||||
::
|
||||
=/ unpin-ids=(list @) (fand [post]~ unpin.order.u.col)
|
||||
=. unpin.order.u.col
|
||||
=/ unpin-ids=(list @) (fand [post]~ unpin.order.new)
|
||||
=. unpin.order.new
|
||||
|-
|
||||
?~ unpin-ids
|
||||
unpin.order.u.col
|
||||
unpin.order.new
|
||||
%= $
|
||||
unpin.order.u.col (oust [i.unpin-ids 1] unpin.order.u.col)
|
||||
unpin.order.new (oust [i.unpin-ids 1] unpin.order.new)
|
||||
unpin-ids t.unpin-ids
|
||||
==
|
||||
=? pubs.sat =(who our.bol)
|
||||
(~(put by pubs.sat) coll new)
|
||||
=? subs.sat !=(who our.bol)
|
||||
(~(put by subs.sat) [who coll] new)
|
||||
(da-emil make-tile-moves)
|
||||
::
|
||||
++ da-remove
|
||||
@ -462,14 +458,14 @@
|
||||
++ da-insert-latest
|
||||
|= [who=@p coll=@tas post=@tas]
|
||||
^+ da-this
|
||||
=/ new-date=@da date-created:(need (get-post-by-index who coll post))
|
||||
=/ new-date=@da date-created:(need (get-post-info-by-index who coll post))
|
||||
=/ pre=(list [@p @tas @tas]) ~
|
||||
=/ suf=(list [@p @tas @tas]) latest.sat
|
||||
=? latest.sat =(~ (find [who coll post]~ latest.sat))
|
||||
|-
|
||||
?~ suf
|
||||
(weld pre [who coll post]~)
|
||||
=/ i-date=@da date-created:(need (get-post-by-index i.suf))
|
||||
=/ i-date=@da date-created:(need (get-post-info-by-index i.suf))
|
||||
?: (gte new-date i-date)
|
||||
(weld pre [[who coll post] suf])
|
||||
%= $
|
||||
@ -481,7 +477,7 @@
|
||||
++ da-insert-order
|
||||
|= [who=@p coll=@tas post=@tas]
|
||||
^+ da-this
|
||||
=/ new-post=post-info (need (get-post-by-index who coll post))
|
||||
=/ new-post=post-info (need (get-post-info-by-index who coll post))
|
||||
=/ col=collection (need (get-coll-by-index who coll))
|
||||
::
|
||||
=/ pre=(list @tas) ~
|
||||
@ -498,7 +494,7 @@
|
||||
(snoc pre post)
|
||||
?: =(post i.suf)
|
||||
(weld pre suf)
|
||||
=/ i-date=@da date-created:(need (get-post-by-index who coll i.suf))
|
||||
=/ i-date=@da date-created:(need (get-post-info-by-index who coll i.suf))
|
||||
?: (gte date-created.new-post i-date)
|
||||
(weld pre [post suf])
|
||||
%= $
|
||||
@ -543,7 +539,7 @@
|
||||
=/ rum=(unit rumor) (feel p del)
|
||||
?~ rum
|
||||
~
|
||||
[b %diff %write-rumor u.rum]~
|
||||
[b %diff %publish-rumor u.rum]~
|
||||
:: +feel: delta to rumor
|
||||
::
|
||||
++ feel
|
||||
@ -563,6 +559,19 @@
|
||||
==
|
||||
::
|
||||
++ get-post-by-index
|
||||
|= [who=@p coll=@tas post=@tas]
|
||||
^- (unit (each [post-info manx @t] tang))
|
||||
=/ col=(unit collection)
|
||||
?: =(our.bol who)
|
||||
(~(get by pubs.sat) coll)
|
||||
(~(get by subs.sat) who coll)
|
||||
?~ col ~
|
||||
=/ pos=(unit [bone (each [post-info manx @t] tang)])
|
||||
(~(get by pos.u.col) post)
|
||||
?~ pos ~
|
||||
[~ +.u.pos]
|
||||
::
|
||||
++ get-post-info-by-index
|
||||
|= [who=@p coll=@tas post=@tas]
|
||||
^- (unit post-info)
|
||||
=/ col=(unit collection)
|
||||
@ -599,7 +608,7 @@
|
||||
?: ?=([%error *] build-result.mad)
|
||||
[%.n message.build-result.mad]
|
||||
?> ?=(%bake +<.build-result.mad)
|
||||
?> ?=(%write-info p.cage.build-result.mad)
|
||||
?> ?=(%publish-info p.cage.build-result.mad)
|
||||
[%.y (collection-info q.q.cage.build-result.mad)]
|
||||
::
|
||||
?~ awa
|
||||
@ -667,7 +676,7 @@
|
||||
?: ?=([%error *] build-result.mad)
|
||||
[%.n message.build-result.mad]
|
||||
?> ?=(%bake +<.build-result.mad)
|
||||
?> ?=(%write-post p.cage.build-result.mad)
|
||||
?> ?=(%publish-post p.cage.build-result.mad)
|
||||
[%.y (,[post-info manx @t] q.q.cage.build-result.mad)]
|
||||
::
|
||||
?~ awa
|
||||
@ -735,7 +744,7 @@
|
||||
?: ?=([%error *] build-result.mad)
|
||||
[%.n message.build-result.mad]
|
||||
?> ?=(%bake +<.build-result.mad)
|
||||
?> ?=(%write-comments p.cage.build-result.mad)
|
||||
?> ?=(%publish-comments p.cage.build-result.mad)
|
||||
[%.y (,(list [comment-info @t]) q.q.cage.build-result.mad)]
|
||||
::
|
||||
?~ awa
|
||||
@ -820,8 +829,8 @@
|
||||
^- (list move)
|
||||
=/ files=(list path)
|
||||
?~ post
|
||||
.^((list path) %ct (weld our-beak /web/write/[coll]))
|
||||
.^((list path) %ct (weld our-beak /web/write/[coll]/[u.post]))
|
||||
.^((list path) %ct (weld our-beak /web/publish/[coll]))
|
||||
.^((list path) %ct (weld our-beak /web/publish/[coll]/[u.post]))
|
||||
%+ turn files
|
||||
|= pax=path
|
||||
^- move
|
||||
@ -835,7 +844,7 @@
|
||||
%- (slog u.err)
|
||||
[~ this]
|
||||
::
|
||||
++ poke-write-action
|
||||
++ poke-publish-action
|
||||
|= act=action
|
||||
^- (quip move _this)
|
||||
?- -.act
|
||||
@ -857,27 +866,27 @@
|
||||
now.bol
|
||||
now.bol
|
||||
==
|
||||
=/ pax=path /web/write/[name.act]/write-info
|
||||
=/ pax=path /web/publish/[name.act]/publish-info
|
||||
=/ blog-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/write/[name.act]
|
||||
/web/publish/[name.act]
|
||||
%rw `read.perm.act `write.perm.act
|
||||
==
|
||||
=/ info-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/write/[name.act]/write-info
|
||||
/web/publish/[name.act]/publish-info
|
||||
%rw `*rule:clay `*rule:clay
|
||||
==
|
||||
::
|
||||
=/ wir=wire /collection/[name.act]
|
||||
=/ schema=schematic:ford
|
||||
:* %bake
|
||||
%write-info
|
||||
%publish-info
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[name.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[name.act]/publish/web]
|
||||
==
|
||||
:_ this
|
||||
:~ (write-file pax %write-info !>(conf))
|
||||
:~ (write-file pax %publish-info !>(conf))
|
||||
[ost.bol blog-perms]
|
||||
[ost.bol info-perms]
|
||||
[ost.bol %build wir %.y schema]
|
||||
@ -886,8 +895,8 @@
|
||||
%new-post
|
||||
?. =(who.act our.bol)
|
||||
:_ this
|
||||
[ost.bol %poke /forward [who.act %write] %write-action act]~
|
||||
=/ pax=path /web/write/[coll.act]/[name.act]/udon
|
||||
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
|
||||
=/ pax=path /web/publish/[coll.act]/[name.act]/udon
|
||||
?. (allowed src.bol %write pax)
|
||||
[~ this]
|
||||
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
|
||||
@ -912,27 +921,27 @@
|
||||
=/ post-wir=wire /post/[coll.act]/[name.act]
|
||||
=/ post-schema=schematic:ford
|
||||
:* %bake
|
||||
%write-post
|
||||
%publish-post
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[name.act]/[coll.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[name.act]/[coll.act]/publish/web]
|
||||
==
|
||||
::
|
||||
=/ comments-wir=wire /comments/[coll.act]/[name.act]
|
||||
=/ comments-schema=schematic:ford
|
||||
:* %bake
|
||||
%write-comments
|
||||
%publish-comments
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[name.act]/[coll.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[name.act]/[coll.act]/publish/web]
|
||||
==
|
||||
::
|
||||
=/ post-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/write/[coll.act]/[name.act]/udon
|
||||
/web/publish/[coll.act]/[name.act]/udon
|
||||
%w `[%white (ships-to-whom (sy src.bol ~))]
|
||||
==
|
||||
=/ comment-perms=card
|
||||
:* %perm /perms q.byk.bol
|
||||
/web/write/[coll.act]/[name.act]
|
||||
/web/publish/[coll.act]/[name.act]
|
||||
%w `[%black ~]
|
||||
==
|
||||
:_ this
|
||||
@ -946,8 +955,9 @@
|
||||
%new-comment
|
||||
?. =(who.act our.bol)
|
||||
:_ this
|
||||
[ost.bol %poke /forward [who.act %write] %write-action act]~
|
||||
=/ pax=path /web/write/[coll.act]/[post.act]/(scot %da now.bol)/udon
|
||||
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
|
||||
=/ pax=path
|
||||
/web/publish/[coll.act]/[post.act]/(scot %da now.bol)/publish-comment
|
||||
?. (allowed src.bol %write pax)
|
||||
[~ this]
|
||||
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
|
||||
@ -955,17 +965,9 @@
|
||||
[~ this]
|
||||
?. (~(has by pos.u.col) post.act)
|
||||
[~ this]
|
||||
::
|
||||
=. content.act (cat 3 content.act '\0a') :: XX fix udon parser
|
||||
=/ front=(map knot cord)
|
||||
%- my
|
||||
:~ [%creator (scot %p src.bol)]
|
||||
[%collection coll.act]
|
||||
[%post post.act]
|
||||
[%date-created (scot %da now.bol)]
|
||||
[%last-modified (scot %da now.bol)]
|
||||
==
|
||||
=/ out=@t (update-udon-front front content.act)
|
||||
|
||||
=/ com=comment
|
||||
[[src.bol coll.act post.act now.bol now.bol] content.act]
|
||||
::
|
||||
=/ comment-perms=card
|
||||
:* %perm /perms q.byk.bol pax
|
||||
@ -973,7 +975,7 @@
|
||||
==
|
||||
::
|
||||
:_ this
|
||||
:~ (write-file pax %udon !>(out))
|
||||
:~ (write-file pax %publish-comment !>(com))
|
||||
[ost.bol comment-perms]
|
||||
==
|
||||
::
|
||||
@ -1016,7 +1018,7 @@
|
||||
?. =(src.bol our.bol)
|
||||
[~ this]
|
||||
:_ this
|
||||
[(delete-file /web/write/[coll.act]/[post.act]/[comment.act]/udon)]~
|
||||
[(delete-file /web/publish/[coll.act]/[post.act]/[comment.act]/udon)]~
|
||||
::
|
||||
%edit-collection
|
||||
?. =(src.bol our.bol)
|
||||
@ -1026,9 +1028,9 @@
|
||||
%edit-post
|
||||
?. =(who.act our.bol)
|
||||
:_ this
|
||||
[ost.bol %poke /forward [who.act %write] %write-action act]~
|
||||
[ost.bol %poke /forward [who.act %publish] %publish-action act]~
|
||||
::
|
||||
=/ pax=path /web/write/[coll.act]/[name.act]/udon
|
||||
=/ pax=path /web/publish/[coll.act]/[name.act]/udon
|
||||
?. (allowed src.bol %write pax)
|
||||
[~ this]
|
||||
=/ col=(unit collection) (~(get by pubs.sat) coll.act)
|
||||
@ -1037,9 +1039,14 @@
|
||||
?. (~(has by pos.u.col) name.act)
|
||||
[~ this]
|
||||
::
|
||||
=/ pos=(unit post-info) (get-post-by-index who.act coll.act name.act)
|
||||
=/ pos=(unit (each [post-info manx @t] tang))
|
||||
(get-post-by-index who.act coll.act name.act)
|
||||
?~ pos
|
||||
~| %editing-non-existent-post !!
|
||||
=/ date-created=@da
|
||||
?: ?=(%.y -.u.pos)
|
||||
date-created.-.p.u.pos
|
||||
now.bol
|
||||
::
|
||||
=. content.act (cat 3 content.act '\0a') :: XX fix udon parser
|
||||
=/ front=(map knot cord)
|
||||
@ -1049,9 +1056,9 @@
|
||||
[%collection coll.act]
|
||||
[%filename name.act]
|
||||
[%comments com.act]
|
||||
[%date-created (scot %da date-created.u.pos)]
|
||||
[%date-created (scot %da date-created)]
|
||||
[%last-modified (scot %da now.bol)]
|
||||
[%pinned ?:(pinned.u.pos %true %false)]
|
||||
[%pinned %false]
|
||||
==
|
||||
=/ out=@t (update-udon-front front content.act)
|
||||
::
|
||||
@ -1068,14 +1075,14 @@
|
||||
%+ turn who.act
|
||||
|= who=@p
|
||||
^- move
|
||||
[ost.bol %poke /forward [who %write] %write-action new-act]
|
||||
[ost.bol %poke /forward [who %publish] %publish-action new-act]
|
||||
=. invites.sat (~(put by invites.sat) [src.bol coll.act] title.act)
|
||||
:_ this
|
||||
%+ welp make-tile-moves
|
||||
::
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [b=bone *]
|
||||
[b %diff %write-update %invite %.y src.bol coll.act title.act]
|
||||
[b %diff %publish-update %invite %.y src.bol coll.act title.act]
|
||||
::
|
||||
:: %reject-invite: remove invite from list, acceptance is handled by
|
||||
:: %subscribe action
|
||||
@ -1091,7 +1098,7 @@
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [b=bone *]
|
||||
^- move
|
||||
[b %diff %write-update %invite %.n who.act coll.act u.title]
|
||||
[b %diff %publish-update %invite %.n who.act coll.act u.title]
|
||||
::
|
||||
:: %serve:
|
||||
::
|
||||
@ -1100,44 +1107,44 @@
|
||||
?: (~(has by pubs.sat) coll.act)
|
||||
[~ this]
|
||||
=/ files=(list path)
|
||||
.^((list path) %ct (weld our-beak /web/write/[coll.act]))
|
||||
.^((list path) %ct (weld our-beak /web/publish/[coll.act]))
|
||||
=/ all=[moves=(list move) builds=(set wire)]
|
||||
%+ roll files
|
||||
|= [pax=path out=[moves=(list move) builds=(set wire)]]
|
||||
?+ pax
|
||||
out
|
||||
::
|
||||
[%web %write @tas %write-info ~]
|
||||
[%web %publish @tas %publish-info ~]
|
||||
?> =(coll.act i.t.t.pax)
|
||||
=/ wir=wire /collection/[coll.act]
|
||||
=/ schema=schematic:ford
|
||||
:* %bake
|
||||
%write-info
|
||||
%publish-info
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[coll.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[coll.act]/publish/web]
|
||||
==
|
||||
%= out
|
||||
moves [[ost.bol %build wir %.y schema] moves.out]
|
||||
builds (~(put in builds.out) wir)
|
||||
==
|
||||
::
|
||||
[%web %write @tas @tas %udon ~]
|
||||
[%web %publish @tas @tas %udon ~]
|
||||
?> =(coll.act i.t.t.pax)
|
||||
=/ post i.t.t.t.pax
|
||||
=/ post-wir=wire /post/[coll.act]/[post]
|
||||
=/ post-schema=schematic:ford
|
||||
:* %bake
|
||||
%write-post
|
||||
%publish-post
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[post]/[coll.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[post]/[coll.act]/publish/web]
|
||||
==
|
||||
::
|
||||
=/ comments-wir=wire /comments/[coll.act]/[post]
|
||||
=/ comments-schema=schematic:ford
|
||||
:* %bake
|
||||
%write-comments
|
||||
%publish-comments
|
||||
*coin
|
||||
[[our.bol q.byk.bol] /[post]/[coll.act]/write/web]
|
||||
[[our.bol q.byk.bol] /[post]/[coll.act]/publish/web]
|
||||
==
|
||||
%= out
|
||||
moves
|
||||
@ -1186,12 +1193,12 @@
|
||||
:_ this(outgoing.sat (~(put by outgoing.sat) wir ost.bol))
|
||||
;: welp
|
||||
make-tile-moves
|
||||
[ost.bol %peer wir [who.act %write] wir]~
|
||||
[ost.bol %peer wir [who.act %publish] wir]~
|
||||
?~ title ~
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [b=bone *]
|
||||
^- move
|
||||
[b %diff %write-update %invite %.n who.act coll.act u.title]
|
||||
[b %diff %publish-update %invite %.n who.act coll.act u.title]
|
||||
==
|
||||
::
|
||||
:: %unsubscribe: unsub from a foreign blog, delete all state related to it
|
||||
@ -1221,12 +1228,12 @@
|
||||
latest.sat new-latest
|
||||
outgoing.sat (~(del by outgoing.sat) wir)
|
||||
==
|
||||
:- [u.bon %pull wir [who.act %write] ~]
|
||||
:- [u.bon %pull wir [who.act %publish] ~]
|
||||
%+ welp make-tile-moves
|
||||
%+ turn (prey:pubsub:userlib /primary bol)
|
||||
|= [b=bone *]
|
||||
^- move
|
||||
[b %diff %write-rumor %remove who.act coll.act ~]
|
||||
[b %diff %publish-rumor %remove who.act coll.act ~]
|
||||
::
|
||||
:: %read: notify that we've seen a post
|
||||
::
|
||||
@ -1301,27 +1308,15 @@
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
:: new
|
||||
::
|
||||
[[~ [%'~publish' @t @t %new ~]] ~]
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
:: new
|
||||
::
|
||||
[[~ [%'~publish' %new ~]] ~]
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
:: new post
|
||||
::
|
||||
[[~ [%'~publish' %new %post ~]] ~]
|
||||
[[~ [%'~publish' %new-post ~]] ~]
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
:: new blog
|
||||
::
|
||||
[[~ [%'~publish' %new %blog ~]] ~]
|
||||
[[~ [%'~publish' %new-blog ~]] ~]
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
@ -1340,14 +1335,6 @@
|
||||
=/ blog=@tas i.t.t.site.request-line
|
||||
=/ post=@tas i.t.t.t.site.request-line
|
||||
::
|
||||
:: ?~ who [[ost.bol %http-response not-found:app]~ this]
|
||||
:: =/ col=(unit collection)
|
||||
:: ?: =(u.who our.bol)
|
||||
:: (~(get by pubs.sat) blog)
|
||||
:: (~(get by subs.sat) u.who blog)
|
||||
:: ?~ col [[ost.bol %http-response not-found:app]~ this]
|
||||
:: =/ pos (~(get by pos.u.col) post)
|
||||
:: ?~ pos [[ost.bol %http-response not-found:app]~ this]
|
||||
=/ hym=manx (index (state-to-json sat))
|
||||
:_ this
|
||||
[ost.bol %http-response (manx-response:app hym)]~
|
||||
@ -1407,7 +1394,7 @@
|
||||
?. ?=([@tas ~] wir)
|
||||
[~ this]
|
||||
=/ coll=@tas i.wir
|
||||
=/ pax /web/write/[coll]
|
||||
=/ pax /web/publish/[coll]
|
||||
?. (allowed src.bol %read pax)
|
||||
:_ this
|
||||
[ost.bol %quit ~]~
|
||||
@ -1421,13 +1408,12 @@
|
||||
=/ rum=rumor
|
||||
[%total our.bol coll new]
|
||||
:_ this(pubs.sat (~(put by pubs.sat) coll new))
|
||||
[ost.bol %diff %write-rumor rum]~
|
||||
[ost.bol %diff %publish-rumor rum]~
|
||||
::
|
||||
++ diff-write-rumor
|
||||
++ diff-publish-rumor
|
||||
|= [wir=wire rum=rumor]
|
||||
^- (quip move _this)
|
||||
(bake rum)
|
||||
::
|
||||
:: +poke-handle-http-cancel: received when a connection was killed
|
||||
::
|
||||
++ poke-handle-http-cancel
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -3,7 +3,7 @@
|
||||
;html
|
||||
::
|
||||
;head
|
||||
;title: Write
|
||||
;title: Publish
|
||||
;meta(charset "utf-8");
|
||||
;meta
|
||||
=name "viewport"
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,214 +0,0 @@
|
||||
|%
|
||||
:: +move: output effect
|
||||
::
|
||||
+$ move [bone card]
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ card
|
||||
$% [%connect wire [(unit @t) (list @t)] %server]
|
||||
[%wait wire @da]
|
||||
[%http-response =http-event:http]
|
||||
[%diff %json json]
|
||||
==
|
||||
--
|
||||
:: utilities:
|
||||
::
|
||||
|%
|
||||
::
|
||||
++ parse-request-line
|
||||
|= url=@t
|
||||
^- [[(unit @ta) site=(list @t)] args=(list [key=@t value=@t])]
|
||||
(fall (rush url ;~(plug apat:de-purl:html yque:de-purl:html)) [[~ ~] ~])
|
||||
:: +hello:
|
||||
::
|
||||
++ hello
|
||||
|= name=@t
|
||||
^- octs
|
||||
%- as-octs:mimes:html
|
||||
%- crip
|
||||
%- en-xml:html
|
||||
;html
|
||||
;head
|
||||
;title:"Hello, {(trip name)}"
|
||||
==
|
||||
;body
|
||||
;h1:"Hello, {(trip name)}"
|
||||
;p
|
||||
; Time is
|
||||
;span#time:"?????"
|
||||
==
|
||||
;button#start:"Start Timer"
|
||||
;button#poke:"Random Poke"
|
||||
;script(type "module", src "/~server/hello.js");
|
||||
==
|
||||
==
|
||||
::
|
||||
++ hello-js
|
||||
^- octs
|
||||
%- as-octs:mimes:html
|
||||
'''
|
||||
import * as urb from '/~/channel/channel.js';
|
||||
|
||||
var c = urb.newChannel();
|
||||
|
||||
// The poke button just sends a poke
|
||||
document.getElementById("poke").addEventListener("click", function(){
|
||||
c.poke("zod", "server", "json", 5,
|
||||
function() {
|
||||
console.log("Poke worked");
|
||||
},
|
||||
function(err) {
|
||||
console.log("Poke failed: " + err);
|
||||
});
|
||||
});
|
||||
|
||||
function doSubs() {
|
||||
// The subscription sends the time which makes the thing work.
|
||||
//
|
||||
c.subscribe("zod", "server", "/timer",
|
||||
function(err) {
|
||||
console.log("Failed initial connection: " + err);
|
||||
},
|
||||
function(json) {
|
||||
console.log("Subscription update: ", json);
|
||||
var message = document.getElementById("time");
|
||||
message.innerHTML = json;
|
||||
},
|
||||
function() {
|
||||
console.log("Subscription quit");
|
||||
|
||||
// resubscribe because Gall is broken
|
||||
//
|
||||
// Galls queuing mechanism is broken and will
|
||||
// break subscriptions whenever 20 messages have
|
||||
// been sent.
|
||||
//
|
||||
doSubs();
|
||||
});
|
||||
}
|
||||
doSubs();
|
||||
'''
|
||||
:: +require-authorization: redirect to the login page when unauthenticated
|
||||
::
|
||||
++ require-authorization
|
||||
|* [=bone move=mold this=*]
|
||||
|= handler=$-(inbound-request:eyre (quip move _this))
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
?: authenticated.inbound-request
|
||||
(handler inbound-request)
|
||||
::
|
||||
:_ this
|
||||
^- (list move)
|
||||
=/ redirect=cord
|
||||
%- crip
|
||||
"/~/login?redirect={(trip url.request.inbound-request)}"
|
||||
[bone [%http-response %start [307 ['location' redirect]~] ~ %.y]]~
|
||||
--
|
||||
|%
|
||||
::
|
||||
+$ state
|
||||
$: next-timer=(unit @da)
|
||||
==
|
||||
--
|
||||
::
|
||||
|_ [bow=bowl:gall state]
|
||||
::
|
||||
++ this .
|
||||
::
|
||||
++ prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
~& %prep
|
||||
:- [`move`[ost.bow [%connect / [~ /'~server'] %server]] ~]
|
||||
?~ old
|
||||
this
|
||||
this(+<+ u.old)
|
||||
:: alerts us that we were bound. we need this because the vane calls back.
|
||||
::
|
||||
++ bound
|
||||
|= [wir=wire success=? binding=binding:eyre]
|
||||
~& [%bound success]
|
||||
[~ this]
|
||||
::
|
||||
:: +wake: responds to a %wait send from +handle-start-stream
|
||||
::
|
||||
++ wake
|
||||
|= [wir=wire ~]
|
||||
^- (quip move _this)
|
||||
::
|
||||
~& [%timer-tick wir now.bow]
|
||||
::
|
||||
=/ moves=(list move)
|
||||
%+ turn (prey:pubsub:userlib /timer bow)
|
||||
|= [=bone ^]
|
||||
[bone %diff %json %s (scot %da now.bow)]
|
||||
:: if we have outbound moves, say that we have another timer.
|
||||
::
|
||||
=. next-timer
|
||||
?: ?=(^ moves)
|
||||
`(add now.bow ~s1)
|
||||
~
|
||||
:: if we have any subscribers, add another timer for the future
|
||||
::
|
||||
=? moves ?=(^ moves)
|
||||
[[ost.bow %wait /timer (add now.bow ~s1)] moves]
|
||||
::
|
||||
[moves this]
|
||||
:: +poke-handle-http-request: received on a new connection established
|
||||
::
|
||||
++ poke-handle-http-request
|
||||
%- (require-authorization ost.bow move this)
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
::
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
~& [%request-line request-line]
|
||||
=/ name=@t
|
||||
=+ back-path=(flop site.request-line)
|
||||
?~ back-path
|
||||
'World'
|
||||
i.back-path
|
||||
::
|
||||
?: =(name 'hello')
|
||||
:_ this
|
||||
:~ ^- move
|
||||
:- ost.bow
|
||||
:* %http-response
|
||||
[%start [200 ['content-type' 'application/javascript']~] [~ hello-js] %.y]
|
||||
==
|
||||
==
|
||||
::
|
||||
:_ this
|
||||
:~ ^- move
|
||||
:- ost.bow
|
||||
:* %http-response
|
||||
[%start [200 ['content-type' 'text/html']~] [~ (hello name)] %.y]
|
||||
==
|
||||
==
|
||||
:: +poke-handle-http-cancel: received when a connection was killed
|
||||
::
|
||||
++ poke-handle-http-cancel
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
:: the only long lived connections we keep state about are the stream ones.
|
||||
::
|
||||
[~ this]
|
||||
::
|
||||
++ poke-json
|
||||
|= =json
|
||||
^- (quip move _this)
|
||||
~& [%poke-json json]
|
||||
[~ this]
|
||||
::
|
||||
++ peer-timer
|
||||
|= pax/path
|
||||
^- (quip move _this)
|
||||
:: if we don't have a timer, set a timer.
|
||||
?: ?=(^ next-timer)
|
||||
[~ this]
|
||||
::
|
||||
:- [ost.bow %wait /timer (add now.bow ~s1)]~
|
||||
this(next-timer `(unit @da)`[~ (add now.bow ~s1)])
|
||||
--
|
@ -433,7 +433,7 @@
|
||||
(ta-open nev.rum)
|
||||
::
|
||||
$config
|
||||
=+ cur=(fall (~(get by mirrors) cir.rum) *config)
|
||||
=+ cur=(~(gut by mirrors) cir.rum *config)
|
||||
=. +>.$
|
||||
=< sh-done
|
||||
%- ~(sh-show-config sh cli)
|
||||
@ -477,8 +477,8 @@
|
||||
==
|
||||
::
|
||||
$status
|
||||
=+ rem=(fall (~(get by remotes) cir.rum) *group)
|
||||
=+ cur=(fall (~(get by rem) who.rum) *status)
|
||||
=+ rem=(~(gut by remotes) cir.rum *group)
|
||||
=+ cur=(~(gut by rem) who.rum *status)
|
||||
=. +>.$
|
||||
=< sh-done
|
||||
%- ~(sh-show-status sh cli)
|
||||
@ -1212,7 +1212,7 @@
|
||||
%- zing
|
||||
=/ sos
|
||||
=- ~(tap in src:-)
|
||||
(fall (~(get by mirrors) incir) *config)
|
||||
(~(gut by mirrors) incir *config)
|
||||
%+ turn ~(tap in pas)
|
||||
|= c/circle
|
||||
%+ skim sos
|
||||
@ -1373,7 +1373,7 @@
|
||||
=< (sh-fact %mor (murn (sort ~(tap by remotes) aor) .))
|
||||
|= {cir/circle gop/group} ^- (unit sole-effect:sole-sur)
|
||||
?. |(=(~ cis) (~(has in cis) cir)) ~
|
||||
?: =(%mailbox sec.con:(fall (~(get by mirrors) cir) *config)) ~
|
||||
?: =(%mailbox sec.con:(~(gut by mirrors) cir *config)) ~
|
||||
?. (~(has in sources) cir) ~
|
||||
=- `[%tan rose+[", " `~]^- leaf+~(cr-full cr cir) ~]
|
||||
=< (murn (sort ~(tap by gop) aor) .)
|
||||
@ -1461,7 +1461,7 @@
|
||||
%+ turn
|
||||
:: make sure to exclude {nom} itself.
|
||||
=- ~(tap in (~(del in src:-) [cir ~]))
|
||||
(fall (~(get by mirrors) cir) *config)
|
||||
(~(gut by mirrors) cir *config)
|
||||
|= s/^source
|
||||
^- sole-effect:sole-sur
|
||||
:- %txt
|
||||
@ -2059,7 +2059,7 @@
|
||||
?^ han han
|
||||
=+ gop=(~(get by remotes) cir)
|
||||
?~ gop ~
|
||||
han.man:(fall (~(get by u.gop) hos.one) *status)
|
||||
han.man:(~(gut by u.gop) hos.one *status)
|
||||
?~ nic (cr-curt |)
|
||||
=+ raw=(scag 14 (trip u.nic))
|
||||
=+ len=(sub 14 (lent raw))
|
||||
|
@ -152,19 +152,8 @@
|
||||
++ skip-completely
|
||||
^~ ^- (map path tape)
|
||||
%- my :~ ::TODO don't hardcode
|
||||
:- /ren/css "not meant to be called outside /web/pack"
|
||||
:- /ren/js "not meant to be called outside /web/pack"
|
||||
:- /ren/run "not meant to be called except on a (different) hoon file"
|
||||
:- /ren/collections "temporarily disabled"
|
||||
:- /ren/rss-xml "scrys into eyre"
|
||||
:- /ren/test-gen "temporarily disabled"
|
||||
:- /ren/urb "temporarily disabled"
|
||||
:- /ren/x-urb "temporarily disabled"
|
||||
:- /ren/x-htm "temporarily disabled"
|
||||
:- /ren/x-collections-snip "temporarily disabled"
|
||||
:- /ren/x-collections-json "temporarily disabled"
|
||||
::
|
||||
:- /web/landscape "/$ doensn't work in tests"
|
||||
==
|
||||
::
|
||||
++ failing
|
||||
|
@ -18,7 +18,7 @@
|
||||
:: +card: output effect payload
|
||||
::
|
||||
+$ poke
|
||||
$% [%noun [@tas path @t]]
|
||||
$% [%launch-action [@tas path @t]]
|
||||
==
|
||||
::
|
||||
+$ card
|
||||
@ -44,11 +44,11 @@
|
||||
++ prep
|
||||
|= old=(unit tim=@da)
|
||||
^- (quip move _this)
|
||||
=/ launchnoun [%noun [%timer /tile '/~timer/js/tile.js']]
|
||||
=/ launcha [%launch-action [%timer /tile '/~timer/js/tile.js']]
|
||||
:-
|
||||
:~
|
||||
[ost.bol %connect / [~ /'~timer'] %timer]
|
||||
[ost.bol %poke /timer [our.bol %launch] launchnoun]
|
||||
[ost.bol %poke /timer [our.bol %launch] launcha]
|
||||
==
|
||||
?~ old
|
||||
this
|
||||
@ -77,7 +77,7 @@
|
||||
[~ this]
|
||||
=/ str/@t +.jon
|
||||
?: =(str 'start')
|
||||
=/ data/@da (add now.bol ~s10)
|
||||
=/ data/@da (add now.bol ~m20)
|
||||
:_ this(tim data)
|
||||
[[ost.bol %wait /timer data] (send-tile-diff [%s (scot %da data)])]
|
||||
?: =(str 'stop')
|
||||
@ -116,7 +116,10 @@
|
||||
++ wake
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
:- (send-tile-diff [%s 'alarm'])
|
||||
this(tim *@da)
|
||||
?~ err
|
||||
:- (send-tile-diff [%s 'alarm'])
|
||||
this(tim *@da)
|
||||
~& err
|
||||
[~ this]
|
||||
::
|
||||
--
|
||||
|
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@
|
||||
[%wait wire @da]
|
||||
==
|
||||
+$ poke
|
||||
$% [%noun [@tas path @t]]
|
||||
$% [%launch-action [@tas path @t]]
|
||||
==
|
||||
+$ state
|
||||
$% [%0 data=json time=@da location=@t timer=(unit @da)]
|
||||
@ -45,10 +45,12 @@
|
||||
++ prep
|
||||
|= old=(unit state)
|
||||
^- (quip move _this)
|
||||
=/ launcha
|
||||
[%launch-action [%weather /weathertile '/~weather/js/tile.js']]
|
||||
:-
|
||||
:~
|
||||
[ost.bol %connect / [~ /'~weather'] %weather]
|
||||
[ost.bol %poke /weather [our.bol %launch] [%noun [%weather /weathertile '/~weather/js/tile.js']]]
|
||||
[ost.bol %poke /weather [our.bol %launch] launcha]
|
||||
==
|
||||
?~ old
|
||||
this
|
||||
@ -70,15 +72,14 @@
|
||||
=/ str/@t +.jon
|
||||
=/ req/request:http (request-darksky str)
|
||||
=/ out *outbound-config:iris
|
||||
=/ lismov [ost.bol %request /[(scot %da now.bol)] req out]~
|
||||
?~ timer
|
||||
:- %+ weld
|
||||
`(list move)`[ost.bol %wait /timer (add now.bol ~d1)]~
|
||||
`(list move)`[ost.bol %request /[(scot %da now.bol)] req out]~
|
||||
:- [[ost.bol %wait /timer (add now.bol ~h3)] lismov]
|
||||
%= this
|
||||
location str
|
||||
timer `(add now.bol ~d1)
|
||||
timer `(add now.bol ~h3)
|
||||
==
|
||||
:- [ost.bol %request /[(scot %da now.bol)] req out]~
|
||||
:- lismov
|
||||
%= this
|
||||
location str
|
||||
==
|
||||
@ -110,17 +111,21 @@
|
||||
?~ data
|
||||
:: data is null
|
||||
[~ this]
|
||||
=/ jon/(unit json) (de-json:html q.data.u.data)
|
||||
?~ jon
|
||||
=/ ujon/(unit json) (de-json:html q.data.u.data)
|
||||
?~ ujon
|
||||
[~ this]
|
||||
?> ?=(%o -.u.jon)
|
||||
=/ ayyy/json %- pairs:enjs:format :~
|
||||
currently+(~(got by p.u.jon) 'currently')
|
||||
daily+(~(got by p.u.jon) 'daily')
|
||||
?> ?=(%o -.u.ujon)
|
||||
?: (gth 200 status-code.response-header.response)
|
||||
~& weather+u.ujon
|
||||
~& weather+location
|
||||
[~ this]
|
||||
=/ jon/json %- pairs:enjs:format :~
|
||||
currently+(~(got by p.u.ujon) 'currently')
|
||||
daily+(~(got by p.u.ujon) 'daily')
|
||||
==
|
||||
:- (send-tile-diff ayyy)
|
||||
:- (send-tile-diff jon)
|
||||
%= this
|
||||
data ayyy
|
||||
data jon
|
||||
time now.bol
|
||||
==
|
||||
::
|
||||
@ -128,10 +133,10 @@
|
||||
%- (require-authorization:app ost.bol move this)
|
||||
|= =inbound-request:eyre
|
||||
^- (quip move _this)
|
||||
=+ request-line=(parse-request-line url.request.inbound-request)
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ request-line (parse-request-line url.request.inbound-request)
|
||||
=/ back-path (flop site.request-line)
|
||||
=/ name=@t
|
||||
=+ back-path=(flop site.request-line)
|
||||
=/ back-path (flop site.request-line)
|
||||
?~ back-path
|
||||
''
|
||||
i.back-path
|
||||
@ -150,12 +155,16 @@
|
||||
++ wake
|
||||
|= [wir=wire err=(unit tang)]
|
||||
^- (quip move _this)
|
||||
=/ req/request:http (request-darksky location)
|
||||
=/ lismov/(list move)
|
||||
`(list move)`[ost.bol %request /[(scot %da now.bol)] req *outbound-config:iris]~
|
||||
?~ timer
|
||||
:- (weld lismov `(list move)`[ost.bol %wait /timer (add now.bol ~h3)]~)
|
||||
this(timer `(add now.bol ~h3))
|
||||
[lismov this]
|
||||
?~ err
|
||||
=/ req/request:http (request-darksky location)
|
||||
=/ out *outbound-config:iris
|
||||
=/ lismov/(list move)
|
||||
[ost.bol %request /[(scot %da now.bol)] req out]~
|
||||
?~ timer
|
||||
:- [[ost.bol %wait /timer (add now.bol ~h3)] lismov]
|
||||
this(timer `(add now.bol ~h3))
|
||||
[lismov this]
|
||||
~& err
|
||||
[~ this]
|
||||
::
|
||||
--
|
||||
|
File diff suppressed because one or more lines are too long
27
pkg/arvo/gen/acme/domain-validation.hoon
Normal file
27
pkg/arvo/gen/acme/domain-validation.hoon
Normal file
@ -0,0 +1,27 @@
|
||||
:: :acme domain validation request handler
|
||||
::
|
||||
|= [[now=@da eny=@ bek=beak] $~ $~]
|
||||
|= [authorized=? =request:http]
|
||||
^- simple-payload:http
|
||||
=/ url=(unit (pair pork:eyre quay:eyre))
|
||||
%+ rush url.request
|
||||
;~(plug ;~(pose apat:de-purl:html (easy *pork:eyre)) yque:de-purl:html)
|
||||
::
|
||||
:: url doesn't match expected binding from :acme
|
||||
::
|
||||
?. ?=(^ url)
|
||||
~| [%invalid-url url.request] !!
|
||||
?. ?=([%'.well-known' %acme-challenge *] q.p.u.url)
|
||||
~| [%unknown-url url.request] !!
|
||||
::
|
||||
:: 404 if token missing from url or not in app
|
||||
::
|
||||
?~ t.t.q.p.u.url
|
||||
[[%404 ~] ~]
|
||||
=/ challenge=@t i.t.t.q.p.u.url
|
||||
=/ response
|
||||
.^((unit @t) %gx /=acme/(scot %da now)/domain-validation/[challenge]/noun)
|
||||
?~ response
|
||||
[[%404 ~] ~]
|
||||
:- [200 ['content-type' 'text/html']~]
|
||||
(some (as-octs:mimes:html u.response))
|
@ -1,458 +0,0 @@
|
||||
!:
|
||||
:- %say
|
||||
|= *
|
||||
:- %noun
|
||||
=- %hello
|
||||
=> |%
|
||||
++ tope :: topographic type
|
||||
$@ $? %& :: cell or atom
|
||||
%| :: atom
|
||||
== ::
|
||||
(pair tope tope) :: cell
|
||||
--
|
||||
|%
|
||||
++ ax
|
||||
=+ :* dom=`axis`1
|
||||
doc=*(list what)
|
||||
==
|
||||
|_ mod/tile
|
||||
++ home
|
||||
:: express a hoon against the original subject
|
||||
::
|
||||
|=(gen/hoon ^-(hoon ?:(=(1 dom) gen [%tsgr [%$ dom] gen])))
|
||||
::
|
||||
++ default
|
||||
:: produce a hoon that makes the model's default value, untyped
|
||||
::
|
||||
|- ^- hoon
|
||||
?- mod
|
||||
{^ *}
|
||||
[$(mod -.mod) $(mod +.mod)]
|
||||
::
|
||||
{$axil *}
|
||||
?+ p.mod [%rock %$ 0]
|
||||
$cell [[%rock %$ 0] [%rock %$ 0]]
|
||||
$void [%zpzp ~]
|
||||
==
|
||||
::
|
||||
{$bark *}
|
||||
$(mod q.mod)
|
||||
::
|
||||
{$herb *}
|
||||
=+ cys=~(boil ap p.mod)
|
||||
?: ?=($herb -.cys)
|
||||
(home [%tsgl [%limb %$] p.mod])
|
||||
$(mod cys)
|
||||
::
|
||||
{$deet *}
|
||||
$(mod q.mod)
|
||||
::
|
||||
{$fern *}
|
||||
:: last entry is the default value
|
||||
::
|
||||
|- ^- hoon
|
||||
?~(t.p.mod ^$(mod i.p.mod) $(i.p.mod i.t.p.mod, t.p.mod t.t.p.mod))
|
||||
::
|
||||
{$kelp *}
|
||||
:: last entry is the default value
|
||||
::
|
||||
|- ^- hoon
|
||||
?~(t.p.mod ^$(mod i.p.mod) $(i.p.mod i.t.p.mod, t.p.mod t.t.p.mod))
|
||||
::
|
||||
{$leaf *}
|
||||
[%rock p.mod q.mod]
|
||||
::
|
||||
{$plow *}
|
||||
$(mod q.mod)
|
||||
::
|
||||
{$reed *}
|
||||
$(mod p.mod)
|
||||
::
|
||||
{$vine *}
|
||||
$(mod q.mod)
|
||||
::
|
||||
{$weed *}
|
||||
(home p.mod)
|
||||
==
|
||||
::
|
||||
++ trivial
|
||||
:: ersatz by trivial construction
|
||||
::
|
||||
^- hoon
|
||||
:+ %tsls
|
||||
[%bust %noun]
|
||||
~(construct sample [2 %|])
|
||||
::
|
||||
++ basic
|
||||
|= bas/base
|
||||
?- bas
|
||||
::
|
||||
{$atom *}
|
||||
:: trivial zero
|
||||
::
|
||||
[%sand p.bas 0]
|
||||
::
|
||||
$noun
|
||||
:: raw nock produces noun type
|
||||
::
|
||||
=+([%rock %$ 0] [%ktls [%dttr - - [%rock %$ 1]] -])
|
||||
::
|
||||
$cell
|
||||
:: reduce to pair of nouns
|
||||
::
|
||||
=+($(mod [%axil %noun]) [- -])
|
||||
::
|
||||
$bean
|
||||
:: comparison produces boolean type
|
||||
::
|
||||
=+([%rock %$ 0] [%ktls [%dtts - -] -])
|
||||
::
|
||||
$null
|
||||
[%rock %n 0]
|
||||
::
|
||||
$void
|
||||
:: should not actually be a thing
|
||||
::
|
||||
[%zpzp ~]
|
||||
==
|
||||
::
|
||||
++ decorate
|
||||
:: document
|
||||
::
|
||||
|= gen/hoon
|
||||
^- hoon
|
||||
?~ doc gen
|
||||
=/ fin $(doc t.doc)
|
||||
?~(i.doc gen [%docs u.i.doc gen])
|
||||
::
|
||||
++ ersatz
|
||||
:: produce a correctly typed instance without subject
|
||||
::
|
||||
^- hoon
|
||||
?- mod
|
||||
{^ *}
|
||||
%- decorate
|
||||
=. doc ~
|
||||
[ersatz(mod -.mod) ersatz(mod +.mod)]
|
||||
::
|
||||
{$axil *}
|
||||
(decorate (basic p.mod))
|
||||
::
|
||||
{$bark *}
|
||||
[%ktts p.mod ersatz(mod q.mod)]
|
||||
::
|
||||
{$herb *}
|
||||
%- decorate
|
||||
=. doc ~
|
||||
=+ cys=~(boil ap p.mod)
|
||||
?: ?=($herb -.cys)
|
||||
(home [%tsgl [%limb %$] p.mod])
|
||||
ersatz(mod cys)
|
||||
::
|
||||
{$deet *}
|
||||
[%dbug p.mod ersatz(mod q.mod)]
|
||||
::
|
||||
{$fern *}
|
||||
trivial
|
||||
::
|
||||
{$kelp *}
|
||||
trivial
|
||||
::
|
||||
{$leaf *}
|
||||
(decorate [%rock p.mod q.mod])
|
||||
::
|
||||
{$plow *}
|
||||
ersatz(mod q.mod, doc [p.mod doc])
|
||||
:: atom/cell, $@
|
||||
::
|
||||
{$reed *}
|
||||
trivial
|
||||
:: pair/switch, $^
|
||||
::
|
||||
{$vine *}
|
||||
trivial
|
||||
::
|
||||
{$weed *}
|
||||
(home p.mod)
|
||||
==
|
||||
::
|
||||
++ factory
|
||||
:: produce a normalizing gate (mold)
|
||||
::
|
||||
^- hoon
|
||||
:^ %brts ~^~
|
||||
[%base %noun]
|
||||
~(construct sample [6 %&])
|
||||
::
|
||||
++ sample
|
||||
:: normalize a sample of the subject
|
||||
::
|
||||
|_ $: :: axe: axis to sample
|
||||
:: top: topographic type of sample
|
||||
::
|
||||
axe/axis
|
||||
top/tope
|
||||
==
|
||||
++ basic
|
||||
|= bas/base
|
||||
:: apply documentation
|
||||
::
|
||||
?^ doc document
|
||||
?- bas
|
||||
{%atom *}
|
||||
:: rez: fake instance
|
||||
::
|
||||
=/ rez ersatz
|
||||
?^ top rez
|
||||
?: =(%| top)
|
||||
:: xx sanitize
|
||||
::
|
||||
fetch
|
||||
[%wtpt fetch-wing fetch rez]
|
||||
::
|
||||
$noun
|
||||
fetch
|
||||
::
|
||||
$cell
|
||||
?^ top fetch
|
||||
:: rez: fake instance
|
||||
::
|
||||
=/ rez ersatz
|
||||
?: =(%| top)
|
||||
rez
|
||||
[%wtpt fetch-wing rez fetch]
|
||||
::
|
||||
$bean
|
||||
?^ top ersatz
|
||||
:^ %wtcl
|
||||
[%dtts [%rock %$ |] [%$ axe]]
|
||||
[%rock %f |]
|
||||
[%rock %f &]
|
||||
::
|
||||
$null
|
||||
ersatz
|
||||
::
|
||||
$void
|
||||
ersatz
|
||||
==
|
||||
++ fetch
|
||||
:: load the sample
|
||||
::
|
||||
^- hoon
|
||||
[%$ axe]
|
||||
::
|
||||
++ fetch-wing
|
||||
:: load, as a wing
|
||||
::
|
||||
^- wing
|
||||
[[%& axe] ~]
|
||||
::
|
||||
++ choice
|
||||
:: match full models, by trying them
|
||||
::
|
||||
|= $: :: one: first option
|
||||
:: rep: other options
|
||||
::
|
||||
one/tile
|
||||
rep/(list tile)
|
||||
==
|
||||
^- hoon
|
||||
:: if no other choices, construct head
|
||||
::
|
||||
?~ rep construct(mod one)
|
||||
:: fin: loop completion
|
||||
::
|
||||
=/ fin/hoon $(one i.rep, rep t.rep)
|
||||
:: new: trial product
|
||||
:: old: original subject
|
||||
::
|
||||
=/ new [%$ 2]
|
||||
=* old [%$ 3]
|
||||
:: build trial noun
|
||||
::
|
||||
:+ %tsls
|
||||
:: build the sample with the first option
|
||||
::
|
||||
construct(mod one)
|
||||
:: build test
|
||||
::
|
||||
:^ %wtcl
|
||||
:: if the trial noun equals the sample
|
||||
::
|
||||
[%dtts new fetch]
|
||||
:: produce the trial noun
|
||||
::
|
||||
new
|
||||
:: continue with the original subject
|
||||
::
|
||||
[%tsgr old fin]
|
||||
::
|
||||
++ switch
|
||||
|= $: :: one: first format
|
||||
:: two: more formats
|
||||
::
|
||||
one/line
|
||||
rep/(list line)
|
||||
==
|
||||
^- hoon
|
||||
:: if no other choices, construct head
|
||||
::
|
||||
?~ rep construct(mod `tile`one)
|
||||
:: fin: loop completion
|
||||
::
|
||||
=/ fin/hoon $(one i.rep, rep t.rep)
|
||||
:: interrogate this instance
|
||||
::
|
||||
:^ %wtcl
|
||||
:: test if we match this wing
|
||||
::
|
||||
[%wtts p.i.rep fetch-wing]
|
||||
:: use this format
|
||||
::
|
||||
:- `hoon`p.i.rep
|
||||
construct(mod q.i.rep, top &, axe (peg axe 3))
|
||||
:: continue in the loop
|
||||
::
|
||||
fin
|
||||
::
|
||||
++ probe
|
||||
:: probe for cell or default
|
||||
::
|
||||
^- hoon
|
||||
:: against constructor
|
||||
::
|
||||
:+ %tsgr
|
||||
:: constructor trap
|
||||
::
|
||||
:+ %brdt ~^~
|
||||
:: construct within trap
|
||||
::
|
||||
%= construct
|
||||
:: old context within trap context
|
||||
::
|
||||
dom (peg 3 dom)
|
||||
:: old sample within trap sample
|
||||
::
|
||||
axe (peg 3 axe)
|
||||
:: only kick trap if sample is known cell
|
||||
::
|
||||
top [& &]
|
||||
==
|
||||
:: boc: call constructor
|
||||
:: but: default, but coerce type to call
|
||||
::
|
||||
=/ boc/hoon [%limb %$]
|
||||
=/ but/hoon [%ktls boc default]
|
||||
?: =(& top)
|
||||
:: may be atom or cell; default or construct
|
||||
::
|
||||
[%wtpt fetch-wing but boc]
|
||||
:: must be atom; construct
|
||||
::
|
||||
but
|
||||
::
|
||||
++ document
|
||||
:: document and construct
|
||||
::
|
||||
|- ^- hoon
|
||||
?~ doc construct
|
||||
=/ fin $(doc t.doc)
|
||||
?~(i.doc fin [%docs u.i.doc fin])
|
||||
::
|
||||
++ construct
|
||||
:: constructor at arbitrary sample
|
||||
::
|
||||
^- hoon
|
||||
?- mod
|
||||
::
|
||||
:: cell
|
||||
::
|
||||
{^ *}
|
||||
:: apply help
|
||||
::
|
||||
?^ doc document
|
||||
:: probe unless we know the sample is a cell
|
||||
::
|
||||
?@ top probe
|
||||
:: if known cell, descend directly
|
||||
::
|
||||
:- construct(mod -.mod, top p.top, axe (peg axe 2))
|
||||
construct(mod +.mod, top q.top, axe (peg axe 3))
|
||||
::
|
||||
:: base
|
||||
::
|
||||
{$axil *}
|
||||
(basic p.mod)
|
||||
::
|
||||
:: name, $=
|
||||
::
|
||||
{$bark *}
|
||||
[%ktts p.mod construct(mod q.mod)]
|
||||
::
|
||||
:: debug
|
||||
::
|
||||
{$deet *}
|
||||
[%dbug p.mod construct(mod q.mod)]
|
||||
::
|
||||
:: choice, $?
|
||||
::
|
||||
{$fern *}
|
||||
(choice i.p.mod t.p.mod)
|
||||
::
|
||||
:: synthesis, $;
|
||||
::
|
||||
{$herb *}
|
||||
?^ doc document
|
||||
=+ cys=~(boil ap p.mod)
|
||||
?: ?=($herb -.cys)
|
||||
[%cnhp (home p.mod) fetch ~]
|
||||
construct(mod cys)
|
||||
::
|
||||
:: switch, $%
|
||||
::
|
||||
{$kelp *}
|
||||
:: if atom or unknown, probe
|
||||
::
|
||||
?@ top probe
|
||||
:: if cell, enter switch directly
|
||||
::
|
||||
(switch i.p.mod t.p.mod)
|
||||
::
|
||||
:: constant
|
||||
::
|
||||
{$leaf *}
|
||||
(decorate [%rock p.mod q.mod])
|
||||
::
|
||||
:: documentation
|
||||
::
|
||||
{$plow *}
|
||||
construct(doc [p.mod doc], mod q.mod)
|
||||
::
|
||||
:: branch, $@
|
||||
::
|
||||
{$reed *}
|
||||
?^ doc document
|
||||
?@ top
|
||||
?: =(%| top)
|
||||
construct(mod p.mod)
|
||||
[%wtpt fetch-wing construct(mod p.mod) construct(mod q.mod)]
|
||||
construct(mod q.mod)
|
||||
::
|
||||
:: bridge, $^
|
||||
::
|
||||
{$vine *}
|
||||
?^ doc document
|
||||
?@ top probe
|
||||
:^ %wtpt
|
||||
fetch-wing(axe (peg axe 2))
|
||||
construct(mod q.mod)
|
||||
construct(mod p.mod)
|
||||
::
|
||||
:: weed, $_
|
||||
::
|
||||
{$weed *}
|
||||
(decorate (home p.mod))
|
||||
==
|
||||
--
|
||||
--
|
||||
--
|
@ -1,15 +0,0 @@
|
||||
:: Set admin users
|
||||
::
|
||||
:::: /hoon/admins/ask/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{who/(list ship) ~}
|
||||
==
|
||||
:- %ask-admins ^- (set ship)
|
||||
~? =(~ who) %admins-unset
|
||||
(silt who)
|
@ -1,57 +0,0 @@
|
||||
!:
|
||||
:- %say
|
||||
|= *
|
||||
:- %noun
|
||||
=- "hello, world"
|
||||
|%
|
||||
+$ scan [=loop=(map =@ud =xray) =xray]
|
||||
+$ xray
|
||||
$~ %noun
|
||||
$@ $? %noun
|
||||
%void
|
||||
==
|
||||
$% :: %bark: atom selection
|
||||
::
|
||||
[%bark =(map atom aura)]
|
||||
:: %bush: head-of-cell superposition
|
||||
::
|
||||
[%bush wide=xray tall=xray]
|
||||
:: %cell: ordered pair
|
||||
::
|
||||
[%cell head=xray tail=xray]
|
||||
:: %core: functional attribute battery
|
||||
::
|
||||
[%core =vair =xray =(map term (map term xray))]
|
||||
:: %face: namespace
|
||||
::
|
||||
[%face =term =xray]
|
||||
:: %fork: disordered superposition
|
||||
::
|
||||
[%fork =(set xray)]
|
||||
:: %hint: context-preserving type hint
|
||||
::
|
||||
[%hint [=type =note] =xray]
|
||||
:: %knot: recursion root
|
||||
::
|
||||
[%knot =(set @ud) =xray]
|
||||
:: %loop: recursion point
|
||||
::
|
||||
[%loop index=@ud]
|
||||
:: %rock: constant
|
||||
::
|
||||
[%rock =atom =aura]
|
||||
:: %root: atom/cell superposition
|
||||
::
|
||||
[%root flat=xray deep=xray]
|
||||
:: %sand: variable atom
|
||||
::
|
||||
[%sand =aura]
|
||||
:: %wood: tagged superposition
|
||||
::
|
||||
[%wood =(map atom (pair aura xray))]
|
||||
==
|
||||
++ foo
|
||||
|= bar=xray
|
||||
!!
|
||||
--
|
||||
|
@ -1,11 +0,0 @@
|
||||
:: Request a planet from Tlon Inc.
|
||||
::
|
||||
:::: /hoon/ask/hood/gen
|
||||
::
|
||||
/? 310
|
||||
:- %say
|
||||
|= {^ {mel/cord ~} ~}
|
||||
=+ adr=(star ;~(less (mask "\"\\()[],:;<>@") prn))
|
||||
=+ dom=[;~(plug dlab dot (most dot dlab))]:de-purl:html
|
||||
=+ ~|(bad-email+mel (rash mel ;~((glue vat) adr dom)))
|
||||
helm-send-ask+mel
|
@ -1,14 +0,0 @@
|
||||
:: Eyre: set web root
|
||||
::
|
||||
:::: /hoon/serve/hood/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
~
|
||||
~
|
||||
==
|
||||
[%helm-serve [~ /] [%home /gen/frontpage/hoon ~]]
|
@ -1,13 +0,0 @@
|
||||
:: Helm: break arvo somehow?? XX unknown
|
||||
::
|
||||
:::: /hoon/deset/hood/gen
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{arg/~ ~}
|
||||
==
|
||||
[%helm-deset ~]
|
@ -7,12 +7,10 @@
|
||||
::::
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{{pax/$@(term {i/knot t/path}) ~} ~}
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[pax=path syd=desk gen=path ~]
|
||||
~
|
||||
==
|
||||
:- %helm-serve
|
||||
?@ pax pax
|
||||
=+ bem=(need (de-beam:format pax))
|
||||
?. =([%da now] r.bem) :: XX actual sentinel
|
||||
bem
|
||||
bem(r [%ud 0])
|
||||
:+ %helm-serve
|
||||
`binding:eyre`[~ pax]
|
||||
`generator:eyre`[syd gen ~]
|
||||
|
@ -1,11 +0,0 @@
|
||||
:: tlon: add fora notifications to local urbit-meta
|
||||
::
|
||||
:: make the local urbit-meta pull from {for}'s fora notification channels.
|
||||
::
|
||||
:::: /gen/hood/tlon/add-fora/hoon
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{{for/ship ~} ~}
|
||||
==
|
||||
[%helm-tlon-add-fora for]
|
@ -1,11 +0,0 @@
|
||||
:: tlon: add stream to local urbit-meta
|
||||
::
|
||||
:: make the local urbit-meta pull from {web}'s stream.
|
||||
::
|
||||
:::: /gen/hood/tlon/add-stream/hoon
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{{web/ship ~} ~}
|
||||
==
|
||||
[%helm-tlon-add-stream web]
|
@ -1,12 +0,0 @@
|
||||
:: tlon: configure stream ship
|
||||
::
|
||||
:: create a local stream channel and have it pull from
|
||||
:: {met}'s urbit-meta.
|
||||
::
|
||||
:::: /gen/hood/tlon/init-stream/hoon
|
||||
::
|
||||
:- %say
|
||||
|= $: {now/@da eny/@uvJ bec/beak}
|
||||
{{met/ship ~} ~}
|
||||
==
|
||||
[%helm-tlon-init-stream met]
|
@ -24,7 +24,7 @@
|
||||
::
|
||||
+$ poke
|
||||
$% [%hall-action action:hall]
|
||||
[%noun [@tas path @t]]
|
||||
[%launch-action [@tas path @t]]
|
||||
==
|
||||
::
|
||||
+$ state
|
||||
|
@ -1,992 +0,0 @@
|
||||
::
|
||||
:::: /hoon/collections/lib
|
||||
::
|
||||
/? 309
|
||||
/- hall
|
||||
/+ cram, elem-to-react-json
|
||||
:: ::
|
||||
~% %collections-lib ..is ~
|
||||
|%
|
||||
+$ move [bone card]
|
||||
::
|
||||
+$ card
|
||||
$% [%info wire toro:clay]
|
||||
[%poke wire dock poke]
|
||||
[%perm wire desk path rite:clay]
|
||||
[%peer wire dock path]
|
||||
[%pull wire dock ~]
|
||||
[%diff diff]
|
||||
==
|
||||
::
|
||||
+$ diff
|
||||
$% [%collections-prize prize]
|
||||
[%collections-rumor rumor]
|
||||
[%hall-rumor rumor:hall]
|
||||
==
|
||||
::
|
||||
+$ poke
|
||||
$% [%hall-action action:hall]
|
||||
[%collections-action action]
|
||||
[%json json]
|
||||
==
|
||||
::
|
||||
+$ state
|
||||
$% [%0 col=collection str=streams]
|
||||
==
|
||||
::
|
||||
+$ streams
|
||||
$: :: inbox config and messages
|
||||
::
|
||||
inbox=[con=(unit config:hall) env=(list envelope:hall)]
|
||||
:: names and configs of all circles we know about
|
||||
::
|
||||
circles=(map circle:hall (unit config:hall))
|
||||
:: names of all circles we own
|
||||
::
|
||||
our-circles=(set name:hall)
|
||||
:: list of messages in all our DM circles
|
||||
::
|
||||
dms=(map name:hall [ini=ship env=(list envelope:hall)])
|
||||
:: all the DM invites we've received
|
||||
::
|
||||
invites=(list envelope:hall)
|
||||
==
|
||||
::
|
||||
+$ prize
|
||||
$: :: inbox config and messages
|
||||
::
|
||||
inbox=[con=(unit config:hall) env=(list envelope:hall)]
|
||||
:: names and configs of all circles we know about
|
||||
::
|
||||
circles=(map circle:hall (unit config:hall))
|
||||
:: names of all circles we own
|
||||
::
|
||||
our-circles=(set name:hall)
|
||||
:: list of messages in all our DM circles
|
||||
::
|
||||
dms=(map name:hall [ini=ship env=(list envelope:hall)])
|
||||
:: all the DM invites we've received
|
||||
::
|
||||
invites=(list envelope:hall)
|
||||
==
|
||||
::
|
||||
+$ rumor
|
||||
$% :: if config is given, either add new circle or update existing one
|
||||
:: if config is nil then delete circle
|
||||
::
|
||||
[%config-change cir=circle:hall con=(unit config:hall)]
|
||||
:: recieved a new inbox message or DM invite
|
||||
::
|
||||
[%new-msg nom=?(%inbox %invites) env=envelope:hall]
|
||||
==
|
||||
::
|
||||
+$ command
|
||||
$% [%chat-invite nom=name:hall who=(set ship)]
|
||||
[%collection-invite nom=name:hall col=term who=(set ship)]
|
||||
==
|
||||
+$ collection [meta=config data=(map nom=knot =item)]
|
||||
::
|
||||
+$ item
|
||||
$~ [%error ~]
|
||||
$% [%collection col=collection]
|
||||
[%raw raw=raw-item]
|
||||
[%both col=collection raw=raw-item]
|
||||
[%error ~]
|
||||
==
|
||||
::
|
||||
+$ raw-item
|
||||
$% [%udon meta=(map knot cord) data=@t]
|
||||
==
|
||||
::
|
||||
+$ config
|
||||
$: full-path=beam
|
||||
name=@t
|
||||
description=@t
|
||||
::
|
||||
author=@p
|
||||
::
|
||||
date-created=@da
|
||||
last-modified=@da
|
||||
::
|
||||
type=@tas
|
||||
comments=?
|
||||
sort-key=(unit @)
|
||||
visible=?
|
||||
::
|
||||
==
|
||||
::
|
||||
+$ action
|
||||
$: who=ship
|
||||
dek=desk
|
||||
acts=(list sub-action)
|
||||
==
|
||||
::
|
||||
+$ sub-action
|
||||
$% [%write pax=path for=form]
|
||||
[%delete pax=path]
|
||||
[%perms pax=path r=rule:clay w=rule:clay]
|
||||
::
|
||||
[%collection pax=path name=@t desc=@t comments=? visible=? type=@tas]
|
||||
[%post pax=path name=@t type=@tas comments=? content=@t edit=?]
|
||||
[%comment pax=path content=@t]
|
||||
==
|
||||
::
|
||||
+$ form
|
||||
$% [%udon @t]
|
||||
[%collections-config config]
|
||||
==
|
||||
::
|
||||
++ collection-error
|
||||
~/ %coll-collection-error
|
||||
|= col=collection
|
||||
^- ?
|
||||
|-
|
||||
=/ vals=(list item) ~(val by data.col)
|
||||
%+ roll vals
|
||||
|= [i=item out=_|]
|
||||
^- ?
|
||||
?: out out
|
||||
?+ -.i
|
||||
%.n
|
||||
%error %.y
|
||||
%collection ^$(col col.i)
|
||||
%both ^$(col col.i)
|
||||
==
|
||||
::::
|
||||
:::: /mar/snip
|
||||
::::
|
||||
++ words 1
|
||||
++ hedtal
|
||||
=| met/marl
|
||||
|= a/marl ^- {hed/marl tal/marl}
|
||||
?~ a [~ ~]
|
||||
:: looks like it only terminates if it finds an h1?
|
||||
?. ?=($h1 n.g.i.a)
|
||||
?: ?=($meta n.g.i.a)
|
||||
$(a t.a, met [i.a met])
|
||||
=+ had=$(a c.i.a)
|
||||
?^ -.had had
|
||||
$(a t.a)
|
||||
[c.i.a (weld (flop met) (limit words t.a))]
|
||||
::
|
||||
::
|
||||
++ limit
|
||||
~/ %coll-limit
|
||||
|= {lim/@u mal/marl}
|
||||
=< res
|
||||
|- ^- {rem/@u res/marl}
|
||||
?~ mal [lim ~]
|
||||
?~ lim [0 ~]
|
||||
=+ ^- {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)]
|
||||
[rem - res]:[hed $(lim lam, mal t.mal)]
|
||||
::
|
||||
++ deword
|
||||
~/ %coll-deword
|
||||
|= {lim/@u tay/tape} ^- {lim/@u tay/tape}
|
||||
?~ tay [lim tay]
|
||||
?~ lim [0 ~]
|
||||
=+ wer=(dot 1^1 tay)
|
||||
?~ q.wer
|
||||
[lim - tay]:[i.tay $(tay t.tay)]
|
||||
=+ nex=$(lim (dec lim), tay q.q.u.q.wer)
|
||||
[-.nex [(wonk wer) +.nex]]
|
||||
::
|
||||
:: json
|
||||
::
|
||||
++ item-to-json
|
||||
~/ %coll-item-to-json
|
||||
|= itm=item
|
||||
^- json
|
||||
?- -.itm
|
||||
%error (frond:enjs:format %error ~)
|
||||
::
|
||||
%collection
|
||||
%+ frond:enjs:format
|
||||
%collection (collection-to-json col.itm)
|
||||
::
|
||||
%raw
|
||||
%- frond:enjs:format
|
||||
[%item (raw-to-json raw.itm)]
|
||||
::
|
||||
%both
|
||||
%- pairs:enjs:format
|
||||
:~ [%item (raw-to-json raw.itm)]
|
||||
[%collection (collection-to-json col.itm)]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ collection-to-json
|
||||
~/ %coll-collection-to-json
|
||||
|= col=collection
|
||||
^- json
|
||||
%- pairs:enjs:format
|
||||
:~ [%meta (config-to-json meta.col)]
|
||||
:+ %data %a
|
||||
%+ turn ~(tap by data.col)
|
||||
|= [nom=knot ite=item]
|
||||
^- json
|
||||
%- pairs:enjs:format
|
||||
:~ [%filename %s nom]
|
||||
[%item (item-to-json ite)]
|
||||
==
|
||||
==
|
||||
::
|
||||
++ raw-to-json
|
||||
~/ %coll-raw-to-json
|
||||
|= raw=raw-item
|
||||
^- json
|
||||
=/ elm=manx elm:(static:cram (ream data.raw))
|
||||
=/ rec=json (elem-to-react-json elm)
|
||||
%- pairs:enjs:format
|
||||
:~ [%data rec]
|
||||
[%meta (meta-to-json meta.raw)]
|
||||
==
|
||||
::
|
||||
++ config-to-json
|
||||
~/ %coll-config-to-json
|
||||
|= con=config
|
||||
^- json
|
||||
?: =(con *config)
|
||||
~
|
||||
%- pairs:enjs:format
|
||||
:~ :- %full-path
|
||||
:- %a
|
||||
%+ turn (en-beam:format full-path.con)
|
||||
|= a=@ta
|
||||
[%s a]
|
||||
:- %name [%s name.con]
|
||||
:- %desc [%s description.con]
|
||||
:- %author (ship:enjs:format author.con)
|
||||
:- %date-created (time:enjs:format date-created.con)
|
||||
:- %last-modified (time:enjs:format last-modified.con)
|
||||
:- %type [%s type.con]
|
||||
:- %comments [%b comments.con]
|
||||
:- %sort-key ?~(sort-key.con ~ (numb:enjs:format u.sort-key.con))
|
||||
:- %visible [%b visible.con]
|
||||
==
|
||||
::
|
||||
++ meta-to-json
|
||||
~/ %coll-meta-to-json
|
||||
|= meta=(map knot cord)
|
||||
^- json
|
||||
%- pairs:enjs:format
|
||||
%+ turn ~(tap by meta)
|
||||
|= [key=@t val=@t]
|
||||
^- [@t json]
|
||||
[key [%s val]]
|
||||
::
|
||||
++ udon-to-front
|
||||
~/ %coll-udon-to-front
|
||||
|= u=@t
|
||||
^- (map knot cord)
|
||||
%- ~(run by inf:(static:cram (ream u)))
|
||||
|= a=dime ^- cord
|
||||
?+ (end 3 1 p.a) (scot a)
|
||||
%t q.a
|
||||
==
|
||||
::
|
||||
:: +path-to-circle:
|
||||
::
|
||||
:: takes a clay path and returns a hall circle
|
||||
:: for a path /foo/bar it returns a circle with a :name %c-foo-bar
|
||||
::
|
||||
++ path-to-circle
|
||||
~/ %coll-path-to-circle
|
||||
|= [pax=path our=@p]
|
||||
^- circle:hall
|
||||
=. pax
|
||||
?: ?=([%web %collections *] pax)
|
||||
(weld /c (slag 2 `path`pax))
|
||||
?: ?=([%collections *] pax)
|
||||
(weld /c (slag 1 `path`pax))
|
||||
?: ?=([%c *] pax)
|
||||
`path`pax
|
||||
`path`(weld /c pax)
|
||||
=/ nam=term
|
||||
%+ roll `(list @ta)`pax
|
||||
|= [seg=@ta out=term]
|
||||
%^ cat 3
|
||||
?:(=(%$ out) out (cat 3 out '-'))
|
||||
;;(@tas seg)
|
||||
[our nam]
|
||||
::
|
||||
:: +allowed-by: checks if ship :who is allowed by the permission rules in :dic
|
||||
::
|
||||
++ allowed-by
|
||||
~/ %coll-allowed-by
|
||||
|= [who=@p dic=dict:clay our=@p]
|
||||
^- ?
|
||||
?: =(who our) &
|
||||
=/ in-list=?
|
||||
?| (~(has in p.who.rul.dic) who)
|
||||
::
|
||||
%- ~(rep by q.who.rul.dic)
|
||||
|= [[@ta cru=crew:clay] out=_|]
|
||||
?: out &
|
||||
(~(has in cru) who)
|
||||
==
|
||||
?: =(%black mod.rul.dic)
|
||||
!in-list
|
||||
in-list
|
||||
::
|
||||
:: +collection-notify: XX
|
||||
::
|
||||
++ collection-notify
|
||||
~/ %coll-collection-notify
|
||||
|= [pax=path conf=config]
|
||||
^- json
|
||||
%- pairs:enjs:format
|
||||
:~ ['author' [%s (crip (scow %p author.conf))]]
|
||||
['host' [%s (crip (scow %p p.full-path.conf))]]
|
||||
['path' [%a (turn pax |=(a=@ta `json`[%s a]))]]
|
||||
['name' [%s name.conf]]
|
||||
['date' [%s (crip (scow %da last-modified.conf))]]
|
||||
['type' [%s type.conf]]
|
||||
==
|
||||
::
|
||||
:: +item-notify: XX
|
||||
::
|
||||
++ item-notify
|
||||
~/ %coll-item-notify
|
||||
|= [pax=path raw=raw-item now=@da byk=beak]
|
||||
^- json
|
||||
=/ author (fall (~(get by meta.raw) %author) ~.anon)
|
||||
=/ host (fall (~(get by meta.raw) %host) ~.anon)
|
||||
=/ dat (fall (~(get by meta.raw) %last-modified) (scot %da now))
|
||||
=/ nom (fall (~(get by meta.raw) %name) ~.no-title)
|
||||
=/ typ (fall (~(get by meta.raw) %type) ~.no-type)
|
||||
::
|
||||
=/ elm=manx elm:(static:cram (ream data.raw))
|
||||
=/ snip=marl tal:(hedtal +.elm)
|
||||
=/ inner
|
||||
?~ snip
|
||||
(crip (en-xml:html elm))
|
||||
(crip (en-xml:html i.snip)) :: inner html
|
||||
::
|
||||
=/ parent-spur (slag 1 (flop pax))
|
||||
=/ bek=beak byk(r [%da now])
|
||||
=/ parent-path (en-beam:format [bek parent-spur])
|
||||
=/ parent-dir .^(arch %cy parent-path)
|
||||
::
|
||||
=/ parent-conf=json
|
||||
?: (~(has in dir.parent-dir) ~.udon ~)
|
||||
%- meta-to-json
|
||||
%- udon-to-front
|
||||
.^(@t %cx (weld parent-path /udon))
|
||||
?: (~(has in dir.parent-dir) ~.collections-config ~)
|
||||
%- config-to-json
|
||||
.^(config %cx (weld parent-path /collections-config))
|
||||
~
|
||||
::
|
||||
%- pairs:enjs:format
|
||||
:~ ['author' [%s author]]
|
||||
['host' [%s host]]
|
||||
['path' [%a (turn pax |=(a=@ta `json`[%s a]))]]
|
||||
['name' [%s nom]]
|
||||
['date' [%s dat]]
|
||||
['type' [%s typ]]
|
||||
['content' [%s data.raw]]
|
||||
['snip' [%s inner]]
|
||||
['parent-config' parent-conf]
|
||||
==
|
||||
::
|
||||
:: +front-to-wain: XX
|
||||
::
|
||||
++ front-to-wain
|
||||
~/ %coll-front-to-wain
|
||||
|= a=(map knot cord)
|
||||
^- wain
|
||||
=/ entries=wain
|
||||
%+ turn ~(tap by a)
|
||||
|= b=[knot cord]
|
||||
=/ c=[term cord] ;;([term cord] b)
|
||||
(crip " [{<-.c>} {<+.c>}]")
|
||||
::
|
||||
?~ entries ~
|
||||
;: weld
|
||||
[':- :~' ~]
|
||||
entries
|
||||
[' ==' ~]
|
||||
==
|
||||
::
|
||||
:: +update-udon-front: XX
|
||||
::
|
||||
++ update-udon-front
|
||||
~/ %coll-update-udon-front
|
||||
|= [fro=(map knot cord) udon=@t]
|
||||
^- @t
|
||||
%- of-wain:format
|
||||
=/ tum (trip udon)
|
||||
=/ id (find ";>" tum)
|
||||
?~ id
|
||||
%+ weld (front-to-wain fro)
|
||||
(to-wain:format (crip (weld ";>\0a" tum)))
|
||||
%+ weld (front-to-wain fro)
|
||||
(to-wain:format (crip (slag u.id tum)))
|
||||
::
|
||||
:: _ta: main event core for collections
|
||||
::
|
||||
++ ta
|
||||
~/ %coll-ta
|
||||
|_ $: moves=(list move)
|
||||
bol=bowl:gall
|
||||
==
|
||||
::
|
||||
:: +ta-this: ta core subject
|
||||
::
|
||||
++ ta-this .
|
||||
::
|
||||
:: +ta-done:
|
||||
::
|
||||
:: flop :moves for finalization, since moves are prepended to the list
|
||||
::
|
||||
++ ta-done (flop moves)
|
||||
::
|
||||
:: +ta-emit: add a +move to :moves
|
||||
::
|
||||
++ ta-emit
|
||||
~/ %coll-ta-emit
|
||||
|= mov=move
|
||||
%_ ta-this
|
||||
moves [mov moves]
|
||||
==
|
||||
::
|
||||
:: +ta-emil: add a list of +move to :moves
|
||||
::
|
||||
++ ta-emil
|
||||
~/ %coll-ta-emil
|
||||
|= mos=(list move)
|
||||
%_ ta-this
|
||||
moves (welp (flop mos) moves)
|
||||
==
|
||||
::
|
||||
:: +ta-act: process collection-action
|
||||
::
|
||||
++ ta-act
|
||||
~/ %coll-ta-act
|
||||
|= act=action
|
||||
^+ ta-this
|
||||
::
|
||||
:: iterate through list of +sub-action of +action
|
||||
::
|
||||
|-
|
||||
?~ acts.act ta-this
|
||||
=* a i.acts.act
|
||||
::
|
||||
=/ now-id=@da (sub now.bol (div (dis now.bol ~s0..fffe) 2))
|
||||
=/ dat (scot %da now-id)
|
||||
=/ bek=beak byk.bol(r [%da now-id])
|
||||
=/ sap (en-beam:format [bek (flop (path +<.a))])
|
||||
::
|
||||
=. ta-this
|
||||
?- -.a
|
||||
%write
|
||||
=/ perms .^([dict:clay dict:clay] %cp sap)
|
||||
?: (allowed-by src.bol +.perms our.bol)
|
||||
?- -.for.a
|
||||
%udon (ta-write pax.a `cage`[-.for.a !>(+.for.a)])
|
||||
%collections-config (ta-write pax.a `cage`[-.for.a !>(+.for.a)])
|
||||
==
|
||||
ta-this
|
||||
::
|
||||
%delete
|
||||
=/ perms .^([dict:clay dict:clay] %cp sap)
|
||||
?: (allowed-by src.bol +.perms our.bol)
|
||||
(ta-remove pax.a)
|
||||
ta-this
|
||||
::
|
||||
%perms
|
||||
?: =(src.bol our.bol) :: XX admin privileges for other users?
|
||||
(ta-set-permissions pax.a r.a w.a)
|
||||
ta-this
|
||||
::
|
||||
::
|
||||
:: XX some of this is redunant
|
||||
::
|
||||
%collection
|
||||
=/ perms
|
||||
.^([dict:clay dict:clay] %cp (weld sap /[dat]/collections-config))
|
||||
?. (allowed-by src.bol +.perms our.bol)
|
||||
ta-this
|
||||
=/ conf=config
|
||||
:* [bek (flop (weld pax.a /[dat]/collections-config))]
|
||||
name.a
|
||||
desc.a
|
||||
our.bol
|
||||
now-id
|
||||
now-id
|
||||
type.a
|
||||
comments.a
|
||||
~
|
||||
visible.a
|
||||
==
|
||||
=. ta-this
|
||||
%+ ta-write (weld pax.a /[dat]/collections-config)
|
||||
[%collections-config !>(conf)]
|
||||
:: restrict permissions on config file
|
||||
=. ta-this
|
||||
%^ ta-set-permissions (weld pax.a /[dat]/collections-config)
|
||||
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: read
|
||||
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
||||
:: open permissions on collection items
|
||||
=. ta-this
|
||||
%^ ta-set-permissions (weld pax.a /[dat])
|
||||
[%black ((set whom:clay) ~)] :: read
|
||||
[%black ((set whom:clay) ~)] :: write
|
||||
ta-this
|
||||
::
|
||||
%post
|
||||
=? pax.a !edit.a
|
||||
(weld pax.a /[dat])
|
||||
=? sap !edit.a
|
||||
(en-beam:format [bek (flop pax.a)])
|
||||
=/ perms .^([dict:clay dict:clay] %cp (weld sap /udon))
|
||||
?. (allowed-by src.bol +.perms our.bol)
|
||||
ta-this
|
||||
=. content.a (crip (weld (trip content.a) "\0a"))
|
||||
=/ front=(map knot cord)
|
||||
%- my
|
||||
:~ [%name name.a]
|
||||
[%comments ?:(comments.a ~..y ~..n)]
|
||||
[%author (scot %p src.bol)]
|
||||
[%host (scot %p our.bol)]
|
||||
[%date-created (snag 0 (flop pax.a))]
|
||||
[%last-modified dat]
|
||||
[%type type.a]
|
||||
==
|
||||
=. ta-this
|
||||
%+ ta-write (weld pax.a /udon)
|
||||
[%udon !>((update-udon-front front content.a))]
|
||||
:: restrict permissions on udon file
|
||||
=. ta-this
|
||||
%^ ta-set-permissions (weld pax.a /udon)
|
||||
[%black ((set whom:clay) ~)] :: read
|
||||
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
||||
:: open permissions on comments
|
||||
=. ta-this
|
||||
%^ ta-set-permissions pax.a
|
||||
[%black ((set whom:clay) ~)] :: read
|
||||
[%black ((set whom:clay) ~)] :: write
|
||||
ta-this
|
||||
::
|
||||
%comment
|
||||
=/ perms .^([dict:clay dict:clay] %cp (weld sap /[dat]/udon))
|
||||
?. (allowed-by src.bol +.perms our.bol)
|
||||
ta-this
|
||||
=. content.a (crip (weld (trip content.a) "\0a"))
|
||||
=/ front=(map knot cord)
|
||||
%- my
|
||||
:~ [%author (scot %p src.bol)]
|
||||
[%host (scot %p our.bol)]
|
||||
[%date-created dat]
|
||||
[%last-modified dat]
|
||||
[%type %comments]
|
||||
==
|
||||
=. ta-this
|
||||
%+ ta-write (weld pax.a /[dat]/udon)
|
||||
[%udon !>((update-udon-front front content.a))]
|
||||
:: restrict permissions on udon file
|
||||
=. ta-this
|
||||
%^ ta-set-permissions (weld pax.a /[dat]/udon)
|
||||
[%black ((set whom:clay) ~)] :: read
|
||||
[%white ((set whom:clay) [[& src.bol] ~ ~])] :: write
|
||||
ta-this
|
||||
::
|
||||
==
|
||||
$(acts.act t.acts.act)
|
||||
::
|
||||
:: +ta-update:
|
||||
::
|
||||
::
|
||||
::
|
||||
++ ta-update
|
||||
~/ %coll-ta-update
|
||||
|= [old=collection new=collection]
|
||||
^+ ta-this
|
||||
?: =(old new)
|
||||
ta-this
|
||||
(ta-update-collection old new /web/collections)
|
||||
::
|
||||
++ ta-insert-item
|
||||
~/ %coll-ta-insert-item
|
||||
|= [new=item pax=path]
|
||||
^+ ta-this
|
||||
=/ parent-path (scag (dec (lent pax)) pax)
|
||||
::
|
||||
?- -.new
|
||||
::
|
||||
%error
|
||||
(ta-hall-lin parent-path 'error')
|
||||
::
|
||||
%collection
|
||||
=. ta-this
|
||||
%^ ta-hall-json parent-path 'new collection'
|
||||
(collection-notify pax meta.col.new)
|
||||
::
|
||||
=. ta-this (ta-hall-create-circle pax name.meta.col.new)
|
||||
=/ items=(list [nom=@ta =item]) ~(tap by data.col.new)
|
||||
|-
|
||||
?~ items ta-this
|
||||
=. ta-this (ta-insert-item item.i.items (weld pax [nom.i.items ~]))
|
||||
$(items t.items)
|
||||
::
|
||||
%both
|
||||
=. ta-this (ta-hall-create-circle pax name.meta.col.new)
|
||||
=/ items=(list [nom=@ta =item]) ~(tap by data.col.new)
|
||||
=. ta-this
|
||||
|-
|
||||
?~ items ta-this
|
||||
=. ta-this (ta-insert-item item.i.items (weld pax [nom.i.items ~]))
|
||||
$(items t.items)
|
||||
::
|
||||
ta-this
|
||||
::
|
||||
%raw
|
||||
=. ta-this
|
||||
%^ ta-hall-json
|
||||
parent-path
|
||||
'new item'
|
||||
(item-notify pax raw.new now.bol byk.bol)
|
||||
?: ?& (~(has by meta.raw.new) %comments)
|
||||
=('.y' (~(got by meta.raw.new) %comments))
|
||||
==
|
||||
=/ author=(unit @ta) (~(get by meta.raw.new) %author)
|
||||
=/ author-p=@p
|
||||
?~ author our.bol
|
||||
(fall (rush u.author ;~(pfix sig fed:ag)) our.bol)
|
||||
(ta-generate-comments pax author-p)
|
||||
ta-this
|
||||
::
|
||||
==
|
||||
::
|
||||
++ ta-remove-item
|
||||
~/ %coll-ta-remove-item
|
||||
|= [old=item pax=path]
|
||||
^+ ta-this
|
||||
:: flush permissions
|
||||
:: notify parent of deletion
|
||||
=/ parent (scag (dec (lent pax)) pax)
|
||||
:: recurse for children
|
||||
?- -.old
|
||||
::
|
||||
%error
|
||||
(ta-hall-lin parent 'error')
|
||||
::
|
||||
%collection
|
||||
=. ta-this
|
||||
%^ ta-hall-json parent 'deleted collection'
|
||||
(collection-notify pax meta.col.old)
|
||||
=. ta-this (ta-flush-permissions (weld pax /collections-config))
|
||||
=/ items=(list [nom=@ta =item]) ~(tap by data.col.old)
|
||||
|-
|
||||
?~ items ta-this
|
||||
=. ta-this (ta-remove-item item.i.items (weld pax [nom.i.items ~]))
|
||||
$(items t.items)
|
||||
::
|
||||
%both
|
||||
=. ta-this (ta-flush-permissions pax)
|
||||
=. ta-this (ta-flush-permissions (weld pax /collections-config))
|
||||
=/ items=(list [nom=@ta =item]) ~(tap by data.col.old)
|
||||
|-
|
||||
?~ items ta-this
|
||||
=. ta-this (ta-remove-item item.i.items (weld pax [nom.i.items ~]))
|
||||
$(items t.items)
|
||||
::
|
||||
%raw
|
||||
=. ta-this (ta-flush-permissions pax)
|
||||
%^ ta-hall-json
|
||||
parent
|
||||
'deleted item'
|
||||
(item-notify pax raw.old now.bol byk.bol)
|
||||
::
|
||||
==
|
||||
::
|
||||
::
|
||||
::
|
||||
++ ta-update-item
|
||||
:: always make sure removals happen first and insertions happen last
|
||||
:: because removals flush permissions and insertions set them
|
||||
::
|
||||
~/ %coll-ta-update-item
|
||||
|= [old=item new=item pax=path]
|
||||
^+ ta-this
|
||||
?: =(old new)
|
||||
ta-this
|
||||
::
|
||||
:: check for changes in item type
|
||||
?: &(?=(%collection -.old) ?=(%collection -.new))
|
||||
(ta-update-collection col.old col.new pax)
|
||||
?: &(?=(%raw -.old) ?=(%raw -.new))
|
||||
(ta-update-raw-item raw.old raw.new pax)
|
||||
?: &(?=(%both -.old) ?=(%both -.new))
|
||||
:: update raw item
|
||||
=. ta-this (ta-update-collection col.old col.new pax)
|
||||
(ta-update-raw-item raw.old raw.new pax)
|
||||
::
|
||||
?: &(?=(%collection -.old) ?=(%raw -.new))
|
||||
:: remove collection
|
||||
:: insert raw item
|
||||
=. ta-this (ta-remove-item old pax)
|
||||
(ta-insert-item new pax)
|
||||
::
|
||||
?: &(?=(%collection -.old) ?=(%both -.new))
|
||||
:: insert raw item
|
||||
:: update-collection
|
||||
=. ta-this (ta-update-collection col.old col.new pax)
|
||||
(ta-insert-item new pax)
|
||||
::
|
||||
?: &(?=(%raw -.old) ?=(%collection -.new))
|
||||
:: remove raw item
|
||||
:: insert collection
|
||||
=. ta-this (ta-remove-item old pax)
|
||||
(ta-insert-item new pax)
|
||||
::
|
||||
?: &(?=(%raw -.old) ?=(%both -.new))
|
||||
:: insert collection
|
||||
:: update raw item
|
||||
=. ta-this (ta-update-raw-item raw.old raw.new pax)
|
||||
(ta-insert-item new pax)
|
||||
::
|
||||
?: &(?=(%both -.old) ?=(%raw -.new))
|
||||
:: remove collection
|
||||
:: update raw item
|
||||
=. ta-this (ta-remove-item [%collection col.old] pax)
|
||||
(ta-update-raw-item raw.old raw.new pax)
|
||||
::
|
||||
?: &(?=(%both -.old) ?=(%collection -.new))
|
||||
:: remove raw item
|
||||
:: update collection
|
||||
=. ta-this (ta-remove-item [%raw raw.old] pax)
|
||||
(ta-update-collection col.old col.new pax)
|
||||
::
|
||||
::
|
||||
?: &(?=(%error -.old) ?=(%error -.new))
|
||||
ta-this
|
||||
?: &(?=(%error -.old) ?=(%collection -.new))
|
||||
(ta-insert-item new pax)
|
||||
?: &(?=(%error -.old) ?=(%raw -.new))
|
||||
(ta-insert-item new pax)
|
||||
?: &(?=(%error -.old) ?=(%both -.new))
|
||||
(ta-insert-item new pax)
|
||||
?: ?=(%error -.new)
|
||||
(ta-hall-lin pax 'error')
|
||||
::
|
||||
ta-this
|
||||
::
|
||||
++ ta-update-raw-item
|
||||
~/ %coll-ta-update-raw-item
|
||||
|= [old=raw-item new=raw-item pax=path]
|
||||
^+ ta-this
|
||||
?: =(old new)
|
||||
ta-this
|
||||
::
|
||||
=? ta-this !=(data.old data.new)
|
||||
=/ parent-path (scag (dec (lent pax)) pax)
|
||||
%^ ta-hall-json
|
||||
parent-path
|
||||
'edited item'
|
||||
(item-notify pax new now.bol byk.bol)
|
||||
::
|
||||
=? ta-this
|
||||
?& =('.y' (fall (~(get by meta.new) %comments) '.n'))
|
||||
=('.n' (fall (~(get by meta.old) %comments) '.n'))
|
||||
==
|
||||
=/ author=(unit @ta) (~(get by meta.new) %author)
|
||||
=/ author-p=@p
|
||||
?~ author our.bol
|
||||
(fall (rush u.author ;~(pfix sig fed:ag)) our.bol)
|
||||
(ta-generate-comments pax author-p)
|
||||
::
|
||||
=? ta-this
|
||||
?& =('.n' (fall (~(get by meta.new) %comments) '.n'))
|
||||
=('.y' (fall (~(get by meta.old) %comments) '.n'))
|
||||
==
|
||||
:: delete comments
|
||||
(ta-remove (weld pax /collections-config))
|
||||
::
|
||||
ta-this
|
||||
::
|
||||
++ ta-update-collection
|
||||
~/ %coll-ta-update-collection
|
||||
|= $: old=collection
|
||||
new=collection
|
||||
pax=path
|
||||
==
|
||||
^+ ta-this
|
||||
::
|
||||
=? ta-this !=(meta.old meta.new)
|
||||
=/ parent-path (scag (dec (lent pax)) pax)
|
||||
%^ ta-hall-json parent-path 'edited collection'
|
||||
(collection-notify pax meta.new)
|
||||
::
|
||||
?: =(data.old data.new)
|
||||
ta-this
|
||||
::
|
||||
:: new values of all changed items
|
||||
=/ upd-new (~(dif in (~(int by data.old) data.new)) data.old)
|
||||
:: old values of all changed items
|
||||
=/ upd-old (~(dif in (~(int by data.new) data.old)) data.new)
|
||||
:: all totally new entries
|
||||
=/ ins-new (~(dif by data.new) data.old)
|
||||
:: all deleted entries
|
||||
=/ del-old (~(dif by data.old) data.new)
|
||||
::
|
||||
=/ upd-new=(list [nom=knot =item]) ~(tap by upd-new)
|
||||
=/ upd-old=(list [nom=knot =item]) ~(tap by upd-old)
|
||||
=/ ins-new=(list [nom=knot =item]) ~(tap by ins-new)
|
||||
=/ del-old=(list [nom=knot =item]) ~(tap by del-old)
|
||||
::
|
||||
=/ lam |=([[a=knot item] out=(list path)] [(weld pax [a ~]) out])
|
||||
::
|
||||
=. ta-this |-
|
||||
?~ upd-new
|
||||
ta-this
|
||||
?< ?=(~ upd-old)
|
||||
=* new-item i.upd-new
|
||||
=* old-item i.upd-old
|
||||
=/ new-pax (weld pax [nom.new-item ~])
|
||||
=. ta-this (ta-update-item item.old-item item.new-item new-pax)
|
||||
::
|
||||
%= $
|
||||
upd-new t.upd-new
|
||||
upd-old t.upd-old
|
||||
==
|
||||
::
|
||||
=. ta-this |-
|
||||
?~ ins-new
|
||||
ta-this
|
||||
=* new-item i.ins-new
|
||||
=/ new-pax (weld pax [nom.new-item ~])
|
||||
=. ta-this (ta-insert-item +.new-item (weld pax [-.new-item ~]))
|
||||
$(ins-new t.ins-new)
|
||||
::
|
||||
=. ta-this |-
|
||||
?~ del-old
|
||||
ta-this
|
||||
=* old-item i.del-old
|
||||
=/ old-pax (weld pax [nom.old-item ~])
|
||||
=. ta-this (ta-remove-item +.old-item (weld pax [-.old-item ~]))
|
||||
$(del-old t.del-old)
|
||||
::
|
||||
ta-this
|
||||
::
|
||||
++ ta-generate-comments
|
||||
~/ %coll-ta-generate-comments
|
||||
|= [pax=path author=ship]
|
||||
^+ ta-this
|
||||
=/ sup=path [%collections-config (flop pax)]
|
||||
=/ bek byk.bol(r [%da now.bol])
|
||||
=/ pat (en-beam:format [bek sup])
|
||||
=/ dat=@da (slav %da (snag 0 (flop pax)))
|
||||
=/ cay=config
|
||||
:* [bek sup]
|
||||
'comments'
|
||||
'comments'
|
||||
author
|
||||
dat
|
||||
dat
|
||||
%comments
|
||||
|
|
||||
~
|
||||
|
|
||||
==
|
||||
(ta-write (flop sup) %collections-config !>(cay))
|
||||
::
|
||||
:: writing files
|
||||
::
|
||||
++ ta-write
|
||||
~/ %coll-ta-write
|
||||
=, space:userlib
|
||||
|= [pax=path cay=cage]
|
||||
^+ ta-this
|
||||
=/ bek byk.bol(r [%da now.bol])
|
||||
=. pax (en-beam:format bek (flop pax))
|
||||
%+ ta-emit ost.bol
|
||||
[%info (weld /ta-write pax) (foal pax cay)]
|
||||
::
|
||||
++ ta-remove
|
||||
=, space:userlib
|
||||
~/ %coll-ta-remove
|
||||
|= pax=path
|
||||
=/ bek byk.bol(r [%da now.bol])
|
||||
=. pax (en-beam:format bek (flop pax))
|
||||
^+ ta-this
|
||||
%+ ta-emit ost.bol
|
||||
[%info (weld /ta-remove pax) (fray pax)]
|
||||
::
|
||||
:: permissions
|
||||
::
|
||||
++ ta-set-permissions
|
||||
~/ %coll-ta-set-permissions
|
||||
|= [pax=path r=rule:clay w=rule:clay]
|
||||
^+ ta-this
|
||||
%+ ta-emit ost.bol
|
||||
[%perm (weld /perms pax) q.byk.bol pax [%rw `r `w]]
|
||||
::
|
||||
++ ta-flush-permissions
|
||||
~/ %coll-ta-flush-permissions
|
||||
|= pax=path
|
||||
^+ ta-this
|
||||
%+ ta-emit ost.bol
|
||||
[%perm (weld /perms pax) q.byk.bol pax [%rw ~ ~]]
|
||||
::
|
||||
:: hall
|
||||
::
|
||||
++ ta-hall-action
|
||||
~/ %coll-ta-hall-action
|
||||
|= act=action:hall
|
||||
^+ ta-this
|
||||
%+ ta-emit ost.bol
|
||||
[%poke /col-hall-action [our.bol %hall] %hall-action act]
|
||||
::
|
||||
++ ta-hall-actions
|
||||
~/ %coll-ta-hall-actions
|
||||
|= act=(list $?(~ action:hall))
|
||||
^+ ta-this
|
||||
?~ act ta-this
|
||||
?~ i.act $(act t.act)
|
||||
%= $
|
||||
ta-this (ta-hall-action i.act)
|
||||
act t.act
|
||||
==
|
||||
::
|
||||
++ ta-hall-create-circle
|
||||
~/ %coll-ta-hall-create-circle
|
||||
|= [pax=path name=@t]
|
||||
^+ ta-this
|
||||
=/ circ=circle:hall (path-to-circle pax our.bol)
|
||||
=/ parent=circle:hall
|
||||
?: =(nom.circ %c)
|
||||
[our.bol %inbox]
|
||||
(path-to-circle (scag (dec (lent pax)) pax) our.bol)
|
||||
=/ acts=(list action:hall)
|
||||
:~ [%source nom.parent & (sy `source:hall`[circ ~] ~)]
|
||||
[%create nom.circ name %journal]
|
||||
==
|
||||
:: XX should we also source comment circles?
|
||||
=? acts =(nom.parent %c)
|
||||
[[%source %inbox & (sy `source:hall`[circ ~] ~)] acts]
|
||||
(ta-hall-actions (flop acts))
|
||||
::
|
||||
++ ta-hall-lin
|
||||
~/ %coll-ta-hall-lin
|
||||
|= [pax=path msg=cord]
|
||||
^+ ta-this
|
||||
=/ circ=circle:hall (path-to-circle pax our.bol)
|
||||
%- ta-hall-action
|
||||
[%phrase [circ ~ ~] [%lin | msg]~]
|
||||
::
|
||||
++ ta-hall-json
|
||||
~/ %coll-ta-hall-json
|
||||
|= [pax=path header=@t jon=json]
|
||||
^+ ta-this
|
||||
=/ circ=circle:hall (path-to-circle pax our.bol)
|
||||
%- ta-hall-action
|
||||
:+ %phrase [circ ~ ~]
|
||||
[%fat [%text ~[header]] [%lin | (crip (en-json:html jon))]]~
|
||||
::
|
||||
--
|
||||
--
|
@ -45,7 +45,7 @@
|
||||
|= {a/mane b/tape} ^- {cord json}
|
||||
:_ (tape:enjs b)
|
||||
?^ a (mane-to-cord a)
|
||||
(fall (~(get by react-attrs) a) a)
|
||||
(~(gut by react-attrs) a a)
|
||||
==
|
||||
::
|
||||
++ mane-to-cord :: namespaced xml names
|
||||
|
@ -94,7 +94,7 @@
|
||||
[%home %modulo]
|
||||
[%home %launch]
|
||||
[%home %chat]
|
||||
[%home %write]
|
||||
[%home %publish]
|
||||
[%home %timer]
|
||||
[%home %clock]
|
||||
[%home %weather]
|
||||
@ -132,7 +132,7 @@
|
||||
::::
|
||||
::
|
||||
|= {hid/bowl:gall part} :: main drum work
|
||||
=+ (fall (~(get by bin) ost.hid) *source)
|
||||
=+ (~(gut by bin) ost.hid *source)
|
||||
=* dev -
|
||||
=> |% :: arvo structures
|
||||
++ pear :: request
|
||||
|
@ -34,7 +34,7 @@
|
||||
:::: :: ::
|
||||
:: :: ::
|
||||
|: $:{bowl:gall part} :: main helm work
|
||||
=+ sez=(fall (~(get by hoc) ost) $:session)
|
||||
=+ sez=(~(gut by hoc) ost $:session)
|
||||
=> |% :: arvo structures
|
||||
++ card ::
|
||||
$% [%bonk wire ~] ::
|
||||
@ -50,7 +50,6 @@
|
||||
++ move (pair bone card) :: user-level move
|
||||
++ pear :: poke fruit
|
||||
$% {$hood-unsync desk ship desk} ::
|
||||
{$ask-mail cord} ::
|
||||
{$helm-hi cord} ::
|
||||
{$drum-start well:gall} ::
|
||||
{$hall-action action:hall} ::
|
||||
@ -131,9 +130,6 @@
|
||||
%^ emit %poke /helm/hi/(scot %p her)
|
||||
[[her %hood] %helm-hi ?~(mes '' (crip u.mes))]
|
||||
::
|
||||
++ poke-send-ask
|
||||
|= mel/cord
|
||||
abet
|
||||
::
|
||||
++ poke-hi
|
||||
|= mes/@t
|
||||
@ -155,11 +151,6 @@
|
||||
?> ?=({@t ~} pax)
|
||||
(emit %flog ~ %text "hi {(trip i.pax)} {?~(cop "" "un")}successful")
|
||||
::
|
||||
++ coup-ask
|
||||
|= {pax/path cop/(unit tang)} =< abet
|
||||
?> ?=({@t ~} pax)
|
||||
(emit %flog ~ %text "ask {<src>} {?~(cop "" "un")}successful")
|
||||
::
|
||||
++ poke-reload |=(all/(list term) (poke-reload-desk %home all))
|
||||
++ poke-reload-desk :: reload vanes
|
||||
|: $:{syd/desk all/(list term)} =< abet
|
||||
@ -225,50 +216,4 @@
|
||||
|= [wir=wire success=? binding=binding:eyre] =< abet
|
||||
(emit %flog ~ %text "bound: {<success>}")
|
||||
::
|
||||
++ poke-tlon-init-stream
|
||||
:: creates stream channel and makes it pull from
|
||||
:: urbit-meta on {met}.
|
||||
|= met/ship =< abet
|
||||
%- emil
|
||||
%- flop
|
||||
:~ ^- card
|
||||
:^ %poke /helm/web/stream/create [our %hall]
|
||||
:- %hall-action
|
||||
:- %create
|
||||
[%stream 'stream relay channel' %channel]
|
||||
::
|
||||
:^ %poke /helm/web/stream/filter [our %hall]
|
||||
:- %hall-action
|
||||
:- %filter
|
||||
[%stream | |]
|
||||
::
|
||||
:^ %poke /helm/web/stream/source [our %hall]
|
||||
:- %hall-action
|
||||
:- %source
|
||||
[%stream & [[[met %urbit-meta] `[da+(sub now ~d1) ~]] ~ ~]]
|
||||
==
|
||||
::
|
||||
++ poke-tlon-add-fora
|
||||
:: makes the local urbit-meta pull from {for}'s fora
|
||||
:: notification channels.
|
||||
|= for/ship =< abet
|
||||
%- emil
|
||||
:~ :^ %poke /helm/web/fora/source [our %hall]
|
||||
:- %hall-action
|
||||
:- %source
|
||||
[%urbit-meta & [[[for %fora-posts] `[da+now ~]] ~ ~]]
|
||||
::
|
||||
:^ %poke /helm/web/fora/source [our %hall]
|
||||
:- %hall-action
|
||||
:- %source
|
||||
[%urbit-meta & [[[for %fora-comments] `[da+now ~]] ~ ~]]
|
||||
==
|
||||
::
|
||||
++ poke-tlon-add-stream
|
||||
:: makes the local urbit-meta pull from {web}'s stream.
|
||||
|= web/ship =< abet
|
||||
%- emit
|
||||
:^ %poke /helm/web/stream/source [our %hall]
|
||||
:+ %hall-action %source
|
||||
[%urbit-meta & [[[web %stream] `[da+now ~]] ~ ~]]
|
||||
--
|
||||
|
@ -366,7 +366,7 @@
|
||||
::
|
||||
++ auto
|
||||
|= kiln-sync
|
||||
=+ (fall (~(get by syn) syd her sud) [let=*@ud ust=ost])
|
||||
=+ (~(gut by syn) [syd her sud] [let=*@ud ust=ost])
|
||||
|%
|
||||
++ abet
|
||||
..auto(syn (~(put by syn) [syd her sud] let ust))
|
||||
@ -470,7 +470,7 @@
|
||||
++ work :: state machine
|
||||
|= syd/desk
|
||||
=+ ^- per-desk
|
||||
%+ fall (~(get by rem) syd)
|
||||
%+ ~(gut by rem) syd
|
||||
=+ *per-desk
|
||||
%_(- cas [%da now])
|
||||
|%
|
||||
|
@ -3,7 +3,6 @@
|
||||
:::: /hoon/write/hood/lib
|
||||
::
|
||||
/? 310
|
||||
/- plan-diff, plan-acct
|
||||
=, format
|
||||
=* as-octs as-octs:mimes:html
|
||||
=, space:userlib
|
||||
@ -41,45 +40,6 @@
|
||||
|= {sup/path mim/mime} ^+ abet :: XX determine extension, beak
|
||||
(poke--data [`%md (flop sup)] %mime mim)
|
||||
::
|
||||
++ poke-plan-account
|
||||
|= {sev/knot usr/plan-acct} ^+ abet
|
||||
(poke-plan-diff [~ ~ [[sev usr] ~ ~]])
|
||||
::
|
||||
++ poke-plan-info
|
||||
|= {who/@t loc/@t}
|
||||
(poke-plan-diff [[~ who loc] ~ ~])
|
||||
::
|
||||
++ poke-plan-diff
|
||||
|= dif/plan-diff ^+ abet
|
||||
?. =(our src)
|
||||
~|(foreign-write+[our=our src=src] !!)
|
||||
=/ sev
|
||||
:: XX this scry will always fail. wat do?
|
||||
::
|
||||
=+ .^(path %e /(scot %p our)/serv/(scot %da now))
|
||||
?>(?=({@tas @tas *} -) -)
|
||||
=; sob/soba:clay
|
||||
?~(sob abet abet:(emit %info write+~ `toro:clay`[i.t.sev %& sob]))
|
||||
=+ pax=`path`/web/plan
|
||||
=+ paf=(en-beam beak-now (flop pax))
|
||||
?~ [fil:.^(arch %cy paf)]
|
||||
=+ ins=(pact-plan [['' ''] ~] dif)
|
||||
[pax %ins plan+!>(ins)]~
|
||||
=+ ole=.^({{@t @t} (map knot plan-acct)} %cx paf)
|
||||
=+ neu=(pact-plan ole dif)
|
||||
?: =(ole neu) ~
|
||||
[pax %dif plan-diff+!>(dif)]~
|
||||
::
|
||||
++ pact-plan :: XX clay should handle fused insert+diff
|
||||
|= {all/{{who/@t loc/@t} acc/(map knot plan-acct)} dif/plan-diff}
|
||||
^+ all
|
||||
:- (fall inf.dif -.all)
|
||||
=; neu (~(uni by neu) put.dif)
|
||||
=+ del=~(tap by del.dif) :: XXX map functions
|
||||
|- ^+ acc.all
|
||||
?~ del acc.all
|
||||
$(del t.del, acc.all (~(del by acc.all) p.i.del))
|
||||
::
|
||||
++ poke-paste
|
||||
|= {typ/?($hoon $md $txt) txt/@t} ^+ abet
|
||||
(poke--data [`typ /web/paste/(scot %da now)] %mime / (as-octs txt))
|
||||
|
@ -1,2 +0,0 @@
|
||||
=, html
|
||||
|=(hit/httr:eyre ~|(hit ?>(?=($2 (div p.hit 100)) (need (de-json q:(need r.hit))))))
|
@ -1,21 +0,0 @@
|
||||
|= inner=manx
|
||||
^- manx
|
||||
;html
|
||||
::
|
||||
;head
|
||||
;title: Landscape
|
||||
;meta(charset "utf-8");
|
||||
;meta
|
||||
=name "viewport"
|
||||
=content "width=device-width, initial-scale=1, shrink-to-fit=no";
|
||||
;link(rel "stylesheet", href "/~~/landscape/css/index.css");
|
||||
==
|
||||
::
|
||||
;body
|
||||
;div#root
|
||||
;+ inner
|
||||
==
|
||||
;script@"/~~/landscape/js/index-min.js";
|
||||
==
|
||||
::
|
||||
==
|
24
pkg/arvo/lib/launch.hoon
Normal file
24
pkg/arvo/lib/launch.hoon
Normal file
@ -0,0 +1,24 @@
|
||||
::
|
||||
|%
|
||||
::
|
||||
+$ move [bone card]
|
||||
::
|
||||
+$ card
|
||||
$% [%http-response =http-event:http]
|
||||
[%connect wire binding:eyre term]
|
||||
[%peer wire dock path]
|
||||
[%diff %json json]
|
||||
==
|
||||
::
|
||||
+$ tile [name=@tas subscribe=path]
|
||||
::
|
||||
+$ tile-data (map @tas [jon=json url=@t])
|
||||
::
|
||||
+$ action [name=@tas subscribe=path url=@t]
|
||||
::
|
||||
+$ state
|
||||
$% [%0 tiles=(set tile) data=tile-data path-to-tile=(map path @tas)]
|
||||
==
|
||||
::
|
||||
--
|
||||
::
|
@ -1,9 +0,0 @@
|
||||
:: hoon data to json
|
||||
::
|
||||
:::: /hoon/map-to-json/lib
|
||||
::
|
||||
/? 310
|
||||
=, format
|
||||
|* {a/_cord b/_json} :: XX {a/$-(* cord) b/$-(* json)}
|
||||
|= c/(map _+<.a _+<.b)
|
||||
(pairs:enjs (turn ~(tap by c) |*(d/^ [(a -.d) (b +.d)])))
|
@ -1 +0,0 @@
|
||||
prey:pubsub:userlib
|
@ -1,4 +1,4 @@
|
||||
/- *write
|
||||
/- *publish
|
||||
/+ elem-to-react-json
|
||||
|%
|
||||
::
|
@ -47,7 +47,7 @@
|
||||
++ js-response
|
||||
|= oct-js=octs
|
||||
^- http-event:http
|
||||
[%start [200 ['content-type' 'application/js']~] [~ oct-js] %.y]
|
||||
[%start [200 ['content-type' 'text/javascript']~] [~ oct-js] %.y]
|
||||
::
|
||||
++ json-response
|
||||
|= oct-js=octs
|
||||
@ -103,7 +103,7 @@
|
||||
++ js-response
|
||||
|= =octs
|
||||
^- simple-payload:http
|
||||
[[200 ['content-type' 'application/js']~] `octs]
|
||||
[[200 ['content-type' 'text/javascript']~] `octs]
|
||||
::
|
||||
++ json-response
|
||||
|= =octs
|
||||
|
@ -1,19 +0,0 @@
|
||||
::
|
||||
:::: /hoon/ask-mail/mar
|
||||
::
|
||||
/? 310
|
||||
=, format
|
||||
=, mimes:html
|
||||
|_ txt/cord
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun @t :: clam from %noun
|
||||
++ json so:dejs
|
||||
--
|
||||
++ grow
|
||||
|%
|
||||
++ psal ;div: {(trip txt)}
|
||||
++ mime [text+/plain (as-octs txt)]
|
||||
--
|
||||
--
|
@ -1,120 +0,0 @@
|
||||
::
|
||||
:::: /hoon/actions/collection/mar
|
||||
::
|
||||
/? 309
|
||||
/+ collections
|
||||
=, collections
|
||||
=, format
|
||||
::
|
||||
|_ act=action:collections
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
++ tank >act<
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun action:collections
|
||||
++ json
|
||||
|= jon=^json
|
||||
;; action:collections
|
||||
=< (action jon)
|
||||
|%
|
||||
++ action
|
||||
%- ot:dejs
|
||||
:~ ship+(su:dejs fed:ag)
|
||||
desk+(su:dejs sym)
|
||||
:- %acts
|
||||
%- ar:dejs
|
||||
%- of:dejs
|
||||
:~ write+write
|
||||
delete+delete
|
||||
perms+perms
|
||||
collection+collection
|
||||
post+post
|
||||
comment+comment
|
||||
==
|
||||
==
|
||||
::
|
||||
++ write
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
mark+(su:dejs sym)
|
||||
data+so:dejs
|
||||
==
|
||||
::
|
||||
++ delete
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
==
|
||||
::
|
||||
++ perms
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
:- %read
|
||||
%- ot:dejs
|
||||
:~ mod+(su:dejs ;~(pose (jest %black) (jest %white)))
|
||||
who+whoms
|
||||
==
|
||||
:- %write
|
||||
%- ot:dejs
|
||||
:~ mod+(su:dejs ;~(pose (jest %black) (jest %white)))
|
||||
who+whoms
|
||||
==
|
||||
==
|
||||
::
|
||||
++ whoms
|
||||
|= jon=^json
|
||||
^- (set whom:clay)
|
||||
=/ x ((ar:dejs (su:dejs fed:ag)) jon)
|
||||
;; (set whom:clay)
|
||||
%- ~(run in (sy x))
|
||||
|=(w=@ [& w])
|
||||
--
|
||||
::
|
||||
++ collection
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
name+sa
|
||||
desc+so:dejs
|
||||
comments+bo:dejs
|
||||
visible+bo:dejs
|
||||
type+(su:dejs sym)
|
||||
==
|
||||
::
|
||||
++ post
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
name+sa
|
||||
type+(su:dejs sym)
|
||||
comments+bo:dejs
|
||||
content+so:dejs
|
||||
edit+bo:dejs
|
||||
==
|
||||
::
|
||||
++ comment
|
||||
%- ot:dejs
|
||||
:~ path+(su:dejs ;~(pfix fas (more fas urs:ab)))
|
||||
content+so:dejs
|
||||
==
|
||||
::
|
||||
++ sa :: string as ta
|
||||
|= jon=^json
|
||||
?> ?=([%s *] jon)
|
||||
(scot %tas p.jon)
|
||||
--
|
||||
::
|
||||
--
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
/? 309
|
||||
::
|
||||
/- hall
|
||||
/+ collections
|
||||
::
|
||||
|_ com=command:collections
|
||||
++ grab
|
||||
|%
|
||||
++ noun command:collections
|
||||
--
|
||||
--
|
@ -1,92 +0,0 @@
|
||||
::
|
||||
:::: /hoon/config/collection/mar
|
||||
::
|
||||
/+ collections
|
||||
!:
|
||||
|_ con=config:collections
|
||||
::
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
++ mime
|
||||
:- /text/x-collection-config
|
||||
(as-octs:mimes:html (of-wain:format txt))
|
||||
++ txt
|
||||
^- wain
|
||||
::
|
||||
:~ (cat 3 'full-path: ' (spat (en-beam:format full-path.con)))
|
||||
(cat 3 'name: ' name.con)
|
||||
(cat 3 'description: ' description.con)
|
||||
::
|
||||
(cat 3 'author: ' (scot %p author.con))
|
||||
::
|
||||
(cat 3 'date-created: ' (scot %da date-created.con))
|
||||
(cat 3 'last-modified: ' (scot %da last-modified.con))
|
||||
::
|
||||
(cat 3 'type: ' type.con)
|
||||
(cat 3 'comments: ' ?:(comments.con 'y' 'n'))
|
||||
(cat 3 'sort-key: ' ?~(sort-key.con '~' (scot %ud u.sort-key.con)))
|
||||
(cat 3 'visible: ' ?:(visible.con 'y' 'n'))
|
||||
==
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime
|
||||
|= [mite:eyre p=octs:eyre]
|
||||
(txt (to-wain:format q.p))
|
||||
++ txt
|
||||
|= txs=(pole @t)
|
||||
^- config:collections
|
||||
:: TODO: putting ~ instead of * breaks this but shouldn't
|
||||
::
|
||||
?> ?= $: full-path=@t
|
||||
name=@t
|
||||
desc=@t
|
||||
author=@t
|
||||
dc=@t
|
||||
lm=@t
|
||||
type=@t
|
||||
com=@t
|
||||
sk=@t
|
||||
vis=@t
|
||||
*
|
||||
==
|
||||
txs
|
||||
::
|
||||
:* %- need
|
||||
%+ rash full-path.txs
|
||||
;~ pfix (jest 'full-path: ')
|
||||
%+ cook de-beam:format
|
||||
;~(pfix fas (more fas urs:ab))
|
||||
==
|
||||
::
|
||||
(rash name.txs ;~(pfix (jest 'name: ') (cook crip (star next))))
|
||||
::
|
||||
(rash desc.txs ;~(pfix (jest 'description: ') (cook crip (star next))))
|
||||
::
|
||||
(rash author.txs ;~(pfix (jest 'author: ~') fed:ag))
|
||||
::
|
||||
%+ rash dc.txs
|
||||
;~ pfix
|
||||
(jest 'date-created: ~')
|
||||
(cook year when:so)
|
||||
==
|
||||
::
|
||||
%+ rash lm.txs
|
||||
;~ pfix
|
||||
(jest 'last-modified: ~')
|
||||
(cook year when:so)
|
||||
==
|
||||
::
|
||||
(rash type.txs ;~(pfix (jest 'type: ') (cook crip (star next))))
|
||||
::
|
||||
(rash com.txs ;~(pfix (jest 'comments: ') (fuss %y %n)))
|
||||
::
|
||||
(rush sk.txs ;~(pfix (jest 'sort-key: ') dem:ag))
|
||||
::
|
||||
(rash vis.txs ;~(pfix (jest 'visible: ') (fuss %y %n)))
|
||||
==
|
||||
++ noun config:collections
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1,17 +0,0 @@
|
||||
::
|
||||
:::: /hoon/elem/collection/mar
|
||||
::
|
||||
/? 310
|
||||
=, mimes:html
|
||||
=, html
|
||||
|_ own/manx
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ hymn ;html:(head body:"+{own}") :: convert to %hymn
|
||||
++ html (crip (en-xml hymn)) :: convert to %html
|
||||
++ mime [/text/html (as-octs html)] :: convert to %mime
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
++ noun manx :: clam from %noun
|
||||
-- --
|
@ -1,24 +0,0 @@
|
||||
::
|
||||
:::: /hoon/json/collection/mar
|
||||
::
|
||||
/? 309
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
=, eyre
|
||||
=, format
|
||||
=, html
|
||||
|_ jon/json
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ txt (crip (en-json jon))
|
||||
++ json jon
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ noun ^json :: clam from %noun
|
||||
++ json ^json
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1,54 +0,0 @@
|
||||
::
|
||||
::
|
||||
/? 309
|
||||
::
|
||||
/- hall
|
||||
/+ collections, hall-json
|
||||
::
|
||||
|_ piz=prize:collections
|
||||
++ grow
|
||||
|%
|
||||
++ json
|
||||
=, enjs:format
|
||||
^- ^json
|
||||
%+ frond %landscape
|
||||
%+ frond %prize
|
||||
%- pairs
|
||||
:~ :- %inbox
|
||||
%- pairs
|
||||
:~ [%config ?~(con.inbox.piz ~ (conf:enjs:hall-json u.con.inbox.piz))]
|
||||
[%messages %a (turn env.inbox.piz enve:enjs:hall-json)]
|
||||
==
|
||||
::
|
||||
:+ %circles %a
|
||||
%+ turn ~(tap by circles.piz)
|
||||
|= [cir=circle:hall con=(unit config:hall)]
|
||||
%- pairs
|
||||
:~ [%circle (circ:enjs:hall-json cir)]
|
||||
[%config ?~(con ~ (conf:enjs:hall-json u.con))]
|
||||
==
|
||||
::
|
||||
:+ %circles-our %a
|
||||
%+ turn ~(tap in our-circles.piz)
|
||||
|= nom=name:hall
|
||||
[%s nom]
|
||||
::
|
||||
:- %dms
|
||||
%- pairs
|
||||
%+ turn ~(tap by dms.piz)
|
||||
|= [nom=name:hall ini=@p env=(list envelope:hall)]
|
||||
:- nom
|
||||
%- pairs
|
||||
:~ [%initiator (ship ini)]
|
||||
[%messages %a (turn env enve:enjs:hall-json)]
|
||||
==
|
||||
::
|
||||
[%invites %a (turn invites.piz enve:enjs:hall-json)]
|
||||
==
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun prize:collections
|
||||
--
|
||||
--
|
@ -1,36 +0,0 @@
|
||||
::
|
||||
::
|
||||
/? 309
|
||||
::
|
||||
/+ collections, hall-json
|
||||
::
|
||||
|_ rum=rumor:collections
|
||||
++ grow
|
||||
|%
|
||||
++ json
|
||||
=, enjs:format
|
||||
^- ^json
|
||||
%+ frond %landscape
|
||||
%+ frond %rumor
|
||||
%+ frond -.rum
|
||||
?- -.rum
|
||||
%config-change
|
||||
%- pairs
|
||||
:~ [%circle (circ:enjs:hall-json cir.rum)]
|
||||
[%config ?~(con.rum ~ (conf:enjs:hall-json u.con.rum))]
|
||||
==
|
||||
::
|
||||
%new-msg
|
||||
%- pairs
|
||||
:~ [%circle [%s nom.rum]]
|
||||
[%message (enve:enjs:hall-json env.rum)]
|
||||
==
|
||||
==
|
||||
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun rumor:collections
|
||||
--
|
||||
--
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
:::: /hoon/email/mar
|
||||
::
|
||||
/? 310
|
||||
|_ {adr/@ta tyl/tape mez/wall}
|
||||
::
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun {@ta tape wall} :: clam from %noun
|
||||
--
|
||||
--
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /mar/fora/comment/hoon
|
||||
::
|
||||
/? 310
|
||||
|_ {pax/path sup/spur txt/@t}
|
||||
++ grab
|
||||
|%
|
||||
++ noun {path spur @t}
|
||||
++ json
|
||||
(corl need =>(dejs-soft:format (ot pax+(su fel:stab) sup+(su fel:stab) txt+so ~)))
|
||||
--
|
||||
--
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /mar/fora/post/hoon
|
||||
::
|
||||
/? 310
|
||||
|_ {pax/path sup/spur hed/@t txt/@t}
|
||||
++ grab
|
||||
|%
|
||||
++ noun {path spur @t @t}
|
||||
++ json
|
||||
(corl need =>(dejs-soft:format (ot pax+(su fel:stab) sup+(su fel:stab) hed+so txt+so ~)))
|
||||
--
|
||||
--
|
@ -1,23 +0,0 @@
|
||||
::
|
||||
:::: /mar/hall/speeches/hoon
|
||||
::
|
||||
/? 310
|
||||
/- hall
|
||||
/+ hall,map-to-json
|
||||
::
|
||||
=+ hall
|
||||
|_ gam/(list speech)
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun (list speech)
|
||||
--
|
||||
::
|
||||
++ grad
|
||||
|%
|
||||
++ form %hall-speeches
|
||||
++ diff |=((list speech) +<)
|
||||
++ pact |=((list speech) +<)
|
||||
++ join |=({(list speech) (list speech)} `(unit mime)`~)
|
||||
--
|
||||
--
|
11
pkg/arvo/mar/launch/action.hoon
Normal file
11
pkg/arvo/mar/launch/action.hoon
Normal file
@ -0,0 +1,11 @@
|
||||
::
|
||||
::
|
||||
/+ launch
|
||||
::
|
||||
|_ act=action:launch
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun action:launch
|
||||
--
|
||||
--
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
:::: /hoon/plan-diff/mar
|
||||
::
|
||||
/? 310
|
||||
/- plan-diff
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
|_ plan-diff
|
||||
++ grab |% ++ noun plan-diff
|
||||
-- --
|
@ -1,102 +0,0 @@
|
||||
::
|
||||
:::: /hoon/plan/mar
|
||||
::
|
||||
/? 310
|
||||
/- plan-acct, plan-diff
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
=, eyre
|
||||
=, html
|
||||
=, format
|
||||
|_ all/{{who/@txname loc/@txloc} acc/(map knot plan-acct)}
|
||||
::
|
||||
++ grow :: convert to
|
||||
=+ all
|
||||
|%
|
||||
++ txt
|
||||
^- wain
|
||||
:+ (cat 3 'User ' ?~(who 'of Urbit' who))
|
||||
(cat 3 'Location ' ?~(loc %unknown loc))
|
||||
%+ turn (sort ~(tap by acc) aor)
|
||||
|= {a/knot b/plan-acct} ^- cord
|
||||
%+ rap 3
|
||||
:^ a ': ' usr.b
|
||||
?~(url.b ~ [', ' (apix:en-purl u.url.b)])
|
||||
::
|
||||
++ plan-json
|
||||
%- pairs:enjs :~
|
||||
who+?~(who ~ s+who)
|
||||
loc+?~(loc ~ s+loc)
|
||||
acc+o+(~(run by acc) json-acct)
|
||||
==
|
||||
++ json-acct :: helper
|
||||
|= a/plan-acct ^- json
|
||||
=/ url ?~(url.a ~ (tape:enjs (apix:en-purl u.url.a)))
|
||||
(pairs:enjs usr+s+usr.a url+url ~)
|
||||
--
|
||||
++ grab |% :: convert from
|
||||
++ noun {{cord cord} (map knot plan-acct)} :: clam from %noun
|
||||
++ txt
|
||||
|^ |= a/wain ^+ all
|
||||
?> ?=({@t @t *} a)
|
||||
:- [(rash i.a user) (rash i.t.a location)]
|
||||
(malt (turn t.t.a |=(b/cord (rash b account))))
|
||||
::
|
||||
++ user ;~(pfix (jest 'User ') (cook crip (star prn)))
|
||||
++ knot %+ cook crip
|
||||
(plus ;~(pose nud low hig hep dot sig cab))
|
||||
++ location ;~(pfix (jest 'Location ') (cook crip (star prn)))
|
||||
++ account
|
||||
;~ plug
|
||||
knot
|
||||
;~(pfix col ace knot)
|
||||
(punt ;~(pfix com ace aurf:de-purl))
|
||||
==
|
||||
--
|
||||
++ mime |=({* a/octs} (txt (to-wain q.a))) :: XX mark translation
|
||||
--
|
||||
++ grad
|
||||
|%
|
||||
++ form %plan-diff
|
||||
++ diff
|
||||
|= neu/_all ^- plan-diff :: XXX map functions
|
||||
:+ ?:(=(-.all -.neu) ~ (some -.neu))
|
||||
=< (malt `(list {knot ~})`(murn ~(tap by acc.all) .))
|
||||
|= {a/knot *} ^- (unit {knot ~})
|
||||
?:((~(has by acc.neu) a) ~ (some [a ~]))
|
||||
=< (malt (murn ~(tap by acc.neu) .))
|
||||
|= {a/knot b/plan-acct} ^- (unit {knot plan-acct})
|
||||
?: =([~ b] (~(get by acc.all) a))
|
||||
~
|
||||
(some [a b])
|
||||
::
|
||||
++ pact
|
||||
|= dif/plan-diff ^+ all :: XXX map functions
|
||||
:- (fall inf.dif -.all)
|
||||
=; neu (~(uni by neu) put.dif)
|
||||
=+ del=~(tap by del.dif)
|
||||
|- ^+ acc.all
|
||||
?~ del acc.all
|
||||
$(del t.del, acc.all (~(del by acc.all) p.i.del))
|
||||
::
|
||||
++ can-join
|
||||
|= {ali/plan-diff bob/plan-diff} ^- ?
|
||||
?& !&(?=({{^ *} {^ *}} +<) !=(u.inf.ali u.inf.bob)) :: compatible info
|
||||
=(~ (~(int by `(map knot *)`del.ali) put.bob)) :: no del-put
|
||||
=(~ (~(int by `(map knot *)`put.ali) del.bob)) :: conflicts
|
||||
.= (~(int by put.ali) put.bob) :: and all put
|
||||
(~(int by put.bob) put.ali) :: values match
|
||||
==
|
||||
::
|
||||
++ join
|
||||
|= {ali/plan-diff bob/plan-diff}
|
||||
^- (unit plan-diff)
|
||||
?. (can-join ali bob)
|
||||
~
|
||||
%^ some
|
||||
(mate inf.ali inf.bob)
|
||||
(~(uni by del.ali) del.bob)
|
||||
(~(uni by put.ali) put.bob)
|
||||
--
|
||||
--
|
@ -1,11 +1,11 @@
|
||||
::
|
||||
:::: /hoon/action/write/mar
|
||||
:::: /hoon/action/publish/mar
|
||||
::
|
||||
/? 309
|
||||
/- write
|
||||
/- publish
|
||||
=, format
|
||||
::
|
||||
|_ act=action:write
|
||||
|_ act=action:publish
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
@ -14,10 +14,10 @@
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
++ noun action:write
|
||||
++ noun action:publish
|
||||
++ json
|
||||
|= jon=^json
|
||||
%- action:write
|
||||
%- action:publish
|
||||
=< (action jon)
|
||||
|%
|
||||
++ action
|
68
pkg/arvo/mar/publish/comment.hoon
Normal file
68
pkg/arvo/mar/publish/comment.hoon
Normal file
@ -0,0 +1,68 @@
|
||||
/- publish
|
||||
!:
|
||||
|_ com=comment:publish
|
||||
::
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
++ mime
|
||||
:- /text/x-publish-comments
|
||||
(as-octs:mimes:html (of-wain:format txt))
|
||||
++ txt
|
||||
^- wain
|
||||
:* (cat 3 'creator: ' (scot %p creator.info.com))
|
||||
(cat 3 'collection: ' collection.info.com)
|
||||
(cat 3 'post: ' post.info.com)
|
||||
(cat 3 'date-created: ' (scot %da date-created.info.com))
|
||||
(cat 3 'last-modified: ' (scot %da last-modified.info.com))
|
||||
'-----'
|
||||
(to-wain:format body.com)
|
||||
==
|
||||
--
|
||||
++ grab
|
||||
|%
|
||||
++ mime
|
||||
|= [mite:eyre p=octs:eyre]
|
||||
(txt (to-wain:format q.p))
|
||||
++ txt
|
||||
|= txs=(pole @t)
|
||||
^- comment:publish
|
||||
:: TODO: putting ~ instead of * breaks this but shouldn't
|
||||
::
|
||||
?> ?= $: creator=@t
|
||||
collection=@t
|
||||
post=@t
|
||||
date-created=@t
|
||||
last-modified=@t
|
||||
line=@t
|
||||
body=*
|
||||
==
|
||||
txs
|
||||
:_ (of-wain:format (wain body.txs))
|
||||
::
|
||||
:* %+ rash creator.txs
|
||||
;~(pfix (jest 'creator: ~') fed:ag)
|
||||
::
|
||||
%+ rash collection.txs
|
||||
;~(pfix (jest 'collection: ') (cook crip (star next)))
|
||||
::
|
||||
%+ rash post.txs
|
||||
;~(pfix (jest 'post: ') (cook crip (star next)))
|
||||
::
|
||||
%+ rash date-created.txs
|
||||
;~ pfix
|
||||
(jest 'date-created: ~')
|
||||
(cook year when:so)
|
||||
==
|
||||
::
|
||||
%+ rash last-modified.txs
|
||||
;~ pfix
|
||||
(jest 'last-modified: ~')
|
||||
(cook year when:so)
|
||||
==
|
||||
::
|
||||
==
|
||||
++ noun comment:publish
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1,15 +1,15 @@
|
||||
::
|
||||
:::: /hoon/info/write/mar
|
||||
:::: /hoon/info/publish/mar
|
||||
::
|
||||
/- write
|
||||
/- publish
|
||||
!:
|
||||
|_ con=collection-info:write
|
||||
|_ con=collection-info:publish
|
||||
::
|
||||
::
|
||||
++ grow
|
||||
|%
|
||||
++ mime
|
||||
:- /text/x-write-info
|
||||
:- /text/x-publish-info
|
||||
(as-octs:mimes:html (of-wain:format txt))
|
||||
++ txt
|
||||
^- wain
|
||||
@ -29,7 +29,7 @@
|
||||
(txt (to-wain:format q.p))
|
||||
++ txt
|
||||
|= txs=(pole @t)
|
||||
^- collection-info:write
|
||||
^- collection-info:publish
|
||||
:: TODO: putting ~ instead of * breaks this but shouldn't
|
||||
::
|
||||
?> ?= $: owner=@t
|
||||
@ -55,14 +55,14 @@
|
||||
%+ rash comments.txs
|
||||
;~ pfix
|
||||
(jest 'comments: ')
|
||||
%+ cook comment-config:write
|
||||
%+ cook comment-config:publish
|
||||
;~(pose (jest %open) (jest %closed) (jest %none))
|
||||
==
|
||||
::
|
||||
%+ rash allow-edit.txs
|
||||
;~ pfix
|
||||
(jest 'allow-edit: ')
|
||||
%+ cook edit-config:write
|
||||
%+ cook edit-config:publish
|
||||
;~(pose (jest %post) (jest %comment) (jest %all) (jest %none))
|
||||
==
|
||||
::
|
||||
@ -78,7 +78,7 @@
|
||||
(cook year when:so)
|
||||
==
|
||||
==
|
||||
++ noun collection-info:write
|
||||
++ noun collection-info:publish
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1,5 +1,5 @@
|
||||
/- *write
|
||||
/+ *write, elem-to-react-json
|
||||
/- *publish
|
||||
/+ *publish
|
||||
|_ rum=rumor
|
||||
++ grab
|
||||
|%
|
@ -1,4 +1,4 @@
|
||||
/- *write
|
||||
/- *publish
|
||||
|_ upd=update
|
||||
++ grab
|
||||
|%
|
@ -1,17 +0,0 @@
|
||||
::
|
||||
:::: /hoon/quri/mar
|
||||
::
|
||||
/? 310
|
||||
=, eyre
|
||||
=, mimes:html
|
||||
=, html
|
||||
|_ url/quri
|
||||
::
|
||||
++ grow |% ++ mime [text+/x-uri (as-octt (apex:en-purl url))]
|
||||
--
|
||||
++ grab :: convert from
|
||||
|%
|
||||
++ noun quri :: clam from %noun
|
||||
++ mime |=(mim/^mime (rash q.q.mim zest:de-purl))
|
||||
--
|
||||
--
|
@ -1,31 +0,0 @@
|
||||
:: Possibly non-fatal http error
|
||||
::
|
||||
:::: /hoon/recoverable-error/mar
|
||||
::
|
||||
/- recoverable-error
|
||||
::
|
||||
:::: ~fyr
|
||||
::
|
||||
=, eyre
|
||||
=, format
|
||||
=, html
|
||||
|_ recoverable-error
|
||||
++ grab
|
||||
|%
|
||||
++ noun recoverable-error
|
||||
++ httr
|
||||
|= a/^httr ^- recoverable-error
|
||||
~& [%recoverable-httr a]
|
||||
~! a
|
||||
?+ p.a ~|(non-recoverable+p.a !!)
|
||||
$429 :+ p.a %rate-limit
|
||||
%. %x-rate-limit-reset
|
||||
;~ biff
|
||||
~(get by (malt q.a))
|
||||
de-json
|
||||
ni:dejs-soft
|
||||
==
|
||||
==
|
||||
--
|
||||
++ grow |% ++ tank >[+<]< --
|
||||
--
|
@ -1,10 +0,0 @@
|
||||
::
|
||||
:::: /hoon/rss-xml/mar
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:: alias
|
||||
/: /===/mar/xml
|
||||
/!noun/
|
||||
::
|
||||
-
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /hoon/paste/write/mar
|
||||
::
|
||||
/? 310
|
||||
|_ [typ=?($hoon $md $txt) txt=@t]
|
||||
++ grab
|
||||
|%
|
||||
++ noun [?($hoon $md $txt) @t]
|
||||
++ json
|
||||
(corl need =>(dejs-soft:format (ot typ+(ci (soft ?($hoon $md $txt)) so) txt+so ~)))
|
||||
--
|
||||
--
|
@ -1,12 +0,0 @@
|
||||
::
|
||||
:::: /hoon/paste/write/mar
|
||||
::
|
||||
/? 310
|
||||
|_ [who=@txname loc=@txloc]
|
||||
++ grab
|
||||
|%
|
||||
++ noun [@txname @txloc]
|
||||
++ json
|
||||
(corl need =>(dejs-soft:format (ot who+so loc+so ~)))
|
||||
--
|
||||
--
|
@ -1,15 +0,0 @@
|
||||
::
|
||||
:::: /hoon/tree/write/mar
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
=, mimes:html
|
||||
=, format
|
||||
|_ [sup=spur mim=mime]
|
||||
++ grab
|
||||
|%
|
||||
++ noun [spur mime]
|
||||
++ json
|
||||
=,(dejs (ot sup+(su fel:stab) mime+(cu |=(a=@t [/ (as-octs a)]) so) ~))
|
||||
--
|
||||
--
|
@ -1,11 +0,0 @@
|
||||
::
|
||||
:::: /hoon/wipe/write/mar
|
||||
::
|
||||
/? 310
|
||||
|_ spur
|
||||
++ grab
|
||||
|%
|
||||
++ noun spur
|
||||
++ json (corl need (su:dejs-soft:format fel:stab))
|
||||
--
|
||||
--
|
@ -1,26 +0,0 @@
|
||||
::
|
||||
:::: /hoon/x-collections-json/mar
|
||||
::
|
||||
/? 310
|
||||
::
|
||||
:::: compute
|
||||
::
|
||||
=, eyre
|
||||
=, format
|
||||
=, html
|
||||
|_ jon/json
|
||||
::
|
||||
++ grow :: convert to
|
||||
|%
|
||||
++ mime [/application/json (as-octs:mimes txt)] :: convert to %mime
|
||||
++ txt (crip (en-json jon))
|
||||
--
|
||||
++ grab
|
||||
|% :: convert from
|
||||
++ mime |=({p/mite q/octs} (fall (rush (@t q.q) apex:de-json) *json))
|
||||
++ noun json :: clam from %noun
|
||||
++ numb numb:enjs
|
||||
++ time time:enjs
|
||||
--
|
||||
++ grad %mime
|
||||
--
|
@ -1,3 +0,0 @@
|
||||
|_ a=json
|
||||
++ grab |% ++ noun json
|
||||
-- --
|
@ -1,21 +0,0 @@
|
||||
/? 310
|
||||
|_ [hed=marl tal=marl]
|
||||
++ grow
|
||||
|%
|
||||
++ mime
|
||||
=< mime
|
||||
|%
|
||||
++ elem ;div:(h1:"*{hed}" div:"*{tal}") :: convert to %elem
|
||||
++ hymn ;html:(head:title:"snip" body:"+{elem}") :: convert to %hymn
|
||||
++ html (crip (en-xml:^html hymn)) :: convert to %html
|
||||
++ mime [/text/html (as-octs:mimes:^html html)] :: convert to %mime
|
||||
--
|
||||
++ collections-snip [hed tal]
|
||||
--
|
||||
::
|
||||
++ grab
|
||||
|%
|
||||
+$ noun [marl marl]
|
||||
--
|
||||
--
|
||||
|
@ -1,3 +0,0 @@
|
||||
|_ a=manx
|
||||
++ grab |% ++ noun manx
|
||||
-- --
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user