@lapxo/bound 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CITATION.cff +1 -1
- package/README.md +20 -3
- package/TARGET.bound +75 -42
- package/dist/cli/accept.js +59 -70
- package/dist/cli/act-result.js +3 -3
- package/dist/cli/args.js +1 -1
- package/dist/cli/host.js +1 -1
- package/dist/cli/native.js +1 -1
- package/dist/cli/pass.js +22 -21
- package/dist/cli/place.js +6 -6
- package/dist/cli/release-result.js +3 -3
- package/dist/cli/retained-judgment.js +1 -1
- package/dist/cli/standing-result.js +3 -3
- package/dist/cli/takes.js +10 -10
- package/dist/cli/verb.js +79 -77
- package/dist/engine/computation.js +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/object.js +1 -1
- package/dist/engine/ports.js +1 -1
- package/dist/fold/admission-history.js +1 -1
- package/dist/fold/ceilings.js +1 -1
- package/dist/fold/claims.js +2 -2
- package/dist/fold/closed.js +1 -1
- package/dist/fold/configures.js +1 -1
- package/dist/fold/digests.js +10 -10
- package/dist/fold/evidence.js +1 -1
- package/dist/fold/keys.js +3 -3
- package/dist/fold/laid.js +1 -1
- package/dist/fold/observed.js +27 -26
- package/dist/fold/opened.js +1 -1
- package/dist/fold/own.js +3 -3
- package/dist/fold/paid.js +1 -1
- package/dist/fold/place-inputs.js +1 -1
- package/dist/fold/places.js +1 -1
- package/dist/fold/reach.js +1 -1
- package/dist/fold/readers.js +1 -1
- package/dist/fold/region.js +1 -1
- package/dist/fold/release-policy.js +1 -1
- package/dist/fold/resolved.js +1 -1
- package/dist/fold/roles.js +1 -1
- package/dist/fold/shards.js +8 -8
- package/dist/fold/signed.js +3 -3
- package/dist/fold/signers.js +1 -1
- package/dist/fold/stranger.js +6 -6
- package/dist/fold/wire.js +1 -1
- package/dist/fold/zoom.js +1 -1
- package/dist/host/act-cost.js +1 -1
- package/dist/host/adapters/keys/ed25519.js +1 -1
- package/dist/host/adapters/transport/http.js +1 -1
- package/dist/host/admitted-place.js +1 -1
- package/dist/host/call-context.js +1 -1
- package/dist/host/capsule-process.js +1 -1
- package/dist/host/capsule.js +1 -1
- package/dist/host/cell-receipts.js +1 -1
- package/dist/host/command-server.js +4 -0
- package/dist/host/content-store.js +1 -1
- package/dist/host/contextual-place.js +1 -1
- package/dist/host/digest.js +1 -1
- package/dist/host/host-controls.js +1 -1
- package/dist/host/in-process-act.js +1 -1
- package/dist/host/in-process-context.js +1 -1
- package/dist/host/in-process-root.js +1 -1
- package/dist/host/in-process.js +1 -1
- package/dist/host/index.d.ts +1 -1
- package/dist/host/index.js +1 -1
- package/dist/host/located.js +6 -6
- package/dist/host/native/authority-card-view.js +5 -0
- package/dist/host/native/authority-card.js +1 -0
- package/dist/host/native/command.js +1 -1
- package/dist/host/native/custody.js +1 -1
- package/dist/host/native/generated-custodian.js +1 -1
- package/dist/host/native/installed-package.d.ts +1 -0
- package/dist/host/native/installed-package.js +5 -0
- package/dist/host/native/module-delivery.d.ts +1 -1
- package/dist/host/native/module-delivery.js +1 -1
- package/dist/host/native/module-inventory.js +2 -0
- package/dist/host/native/module-syntax.js +1 -1
- package/dist/host/native/native-binary.js +1 -1
- package/dist/host/native/probes.js +1 -0
- package/dist/host/native/reading-witness-admission.js +5 -0
- package/dist/host/native/reading.js +1 -1
- package/dist/host/native/route.js +1 -1
- package/dist/host/native-place-state.js +1 -0
- package/dist/host/native-receiver.js +1 -1
- package/dist/host/objects.js +1 -1
- package/dist/host/persistent-host.js +1 -0
- package/dist/host/physical-lines.d.ts +1 -0
- package/dist/host/physical-lines.js +1 -0
- package/dist/host/place-act-transaction.js +1 -1
- package/dist/host/place-clock-selection.js +1 -1
- package/dist/host/ports/local-act.js +1 -1
- package/dist/host/ports/place-act.js +1 -1
- package/dist/host/ports/store.js +1 -1
- package/dist/host/ports/transport.js +1 -1
- package/dist/host/profile-composition.d.ts +1 -0
- package/dist/host/profile-composition.js +2 -0
- package/dist/host/reading-closures.js +6 -6
- package/dist/host/reading-context.js +1 -1
- package/dist/host/reading-identity.js +2 -2
- package/dist/host/reading-preparation.js +1 -1
- package/dist/host/reference-authenticated.d.ts +1 -1
- package/dist/host/reference-authenticated.js +1 -1
- package/dist/host/reference-export.js +1 -1
- package/dist/host/reference-native-api.d.ts +1 -1
- package/dist/host/reference-native-api.js +1 -1
- package/dist/host/reference-native.js +1 -1
- package/dist/host/reference-standing.js +1 -1
- package/dist/host/reference.js +1 -1
- package/dist/host/refusals.js +2 -2
- package/dist/host/release.js +1 -1
- package/dist/host/root-clock-source.js +1 -1
- package/dist/host/selected-capsules.js +1 -1
- package/dist/host/selected-topos.js +1 -1
- package/dist/host/signing.js +2 -2
- package/dist/host/source-content.js +1 -1
- package/dist/host/standing-carrier.js +1 -1
- package/dist/host/standing-projection.js +1 -1
- package/dist/host/timing.js +1 -1
- package/dist/host/walk.js +1 -1
- package/dist/host/work-trace.js +1 -0
- package/dist/judge/late.js +1 -1
- package/dist/judge/take.js +1 -1
- package/dist/judge/widening.js +1 -1
- package/dist/land/act.js +6 -6
- package/dist/land/alias.js +1 -1
- package/dist/land/held.js +1 -1
- package/dist/land/ledger.js +5 -6
- package/dist/land/sign.js +1 -1
- package/dist/land/standing-pin.js +1 -1
- package/dist/land/vouched.js +1 -1
- package/dist/land/withdraw.js +1 -1
- package/dist/observe/files.js +1 -1
- package/dist/observe/identity.js +1 -1
- package/dist/observe/match.js +1 -1
- package/dist/observe/regions.js +1 -1
- package/dist/observe/run.js +1 -2
- package/dist/observe/runner.js +1 -1
- package/dist/public-types.d.ts +945 -40
- package/dist/render/capsule.js +1 -1
- package/dist/render/field.js +1 -1
- package/dist/render/open.js +1 -1
- package/dist/render/page.js +1 -1
- package/dist/render/receipt-projection.js +1 -0
- package/dist/render/receipts.js +1 -1
- package/dist/render/shape.js +1 -1
- package/dist/render/target.js +4 -4
- package/dist/render/view.js +5 -5
- package/dist/vendor/bundle.json +1 -1
- package/dist/vendor/library14.js +1 -0
- package/dist/vendor/runtime.js +53 -30
- package/dist/wasm/adapter.d.ts +1 -1
- package/docs/contracts/authenticated-reference.publication.json +1 -1
- package/docs/contracts/authority-preflight.md +17 -0
- package/docs/contracts/authority-preflight.publication.json +25 -0
- package/docs/contracts/installed-package.md +21 -0
- package/docs/contracts/installed-package.publication.json +25 -0
- package/docs/contracts/materialized-leaf-sequence.md +15 -0
- package/docs/contracts/materialized-leaf-sequence.publication.json +25 -0
- package/docs/contracts/module-inventory.md +15 -0
- package/docs/contracts/module-inventory.publication.json +25 -0
- package/docs/contracts/native-host.md +29 -1
- package/docs/contracts/native-host.publication.json +4 -4
- package/docs/contracts/native-probes.md +13 -0
- package/docs/contracts/native-probes.publication.json +25 -0
- package/docs/contracts/native-publication.inventory.json +9 -1
- package/docs/contracts/native-view-batch.md +17 -0
- package/docs/contracts/native-view-batch.publication.json +25 -0
- package/docs/contracts/physical-lines.md +19 -0
- package/docs/contracts/physical-lines.publication.json +25 -0
- package/docs/contracts/profile-composition.md +17 -0
- package/docs/contracts/profile-composition.publication.json +25 -0
- package/docs/contracts/profile-preparation-native-meaning.md +9 -0
- package/docs/contracts/publication.md +12 -0
- package/docs/contracts/reading-identity.md +26 -2
- package/docs/contracts/reading-identity.publication.json +4 -4
- package/docs/contracts/reading-witness-admission.md +49 -0
- package/docs/contracts/readme.publication.json +1 -1
- package/docs/contracts/reference-port.md +11 -0
- package/docs/contracts/reference-port.publication.json +1 -1
- package/docs/contracts/refusals.bound +346 -145
- package/docs/contracts/refusals.md +119 -54
- package/docs/contracts/refusals.publication.json +2 -2
- package/docs/reference.md +8 -0
- package/licenses/wasm/{fast-text-encoding.txt → NOTICE.txt} +111 -0
- package/package.json +69 -8
- package/receipts.bound +12921 -11722
- package/samples/authority-preflight/no.json +6 -0
- package/samples/authority-preflight/yes.json +30 -0
- package/samples/engine-alphabet/reader.js +3 -1457
- package/samples/engine-alphabet/receipts.bound +7 -7
- package/samples/engine-interval/reader.js +3 -1457
- package/samples/engine-interval/receipts.bound +7 -7
- package/samples/installed-package/consumer.mjs +29 -0
- package/samples/installed-package/fixture.json +48 -0
- package/samples/installed-package/no.json +10 -0
- package/samples/installed-package/yes.json +52 -0
- package/samples/materialized-leaf-sequence/no.json +11 -0
- package/samples/materialized-leaf-sequence/yes.json +10 -0
- package/samples/module-inventory/yes.json +28 -0
- package/samples/native/physical-line-reader.mjs +1 -0
- package/samples/native/physical-line-reader.source.mjs +13 -0
- package/samples/native-host/no.json +6 -1
- package/samples/native-host/yes.json +18 -1
- package/samples/native-probes/inputs/inspection.json +28 -0
- package/samples/native-probes/no.json +7 -0
- package/samples/native-probes/yes.json +28 -0
- package/samples/native-view-batch/no.json +14 -0
- package/samples/native-view-batch/yes.json +10 -0
- package/samples/no/engine-order/reader.js +3 -1457
- package/samples/no/module-inventory/no.json +10 -0
- package/samples/physical-lines/no.json +5 -0
- package/samples/physical-lines/yes.json +9 -0
- package/samples/profile-composition/no.json +6 -0
- package/samples/profile-composition/yes.json +14 -0
- package/samples/reading-identity/no.json +7 -1
- package/samples/reading-identity/yes.json +24 -1
- package/vectors/native/authority-preflight.vector.json +55 -0
- package/vectors/native/installed-package.vector.json +31 -0
- package/vectors/native/materialized-leaf-sequence.vector.json +31 -0
- package/vectors/native/module-inventory.vector.json +56 -0
- package/vectors/native/native-host.vector.json +214 -0
- package/vectors/native/native-probes.vector.json +31 -0
- package/vectors/native/native-view-batch.vector.json +31 -0
- package/vectors/native/physical-lines.vector.json +105 -0
- package/vectors/native/profile-composition.vector.json +53 -0
- package/vectors/native/reading-identity.vector.json +38 -0
- package/vectors/native/refusals.vector.json +36 -2
- package/dist/vendor/library11.js +0 -1
- package/dist/vendor/sources.json +0 -1
- package/licenses/wasm/bound.txt +0 -21
- package/licenses/wasm/jitl-quickjs-ffi-types.txt +0 -21
- package/licenses/wasm/jitl-quickjs-wasmfile-release-sync.txt +0 -47
- package/licenses/wasm/obligations.txt +0 -21
- package/licenses/wasm/quickjs-emscripten-core.txt +0 -21
- package/licenses/wasm/topos.txt +0 -21
- /package/dist/vendor/{50086958553b9376d600583f7dff354196bfeb41170fc6d1482ca7bea7c493e2.LICENSE → 28cba430228db1c04f446c93f81b09a2705d6bf3e222d35adbe5a4cee4061884.LICENSE} +0 -0
- /package/dist/vendor/{b3e938d28f88a1851af303a40c749e12ebd5a686daac4f0b343b5cdd2e040419.LICENSE → 7aca161279d14bc0e054dcc281cd110aeb95be2e026b42fdf527a260e58b2aae.LICENSE} +0 -0
package/dist/cli/place.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Ae=Object.defineProperty;var m=(e,o)=>Ae(e,"name",{value:o,configurable:!0});import{hostOutput as me}from"../host/call-context.js";import{refreshRetainedJudgment as Ie}from"./retained-judgment.js";import{timing as
|
|
2
|
-
`).filter(Me),
|
|
3
|
-
`),
|
|
4
|
-
`))).replace(/^sha256:/,""),W=
|
|
5
|
-
`).filter(Me).length,
|
|
6
|
-
`),A}m(
|
|
1
|
+
var Ae=Object.defineProperty;var m=(e,o)=>Ae(e,"name",{value:o,configurable:!0});import{traceWork as Je}from"../host/work-trace.js";import{hostOutput as me}from"../host/call-context.js";import{refreshRetainedJudgment as Ie}from"./retained-judgment.js";import{timing as Ve}from"../host/timing.js";import{attestationObservations as ue}from"../fold/evidence.js";import{library14_parse as ge}from"../vendor/runtime.js";import{releasePolicy as he,releaseFaults as Ge}from"../fold/release-policy.js";import{library0_point as Qe,library0_region as Ue,library0_within as Xe}from"../vendor/runtime.js";import{basename as we,join as ye}from"node:path";import{observeText as J}from"../observe/files.js";import{placesOf as I,viewsOf as Ye}from"../fold/views.js";import{prerender as Ze}from"../render/view.js";import{meets as V,instrumentKept as et}from"../fold/closed.js";import{foldPoints as tt,keepFold as st,keptPlace as ke}from"../fold/kept.js";import{openCells as nt}from"../render/open.js";import{boundOf as it,packRegions as ot,regionsNamed as rt,regionsOf as at,unlikeReplay as ct}from"../fold/region.js";import{answersElsewhere as ft,foldCeilings as dt,ceilingSummary as be}from"../fold/ceilings.js";import{keyOf as lt,keyFor as pt,lockLines as mt,lockStanding as ve}from"../fold/keys.js";import{wordFrom as Oe,wordOf as $e,wordOn as ut}from"../fold/wire.js";import{bytesDigest as gt,instrumentOf as G,signaturesOf as ht}from"../fold/digests.js";import{claimKey as Se,fieldOf as l,fieldsOf as wt,isWire as Me}from"../fold/claims.js";import{library14_canonical as Q,library14_LOCK as yt,library14_parse as Re}from"../vendor/runtime.js";import{classDefaults as kt,kindsOf as bt,placesIn as U,spoken as vt}from"../fold/places.js";import{isCeiling as H}from"../fold/configures.js";import{observedClaims as X,placedReadings as Y}from"../fold/observed.js";import{capsuleReadingsOver as xe,currentReceiptObservations as Ce,retiredReceiptHistory as Ot}from"../observe/regions.js";import{costReadings as $t,ownReadings as We,currentActReadings as St}from"../fold/own.js";import{paidOf as Mt}from"../fold/paid.js";import{rolesOf as Fe}from"../fold/roles.js";import{secondHead as Rt}from"../fold/second.js";import{authorityFor as xt,rootSigner as Ct,writerFor as Ne}from"../fold/signers.js";import{ledgerLines as T,storeOf as Z}from"../land/ledger.js";import{vouchedCoordinates as Wt}from"../land/vouched.js";import{ownLock as P,ownRoot as _e}from"../observe/runner.js";import{epochOf as ee,historyOf as Ft,renderedLock as Nt,standingDemands as _t}from"./owner.js";function Pt(e,o,t){const c=Ne(o,"fold"),r=m(f=>{const i=(c===void 0?[]:T(e,c)).filter(s=>l(s,"scope")===`beat/${t??"."}`&&l(s,"at")===`place:${f}`).map(s=>Number(l(s,"value").split("..")[0])).filter(s=>Number.isFinite(s)).slice(-10).sort((s,h)=>s-h);return i.length?i[Math.floor(i.length/2)]??0:0},"middle");return{kept:r("kept"),folded:r("folded")}}m(Pt,"beatsOf");const Dt=m(e=>T(e,"take").filter(o=>l(o,"measure")==="ms").map(o=>Number(l(o,"value").split("..")[0])).filter(o=>Number.isFinite(o)).slice(-10),"costsOf");function Et(e){return"none"}m(Et,"effectStates");const Pe=new WeakMap,De=new WeakMap;function Lt(e,o,t,c){const r=De.get(c);if(r!==void 0)return r;const f=lt(o,"attest"),i=f===void 0?void 0:xt([...c,...T(o,f)],Ct(e),ht(o).admitted);return De.set(c,Rt(o,t,s=>i?.of(s).kind==="admitted",c)).get(c)}m(Lt,"secondOf");function jt(e,o,t){const c=new Map,r=(()=>{try{return pt(e,"read")}catch{return}})();for(const f of o)c.set(l(f,"by"),(c.get(l(f,"by"))??0)+1);for(const f of o){const i=/^keys\/([^/]+)$/.exec(l(f,"scope"))?.[1],s=i===void 0||c.has(i)?void 0:i===r?t:T(e,i);i!==void 0&&s!==void 0&&c.set(i,Pe.get(s)??Pe.set(s,new Set(s.filter(h=>l(h,"sig")!=="")).size).get(s))}return c}m(jt,"signedByKey");function Kt(e){const o=ut(e.standing,"region-leaf",P()),t=m(a=>ye(e.root,e.under??"",a),"at"),c=[...Ye(e.standing).values()].flatMap(a=>"regions"in a&&a.shape?[a]:[]).filter(a=>J(t(a.shape))!==void 0),r=m(a=>I(e.standing,a).includes(e.under??""),"named"),f=c.filter(a=>r(a)||!I(e.standing,a).length&&!c.some(d=>d.shape===a.shape&&r(d))),i=Ze(e,f),s=new Set(f.filter(a=>J(t(a.shape))===i.get(a)).map(a=>a.name)),h=f.length-s.size,u=[...c.filter(a=>r(a)||!I(e.standing,a).length).reduce((a,d)=>a.set(d.shape,(a.get(d.shape)??0)+1),new Map).values()].filter(a=>a>1).length;return{readings:{[`rendered-${o}-differ`]:h,"rendered-coordinates-differ":h,[`${o}-with-two-views`]:u,"coordinates-with-two-views":u},same:s,here:new Set(f.map(a=>a.name))}}m(Kt,"viewReadings");const Bt=[],Ee=new WeakMap,Ht=m((e,o)=>(t=>(c=>c.get(o)??c.set(o,[...t,...o]).get(o))(Ee.get(t)??Ee.set(t,new WeakMap).get(t)))(mt(e)),"ownedOf");function te(e,o,t=Bt){const c=Z(e),r=Ht(c,t),f=Nt(e,c,t),i=f.text.split(`
|
|
2
|
+
`).filter(Me),s=vt(e);if(!s.length)return{standing:i,lock:i,rendered:f,owned:r};const h=`${$e(i,"families","view")}/`,u=m(p=>l(p,"scope").startsWith(h),"isView"),a=new Set(s.filter(p=>!u(p.line)).map(p=>Se(p.line))),d=new Map;for(const p of s.filter(y=>u(y.line)))d.set(l(p.line,"scope"),(d.get(l(p.line,"scope"))??new Set).add(`${p.place}/`));const k=i.flatMap(p=>{const y=u(p)?d.get(l(p,"scope")):void 0;if(y===void 0)return a.has(Se(p))?[]:[p];const v=l(p,"needs").split("|").filter(Boolean),M=v.filter(q=>![...y].some(C=>q.startsWith(C)));if(!v.length||M.length===v.length)return[p];const x=Re(p);return M.length&&x.kind==="fact"?[Q({...x.value.fields,needs:M.join("|")})]:[]}),g=o?.replace(/\/$/,""),b=s.filter(p=>p.place===g).map(p=>p.line),$=s.filter(p=>p.place!==g).map(p=>p.line),w=[...new Set([...b,...k,...$])];return{standing:[...w,...Tt(e,w)],lock:i,rendered:f,owned:r}}m(te,"standingOf");function Tt(e,o){const t=kt(e);if(!t.length)return[];const c=o.filter(H),r=[];for(const f of U(e)){const i=bt(e,f),s=`${f}/`,h=new Set(c.filter(u=>l(u,"scope").startsWith(s)).map(u=>l(u,"measure")));for(const u of t){if(!u.classes.includes("*")&&!u.classes.some(k=>i.includes(k)))continue;const a=l(u.line,"measure");if(h.has(a))continue;const d=Re(u.line);d.kind==="fact"&&(r.push(Q({...d.value.fields,scope:`${s}${l(u.line,"scope")}`})),h.add(a))}}return r}m(Tt,"inheritedOf");function Cs(e,o,t,c){const r=Z(e),{standing:f,rendered:i}=te(e);if(V(e,r,"")&&et(r)===G(r,o,f,e,P())){const w=ke(r);if(w!==void 0)return{standing:f,observed:w.observed,own:{...w.own,...St()},kept:!0}}const s=rt(f),h=c!==void 0&&c.length?[...c]:[...new Set(t.map(w=>it(s,w).region))],u=X(e,r,{wait:!1,...h.includes("")?{}:{reach:h}}),d=[...Ce({root:e,store:r,standing:f,observed:u}),...xe({root:e,store:r,standing:f,observed:u})],k={...We({root:e,store:r,entry:o,roleOf:Fe(r),standing:f,observed:d,unadmitted:i.grey.length+i.refused.length,orphans:0}),...$t(r,f)},g=new Set([...Object.keys(k),...Y(d).map(w=>w.measure),$e(f,"states","unread")]);if(t.every(w=>g.has(l(w,"measure"))||l(w,"scope")in k))return{standing:f,observed:d,own:k,kept:!0};const $=zt(e,o);return{...$,kept:$.kept??!1}}m(Cs,"coneOf");const Le=m(e=>(o=>e===void 0||e===`${o}/`?P().filter(H).map(t=>Q({...wt(t),scope:`${o}/${l(t,"scope")}`})):[])(we(_e())),"ownCeilings");function qt(e){return Ie(e,[...e.standing.filter(o=>H(o)&&!(e.under&&l(o,"measure")==="unread")),...Le(e.under)])}m(qt,"currentJudgment");function zt(e,o,t,c=!0,r){return Je("fold/place",()=>At(e,o,t,c,r))}m(zt,"foldPlace");function At(e,o,t,c=!0,r){const f=[],i=Ve(f),s=Z(e),h=Date.now(),u=i("closure",()=>V(e,s,t??"")),a=Date.now()-h;if(u&&r?.free!==!0){const n=ke(s,t,G(s,o,te(e).standing,e,P()));if(n!==void 0)return me("error",`CLOSED ${t||"."} \xB7 digest ${a} ms
|
|
3
|
+
`),qt(n)}const{standing:d,lock:k,rendered:g,owned:b}=r?.standing??i("standing",()=>te(e,t)),$=Ne(d,"fold"),w=r===void 0&&t?new Map:void 0,p=r?.observed??i("observed",()=>X(e,s,{wait:c,...t?{reach:[t],answered:w}:{}})),y=i("instrument",()=>G(s,o,d,e,P())),v=m(n=>!t||Xe(Qe(n.replace(/\/\*$/,"")),Ue(t)),"inside"),M=i("history",()=>Ft(e,s,_t(s))),x=M.live.filter(n=>(O=>!t||O.length>0&&O.every(v))(l(n,"needs").split("|").filter(Boolean))),q=t&&t!==`${we(_e())}/`?{owned:b,place:t,scopes:new Set(x.map(n=>l(n,"scope")))}:void 0,C=r?.observed??(t?i("observe",()=>X(e,s,{wait:c})):p),D=[...i("current-receipts",()=>Ce({root:e,store:s,...t?{under:t}:{},standing:d,observed:C})),...i("capsules",()=>xe({root:e,store:s,...t?{under:t}:{},standing:d,observed:C}))],se=i("points",()=>tt(s,d,t,$,y,p,e,w,q)),E=i("point-digest",()=>gt(s,new TextEncoder().encode(se.join(`
|
|
4
|
+
`))).replace(/^sha256:/,"")),W=D.filter(n=>!/ measure=observed /.test(n)||v(l(n,"scope"))),ne=new Set(t?Y(D).filter(n=>!v(n.place)).map(n=>n.question):[]),je=M,L=x,z=[],R=[...d.filter(n=>H(n)&&!(t&&l(n,"measure")==="unread")),...Le(t)],j=i("own",()=>We({root:e,store:s,entry:o,roleOf:Fe(s),standing:d,observed:D,unadmitted:g.grey.length+g.refused.length,orphans:z.length,...t?{under:t}:{}})),ie=i("regions",()=>at(d,R.filter(n=>!ft(n,j,t,new Set(U(e)))),Y(W))),oe=m(n=>dt({standing:d,ceilings:R,observed:W,own:{...j,...n},epoch:ee(b),...t?{under:t,places:new Set(U(e))}:{}}),"fold"),F=i("ceilings",()=>oe({})),{paid:re,missing:Ke}=i("paid",()=>Mt(s,L,W,`${Oe(d,"families","view",ve(s))}/`)),Be=(J(ye(e,t??"",yt))??"").split(`
|
|
5
|
+
`).filter(Me).length,K=i("second",()=>Lt(e,s,k,b)),B=d.filter(n=>!g.grey.includes(n)&&!g.refused.includes(n)),ae=Ge({forks:g.forks,refused:g.refused,grey:g.grey,orphans:z,second:K}),S={release:he({standing:B,demands:L,paid:re,ceilings:R,readings:F,faults:ae,verdicts:ue(B.map(n=>{const O=ge(n);return O.kind==="fact"?O.value.fields:{}}),K),snapshot:{fold:E,instrument:y}}),root:e,store:s,...t?{under:t}:{},epoch:ee(b),standing:d,claims:g.standing,forks:g.forks,grey:g.grey,refused:g.refused,vacuous:g.vacuous.length,demands:L,paid:re,missing:Ke,history:je.history.filter(n=>l(n,"needs").split("|").filter(Boolean).some(v)),observed:W,receiptHistory:i("receipt-history",()=>Ot({root:e,store:s,...t?{under:t}:{},standing:d,observed:C})),ceilings:be(F,R.length,ne),orphans:z,lock:Be,signed:i("signatures",()=>jt(s,d,D)),second:K,effects:Et(s),key:E,instrument:y,own:j,open:nt({store:s,standing:d,observed:W,grey:g.grey,epoch:ee(b)}),regions:ot(ie),beats:i("beats",()=>Pt(s,d,t)),landed:[...Wt(s).keys()].filter(n=>!t||n.startsWith(t)).length,costs:i("cost-history",()=>Dt(s))},{readings:He,same:Te,here:qe}=i("docs",()=>Kt(S)),ce=`${Oe(d,"families","view",ve(s))}/`,ze=new Set([...qe].map(n=>`${ce}${n}`)),N=m(n=>ze.has(l(n,"scope")),"writes"),_=m(n=>Te.has(l(n,"scope").slice(ce.length)),"holds"),fe=[...S.missing.filter(n=>!N(n)||!_(n)),...S.paid.filter(n=>N(n)&&!_(n))],de={...He,"payments-lost-on-equal-output":fe.filter(n=>N(n)&&_(n)).length,"poles-unlike-replay":ct(ie,new Set(F.over.map(n=>n.ceiling)),{...j,unread:F.unread.length+F.vacuous.length})},le=i("ceilings",()=>oe(de)),pe=[...S.paid.filter(n=>!N(n)||_(n)),...S.missing.filter(n=>N(n)&&_(n))],A={...S,paid:pe,release:he({standing:B,demands:L,paid:pe,ceilings:R,readings:le,faults:ae,verdicts:ue(B.map(n=>{const O=ge(n);return O.kind==="fact"?O.value.fields:{}}),K),snapshot:{fold:E,instrument:y}}),missing:fe,own:{...S.own,...de},ceilings:be(le,R.length,ne)};return $!==void 0&&V(e,s,t??"",!0,A.observed)&&i("keep",()=>st(s,E,A,se,y)),me("error",`SPENT fold ${f.join(" ms \xB7 ")} ms
|
|
6
|
+
`),A}m(At,"foldPlaceCurrent");export{Cs as coneOf,qt as currentJudgment,zt as foldPlace,Le as ownCeilings,te as standingOf};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var S=Object.defineProperty;var f=(n,o)=>S(n,"name",{value:o,configurable:!0});import{
|
|
2
|
-
`).filter(l=>l.trim().length>0);
|
|
3
|
-
`)}f(
|
|
1
|
+
var S=Object.defineProperty;var f=(n,o)=>S(n,"name",{value:o,configurable:!0});import{hostOutput as y}from"../host/call-context.js";import{library14_parse as b}from"../vendor/runtime.js";import{authorityFor as $,writerFor as x,releaseSigner as k}from"../fold/signers.js";import{eraOf as L}from"../fold/digests.js";import{fieldOf as r,foldClaims as R}from"../fold/claims.js";import{observeText as A}from"../observe/files.js";import{claimLinesIn as O}from"./args.js";import{library14_LOCK as z}from"../vendor/runtime.js";import{join as C}from"node:path";function K(n,o){const a=R(n).standing,s=x(a,"authorize");if(!s)throw Error("REFUSE\xB7release place names no authorizer");const l=f((e,t,c)=>{const i=e.filter(h=>r(h,"scope")===t&&(!c||r(h,"measure")===c)&&r(h,"value")!=="withdraw");if(i.length!==1)throw Error(`REFUSE\xB7release ${t} needs one declaration`);return r(i[0],"value")},"one"),U={...k(a),id:s,publicKey:l(a,`keys/${s}`,"public-key"),coverage:l(a,`keys/${s}`,"coverage").split("|")};if(!o.length)throw Error("REFUSE\xB7release empty approval");for(const e of o){const t=b(e);if(t.kind!=="fact")throw Error("REFUSE\xB7release malformed approval");if(t.value.fields.by!==s||!t.value.fields.sig)throw Error(`REFUSE\xB7release approval must be signed by ${s}`)}const u=o.filter(e=>["wire/signature-algorithms","audit/wire/signature-algorithms","wire/era","audit/wire/era"].includes(r(e,"scope")));let m;try{m=L(u.length?R(u).standing:a)}catch{throw Error("REFUSE\xB7release signature era is absent or conflicting")}const F=$([],U,m.admitted);for(const e of o){const t=F.of(e);if(t.kind!=="admitted")throw Error(`REFUSE\xB7release ${r(e,"scope")}: ${t.why??t.kind}`)}const w=o.filter(e=>/^release\/[^/]+$/.test(r(e,"scope"))&&r(e,"measure")==="digest"&&r(e,"role")==="writes");if(w.length!==1)throw Error("REFUSE\xB7release needs one signed release/<tag> digest");const d=f((e,t)=>{const c=o.filter(i=>r(i,"scope")===e);if(c.some(i=>r(i,"role")!=="writes"||r(i,"form")!=="alphabet"||r(i,"measure")!==t))throw Error(`REFUSE\xB7release ${e} is not an approval declaration`);return l(c,e,t)},"required"),g=d(r(w[0],"scope"),"digest"),v=d("release/artifact","id"),E=d("sources/archive","id");if(!/^sha256:[a-f0-9]{64}$/.test(g))throw Error("REFUSE\xB7release archive needs sha256");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(v))throw Error("REFUSE\xB7release artifact needs one safe filename");let p;try{p=new URL(E)}catch{throw Error("REFUSE\xB7release archive source needs an absolute URL")}if(p.username||p.password||/[\s\x00-\x1f\x7f]/.test(E))throw Error("REFUSE\xB7release archive source needs a credential-free absolute URL without whitespace");return`READY ${g} ${v} ${E}`}f(K,"releaseApproval");function H(n,o){const a=A(o);if(a===void 0)throw Error("REFUSE\xB7release approval file is absent");const s=a.split(`
|
|
2
|
+
`).filter(l=>l.trim().length>0);y("out",K(O(C(n,z)),s)+`
|
|
3
|
+
`)}f(H,"printReleaseApproval");export{H as printReleaseApproval,K as releaseApproval};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var r=Object.defineProperty;var m=(e,t)=>r(e,"name",{value:t,configurable:!0});import{foldCeilings as u,ceilingSummary as c}from"../fold/ceilings.js";import{currentActReadings as f}from"../fold/own.js";import{placedReadings as g}from"../fold/observed.js";import{placesIn as b}from"../fold/places.js";import{releasePolicy as h,releaseFaults as y}from"../fold/release-policy.js";import{attestationObservations as p}from"../fold/evidence.js";import{
|
|
1
|
+
var r=Object.defineProperty;var m=(e,t)=>r(e,"name",{value:t,configurable:!0});import{foldCeilings as u,ceilingSummary as c}from"../fold/ceilings.js";import{currentActReadings as f}from"../fold/own.js";import{placedReadings as g}from"../fold/observed.js";import{placesIn as b}from"../fold/places.js";import{releasePolicy as h,releaseFaults as y}from"../fold/release-policy.js";import{attestationObservations as p}from"../fold/evidence.js";import{library14_parse as v}from"../vendor/runtime.js";import{library0_point as w,library0_region as _,library0_within as k}from"../vendor/runtime.js";function O(e,t,o=f(e.under)){const s={...e.own,...o},a=u({standing:e.standing,ceilings:t,observed:e.observed,own:s,epoch:e.epoch,...e.under?{under:e.under,places:new Set(b(e.root))}:{}}),d=e.standing.filter(n=>!e.grey.includes(n)&&!e.refused.includes(n)),l=new Set(e.under?g(e.observed).filter(n=>!k(w(n.place.replace(/\/\*$/,"")),_(e.under))).map(n=>n.question):[]);return{...e,kept:!0,own:s,ceilings:c(a,t.length,l),release:h({standing:d,demands:e.demands,paid:e.paid,ceilings:t,readings:a,faults:y(e),verdicts:p(d.map(n=>{const i=v(n);return i.kind==="fact"?i.value.fields:{}}),e.second),snapshot:{fold:e.key,instrument:e.instrument}})}}m(O,"refreshRetainedJudgment");export{O as refreshRetainedJudgment};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);return}const i=a(t);
|
|
1
|
+
var e=Object.defineProperty;var o=(t,n)=>e(t,"name",{value:n,configurable:!0});import{hostOutput as r}from"../host/call-context.js";import{hasContextualPlace as m,contextualStanding as s}from"../host/contextual-place.js";import{publicStandingLines as a}from"../host/admitted-place.js";import{assertStandingView as f}from"../host/standing-projection.js";import{lockStanding as p}from"../fold/keys.js";import{storeOf as u}from"../land/ledger.js";function O(t){const n=u(t);if(f(p(n)),m(t)){r("out",JSON.stringify(s(t))+`
|
|
2
|
+
`);return}const i=a(t);r("out",i.length?i.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`:"")}
|
|
4
|
+
`:"")}o(O,"printStandingResult");export{O as printStandingResult};
|
package/dist/cli/takes.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);return}if(
|
|
3
|
-
`);return}const{scope:
|
|
4
|
-
`);const
|
|
5
|
-
MOVED ${
|
|
6
|
-
IGNORED ${[...
|
|
7
|
-
${
|
|
8
|
-
`:""}EFFECTS ${
|
|
9
|
-
RECEIPT ${
|
|
10
|
-
`)}
|
|
1
|
+
var x=Object.defineProperty;var w=(l,o)=>x(l,"name",{value:o,configurable:!0});import{hostOutput as T}from"../host/call-context.js";import{existsSync as R}from"node:fs";import{join as A}from"node:path";import{fullDigest as F}from"../fold/digests.js";import{library14_canonical as p}from"../vendor/runtime.js";import{fieldOf as r,foldClaims as D}from"../fold/claims.js";import{paidOf as I}from"../fold/paid.js";import{rolesOf as L}from"../fold/roles.js";import{writerFor as U}from"../fold/signers.js";import{judgeTake as V,sealed as W}from"../judge/take.js";import{land as $,landEnvelope as B,ledgerLines as G,storeOf as S}from"../land/ledger.js";import{wordOf as M}from"../fold/wire.js";import{hasVouchedTree as J,inside as P,landCoordinates as _,coordinatesOf as q,locationsOf as N,vouchedCoordinates as z,witnessOf as H}from"../land/vouched.js";import{ownerOf as K,forkedScopes as Q,signedOwnerLines as C}from"./owner.js";function ue(l,o,b){if(b&&!Number.isSafeInteger(b.now))throw Error("REFUSE\xB7demand invalid explicit clock");const a=Date.now(),s=S(l),d=r(o,"scope"),m=w(e=>({kind:"refused",scope:d,why:e}),"refuse");if(!J(s))return m("no source is vouched; land the lock once");if(Q(s).has(d))return m("it stands as a fork; the owner narrows or withdraws one line first");const f=r(o,"condition");if(f){const e=G(s,"judge").filter(h=>r(h,"scope")===f&&r(h,"value")==="present").pop();if(!e)return{kind:"owed",scope:d,why:`it rests on ${f}, which has no FACT: it stands owed until that is paid`};const i=N(r(o,"needs")).locations.filter(h=>!R(A(l,h.replace(/\/$/,""))));return i.length?m(`demanded locations absent: ${i.join(", ")}`):{kind:"conditioned",scope:d,demand:o,receipt:r(e,"at"),condition:f}}const{locations:g,refused:j}=N(r(o,"needs"));if(j.length)return m(`needs that are not locations: ${j.join(", ")}`);const n=L(s),k=new Map,y=w(e=>{const i=n(e);return i!=="source"&&k.set(i,(k.get(i)??0)+1),i},"walked"),u=new Map([...z(s)].filter(([e])=>g.some(i=>P(e,i))&&n(e)==="source")),v=new Map;for(const e of g)for(const[i,h]of q(l,e,y))v.set(i,h);const O=[d.split("/").pop()??d,r(o,"at").replace(/^witness:/,"")].filter(Boolean),E=D(C(s)).standing,t=I(s,[o],[],`${M(E,"families","view")}/`).missing.length===1,c=V({root:l,scope:d,value:r(o,"value"),locations:g,before:u,after:v,law:O,unpaid:t,shape:r(o,"shape"),restsOn:r(o,"restsOn"),witnessOf:w(e=>H(l,e),"witnessOf"),template:M(D(C(s)).standing,"templates","{roots}")});return{kind:"judged",scope:d,demand:o,locations:g,before:u,after:v,verdict:c,ignored:k,started:a}}w(ue,"judgeDemand");function pe(l,o,b){const a=S(l);if(o.kind==="refused")return;if(o.kind==="owed"){T("out",`OWED take ${o.scope} \xB7 ${o.why}
|
|
2
|
+
`);return}if(o.kind==="conditioned"){const{scope:t,demand:c,receipt:e,condition:i}=o;$(a,"judge",[p({scope:t,role:"writes",form:"alphabet",measure:r(c,"measure")||"status",value:r(c,"value")||"present",by:"judge",at:e,condition:i})]),$(a,"take",[p({scope:`take/${t}`,role:"writes",form:"alphabet",measure:"status",value:"fact",by:"judge",at:e})]),T("out",`FACT take ${t} \xB7 paid by ${e} \xB7 condition ${i} \xB7 no moved set
|
|
3
|
+
`);return}const{scope:s,demand:d,before:m,after:f,ignored:g,started:j}=o,n=W(l,o.verdict,b),k=U(C(a),"fold")??K(a),y=F(a,[...m].map(([t,c])=>`${t} ${c}`));$(a,"take",[p({scope:`take/${s}`,role:"writes",form:"alphabet",measure:"status",value:"open",by:k,at:`place:${y}`})]),B(a,n.digest,`${JSON.stringify(n.envelope,null,1)}
|
|
4
|
+
`);const u=`receipt:${n.digest}`,v=F(a,[...f].sort().map(([t,c])=>`${t} ${c}`));if($(a,"judge",n.envelope.effects.map(t=>p({scope:`${t.kind}/${v}`,role:"writes",form:"alphabet",measure:"status",value:t.status,by:"judge",at:u}))),n.kind==="fact"){const t=new Map(n.changed.filter(e=>f.has(e)).map(e=>[e,f.get(e)??""])),c=n.changed.filter(e=>!f.has(e));_(a,t,c,u),$(a,"judge",[p({scope:s,role:"writes",form:"alphabet",measure:r(d,"measure")||"status",value:r(d,"value")||"present",by:"judge",at:u}),p({scope:s,role:"writes",form:"alphabet",measure:"cone",value:(n.changed.length?n.changed:[...f.keys()].sort()).join("|"),by:"judge",at:u})])}const O=Date.now()-j;$(a,"take",[p({scope:`take/${s}`,role:"writes",form:"alphabet",measure:"status",value:n.kind,by:"judge",at:u}),p({scope:`take/${s}`,role:"writes",form:"interval",measure:"ms",value:`${O}..${O}`,by:"judge",at:u})]);const E=n.envelope.effects.map(t=>`${t.kind}@${t.at||"."}:${t.admitted?t.status:`${t.status}\xB7grey`}(${t.ms} ms)`).join(" ")||"none";T("out",`${n.kind==="fact"?"FACT ":"REFUSE"} take ${s} \xB7 ${n.why}
|
|
5
|
+
MOVED ${n.changed.length} sources: ${n.changed.join(" ")}
|
|
6
|
+
IGNORED ${[...g].map(([t,c])=>`${c} ${t}`).join(" \xB7 ")||"none"} (not walked, never landed)
|
|
7
|
+
${n.notOwned.length?`NOT OWN ${n.notOwned.length} witnesses of other laws, left for them: ${n.notOwned.join(" ")}
|
|
8
|
+
`:""}EFFECTS ${E}
|
|
9
|
+
RECEIPT ${n.digest} \xB7 ${O} ms
|
|
10
|
+
`)}w(pe,"landTake");export{ue as judgeDemand,pe as landTake};
|
package/dist/cli/verb.js
CHANGED
|
@@ -1,84 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`),
|
|
4
|
-
`),
|
|
5
|
-
`);const
|
|
6
|
-
TARGET ${
|
|
7
|
-
`);for(const
|
|
8
|
-
`);if(!
|
|
9
|
-
`)}return
|
|
10
|
-
`),n!==void 0){if(!t.kept){const
|
|
11
|
-
`)}
|
|
2
|
+
var tt=Object.defineProperty;var $=(e,t)=>tt(e,"name",{value:t,configurable:!0});import{hostOutput as s,hostArguments as nt}from"../host/call-context.js";import{serveNativeCommands as it}from"../host/command-server.js";import{authenticatedStanding as rt}from"../host/admitted-place.js";import{prepareNativeProbe as ot}from"../host/native/probes.js";import{nativeAuthorityCardView as st}from"../host/native/authority-card-view.js";import{prepareNativeReadingIdentity as at,prepareNativeViewIdentity as ct,prepareNativeViewIdentities as lt,declaredReadingIdentityLimits as Fe}from"../host/reading-identity.js";import{nativeHostInstrument as te}from"../host/native-receiver.js";import{ownRoot as X,processOf as Y}from"../observe/runner.js";import{BoundRefusal as O,refusalRecord as dt}from"../host/refusals.js";import{readFileSync as Oe}from"node:fs";import{sha256 as Q}from"../host/hash.js";import{printReleaseApproval as ft}from"./release-result.js";import{inspectReference as ut}from"../host/reference.js";import{exportAuthenticatedReference as pt}from"../host/reference-export.js";import{authenticatedReferenceSelected as mt,openAuthenticatedReference as ht}from"../host/reference-native.js";import{printActResult as gt}from"./act-result.js";import{printStandingResult as wt}from"./standing-result.js";import{withContentStore as Ue}from"../host/content-store.js";import{readOnly as xe,withoutEffects as Ne}from"../host/read-only.js";import{layReleases as yt}from"../host/release.js";import{resolveSources as Et,resolveRequested as $t}from"../host/source-content.js";import{cellsWithReceipts as bt}from"../host/cell-receipts.js";import{library12_renderCells as kt}from"../vendor/runtime.js";import{releasePolicyLines as St}from"../fold/release-policy.js";import{admittedObjects as Ce}from"../host/objects.js";import{objectFold as De,executeComputation as vt}from"../engine/index.js";import{readingEnvironment as Rt}from"../host/reading-context.js";import{verifyBytes as Ft}from"../host/adapters/keys/ed25519.js";import{instrumentDigest as Ot}from"../fold/digests.js";import{library14_authorityAtEpoch as Ut}from"../vendor/runtime.js";import{toposAt as xt,contentAt as Nt}from"../host/selected-topos.js";import{foldObjectsWithWasm as Ct,usesWasmObject as Te}from"../wasm/object.js";import{library14_OBJECT_VIEW as Dt}from"../vendor/runtime.js";import{library10_toposStanding as Tt}from"../vendor/runtime.js";import{library14_wireAt as jt,library14_parse as je}from"../vendor/runtime.js";import{lockStanding as me}from"../fold/keys.js";import{ownStore as It,ownLock as Ie}from"../observe/runner.js";import{signedOwnerLines as oe}from"./owner.js";import{existsSync as _,lstatSync as V,mkdirSync as Ae,writeFileSync as Le}from"node:fs";import{basename as At,dirname as he,join as se,relative as ge,resolve as b,sep as we}from"node:path";import{eraOf as Lt,signaturesOf as ye}from"../fold/digests.js";import{fullDigest as We}from"../host/digest.js";import{library14_canonical as ne}from"../vendor/runtime.js";import{EXTENSION as Wt,LOCK as Be,fieldOf as W,foldClaims as Bt,isWire as Je,selfName as A}from"../fold/claims.js";import{observedClaims as Jt,readerRefusals as qe}from"../fold/observed.js";import{rolesOf as qt}from"../fold/roles.js";import{authorityFor as ae,releaseSigner as Me,rootSigner as Ee,writerFor as $e}from"../fold/signers.js";import{land as ie,ledgerLines as ce,storeOf as w}from"../land/ledger.js";import{lockLines as be,releaseOf as Mt}from"../fold/keys.js";import{signConsentLot as _t}from"../land/sign.js";import{signerFor as Pt,frameSignerFor as Vt}from"../host/signing.js";import{admittedIn as zt,ownLockOf as Gt,tellOwn as Ht}from"../fold/signed.js";import{hasVouchedTree as Kt,landCoordinates as Xt,coordinatesOf as Yt,locationsOf as Qt,vouching as Zt,sourced as en}from"../land/vouched.js";import{observeText as ke}from"../observe/files.js";import{askWhy as tn,unrendered as nn,viewOf as rn}from"../render/view.js";import{openCards as on}from"../render/open.js";import{foldPlace as _e,ownCeilings as Pe,standingOf as z}from"./place.js";import{foldPoints as sn,movedPoints as an}from"../fold/kept.js";import{placesOf as cn,sharedShapes as ln,viewsOf as le}from"../fold/views.js";import{placesIn as dn}from"../fold/places.js";import{isCeiling as Se}from"../fold/configures.js";import{readingsIn as Ve}from"../land/inert.js";import{pass as fn}from"./pass.js";import{installActSignalHandler as un,underTheLock as pn,underTheRegions as mn,underRootAuthority as hn}from"../land/act.js";import{ownerOf as gn,renderInto as wn,signedDemands as yn,targetFile as de}from"./owner.js";import{claimLinesIn as re,entryOf as ve,namedPlaces as Re,positionalIndexes as En,positionalsOf as B,valueOf as N}from"./args.js";import{EXIT as l,FLAGS as g,NAMED_VIEWS as Z,helpLines as ze}from"./names.js";import{accept as $n,signedBatch as Ge}from"./accept.js";import{renderWalk as bn,landWalk as kn,foreignWalkLines as Sn}from"../host/walk.js";import{library13_isWalkHeader as vn}from"../vendor/runtime.js";import{ingressBundles as Rn,ingressReceipts as Fn}from"../host/ports/ingress.js";async function On(e,t){const a=Date.now(),n=w(e),i=re(de(e)),c=ke(de(e));let d,E,r,u=0,f;try{if(!i.length)throw new Error("REFUSE\xB7bootstrap the proposed lock holds no claims");const m=Lt(i),k=i.find(p=>["wire/digest-algorithms","audit/wire/digest-algorithms"].includes(W(p,"scope"))&&W(p,"value")!=="withdraw"),U=W(k??"","value").split("|").filter(Boolean)[0]?.split(":")[0]??"";if(!U)throw new Error("REFUSE\xB7bootstrap the proposed lock names no digest algorithm");if(d=$e(i,"authorize")??"",!d)throw new Error("REFUSE\xB7bootstrap the proposed lock declares no root authorizer");if(E=N(t,g.key)??d,ce(n,d).length)throw new Error("REFUSE\xB7bootstrap the owner ledger already holds claims; the first land happens once");const L=$(p=>{const x=new Set(i.filter(I=>W(I,"scope")===`keys/${d}`&&W(I,"measure")===p&&W(I,"value")!=="withdraw").map(I=>W(I,"value")));if(x.size!==1)throw new Error(`REFUSE\xB7bootstrap root key ${d} must declare one ${p}`);return[...x][0]},"said");if(L("class")!=="authorize")throw new Error("REFUSE\xB7bootstrap the root key must authorize");const y=L("public-key"),S=L("coverage").split("|").filter(Boolean);if(!y||!S.length)throw new Error("REFUSE\xB7bootstrap the root key must declare its public key and coverage");const D=i.filter(p=>!W(p,"sig"));if(D.length){const p=Pt(i,E,N(t,g.signer),N(t,g.keyFile)),x=await _t(D,{epoch:1,by:E,algorithm:m.era},y,m.admitted,p);if(x.kind==="refuse")throw new Error(x.why);let I=0;i.splice(0,i.length,...i.map(R=>W(R,"sig")?R:x.lines[I++]))}const q=ae(i,{...Me(i),id:d,publicKey:y,coverage:S},m.admitted);for(const p of i){const x=q.of(p);if(x.kind!=="admitted")throw new Error(`REFUSE\xB7bootstrap ${W(p,"scope")} is not admitted: ${x.why??x.kind}`);u+=1}Zt(i),en(i),r=We(i.map(p=>p.replace(/ sig="[^"]*"/,"")).sort(),U),f={[d]:{id:d,publicKey:y,coverage:S}}}catch(m){if(m instanceof O)throw m;return s("error",`${A()}: ${m instanceof Error?m.message:String(m)}
|
|
3
|
+
`),l.refuse}return pn(n,"bootstrap",()=>{if(ce(n,d).length||ke(de(e))!==c)return s("error",`${A()}: REFUSE\xB7bootstrap the proposed lock or owner ledger changed before commit
|
|
4
|
+
`),l.refuse;const m=ie(n,d,i);E!==d&&ie(n,E,i);const k=se(n,`${A()}.keys`);Ae(he(k),{recursive:!0}),Le(k,`${JSON.stringify(f,null,2)}
|
|
5
|
+
`);const U=i.filter(S=>/\bsig=/.test(S)),L=U.length-u;ie(n,"land",[ne({scope:"bootstrap",role:"writes",form:"alphabet",measure:"status",value:"present",by:"land",at:`bootstrap:${r}`,about:"the lines this clone was born from: one land per clone, and a second is a fork of the same cell"})]);const y=wn(e,n);s("out",`FACT landed ${m.appended} unique lines from ${i.length} in TARGET \xB7 ${L} of ${U.length} signed lines fail admission by declared authority
|
|
6
|
+
TARGET ${y.standing} claims \xB7 ${y.superseded.length} superseded \xB7 ${Date.now()-a} ms
|
|
7
|
+
`);for(const S of y.superseded)s("out",`SUPERSEDED ${S}
|
|
8
|
+
`);if(!Kt(n)){const S=new Set,D=new Set;for(const I of yn(n)){const R=Qt(W(I,"needs"));for(const P of R.locations)S.add(P);for(const P of R.refused)D.add(P)}const q=new Map,p=qt(n);for(const I of S)for(const[R,P]of Yt(e,I,p))q.set(R,P);const x=Xt(n,q,[],"origin:land");s("out",`FACT vouched \xB7 ${x} sources under ${S.size} locations \xB7 ${D.size} needs refused as globs
|
|
9
|
+
`)}return l.closed})}$(On,"firstLand");function fe(e,t,a){const n=$e(t.standing,"fold"),i=$(c=>`${(c/1e3).toFixed(c<100?2:1)} s`,"seconds");if(s("error",`BEAT fold ${t.key.slice(0,8)} ${t.kept?"kept":"folded"} ${i(a)}${t.beats.kept?` \xB7 ${i(t.beats.kept)} kept`:""}${t.beats.folded?` \xB7 ${i(t.beats.folded)} folded`:""}
|
|
10
|
+
`),n!==void 0){if(!t.kept){const c=an(w(e),sn(w(e),t.standing,t.under,n,t.instrument),t.key),d=c===void 0?"no fold was kept before this one":`${c.gone.length} points gone \xB7 ${c.came.length} came \xB7 ${[...c.gone,...c.came].slice(0,3).map(E=>E.split(" ")[0]).join(" ")||"none"}`;s("error",`KEPT fold ${t.key.slice(0,8)} miss \xB7 ${d}
|
|
11
|
+
`)}ie(w(e),n,[ne({scope:`beat/${t.under??"."}`,role:"writes",form:"interval",measure:"ms",value:`${a}..${a}`,by:n,at:`place:${t.kept?"kept":"folded"}`})])}}$(fe,"beat");async function ee(e,t,a,n=[],i,c,d=!0,E=!1){const[r=a,u,f,...m]=a.split("@");if(r===Z.help)return s("out",`${ze().join(`
|
|
12
12
|
`)}
|
|
13
|
-
`),
|
|
14
|
-
`),
|
|
15
|
-
`),
|
|
16
|
-
`),
|
|
17
|
-
`)
|
|
18
|
-
`),
|
|
19
|
-
`);return
|
|
20
|
-
|
|
21
|
-
`)
|
|
22
|
-
`);return
|
|
23
|
-
|
|
24
|
-
`);
|
|
25
|
-
|
|
26
|
-
`);return
|
|
27
|
-
`)
|
|
28
|
-
|
|
29
|
-
`),
|
|
13
|
+
`),l.closed;if(r==="authority-card"){if(t||n.length||i||!u||f!==void 0||m.length)throw new O("authority-card/selection","REFUSE\xB7authority-card/selection requires one admitted request scope");const o=await st(e,te(X(),Y("verb")),u);if(o.kind==="refuse")throw new O(o.code,o.diagnostic);return s("out",JSON.stringify(o)+`
|
|
14
|
+
`),l.closed}if(r==="probe"){if(t||n.length||i||!u||m.length||f==="")throw new O("reading-identity/selection","REFUSE\xB7probe requires one local native view");const o=Fe(rt(e)),h=ot({place:e,instrument:te(X(),Y("verb")),view:u,...f?{expectedIdentity:f}:{},port:{coordinate:"port/native-probe",probes:o.probes,responseBytes:o.bytes},counter:{used:new Map}});if(h.kind==="refuse")throw new O(h.code,h.diagnostic);return s("out",JSON.stringify(h)+`
|
|
15
|
+
`),l.closed}if(r==="reading-identities"){if(t||n.length||i||!u||f!==void 0||m.length)throw new O("reading-identity/selection","REFUSE\xB7native view identities require one local place and explicit views");const o=lt({place:e,instrument:te(X(),Y("verb")),views:u.split("+")});if(o.kind==="refuse")throw new O(o.code,o.diagnostic);return s("out",JSON.stringify(o)+`
|
|
16
|
+
`),l.closed}if(r==="reading-identity"&&u!==void 0){if(t||n.length||i||m.length||f==="")throw new O("reading-identity/selection","REFUSE\xB7native view identity requires one local place and a declared selector");const o=ct({place:e,instrument:te(X(),Y("verb")),view:u,...f?{expectedIdentity:f}:{}});if(o.kind==="refuse")throw new O(o.code,o.diagnostic);return s("out",JSON.stringify(f===void 0?{kind:o.kind,view:o.view,identity:o.identity}:o)+`
|
|
17
|
+
`),l.closed}if(r==="reading-identity"){if(t||n.length||i||u!==void 0)throw new O("host/context","REFUSE\xB7reading identity requires one local admitted place");const o=Fe(me(w(e))),h=await at({place:e,instrument:te(X(),Y("verb")),limits:o});if(h.kind==="refuse")throw new O(h.code,h.diagnostic);return s("out",JSON.stringify(h)+`
|
|
18
|
+
`),l.closed}if(!E&&!n.length&&!xe()&&me(w(e)).some(o=>/^reader\/.+\/port$/.test(W(o,"scope"))&&W(o,"role")==="writes"&&W(o,"value")!=="withdraw"))return hn(w(e),"view reader authority",()=>ee(e,t,a,n,i,c,d,!0));if(!be(w(e)).length)return s("error",`${A()}: the owner ledger is empty; land it before rendering a view
|
|
19
|
+
`),l.refuse;if(r==="act"){if(t||n.length)throw Error("REFUSE\xB7act committed identity query only");return gt(e,i),l.closed}if(r==="standing"){if(t||n.length||i||u!==void 0)throw new O("standing/query","REFUSE\xB7standing local committed projection only");return wt(e),l.closed}if(r==="evidence"&&!t&&!n.length&&Rn(w(e)).length){const o=le(me(w(e))).get(r);if(!o||o.shape||!o.regions.some(j=>j.name==="evidence"))throw Error("REFUSE\xB7view foreign evidence requires a declared evidence view");const h=await Sn(e),T=ae(be(w(e)),Ee(e),ye(w(e)).admitted),C=[...new Set(T.admitted.flatMap(j=>ce(w(e),j.id)))].filter(j=>T.of(j).kind==="admitted");for(const j of[...new Set([...C,...Fn(w(e)),...h])])s("out",j+`
|
|
20
|
+
`);return s("out",`FACT authenticated histories \xB7 readings \xB7 no encounters computed
|
|
21
|
+
`),l.closed}const k=Date.now(),U=t?.replace(/\/$/,""),L=Mt(w(e)),y=ae([...L??be(w(e)),...n],L?Me(L):Ee(e),ye(w(e),n).admitted),S=n.filter(o=>y.of(o).kind==="admitted"),D=n.filter(o=>!S.includes(o));if(U&&D.length&&Ht(U,D),r===Z.lines&&(n.length||u===void 0)){const o=z(e,t,S).standing.filter(Je).join(`
|
|
22
|
+
`);return s("out",o?`${o}
|
|
23
|
+
`:""),l.closed}if(n.length){const o=le(z(e,t,S).standing).get(r);if(o&&!o.shape&&o.regions.some(h=>h.name==="cells")){const h=[...oe(w(e)),...S],T=await Ce(e,h);s("out",`TOLD ${n.length} lines folded as if landed \xB7 nothing written
|
|
24
|
+
`);for(const C of kt(De(T.records,T.context)))s("out",C+`
|
|
25
|
+
`);return l.closed}}const q=U?D.filter(o=>zt(e,U,o)):[];!n.length&&!xe()&&yt(w(e),e,z(e,t).standing,w(e));const p=n.length?_e(e,ve(e),t,!1,{standing:z(e,t,S),observed:Jt(e,w(e),{wait:!1}),free:!0}):_e(e,ve(e),t,!0);if(!n.length&&qe().length){for(const o of qe())s("error",`${A()}: ${o}
|
|
26
|
+
`);return l.refuse}if(i&&tn(p,i),r===Z.lines){n.length||fe(e,p,Date.now()-k);const o=p.standing.filter(Je).join(`
|
|
27
|
+
`);if(s("out",o?`${o}
|
|
28
|
+
`:""),u==="1")for(const h of Ve([...p.standing.filter(Se),...Pe(t)],p))s("out",`${h}
|
|
29
|
+
`);return l.closed}const x=le(p.standing),I=[...x.entries()].find(([,o])=>!o.shape&&o.regions.some(h=>h.name==="cells"));if(I&&r===I[0]){const o=oe(w(e)),{objectHistory:h}=await import("../vendor/library14.js"),T=h(o);if(T.kind!=="fact")throw Error(`REFUSE\xB7wire ${T.why}`);if(T.value.objects.length){if(await bt(e,o,v=>s("out",v+`
|
|
30
|
+
`)),d)for(const v of St(p.release))s("out",v+`
|
|
31
|
+
`);return n.length||fe(e,p,Date.now()-k),l.closed}n.length||fe(e,p,Date.now()-k);const C=p.open??[],j=c?C.filter(v=>v.origins.includes(c)):C,F=on(j);return c&&s("out",`KEY ${c}
|
|
32
|
+
`),F.length&&s("out",`${F.join(`
|
|
30
33
|
`)}
|
|
31
|
-
`),
|
|
32
|
-
`),
|
|
33
|
-
`),
|
|
34
|
-
`),
|
|
35
|
-
`),
|
|
36
|
-
`),
|
|
37
|
-
`),
|
|
38
|
-
`),
|
|
39
|
-
`),
|
|
40
|
-
`),
|
|
41
|
-
`);return
|
|
34
|
+
`),l.closed}if(n.length||fe(e,p,Date.now()-k),r==="rank"){const h=(U?[U]:dn(e)).flatMap(T=>ln(Gt(e,T)).map(C=>`${T} ${C}`));if(h.length)return s("error",`${A()}: REFUSE\xB7rank ${h.join(" \xB7 ")}: two views naming the same shape in one place
|
|
35
|
+
`),l.refuse}const R=x.get(r);if(!R)return s("error",`${A()}: no view/${r} is signed; the lock signs ${[...x.keys()].sort().map(o=>`view/${o}`).join(" \xB7 ")||"no view"}
|
|
36
|
+
`),l.usage;const P=nn(p,R);if(P.length)return s("error",`${A()}: REFUSE\xB7view view/${r} asks regions nothing renders: ${P.join(" ")} \xB7 none is the instrument's own and no capsule ${t??"the root"} can run declares it
|
|
37
|
+
`),l.refuse;const G=cn(p.standing,R);if(G.length&&!G.includes(t??""))return s("error",`${A()}: view/${r} writes ${G.map(o=>`${o}${R.shape}`).join(" \xB7 ")}, and nothing of ${t??"this place"}
|
|
38
|
+
`),l.usage;const H=$e(p.standing,"fold");if(H!==void 0&&!n.length){const o=Date.now()-k;ie(w(e),H,[ne({scope:`beat/${t??"."}`,role:"writes",form:"interval",measure:"ms",value:`${o}..${o}`,by:H,at:`place:command-${p.kept?"kept":"folded"}`})])}return $(o=>{const h=rn(o,Number.isFinite(Number(u))&&u!==void 0?{...R,regions:R.regions.map(C=>C.called?{...C,at:Number(u)}:C)}:R);if((nt()??process.argv).includes(g.check)){const C=se(e,t??"",R.shape||""),j=R.shape?ke(C):void 0;if(j!==void 0&&j===h)return s("out",`SAME ${R.shape||`view/${r}`}
|
|
39
|
+
`),l.closed;const v=(j??"").split(`
|
|
40
|
+
`),J=h.split(`
|
|
41
|
+
`),K=v.findIndex((Ze,et)=>Ze!==J[et]),M=K<0?Math.min(v.length,J.length):K,Qe=(K<0?J[M]:v[M])??J[M]??"";return s("out",`DIFFERS ${R.shape||`view/${r}`}${j===void 0?" \xB7 this place holds no such region":` \xB7 line ${M+1} \xB7 ${Qe}`}
|
|
42
|
+
`),l.refuse}if(!R.shape||n.length){if(n.length&&s("out",`TOLD ${n.length} lines folded as if landed \xB7 ${S.length} in the ledger \xB7 ${q.length} in ${U??"the root"}'s own lock${D.length-q.length?` \xB7 ${D.length-q.length} admitted nowhere`:""} \xB7 the batch lands nothing and nothing is written
|
|
43
|
+
`),s("out",h),u==="1")for(const C of Ve(n.length?n.filter(Se):[...o.standing.filter(Se),...Pe(t)],o))s("out",`${C}
|
|
44
|
+
`);return l.closed}const T=se(e,t??"",R.shape);return mn(w(e),[t??""],`view/${r}`,()=>(Ae(he(T),{recursive:!0}),Le(T,h),s("out",`RENDERED ${ge(e,T).split(we).join("/")} \xB7 view/${r} \xB7 ${h.split(`
|
|
42
45
|
`).length-1} lines
|
|
43
|
-
`),
|
|
44
|
-
`),
|
|
45
|
-
`),
|
|
46
|
-
`);for(const i of n.signed)
|
|
47
|
-
`);return
|
|
48
|
-
`),
|
|
49
|
-
`),
|
|
50
|
-
`)
|
|
51
|
-
`)
|
|
52
|
-
`),d.refuse}}w(Rn,"landVerb");function vn(e){const t=ee(e),o=Ct(t),i=o.standing.flatMap(c=>{const y=Te(c);return y.kind==="fact"?[y.value.fields]:[]}).some(c=>c.scope?.startsWith("region/")&&c.measure==="reads");if(i&&o.forks.length)throw Error("REFUSE\xB7topos incompatible live claims in declared fold");const s=i?Ut(o.standing):void 0;if(s!==void 0){const y=xt(je().flatMap(r=>{const f=Te(r);return f.kind==="fact"?[f.value.fields]:[]}),Number.MAX_SAFE_INTEGER)?.digests.values().next().value;if(!y)throw Error("REFUSE\xB7topos instrument names no digest algorithm");process.stdout.write(s.split(`
|
|
46
|
+
`),l.closed))},"shown")(p)}$(ee,"view");async function Un(e,t){const a=N(t,g.as);if(a!==void 0){const i=B(t);if(a!=="reference"||i.length!==1||t.includes(g.check))throw new O("reference-export/usage","REFUSE\xB7reference-export usage: sign --as reference <source-url>");const c=await pt(e,i[0],{key:N(t,g.key),keyFile:N(t,g.keyFile),signer:N(t,g.signer)});return s("out",JSON.stringify(c)+`
|
|
47
|
+
`),l.closed}const n=await Ge(e,t,B(t));if(n.kind==="exit")return n.code;if(n.kind==="once")return s("error",`ONCE ${n.proposed.length} lines \xB7 every one already landed: nothing to sign
|
|
48
|
+
`),l.closed;for(const i of Re(t))s("out",`# place ${i}
|
|
49
|
+
`);for(const i of n.signed)s("out",`${i}
|
|
50
|
+
`);return s("error",`SIGNED ${n.signed.length} lines \xB7 epoch ${n.epoch}${Re(t).length?` \xB7 own lines for ${Re(t).join(", ")}`:""} \xB7 they land together, before the lock moves
|
|
51
|
+
`),l.closed}$(Un,"signVerb");async function xn(e,t){const a=b(de(e)),n=B(t).filter(i=>{const c=b(i);return _(c)&&!V(c).isDirectory()&&c!==a});if(!n.length){const i=w(e);return _(se(i,"ledger"))&&ce(i,gn(i)).length?(s("error",`${A()}: REFUSE\xB7bootstrap the owner ledger already holds claims; provide an explicit signed batch to change it
|
|
52
|
+
`),l.refuse):On(e,t)}try{const i=n.flatMap(re);if(i.some(vn)){for(const c of await kn(e,i,N(t,g.key),N(t,g.keyFile),N(t,g.signer)))s("out",c+`
|
|
53
|
+
`);return l.closed}return await $n(e,t)}catch(i){if(i instanceof O)throw i;const c=i instanceof Error?i.message:String(i);return s("error",`${A()}: ${c.startsWith("REFUSE\xB7")?c:`REFUSE\xB7crash ${c}`}
|
|
54
|
+
`),l.refuse}}$(xn,"landVerb");function Nn(e){const t=re(e),a=Bt(t),i=a.standing.flatMap(d=>{const E=je(d);return E.kind==="fact"?[E.value.fields]:[]}).some(d=>d.scope?.startsWith("region/")&&d.measure==="reads");if(i&&a.forks.length)throw Error("REFUSE\xB7topos incompatible live claims in declared fold");const c=i?Tt(a.standing):void 0;if(c!==void 0){const E=jt(Ie().flatMap(r=>{const u=je(r);return u.kind==="fact"?[u.value.fields]:[]}),Number.MAX_SAFE_INTEGER)?.digests.values().next().value;if(!E)throw Error("REFUSE\xB7topos instrument names no digest algorithm");s("out",c.split(`
|
|
53
55
|
`).filter(Boolean).map(r=>"TOPOS "+r).join(`
|
|
54
56
|
`)+`
|
|
55
|
-
`),
|
|
56
|
-
`)}for(const
|
|
57
|
-
`);for(const
|
|
58
|
-
`);return
|
|
59
|
-
`),
|
|
60
|
-
`);for(const
|
|
61
|
-
`).filter(Boolean))
|
|
62
|
-
`);for(const
|
|
63
|
-
`);return
|
|
64
|
-
`),
|
|
65
|
-
`)
|
|
66
|
-
`);
|
|
67
|
-
`)
|
|
68
|
-
`);return d.
|
|
69
|
-
`)
|
|
57
|
+
`),s("out","PIN "+We([c],E)+`
|
|
58
|
+
`)}for(const d of a.standing)s("out",`${d}
|
|
59
|
+
`);for(const d of a.forks)s("out",`FORK ${d.key}${d.state?` \xB7 ${d.state}`:""}
|
|
60
|
+
`);return s("out",`FACT ${a.standing.length} standing \xB7 ${a.forks.length} forks \xB7 ${At(e)} \xB7 readings \xB7 no encounters computed
|
|
61
|
+
`),l.closed}$(Nn,"foldFile");function Cn(e,t){const a=B(t).filter(r=>/^#(?:bound|topos-reference)(?::|$)/.test(r));if(a.length){if(a.length!==1||B(t).length!==1||t.some(r=>r.startsWith("--")))throw Error("REFUSE\xB7reference name one reference without view, check or signing options");if(mt(z(e).standing)){if(a[0].startsWith("#topos-reference:"))throw Error("REFUSE\xB7reference located profile is inspection only; authenticated opening requires its declared carrier");return ht(e,a[0]).then(r=>{s("out",`SOURCE ${r.reference.source}
|
|
62
|
+
`);for(const u of r.semanticStanding.split(`
|
|
63
|
+
`).filter(Boolean))s("out",`TOPOS ${u}
|
|
64
|
+
`);for(const u of r.readings)s("out","CELL "+JSON.stringify(u)+`
|
|
65
|
+
`);return s("out",`AUTHENTICATED standing ${r.semanticIdentity} \xB7 authority ${r.authorityContextIdentity} \xB7 no effects committed
|
|
66
|
+
`),l.closed})}return ut(a[0],z(e).standing).then(r=>{const u="source"in r.reference?r.reference.source:r.reference.location;if(u&&s("out",`SOURCE ${u}
|
|
67
|
+
`),"needs"in r)return s("out",`NEEDS ${r.needs} \xB7 unauthenticated inspection
|
|
68
|
+
`),l.closed;for(const f of r.lines)s("out",`TOPOS ${f}
|
|
69
|
+
`);return s("out",`INSPECT standing sha256:${r.reference.digest} \xB7 blob ${r.reference.blob} \xB7 no encounters computed \xB7 unauthenticated
|
|
70
|
+
`),l.closed})}const n=B(t).filter(r=>_(b(r))&&!V(b(r)).isDirectory()&&r.endsWith(Wt)),i=B(t).filter(r=>_(b(r))&&V(b(r)).isDirectory());if(n.length===1&&!i.length&&N(t,g.as)===void 0){const r=b(n[0]);return!r.endsWith(`/${Be}`)&&r!==Be?Nn(r):ue(he(r),void 0,t)}const c=i[0],d=n.length?e:b("."),E=c?ge(d,b(c)).split(we).join("/"):"";return ue(d,E?`${E}/`:void 0,t)}$(Cn,"foldVerb");async function ue(e,t,a){return Ue(w(e),()=>Dn(e,t,a),()=>z(e,t).standing)}$(ue,"foldAt");async function Dn(e,t,a){const n=N(a,g.as),i=n!==void 0&&B(a).some(c=>_(b(c))&&!V(b(c)).isDirectory());if(["reading-identity","reading-identities","probe","authority-card"].includes(n?.split("@")[0]??"")&&(i||t||a.includes(g.check)))throw new O("reading-identity/selection","REFUSE\xB7reading-identity/selection preparation does not sign batches or check rendered output");return["reading-identity","reading-identities","probe","authority-card"].includes(n?.split("@")[0]??"")||n==="release"||n?.split("@")[0]==="act"||n===Z.help||i||a.includes(g.check)?He(e,t,a):$t(c=>Et(z(e,t).standing,[c]),()=>He(e,t,a))}$(Dn,"foldRequested");async function He(e,t,a){const n=N(a,g.as);if(n==="release"){const f=B(a).filter(m=>!(_(b(m))&&V(b(m)).isDirectory()));if(f.length!==1||a.includes(g.check))throw Error("REFUSE\xB7release name one approval file; check does not authorize delivery");return Ne(()=>(ft(t?b(e,t):e,b(f[0])),l.closed))}const i=B(a).filter(f=>_(b(f))&&!V(b(f)).isDirectory()),c=n===void 0&&a.includes(g.check);if(n?.split("@")[0]==="walk"){if(a.includes(g.check))throw Error("REFUSE\xB7walk check does not initiate or sign an exchange");if(t||i.length>1)throw Error("REFUSE\xB7walk one place and one authenticated peer inventory per fold");const f=n.split("@")[1];if(f!==void 0&&(!/^(0|[1-9][0-9]*)$/.test(f)||!Number.isSafeInteger(Number(f))))throw Error("REFUSE\xB7walk invalid resolution");const m=i.length?re(i[0]):[];for(const k of await bn(e,f===void 0?void 0:Number(f),m,N(a,g.key),N(a,g.keyFile),N(a,g.signer)))s("out",k+`
|
|
71
|
+
`);return l.closed}if(n===Dt||n==="computation"){const f=B(a).filter(y=>_(b(y))&&!V(b(y)).isDirectory());if(f.length>1)throw Error("REFUSE\xB7object one history snapshot per fold");const m=f.length?re(f[0]):oe(w(e)),k=await Ce(e,m,y=>(n==="computation"?process.stderr:process.stdout).write(y+`
|
|
72
|
+
`)),U=$(async()=>{if(Te(k.configuration)){const y=new AbortController,S=$(()=>y.abort(),"interrupt");process.once("SIGINT",S);try{return await Ct(e,k.records,k.context,k.configuration,y.signal)}finally{process.removeListener("SIGINT",S)}}return De(k.records,k.context)},"project");if(n==="computation"){if(t||a.includes(g.check))throw new O("computation/context","REFUSE\xB7computation/context");const y=$(F=>{const v=k.configuration.filter(J=>J.scope===F&&J.value!=="withdraw");if(v.length!==1)throw new O("computation/context","REFUSE\xB7computation/context");return v[0].value},"one");if(y("view/computation")!=="computation@1")throw new O("computation/context","REFUSE\xB7computation/context");const S=$(F=>{const v=/^0\.\.([1-9][0-9]*)$/.exec(y(F)),J=Number(v?.[1]);if(!v||!Number.isSafeInteger(J))throw new O("computation/budget","REFUSE\xB7computation/budget");return J},"resource"),D=N(a,g.key),q=ye(w(e)),p=ae(m,Ee(e),q.admitted),x=p.admitted.find(F=>F.id===D),I=Math.max(...m.map(F=>Number(W(F,"epoch")||0)));if(!D||!x||Ut({scope:"computation",by:D},x,I,"computation","authority").kind!=="admitted")throw new O("computation/authority","REFUSE\xB7computation/authority");const R=new TextEncoder().encode(m.join(`
|
|
70
73
|
`)+`
|
|
71
|
-
`),
|
|
72
|
-
`)),
|
|
73
|
-
`),"evaluate"),sign:
|
|
74
|
-
`),
|
|
75
|
-
`);return
|
|
76
|
-
`),
|
|
77
|
-
`),
|
|
78
|
-
`),
|
|
79
|
-
`),
|
|
80
|
-
`),
|
|
81
|
-
`),
|
|
82
|
-
`)}
|
|
83
|
-
`)
|
|
84
|
-
`),He(e instanceof A?e:new A("operation/failed",t)),process.exitCode=d.refuse},"refused");cn();try{const e=Un(process.argv.slice(2));e instanceof Promise?e.then(Ke).catch(Xe):Ke(e)}catch(e){Xe(e)}
|
|
74
|
+
`),P=Q(k.configuration.map(F=>ne(F)).join(`
|
|
75
|
+
`)),G=new Map;for(const F of new Set(k.records.filter(v=>v.record==="cell").map(v=>v.fields.topos))){G.set("form/"+F,F);const v=xt(F),J=v.parts.find(K=>K.scope==="wire/topos/context-view")?.value;for(const K of v.parts.filter(M=>M.kind==="check"&&M.view===J))for(const M of(K.restsOn??"").split("|").filter(Boolean))Nt(M),G.set("form-module/"+M,M)}const H=Ot(It(),Y("verb"),Ie(),X()),pe=Te(k.configuration)?["manifest.json","runtime.js","runtime.wasm","guest.js"].map(F=>[F,Q(Oe(new URL("../../assets/wasm/"+F,import.meta.url)))]):[],o=pe.length?Q(JSON.stringify([H,pe])):H,h=Vt(k.configuration.map(F=>ne(F)),D,N(a,g.signer),N(a,g.keyFile)),T={maxBytes:S("computation/bytes"),timeoutMs:S("computation/milliseconds")},C={contract:y("computation/contract"),numericPolicy:y("computation/numeric-policy"),reading:{instrument:H,implementation:o,policy:P,inputs:[...G],environment:Rt(Q)},keyId:D,algorithm:q.era},j=await vt(C,R,{digest:Q,evaluate:$(async()=>new TextEncoder().encode(JSON.stringify(await U())+`
|
|
76
|
+
`),"evaluate"),sign:h,verify:$(async(F,v,J)=>v.keyId===D&&Ft(F,x.publicKey,v.signature,[J]),"verify")},T);return s("out",JSON.stringify({profile:"bound-computation-delivery@1",context:C,input:new TextDecoder().decode(R),statement:j.statement,output:new TextDecoder().decode(j.output)})+`
|
|
77
|
+
`),l.closed}const L=await U();for(const y of L)s("out","CELL "+JSON.stringify(y)+`
|
|
78
|
+
`);return s("out",`FACT object fold ${L.length} cells
|
|
79
|
+
`),l.closed}const d=N(a,g.key);if(n===void 0){const f=await fn(e,ve(e),t,a.includes(g.check));if(c||f!==0)return f;const m=oe(w(e)),{objectHistory:k}=await import("../vendor/library14.js"),U=k(m);if(U.kind!=="fact")throw Error(`REFUSE\xB7wire ${U.why}`);if(U.value.objects.length){const L=[...le(m).values()].find(y=>!y.shape&&y.regions.some(S=>S.name==="cells"));if(!L)throw Error("REFUSE\xB7view object cells require a signed cells view");return ee(e,t,L.name,[],void 0,void 0,!1)}return f}const E=i,r=B(a).find(f=>f!==t?.replace(/\/$/,"")&&!f.startsWith("-")&&!(_(b(f))&&V(b(f)).isDirectory()));if(n==="act"){if(B(a).length!==1)throw Error("REFUSE\xB7act name one committed identity");return ee(e,t,n,[],r)}if((n==="why"||n===Z.because||n.split("@")[0]==="why")&&r!==void 0)return ee(e,t,n===Z.because?"why":n,[],r,d);if(!E.length)return ee(e,t,n,[],void 0,d);const u=await Ge(e,a,E);return u.kind==="exit"?u.code:(u.kind==="once"&&s("out",`ONCE ${u.proposed.length} lines \xB7 every one already landed: the view folds the tree as it stands
|
|
80
|
+
`),Ne(()=>ee(e,t,n,u.kind==="signed"?u.signed:u.proposed,void 0,d)))}$(He,"foldResolved");const Ke={fold:$((e,t)=>Cn(e,t),"fold"),land:$((e,t)=>xn(e,t),"land"),sign:$((e,t)=>Un(e,t),"sign")};function Tn(e){for(let c=0;c<e.length;c+=1){const d=e[c];if(d.startsWith("--")){if(!Object.values(g).includes(d))return s("error",`${A()}: REFUSE\xB7flag unknown option ${d}
|
|
81
|
+
`),l.usage;if(d!==g.check){if(e[c+1]===void 0||e[c+1].startsWith("--"))return s("error",`${A()}: REFUSE\xB7flag ${d} needs a value
|
|
82
|
+
`),l.usage;c+=1}}}const t=e[0]??"",a=t in Ke?Ke[t]:void 0,n=B(a===void 0?e:e.slice(1)).filter(c=>_(b(c))&&V(b(c)).isDirectory());if(a!==void 0){const c=e.slice(1),d=En(c).filter(f=>{const m=b(c[f]);return _(m)&&V(m).isDirectory()});if(d.length>1)return s("error",`${A()}: REFUSE\xB7root name one acting directory
|
|
83
|
+
`),l.usage;const E=d[0],r=b(E===void 0?".":c[E]),u=E===void 0?c:c.filter((f,m)=>m!==E);return Ue(w(r),()=>t==="fold"&&E!==void 0&&!B(u).some(f=>/^#bound(?::|$)/.test(f))?ue(r,void 0,u):a(r,u,[t,...u]),()=>z(r).standing)}const i=e[0]??"";if(i&&!i.startsWith("-")&&n.includes(i)){const c=b("."),d=ge(c,b(i)).split(we).join("/");return ue(c,d?`${d}/`:void 0,e)}return s("error",`${A()}: ${ze().join(" \xB7 ")}
|
|
84
|
+
`),l.usage}$(Tn,"main");function Xe(e){let t="";try{t=Oe(new URL("../../docs/contracts/refusals.bound",import.meta.url),"utf8")}catch{}s("error",JSON.stringify(dt(e,t,Q))+`
|
|
85
|
+
`)}$(Xe,"printRefusal");function jn(e){return(e===l.refuse||e===l.usage)&&Xe(new O(e===l.usage?"operation/usage":"operation/failed","")),e}$(jn,"completed");async function Ye(e){try{return jn(await Tn(e))}catch(t){const a=t instanceof Error?t.message:String(t);return s("error",`${A()}: ${a.startsWith("REFUSE\xB7")?a:`REFUSE\xB7crash ${a}`}
|
|
86
|
+
`),Xe(t instanceof O?t:new O("operation/failed",a)),l.refuse}}$(Ye,"runNativeCommand"),process.send&&process.argv.length===2?it(Ye):(un(),Ye(process.argv.slice(2)).then(e=>{process.exitCode=e}));
|