diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..0c4d36153 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +language: node_js # ish, mainly used as an entry point +node_js: + - 4 +before_install: + - cd .travis # keep main directory clear + + - > + wget $(cat ./pin-urbit-release.url)/urbit -O ./urbit && + chmod +x ./urbit; + echo "FIXME downloaded raw urbit binary releaseinstead of .deb"; + echo "FIXME used full pinned url instead of tag name" + +before_script: bash get-or-build-pill.sh + +# https://github.com/travis-ci/travis-ci/issues/2570 +before_deploy: "[ -d piers ] || { mkdir piers && tar cvzSf piers/zod-$TRAVIS_COMMIT.tgz zod/; }" +deploy: + - skip_cleanup: true + provider: gcs + access_key_id: GOOGW5WD4W7RF3TQ5EBM + secret_access_key: + secure: cbMrx/jloYtTiMc9b+gujrpdzmB05yHC7C2PN1dqHoe25JqwS1c8ne0jhzYOanSkJptPEjwpKeEYLyF87CStCglMJaHwsx1wAm94D8Vh6WL96pgxFbMdVRD+g2dAcSXYnSX5C0QpFrnxY8ujg9yqhItpvd+whsPYjxZahIUd5rPPS1gCP2O6hGpKFCv5++DB1RgqL5y1Hlm9efsLxsnkS7cuzrSX6o8I6Yns5pFlDDRED7Tgpp5DYYfq6ZmiIpxbuYZK+AYJKK7N2zC4RfFXstgL+M9h7joFE1r8RlzrVHLXL7+3qg8POWEEu47008ORByDCmlt5VKoMBJ3q4J4ykDKI2qmx3jw68tGIu2o5uVf6KpxtAM2IJSNZ4mOEYjs7ieR1GOrLKr7lSSYEOIShJhx7J1MMjBOaS17Ho7Uc4iNLGpH4M7DpiKwVLnjfsYiasv/1xq71ed386wLTpI5YyY/SfsNPoIbgv1IjkKIMRLl5l85tEUK10h8dxQi3mXeaP698LnQLdHdxeBKJB08hwJrl7kIOJnqZxWPBp8i7OQeIvKcu+WzMg5UIR4hR7wj7NEga/+1jjjDQeo7EHQB2Tk9dhXtTmozOGpsW49H7+VBThhhNODEYeX3CIcdOtSyjuwBLZ45HsKIhhWA00b+YyE8boBkV1yQeFh/IYCZBn7s= + bucket: ci-piers.urbit.org + local-dir: piers/ + acl: public-read + on: + repo: urbit/arvo + all_branches: true + # + - skip_cleanup: true + provider: gcs + access_key_id: GOOGW5WD4W7RF3TQ5EBM + secret_access_key: + secure: cbMrx/jloYtTiMc9b+gujrpdzmB05yHC7C2PN1dqHoe25JqwS1c8ne0jhzYOanSkJptPEjwpKeEYLyF87CStCglMJaHwsx1wAm94D8Vh6WL96pgxFbMdVRD+g2dAcSXYnSX5C0QpFrnxY8ujg9yqhItpvd+whsPYjxZahIUd5rPPS1gCP2O6hGpKFCv5++DB1RgqL5y1Hlm9efsLxsnkS7cuzrSX6o8I6Yns5pFlDDRED7Tgpp5DYYfq6ZmiIpxbuYZK+AYJKK7N2zC4RfFXstgL+M9h7joFE1r8RlzrVHLXL7+3qg8POWEEu47008ORByDCmlt5VKoMBJ3q4J4ykDKI2qmx3jw68tGIu2o5uVf6KpxtAM2IJSNZ4mOEYjs7ieR1GOrLKr7lSSYEOIShJhx7J1MMjBOaS17Ho7Uc4iNLGpH4M7DpiKwVLnjfsYiasv/1xq71ed386wLTpI5YyY/SfsNPoIbgv1IjkKIMRLl5l85tEUK10h8dxQi3mXeaP698LnQLdHdxeBKJB08hwJrl7kIOJnqZxWPBp8i7OQeIvKcu+WzMg5UIR4hR7wj7NEga/+1jjjDQeo7EHQB2Tk9dhXtTmozOGpsW49H7+VBThhhNODEYeX3CIcdOtSyjuwBLZ45HsKIhhWA00b+YyE8boBkV1yQeFh/IYCZBn7s= + bucket: bootstrap.urbit.org + local-dir: built-pill/ + acl: public-read + on: + condition: -d built-pill/ + repo: urbit/arvo + all_branches: true diff --git a/.travis/.gitignore b/.travis/.gitignore new file mode 100644 index 000000000..c2658d7d1 --- /dev/null +++ b/.travis/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/.travis/get-or-build-pill.sh b/.travis/get-or-build-pill.sh new file mode 100644 index 000000000..76b9d78d8 --- /dev/null +++ b/.travis/get-or-build-pill.sh @@ -0,0 +1,79 @@ +#!/bin/bash +set -euo pipefail +# set -x + +# XX use -s instead of hash pill +HASH=$(git -C .. log -1 HEAD --format=%H -- sys/) +export PILL_NAME="git-${HASH:0:10}" + +if [ ! ${PILL_FORCE:-} ]; then + wget https://bootstrap.urbit.org/$PILL_NAME.pill -O urbit.pill && exit 0 +fi + +# if wget failed + +if [ ${TRAVIS_COMMIT:-} ] && [ $TRAVIS_COMMIT != $HASH ]; then + echo Directory sys/ not modified in commit $TRAVIS_COMMIT + echo FIXME ignoring, as current sys/ commits are unlikely to contain the pill-build code + echo +# echo For auto-build please tag and push $HASH +# exit 1 +fi + +mkdir prev +{ + echo Pilling: trying pinned fakezod + wget -i pin-parent-pill-pier.url -O - | tar xvz -C prev/ && + echo Downloaded prev/zod +} || { + echo Pilling: Parent-pill pier not available, trying preceding pill commit + HASH2=$(git -C .. log -2 $HASH --format=%H -- sys/ | tail -1) + PILL_NAME2="git-${HASH2:0:10}" + wget https://bootstrap.urbit.org/$PILL_NAME2.pill -O urbit.pill && + echo FIXME running test script to create fakezod, this might be overkill && + lsc test.ls && + mv urbit.pill prev/urbit.pill && + mv zod prev/zod && + export PIER_FRESH="y" +} || { + echo Pilling: Out of ideas + exit 1 +} + +lsc < + pty = require \pty.js + + urbit = pty.spawn './urbit' <[-FI zod prev/zod]> + .on \data -> process.stdout.write it + + on-next = (re,cb)-> + urbit.pipe (new stream-snitch re).on \match once cb + + on-next /\n(\/~|ford: )/ -> + console.log "\n\n---\nnode: detected error\n---\n\n" + set-timeout (-> process.exit 1), 1000 + + <- on-next /dojo> / + {PILL_NAME} = process.env + do-pill = -> + urbit.write "|label %home %#PILL_NAME\r" + urbit.write ".urbit/pill +solid /==/#PILL_NAME/sys, =dub &\r" + <- wait-on resources: <[ prev/zod/.urb/put/urbit.pill ]> + urbit.write "\04" + process.exit 0 + # + if process.env.PIER_FRESH then do-pill! + urbit.write "|autoload |\r" + urbit.write "|mount %\r" + <- wait-on resources: <[ prev/zod/home ]> + <- recursive-copy '../sys/' 'prev/zod/home/sys/' {+overwrite} .then + on-next /sync/ do-pill +done +cp prev/zod/.urb/put/urbit.pill urbit.pill +mkdir built-pill; cp urbit.pill built-pill/$PILL_NAME.pill + +echo +echo Created $PILL_NAME.pill, to be uploaded if tests pass +echo diff --git a/.travis/package.json b/.travis/package.json new file mode 100644 index 000000000..57a37cc44 --- /dev/null +++ b/.travis/package.json @@ -0,0 +1,19 @@ +{ + "name": "arvo-tests", + "version": "1.0.0", + "description": "Test harness for Urbit arvo distribution", + "main": "test.ls", + "scripts": { + "test": "lsc test.ls" + }, + "author": "~fyr", + "license": "MIT", + "dependencies": { + "livescript": "^1.5.0", + "once": "^1.4.0", + "pty.js": "^0.3.1", + "recursive-copy": "^2.0.7", + "stream-snitch": "0.0.3", + "wait-on": "^2.0.2" + } +} diff --git a/.travis/pin-parent-pill-pier.url b/.travis/pin-parent-pill-pier.url new file mode 100644 index 000000000..a22da1ea0 --- /dev/null +++ b/.travis/pin-parent-pill-pier.url @@ -0,0 +1 @@ +https://ci-piers.urbit.org/zod-2eb534980256ca8598333616f3bceb164183a9e9.tgz diff --git a/.travis/pin-urbit-release.url b/.travis/pin-urbit-release.url new file mode 100644 index 000000000..bf8599a25 --- /dev/null +++ b/.travis/pin-urbit-release.url @@ -0,0 +1 @@ +https://github.com/urbit/urbit/releases/download/travis-0.5.0 diff --git a/.travis/test.ls b/.travis/test.ls new file mode 100644 index 000000000..016773b07 --- /dev/null +++ b/.travis/test.ls @@ -0,0 +1,30 @@ +require! \stream-snitch +pty = require \pty.js + +urbit = + # TODO abort on failure + pty.spawn './urbit' <[-B urbit.pill -A .. -cFI zod zod]> + .on \data -> process.stdout.write it + +urbit.on \exit (code)-> + console.log "\nnode: urbit exited with code #code\n" + process.exit code + +fin = no +urbit.pipe (new stream-snitch /dojo> /g).on \match -> + return if fin + fin := yes + console.log "\n\n---\nnode: got dojo!\n---\n\n" + set-timeout (-> process.exit 0), 1000 # should probably test further + +urbit.pipe (new stream-snitch /\n(\/~|ford: )/g).on \match -> + return if fin + fin := yes + console.log "\n\n---\nnode: detected error\n---\n\n" + set-timeout (-> process.exit 1), 1000 + +set-timeout ... + -> console.log "\n\n---\nnode: timed out after 5 min\n---" + 5*60000 + +process.on \exit -> urbit.write '\04' # send EOF to gracefully checkpoint diff --git a/app/ask.hoon b/app/ask.hoon index 1a4838cfc..8d390342c 100644 --- a/app/ask.hoon +++ b/app/ask.hoon @@ -2,12 +2,12 @@ :::: /hoon/ask/app :: /? 310 -/+ sole, womb, prey +/+ sole, hood-womb, prey [. sole] |% ++ card $% {$diff $sole-effect sole-effect} - {$poke wire {ship $hood} $womb-invite {cord:womb invite:womb}} + {$poke wire {ship $hood} $womb-invite {cord:hood-womb invite:hood-womb}} == ++ invited ?($new $sent $ignored) ++ email @t @@ -154,7 +154,7 @@ ^- card :^ %poke /invite/(scot %t ask) [(need wom) %hood] :- %womb-invite - ^- [cord:womb invite:womb] + ^- [cord:hood-womb invite:hood-womb] =+ inv=(scot %uv (end 7 1 eny.bow)) [inv [ask 1 0 "You have been invited to Urbit: {(trip inv)}" ""]] -- diff --git a/app/hood.hoon b/app/hood.hoon index af3d974e6..1961ad973 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -2,56 +2,84 @@ :::: /hoon/hood/app :: :: :: :: :: /? 310 :: zuse version -/+ sole, helm, kiln, drum, write, womb :: libraries -[. helm kiln drum] +/+ sole :: libraries + :: XX these should really be separate apps, as + :: none of them interact with each other in + :: any fashion; however, to reduce boot-time + :: complexity and work around the current + :: non-functionality of end-to-end acknowledgments, + :: they have been bundled into :hood + :: + :: |command handlers + hood-helm, hood-kiln, hood-drum, hood-write, + hood-womb :: :: :: :::: :: :: :: :: :: +|% +++ hood-module + :: each hood module follows this general shape + => |% + += part [%module %0 pith] + += pith ~ + :: + += move [bone card] + += card $% [%fake _!!] + == + -- + |= [bowl:gall own=part] + |_ moz=(list move) + ++ abet [(flop moz) own] + -- +-- +:: :: :: +:::: :: :: state handling + :: :: :: !: -=> |% :: module boilerplate - ++ hood-old :: +=> |% :: + ++ hood-old :: unified old-state {?($0 $1) lac/(map @tas hood-part-old)} :: - ++ hood-1 :: + ++ hood-1 :: unified state {$1 lac/(map @tas hood-part)} :: - ++ hood-good :: + ++ hood-good :: extract specific |* hed/hood-head :: |= paw/hood-part :: ?- hed :: - $drum ?>(?=($drum -.paw) `drum-part`paw) :: - $helm ?>(?=($helm -.paw) `helm-part`paw) :: - $kiln ?>(?=($kiln -.paw) `kiln-part`paw) :: - $womb ?>(?=($womb -.paw) `part:womb`paw) :: - $write ?>(?=($write -.paw) `part:write`paw) :: - == :: - ++ hood-head _-:*hood-part :: + $drum ?>(?=($drum -.paw) `part:hood-drum`paw) :: + $helm ?>(?=($helm -.paw) `part:hood-helm`paw) :: + $kiln ?>(?=($kiln -.paw) `part:hood-kiln`paw) :: + $womb ?>(?=($womb -.paw) `part:hood-womb`paw) :: + $write ?>(?=($write -.paw) `part:hood-write`paw) :: + == :: module name + ++ hood-head _-:*hood-part :: initialize state ++ hood-make :: |* {our/@p hed/hood-head} :: ?- hed :: - $drum (drum-make our) :: - $helm *helm-part :: - $kiln *kiln-part :: - $womb *part:womb :: - $write *part:write :: + $drum (make:hood-drum our) :: + $helm *part:hood-helm :: + $kiln *part:hood-kiln :: + $womb *part:hood-womb :: + $write *part:hood-write :: == :: - ++ hood-part-old hood-part :: - ++ hood-port :: + ++ hood-part-old hood-part :: old state for ++prep + ++ hood-port :: state transition |= paw/hood-part-old ^- hood-part :: paw :: :: :: - ++ hood-part :: - $% {$drum $2 drum-pith-2} :: - {$helm $0 helm-pith} :: - {$kiln $0 kiln-pith} :: - {$womb $1 pith:womb} :: - {$write $0 pith:write} :: + ++ hood-part :: current module state + $% {$drum $2 pith-2:hood-drum} :: + {$helm $0 pith:hood-helm} :: + {$kiln $0 pith:hood-kiln} :: + {$womb $1 pith:hood-womb} :: + {$write $0 pith:hood-write} :: == :: -- :: :: :: :: -:::: :: :: +:::: :: :: app proper :: :: :: =, gall -|_ $: hid/bowl :: system state - hood-1 :: server state +|_ $: hid/bowl :: gall environment + hood-1 :: module states == :: ++ able :: find+make part |* hed/hood-head @@ -63,42 +91,23 @@ |* {(list) hood-part} [(flop +<-) %_(+> lac (~(put by lac) +<+< +<+))] :: :: :: -:::: :: :: +:::: :: :: generic handling :: :: :: ++ prep - |= old/(unit hood-old) ^- (quip _!! _+>) :: + |= old/(unit hood-old) ^- (quip _!! _+>) :- ~ ?~ old +> +>(lac (~(run by lac.u.old) hood-port)) :: -++ coup-kiln-fancy (wrap take-coup-fancy):from-kiln -++ coup-kiln-spam :: - |= {way/wire saw/(unit tang)} - ~? ?=(^ saw) [%kiln-spam-lame u.saw] - [~ +>] -:: -++ coup-kiln-reload :: - |= {way/wire saw/(unit tang)} - ~? ?=(^ saw) [%kiln-reload-lame u.saw] - [~ +>] -:: -++ coup-kiln-overload :: - |= {way/wire saw/(unit tang)} - ~? ?=(^ saw) [%kiln-overload-lame u.saw] - [~ +>] -:: -++ poke-hood-load +++ poke-hood-load :: recover lost brain |= dat/hood-part - ?> =(our src) + ?> =(our.hid src.hid) ~& loaded+-.dat [~ %_(+> lac (~(put by lac) -.dat dat))] :: -++ 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 -++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum -++ from-lib - |* _[%helm ..$ _abet]:(helm) +:: +++ from-module :: create wrapper + |* _[%module ..$ _abet]:(hood-module) => .(+< [identity start finish]=+<) =- [wrap=- *start] :: usage (wrap handle-arm):from-foo |* handle/_finish @@ -106,12 +115,23 @@ =. +>.handle (start hid (able identity)) (ably (handle +<)) :: -++ from-drum (from-lib %drum [..$ _se-abet]:(drum)) -++ from-helm (from-lib %helm [..$ _abet]:(helm)) -++ from-kiln (from-lib %kiln [..$ _abet]:(kiln)) -++ from-womb (from-lib %womb [..$ _abet]:(womb)) -++ from-write (from-lib %write [..$ _abet]:(write)) +:: per-module interface wrappers +++ from-drum (from-module %drum [..$ _se-abet]:(hood-drum)) +++ from-helm (from-module %helm [..$ _abet]:(hood-helm)) +++ from-kiln (from-module %kiln [..$ _abet]:(hood-kiln)) +++ from-womb (from-module %womb [..$ _abet]:(hood-womb)) +++ from-write (from-module %write [..$ _abet]:(hood-write)) :: +:: :: :: +:::: :: :: switchboard + :: :: :: +++ 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 +++ diff-sole-effect-drum-phat (wrap diff-sole-effect-phat):from-drum ++ init-helm |=({way/wire *} [~ +>]) ++ made-write (wrap made):from-write ++ made-kiln (wrap take-made):from-kiln @@ -121,7 +141,7 @@ ++ note-helm (wrap take-note):from-helm ++ onto-drum (wrap take-onto):from-drum ++ peer-drum (wrap peer):from-drum -++ peek-x-womb peek-x:(womb hid (able %womb)) +++ peek-x-womb peek-x:(hood-womb hid (able %womb)) ++ peer-scry-x-womb (wrap peer-scry-x):from-womb ++ poke-atom (wrap poke-atom):from-helm ++ poke-dill-belt (wrap poke-dill-belt):from-drum diff --git a/gen/cat.hoon b/gen/cat.hoon index 3049c8857..5525cff82 100644 --- a/gen/cat.hoon +++ b/gen/cat.hoon @@ -3,8 +3,7 @@ :::: /hoon/cat/gen :: /? 310 -// /%%/ls/subdir -// /%/pretty +/+ pretty-file, show-dir :: :::: :: @@ -29,6 +28,6 @@ * =- [palm+[": " ``~]^-]~ :~ rose+[" " `~]^~[leaf+"*" (smyt pax)] - `tank`(subdir vane pax dir.ark) + `tank`(show-dir vane pax dir.ark) == == diff --git a/gen/cram.hoon b/gen/cram.hoon deleted file mode 100644 index c2c6dae05..000000000 --- a/gen/cram.hoon +++ /dev/null @@ -1,60 +0,0 @@ -::BROKEN fixme when md is properly merged -:: -:::: hoon/cram/gen - :: - :: test generator for the cram markdown syntax - :: - :: todo: integrate with ++sail and embed in hoon compiler - :: - :: ++cram is a simple markdown-inspired parser that makes - :: common html tropes easy to type. you can think of ++cram - :: as "rational markdown" or "markdown with syntax errors." - :: a document format should be easy to type and read, but - :: that doesn't mean it can't or have rigorous syntax. - :: - :: tldr: ++cram is indent-oriented. indent 2 spaces for - :: a dynamic interpolation, 4 spaces for example code, 6 - :: spaces for a blockquote and 8 spaces for verse. separate - :: every semantic block by a blank line. use - for - :: unordered lists, + for ordered lists. - :: - :: markdown link syntax works. * means bold, _ means - :: italics, "" inserts smart quotes. all enclosed - :: strings are reparsed; escape the terminator within - :: the string, eg, *star \* in bold text*. - :: - :: markdown `literal` syntax is supported, but all hoon - :: constants are automatically marked as code. also, any - :: hoon expression prefixed with # is a code literal. - :: - :: (++cram is a valid hoon parsing rule, but it does a lot - :: of custom processing internally, since the language is - :: context-sensitive. we use a context-sensitive parser - :: to cut the lines into blocks, then reparse flow blocks - :: with normal hoon rules. multipass parsing is the tax - :: humans have to pay for simple but human-friendly syntax.) - :: -::|= inp/cord -::=< (steam-marl (rash inp apex:(sail &))) -=< |=(pax/path (test pax)) -|% :: -++ test :: test text parsing - |= pax/path - ^- tape - :: - :: src: text file as (list cord) - :: txt: source as tape with newlines - :: vex: parsing result - :: - =/ src .^(wain %cx pax) - =. src ['---' src] - =/ txt (zing (turn src |=(@t (weld (rip 3 +<) `tape`~[`@`10])))) - =/ vex (cram:vast [1 1] txt) - :: - :: print result as error or xml text - ?~ q.vex - "syntax error: line {(scow %ud p.p.vex)}, column {(scow %ud q.p.vex)}" - ?: [freeze=|] (poxo (snag 1 ~(shut ap p.u.q.vex))) - (poxo ;;(manx q:(slap !>(..zuse) p.u.q.vex))) -:: --- diff --git a/gen/heed.hoon b/gen/heed.hoon deleted file mode 100644 index abcc997ad..000000000 --- a/gen/heed.hoon +++ /dev/null @@ -1,150 +0,0 @@ -::BROKEN -=> |% - -- -|* $: :> vinyl: historical state (including version) - :> brain: working state of the application (not including version) - :> delta: grain of change across all state - :> prize: (pair mark noun) for namespace value - :> rumor: (pair mark noun) for namespace diff - :> opera: (pair bone card) for operation (old ++move) - :> - vinyl/mold - brain/mold - delta/mold - prize/mold - rumor/mold - opera/mold - == -|_ $: :> ops: pending operations, in reverse order - :> ego: current state - :> - ops/(list opera) - ego/brain - == -:: :: ++bake -++ bake :< apply delta - |= $: :> del: change - :> - del/delta - == - :> core after change (including operations) - ^- _+> - !! -:: :: ++cope -++ cope :< transaction result - |= $: :> weg: forward identity - :> het: success or error report - :> - weg/(list coin) - het/(unit tang) - == - :> actions in reverse order - :> - ^- (list delta) - !! -:: :: ++fail -++ fail :< process error - |= $: :> why: error dump - :> - why/tang - == - :> actions in reverse order - :> - ^- (list delta) - !! -:: :: ++feel -++ feel :< update - |= $: :> del: change - :> pex: preparsed path, inside-first - :> - del/delta - pex/(list coin) - == - :> query updates in reverse order - :> - ^- (list rumor) - !! -:: :: ++hear -++ hear :< subscription update - |= $: :> weg: forward identity - :> - weg/(list coin) - == - :> actions in reverse order - :> - ^- (list delta) - !! -:: :: ++pull -++ pull :< subscription cancel - |= $: :> weg: forward identity - :> het: error report, if any - :> - weg/(list coin) - het/(unit tang) - == - :> actions in reverse order - :> - ^- (list delta) - !! -:: :: ++leak -++ leak :< check access - |= $: :> lec: leakset (~ means public) - :> pex: preparsed path, inside-first - :> - lec/(unit (set ship)) - pex/(list coin) - == - :> if path `pex` is visible to ships in `lec` - ^- ? - !! -:: :: ++load -++ look :< asynchronous read - |= $: :> pex: preparsed path, inside-first - :> - pex/(list coin) - == - :> actions in reverse order - ^- _+> - !! -:: :: ++prep -++ prep :< load system - |= $: old/vinyl - == - :> core after boot - ^- _+> - !! -:: :: ++peek -++ peek :< synchronous read - |= $: :> pex: preparsed path, inside-first - :> - pex/(list coin) - == - :> value at `pec`; ~ for unavailable, [~ ~] for invalid - :> - ^- (unit (unit prize)) - !! -:: :: ++poke -++ poke :< generic poke - |= $: :> ost: opaque cause - :> msg: message with mark and vase - :> - ost/bone - msg/cage - == - :> actions in reverse order - :> - ^- (list delta) - !! -:: :: ++pour -++ pour :< arvo response - |= $: :> weg: forward identity - :> sin: response card - :> - weg/(list coin) - sin/sign - == - :> actions in reverse order - :> - ^- (list delta) - !! --- diff --git a/gen/hood/invite.hoon b/gen/hood/invite.hoon index a14d237e8..f8bdf609c 100644 --- a/gen/hood/invite.hoon +++ b/gen/hood/invite.hoon @@ -6,14 +6,36 @@ :: :::: :: -/+ womb -=* invite invite:womb -=* reference reference:womb +/+ hood-womb +=* invite invite:hood-womb +=* reference reference:hood-womb +|% +++ plural + |= {a/@u b/tape} ^+ b + ?: =(1 a) "one {b}" + =; n/tape "{n} {b}s" + ~| plural-stub+a ::TODO expand + %- trip + %+ snag a ^~ + %+ weld + /no/''/two/three/four/five/six/seven/eight/nine/ten/elven/twelve + /thirteen/fourteen/fifteen/sixteen/seventeen/eighteen/nineteen/twenty +:: +++ type $%({$planets planets/@u} {$stars stars/@u}) +-- :- %say |= $: {now/@da eny/@uvJ bec/beak} - {{who/@t $~} ref/(unit (each ship mail:womb)) sta/@} + {{who/@t etc/$@($~ {typ/type $~})} ref/(unit (each ship mail:hood-womb))} == +?~ etc $(etc ~[planets+2]) :- %womb-invite ^- {cord reference invite} =+ inv=(scot %uv (end 7 1 eny)) -[inv ref [who 10 sta "You have been invited to Urbit: {(trip inv)}" "This is an invite of 10 planets"]] +=; d/[planets=@u stars=@u inf=tape] + [inv ref [who planets.d stars.d "Your invite for {inf.d}: {(trip inv)}" ~]] +:: +?: =(0 +.typ.etc) ~|(%empty-invite !!) +?- -.typ.etc + $stars [planets=0 stars.typ.etc (plural stars.typ.etc "star")] + $planets [planets.typ.etc stars=0 (plural planets.typ.etc "planet")] +== diff --git a/gen/hood/load.hoon b/gen/hood/load.hoon index 054c950d7..c82fba059 100644 --- a/gen/hood/load.hoon +++ b/gen/hood/load.hoon @@ -3,7 +3,7 @@ :::: /hoon/load/hood/gen :: /? 310 -/+ womb, old-zuse +/+ hood-womb, old-zuse =, old-zuse :: :::: @@ -12,9 +12,9 @@ |= $: {now/@da eny/@uvJ byk/beak} {{dap/term pas/@uw $~} $~} == -^- {$hood-load ?(part:womb)} +^- {$hood-load ?(part:hood-womb)} ?+ dap ~|(unknown-backup+dap !!) $womb =+ dat=.^(@ %cx (tope byk /jam-crub/womb-part/bak/hood/app)) - [%hood-load ;;(part:womb (cue (dy:crub pas dat)))] + [%hood-load ;;(part:hood-womb (cue (dy:crub pas dat)))] == diff --git a/gen/hood/reinvite.hoon b/gen/hood/reinvite.hoon index d885b78cc..9db8cd648 100644 --- a/gen/hood/reinvite.hoon +++ b/gen/hood/reinvite.hoon @@ -8,7 +8,8 @@ :: :- %say |= $: {now/@da eny/@uvJ bec/beak} - {{pas/@uvG who/@t $~} $~} + {{pas/@uvG who/@t pla/@u sta/@u $~} $~} == :- %womb-reinvite -[pas who 3 0 "You have been inivted to Urbit" "This is a re-invite of 3 planets"] +=/ new `@uv`(end 7 1 eny) +[pas new who pla sta "Your urbit balance has been transferred: {}" ""] diff --git a/gen/hood/replay-womb-log.hoon b/gen/hood/replay-womb-log.hoon index 095d89165..bcb26d235 100644 --- a/gen/hood/replay-womb-log.hoon +++ b/gen/hood/replay-womb-log.hoon @@ -3,12 +3,12 @@ :::: /hoon/replay-womb-log/hood/gen :: /? 310 -/+ womb +/+ hood-womb :: :::: :: :- %say |= $: {now/@da eny/@uvJ bec/beak} - {log/(list {@uvJ transaction:womb}) $~} + {log/(list {@uvJ transaction:hood-womb}) $~} == [%womb-replay-log log] diff --git a/gen/hood/transfer.hoon b/gen/hood/transfer.hoon index d1b3a1fee..1a0df2bf7 100644 --- a/gen/hood/transfer.hoon +++ b/gen/hood/transfer.hoon @@ -3,7 +3,7 @@ :::: /hoon/transfer/hood/gen :: /? 310 -/+ womb +/+ hood-womb :: :::: :: @@ -12,6 +12,6 @@ {{pas/@uvH who/@t $~} $~} == :- %womb-reinvite -=+ [him=(scot %p p.bec) cas=(scot %da now) key=(scot %p pas)] -=+ [pla=planets sta=stars]:.^(balance:womb %gx /[him]/hood/[cas]/womb/balance/[key]) +=+ [him=(scot %p p.bec) cas=(scot %da now) key=(scot %uv pas)] +=+ [pla=planets sta=stars]:.^(balance:hood-womb %gx /[him]/hood/[cas]/womb/balance/[key]/womb-balance) [pas who pla sta "Email updated, new passcode" "Email correction"] diff --git a/gen/ivory.hoon b/gen/ivory.hoon index 41eb6bba7..d556ef597 100644 --- a/gen/ivory.hoon +++ b/gen/ivory.hoon @@ -19,24 +19,24 @@ :: =+ compiler-source=.^(@t %cx (welp sys /hoon/hoon)) :: -:: compiler-twig: compiler as hoon expression +:: compiler-hoon: compiler as hoon expression :: ~& %ivory-parsing -=+ compiler-twig=(ream compiler-source) +=+ compiler-hoon=(ream compiler-source) ~& %ivory-parsed :: :: arvo-source: hoon source file producing arvo kernel, `sys/arvo` :: =+ arvo-source=.^(@t %cx (welp sys /arvo/hoon)) :: -:: whole-twig: arvo within compiler +:: whole-hoon: arvo within compiler :: -=+ whole-twig=`twig`[%tsgr compiler-twig [%tsgr [%$ 7] (ream arvo-source)]] +=+ whole-hoon=`hoon`[%tsgr compiler-hoon [%tsgr [%$ 7] (ream arvo-source)]] :: :: compile the whole schmeer :: ~& %ivory-compiling -=+ whole-formula=q:(~(mint ut %noun) %noun whole-twig) +=+ whole-formula=q:(~(mint ut %noun) %noun whole-hoon) ~& %ivory-compiled :: whole-formula diff --git a/gen/ls.hoon b/gen/ls.hoon index c476c3c0f..c03296b93 100644 --- a/gen/ls.hoon +++ b/gen/ls.hoon @@ -3,7 +3,7 @@ :::: /hoon/ls/gen :: /? 310 -// /%/subdir +/+ show-dir :: :::: :: @@ -11,4 +11,4 @@ :- %say |= {^ {arg/path $~} vane/?($g $c)} =+ lon=.^(arch (cat 3 vane %y) arg) -tang+[?~(dir.lon leaf+"~" (subdir vane arg dir.lon))]~ +tang+[?~(dir.lon leaf+"~" (show-dir vane arg dir.lon))]~ diff --git a/gen/ls/subdir.hoon b/gen/ls/subdir.hoon deleted file mode 100644 index 6bef2d4c8..000000000 --- a/gen/ls/subdir.hoon +++ /dev/null @@ -1,25 +0,0 @@ -:: Filesystem iterator XX move to lib/ -:: -:::: /hoon/subdir/ls/gen - :: -/? 310 -|% -++ subdir - |= {vane/?($g $c) pax/path des/(map @t $~)} - ^- tank - :+ %rose [" " `~] - %+ turn (sort ~(tap by des) aor) - |= {kid/@ta $~} - =+ paf=`path`/[kid] - =- :+ %rose ["/" ~ ?:(dir "/" ~)] - (turn paf |=(a/knot leaf+(trip a))) - |- ^- {dir/? paf/path} - =+ arf=.^(arch (cat 3 vane %y) (weld pax paf)) - ?^ fil.arf - [| paf] - ?~ dir.arf - [& paf] :: !! - ?. ?=({^ $~ $~} dir.arf) - [& paf] - $(paf (welp paf /[p.n.dir.arf])) --- diff --git a/gen/mud.hoon b/gen/mud.hoon deleted file mode 100644 index befc5092a..000000000 --- a/gen/mud.hoon +++ /dev/null @@ -1,72 +0,0 @@ -::BROKEN -:: Compile arvo as a pill noun, for compiler changes; -:: usage -:: -:: .urbit/pill +mud -:: -:::: /hoon/mud/gen - :: -/? 310 -/+ old-zuse -=, old-zuse -:: -:::: - !: -:- %say -|= $: {now/@da eny/@uvJ bec/beak} - {$~ $~} - == -:- %noun -=+ ^= must - :: virtualize, running in a nested memory ring - :: - |* taq/_|.(**) - =+ muz=(mule taq) - ?- -.muz - $& p.muz - $| (mean p.muz) - == -=+ top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys -=+ pax=`path`(weld top `path`[%hoon ~]) -=+ arp=`path`(weld top `path`[%ovra ~]) -~& %mud-start -=+ txt=.^(@t %cx (weld pax `path`[%hoon ~])) -=+ rax=.^(@t %cx (weld arp `path`[%hoon ~])) -~& %mud-loaded -=+ gen=(must |.((rain pax txt))) -~& %mud-parsed -=+ one=(must |.((~(mint ut %noun) %noun gen))) -~& %mud-compiled -=+ gat=`vase`[p.one .*(0 q.one)] -~& %mud-done-hoon -=+ kyr=`(pair vase vase)`[(slap ked [%limb %p]) (slap ked [%limb %q])] -~& %mud-next-arvo -=+ - %- must |. - (slam gat (slop p.kyr `vase`[[%atom %t ~] rax])) -~& %mud-done-arvo -=+ ayr=`(pair vase vase)`[(slap arv [%limb %p]) (slap arv [%limb %q])] -=+ ken=[7 q.q.kyr q.q.ayr] -~& [%mud-recompiled `@ux`(mug ken)] -:- ken -=+ all=.*(0 ken) -=+ ^= vay ^- (list {p/@tas q/path}) - :~ [%$ /zuse] - [%f /vane/ford] - [%c /vane/clay] - [%g /vane/gall] - [%a /vane/ames] - [%b /vane/behn] - [%d /vane/dill] - [%e /vane/eyre] - == -|- ^+ all -?~ vay all -=+ pax=(weld top q.i.vay) -=+ txt=.^(@ %cx (weld pax `path`[%hoon ~])) -=+ sam=[now `ovum`[[%gold ~] [%veer p.i.vay pax txt]]] -~& [%solid-veer i.vay] -=+ gat=.*(all .*(all [0 42])) -=+ nex=+:.*([-.gat [sam +>.gat]] -.gat) -$(vay t.vay, all nex) - diff --git a/gen/serving.hoon b/gen/serving.hoon new file mode 100644 index 000000000..a54ff98da --- /dev/null +++ b/gen/serving.hoon @@ -0,0 +1,12 @@ +:: Eyre: show web base path +:: +:::: /hoon/serving/gen + :: +/? 310 +:: +:::: + :: +:- %say +|= [[now=time @ our=ship ^] ~ ~] +:- %noun +.^(path %e (en-beam:format [our %serv da+now] /)) diff --git a/gen/solid.hoon b/gen/solid.hoon index 35e061130..355b0e34b 100644 --- a/gen/solid.hoon +++ b/gen/solid.hoon @@ -11,26 +11,44 @@ !: :- %say |= $: {now/@da eny/@uvJ bec/beak} - {$~ $~} + {arg/$@($~ {top/path $~}) dub/_|} == :- %noun -=+ top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys -=+ pax=`path`(weld top `path`[%hoon ~]) -=+ arp=`path`(weld top `path`[%ovra ~]) +?~ arg $(arg ~[top=`path`/(scot %p p.bec)/[q.bec]/(scot %da now)/sys]) +=+ pax=`path`(weld top.arg `path`[%hoon ~]) +=+ arp=`path`(weld top.arg `path`[%ovra ~]) ~& %solid-start =+ txt=.^(@t %cx (weld pax `path`[%hoon ~])) =+ rax=.^(@t %cx (weld arp `path`[%hoon ~])) =+ ^= ken - =- ?:(?=($& -.res) p.res ((slog p.res) ~)) + =- ?:(?=($& -.res) p.res (mean (flop p.res))) ^= res %- mule |. ~& %solid-loaded =+ gen=(rain pax txt) ~& %solid-parsed =+ one=(~(mint ut %noun) %noun gen) ~& %solid-compiled - =+ two=(~(mint ut p.one) %noun (rain arp rax)) - ~& %solid-arvo - [7 q.one q.two] + ?. dub + =+ two=(~(mint ut p.one) %noun (rain arp rax)) + ~& %solid-arvo + [7 q.one q.two] + =/ tri + ''' + :: XX moveme to, uh arvo probably, this depends on too many names + |= [pax=path txt=@t arp=path rax=@t] + =+ gen=(rain pax txt) + ~& %solid-double-parsed + =+ one=(~(mint ut %noun) %noun gen) + ~& %solid-double-compiled + =+ two=(~(mint ut p.one) %noun (rain arp rax)) + ~& %solid-arvo + [7 q.one q.two] + ''' + =+ all=.*(0 q.one) + .* all + :+ 7 =<(+ .*(all [9 2 0+2 1+[p.one tri] 0+7])) + [9 2 0+2 1+[pax txt arp rax] 0+7] +:: ~& [%solid-kernel `@ux`(mug ken)] :- ken =+ all=.*(0 ken) @@ -46,7 +64,7 @@ == |- ^+ all ?~ vay all -=+ pax=(weld top q.i.vay) +=+ pax=(weld top.arg q.i.vay) =+ txt=.^(@ %cx (weld pax `path`[%hoon ~])) =+ sam=[now `ovum`[[%gold ~] [%veer p.i.vay pax txt]]] ~& [%solid-veer i.vay] diff --git a/gen/walk.hoon b/gen/walk.hoon deleted file mode 100644 index b4cacc3bc..000000000 --- a/gen/walk.hoon +++ /dev/null @@ -1,161 +0,0 @@ -::BROKEN -!: -:::: - :: -:- %say -|= $: {now/@da * bec/beak} - * - == -=< :- %noun - %hello -|% -:: -++ ap - |_ gen/twig - ++ gi - =| whit - =* wit - - |% - ++ gray - ^- ? - | - :: on reflection, perhaps just obsessive linting - :: - :: ?| ?=(^ lab) - :: ?=(^ boy) - :: |- ^- ? - :: ?~ def | - :: |($(def l.def) $(def r.def) !(~(has in use) p.n.def)) - :: == - :: - ++ grad - |= $: gen/twig - wit/whit - aid/$-({? twig whit} {twig whit}) - == - ^- (unit (pair twig whit)) - =: ^gen gen - ^wit wit - == - ?: =([~ ~ ~ ~] wit) `[gen wit] - =< apex - |% - ++ apex - ^- (unit (pair twig whit)) - =^ one wit prim - =^ two wit senc(gen one) - ?: =(gen two) - ~ - `(aid & two wit) - :: - :: resolve body and label issues - :: - ++ prim - ^- (pair twig whit) - ?: ?=(^ -.gen) flam - ?+ -.gen flam - $halo flam - $base runk - $leaf runk - $bcpt runk - $bccb runk - $bccl runk - $bccn runk - $bchp runk - $bckt runk - $bcwt runk - $bcts flam - $bcsm runk - $brcb ((doof -.gen +>.gen) p.gen) - $brcl ((doof -.gen +>.gen) p.gen) - $brcn ((doof -.gen +>.gen) p.gen) - $brdt ((doof -.gen +>.gen) p.gen) - $brkt ((doof -.gen +>.gen) p.gen) - $brhp ((doof -.gen +>.gen) p.gen) - $brsg ((doof -.gen +>.gen) p.gen) - $brtr ((doof -.gen +>.gen) p.gen) - $brts ((doof -.gen +>.gen) p.gen) - $brwt ((doof -.gen +>.gen) p.gen) - == - :: - :: resolve variable issues - :: - ++ senc - ^- (pair twig whit) - ?: ?=(^ -.gen) flam - ?+ -.gen flam - $ktts ((helk -.gen +>.gen) p.gen) - $bcts ((helk -.gen +>.gen) p.gen) - $var ((hulp -.gen +>.gen) p.gen) - $rev ((hulp -.gen +>.gen) p.gen) - $sip ((hulp -.gen +>.gen) p.gen) - $aka ((humm -.gen +>.gen) p.gen) - == - :: - ++ flam [gen wit] - ++ grif - |= {cog/term wat/what} - ^- {what whit} - ?: =(~ def) - ?~ boy [wat wit] - [boy wit(boy ~)] - =+ yeb=(~(get by def) cog) - ?~ yeb [wat wit] - [`u.yeb wit(use (~(put in use) cog))] - :: - ++ doof - |* {pif/@tas suf/*} - |= pac/chap - ^- (pair twig whit) - :_ wit(lab ~, boy ~) - =- [pif - suf] - ^- chap - :- ?~(lab p.pac [u.lab ~]) - ?~(boy q.pac boy) - :: - ++ helk - |* {pif/@tas suf/*} - |= got/toga - ^- (pair twig whit) - =^ gef wit (tong got) - [[pif gef suf] wit] - :: - ++ hulp - |* {pif/@tas suf/*} - |= hot/toro - ^- (pair twig whit) - =^ tog wit (tong p.hot) - [[pif [tog q.hot] suf] wit] - :: - ++ humm - |* {pif/@tas suf/*} - |= {cog/term wat/what) - ^- (pair twig whit) - =^ taw wit (grif cog wat) - [[pif [cog taw] suf] wit] - :: - ++ runk - ^- (pair twig whit) - ?~ boy flam - [[%halo boy gen] wit(boy ~)] - :: - ++ tong - |= got/toga - ^- {toga whit} - ?@ got - =^ wat wit (grif got ~) - ?~ wat [got wit] - [[%1 [wat got] [%0 ~]] wit] - ?- -.got - $0 [got wit] - $1 =^ wat wit (grif q.p.got p.p.got) - =^ sub wit $(got q.got) - [[%1 [wat q.p.got] sub] wit] - $2 =^ one wit $(got p.got) - =^ two wit $(got q.got) - [[%2 one two] wit] - == - -- - -- - -- --- diff --git a/gen/womb/balance.hoon b/gen/womb/balance.hoon index 00c0cbd5f..e5dabc8a6 100644 --- a/gen/womb/balance.hoon +++ b/gen/womb/balance.hoon @@ -3,11 +3,11 @@ :::: /hoon/balance/womb/gen :: /? 310 -/+ womb +/+ hood-womb :- %say |= $: {now/@da eny/@uvJ bec/beak} {pas/@uvG $~} who/(unit @p) == -=- [%womb-balance .^(balance:womb %gx /[him]/hood/[cas]/womb/balance/[key]/womb-balance)] +=- [%womb-balance .^(balance:hood-womb %gx /[him]/hood/[cas]/womb/balance/[key]/womb-balance)] [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now) key=(scot %uv pas)] diff --git a/gen/womb/balances.hoon b/gen/womb/balances.hoon index 54165bf90..69644505e 100644 --- a/gen/womb/balances.hoon +++ b/gen/womb/balances.hoon @@ -3,7 +3,7 @@ :::: /hoon/balance/womb/gen :: /? 310 -/+ womb +/+ hood-womb :- %say |= $: {now/@da eny/@uvJ bec/beak} $~ @@ -11,5 +11,5 @@ == :- %womb-balance-all =+ [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now)] -=/ balances =>(womb ,(set [passhash mail])) +=/ balances =>(hood-womb ,(set [passhash mail])) .^(balances %gx /[him]/hood/[cas]/womb/balance/womb-balance-all) diff --git a/gen/womb/stats.hoon b/gen/womb/stats.hoon index e4a3581bd..81f0cc11c 100644 --- a/gen/womb/stats.hoon +++ b/gen/womb/stats.hoon @@ -2,7 +2,7 @@ :::: /hoon/stats/womb/gen :: /? 310 -/+ womb +/+ hood-womb :- %say |= $: {now/@da eny/@uvJ bec/beak} $~ @@ -10,4 +10,4 @@ == :- %womb-stat-all =+ [him=(scot %p ?^(who u.who p.bec)) cas=(scot %da now)] -.^((map ship stat:womb) %gx /[him]/hood/[cas]/womb/stats/womb-stat-all) +.^((map ship stat:hood-womb) %gx /[him]/hood/[cas]/womb/stats/womb-stat-all) diff --git a/lib/drum.hoon b/lib/hood/drum.hoon similarity index 97% rename from lib/drum.hoon rename to lib/hood/drum.hoon index 8e3bfb2db..217fc547e 100644 --- a/lib/drum.hoon +++ b/lib/hood/drum.hoon @@ -1,5 +1,5 @@ :: :: :: -:::: /hoon/drum/lib :: :: +:::: /hoon/drum/hood/lib :: :: :: :: :: /? 310 :: version /- sole, hall @@ -9,18 +9,18 @@ :::: :: :: :: :: :: |% :: :: -++ drum-part {$drum $2 drum-pith-2} :: -++ drum-part-old {$drum $1 drum-pith-1} :: +++ part {$drum $2 pith-2} :: +++ part-old {$drum $1 pith-1} :: :: :: -++ drum-pith-1 :: pre-style - %+ cork drum-pith-2 :: - |=(drum-pith-2 +<(bin *(map bone source-1))) :: +++ pith-1 :: pre-style + %+ cork pith-2 :: + |=(pith-2 +<(bin *(map bone source-1))) :: :: :: ++ source-1 :: %+ cork source :: |=(source +<(mir *(pair @ud (list @c)))) :: style-less mir :: :: -++ drum-pith-2 :: +++ pith-2 :: $: sys/(unit bone) :: local console eel/(set gill:gall) :: connect to ray/(set well:gall) :: @@ -88,9 +88,9 @@ ^- (list gill:gall) [[our %talk] [our %dojo] ~] :: -++ drum-make :: initial part +++ make :: initial part |= our/ship - ^- drum-part + ^- part :* %drum %2 ~ :: sys @@ -100,19 +100,20 @@ ~ :: bin == :: :: -++ drum-path :: encode path +:: +++ en-gill :: gill to wire |= gyl/gill:gall ^- wire [%drum %phat (scot %p p.gyl) q.gyl ~] :: -++ drum-phat :: decode path +++ de-gill :: gill from wire |= way/wire ^- gill:gall ?>(?=({@ @ $~} way) [(slav %p i.way) i.t.way]) -- :: :::: :: -|= {hid/bowl:gall drum-part} :: main drum work +|= {hid/bowl:gall part} :: main drum work =+ (fall (~(get by bin) ost.hid) *source) =* dev - => |% :: arvo structures @@ -136,7 +137,7 @@ ++ diff-sole-effect-phat :: app event |= {way/wire fec/sole-effect} =< se-abet =< se-view - =+ gyl=(drum-phat way) + =+ gyl=(de-gill way) ?: (se-aint gyl) +>.$ (se-diff gyl fec) :: @@ -178,7 +179,7 @@ ++ reap-phat :: ack connect |= {way/wire saw/(unit tang)} =< se-abet =< se-view - =+ gyl=(drum-phat way) + =+ gyl=(de-gill way) ?~ saw (se-join gyl) (se-dump:(se-drop & gyl) u.saw) @@ -187,7 +188,7 @@ |= {way/wire saw/(unit tang)} =< se-abet =< se-view ?~ saw +> - =+ gyl=(drum-phat way) + =+ gyl=(de-gill way) ?: (se-aint gyl) +>.$ %- se-dump:(se-drop & gyl) :_ u.saw @@ -209,15 +210,15 @@ ++ quit-phat :: |= way/wire =< se-abet =< se-view - =+ gyl=(drum-phat way) + =+ gyl=(de-gill way) ~& [%drum-quit src.hid ost.hid gyl] (se-drop %| gyl) :: :: :: :::: :: :: :: :: :: ++ se-abet :: resolve - ^- (quip move drum-part) - =* pith +>+>+<+ + ^- (quip move part) + =* pith +<+.$ ?. se-ably =. . se-adit [(flop moz) pith] @@ -445,16 +446,16 @@ :: ++ se-poke :: send a poke |= {gyl/gill:gall par/pear} - (se-emit [ost.hid %poke (drum-path gyl) gyl par]) + (se-emit [ost.hid %poke (en-gill gyl) gyl par]) :: ++ se-peer :: send a peer |= gyl/gill:gall %- se-emit(fug (~(put by fug) gyl ~)) - [ost.hid %peer (drum-path gyl) gyl /sole] + [ost.hid %peer (en-gill gyl) gyl /sole] :: ++ se-pull :: cancel subscription |= gyl/gill:gall - (se-emit [ost.hid %pull (drum-path gyl) gyl ~]) + (se-emit [ost.hid %pull (en-gill gyl) gyl ~]) :: ++ se-tame :: switch connection |= gyl/gill:gall diff --git a/lib/helm.hoon b/lib/hood/helm.hoon similarity index 93% rename from lib/helm.hoon rename to lib/hood/helm.hoon index 9dcd0b257..b267cee85 100644 --- a/lib/helm.hoon +++ b/lib/hood/helm.hoon @@ -1,5 +1,5 @@ :: :: :: -:::: /hoon/helm/lib :: :: +:::: /hoon/helm/hood/lib :: :: :: :: :: /? 310 :: version /- sole @@ -8,12 +8,12 @@ :::: :: :: :: :: :: |% :: :: -++ helm-part {$helm $0 helm-pith} :: helm state -++ helm-pith :: helm content - $: bur/(unit (pair ship mace:ames)) :: requesting ticket - hoc/(map bone helm-session) :: consoles +++ part {$helm $0 pith} :: helm state +++ pith :: helm content + $: bur/(unit (pair ship mace:ames)) :: requesting ticket + hoc/(map bone session) :: consoles == :: -++ helm-session :: +++ session :: $: say/sole-share :: console state mud/(unit (sole-dialog @ud)) :: console dialog == :: @@ -42,8 +42,8 @@ :: :: :: :::: :: :: :: :: :: -|= {bowl:gall helm-part} :: main helm work -=+ sez=(fall (~(get by hoc) ost) *helm-session) +|= {bowl:gall part} :: main helm work +=+ sez=(fall (~(get by hoc) ost) *session) => |% :: arvo structures ++ card :: $% {$cash wire p/@p q/buck:ames} :: @@ -64,7 +64,7 @@ -- |_ moz/(list move) ++ abet :: resolve - [(flop moz) %_(+>+>+<+ hoc (~(put by hoc) ost sez))] + [(flop moz) %_(+<+.$ hoc (~(put by hoc) ost sez))] :: ++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card ++ emil :: return cards @@ -186,7 +186,7 @@ ++ poke-meset :: reset system (new) |= hood-reset =< abet %- emil - %- flop ^- (list card) + %- flop ^- (list card) =+ top=`path`/(scot %p our)/home/(scot %da now)/sys =+ hun=.^(@ %cx (welp top /hoon/hoon)) =+ arv=.^(@ %cx (welp top /arvo/hoon)) diff --git a/lib/kiln.hoon b/lib/hood/kiln.hoon similarity index 96% rename from lib/kiln.hoon rename to lib/hood/kiln.hoon index a02a5db39..1b6d1327d 100644 --- a/lib/kiln.hoon +++ b/lib/hood/kiln.hoon @@ -1,5 +1,5 @@ :: :: :: -:::: /hoon/kiln/lib :: :: +:::: /hoon/kiln/hood/lib :: :: :: :: :: /? 310 :: version :: :: :: @@ -9,9 +9,9 @@ =, space:userlib =, format |% :: :: -++ kiln-part {$kiln $0 kiln-pith} :: kiln state -++ kiln-pith :: - $: rem/(map desk kiln-desk) :: +++ part {$kiln $0 pith} :: kiln state +++ pith :: :: + $: rem/(map desk per-desk) :: syn/(map kiln-sync {let/@ud ust/bone}) :: autoload-on/? :: cur-hoon/@uvI :: @@ -19,7 +19,7 @@ cur-zuse/@uvI :: cur-vanes/(map @tas @uvI) :: == :: -++ kiln-desk :: per-desk state +++ per-desk :: per-desk state $: auto/? :: escalate on failure gem/germ :: strategy her/@p :: from ship @@ -56,7 +56,7 @@ :: :: :: :::: :: :: :: :: :: -|= {bowl:gall kiln-part} :: main kiln work +|= {bowl:gall part} :: main kiln work ?> =(src our) => |% :: arvo structures ++ card :: @@ -82,7 +82,7 @@ -- |_ moz/(list move) ++ abet :: resolve - [(flop moz) `kiln-part`+>+>->] + [(flop moz) `part`+<+.$] :: ++ emit |=(card %_(+> moz [[ost +<] moz])) :: return card ++ emil :: return cards @@ -254,6 +254,11 @@ +>.$ =. cur-vanes (~(put by cur-vanes) syd new-vane) (emit [%poke /kiln/reload/[syd] [our %hood] %helm-reload ~[syd]]) + :: + ++ coup-reload + |= {way/wire saw/(unit tang)} + ~? ?=(^ saw) [%kiln-reload-lame u.saw] + +>.$ -- :: ++ poke-overload @@ -275,6 +280,15 @@ |= {way/wire saw/(unit tang)} abet:abet:(coup-fancy:(take way) saw) :: +++ take-coup-reload :: + |= {way/wire saw/(unit tang)} + abet:(coup-reload:autoload way saw) +:: +++ take-coup-spam :: + |= {way/wire saw/(unit tang)} + ~? ?=(^ saw) [%kiln-spam-lame u.saw] + abet +:: ++ take-mere-sync :: |= {way/wire mes/(each (set path) (pair term tang))} ?> ?=({@ @ @ *} way) @@ -406,9 +420,9 @@ :: ++ work :: state machine |= syd/desk - =+ ^- kiln-desk + =+ ^- per-desk %+ fall (~(get by rem) syd) - =+ *kiln-desk + =+ *per-desk %_(- cas [%da now]) |% ++ abet :: resolve diff --git a/lib/womb.hoon b/lib/hood/womb.hoon similarity index 98% rename from lib/womb.hoon rename to lib/hood/womb.hoon index 345c79183..97905ca23 100644 --- a/lib/womb.hoon +++ b/lib/hood/womb.hoon @@ -1,5 +1,5 @@ :: :: :: -:::: /hoon/womb/lib :: :: +:::: /hoon/womb/hood/lib :: :: :: :: :: /? 310 :: version /+ hall, old-phon @@ -146,7 +146,7 @@ {$recycle who/mail him/knot tik/knot} {$bonus tid/cord pla/@ud sta/@ud} {$invite tid/cord ref/reference inv/invite} - {$reinvite aut/passcode inv/invite} + {$reinvite aut/passcode new/passcode inv/invite} == -- |% @@ -254,7 +254,7 @@ :: :: :: :::: :: :: :: :: :: -=+ cfg=[can-claim=& can-recycle=&] :: temporarily disabled +=+ cfg=[can-claim=| can-recycle=|] :: temporarily disabled =+ [replay=| stat-no-email=|] :: XX globals |= {bowl:gall part} :: main womb work |_ moz/(list move) @@ -654,7 +654,7 @@ :: ++ coup-invite :: invite sent :: ++ poke-reinvite :: split invitation - |= {aut/passcode inv/invite} :: further invite + |= {aut/passcode new/passcode inv/invite} :: further invite =< abet =. log-transaction (log-transaction %reinvite +<) ?> =(src src) :: self-authenticated @@ -662,8 +662,8 @@ =. stars.bal (sub stars.bal sta.inv) =. planets.bal (sub planets.bal pla.inv) =. bureau (~(put by bureau) (shaf %pass aut) bal) - =+ tid=(scot %uv (end 7 1 (shaf %pass eny))) - (invite-from [owner.bal history.bal] tid inv) + =+ tid=(scot %uv new) + (invite-from [owner.bal history.bal] (scot %uv new) inv) :: ++ poke-obey :: set/reset boss |= who/(unit @p) diff --git a/lib/write.hoon b/lib/hood/write.hoon similarity index 99% rename from lib/write.hoon rename to lib/hood/write.hoon index 5184c0df9..2a706bc4a 100644 --- a/lib/write.hoon +++ b/lib/hood/write.hoon @@ -1,6 +1,6 @@ :: File writer module :: -:::: /hoon/write/lib +:::: /hoon/write/hood/lib :: /? 310 /- plan-diff, plan-acct diff --git a/gen/cat/pretty.hoon b/lib/pretty-file.hoon similarity index 80% rename from gen/cat/pretty.hoon rename to lib/pretty-file.hoon index ab2d648ec..e35ff1f7c 100644 --- a/gen/cat/pretty.hoon +++ b/lib/pretty-file.hoon @@ -1,9 +1,10 @@ -:: Pretty-printing util, should be in lib/ +:: Untyped best-guess printer :: -:::: /hoon/pretty/cat/gen +:::: /hoon/pretty-file/lib :: /? 310 :: +=< pretty-file |% ++ pretty-noun |= pri/* ^- tank @@ -21,8 +22,8 @@ :: ++ vale-cord |=(a/cord `?`(levy (trip a) |=(b/@ |((gte b 32) =(10 b))))) :: +++ wain-to-tang |=(a/wain (turn a |=(b/cord leaf+(trip b)))) ++ pretty-file - =+ wain-to-tang=|=(a/wain (turn a |=(b/cord leaf+(trip b)))) |= fyl/* ^- tang =+ `(unit wain)`?@(fyl `(to-wain:format fyl) ((soft wain) fyl)) ?^ - (wain-to-tang u) diff --git a/lib/show-dir.hoon b/lib/show-dir.hoon new file mode 100644 index 000000000..1f32bcce4 --- /dev/null +++ b/lib/show-dir.hoon @@ -0,0 +1,22 @@ +:: Display directory contents +:: +:::: /hoon/show-dir/lib + :: +/? 310 +|= {vane/?($g $c) pax/path des/(map @t $~)} +^- tank +:+ %rose [" " `~] +%+ turn (sort ~(tap by des) aor) +|= {kid/@ta $~} +=+ paf=`path`/[kid] +=- :+ %rose ["/" ~ ?:(dir "/" ~)] + (turn paf |=(a/knot leaf+(trip a))) +|- ^- {dir/? paf/path} +=+ arf=.^(arch (cat 3 vane %y) (weld pax paf)) +?^ fil.arf + [| paf] +?~ dir.arf + [& paf] :: !! +?. ?=({^ $~ $~} dir.arf) + [& paf] +$(paf (welp paf /[p.n.dir.arf])) diff --git a/mar/womb/balance.hoon b/mar/womb/balance.hoon index 767ad7eef..6d1fb72de 100644 --- a/mar/womb/balance.hoon +++ b/mar/womb/balance.hoon @@ -2,16 +2,16 @@ :::: /hoon/stat-all/womb/mar :: /? 310 -/+ womb, old-zuse +/+ hood-womb, old-zuse :: :::: ~fyr :: =, old-zuse -|_ balance:womb +|_ balance:hood-womb :: ++ grab :: convert from |% - ++ noun balance:womb :: clam from %noun + ++ noun balance:hood-womb :: clam from %noun -- ++ grow |% diff --git a/mar/womb/claim.hoon b/mar/womb/claim.hoon index aba2dd4b7..bb7a9a863 100644 --- a/mar/womb/claim.hoon +++ b/mar/womb/claim.hoon @@ -9,6 +9,6 @@ ++ grab :: convert from |% ++ noun {@uvH @p} :: clam from %noun - ++ json (corl need (ot aut+(su ;~(pfix (jest '0v') viz:ag)) her+(su fed:ag) ~):jo) + ++ json (corl need (ot aut+(cu |=(a/@ a) (su ;~(pfix (jest '0v') viz:ag))) her+(su fed:ag) ~):jo) -- -- diff --git a/mar/womb/invite.hoon b/mar/womb/invite.hoon index 0265b81b2..0a33b4161 100644 --- a/mar/womb/invite.hoon +++ b/mar/womb/invite.hoon @@ -2,12 +2,12 @@ :::: /hoon/stat-all/womb/mar :: /? 310 -/+ womb, old-zuse +/+ hood-womb, old-zuse :: :::: ~fyr :: -=* invite invite:womb -=* reference reference:womb +=* invite invite:hood-womb +=* reference reference:hood-womb =, old-zuse |_ {cord reference invite} :: @@ -15,16 +15,18 @@ |% ++ noun {cord reference invite} :: clam from %noun ++ json - %+ corl need + |= jon/^json ^- {cord reference invite} + %- need + %. jon => jo - =+ ^= mail - ;~ simu - ;~(pfix (plus ;~(less pat next)) pat) - (cook crip (star ;~(less ace prn))) - == + =/ mail + ;~ simu + ;~(pfix (plus ;~(less pat next)) pat) + (cook crip (star ;~(less ace prn))) + == %- ot :~ tid+so - ref+(mu (su (pick ;~(pfix (jest '0v') viz:ag) mail))) + ref+(mu (su (pick ;~(pfix sig fed:ag) mail))) inv+(ot who+(su mail) pla+ni sta+ni wel+(ot intro+sa hello+sa ~) ~) == -- diff --git a/mar/womb/part.hoon b/mar/womb/part.hoon index 9168154aa..f5564a8d6 100644 --- a/mar/womb/part.hoon +++ b/mar/womb/part.hoon @@ -2,11 +2,11 @@ :::: /hoon/part/womb/mar :: /? 310 -/+ womb -|_ all/part:womb +/+ hood-womb +|_ all/part:hood-womb ++ grad %jam ++ grow |% ++ jam (^jam all) -- ++ grab |% ++ jam |=(a/@ (noun (cue a))) - ++ noun part:womb + ++ noun part:hood-womb -- -- diff --git a/mar/womb/replay-log.hoon b/mar/womb/replay-log.hoon index d87fccf04..577f725e0 100644 --- a/mar/womb/replay-log.hoon +++ b/mar/womb/replay-log.hoon @@ -2,9 +2,9 @@ :::: /hoon/replay-log/womb/mar :: /? 310 -/+ womb -|_ log/(list {@uvJ transaction:womb}) +/+ hood-womb +|_ log/(list {@uvJ transaction:hood-womb}) ++ grab |% - ++ noun (list {@uvJ transaction:womb}) + ++ noun (list {@uvJ transaction:hood-womb}) -- -- diff --git a/mar/womb/stat-all.hoon b/mar/womb/stat-all.hoon index caaccbd7d..f57c78f64 100644 --- a/mar/womb/stat-all.hoon +++ b/mar/womb/stat-all.hoon @@ -2,28 +2,28 @@ :::: /hoon/stat-all/womb/mar :: /? 310 -/+ womb, old-zuse +/+ hood-womb, old-zuse :: :::: ~fyr :: =, old-zuse -|_ all/(map ship stat:womb) +|_ all/(map ship stat:hood-womb) :: ++ grab :: convert from |% - ++ noun (map ship stat:womb) :: clam from %noun + ++ noun (map ship stat:hood-womb) :: clam from %noun -- ++ grow |% ++ json %- jobe %+ turn ~(tap by all) - |= {a/ship b/stat:womb} ^- {cord ^json} + |= {a/ship b/stat:hood-womb} ^- {cord ^json} :- (crip +:) (jobe live+[%s p.b] dist+(json-dist q.b) ~) :: ++ json-dist - |= a/dist:womb + |= a/dist:hood-womb %+ joba -.a ?- -.a $free b+& diff --git a/neo/arvo.hoon b/neo/arvo.hoon index 7a50ec129..84c55600a 100644 --- a/neo/arvo.hoon +++ b/neo/arvo.hoon @@ -1,3 +1,4 @@ +::BROKEN needs span/twig renaming at least !: :: /sys/arvo :: :: %reference/2 :: %arvo: arvo microkernel. diff --git a/ren/run.hoon b/ren/run.hoon index 37a4c4a33..803c05122 100644 --- a/ren/run.hoon +++ b/ren/run.hoon @@ -4,5 +4,5 @@ :: /? 310 /% /!noun/ -~& run/-.- +~& run+-.- ~ diff --git a/ren/tree/head.hoon b/ren/tree/head.hoon index cf00aede8..a0a96b857 100644 --- a/ren/tree/head.hoon +++ b/ren/tree/head.hoon @@ -41,7 +41,6 @@ ;link(type "text/css", rel "stylesheet", href "/===/web/lib/css/codemirror.css"); ;link(type "text/css", rel "stylesheet", href "/===/web/tree/main.css"); == - ::;link(type "text/css", rel "stylesheet", href "http://localhost:8000/docs/pub/tree/main.css"); ;script(type "text/javascript", src "{(cdnjs "jquery/2.1.3/jquery")}"); ;script(type "text/javascript", src "{(maxcdn "bootstrap/3.3.6/js/bootstrap")}"); ;script(type "text/javascript", src "{(cdnjs "lodash.js/2.4.1/lodash")}"); diff --git a/sys/arvo.hoon b/sys/arvo.hoon index c58ea746b..a671f671a 100644 --- a/sys/arvo.hoon +++ b/sys/arvo.hoon @@ -1,3 +1,4 @@ +::BROKEN needs span/twig renaming at least :: :: :::: 6: layer six :: diff --git a/sys/hoon.hoon b/sys/hoon.hoon index 927fa7148..2e7762b86 100644 --- a/sys/hoon.hoon +++ b/sys/hoon.hoon @@ -12325,7 +12325,7 @@ =+ lam=(~(get by hit.day) nam) day(hit (~(put by hit.day) nam ?~(lam 1 +(u.lam)))) :: -++ pi-noon !. :: sample trace +++ pi-noon :: sample trace |= {mot/term paz/(list path) day/doss} =| lax/(unit path) |- ^- doss diff --git a/sys/vane/eyre.hoon b/sys/vane/eyre.hoon index 40f2fbc79..2b21228bb 100644 --- a/sys/vane/eyre.hoon +++ b/sys/vane/eyre.hoon @@ -457,9 +457,18 @@ document.location = url } urb.redir = function(ship){ - var location = new URL(document.location) - location.pathname = location.pathname.replace(/^\/~~|\/~\/as\/any/,'/~/as/~'+ship) - urb.redirTo(location) + if(ship){ + var location = new URL(document.location) + location.pathname = location.pathname.replace(/^\/~~|\/~\/as\/any/,'/~/as/~'+ship) + urb.redirTo(location) + } + else urb.redirTo( + document.location.hash.match(/#[^?]+/)[0].slice(1) + + document.location.pathname.replace( + /^\/~\/am\/[^/]+/, + '/~/as/~' + urb.ship) + + document.location.search + ) } if(urb.foreign && urb.auth.indexOf(urb.ship) !== -1){ req("/~/auth.json?PUT", @@ -934,8 +943,11 @@ (~(has in aut.u.cyz) our) :: ++ ses-ya |=(ses/hole ~(. ya ses (~(got by wup) ses))) - ++ our-host `hart`[& ~ %& /org/urbit/(rsh 3 1 (scot %p our))] - :: [| [~ 8.443] `/localhost] :: XX testing + ++ our-host + ^- hart + :: XX get actual -F flag value + ?: [fake=|] [| [~ 8.443] &+/localhost] + `hart`[& ~ %& /org/urbit/(rsh 3 1 (scot %p our))] :: ++ eyre-them |= {tea/whir vax/vase} diff --git a/sys/zuse.hoon b/sys/zuse.hoon index 432561b21..b8b99c168 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -664,7 +664,6 @@ $: qix/(map @t @t) :: query ced/cred :: client credentials bem/beam :: original path - but/path :: ending == :: += gram :: inter-ship message $? [[%lon ~] p=hole] :: login request @@ -4176,7 +4175,7 @@ |= {bem/beam ced/noun:cred quy/quer} ^- epic =+ qix=|-(`quay`?~(quy quy [[p q]:quy $(quy t.quy)])) - [(malt qix) ((hard cred) ced) bem /] + [(malt qix) ((hard cred) ced) bem] -- ::eyre :: :: :::: ++wired :: wire formatting diff --git a/web/unmark/all.hoon b/web/unmark/all.hoon index 109a31f84..34dc8b66f 100644 --- a/web/unmark/all.hoon +++ b/web/unmark/all.hoon @@ -4,8 +4,16 @@ :: /+ cram :: -/= cor /^ (list {@ud wain}) - /: /%%/ /_ @ud /txt/ +/= cor + /^ (list {@ud wain}) + /: /%%/ + /; |= a/(map knot wain) + =; kid/(list {@ud wain}) (sort kid dor) + %+ murn ~(tap by a) + |= {b/knot c/wain} + %+ bind (slaw %ud b) + |=(d/@ud [d c]) + /_ /txt/ :: |% ++ rolt |=(a/wall `tape`?~(a ~ ?~(t.a i.a :(weld i.a "\0a" $(a t.a))))) diff --git a/web/unmark/test.hoon b/web/unmark/test.hoon index 43e3ecc81..c159858b9 100644 --- a/web/unmark/test.hoon +++ b/web/unmark/test.hoon @@ -1,8 +1,9 @@ +=- ;pre:"{<[-]>}" :- ;> indented indented -:- ;= ;> +:- ;= *{~} == -;= ;> some *markdown* +;= some *markdown* == diff --git a/web/womb/main.css b/web/womb/main.css index 9609abfc2..dd6a7981b 100644 --- a/web/womb/main.css +++ b/web/womb/main.css @@ -26,3 +26,34 @@ .recycling input { width: 60%; } + +.recycleTicket { + margin-top: 1rem; +} + +button { + font-weight: 500; + background-color: transparent; + border: 2px solid #000; + padding: 9px 9px 5px 9px; +} + +button.reroll { + background-color: #555; + border-color: #555; + color: #fff; +} + +input.pick { margin-right: 1rem; } + +.split .label { margin-left: 1rem; } + +button.invalid { opacity: .5; } + +ul.network li { + margin-top: .3rem; +} + +ul.shop li { + margin-top: 1rem; +} diff --git a/web/womb/main.js b/web/womb/main.js index e28f32c78..467767118 100644 --- a/web/womb/main.js +++ b/web/womb/main.js @@ -7,12 +7,9 @@ Persistence = require('./Persistence.coffee'); module.exports = { setPasscode: function(pass) { - Dispatcher.dispatch({ + return Dispatcher.dispatch({ setPasscode: pass }); - return $('.womb-pass-input').each(function() { - return this.value || (this.value = pass); - }); }, recycleTicket: function(arg, pass) { var mail, ship, tick; @@ -33,6 +30,14 @@ module.exports = { }; })(this)); }, + confirmShip: function(pass, ship) { + return Dispatcher.dispatch({ + confirmClaim: { + pass: pass, + ship: ship + } + }); + }, claimShip: function(pass, ship) { Dispatcher.dispatch({ putClaim: { @@ -168,6 +173,17 @@ WombStore = _.extend((new EventEmitter).setMaxListeners(50), { path = arg1.path, data = arg1.data; return _data[path] = data; }, + confirmClaim: function(arg1) { + var k, ship, v; + ship = arg1.ship; + for (k in _data) { + v = _data[k]; + if (k.indexOf('claim/') !== -1 && v === "confirm") { + _data[k] = "none"; + } + } + return _data["claim/" + ship] = "confirm"; + }, putClaim: function(arg1) { var ship; ship = arg1.ship; @@ -278,22 +294,21 @@ Balance = Scry("/balance/:pass", function(arg) { }, Label("Invalid passcode", "warning")); } planets = balance.planets, stars = balance.stars, owner = balance.owner, history = balance.history; - return div({}, h3({}, "Balance"), p({}, "Hello ", Mail(owner), ", "), p({}, "This balance was ", History(history)), p({}, "You currently hold ", b({}, planets || "no"), " Planets ", "and ", b({}, stars || "no"), " Stars."), stars ? rele(Stars) : void 0, planets ? rele(Planets) : void 0); + return div({}, h3({}, "Balance"), p({}, "Hello ", Mail(owner), ", "), p({}, "This balance was ", History(history)), p({}, "You currently hold ", b({}, planets || "no"), " Planets ", "and ", b({}, stars || "no"), " Stars."), p({ + className: 'red' + }, b({}, "Warning: "), "When you click 'Claim' we will send the ticket to the email address above. This can only be done once!"), stars ? rele(Stars) : void 0, planets ? rele(Planets) : void 0); }); module.exports = name("Claim", FromStore("pass", function(arg) { var pass; pass = arg.pass; return div({}, p({}, "To view your ships, input your passcode."), PassInput({ - minLength: 32, + minLength: 28, defaultValue: pass, onInputPass: Actions.setPasscode }), pass ? rele(Balance, { - key: "balance", pass: pass - }) : div({ - key: "recycle" - }, h3({}, "Convert an old ticket"), rele(Recycling, {}))); + }) : div({}, h3({}, "Convert an old ticket"), rele(Recycling, {}))); })); @@ -325,31 +340,38 @@ ClaimButton = FromStore("pass", function(arg) { pass = arg.pass, ship = arg.ship; if (!ship) { return button({ - disabled: true - }, "Claim (invalid)"); + disabled: true, + className: 'claim invalid' + }, "Invalid"); } return rele(_ClaimButton, { - ship: ship, - onClick: function() { - return Actions.claimShip(pass, ship); - } + pass: pass, + ship: ship }); }); _ClaimButton = FromStore("claim/:ship", function(arg) { - var claim, onClick; - claim = arg.claim, onClick = arg.onClick; + var claim, pass, ship; + claim = arg.claim, pass = arg.pass, ship = arg.ship; switch (claim) { case "own": return Label("Claimed!", "success"); case "wait": return Label("Claiming..."); case "xeno": - return Label("Taken", "warning"); + return Label("Not available", "warning"); case "none": return button({ - onClick: onClick + onClick: function() { + return Actions.confirmShip(pass, ship); + } }, "Claim"); + case "confirm": + return button({ + onClick: function() { + return Actions.claimShip(pass, ship); + } + }, "Click again to confirm."); default: throw new Error("Bad claim type: " + claim); } @@ -439,26 +461,32 @@ module.exports = name("MailInput", function(arg) { },{"../util.coffee":18}],10:[function(require,module,exports){ -var Claim, NET, Ships, div, h3, h4, ref, rele; +var Claim, NET, Recycling, Ships, a, div, h3, h4, ref, rele; Claim = require('./Claim.coffee'); Ships = require('./Ships.coffee'); +Recycling = require('./Recycling.coffee'); + rele = React.createElement; -NET = false; +NET = true; -ref = React.DOM, div = ref.div, h3 = ref.h3, h4 = ref.h4; +ref = React.DOM, div = ref.div, h3 = ref.h3, h4 = ref.h4, a = ref.a; module.exports = function() { return div({}, h3({ className: 'first-a' - }, "Claim an invite"), rele(Claim, {}), NET ? div({}, h4({}, "Network"), rele(Ships, {})) : void 0); + }, "Claim an invite"), rele(Claim, {}), NET ? div({}, h3({}, "Network"), rele(Ships, {})) : void 0, div({ + className: 'footer' + }, "Questions? Email us:", a({ + href: "mailto:urbit@urbit.org" + }, "urbit@urbit.org"), ".")); }; -},{"./Claim.coffee":5,"./Ships.coffee":15}],11:[function(require,module,exports){ +},{"./Claim.coffee":5,"./Recycling.coffee":12,"./Ships.coffee":15}],11:[function(require,module,exports){ var input, name, recl, uvShape; uvShape = require('../util.coffee').uvShape; @@ -478,7 +506,7 @@ module.exports = name("PassInput", function(arg) { onInputPass = arg.onInputPass, minLength = arg.minLength, defaultValue = arg.defaultValue; return input({ defaultValue: defaultValue, - className: 'mono womb-pass-input', + className: 'mono', style: { width: '100%' }, @@ -542,23 +570,27 @@ RecycleTicket = name("RecycleTicket", Scry("/ticket/~:ship/~:tick", function(arg mail: mail }, passcode); }; - switch (status != null ? status : "fail") { - case "fail": - return Label("Bad ticket", "warning"); - case "good": - return rele(RecycleButton, { - disabled: !mail, - onClick: doRecycle - }); - case "used": - return span({}, a({ - onClick: function() { - return Actions.setPasscode(passcode); - } - }, passcode), Label("Ticket exchanged", "info")); - default: - throw new Error("Bad ticket status: " + status); - } + return div({ + className: 'recycleTicket' + }, (function() { + switch (status != null ? status : "fail") { + case "fail": + return Label("Bad ticket", "warning"); + case "good": + return rele(RecycleButton, { + disabled: !mail, + onClick: doRecycle + }); + case "used": + return span({}, a({ + onClick: function() { + return Actions.setPasscode(passcode); + } + }, passcode), Label("Ticket exchanged", "info")); + default: + throw new Error("Bad ticket status: " + status); + } + })()); })); Recycling = recl({ @@ -746,7 +778,7 @@ module.exports = name("ShipInput", function(arg) { return input({ defaultValue: defaultValue, placeholder: placeholder, - className: 'mono', + className: 'mono pick', onChange: function(arg1) { var ship, target; target = arg1.target; @@ -790,7 +822,9 @@ labels = { Stat = name("Stat", function(arg) { var className, dist, free, live, owned, ship, split, stats; stats = arg.stats; - return ul({}, (function() { + return ul({ + className: 'network' + }, (function() { var ref1, results; results = []; for (ship in stats) { @@ -802,7 +836,7 @@ Stat = name("Stat", function(arg) { key: ship }, span({ className: "mono" - }, "~" + ship), " (", live, "): ", (function() { + }, "~" + ship), (function() { switch (false) { case free == null: return Label(labels.free); @@ -830,7 +864,7 @@ module.exports = Scry("/stats", Stat); },{"./Label.coffee":8,"./Scry.coffee":13,"classnames":19}],16:[function(require,module,exports){ -var ClaimButton, Scry, ShipInput, Shop, ShopShips, button, div, h6, li, recl, ref, rele, span, ul; +var ClaimButton, Scry, ShipInput, Shop, ShopShips, button, code, div, h6, li, recl, ref, rele, span, ul; Scry = require('./Scry.coffee'); @@ -838,7 +872,7 @@ ShipInput = require('./ShipInput.coffee'); ClaimButton = require('./ClaimButton.coffee'); -ref = React.DOM, ul = ref.ul, li = ref.li, div = ref.div, h6 = ref.h6, button = ref.button, span = ref.span; +ref = React.DOM, ul = ref.ul, li = ref.li, div = ref.div, h6 = ref.h6, button = ref.button, span = ref.span, code = ref.code; recl = React.createClass; @@ -888,17 +922,26 @@ Shop = function(type, length) { }, render: function() { var ref1; - return div({}, h6({}, "Avaliable " + type + " (random). ", button({ - onClick: this.reroll - }, "Reroll")), rele(ShopShips, _.extend({}, this.props, { + return div({}, h6({}, "Avaliable " + type + " — "), rele(ShopShips, _.extend({}, this.props, { type: type, nth: this.state.shipSelector - })), h6({}, "Custom"), div({}, "Specific " + type + ": ", rele(ShipInput, { + })), button({ + onClick: this.reroll, + className: 'reroll' + }, "Get a new set"), h6({}, "Custom " + type + " — "), div({}, div({ + style: { + marginBottom: ".3rem" + } + }, "If you understand how to pick a ", code({}, "@p"), " for " + type + ", feel free:"), div({ + style: { + marginBottom: "1rem" + } + }, rele(ShipInput, { length: length, onInputShip: this.onInputShip }), rele(ClaimButton, { ship: (ref1 = this.state.customShip) != null ? ref1 : "" - }))); + })))); } }); }; @@ -922,9 +965,9 @@ var PO, PO_old, SHIPSHAPE, SHIPSHAPE = /^~?([a-z]{3}|[a-z]{6}(-[a-z]{6}){0,3}|[a-z]{6}(-[a-z]{6}){3}(--[a-z]{6}(-[a-z]{6}){3})+)$/; -PO_old = 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\nrigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\nholpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\nlosdilforpilramtirwintadbicdifrocwidbisdasmidlop\nrilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\nritpodmottamtolsavposnapnopsomfinfonbanporworsip\nronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\nsivtagpadsaldivdactansidfabtarmonranniswolmispal\nlasdismaprabtobrollatlonnodnavfignomnibpagsopral\nbilhaddocridmocpacravripfaltodtiltinhapmicfanpat\ntaclabmogsimsonpinlomrictapfirhasbosbatpochactid\nhavsaplindibhosdabbitbarracparloddosbortochilmac\ntomdigfilfasmithobharmighinradmashalraglagfadtop\nmophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\nnimlarfitwalrapsarnalmoslandondanladdovrivbacpol\nlaptalpitnambonrostonfodponsovnocsorlavmatmipfap\n\nzodnecbudwessevpersutletfulpensytdurwepserwylsun\nrypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\nlunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\npyldulhetmevruttylwydtepbesdexsefwycburderneppur\nrysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\nsecmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\nselrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\nsyptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\nlytdusnebrumtynseglyxpunresredfunrevrefmectedrus\nbexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\ntenlusnussyltecmexpubrymtucfyllepdebbermughuttun\nbylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\nwedducfurfexnulluclennerlexrupnedlecrydlydfenwel\nnydhusrelrudneshesfetdesretdunlernyrsebhulryllud\nremlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\nlyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'; +PO_old = 'doz mar bin wan sam lit sig hid fid lis sog dir wac sab wis sib\nrig sol dop mod fog lid hop dar dor lor hod fol rin tog sil mir\nhol pas lac rov liv dal sat lib tab han tic pid tor bol fos dot\nlos dil for pil ram tir win tad bic dif roc wid bis das mid lop\nril nar dap mol san loc nov sit nid tip sic rop wit nat pan min\nrit pod mot tam tol sav pos nap nop som fin fon ban por wor sip\nron nor bot wic soc wat dol mag pic dav bid bal tim tas mal lig\nsiv tag pad sal div dac tan sid fab tar mon ran nis wol mis pal\nlas dis map rab tob rol lat lon nod nav fig nom nib pag sop ral\nbil had doc rid moc pac rav rip fal tod til tin hap mic fan pat\ntac lab mog sim son pin lom ric tap fir has bos bat poc hac tid\nhav sap lin dib hos dab bit bar rac par lod dos bor toc hil mac\ntom dig fil fas mit hob har mig hin rad mas hal rag lag fad top\nmop hab nil nos mil fop fam dat nol din hat nac ris fot rib hoc\nnim lar fit wal rap sar nal mos lan don dan lad dov riv bac pol\nlap tal pit nam bon ros ton fod pon sov noc sor lav mat mip fap\n\n/ / / / / / / / / / / / / / /\nzod nec bud wes sev per sut let ful pen syt dur wep ser wyl sun\nryp syx dyr nup heb peg lup dep dys put lug hec ryt tyv syd nex\nlun mep lut sep pes del sul ped tem led tul met wen byn hex feb\npyl dul het mev rut tyl wyd tep bes dex sef wyc bur der nep pur\nrys reb den nut sub pet rul syn reg tyd sup sem wyn rec meg net\nsec mul nym tev web sum mut nyx rex teb fus hep ben mus wyx sym\nsel ruc dec wex syr wet dyl myn mes det bet bel tux tug myr pel\nsyp ter meb set dut deg tex sur fel tud nux rux ren wyt nub med\nlyt dus neb rum tyn seg lyx pun res red fun rev ref mec ted rus\nbex leb dux ryn num pyx ryg ryx fep tyr tus tyc leg nem fer mer\nten lus nus syl tec mex pub rym tuc fyl lep deb ber mug hut tun\nbyl sud pem dev lur def bus bep run mel pex dyt byt typ lev myl\nwed duc fur fex nul luc len ner lex rup ned lec ryd lyd fen wel\nnyd hus rel rud nes hes fet des ret dun ler nyr seb hul ryl lud\nrem lys fyn wer ryc sug nys nyl lyn dyn dem lux fed sed bec mun\nlyr tes mud nyt byr sen weg fyr mur tel rep teg pec nel nev fes'; -PO = 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\nrigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\nholpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\nlosdilforpilramtirwintadbicdifrocwidbisdasmidlop\nrilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\nritpodmottamtolsavposnapnopsomfinfonbandorworsip\nronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\nsivtagpadsaldivdactansidfabtarmonranniswolmispal\nlasdismaprabtobrollatlonnodnavfignomnibpagsopral\nbilhaddocridmocpacravripfaltodtiltinhapmicfanpat\ntaclabmogsimsonpinlomrictapfirhasbosbatpochactid\nhavsaplindibhosdabbitbarracparloddosbortochilmac\ntomdigfilfasmithobharmighinradmashalraglagfadtop\nmophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\nnimlarfitwalrapsarnalmoslandondanladdovrivbacpol\nlaptalpitnambonrostonfodponsovnocsorlavmatmipfip\n\nzodnecbudwessevpersutletfulpensytdurwepserwylsun\nrypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\nlunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\npyldulhetmevruttylwydtepbesdexsefwycburderneppur\nrysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\nsecmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\nselrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\nsyptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\nlytdusnebrumtynseglyxpunresredfunrevrefmectedrus\nbexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\ntenlusnussyltecmexpubrymtucfyllepdebbermughuttun\nbylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\nwedducfurfexnulluclennerlexrupnedlecrydlydfenwel\nnydhusrelrudneshesfetdesretdunlernyrsebhulryllud\nremlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\nlyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'; +PO = 'doz mar bin wan sam lit sig hid fid lis sog dir wac sab wis sib\nrig sol dop mod fog lid hop dar dor lor hod fol rin tog sil mir\nhol pas lac rov liv dal sat lib tab han tic pid tor bol fos dot\nlos dil for pil ram tir win tad bic dif roc wid bis das mid lop\nril nar dap mol san loc nov sit nid tip sic rop wit nat pan min\nrit pod mot tam tol sav pos nap nop som fin fon ban dor wor sip\nron nor bot wic soc wat dol mag pic dav bid bal tim tas mal lig\nsiv tag pad sal div dac tan sid fab tar mon ran nis wol mis pal\nlas dis map rab tob rol lat lon nod nav fig nom nib pag sop ral\nbil had doc rid moc pac rav rip fal tod til tin hap mic fan pat\ntac lab mog sim son pin lom ric tap fir has bos bat poc hac tid\nhav sap lin dib hos dab bit bar rac par lod dos bor toc hil mac\ntom dig fil fas mit hob har mig hin rad mas hal rag lag fad top\nmop hab nil nos mil fop fam dat nol din hat nac ris fot rib hoc\nnim lar fit wal rap sar nal mos lan don dan lad dov riv bac pol\nlap tal pit nam bon ros ton fod pon sov noc sor lav mat mip fip\n\nzod nec bud wes sev per sut let ful pen syt dur wep ser wyl sun\nryp syx dyr nup heb peg lup dep dys put lug hec ryt tyv syd nex\nlun mep lut sep pes del sul ped tem led tul met wen byn hex feb\npyl dul het mev rut tyl wyd tep bes dex sef wyc bur der nep pur\nrys reb den nut sub pet rul syn reg tyd sup sem wyn rec meg net\nsec mul nym tev web sum mut nyx rex teb fus hep ben mus wyx sym\nsel ruc dec wex syr wet dyl myn mes det bet bel tux tug myr pel\nsyp ter meb set dut deg tex sur fel tud nux rux ren wyt nub med\nlyt dus neb rum tyn seg lyx pun res red fun rev ref mec ted rus\nbex leb dux ryn num pyx ryg ryx fep tyr tus tyc leg nem fer mer\nten lus nus syl tec mex pub rym tuc fyl lep deb ber mug hut tun\nbyl sud pem dev lur def bus bep run mel pex dyt byt typ lev myl\nwed duc fur fex nul luc len ner lex rup ned lec ryd lyd fen wel\nnyd hus rel rud nes hes fet des ret dun ler nyr seb hul ryl lud\nrem lys fyn wer ryc sug nys nyl lyn dyn dem lux fed sed bec mun\nlyr tes mud nyt byr sen weg fyr mur tel rep teg pec nel nev fes'; module.exports = { unpackFrond: function(a) { @@ -948,7 +991,7 @@ module.exports = { }, mailShape: function(a) { var valid; - return valid = a.indexOf('@') !== -1 && a.indexOf('.') !== -1 && a.length > 7 && a.split(".")[1].length > 1 && a.split("@")[0].length > 0 && a.split("@")[1].length > 4; + return valid = a.indexOf('@') !== -1 && a.indexOf('.') !== -1 && a.length > 7 && a.split(".").slice(-1)[0].length > 1 && a.split("@")[0].length > 0 && a.split("@")[1].length > 4; } }; @@ -1063,8 +1106,12 @@ EventEmitter.prototype.emit = function(type) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; } - throw TypeError('Uncaught, unspecified "error" event.'); } }