Merge branch 'test' into goodtest

Conflicts:
	urb/urbit.pill
	urb/zod/base/ape/dojo/core.hook
	urb/zod/base/ape/hood/core.hook
	urb/zod/base/ape/octo/core.hook
	urb/zod/base/arvo/hoon.hoon
This commit is contained in:
C. Guy Yarvin 2015-05-28 12:16:10 -07:00
commit 16004b615e
36 changed files with 1293 additions and 1261 deletions

450
base/ape/cloud/core.hook Normal file
View File

@ -0,0 +1,450 @@
:: digital ocean fleet management
::
::::
::
/? 314
/- *talk
/+ talk, sole, http
::
::
:::: sivtyv-barnel
::
!:
|%
++ instance
$: name=@t id=@ud status=@t created=@t region=@t snapshot=json disk=@u ip=(list ,@if)
==
++ create-req-do
$:
name=@t region=@t size=@t image=@t ssh=(list cord)
backups=(unit ,?) ipv6=(unit ,?)
private-networking=(unit ,?) user-data=(unit ,@t)
==
++ create-req-gce ,[project=@t zone=@t name=@t machine-type=@t]
++ axle
$: auth=[do=keys gce=keys] toke=[do=tokens gce=tokens]
insts=(list instance)
==
++ keys ,[authc=(unit ,@t) client-secret=(unit ,@t)]
++ tokens ,[access=@t refresh=@t]
++ move ,[bone card]
++ card
$% [%diff %json json]
[%wait wire @da]
[%send wire [ship term] %poke %talk-command command]
[%them wire (unit hiss)]
==
--
!:
|% :::
++ parse-img
=> jo
%- ot
:~ id/ni name/so distribution/so slug/(mu so) public/bo
regions/(ar so) 'created_at'^so type/so 'min_disk_size'^ni
==
++ parse-ip
=> jo
%- ot
:- v4/(ar (ot 'ip_address'^(su lip:ag) ~))
~
++ parse-region
=> jo
(ot name/so ~)
++ create-do-body
|= $: name=@t region=@t size=@t image=@t ssh-keys=(list cord)
backups=(unit ,?) ipv6=(unit ,?) private-networking=(unit ,?) user-data=(unit ,@t)
==
%- jobe
:~ name/s/name region/s/region size/s/size image/s/image ::(jone image)
backups/?~(backups ~ b/u.backups) ipv6/?~(ipv6 ~ b/u.ipv6)
'user_data'^?~(user-data ~ s/u.user-data) 'private_networking'^?~(private-networking ~ b/u.private-networking)
==
++ state-to-json
|= a=(list instance)
:- %a
%+ turn a
|= instance
^- json
%- jobe
:~ name/`json`s/name
id/`json`(jone id)
status/s/status
created/s/created
region/s/region
snapshot/s/'xx replace'
disk/`json`(jone disk)
ip/a/(turn ip |=(a=@if s/(rsh 3 1 (scot %if a))))
==
--
!:
|_ [hid=hide vat=axle]
::
++ prep ,_`.
:::
++ spam
|= jon=json
%+ turn (~(tap by sup.hid))
|= [sub=bone @ pax=path]
^- move
[sub %diff %json jon]
++ auth-queries
|= code=cord
:~ 'grant_type'^'authorization_code'
'code'^code
:- 'client_id'
'd8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f'
'redirect_uri'^'http://localhost:8443/home/pub/cloud/fab'
==
++ httpreq
|= $: ost=bone pour-path=wire
domain=(list cord) end-point=path
req-type=$?(%get [%post json]) headers=math
queries=quay
==
^- move
=+ ^- parsed-url=purl
:+ ^= host-port :: ++hart
:+ security=%.y
port=~
host=[%.y [path=[%com domain]]]
endpoint=[extensions=~ point=end-point] :: ++pork,
q-strings=queries :: ++quay
=+ ^- request=hiss :: cast to hiss
:- parsed-url
?@ req-type
[%get headers ~]
[%post headers ~ (tact (pojo +.req-type))]
:^ ost %them pour-path
`(unit hiss)`[~ request]
::
++ peer
|= [[ost=bone you=ship] pax=path]
^- [(list move) _+>.$]
:_ +>.$
[ost %diff %json (state-to-json insts.vat)]~
::
++ poke-cloud-auth
|= [[ost=bone you=ship] [cde=cord typ=cord]]
^- [(list move) _+>.$]
~& [cde typ]
?: =(%do typ)
=. authc.do.auth.vat
[~ cde]
:_ +>.$
~
=. access.gce.toke.vat
cde
:_ +>.$
:- (list-instances-gce ost)
~
::
++ poke-cloud-secret
|= [[ost=bone you=ship] secret=cord typ=cord]
^- [(list move) _+>.$]
~& [secret typ]
::=+ [newvat code path]=[vat(auth auth.vat) ...]
::=. vat newvat
?+ typ ~|(missing-platform=typ !!)
%do
=. client-secret.do.auth.vat
[~ secret]
:_ +>.$
:_ ~
%^ httpreq ost /auth-do
:^ ~[%digitalocean %cloud] `path`/v1/oauth/token
[%post ~]
:- ~ `quay`['client_secret'^secret (auth-queries (need authc.do.auth.vat))]
%gce
=. client-secret.gce.auth.vat
[~ secret]
:_ +>.$
:_ ~
%^ httpreq ost /auth-gce
:^ ~[%google %cloud] `path`/v1/oauth/token
[%post ~]
:- (mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~] ~)
`quay`['client_secret'^secret %'access_token'^(need authc.gce.auth.vat) ~] ::(auth-queries (need authc.gcp.auth.vat))]
==
::
++ receive-auth
|= [ost=bone pour-path=cord resp=httr]
^- [(list move) _+>.$]
~| resp
=+ body=(rash q:(need r.resp) apex:poja)
~| recieve-auth/resp(r body)
?+ pour-path !!
%auth-do
=+ [ac re]=(need ((ot 'access_token'^so 'refresh_token'^so ~):jo body))
=: access.do.toke.vat ac
refresh.do.toke.vat re
==
:_ +>.$
:~ (list-instances-do ost)
(publish ost our.hid [%lin & 'successfully authenticated']~)
==
%auth-gce
::=+ ac=(need ((ot ~):jo
~& [body resp]
:_ +>.$
~
==
::
++ poke-json
|= [[ost=bone you=ship] act=json]
^- [(list move) _+>.$]
=+ do=(need ((ot action/so ~):jo act))
:_ +>.$
:_ ~
?+ do !!
%list
^- move (list-instances-do ost)
::
%create-do
^- move (create-do ost act)
::
%create-gce-disk
^- move (create-gce-disk ost act)
::
%create-gce
^- move (create-gce ost act)
::
?(%start %stop %reboot %delete) ::%'power_on' %'power_off' %reboot %'power_cycle'
^- move
=+ id=(need ((ot id/no ~):jo act))
(instance-action ost id do)
==
::
++ instance-action
|= $: os=bone id=@t
$= action $?
%start %stop %reboot %delete
== ==
:: restore, resize, rebuild, change_kernelm, retrieve droplet action
^- move
=+ ^= req
%- httpreq :*
os /reboot
~[%digitalocean %api] /v2/droplets/[id]/actions
[%post `json`(jobe type/s/action ~)]
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~] ~)
*quay
==
req
++ list-instances-gce
|= os=bone
=+ ^= lis
:* os /list-gce
~[%googleapis %www] /compute/v1/projects/urbcloud/zones/['us-central1-a']/'instances'
%get ~
^- quay
[%'access_token' access.gce.toke.vat]~
==
(httpreq lis)
++ list-instances-do
|= os=bone
=+ ^= lis
:~ os /list-do
~[%digitalocean %api] /v2/droplets
%get
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~] ~)
==
(httpreq lis)
::
++ receive-list-do
|= [ost=bone resp=httr]
^- [(list move) _+>.$]
=+ parsed=(rash q:(need r.resp) apex:poja) :: parse httr to json
~| recieve-list/parsed
=+ dar=(need ((ot droplets/(ar some) ~):jo parsed)) :: reparse ar of insts
=+ ^- dropz=(list instance)
~| bad-json/-.dar
%+ turn dar
|= drp=json
%- need
%. drp =+ jo
%- ot
:~ name/so id/ni status/so 'created_at'^so region/parse-region
image/some disk/ni networks/parse-ip
==
=. insts.vat
dropz
=+ buf=`@da`(add ~s10 lat.hid)
:_ +>.$
:_ (spam (state-to-json insts.vat))
[ost %wait /refresh-do buf]
++ create-do
|= [os=bone act=json]
=+ ^- deets=create-req-do
%- need
%. act
=> jo
%- ot
:~ name/so region/so size/so image/so :: id key:img object
ssh/(ar so) backups/(mu bo)
'ipv6'^(mu bo) 'priv_networking'^(mu bo) 'user_data'^(mu so)
==
=+ ^- body=json
%- create-do-body :*
name.deets region.deets size.deets image.deets ssh.deets backups.deets
ipv6.deets private-networking.deets user-data.deets
==
%- httpreq :*
os /create-do
~[%digitalocean %api] /v2/droplets
[%post body]
%^ mo ['Content-Type' 'application/json; charset=utf-8' ~]
['Authorization' (cat 3 'Bearer ' access.do.toke.vat) ~]
~
~
==
::++ batch-request
::|= [os=bone name=@t number=@ud snap=@t]
::(list httr) ^- httr
++ create-gce-disk
|= [os=bone act=json] :: num=(unit ,@u)
:: =. name ?~(num name ...
=+ :- name=(need ((ot name/so ~):jo act))
snap=(need ((ot snap/so ~):jo act))
=+ ^- body=json
(jobe name/s/name %'sourceSnapshot'^s/'compute/v1/projects/urbcloud/global/snapshots/snapshot-1' ~) ::^so/snap ~)
%- httpreq
:* os /create-gce-disk
~['googleapis' 'www'] /compute/v1/projects/urbcloud/zones/us-central1-b/disks
[%post body]
%^ mo ['Content-Type' 'application/json' ~]
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~]
~
~
==
++ ask-disk-status
|= [os=bone pax=path] ^- move
=+ safe=(slav %uv ?~(pax !! -.pax))
=+ link=(need (epur ?~(pax !! safe)))
=. r.link ['access_token'^access.gce.toke.vat r.link]
:^ os %them `wire`/disk-status
`(unit hiss)`[~ [link [%get ~ ~]]]
++ disk-status ::receive
|= [ost=bone resp=httr]
^- [(list move) _+>.$]
=+ hcode=p.resp
?: =('200' hcode)
~| 'did not receive 200' !!
=+ :-(parsed=(rash q:(need r.resp) apex:poja) jo)
=+ :- status=(need ((ot status/so ~) parsed))
lin=(need ((ot 'selfLink'^so ~) parsed))
=+ link=(scot %uv lin)
~& lin
?: =('DONE' status)
~& resp
~& 'boot disk now running, now starting instance'
=+ target=(need ((ot 'targetLink'^so ~):jo parsed))
=+ nam=-:(flop q.q:(need (epur target)))
~& nam
::(create-gce-disk ost nam 'tbd')
:- ~ +>.$
:_ +>.$
[ost %wait `path`[%check-status link ~] `@da`(add ~s3 lat.hid)]~ :: refesh every 10 sec
++ create-gce
|= [os=bone act=json]
=+ ^- deets=create-req-gce
%- need
%. act
=> jo
%- ot
:~ project/so zone/so name/so %'machine_type'^so
==
=+ src=(cat 3 'compute/v1/projects/urbcloud/zones/us-central1-b/disks/' name.deets)
=+ ^- body=json
%- jobe
:~ name/s/'name-provided' 'machineType'^s/'zones/us-central1-b/machineTypes/n1-standard-1'
:- %disks :- %a :_ ~
(jobe boot/b/%.y type/s/'persistent' source/s/src ~)
:- 'networkInterfaces' :- %a :_ ~
(joba 'network' `json`[%s 'global/networks/default'])
==
%- httpreq
:* `bone`os `path`/create-gce
`(list cord)`~['googleapis' 'www'] `path`/compute/v1/projects/urbcloud/zones/us-central1-b/'instances'
[%post `json`body]
%^ mo ['Content-Type' 'application/json' ~]
['Authorization' (cat 3 'Bearer ' access.gce.toke.vat) ~]
~
`quay`[%key access.gce.toke.vat]~
==
++ wake
|= [[ost=bone him=ship pour-path=path] ~]
?+ -.pour-path !!
%refresh-do
:_ +>.$
[(list-instances-do ost)]~
%check-status
:_ +>.$
[(ask-disk-status ost +.pour-path)]~
==
++ thou
|= [[ost=bone him=ship pour-path=path] resp=httr]
^- [(list move) _+>.$]
?+ -.pour-path ~& pour-path !!
%auth-do
(receive-auth ost -.pour-path resp)
::
%auth-gce
(receive-auth ost -.pour-path resp)
::
%list-do
(receive-list-do ost resp)
%list-gce
~& resp
:_ +>.$
~
::
$?
%delete %reboot %'power_cycle' %shutdown %'power_off'
%'power_on' %'password_reset' %'enable_ipv6' %'enable_private_networking'
%snapshot %upgrade :: add retrieve droplet action
%create-do %create-gce
==
~& resp
:_ +>.$ ~
::
?(%create-gce-disk %disk-status)
(disk-status ost resp)
::
%check-status
:_ +>.$ ~[(ask-disk-status ost +.pour-path)]
::
%pub
:_ +>.$ ~
::
==
++ publish
|= [ost=bone you=ship act=(list speech)]
^- move
=+ ^= spchz
%+ turn act
|= sp=speech
=+ ^= tail
:- ^- audience
:+ :- `partner`[%& our.hid ?+((clan our.hid) !! %czar %court, %duke %porch)]
^- (pair envelope delivery)
[`envelope`[& ~] %pending]
~
~
`statement`[lat.hid ~ sp]
^- thought
:- `@`(sham eny.hid tail)
tail
=+ mez=[%talk-command [%publish `(list thought)`spchz]]
[ost %send /pub [our.hid %talk] %poke mez]
--

View File

@ -1,302 +0,0 @@
::
::
::::
::
/? 314
/- *talk
/+ talk, sole
!:
:::: sivtyv-barnel
:: be sure to have oauth2-code mark
|%
++ redirect-uri (crip (urle "http://localhost:8444/gen/main/pub/fab/coin"))
++ client-id '2e688dde3f7655e7c261313a286e69e7c61ec5502459408b7818c4c74c77bf45'
++ auth-url "https://www.coinbase.com/oauth/authorize?".
"response_type=code".
"&client_id=2e688dde3f7655e7c261313a286e69e7c61ec5502459408b7818c4c74c77bf45".
"&redirect_uri={(urle "http://localhost:8443/gen/main/pub/fab/coin")}".
"&scope=user+balance+buy+sell+send+transactions".
"&{(urle "meta[send_limit_amount]")}=1&{(urle "meta[send_limit_curency]")}=BTC&{(urle "meta[send_limit_period]")}=day"
++ axle
$:
key=[atok=@t secr=@t refr=@t]
::outbox=[p=@u q=(map ,@u hiss)]
account-info=(unit ,[bitbal=@t usdval=@t lasttrans=@t])
==
++ move ,[bone (mold note gift)]
++ note
$% $: %e
$% [%them p=(unit hiss)]
[%nice ~]
== ==
[%g %mess [ship path] ship cage]
==
++ coin-args :: passed as hoon type from shell
$%
[%buy qty=@u currency=@tas ~]
[%view-balance ~]
[%refresh-manually ~]
[%get-updates ~]
[%sell qty=@u currency=@tas ~]
[%send to=@t qty=@u currency=@tas ~]
==
++ gift
$% [%nice ~]
[%rush %json json]
==
++ sign
$% $: %e
$% [%thou p=httr]
[%nice ~]
== ==
$: %g
$% [%mean p=ares]
[%nice ~]
== == ==
::
--
::
!:
|_ [hid=hide vat=axle]
++ peer ,_`.
++ poke-keys::oauth2-code
|= [ost=bone his=ship arg=(list cord)]
=: secr.key.vat -.arg
atok.key.vat &2.arg
==
~& key.vat
=+ ^- thot=thought
:+ `serial``@uv`eny.hid
`audience`[[`partner`[%& our.hid %court] `(pair envelope delivery)`[`envelope`[& ~] `delivery`%pending]] ~ ~]
`statement`[lat.hid ~ [%lin & 'keys stored']]
:: =+ prl=`purl`(need (epur (crip auth-url)))
:: =+ ^- url=thought
:: :+ `serial``@uv`eny.hid
:: `audience`[[`partner`[%& our.hid %court] `(pair envelope delivery)`[`envelope`[& ~] `delivery`%pending]] ~ ~]
:: `statement`[lat.hid ~ [%url prl]]
=+ cag=`cage`[%talk-command !>([%publish `(list thought)`[thot ~]])]
:_ +>.$
:- [ost %pass /test %g %mess [our.hid /talk] his cag]
(get-token ost)
++ prep ,_`.
++ hisser
|= [ost=bone move-data=wire endpoint=path reqtype=$|(%get [%post p=json]) args=quay]
^- [(list move) _+>.$]
=+ ^= prl
:+ hrt=[security=%.y port=~ host=[%.y path=/com/coinbase]]
prk=[extension=~ path=endpoint]
quy=args
=+ ^- hiz=hiss
:- prl
?@ reqtype
`moth`[reqtype ~ ~]
`moth`[-.reqtype ~ `(tact (pojo p.reqtype))]
:- :_ ~
:^ ost %pass
=- ~& hiss/- -
[(scot %ud p.outbox.vat) move-data]
:^ %e %them ~
hiz
+>.$
:: p.outbox.vat +(p.outbox.vat)
::q.outbox.vat [(~(put by q.outbox.vat) p.outbox.vat hiz)]
++ spam
|= newtranz=(list ,@t)
^- (list move)
%+ turn (~(tap by sup.hid)) :: listify subscribers
|= [ost=bone *]
^- move
:^ ost %give %rush
:+ %json %a
%+ turn newtranz
|=(a=cord [%s a])
++ get-token
|= os=bone
^+ [*(list move) +>]
=+ ^= queries
:~ ['grant_type' 'authorization_code']
['code' atok.key.vat]
['redirect_uri' redirect-uri]
['client_id' client-id]
['client_secret' secr.key.vat]
==
=^ hiz +>.$ :: =+ hiz as head of hisser, change +>.$ to tail of hisser to reflect outbox changes
(hisser os /code /oauth/token [%post ~] queries)
[[[ost %give %nice ~] hiz] +>.$]
::
++ poke-coin-args
|= [ost=bone you=ship arg=coin-args]
^+ [*(list move) +>]
:: send to parent app, as :coin args spawns an ephemeral app. ask me if this confuses you.
?. =(/coin imp.hid) ::?= makes imp.hid too specific a type for +>.$
=+ cag=`cage`[%coin-args !>(arg)]
~& instance/arg
:_(+>.$ [ost %pass /foreign %g %mess [our.hid /coin] you cag]~) ::sending to parent app
?- -.arg
%buy
=+ quy=['access_token' atok.key.vat]~
=+ jon=(jobe qty/(jone qty.arg) currency/s/(cuss (trip currency.arg)) ~)
[(hisser ost /bought /api/v1/buys [%post p=jon] quy)]
%sell
=+ quy=['access_token' atok.key.vat]~
=+ jon=(jobe qty/(jone qty.arg) currency/s/(cuss (trip currency.arg)) ~)
[(hisser ost /sold /api/v1/sells [%post p=jon] quy)]
%send
=+ quy=['access_token' atok.key.vat]~
=+ jon=(joba transaction/(jobe to/[%s to.arg] 'amount_currency_iso'^[%s (cuss (trip currency.arg))] 'amount_string'^(jone qty.arg) ~))
=+ quy=['access_token' atok.key.vat]~
~& sending/(crip (pojo jon))
(hisser ost /view /api/v1/transactions/'send_money' [%post jon] quy)
%view-balance
=+ quy=['access_token' atok.key.vat]~
(hisser ost /view /api/v1/accounts %get quy)
%refresh-manually
~& %trying-to-r-m
=+ ^= queries
:~ ['grant_type' 'refresh_token']
['redirect_uri' redirect-uri]
['client_id' client-id]
['client_secret' secr.key.vat]
['refresh_token' refr.key.vat]
==
(hisser ost /refresh /oauth/token [%post ~] queries) :: refresh
%get-updates
(auto-updates ost)
==
::
++ return |=(a=(list move) [a +>.$])
++ parse-error :: parses the various error messages we receive
|= [ost=bone pax=path jon=json]
^- (unit ,[(list move) _+>.$])
=+ misc-error=%.(jon =>(jo (ot errors/(ar so) ~)))
?^ misc-error
%- some :: HAVE TO SOME BECAUSE RESULT IS UNIT
~& miscellaneous-error/u.misc-error
(return) ::
=+ token-error=%.(jon =>(jo (ot 'invalid_grant'^so 'error_description'^so ~)))
?^ token-error
%- some
~& token-err/jon
?: ?=([%refresh ~] pax) :: if refresh failure, stop
~& coin/oauth/%refresh-loop
[~ +>.$]
=+ ^= queries
:~ ['grant_type' 'refresh_token']
['redirect_uri' redirect-uri]
['client_id' client-id]
['client_secret' secr.key.vat]
['refresh_token' refr.key.vat]
==
[(hisser ost /refresh /oauth/token [%post ~] queries)] :: refresh
~ :: no error parsed
::
++ peer :: call when someone subscribes to you
|= [ost=bone *] :: need ost to send confirmation back
:_ +>.$
:- [ost %give %nice ~]
?~ account-info.vat ~
[ost %give %rush %json [%a [%s lasttrans.u.account-info.vat]~]]~ :: have to send arr of str
++ pour
|= [ost=bone pax=path sih=sign]
^+ [*(list move) +>]
~& pour-pax/pax
?- &2.sih
%nice :: receive positive acknowledgement
~& %nice
[[ost %give %nice ~]~ +>.$]
%mean :: receive negative acknowledgement
~& mean/p.sih
[~ +>.$]
%thou :: receive response
?: =(401 p.p.sih) :: handle 401, then try to reauth using %refresh-token
=+ ^= queries
:~ ['grant_type' 'refresh_token']
['redirect_uri' redirect-uri]
['client_id' client-id]
['client_secret' secr.key.vat]
['refresh_token' refr.key.vat]
==
[(hisser ost /refresh /oauth/token [%post ~] queries)] :: send refresh token
?: =(5 (div p.p.sih 100)) :: catch http 5xx
~& [%server-error pax=pax] :: print error
:: XX resend
[~ +>.$] :: return state and no moves
=+ ~| parse-error/[pax p.sih] :: parse error
respbody=(rash q:(need r.p.sih) apex:poja) :: rash unwraps unit; octs is [p q]
=+ error=(parse-error ost pax respbody)
?^ error
u.error :: If parse-error succeeds, return move, context
?~ pax [[ost %give %nice ~]~ +>.$] :: ~|(%nil-path !!)
::=. q.outbox.vat ~| pax (~(del by q.outbox.vat) (slav %ud i.pax))
=> .(pax t.pax)
?+ pax ~|(unhandled-path/pax !!) :: switch on path of your initial request
[%bought ~]
~& successful-buy-request/respbody
`+>.$
::
[%sold ~]
~& successful-sell-request/respbody
`+>.$
[%view ~]
~& %viewed
~& respbody
~& %. respbody
=> jo
=+ bal=`$+(json (unit ,[num=@t in=@t]))`(ot amount/so currency/so ~)
(ot accounts/(ar (ot name/so balance/bal 'native_balance'^bal ~)) ~)
:_(+>.$ ~)
::
[?(%code %refresh) ~]
|-
=+ state=`[atoken=@t secr=@t]`(need ((ot 'access_token'^so 'refresh_token'^so ~):jo respbody))
=: atok.key.vat atoken.state
secr.key.vat secr.state
==
~& [%authorized i.pax]
[[ost %give %nice ~]~ +>.^$] :: ^$ because $ contains other =+'s that would change type of state
[%update ~]
=+ ^= updatez
^+ =< *(unit .) ::
$: [@ btc=@t]
[@ usd=@t]
transhistory=(list ,id=@t)
==
~& respbody
%. respbody
=> jo
%- ot :~
%balance^(ot currency/so amount/so ~)
'native_balance'^(ot currency/so amount/so ~)
'account_changes'^(ar (ot id/so ~))
==
~& bal/updatez
=+ old-lasttrans=`(unit ,@t)`?~(account-info.vat ~ `lasttrans.u.account-info.vat):: for recursing down to last trans
=. account-info.vat :: doesn't change type, although it does assert that the new type fits
?~ updatez
~& update-unparsable/respbody
account-info.vat
`[btc.u.updatez usd.u.updatez -.transhistory.u.updatez] :: end =. ; if bal is empty do nothing by returning old state
::
=+ ^= newtrans ^- (list ,@t) :: LIST NEW TRANSACTIONS
?~ updatez ~ :: allow us to address updatez later
=+ b=u.updatez
?~ old-lasttrans transhistory.b
|-(?~(transhistory.b ~ ?:(=(i.transhistory.b u.old-lasttrans) ~ [i.transhistory.b $(transhistory.b t.transhistory.b)])))
~& :- %new-transactions-received newtrans
:_ +>.$
?~ newtrans
~
(spam newtrans)
==
==
++ auto-updates
|= ost=bone
=+ ^= query
['access_token' atok.key.vat]~
(hisser ost /update /api/v1/'account_changes' %get query)
--

11
base/ape/curl/core.hook Normal file
View File

@ -0,0 +1,11 @@
/+ mean
!:
::::
::
|_ [^ ~]
++ poke |*([[a=@ @] b=[mark *]] :_(+> [a %hiss / %wain b]~))
::++ poke-purl |=([[a=@ @] b=purl] :_(+> [a %hiss / %wain %purl b]~))
++ poke-noun |=([a=from b=tape] (poke a %purl (scan b auri:epur)))
++ sigh-wain |=([^ a=wain] ~&(a `+>))
++ sigh-tang |=([^ a=tang] `_+>`(mean a))
--

View File

@ -1,334 +0,0 @@
:: digital ocean fleet management
::
::::
::
/? 310
::
::
:::: sivtyv-barnel
::
!:
|%
++ droplet
$: id=@ud name=@t memory=@ud vcpus=@ud disk=@ud locked=?
created=@t status=@t backup-ids=(list ,@t) snapshot-ids=(list ,@t)
features=(list ,@t) region=regi image=img
size=syze size-slug=@t networks=ntwrks kernel=kern
next-backup-window=json
==
++ regi ,[name=@t slug=@t sizes=(list ,@t)]
++ kern ,[id=@ud name=@t version=@t]
++ img
$: id=@ud name=@t distribution=@t slug=@t public=? regions=(list ,@t)
created-at=@t type=@t min-disk-size=@ud
==
++ ntwrks ,[v4=(list v) v6=(list v)]
++ v ,[ip-address=@t netmask=@t gateway=@t type=@t]
++ syze
$: memory=@ud price-monthly=@t price-hourly=@t disk=@ud vcpus=@ud
slug=@t transfer=@t available=? regions=(list ,@t)
==
++ reqbody
$:
name=@t region=@t size=@t image=@t ssh=(list cord)
backups=(unit ,?) ipv6=(unit ,?) private-networking=(unit ,?) user-data=(unit ,@t)
==
++ axle ,[ke=keys toke=tokens drops=(list droplet)]
++ keys ,[authc=(unit ,@t) client-secret=(unit ,@t)]
++ tokens ,[access=@t refresh=@t]
++ move ,[bone (mold note gift)]
++ note
$: %e
%them
(unit hiss)
==
++ gift
$% [%nice ~]
[%rush %json json]
==
++ sign
$: %e
$% [%thou p=httr]
== ==
--
!:
|% :::
++ parse-img
=> jo
%- ot
:~ id/ni name/so distribution/so slug/so public/bo
regions/(ar so) 'created_at'^so type/so 'min_disk_size'^ni
==
++ parse-ntwrks
=> jo
%- ot
:+ v4/(ar (ot 'ip_address'^so netmask/so gateway/so type/so ~))
v6/(ar (ot 'ip_address'^so netmask/so gateway/so type/so ~))
~
++ parse-size
=> jo
%- ot
:~ memory/ni 'price_monthly'^no 'price_hourly'^no disk/ni
vcpus/ni slug/so transfer/no available/bo regions/(ar so)
==
++ parse-region
=> jo
(ot name/so slug/so sizes/(ar so) ~)
++ create-body
|= $: name=@t region=@t size=@t image=@t ssh-keys=(list cord)
backups=(unit ,?) ipv6=(unit ,?) private-networking=(unit ,?) user-data=(unit ,@t)
==
%- jobe
:~ name/s/name region/s/region size/s/size image/s/image
'ssh_keys'^a/(turn ssh-keys |=(cord s/+<)) backups/?~(backups ~ b/u.backups) ipv6/?~(ipv6 ~ b/u.ipv6)
'user_data'^?~(user-data ~ s/u.user-data) 'private_networking'^?~(private-networking ~ b/u.private-networking)
==
++ state-to-json
|= a=(list droplet)
:- %a
%+ turn a
|= droplet
^- json
%- jobe
:~ id/`json`(jone id)
name/`json`s/name
vcpus/`json`(jone vcpus)
disk/`json`(jone disk)
locked/b/locked
created/s/created
status/s/status
backup-ids/a/(turn backup-ids |=(el=cord s/el))
snapshot-ids/a/(turn snapshot-ids |=(el=cord s/el))
features/a/(turn features |=(el=cord s/el))
=+ ^= reg
:~ name/s/name.region slug/s/slug.region
sizes/a/(turn sizes.region |=(el=cord s/el))
==
region/(jobe reg)
=+ ^= im
:~ id/(jone id.image) name/s/name.image distribution/s/distribution.image
slug/s/slug.image public/b/public.image
regions/a/(turn regions.image |=(el=cord s/el))
created-at/s/created-at.image type/s/type.image
min-disk-size/(jone min-disk-size.image)
==
image/(jobe im)
=+ ^= sz
:~ memory/(jone memory.size) price-monthly/s/price-monthly.size
price-hourly/s/price-hourly.size disk/(jone disk.size) vcpus/(jone vcpus.size)
slug/s/slug.size transfer/s/transfer.size available/b/available.size
regions/a/(turn regions.size |=(el=cord s/el))
==
size/(jobe sz)
size-slug/s/size-slug
=+ ^= nt
=+ ^= vobj
|= v
%- jobe :~
ip-address/s/ip-address netmask/s/netmask
gateway/s/gateway type/s/type
==
:~ v4/[%a (turn v4.networks vobj)]
v6/[%a (turn v4.networks vobj)]
==
networks/(jobe nt)
kernel/s/'kernel'
next-backup-window/s/'valid'
==
--
!:
|_ [hid=hide vat=axle]
::
++ auth-queries
:~ 'grant_type'^'authorization_code'
'code'^(need authc.ke.vat)
:- 'client_id'
'd8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f'
'redirect_uri'^'http://localhost:8443/main/pub/do/fab'
==
++ httpreq
|= $: ost=bone pour-path=wire
domain=(list cord) end-point=path
req-type=$?(%get [%post json]) headers=math
queries=quay
==
^- move
=+ ^- parsed-url=purl
:+ ^= host-port :: ++hart
:+ security=%.y
port=~
host=[%.y [path=[%com domain]]]
endpoint=[extensions=~ point=end-point] :: ++pork,
q-strings=queries :: ++quay
=+ ^- request=hiss :: cast to hiss
:- parsed-url
?@ req-type
[%get headers ~]
[%post headers ~ (tact (pojo +.req-type))]
:^ ost %pass pour-path
:+ %e %them
`(unit hiss)`[~ request]
::++ prep ,_`. :: wipe state when app code is changed
::
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>.$]
:_ +>.$
[ost %give %rush %json (state-to-json drops.vat)]~
::
++ poke-oauth2-code
|= [ost=bone you=ship code=cord]
^- [(list move) _+>.$]
=. authc.ke.vat
[~ code]
=+ ath=(need authc.ke.vat)
:_ +>.$
[ost %give %nice ~]~
::
++ poke-client-secret
|= [ost=bone you=ship secret=cord]
^- [(list move) _+>.$]
=. client-secret.ke.vat
[~ secret]
~& client-secret.ke.vat
:_ +>.$
:_ [ost %give %nice ~]~
%^ httpreq ost /auth
:^ ~[%digitalocean %cloud] `path`/v1/oauth/token
[%post ~]
:- ~ `quay`['client_secret'^(need client-secret.ke.vat) auth-queries]
::
++ receive-auth
|= [ost=bone pour-path=path resp=sign]
=+ body=(rash q:(need r.p.+.resp) apex:poja)
~& body
=+ [ac re]=(need ((ot 'access_token'^so 'refresh_token'^so ~):jo body))
=: access.toke.vat ac
refresh.toke.vat re
==
~& toke.vat
:_ +>.$
[ost %give %nice ~]~
::
++ poke-json
|= [ost=bone you=ship act=json]
^- [(list move) _+>.$]
=+ do=(need ((ot action/so ~):jo act))
?+ do !!
%list
:_ +>.$
:+ [(list-droplets ost)]
[ost %give %nice ~]
~
%create
:_ +>.$
=+ ^- deets=reqbody
%- need
%. act
=> jo
%- ot
:~ name/so region/so size/so image/so ssh/(ar so) backups/(mu bo)
'ipv6'^(mu bo) 'priv_networking'^(mu bo) 'user_data'^(mu so)
==
:+ [(create-droplet ost deets)]
[ost %give %nice ~]
~
%reboot
:_ +>.$
=+ id=(need ((ot id/ni ~):jo act))
~& id
^- (list move)
:+ `move`(reboot-droplet ost id)
[ost %give %nice ~]
~
==
++ reboot-droplet
|= [os=bone id=@ud]
%- httpreq :*
os
/reboot
~[%digitalocean %api]
=+ path=`path`/v2/droplets/'5073686'/actions
~& path
path
[%post `json`(jobe type/s/'reboot' ~)]
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~)
*quay
==
++ list-droplets
|= os=bone
~& 'poked'
=+ ^= lis
:~ os /list
~[%digitalocean %api] /v2/droplets
%get
(mo ['Content-Type' 'application/json' ~] ['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~)
==
(httpreq lis)
::
++ receive-list
|= [ost=bone pour-path=path resp=sign]
=+ parsed=(rash q:(need r.p.+.resp) apex:poja)
=+ dar=(need ((ot droplets/(ar some) ~):jo parsed))
=+ ^- dropz=(list droplet)
~| bad-json/-.dar
%+ turn dar
|= drp=json
%- need
%. drp =+ jo
%- ot
:~ id/ni name/so
memory/ni vcpus/ni disk/ni
locked/bo 'created_at'^so status/so
'backup_ids'^(ar so) 'snapshot_ids'^(ar so) features/(ar so)
region/parse-region image/parse-img size/parse-size
'size_slug'^so networks/parse-ntwrks kernel/(ot id/ni name/so version/so ~)
'next_backup_window'^some
==
=. drops.vat
dropz
~& drops/drops.vat
:_ +>.$
[ost %give %nice ~]~
::
++ create-droplet
|= [os=bone reqbody]
~& 'reached'
=+ ^= create :*
os /create
~[%digitalocean %api] /v2/droplets
:- %post
%- create-body
:* name region size image ssh backups
ipv6 private-networking user-data
==
%^ mo ['Content-Type' 'application/json' ~]
['Authorization' (cat 3 'Bearer ' access.toke.vat) ~] ~
~
==
(httpreq create)
::
++ pour
|= [ost=bone pour-path=path resp=sign]
^- [(list move) _+>.$]
?+ -.pour-path !!
%auth
(receive-auth ost pour-path resp)
::
%list
(receive-list ost pour-path resp)
::
%create
~& created/resp
:_ +>.$
[ost %give %nice ~]~
::
%reboot
~& resp
:_ +>.$
[ost %give %nice ~]~
==
--

View File

@ -133,9 +133,9 @@
[%call p=silk q=silk] :: slam
[%cast p=mark q=silk] :: translate
[%diff p=silk q=silk] :: diff
[%done p=(set beam) q=gage] :: literal
[%done p=(set beam) q=cage] :: literal
[%dude p=tank q=silk] :: error wrap
[%dune p=(set beam) q=(unit gage)] :: unit literal
[%dune p=(set beam) q=(unit cage)] :: unit literal
[%file p=beam] :: from clay
[%join p=mark q=silk r=silk] :: merge
[%mash p=mark q=milk r=milk] :: annotate
@ -149,7 +149,7 @@
[%volt p=(set beam) q=(cask ,*)] :: unsafe add type
== ::
++ sign ::
$% [%made p=@uvH q=(each gage tang)] ::
$% [%made p=@uvH q=gage] ::
[%unto p=cuft] ::
== ::
-- ::
@ -227,7 +227,7 @@
(ifix [sel ser] (stag %tu (most ace dp-source)))
==
::
++ dp-goal :: ++goal
++ dp-goal :: ++goal
%+ cook |=(a=goal a)
;~ pose
;~ plug
@ -240,10 +240,11 @@
++ dp-model-cat ;~(plug dp-server-cat dp-config) :: ++dojo-model
++ dp-model-dog ;~(plug dp-server-dog dp-config) :: ++dojo-model
++ dp-model-pig ;~(plug dp-server-pig dp-config) :: ++dojo-model
++ dp-path `path`/(scot %p our.hid)/home/(scot %da now.hid)
++ dp-server-cat (stag 0 (stag %cat dp-device)) :: ++dojo-server
++ dp-server-dog (stag 0 (stag %dog dp-device)) :: ++dojo-server
++ dp-server-pig (stag 0 (stag %pig dp-device)) :: ++dojo-server
++ dp-twig wide:(vang & ~) :: ++twig
++ dp-twig wide:(vang & dp-path) :: ++twig
++ dp-device (most fas sym) :: ++dojo-device
++ dp-value :: ++dojo-source
%+ cook |=(a=dojo-source a)
@ -626,13 +627,12 @@
[& %$ "> "]
::
++ he-made :: result from ford
|= [way=wire dep=@uvH reg=(each gage tang)]
|= [way=wire dep=@uvH reg=gage]
^+ +>
?> ?=(^ poy)
=< he-pine
?- -.reg
%& ?> ?=(@ p.p.reg)
%. p.reg
%& %. p.reg
=+ dye=~(. dy u.poy(pux ~))
?+ way !!
[%hand ~] dy-hand:dye
@ -641,6 +641,7 @@
[%edit ~] dy-made-edit:dye
==
%| (he-diff(poy ~) %tan p.reg)
%tabl !!
==
::
++ he-unto :: result from behn
@ -741,7 +742,7 @@
he-abet:(~(he-type he [ost.hid ~] (~(got by hoc) ost.hid)) act)
::
++ made
|= [way=wire dep=@uvH reg=(each gage tang)]
|= [way=wire dep=@uvH reg=gage]
he-abet:(~(he-made he [[ost.hid ~] (~(got by hoc) ost.hid)]) way dep reg)
::
++ unto

View File

@ -119,7 +119,7 @@
(ably (take-mere:(kiln-work hid (able %kiln)) way +<+))
::
++ made-kiln ::
|= [way=wire @uvH (each gage tang)]
|= [way=wire @uvH gage]
(ably (take-made:(kiln-work hid (able %kiln)) way +<+))
::
++ init-helm ::

View File

@ -1644,6 +1644,9 @@
|= oug=?
^- tape
?+ -.sep ""
%url
(earn p.sep)
::
%lin
=+ txt=(trip q.sep)
?: p.sep

View File

@ -72,7 +72,7 @@
[%writ p=riot] ::
== == ::
$: %f ::
$% [%made p=@uvH q=(each gage (list tank))] ::
$% [%made p=@uvH q=gage] ::
== == ::
$: %t ::
$% [%wake ~] :: timer activate
@ -175,29 +175,53 @@
:: ~& [%aver-mun nao [%from syd lim q.mun]]
?~(nao ~ (read-at-aeon:ze u.nao mun))
::
++ made-to-tage
|= res=(each gage tang)
^- tage
?: ?=(%| -.res)
~| %ford-fail
|-
?~ p.res !!
~> %mean.|.(i.p.res) :: interpolate ford fail into stack trace
$(p.res t.p.res)
?@ p.p.res
~|(%bad-marc !!)
p.res
++ ford-fail
|= tan=tang
~| %ford-fail
|-
?~ tan !!
~> %mean.|.(i.tan) :: interpolate into stack trace
$(tan t.tan)
::
++ tage-to-cages
|= tab=tage
^- (list (pair cage cage))
?~ p.tab
~
:_ $(p.tab t.p.tab, q.tab (slot 3 q.tab))
~| %strange-gage
:- [?^(p.i.p.tab !! p.i.p.tab) (slot 4 q.tab)]
[?^(q.i.p.tab !! q.i.p.tab) (slot 5 q.tab)]
++ unwrap-tang
|* res=(each ,* tang)
?: ?=(%& -.res)
p.res
(ford-fail p.res)
::
++ gage-to-cages
|= gag=gage ^- (list (pair cage cage))
(unwrap-tang (gage-to-tage gag))
::
++ gage-to-tage
|= gag=gage
^- (each (list (pair cage cage)) tang)
?. ?=(%tabl -.gag)
(mule |.(`~`(ford-fail >%strange-gage< ~)))
=< ?+(. [%& .] [@ *] .)
|- ^- ?((list ,[cage cage]) (each ,~ tang))
?~ p.gag ~
=* hed i.p.gag
?- -.p.hed
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
%| (mule |.(`~`(ford-fail p.p.hed)))
%& ?- -.q.hed
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
%| (mule |.(`~`(ford-fail p.q.hed)))
%& =+ $(p.gag t.p.gag)
?+(- [[p.p p.q]:hed -] [@ *] -)
== ==
::
++ cages-to-map
|= tay=(list (pair cage cage))
=| can=(map path cage)
|- ^- (each (map path cage) tang)
?~ tay [%& can]
=* pax p.i.tay
?. ?=(%path p.pax)
(mule |.(`~`~|([%expected-path got=p.pax] !!)))
$(tay t.tay, can (~(put by can) ((hard path) q.q.pax) q.i.tay))
++ balk :: read and send
|= [hen=duct cay=(unit (each cage lobe)) mun=mood]
^+ +>
@ -538,7 +562,7 @@
(checkout-ankh(lat.ran lat.ran.+.hat) u.-.hat)
::
++ take-inserting
|= [wen=@da res=(each gage tang)]
|= [wen=@da res=gage]
^+ +>
?~ dok
~& %clay-take-inserting-unexpected-made +>.$
@ -551,14 +575,14 @@
(apply-edit wen)
+>.$
^- (list (pair path cage))
%+ turn (tage-to-cages (made-to-tage res))
%+ turn (gage-to-cages res)
|= [pax=cage cay=cage]
?. ?=(%path p.pax)
~|(%clay-take-inserting-strange-path-mark !!)
[((hard path) q.q.pax) cay]
::
++ take-diffing
|= [wen=@da res=(each gage tang)]
|= [wen=@da res=gage]
^+ +>
?~ dok
~& %clay-take-diffing-unexpected-made +>.$
@ -571,7 +595,7 @@
(apply-edit wen)
+>.$
^- (list (trel path lobe cage))
%+ turn (tage-to-cages (made-to-tage res))
%+ turn (gage-to-cages res)
|= [pax=cage cay=cage]
^- (pair path (pair lobe cage))
?. ?=(%path p.pax)
@ -580,14 +604,14 @@
[paf (page-to-lobe:ze [p q.q]:cay) (~(got by dig.u.dok) paf)]
::
++ take-castify
|= [wen=@da res=(each gage tang)]
|= [wen=@da res=gage]
^+ +>
?~ dok
~& %clay-take-castifying-unexpected-made +>.$
?. =(~ muh.u.dok)
~& %clay-take-castifying-redundant-made +>.$
=+ ^- cat=(list (pair path cage))
%+ turn (tage-to-cages (made-to-tage res))
%+ turn (gage-to-cages res)
|= [pax=cage cay=cage]
?. ?=(%path p.pax)
~|(%castify-bad-path-mark !!)
@ -610,7 +634,7 @@
==
::
++ take-mutating
|= [wen=@da res=(each gage tang)]
|= [wen=@da res=gage]
^+ +>
?~ dok
~& %clay-take-mutating-unexpected-made +>.$
@ -623,7 +647,7 @@
(apply-edit wen)
+>.$
^- (list (trel path lobe cage))
%+ murn (tage-to-cages (made-to-tage res))
%+ murn (gage-to-cages res)
|= [pax=cage cay=cage]
^- (unit (pair path (pair lobe cage)))
?. ?=(%path p.pax)
@ -634,7 +658,7 @@
`[paf (~(got by muh.u.dok) paf) cay]
::
++ take-patch
|= res=(each gage tang)
|= res=gage
^+ +>
:: ~& %taking-patch
?: ?=(%| -.res)
@ -675,29 +699,15 @@
(echo now %& *cart sim)
==
?~ dok ~& %no-dok +>.$
=+ cay=p.res
?@ p.cay ~| %patch-bad-marc !!
:: ~& %canning
=+ ^= can
|- ^- (list ,[path cage])
?~ p.p.cay
~
:_ %_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?. ?=(%path p.i.p.p.cay)
~| %patch-strange-marc-a
!!
?. ?=(@ q.i.p.p.cay)
~| %patch-strange-marc-b
!!
=+ coy=(slot 2 q.cay)
?@ q.coy
~| %patch-strange-coy
!!
:- ((hard path) -.q.coy)
[q.i.p.p.cay (slot 3 coy)]
=+ ^- cat=(list (pair path cage))
%+ turn (gage-to-cages res)
|= [pax=cage cay=cage]
?. ?=(%path p.pax)
~|(%patch-bad-path-mark !!)
[((hard path) q.q.pax) cay]
:: ~& %canned
:: ~& %checking-out
=. ank.dom (checkout-ankh:ze (mo can))
=. ank.dom (checkout-ankh:ze (mo cat))
=. +>.$ =>(wake ?>(?=(^ dok) .))
:: ~& %checked-out
?~ hez +>.$(dok ~)
@ -734,7 +744,7 @@
==
::
++ take-ergo
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
%_ +>.$
@ -743,30 +753,19 @@
==
?~ hez ~|(%no-sync-duct !!)
?. syn ~|(%sync-off !!)
=+ cay=p.res
?@ p.cay ~| %patch-bad-marc !!
%= +>.$
reg
:_ reg
:* u.hez %ergo who syd let.dom
|- ^- (list ,[path (unit mime)])
?~ p.p.cay
^- (list ,[path (unit mime)])
%+ turn (gage-to-cages res)
|= [pax=cage mim=cage]
?. ?=(%path p.pax)
~|(%ergo-bad-path-mark !!)
:- ((hard path) q.q.pax)
?. ?=(%mime p.mim)
~
:_ %_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?. ?=(%path p.i.p.p.cay)
~| %ergo-strange-marc-a
!!
?. ?=(@ q.i.p.p.cay)
~| %ergo-strange-marc-b
!!
=+ coy=(slot 2 q.cay)
?@ q.coy
~| %ergo-strange-coy
!!
:- ((hard path) -.q.coy)
?. ?=(%mime q.i.p.p.cay)
~
`((hard mime) q:(slot 3 coy))
`((hard mime) q.q.mim)
==
==
::
@ -942,12 +941,13 @@
==
::
++ take-foreign-x
|= [car=care cas=case pax=path res=(each gage tang)]
|= [car=care cas=case pax=path res=gage]
^+ +>
?> ?=(^ ref)
?: ?=(%| -.res)
?. ?=(%& -.res)
~| "validate foreign plops failed"
~| [%plop-fail (turn p.res |=(tank ~(ram re +<)))]
=+ tan=?-(-.res %| p.res, %tabl ~[>%bad-marc<])
~> %mean.|.(rose/[" " "[" "]"]^[>%plop-fail< tan])
!!
?> ?=(@ p.p.res)
wake(haw.u.ref (~(put by haw.u.ref) [car cas pax] `p.res))
@ -976,34 +976,24 @@
==
::
++ take-foreign-plops
|= res=(each gage tang)
|= res=gage
^+ +>
?> ?=(^ ref)
?> ?=(^ nak.u.ref)
?: ?=(%| -.res)
?. ?=(%| -.res)
~| "validate foreign plops failed"
~| [%plop-fail (turn p.res |=(tank ~(ram re +<)))]
~> %mean.|.(rose/[" " "[" "]"]^[>%plop-fail< p.res])
!!
=+ cay=p.res
?@ p.cay ~| %plop-bad-marc !!
=+ |- ^- lat=(list blob)
?~ p.p.cay
~
:_ %_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?. ?=(%blob p.i.p.p.cay)
~| %plop-strange-marc-a
=+ ^- lat=(list blob)
%+ turn (gage-to-cages res)
|= [bob=cage cay=cage]
?. ?=(%blob p.bob)
~| %plop-not-blob
!!
?. ?=(@ q.i.p.p.cay)
~| %plop-strange-marc-b
!!
=+ coy=(slot 2 q.cay)
?@ q.coy
~| %plop-strange-coy
!!
=+ bol=((hard blob) -.q.coy)
=+ bol=((hard blob) q.bob)
?- -.bol
%delta [-.bol p.bol q.bol q.i.p.p.cay +.q.coy]
%direct [-.bol p.bol q.i.p.p.cay +.q.coy]
%delta [-.bol p.bol q.bol p.cay q.q.cay]
%direct [-.bol p.bol p.cay q.q.cay]
%indirect ~| %plop-indirect-not-implemented !!
==
%^ apply-foreign-update
@ -1594,16 +1584,16 @@
..me(mer (~(del by mer) ali), reg :_(reg [hen %mere gon.dat]))
::
++ route
|= [sat=term res=(each riot (each gage tang))]
|= [sat=term res=(each riot gage)]
^+ +>.$
?+ sat ~|((crip <[%bad-stage sat]>) !!)
%ali %- fetched-ali ?> ?=(%& -.res) p.res
%diff-ali %- diffed-ali ?> ?=(%| -.res) p.res
%diff-bob %- diffed-bob ?> ?=(%| -.res) p.res
%merge %- merged ?> ?=(%| -.res) p.res
%build %- built ?> ?=(%| -.res) p.res
%checkout %- checked-out ?> ?=(%| -.res) p.res
%ergo %- ergoed ?> ?=(%| -.res) p.res
?+ +< ~|((crip <[%bad-stage sat ?~(-.res %riot %gage)]>) !!)
[%ali %& *] %.(p.res fetched-ali)
[%diff-ali %| *] %.(p.res diffed-ali)
[%diff-bob %| *] %.(p.res diffed-bob)
[%merge %| *] %.(p.res merged)
[%build %| *] %.(p.res built)
[%checkout %| *] %.(p.res checked-out)
[%ergo %| *] %.(p.res ergoed)
==
::
++ start
@ -1838,34 +1828,14 @@
(diff-bas %ali ali.dat ali bob.dat)
::
++ diffed-ali
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
(error:he %diff-ali-bad-made leaf/"merge diff ali failed" p.res)
=+ cay=p.res
?@ p.cay
(error:he %diff-ali-bad-marc >p.cay< ~)
=| can=(map path cage)
=>
|- ^+ +
?~ p.p.cay
+.$(can ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %diff-ali-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %diff-ali-strange-marc-b >q.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %diff-ali-strange-coy ~))
%_ +.$
can
%+ ~(put by can:tal)
((hard path) -.q.coy)
[q.i.p.p.cay (slot 3 coy)]
==
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %diff-ali-bad-made leaf/"merge diff ali failed" p.tay)
=+ can=(cages-to-map p.tay)
?: ?=(%| -.can)
(error:he %diff-ali p.can)
?: ?=(%| -.gon.dat)
+>.$
=. new.dal.dat
@ -1883,7 +1853,7 @@
!=([~ lob] a)
=([~ lob] b)
==
=. can.dal.dat can
=. can.dal.dat p.can
=. old.dal.dat
%- mo ^- (list ,[path ~])
%+ murn (~(tap by q.bas.dat))
@ -1898,34 +1868,14 @@
(diff-bas %bob bob.dat bob ali.dat)
::
++ diffed-bob
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
(error:he %diff-bob-bad-made leaf/"merge diff bob failed" p.res)
=+ cay=p.res
?@ p.cay
(error:he %diff-bob-bad-marc >p.cay< ~)
=| can=(map path cage)
=>
|- ^+ +
?~ p.p.cay
+.$(can ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %diff-bob-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %diff-bob-strange-marc-b >q.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %diff-bob-strange-coy ~))
%_ +.$
can
%+ ~(put by can:tal)
((hard path) -.q.coy)
[q.i.p.p.cay (slot 3 coy)]
==
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %diff-bob-bad-made leaf/"merge diff bob failed" p.tay)
=+ can=(cages-to-map p.tay)
?: ?=(%| -.can)
(error:he %diff-bob p.can)
?: ?=(%| -.gon.dat)
+>.$
=. new.dob.dat
@ -1943,7 +1893,7 @@
!=([~ lob] b)
=([~ lob] a)
==
=. can.dob.dat can
=. can.dob.dat p.can
=. old.dob.dat
%- mo ^- (list ,[path ~])
%+ murn (~(tap by q.bas.dat))
@ -1977,35 +1927,14 @@
==
::
++ merged
|= res=(each gage tang)
?: ?=(%| -.res)
(error:he %merge-bad-made leaf/"merging failed" p.res)
=+ cay=p.res
?@ p.cay
(error:he %merge-bad-marc >p.cay< ~)
=| bof=(map path (unit cage))
=>
|- ^+ +
?~ p.p.cay
+.$(bof ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %merge-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %merge-strange-marc-b >q.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %merge-strange-coy ~))
%_ +.$
bof
%+ ~(put by bof:tal)
((hard path) -.q.coy)
?: ?=(%null q.i.p.p.cay)
~
`[q.i.p.p.cay (slot 3 coy)]
==
|= res=gage
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %merge-bad-made leaf/"merging failed" p.tay)
=+ can=(cages-to-map p.tay)
?: ?=(%| -.can)
(error:he %merge p.can)
=+ bof=(~(run by p.can) (flit |=([a=mark ^] !?=(%null a))))
?: ?=(%| -.gon.dat)
+>.$
=. bof.dat bof
@ -2034,37 +1963,17 @@
::
++ built
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
(error:he %build-bad-made leaf/"delta building failed" p.res)
=+ cay=p.res
?@ p.cay
(error:he %build-bad-marc >p.cay< ~)
=| bop=(map path cage)
=>
|- ^+ +
?~ p.p.cay
+.$(bop ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %build-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %build-strange-marc-b >q.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %build-strange-coy ~))
%_ +.$
bop
%+ ~(put by bop:tal)
((hard path) -.q.coy)
[q.i.p.p.cay (slot 3 coy)]
==
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %build-bad-made leaf/"delta building failed" p.tay)
=+ bop=(cages-to-map p.tay)
?: ?=(%| -.bop)
(error:he %built p.bop)
?: ?=(%| -.gon.dat)
+>.$
=. bop.dat bop
=. bop.dat p.bop
=+ ^- con=(map path ,*) :: 2-change conflict
%- mo
%+ skim (~(tap by bof.dat))
@ -2170,39 +2079,19 @@
==
::
++ checked-out
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
(error:he %checkout-bad-made leaf/"merge checkout failed" p.res)
=+ cay=p.res
?@ p.cay
(error:he %patch-bad-marc >p.cay< ~)
=| can=(list ,[path cage])
=>
|- ^+ +
?~ p.p.cay
+.$(can ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %patch-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %patch-strange-marc-b >q.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %patch-strange-coy ~))
%_ +.$
can
:_ can:tal
:- ((hard path) -.q.coy)
[q.i.p.p.cay (slot 3 coy)]
==
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %checkout-bad-made leaf/"merge checkout failed" p.tay)
=+ can=(cages-to-map p.tay)
?: ?=(%| -.can)
(error:he %checkout p.can)
?: ?=(%| -.gon.dat)
+>.$
=. let.dom +(let.dom)
=. hit.dom (~(put by hit.dom) let.dom r.new.dat)
=. ank.dat (checkout-ankh:ze (~(uni by bop.dat) (mo can)))
=. ank.dat (checkout-ankh:ze (~(uni by bop.dat) p.can))
=. ank.dom ank.dat
?~ hez
(done:he ~)
@ -2230,44 +2119,30 @@
==
::
++ ergoed
|= res=(each gage tang)
|= res=gage
^+ +>
?: ?=(%| -.res)
(error:he %ergo-bad-made leaf/"merge ergo failed" p.res)
=+ cay=p.res
?@ p.cay ~| %patch-bad-marc !!
=| can=(list ,[path (unit mime)])
=>
|- ^+ +
?~ p.p.cay
+.$(can ~)
=+ tal=%_($ cay [[%tabl t.p.p.cay] (slot 3 q.cay)])
?: ?=(%| -.gon.dat.tal)
tal
?. ?=(%path p.i.p.p.cay)
+.$(+>.$ (error:he %patch-strange-marc-a >p.i.p.p.cay< ~))
?. ?=(@ q.i.p.p.cay)
+.$(+>.$ (error:he %patch-strange-marc-b >p.i.p.p.cay< ~))
=+ coy=(slot 2 q.cay)
?@ q.coy
+.$(+>.$ (error:he %patch-strange-coy ~))
%_ +.$
can
:_ can:tal
:- ((hard path) -.q.coy)
?. ?=(%mime q.i.p.p.cay)
~
`((hard mime) q:(slot 3 coy))
==
=+ tay=(gage-to-tage res)
?: ?=(%| -.tay)
(error:he %ergo-bad-made leaf/"merge ergo failed" p.tay)
=+ =| can=mick
|- ^- tan=$&(mick [p=term q=tang])
?~ p.tay can
=* pax p.i.p.tay
?. ?=(%path p.pax)
[%ergo >[%expected-path got=p.pax]< ~]
=* mim q.i.p.tay
=+ mit=?.(?=(%mime p.mim) ~ `((hard mime) q.q.mim))
$(p.tay t.p.tay, can :_(can [((hard path) q.q.pax) mit]))
?: ?=([@ *] tan) (error:he tan)
?~ hez
(error:he %ergo-no-hez ~)
?. syn
(error:he %ergo-sync-off ~)
?: ?=(%| -.gon.dat)
+>.$
%= +>.$
%_ +>.$
don %|
reg [[u.hez %ergo who syd let.dom can] reg]
reg [[u.hez %ergo who syd let.dom tan] reg]
==
::
++ he
@ -2691,12 +2566,10 @@
==
?: ?=([%blab care @ @ *] tea)
?> ?=(%made +<.q.hin)
?: ?=(%| -.q.q.hin)
?. ?=(%& -.q.q.hin)
~| %blab-fail
~> %mean.|.(p.q.q.hin) :: interpolate ford fail into stack trace
!!
?^ p.p.q.q.hin
~|(%bad-marc !!)
~> %mean.|.(?+(-.q.q.hin -.q.q.hin %| p.q.q.hin))
!! :: interpolate ford fail into stack trace
:_ ..^$ :_ ~
:* hen %give %writ ~
`[care case @tas]`[i.t.tea ((hard case) +>:(slay i.t.t.tea)) i.t.t.t.tea]
@ -2874,40 +2747,57 @@
^- soba
:- *cart
=| pax=path
:: =- ~& [%khan (turn - |=((pair path miso) [p -.q]))] -
|- ^- (list ,[p=path q=miso])
?~ ank
?~ kan
:: ~& >> [pax %ank-kan-sig]
~
:: ~& >> [pax %ank-sig]
=+ =+ (~(tap by dir.u.kan))
|-(?~(+< ~ (weld ^$(pax [p.i pax], kan `q.i) $(+< t))))
:: ~& [%dirukan pax=pax (~(run by dir.u.kan) (cury test ~))]
|- ^- (list (pair path miso))
?~ +< ~
?~ q.i $(+< t)
(weld ^$(pax [p.i pax], kan `u.q.i) $(+< t))
?~ fil.u.kan
-
?~ u.fil.u.kan
-
:: ~& >> [pax %ins-1]
[[(flop pax) %ins u.u.fil.u.kan] -]
?~ kan
:: ~& >> [pax %kan-sig]
=+ =+ (~(tap by r.u.ank))
|-(?~(+< ~ (weld ^$(pax [p.i pax], ank `q.i) $(+< t))))
?~ q.u.ank
-
[[(flop pax) %del q.u.q.u.ank] -]
:: ~& >> [pax %neither-sig]
=+ %+ weld
=+ (~(tap by r.u.ank))
|- ^- (list ,[p=path q=miso])
?~ +< ~
=+ (~(get by dir.u.kan) p.i)
?: ?=([~ ~] -) $(+< t)
%- weld :_ $(+< t)
^$(pax [p.i pax], ank `q.i, kan (~(get by dir.u.kan) p.i))
:: ~& >> [pax %ankhing p.i ?=(~ -)]
^$(pax [p.i pax], ank `q.i, kan ?~(- ~ `u.u.-))
=+ (~(tap by dir.u.kan))
:: ~& > [%sdirukan pax=pax (~(run by dir.u.kan) (cury test ~))]
|- ^- (list ,[p=path q=miso])
?~ +< ~
?~ q.i $(+< t)
?: (~(has by r.u.ank) p.i) $(+< t)
:: ~& >> [pax %khaning p.i]
%- weld :_ $(+< t)
^$(pax [p.i pax], kan `q.i, ank ~)
^$(pax [p.i pax], kan `u.q.i, ank ~)
?~ q.u.ank
?~ fil.u.kan
-
?~ u.fil.u.kan
-
:: ~& %ins-2
[[(flop pax) %ins u.u.fil.u.kan] -]
?~ fil.u.kan
-

View File

@ -16,6 +16,7 @@
== == ::
$: %e :: to self
$% [%this p=? q=clip r=httq] :: proxied request
[%meta vase:,[%them (unit httr)]] :: type check
== == ::
$: %f :: to %ford
$% [%exec p=@p q=beak r=(unit silk)] ::
@ -39,7 +40,7 @@
$% [%thou p=httr] :: response for proxy
== == ::
$: %f :: by %ford
$% [%made p=@uvH q=(each gage tang)] ::
$% [%made p=@uvH q=gage] ::
[%news ~] ::
== == ::
$: %t :: by %time
@ -53,6 +54,8 @@
$% [%at p=hole q=whir] :: authenticated
[%ay p=span:ship q=span:,@uvH ~] :: remote duct
[%he p=whir] :: HEAD request
[%hi p=mark ~] :: outbound HTTP
[%si ~] :: response done
[%of p=ixor q=$|(~ whir-of)] :: associated view
[%on p=span:,@uvH ~] :: dependency
[%to p=ixor q=span:ship r=term s=wire] :: associated app
@ -478,6 +481,20 @@
q.ask (~(put by q.ask) p.ask hen u.p.kyz)
kes (~(put by kes) hen p.ask)
==
::
%hiss :: outbound cage
::?~ p.kyz :: XX cancel
:: =+ sud=(need (~(get by kes) hen))
:: %= +>.$
:: mow :_(mow [ged [%give %thus sud ~]])
:: q.ask (~(del by q.ask) sud)
:: kes (~(del by kes) hen)
:: ==
:: ~& eyre-them/(earn p.u.p.kyz)
%+ pass-note hi//[p.kyz]
?: ?=(%hiss p.q.kyz)
[%e %meta :(slop !>(%them) !>(~) q.q.kyz)]
(ford-req root-beak [%cast %hiss %done ~ q.kyz])
::
%they :: inbound response
=+ kas=(need (~(get by q.ask) p.kyz))
@ -539,8 +556,12 @@
::
%went +>.$
%thou
?> ?=([%ay ^] tee)
(ames-gram (slav %p p.tee) got/~ (slav %uv q.tee) |2.sih)
?+ -.tee !!
%ay (ames-gram (slav %p p.tee) got/~ (slav %uv q.tee) |2.sih)
%hi =+ cay=[%httr !>(`httr`p.sih)]
?: ?=(%httr p.tee) (give-sigh ~ cay)
(pass-note si/~ (ford-req root-beak [%cast p.tee %done `cay]))
==
::
%unto :: XX horrible
=+ cuf=`cuft`+>.sih
@ -577,11 +598,18 @@
==
::
%made
?> ?=(?([%| *] [%& @ *]) q.sih)
?< ?=(%tabl -.q.sih)
=. our (need hov) :: XX
|- ^+ ..axon
?- tee
[?(%on %ay) *] ~|(e/ford/lost/-.tee !!)
[%si ~] (give-sigh q.sih)
[%hi ^]
?: ?=(%| -.q.sih)
(give-sigh q.sih) :: XX crash?
=* cay p.q.sih
?> ?=(%hiss p.cay)
(pass-note tee [%e %meta :(slop !>(%them) !>(~) q.cay)])
[%he *] :: XX hack
=. ..axon $(tee p.tee)
%_ ..axon
@ -696,6 +724,12 @@
+>(ded (~(del in ded) hen))
+>(mow :_(mow [hen %give %thou hit]))
::
++ give-sigh :: userspace done
|= res=(each cage tang)
=- +>.$(mow :_(mow [hen %give %sigh `cage`-]))
?. ?=(%| -.res) p.res
[%tang !>(p.res)]
::
++ mean-json |=([sas=@uG err=ares] (give-json sas ~ (ares-to-json err)))
++ nice-json |=(* (give-json 200 ~ (joba %ok %b &)))
::
@ -1014,6 +1048,8 @@
=+ ext=(fall p.pok %urb)
=+ bem=?-(-.hem %beam p.hem, %spur [root-beak p.hem])
=+ wir=?+(mef !! %get ~, %head [%he ~])
~| bad-beam/q.bem
?< =([~ 0] (sky %cw (tope bem(+ ~, r [%da now]))))
=- ?.(aut [%& %| -] [%| (pass-note -)]) :: XX properly
[wir (ford-get-beam bem ext)]
::
@ -1202,6 +1238,7 @@
++ foreign-auth
|= [him=ship pul=purl] ^+ ..ya
=. way (~(put by way) him pul hen)
~& asking-foreign/him
(ames-gram:abet him [lon/~ ses])
::
++ foreign-hat

View File

@ -55,7 +55,7 @@
dep=(set beam) :: dependencies
== ::
++ calx :: concrete cache line
$% [%hood p=calm q=(pair beam gage) r=hood] :: compile
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile
[%bake p=calm q=(trel mark beam heel) r=(unit vase)]:: load
[%slit p=calm q=[p=type q=type] r=type] :: slam type
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
@ -105,8 +105,21 @@
^- cafe ::
[(grom p.a p.b) (grum q.a q.b)] ::
:: ::
++ faun |=([a=cafe b=vase] (fine a `gage`[%noun b])) :: vase to cage
++ feel |=([a=cafe b=gage] (fine a q.b)) :: cage to vase
++ faun |=([a=cafe b=vase] (fine a [%& %noun b])) :: vase to gage
++ feel |=([a=cafe b=cage] (fine a q.b)) :: cage to vase
++ furl :: unwrap gage to cage
|= [a=cafe b=gage] ^- (bolt cage)
?- -.b
%tabl (flaw a >%bad-marc< ~)
%| (flaw a p.b)
%& (fine a p.b)
==
::
++ fret :: lift error
|= a=(bolt gage) ^- (bolt gage)
?. ?=(%2 -.q.a) a
[p.a [%0 p.q.a `gage`[%| q.q.a]]]
::
++ fest :: bolt to success
|= a=beam ::
|*([b=cafe c=*] (flag a (fine b [~ u=c]))) ::
@ -413,6 +426,23 @@
==
fun
::
++ tabl-run :: apply to all elems
|= fun=(burg cage gage)
|= [cof=cafe gag=gage]
^- (bolt gage)
?. ?=(%tabl -.gag)
(cope (furl cof gag) fun)
%+ cope
|- ^- (bolt (list (pair gage gage)))
?~ p.gag (fine cof ~)
%+ cope (fret ^$(gag q.i.p.gag))
|= [cof=cafe val=gage]
%+ cope ^$(p.gag t.p.gag)
|= [cof=cafe rex=(list (pair gage gage))]
(fine cof [[p.i.p.gag val] rex])
|= [cof=cafe rex=(list (pair gage gage))]
(fine cof %tabl rex)
::
++ dash :: process cache
|= cof=cafe
^+ +>
@ -424,17 +454,15 @@
%. [cof kas kos]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] (make cof p))
|=([cof=cafe p=silk q=silk] (make cof q))
|=([cof=cafe p=silk q=silk] (cope (make cof p) furl))
|=([cof=cafe p=silk q=silk] (cope (make cof q) furl))
==
|= [cof=cafe cay=gage coy=gage]
?. &(?=(@ p.cay) ?=(@ p.coy))
(flaw cof leaf/"bad diff marc" ~)
|= [cof=cafe cay=cage coy=cage]
?. =(p.cay p.coy)
%+ flaw cof :_ ~
leaf/"diff on data of different marks: {(trip p.cay)} {(trip p.coy)}"
?: =(q.q.cay q.q.coy)
(fine cof %null [%atom %n] ~)
(fine cof %& %null [%atom %n] ~)
%+ cope (fang cof p.cay)
|= [cof=cafe pro=vase]
?. (slab %grad p.pro)
@ -461,7 +489,7 @@
=+ for=((soft ,@tas) q:(slap gar [%cnzy %form]))
?~ for
(flaw cof leaf/"bad ++form:grad" ~)
(fine cof u.for dif)
(fine cof %& u.for dif)
==
::
++ daze :: remember depends
@ -480,7 +508,7 @@
=. ..exec (dash p.bot)
?- -.q.bot
%0 =^ dep deh.bay (daze p.q.bot)
amok:(expo [%made dep %& q.q.bot])
amok:(expo [%made dep q.q.bot])
%2 =^ dep deh.bay (daze p.q.bot)
amok:(expo [%made dep %| q.q.bot])
%1 =+ zuk=(~(tap by p.q.bot) ~)
@ -499,11 +527,11 @@
|= [cof=cafe for=mark bem=beam]
^- (bolt hood)
%+ cool |.(leaf/"ford: fade {<[(tope bem)]>}")
%+ cope (make cof [%bake for bem ~])
|= [cof=cafe cay=gage]
%+ cope (cope (make cof [%bake for bem ~]) furl)
|= [cof=cafe cay=cage]
%+ (clef %hood) (fine cof bem(r [%ud 0]) cay)
^- (burg (pair beam gage) hood)
|= [cof=cafe bum=beam cay=gage]
^- (burg (pair beam cage) hood)
|= [cof=cafe bum=beam cay=cage]
:: ~& fade/clef-miss/bem
=+ rul=(fair bum)
?. ?=(@ q.q.cay)
@ -678,12 +706,10 @@
%. [cof kas kos]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] (make cof p))
|=([cof=cafe p=silk q=silk] (make cof q))
|=([cof=cafe p=silk q=silk] (cope (make cof p) furl))
|=([cof=cafe p=silk q=silk] (cope (make cof q) furl))
==
|= [cof=cafe cay=gage coy=gage]
?. &(?=(@ p.cay) ?=(@ p.coy))
(flaw cof leaf/"bad join marc: {<p.cay>} {<p.coy>}" ~)
|= [cof=cafe cay=cage coy=cage]
%+ cope (fang cof for)
|= [cof=cafe pro=vase]
?. (slab %grad p.pro)
@ -704,7 +730,7 @@
leaf/"join on data of bad marks: {(trip p.cay)} {(trip p.coy)}"
leaf/"expected mark {(trip u.fom)}"
?: =(q.q.cay q.q.coy)
(fine cof cay)
(fine cof %& cay)
?. (slab %join p.gar)
(flaw cof leaf/"no ++join:grad" ~)
%+ cope
@ -713,8 +739,8 @@
(slop q.cay q.coy)
|= [cof=cafe dif=vase]
?@ q.dif
(fine cof %null dif)
(fine cof u.fom (slot 3 dif))
(fine cof %& %null dif)
(fine cof %& u.fom (slot 3 dif))
==
::
++ mash
@ -723,12 +749,10 @@
%. [cof r.mas r.mos]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] (make cof p))
|=([cof=cafe p=silk q=silk] (make cof q))
|=([cof=cafe p=silk q=silk] (cope (make cof p) furl))
|=([cof=cafe p=silk q=silk] (cope (make cof q) furl))
==
|= [cof=cafe cay=gage coy=gage]
?. &(?=(@ p.cay) ?=(@ p.coy))
(flaw cof leaf/"bad mash marc: {<p.cay>} {<p.coy>}" ~)
|= [cof=cafe cay=cage coy=cage]
%+ cope (fang cof for)
|= [cof=cafe pro=vase]
?. (slab %grad p.pro)
@ -750,9 +774,9 @@
leaf/"mash on data of bad marks: {(trip p.cay)} {(trip p.coy)}"
leaf/"expected mark {(trip u.fom)}"
?: =(q.q.cay q.q.coy)
(fine cof cay)
(fine cof %& cay)
?. (slab %mash p.gar)
(fine cof %null [%atom %n] ~)
(fine cof %& %null [%atom %n] ~)
%+ cope
%^ maul cof
(slap (slap pro [%cnzy %grad]) [%cnzy %mash])
@ -763,7 +787,7 @@
q.coy
==
|= [cof=cafe dif=vase]
(fine cof u.fom dif)
(fine cof %& u.fom dif)
==
::
++ kale :: mutate
@ -772,17 +796,18 @@
%+ cope
|- ^- (bolt (list (pair wing vase)))
?~ muy (flue cof)
%+ cope (make cof q.i.muy)
|= [cof=cafe cay=gage]
%+ cope (cope (make cof q.i.muy) furl)
|= [cof=cafe cay=cage]
%+ cope ^$(muy t.muy)
|= [cof=cafe rex=(list (pair wing vase))]
(fine cof [[p.i.muy q.cay] rex])
|= [cof=cafe yom=(list (pair wing vase))]
%+ cope (make cof kas)
|= [cof=cafe cay=gage]
%- tabl-run
|= [cof=cafe cay=cage]
%+ cope (keel cof q.cay yom)
|= [cof=cafe vax=vase]
(fine cof p.cay vax)
(fine cof %& p.cay vax)
::
++ keel :: apply mutations
|= [cof=cafe suh=vase yom=(list (pair wing vase))]
@ -872,13 +897,13 @@
::
++ lear :: load vase
|= [cof=cafe bem=beam]
^- (bolt cage)
^- (bolt gage)
=+ von=(save ~ %cx bem)
?~ von
[p=*cafe q=[%1 [[%x bem ~] ~ ~]]]
?~ u.von
(flaw cof leaf/"lear: file unavailable" (smyt (tope bem)) ~)
(fine cof u.u.von)
(fine cof %& u.u.von)
::
++ lend :: load arch
|= [cof=cafe bem=beam]
@ -929,8 +954,8 @@
%+ cope (lion cof for haz)
|= [cof=cafe wuy=(list ,@tas)]
?~ wuy (flue cof)
%+ cope (make cof %bake i.wuy bem arg)
|= [cof=cafe hoc=gage]
%+ cope (cope (make cof %bake i.wuy bem arg) furl)
|= [cof=cafe hoc=cage]
%+ cope (lope cof i.wuy t.wuy q.hoc)
|= [cof=cafe vax=vase]
((fest bem) cof vax)
@ -1040,12 +1065,12 @@
%. [cof p.kas q.kas]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas p.kas))
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas q.kas))
==
|=([cof=cafe p=silk q=silk] (cope ^$(cof cof, kas p.kas) furl))
|=([cof=cafe p=silk q=silk] (cope ^$(cof cof, kas q.kas) furl))
== :: XX merge %tabl
::
|= [cof=cafe bor=gage heg=gage] ^- (bolt gage)
[p=cof q=[%0 ~ [%$ (slop q.bor q.heg)]]]
|= [cof=cafe bor=cage heg=cage] ^- (bolt gage)
(faun cof (slop q.bor q.heg))
==
::
%bake
@ -1055,7 +1080,7 @@
|= [cof=cafe vux=(unit vase)]
?~ vux
(flaw cof leaf/"bake failed" (smyt (tope q.kas)) ~)
(fine cof [p.kas u.vux])
(fine cof [%& p.kas u.vux])
::
%boil
^- (bolt gage)
@ -1064,49 +1089,48 @@
|= [cof=cafe bem=beam]
%+ cope (lime cof p.kas bem r.kas)
|= [cof=cafe vax=vase]
(fine cof `gage`[p.kas vax])
(fine cof `gage`[%& p.kas vax])
::
%bunt
%+ cool |.(leaf/"ford: bunt {<p.kas>}")
?: ?=(?(%hoon %hook) p.kas)
(fine cof p.kas [%atom %t] '')
(fine cof %& p.kas [%atom %t] '')
%+ cope (fang cof p.kas)
|= [cof=cafe tux=vase]
(fine cof [p.kas (slot 6 tux)])
(fine cof [%& p.kas (slot 6 tux)])
::
%call
:: %+ cool |.(leaf/"ford: call {<`@p`(mug kas)>}")
%. [cof p.kas q.kas]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas p))
|=([cof=cafe p=silk q=silk] (cope ^$(cof cof, kas p) furl))
|=([cof=cafe p=silk q=silk] ^$(cof cof, kas q))
==
::
|= [cof=cafe gat=gage sam=gage]
(maul cof q.gat q.sam)
::
|= [cof=cafe vax=vase]
(fine cof %noun vax)
|= [cof=cafe gat=cage sam=gage]
%. [cof sam]
%- tabl-run
|= [cof=cafe sam=cage]
(cope (maul cof q.gat q.sam) faun)
==
::
%cast
%+ cool |.(leaf/"ford: cast {<p.kas>}")
%+ cope $(kas q.kas)
|= [cof=cafe cay=gage]
%- tabl-run
|= [cof=cafe cay=cage]
^- (bolt gage)
%+ cool |.(leaf/"ford: casting {<p.cay>} to {<p.kas>}")
?. ?=(@ p.cay)
(flaw cof leaf/"bad cast marc" ~)
%+ cope (link cof p.kas p.cay q.cay)
|= [cof=cafe vax=vase]
(fine cof [p.kas vax])
(fine cof [%& p.kas vax])
::
%diff
%+ cool |.(leaf/"ford: diff {<`@p`(mug p.kas)>} {<`@p`(mug q.kas)>}")
(diff cof p.kas q.kas)
::
%done [cof %0 p.kas q.kas]
%done [cof %0 p.kas %& q.kas]
%dude (cool |.(p.kas) $(kas q.kas))
%dune
?~ q.kas [cof [%2 p.kas [%leaf "no data"]~]]
@ -1142,46 +1166,44 @@
%+ cool |.(leaf/"ford: pact {<`@p`(mug p.kas)>} {<`@p`(mug q.kas)>}")
(pact cof p.kas q.kas)
::
%plan
%+ cope (abut:(meow p.kas q.kas) cof r.kas)
|= [cof=cafe vax=vase]
(fine cof %noun vax)
::
%reef (fine cof %noun pit)
%plan (cope (abut:(meow p.kas q.kas) cof r.kas) faun)
%reef (faun cof pit)
%ride
%+ cool |.(leaf/"ford: ride {<`@p`(mug kas)>}")
%+ cope $(kas q.kas)
|= [cof=cafe cay=gage]
%- tabl-run
|= [cof=cafe cay=cage]
%+ cope (maim cof q.cay p.kas)
|= [cof=cafe vax=vase]
(fine cof %noun vax)
(faun cof vax)
::
%tabl
%+ cope
|- ^- (bolt (pair (list (pair marc marc)) vase))
?~ p.kas (fine cof ~ *vase)
|- ^- (bolt (list (pair gage gage)))
?~ p.kas (fine cof ~)
%+ cope (make cof p.i.p.kas)
|= [cof=cafe key=gage]
%+ cope (make cof q.i.p.kas)
|= [cof=cafe val=gage]
%+ cope ^^$(p.kas t.p.kas)
|= [cof=cafe rex=(list (pair marc marc)) rey=vase]
(fine cof [[p.key p.val] rex] (slop (slop q.key q.val) rey))
|= [cof=cafe rex=(list (pair marc marc)) rey=vase]
(fine cof [%tabl rex] rey)
|= [cof=cafe rex=(list (pair gage gage))]
(fine cof [[key val] rex])
|= [cof=cafe rex=(list (pair gage gage))]
(fine cof [%tabl rex])
::
%vale
%+ cool |.(leaf/"ford: vale {<p.kas>} {<q.kas>} {<`@p`(mug r.kas)>}")
%+ cope (lave cof p.kas q.kas r.kas)
|= [cof=cafe vax=vase]
(fine cof `cage`[p.kas vax])
(fine cof `gage`[%& p.kas vax])
::
%volt
%+ cool |.(leaf/"ford: volt {<p.q.kas>}")
%+ cope $(kas [%bunt p.q.kas])
|= [cof=cafe cay=gage]
%- tabl-run
|= [cof=cafe cay=cage]
^- (bolt gage)
[cof %0 p.kas p.q.kas p.q.cay q.q.kas]
[cof %0 p.kas %& p.q.kas p.q.cay q.q.kas]
==
::
++ malt :: cached slit
@ -1403,7 +1425,7 @@
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
(fine cof [p.tug q.vax])
::
%toy (cope (make cof %boil p.hon how ~) feel)
%toy (cope (cope (make cof %boil p.hon how ~) furl) feel)
==
::
++ head :: consume structures
@ -1511,12 +1533,10 @@
%. [cof kas kos]
;~ cope
;~ coax
|=([cof=cafe p=silk q=silk] (make cof p))
|=([cof=cafe p=silk q=silk] (make cof q))
|=([cof=cafe p=silk q=silk] (cope (make cof p) furl))
|=([cof=cafe p=silk q=silk] (cope (make cof q) furl))
==
|= [cof=cafe cay=gage coy=gage]
?. &(?=(@ p.cay) ?=(@ p.coy))
(flaw cof leaf/"bad pact marc" ~)
|= [cof=cafe cay=cage coy=cage] ^- (bolt gage)
?: ?=(?(%hoon %hook) p.cay)
?. ?=(%txt-diff p.coy)
(flaw cof leaf/"{<p.cay>} mark with bad diff type: {<p.coy>}" ~)
@ -1528,7 +1548,7 @@
=- (flaw cof leaf/"{<p.cay>} data with bad diff" -)
[>type=p.q.coy< >shouldbe=-:!>(*(urge cord))< ~]
=+ pac=(role (lurk (lore (cat 3 u.txt '\0a')) u.dif))
(fine cof p.cay [%atom %t] (end 3 (dec (met 3 pac)) pac))
(fine cof %& p.cay [%atom %t] (end 3 (dec (met 3 pac)) pac))
%+ cope (fang cof p.cay)
|= [cof=cafe pro=vase]
?. (slab %grad p.pro)
@ -1557,7 +1577,7 @@
(slap (slap pox [%cnzy %grad]) [%cnzy %pact])
q.coy
|= [cof=cafe pat=vase]
(fine cof p.cay pat)
(fine cof %& p.cay pat)
==
::
++ resp
@ -1622,8 +1642,8 @@
~
::
++ load :: highly forgiving
|= old=axle
..^$(+>- old)
:: |= old=axle
:: ..^$(+>- old)
::=. old
:: ?. ?=([%0 *] old) old :: remove at 1
:: :- %1
@ -1632,12 +1652,13 @@
:: ?> ?=([n=[p=* q=[tad=* dym=* deh=* jav=*]] l=* r=*] +.old)
:: :- [p.n.+.old [tad.q.n.+.old dym.q.n.+.old deh.q.n.+.old ~]]
:: [$(+.old l.+.old) $(+.old r.+.old)]
:: =+ lox=((soft axle) old)
:: ^+ ..^$
:: ?~ lox
:: ~& %ford-reset
:: ..^$
:: ..^$(+>- u.lox)
|= old=*
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
~& %ford-reset
..^$
..^$(+>- u.lox)
::
++ scry
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]

View File

@ -22,6 +22,7 @@
++ cote :: ++ap note
$% [%meta p=@tas q=vase] ::
[%send p=ship q=cush] ::
[%hiss p=mark q=cage]
== ::
++ cove (pair bone (mold cote cuft)) :: internal move
++ move ,[p=duct q=(mold note-arvo gift-arvo)] :: typed move
@ -130,9 +131,10 @@
(~(nest ut -:!>(*bowl)) %| p:(slot 12 vax))
::
++ mo-boom :: complete new boot
|= [dap=dude pup=scup dep=@uvH gux=(each gage tang)]
|= [dap=dude pup=scup dep=@uvH gux=gage]
^+ +>
?- -.gux
%tabl ~|(%made-tabl !!)
%|
=. +> (mo-bold pup dap dep)
=. +> (mo-give %onto %| p.gux)
@ -169,13 +171,14 @@
==
::
++ mo-boon :: complete old boot
|= [dap=dude pup=scup dep=@uvH gux=(each gage tang)]
|= [dap=dude pup=scup dep=@uvH gux=gage]
^+ +>
?. (~(has by bum) dap)
~& [%gall-old-boon dap]
+>
=. +> (mo-bold pup dap dep)
?- -.gux
%tabl ~|(%made-tabl !!)
%| (mo-give %onto %| p.gux)
%& ?> ?=(@ p.p.gux)
ap-abet:(ap-peep:(ap-abed:ap dap [%high [~ our]]) q.p.gux)
@ -325,9 +328,9 @@
num=(slav %ud i.t.t.t.pax)
==
?- -.q.+>.sih
%tabl ~|(%made-tabl !!)
%| (mo-give %mack `p.q.+>.sih) :: XX should crash
%& ?> ?=(@ p.p.q.+>.sih)
=. +>.$ (mo-give %mack ~) :: XX pump should ack
%& =. +>.$ (mo-give %mack ~) :: XX pump should ack
(mo-give(hen (mo-ball him num)) %unto %diff `cage`p.q.+>.sih)
==
::
@ -339,9 +342,9 @@
==
?: ?=([%f %made *] sih)
?- -.q.+>.sih
%tabl ~|(%made-tabl !!)
%| (mo-give %mack `p.q.+>.sih) :: XX should crash
%& ?> ?=(@ p.p.q.+>.sih)
(mo-pass [%sys pax] %g %deal [him our] i.t.t.pax %poke p.q.+>.sih)
%& (mo-pass [%sys pax] %g %deal [him our] i.t.t.pax %poke p.q.+>.sih)
==
?: ?=([%a %woot *] sih) +>.$ :: quit ack, boring
?> ?=([%g %unto *] sih)
@ -368,7 +371,7 @@
++ mo-cook :: take in /use
|= [pax=path hin=(hypo sign-arvo)]
^+ +>
?. ?=([@ @ ?(%inn %out) *] pax)
?. ?=([@ @ ?(%inn %out %enn) *] pax)
~& [%mo-cook-bad-pax pax]
!!
=+ dap=`@tas`i.pax
@ -376,7 +379,13 @@
=+ pap=(ap-abed:ap dap pry)
=+ vax=(slot 3 `vase`hin)
?- i.t.t.pax
%inn ap-abet:(ap-pour:pap t.t.t.pax (slot 3 `vase`hin))
%inn ap-abet:(ap-pour:pap t.t.t.pax (slot 3 `vase`hin))
%enn ?. ?=([%e %sigh *] q.hin)
~& [%mo-cook-weird q.hin]
~& [%mo-cook-weird-path pax]
+>.$
ap-abet:(ap-sigh:pap t.t.t.pax +>.q.hin)
::
%out ?. ?=([%g %unto *] q.hin)
~& [%mo-cook-weird q.hin]
~& [%mo-cook-weird-path pax]
@ -508,6 +517,7 @@
%pass
:+ %pass `path`[%use dap p.q.cov]
?- -.q.q.cov
%hiss `note-arvo`[%e %hiss p.q.q.cov q.q.q.cov]
%send `note-arvo`[%g %deal [our p.q.q.cov] q.q.q.cov]
%meta `note-arvo`[`@tas`p.q.q.cov %meta `vase`q.q.q.cov]
==
@ -649,6 +659,7 @@
?+ +<.q.vax
(ap-move-pass -.q.vax +<.q.vax cav)
%diff (ap-move-diff -.q.vax cav)
%hiss (ap-move-hiss -.q.vax cav)
%peer (ap-move-peer -.q.vax cav)
%pull (ap-move-pull -.q.vax cav)
%poke (ap-move-poke -.q.vax cav)
@ -670,6 +681,21 @@
[%| (ap-suck "move: improper diff")]
[%& sto %give %diff `cage`[-.q.vax (slot 3 (spec vax))]]
::
++ ap-move-hiss :: pass %hiss
|= [sto=bone vax=vase]
^- (each cove tang)
?. &(?=([p=* q=@ q=^] q.vax) ((sane %tas) q.q.vax))
[%| (ap-suck "move: malformed hiss ask.[%hiss path mark cage]")]
=+ gaw=(slot 7 vax)
?. &(?=([p=@ q=^] q.gaw) ((sane %tas) p.q.gaw))
[%| (ap-suck "move: malformed cage")]
=+ pux=((soft path) p.q.vax)
?. &(?=(^ pux) (levy u.pux (sane %ta)))
[%| (ap-suck "move: malformed path")]
:^ %& sto %pass
:- [(scot %p q.q.pry) %enn u.pux]
[%hiss q.q.vax [p.q.gaw (slot 3 (spec gaw))]]
::
++ ap-move-mess :: extract path, target
|= vax=vase
^- (each (trel path ship term) tang)
@ -810,7 +836,8 @@
^+ +>
=+ cug=(ap-find /lame)
?~ cug
~& [%ap-lame wut why]
=. why (turn why |=(a=tank rose/[~ "! " ~]^[a]~))
~> %slog.`rose/[" " "[" "]"]^[>%ap-lame< >wut< why]
+>.$
=^ cam +>.$
%+ ap-call q.u.cug
@ -835,6 +862,22 @@
?^ cam (ap-lame -.q.vax u.cam)
+>.$
::
++ ap-sigh :: http response
|= [pax=path cag=cage]
^+ +>
=. q.cag (spec q.cag)
=+ cug=(ap-find [%sigh p.cag pax])
?~ cug
(ap-lame %sigh (ap-suck "sigh: no {<`path`[p.cag pax]>}"))
=+ ^= arg ^- vase
%- slop
?: =(0 p.u.cug)
[!>([`@ud`ost `@p`q.q.pry `path`pax]) !>(cag)]
[!>([`@ud`ost `@p`q.q.pry (slag (dec p.u.cug) `path`pax)]) q.cag]
=^ cam +>.$ (ap-call q.u.cug arg)
?^ cam (ap-lame q.u.cug u.cam)
+>.$
::
++ ap-pout :: specific take
|= [pax=path cuf=cuft]
^+ +>
@ -985,6 +1028,7 @@
%merg `%c
%plug `%c
%them `%e
%hiss `%e
%want `%a
==
--

View File

@ -3705,11 +3705,12 @@
royl
==
--
++ scot |=(mol=dime ~(rent co %$ mol))
++ scot ~/ %scot |=(mol=dime ~(rent co %$ mol))
++ scow |=(mol=dime ~(rend co %$ mol))
++ slat |=(mod=@tas |=(txt=@ta (slaw mod txt)))
++ slav |=([mod=@tas txt=@ta] (need (slaw mod txt)))
++ slaw
~/ %slaw
|= [mod=@tas txt=@ta]
^- (unit ,@)
=+ con=(slay txt)
@ -8429,30 +8430,34 @@
$(i.ruw t.i.ruw, cah [i.i.ruw cah])
$(i.ruw t.i.ruw, cah ~, yun [p.i.i.ruw (wod cah yun)])
::
++ posh
++ posh !:
|= [pre=(unit tyke) pof=(unit ,[p=@ud q=tyke])]
^- (list twig)
~| %posh-fail
^- (unit (list twig))
=- ?^(- - ~&(%posh-fail -))
=+ wom=(poof wer)
=+ ^= yez
?~ pre wom
=+ moz=(poon wom u.pre)
?~(pof moz (weld moz (slag (lent u.pre) wom)))
?~ pof yez
%+ biff
?~ pre `u=wom
%+ bind (poon wom u.pre)
|= moz=(list twig)
?~(pof moz (weld moz (slag (lent u.pre) wom)))
|= yez=(list twig)
?~ pof `yez
=+ zey=(flop yez)
=+ [moz=(scag p.u.pof zey) gul=(slag p.u.pof zey)]
(weld (flop gul) (poon (flop moz) q.u.pof))
=+ zom=(poon (flop moz) q.u.pof)
?~(zom ~ `(weld (flop gul) u.zom))
::
++ poof |=(pax=path ^-(tusk (turn pax |=(a=@ta [%dtzy %ta a]))))
++ poon
|= [pag=tusk goo=tyke]
^- tusk
?~ goo ~
:- ?^(i.goo u.i.goo ?>(?=(^ pag) i.pag))
^- (unit tusk)
?~ goo `~
%+ both
?^(i.goo i.goo ?~(pag ~ `u=i.pag))
$(goo t.goo, pag ?~(pag ~ t.pag))
::
++ poor
%+ cook posh
%+ sear posh
;~ plug
(stag ~ gash)
;~(pose (stag ~ ;~(pfix cen porc)) (easy ~))
@ -8750,13 +8755,13 @@
:- '%'
;~ pfix cen
;~ pose
(cook |=([a=@ud b=tyke] [%clsg (posh ~ ~ a b)]) porc)
(stag %clsg (sear |=([a=@ud b=tyke] (posh ~ ~ a b)) porc))
(stag %dtzz (stag %tas (cold %$ buc)))
(stag %dtzz (stag %f (cold & pam)))
(stag %dtzz (stag %f (cold | bar)))
(stag %dtzz (stag %t qut))
(cook (jock &) nuck:so)
(cook |=(a=(list) [%clsg (posh ~ ~ (lent a) ~)]) (star cen))
(stag %clsg (sear |=(a=(list) (posh ~ ~ (lent a) ~)) (star cen)))
:: (easy [%clsg (poof wer)])
==
==
@ -9618,7 +9623,6 @@
== ::
++ curd ,[p=@tas q=*] :: typeless card
++ duct (list wire) :: causal history
++ gage (pair marc vase) :: structured cage
++ hypo |*(a=$+(* *) (pair type a)) :: type associated
++ hobo |* a=$+(* *) :: kiss wrapper
$? $% [%soft p=*] ::

View File

@ -29,6 +29,7 @@
++ raze
|= tym=[p=clok q=clok]
^+ tym
?~ p.tym tym
?~ q.tym tym
?: (gth p:~(get up p.tym) p:~(get up q.tym)) :: killed nonexisting
~& [%snooze-lost del=p:~(get up q.tym) top=p:~(get up p.tym)]
@ -182,6 +183,8 @@
|- ^+ [*(list move) tym]
=. tym (raze tym)
?: =([~ ~] tym) [~ tym] :: XX TMI
?: =(~ p.tym)
~& %weird-wake [~ tym]
=+ nex=~(get up p.tym)
?: (lte now p.nex) [~ tym]
=^ mof tym $(p.tym ~(pop up p.tym))

View File

@ -2316,7 +2316,7 @@
::
++ khan ::
$: fil=(unit (unit cage)) :: XX see khan-to-soba
dir=(map ,@ta khan) ::
dir=(map ,@ta (unit khan)) ::
== ::
++ mick (list ,[path (unit mime)])
++ riff ,[p=desk q=(unit rave)] :: request/desist
@ -2439,6 +2439,7 @@
++ kiss-eyre :: in request ->$
$% [%born ~] :: new unix process
[%crud p=@tas q=(list tank)] :: XX rethink
[%hiss p=mark q=cage] :: outbound user req
[%init p=@p] :: report install
[%them p=(unit hiss)] :: outbound request
[%they p=@ud q=httr] :: inbound response
@ -2449,6 +2450,7 @@
== ::
++ gift-eyre :: out result <-$
$% [%mass p=mass] :: memory usage
[%sigh p=cage] :: marked http response
[%thou p=httr] :: raw http response
[%thus p=@ud q=(unit hiss)] :: http request/cancel
[%veer p=@ta q=path r=@t] :: drop-through
@ -2496,9 +2498,9 @@
[%call p=silk q=silk] :: slam
[%cast p=mark q=silk] :: translate
[%diff p=silk q=silk] :: diff
[%done p=(set beam) q=gage] :: literal
[%done p=(set beam) q=cage] :: literal
[%dude p=tank q=silk] :: error wrap
[%dune p=(set beam) q=(unit gage)] :: unit literal
[%dune p=(set beam) q=(unit cage)] :: unit literal
[%file p=beam] :: from clay
[%flag p=@uvH q=silk] :: re-apply user deps
[%join p=mark q=silk r=silk] :: merge
@ -2513,8 +2515,13 @@
[%volt p=(set beam) q=(cask ,*)] :: unsafe add type
== ::
::::
++ gage :: recursive cage/tang
$% [%& p=cage] :: success
[%| p=tang] :: error
[%tabl p=(list (pair gage gage))] :: table of results
==
++ gift-ford :: out result <-$
$% [%made p=@uvH q=(each gage tang)] :: computed result
$% [%made p=@uvH q=gage] :: computed result
[%mass p=mass] :: memory usage
[%news ~] :: fresh depends
== ::

View File

@ -0,0 +1,9 @@
::
::::
::
/? 310
::
:::::
!:
|= [^ [arg=tape ~] ~]
purl/(scan arg auri:epur)

View File

@ -9,4 +9,4 @@
[arg=[syd=@tas her=@p sud=@tas ~] ~]
==
:- %hood-sync
arg
[syd her sud]:arg

View File

@ -168,8 +168,8 @@
==
++ sp-well
;~ pose
(stag %home sym)
;~(plug sym ;~(pfix fas sym))
(stag %home sym)
==
++ sp-wells (most ;~(plug com ace) sp-well)
--

View File

@ -57,8 +57,6 @@
$% [%talk-command command:talk] ::
[%hood-merge hood-merge] ::
== ::
++ tage :: %tabl gage
,[[%tabl p=(list (pair marc marc))] q=vase] ::
++ move (pair bone card) :: user-level move
--
|_ moz=(list move)
@ -89,7 +87,7 @@
abet:abet:(mere:(take way) are)
::
++ take-made ::
|= [way=wire dep=@uvH reg=(each gage tang)]
|= [way=wire dep=@uvH reg=gage]
abet:abet:(made:(take way) dep reg)
::
++ take-coup-fancy ::
@ -117,22 +115,42 @@
~| %kiln-work-fail
!!
::
++ gage-to-tage ::
|= res=gage
^- tage
?@ p.res
~|(%bad-marc !!)
res
++ ford-fail
|= tan=tang
~| %ford-fail
|-
?~ tan !!
~> %mean.|.(i.tan) :: interpolate into stack trace
$(tan t.tan)
::
++ tage-to-cages ::
|= tab=tage
^- (list (pair cage cage))
?~ p.tab
~
:_ $(p.tab t.p.tab, q.tab (slot 3 q.tab))
~| %strange-gage
:- [?^(p.i.p.tab !! p.i.p.tab) (slot 4 q.tab)]
[?^(q.i.p.tab !! q.i.p.tab) (slot 5 q.tab)]
++ unwrap-tang
|* res=(each ,* tang)
?: ?=(%& -.res)
p.res
(ford-fail p.res)
::
++ gage-to-cages
|= gag=gage ^- (list (pair cage cage))
(unwrap-tang (gage-to-tage gag))
::
++ gage-to-tage
|= gag=gage
^- (each (list (pair cage cage)) tang)
?. ?=(%tabl -.gag)
(mule |.(`~`(ford-fail >%strange-gage< ~)))
=< ?+(. [%& .] [@ *] .)
|- ^- ?((list ,[cage cage]) (each ,~ tang))
?~ p.gag ~
=* hed i.p.gag
?- -.p.hed
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
%| (mule |.(`~`(ford-fail p.p.hed)))
%& ?- -.q.hed
%tabl (mule |.(`~`(ford-fail >%strange-gage< ~)))
%| (mule |.(`~`(ford-fail p.q.hed)))
%& =+ $(p.gag t.p.gag)
?+(- [[p.p p.q]:hed -] [@ *] -)
== ==
::
++ perform ::
^+ .
@ -260,13 +278,13 @@
==
::
++ made
|= [dep=@uvH reg=(each gage tang)]
|= [dep=@uvH reg=gage]
^+ +>
?: ?=(%| -.reg)
=+ "failed to mash"
lose:(spam leaf/- p.reg)
=+ ^- can=(list (pair path (unit miso)))
%+ turn (tage-to-cages (gage-to-tage p.reg))
%+ turn (gage-to-cages reg)
|= [pax=cage dif=cage]
^- (pair path (unit miso))
?. ?=(%path p.pax)

9
base/lib/mean/core.hook Normal file
View File

@ -0,0 +1,9 @@
|% ++ mean |=(a=tang (mean-wrap a |.(!!)))
++ mean-wrap
|* [a=tang _|?(**)]
^+ (+<+)
=> .(a `tang`a)
?~ a (+<+)
~> %mean.|.(i.a)
$(a t.a)
--

View File

@ -22,7 +22,9 @@
~(has in react-elems)
++ react-to-tape
|= src=manx ^- tape
:: ?: =(%script n.g.src)
?: (~(has by (mo a.g.src)) [%urb %codemirror])
?> ?=([[%pre *] _:/(**) ~] src)
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
;: weld
"React.createElement("
=* tan n.g.src

View File

@ -3,8 +3,3 @@
}
.cm-s-default .cm-atom {color: #70f}
.cm-s-default .cm-operator {color: #097}
#err {
background: #fdd;
display: none;
}

View File

@ -0,0 +1,16 @@
:: this mark is used to receive incoming oauth2 tokens that we use to poke our %gall server
::
:::: /hook/door/do-auth/mar
::
/? 310
!:
|_ cod=cord
::
++ grab :: converter arm
|%
++ noun ,@t :: clam from noun
++ json (cork (ot authcode/so platform/so ~):jo need) :: (need (so:jo jon))
--
--

View File

@ -0,0 +1,9 @@
!:
|_ cod=cord
::
++ grab :: converter am
|%
++ noun ,@t :: clam from noun
++ json (cork (ot secret/so platform/so ~):jo need) :: (need (so:jo jon))
--
--

View File

@ -9,7 +9,7 @@
|%
++ mime [/text/hoon (taco own)] :: convert to %mime
++ psal :: convert to %html
;div:(pre:"{(trip own)}")
;div:pre(urb_codemirror ""):"{(trip own)}"
:: =+ gen-id="src-{<`@ui`(mug own)>}"
:: ;div
:: ;textarea(id "{gen-id}"):"{(trip own)}"

16
base/mar/httr/door.hook Normal file
View File

@ -0,0 +1,16 @@
::
:::: /hook/door/httr/mar
::
/? 314
|_ hit=httr
::
++ grow |% ++ wall (turn wain trip)
++ wain ~| hit
?> =(2 (div p.hit 100))
(lore q:(need r.hit))
--
++ grab :: convert from
|%
++ noun httr :: clam from %noun
--
--

View File

@ -3,6 +3,7 @@
:::: /hook/door/oauth2-code/mar
::
/? 310
!:
|_ cod=cord
::
++ grab :: converter arm

13
base/mar/purl/door.hook Normal file
View File

@ -0,0 +1,13 @@
::
:::: /hook/door/purl/mar
::
/? 314
|_ url=purl
::
++ grow |% ++ hiss [url %get ~ ~]
--
++ grab :: convert from
|%
++ noun purl :: clam from %noun
--
--

View File

@ -0,0 +1,32 @@
::
::::
:::
/? 310
/= gas /$ fuel
::
::::
::
!:
^- manx
=+ do=(~(get by qix.gas) %'code')
=+ g=(~(get by qix.gas) %'access_token')
;html
;head
;script@"/~/at/home/lib/urb.js";
;script: urb.appl = 'cloud'
;script@"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js";
;script@"https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js";
::;link/"/main/pub/cloud/src/main.css"(rel "stylesheet");
;title: DO & GCE Manager
==
;body
;* =+ d=?~(do ~ (trip u.do))
=+ g=?~(g ~ (trip u.g))
~& d
:_ ~
;script: authcode='{?~(d g d)}'; console.log(authcode)
;div#container;
;script@"/home/pub/cloud/src/main.js";
==
==

190
base/pub/cloud/src/main.js Normal file
View File

@ -0,0 +1,190 @@
recl = React.createClass
div = React.DOM.div
a = React.DOM.a
b = React.DOM.button
hr = React.DOM.hr
table = React.DOM.table
th = React.DOM.th
tr = React.DOM.tr
td = React.DOM.td
input = React.DOM.input
DOControls = React.createClass({
createDroplet: function(){
urb.send({appl: "cloud",
data: {
action:'create-do',
name:$('#name').val(),
region:$('#region').val(),
size:$('#size').val(),
image:$('#image').val(),
ssh:[], // $('#ssh').val()]
backups:null,//$('#backups').val(),
ipv6:null,//$('#ipv6').val(),
priv_networking:null,//$('#priv-networking').val(),
user_data:null//$('#user-data').val()
},
mark: "json"})
},
render: function(){
href = "https://cloud.digitalocean.com/v1/oauth/authorize?client_id=d8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f&redirect_uri=http%3A%2F%2Flocalhost%3A8443%2Fhome%2Fpub%2Fcloud%2Ffab&response_type=code&scope=read+write"
return (
div({}, [
div({},
a({href:href},"get authcode"),
b({onClick:this.props.handleClick('do')}, "Send Authcode")
),
div({}, [
input({id:"appsecret"},
b({onClick:this.props.sendSecret('do','#appsecret')}, "Send Secret"))
]),
div({}, [
b({onClick:this.createDroplet}, "Create Droplet"),
input({id:"name",placeholder:"Name of droplet"}),
input({id:"region",placeholder:"Region"}),
input({id:"size",placeholder:"Size (str ending in mb"}),
input({id:"image",placeholder:"Image"}),
input({id:"ssh",placeholder:"ssh keys (optional)"}),
input({id:"backups",placeholder:"backups (optional)"}),
input({id:"ipv6",placeholder:"ipv6 (boolean, optional)"}),
input({id:"user-data",placeholder:" user-data string (optional)"}),
input({id:"priv-networking",placeholder:"Private Networking (boolean, optional)"})
])
])
)
}
})
GCEControls = React.createClass({
createDroplet: function(){
urb.send({
appl: 'cloud',
data: {action:'create-gce',
project:$('#project').val(),
zone:$('#zone').val(),
name:$('#gname').val(),
machine_type:$('#machine_type').val()
},
mark: 'json'})
},
createDisk: function(){
urb.send({
appl: 'cloud',
data: {action:'create-gce-disk',
snap:$('#gsnap').val(),
number:$('#number').val(),
name:$('#gcpName').val()},
mark: 'json'})
},
render: function(){
ghref = "https://accounts.google.com/o/oauth2/auth?response_type=token&scope=https://www.googleapis.com/auth/compute&redirect_uri=http://localhost:8443/home/pub/cloud/fab&client_id=719712694742-6htfj2t9s1j2jid92rc4dfq9psrr9qpo.apps.googleusercontent.com"
return(
div({}, [
div({}, [
b({onClick:this.createDisk}, 'Create Disk From Image'),
input({id:'gcpName',placeholder:'Name for GCE Disk and Instance'}),
input({id:'number',placeholder:'Number of instances'}),
input({id:'gsnap',placeholder:'Snapshot'})
]),
div({}, [
a({href:ghref},"Get Google Authcode"),
b({onClick:this.props.handleClick('gce')}, "Send Google Authcode")
]),
div({}, [
input({id:"gappsecret"},
b({onClick:this.props.sendSecret('gce','#gappsecret')}, "Send Google Secret"))
]),
div({}, [
b({onClick:this.createDroplet}, "Create Droplet"),
input({id:"project",placeholder:"project"}),
input({id:"zone",placeholder:"zone"}),
input({id:"gname",placeholder:"Name of droplet"}),
input({id:"machine_type",placeholder:"Machine Type"}),
//input({id:"image",placeholder:"Image"}),
])
]))
}
})
Droplet = React.createClass({
dropletAction:function(id, action){
urb.send({
appl:"cloud",
data: {action: action,
id: id}})
},
render: function() {
var $this = this //local var, else it always points at second
var acts = ["start","stop","reboot","delete"]
var buttons = [];
var buttons = acts.map(function(act){
console.log($this.props.id)
return b({onClick:function(){
$this.dropletAction($this.props.id, act)
}}, act)
})
kay = Object.keys(this.props)
kay = kay.filter(function(b){return b!="children"}) // XX individually adress props
return div({},
buttons,
table({},
tr({},kay.map(function(k){return th({},k)})),
tr({},kay.map(function(k){return td({},JSON.stringify($this.props[k]))}))),
hr())
}
})
Page = recl({
handleClick: function(platform){
return function(){
console.log(platform);
if(window.authcode.length !== ''){
urb.send({
appl: "cloud",
data: {authcode:window.authcode,
platform:platform},
mark: "cloud-auth"})
} else { console.log("nocode") }
}
},
sendSecret: function(platform,codeid){
return function(){
console.log(platform,codeid)
secret= $(codeid).val()
if(secret !== '') {
urb.send({appl: "cloud",
data: {secret:secret,
platform:platform},
mark: "cloud-secret"})
}
}
},
getList: function(){
urb.send({appl: "cloud",
data: {action:"list"},
mark: "json"})
},
render: function(){
return (div({},
DOControls({handleClick:this.handleClick,sendSecret:this.sendSecret}),
GCEControls({handleClick:this.handleClick,sendSecret:this.sendSecret}),
this.props.droplets.map(Droplet)
))
}
})
mounted = React.render(Page({droplets:[]}), $("#container")[0])
urb.bind("/", function(err,d) {
mounted.setProps({droplets:d.data})
return})

View File

@ -1,29 +0,0 @@
::
::::
:::
/? 310
/= gas /$ fuel
::
::::
::
!:
^- manx
=+ authcode=(~(get by qix.gas) %'code')
;html
;head
;script@"/~/at/main/lib/urb.js";
;script: urb.appl = 'do'
;script@"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js";
;script@"https://cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js";
::;link/"/main/pub/do/src/main.css"(rel "stylesheet");
;title: DO Instance Tracker
==
;body
;* ?~ authcode ~
:_ ~
;script: authcode='{(trip u.authcode)}'; console.log(authcode)
;div#container;
;script@"/main/pub/do/src/main.js";
==
==

View File

@ -1,122 +0,0 @@
recl = React.createClass
div = React.DOM.div
a = React.DOM.a
b = React.DOM.button
hr = React.DOM.hr
table = React.DOM.table
th = React.DOM.th
tr = React.DOM.tr
td = React.DOM.td
input = React.DOM.input
Droplet = React.createClass({
deleteDroplet: function() {
urb.send({
appl: "do",
data: {action: 'delete',
id: this.props.id}})
},
rebootDroplet: function() {
urb.send({
appl: "do",
data: {action: 'reboot',
id: this.props.id}})
},
render: function() {
$this = this
kay = Object.keys(this.props)
kay = kay.filter(function(b){return b!="children"}) // XX individually adress props
return div({},
b({id:this.props.id}, "delete"),
b({id:this.props.id,onClick:this.rebootDroplet}, "reboot"),
table({},
tr({},kay.map(function(k){return th({},k)})),
tr({},kay.map(function(k){return td({},JSON.stringify($this.props[k]))}))),
hr())
}
})
Page = recl({
handleClick: function(){
if(window.authcode.length !== ''){
urb.send({
appl: "do",
data: window.authcode,
mark: "oauth2-code"})
} else { console.log("nocode") }
},
sendSecret: function(){
if($('#appsecret').val()) {
urb.send({appl: "do",
data: $('#appsecret').val(),
mark: "client-secret"
})
}
},
getList: function(){
urb.send({appl: "do",
data: {action:"list"},
mark: "json"})
},
createDroplet: function(){
urb.send({appl: "do",
data: {
action:'create',
name:$('#name').val(),
region:$('#region').val(),
size:$('#size').val(),
image:$('#image').val(),
ssh:[$('#ssh').val()],
backups:null,//$('#backups').val(),
ipv6:null,//$('#ipv6').val(),
priv_networking:null,//$('#priv-networking').val(),
user_data:null//$('#user-data').val()
},
mark: "json"})
},
render: function(){
href = "https://cloud.digitalocean.com/v1/oauth/authorize?client_id=d8f46b95af38c1ab3d78ad34c2157a6959c23eb0eb5d8e393f650f08e6a75c6f&redirect_uri=http%3A%2F%2Flocalhost%3A8443%2Fmain%2Fpub%2Fdo%2Ffab&response_type=code&redirect_uri=http://localhost:8443/main/pub/do/fab&scope=read+write"
return (div({}, [
div({},
a({href:href},[
"get authcode",
b({onClick:this.handleClick}, "Send Authcode")
])
),
div({}, [
input({id:"appsecret"},
b({onClick:this.sendSecret}, "Send Secret"))
]),
b({onClick:this.getList}, "Get List"),
div({}, [
b({onClick:this.createDroplet}, "Create Droplet"),
input({id:"name",placeholder:"Name of droplet"}),
input({id:"region",placeholder:"Region"}),
input({id:"size",placeholder:"Size (str ending in mb"}),
input({id:"image",placeholder:"Image"}),
input({id:"ssh",placeholder:"ssh keys (optional)"}),
input({id:"backups",placeholder:"backups (optional)"}),
input({id:"ipv6",placeholder:"ipv6 (boolean, optional)"}),
input({id:"user-data",placeholder:" user-data string (optional)"}),
input({id:"priv-networking",placeholder:"Private Networking (boolean, optional)"})
]),
div({},
this.props.droplets.map(Droplet)
)
])
)
}
})
mounted = React.render(Page({droplets:[]}), $("#container")[0])
urb.bind("/", function(err,d) {
mounted.setProps({droplets:d.data})
return})

View File

@ -0,0 +1,9 @@
recl = React.createClass
[div,textarea] = [React.DOM.div,React.DOM.textarea]
module.exports = recl
render: -> div {}, textarea ref:'ed', value:@props.value
componentDidMount: ->
CodeMirror.fromTextArea @refs.ed.getDOMNode(),
readOnly:true
lineNumbers:true

View File

@ -5,6 +5,7 @@ $ ->
React.initializeTouchEvents(true)
codemirror = React.createFactory require './components/CodeMirror.coffee'
head = React.createFactory require './components/AnchorComponent.coffee'
body = React.createFactory require './components/BodyComponent.coffee'
list = React.createFactory require './components/ListComponent.coffee'
@ -21,7 +22,7 @@ $ ->
if path[0] isnt "/" then path = "/"+path
window.tree._basepath + path
window.tree.fragpath = (path) -> path.replace window.tree._basepath,""
window.tree.init({kids:kids,list:list,lost:lost})
window.tree.init({kids:kids,list:list,lost:lost, codemirror:codemirror})
window.tree.reactify = (str) -> eval str
TreeActions = require './actions/TreeActions.coffee'

View File

@ -1,4 +1,4 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee":[function(require,module,exports){
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var TreeDispatcher, TreePersistence;
TreeDispatcher = require('../dispatcher/Dispatcher.coffee');
@ -72,7 +72,7 @@ module.exports = {
},{"../dispatcher/Dispatcher.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/dispatcher/Dispatcher.coffee","../persistence/TreePersistence.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/persistence/TreePersistence.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/AnchorComponent.coffee":[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":8,"../persistence/TreePersistence.coffee":13}],2:[function(require,module,exports){
var TreeActions, TreeStore, a, div, recl, ref;
TreeStore = require('../stores/TreeStore.coffee');
@ -295,7 +295,7 @@ module.exports = recl({
},{"../actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/stores/TreeStore.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/BodyComponent.coffee":[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14}],3:[function(require,module,exports){
var TreeActions, TreeStore, div, input, load, recl, ref, textarea;
TreeStore = require('../stores/TreeStore.coffee');
@ -360,7 +360,31 @@ module.exports = recl({
},{"../actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/stores/TreeStore.coffee","./LoadComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/LoadComponent.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/KidsComponent.coffee":[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14,"./LoadComponent.coffee":7}],4:[function(require,module,exports){
var div, recl, ref, textarea;
recl = React.createClass;
ref = [React.DOM.div, React.DOM.textarea], div = ref[0], textarea = ref[1];
module.exports = recl({
render: function() {
return div({}, textarea({
ref: 'ed',
value: this.props.value
}));
},
componentDidMount: function() {
return CodeMirror.fromTextArea(this.refs.ed.getDOMNode(), {
readOnly: true,
lineNumbers: true
});
}
});
},{}],5:[function(require,module,exports){
var TreeActions, TreeStore, a, div, hr, li, recl, ref, ul;
TreeStore = require('../stores/TreeStore.coffee');
@ -427,7 +451,7 @@ module.exports = recl({
},{"../actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/stores/TreeStore.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/ListComponent.coffee":[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14}],6:[function(require,module,exports){
var TreeActions, TreeStore, a, div, h1, li, load, recl, ref, ul;
TreeStore = require('../stores/TreeStore.coffee');
@ -522,7 +546,7 @@ module.exports = recl({
},{"../actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/stores/TreeStore.coffee","./LoadComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/LoadComponent.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/LoadComponent.coffee":[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14,"./LoadComponent.coffee":7}],7:[function(require,module,exports){
var div, input, recl, ref, textarea;
recl = React.createClass;
@ -560,7 +584,7 @@ module.exports = recl({
},{}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/dispatcher/Dispatcher.coffee":[function(require,module,exports){
},{}],8:[function(require,module,exports){
var Dispatcher;
Dispatcher = require('flux').Dispatcher;
@ -582,15 +606,16 @@ module.exports = _.extend(new Dispatcher(), {
},{"flux":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/index.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/main.coffee":[function(require,module,exports){
},{"flux":10}],9:[function(require,module,exports){
var rend;
rend = React.render;
$(function() {
var $body, TreeActions, TreePersistence, body, checkMove, checkScroll, frag, head, kids, list, lost, po, setSo, so;
var $body, TreeActions, TreePersistence, body, checkMove, checkScroll, codemirror, frag, head, kids, list, lost, po, setSo, so;
$body = $('body');
React.initializeTouchEvents(true);
codemirror = React.createFactory(require('./components/CodeMirror.coffee'));
head = React.createFactory(require('./components/AnchorComponent.coffee'));
body = React.createFactory(require('./components/BodyComponent.coffee'));
list = React.createFactory(require('./components/ListComponent.coffee'));
@ -616,7 +641,8 @@ $(function() {
window.tree.init({
kids: kids,
list: list,
lost: lost
lost: lost,
codemirror: codemirror
});
window.tree.reactify = function(str) {
return eval(str);
@ -740,9 +766,9 @@ $(function() {
},{"./actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee","./components/AnchorComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/AnchorComponent.coffee","./components/BodyComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/BodyComponent.coffee","./components/KidsComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/KidsComponent.coffee","./components/ListComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/components/ListComponent.coffee","./persistence/TreePersistence.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/persistence/TreePersistence.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/index.js":[function(require,module,exports){
},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":3,"./components/CodeMirror.coffee":4,"./components/KidsComponent.coffee":5,"./components/ListComponent.coffee":6,"./persistence/TreePersistence.coffee":13}],10:[function(require,module,exports){
/**
* Copyright (c) 2014, Facebook, Inc.
* Copyright (c) 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@ -752,7 +778,7 @@ $(function() {
module.exports.Dispatcher = require('./lib/Dispatcher')
},{"./lib/Dispatcher":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/lib/Dispatcher.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/lib/Dispatcher.js":[function(require,module,exports){
},{"./lib/Dispatcher":11}],11:[function(require,module,exports){
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
@ -1004,7 +1030,7 @@ var _prefix = 'ID_';
module.exports = Dispatcher;
},{"./invariant":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/lib/invariant.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/node_modules/flux/lib/invariant.js":[function(require,module,exports){
},{"./invariant":12}],12:[function(require,module,exports){
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
@ -1059,7 +1085,7 @@ var invariant = function(condition, format, a, b, c, d, e, f) {
module.exports = invariant;
},{}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/persistence/TreePersistence.coffee":[function(require,module,exports){
},{}],13:[function(require,module,exports){
var TreeActions;
TreeActions = require('../actions/TreeActions.coffee');
@ -1081,7 +1107,7 @@ module.exports = {
},{"../actions/TreeActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/actions/TreeActions.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/stores/TreeStore.coffee":[function(require,module,exports){
},{"../actions/TreeActions.coffee":1}],14:[function(require,module,exports){
var EventEmitter, MessageDispatcher, TreeStore, _cont, _curr, _load, _snip, _tree;
EventEmitter = require('events').EventEmitter;
@ -1295,7 +1321,7 @@ module.exports = TreeStore;
},{"../dispatcher/Dispatcher.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/dispatcher/Dispatcher.coffee","events":"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/events/events.js"}],"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/events/events.js":[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":8,"events":15}],15:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@ -1355,10 +1381,8 @@ EventEmitter.prototype.emit = function(type) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
} else {
throw TypeError('Uncaught, unspecified "error" event.');
}
return false;
throw TypeError('Uncaught, unspecified "error" event.');
}
}
@ -1600,4 +1624,4 @@ function isUndefined(arg) {
return arg === void 0;
}
},{}]},{},["/Users/galen/Documents/src/urbit-test/urb/zod/docs/pub/tree/src/js/main.coffee"]);
},{}]},{},[9]);

View File

@ -1,7 +1,7 @@
::
/? 314
/= gas /$ fuel
/= ral /: /=home= /% /react-js/
/= ral /: /=== /% /react-js/
::
::::
::
@ -17,12 +17,16 @@
;head
;title: Tree
;meta(name "viewport", content "width=device-width, initial-scale=1");
;link(type "text/css", rel "stylesheet", href "/home/pub/tree/src/css/main.css");
;link(type "text/css", rel "stylesheet", href "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.min.css");
;link(type "text/css", rel "stylesheet", href "/{(trip &2:%)}/pub/tree/src/css/main.css");
;link(type "text/css", rel "stylesheet", href "/{(trip &2:%)}/lib/syntax/codemirror.css");
::;link(type "text/css", rel "stylesheet", href "http://localhost:8000/docs/pub/tree/src/css/main.css");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/react/0.12.2/react.js");
;script(type "text/javascript", src "/home/pub/tree/src/js/main.js");
;script(type "text/javascript", src "//cdnjs.cloudflare.com/ajax/libs/codemirror/4.3.0/codemirror.js");
;script(type "text/javascript", src "/{(trip &2:%)}/lib/syntax/hoon.js");
;script(type "text/javascript", src "/{(trip &2:%)}/pub/tree/src/js/main.js");
::;script(type "text/javascript", src "http://localhost:8000/docs/pub/tree/src/js/main.js");
==
;body