@cotal-ai/core 0.16.0 → 0.18.0
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/dist/acls.d.ts +21 -0
- package/dist/acls.d.ts.map +1 -1
- package/dist/acls.js +44 -1
- package/dist/acls.js.map +1 -1
- package/dist/artifact.d.ts +45 -0
- package/dist/artifact.d.ts.map +1 -0
- package/dist/artifact.js +82 -0
- package/dist/artifact.js.map +1 -0
- package/dist/backup-config.d.ts +9 -2
- package/dist/backup-config.d.ts.map +1 -1
- package/dist/backup-config.js +6 -2
- package/dist/backup-config.js.map +1 -1
- package/dist/broker-tls.d.ts +70 -0
- package/dist/broker-tls.d.ts.map +1 -0
- package/dist/broker-tls.js +195 -0
- package/dist/broker-tls.js.map +1 -0
- package/dist/canonical.d.ts +14 -1
- package/dist/canonical.d.ts.map +1 -1
- package/dist/canonical.js +21 -1
- package/dist/canonical.js.map +1 -1
- package/dist/channels.js +4 -4
- package/dist/channels.js.map +1 -1
- package/dist/endpoint-action.d.ts +108 -3
- package/dist/endpoint-action.d.ts.map +1 -1
- package/dist/endpoint-action.js +209 -20
- package/dist/endpoint-action.js.map +1 -1
- package/dist/endpoint-binding.d.ts +138 -8
- package/dist/endpoint-binding.d.ts.map +1 -1
- package/dist/endpoint-binding.js +233 -26
- package/dist/endpoint-binding.js.map +1 -1
- package/dist/endpoint-contract-store.d.ts +30 -1
- package/dist/endpoint-contract-store.d.ts.map +1 -1
- package/dist/endpoint-contract-store.js +100 -29
- package/dist/endpoint-contract-store.js.map +1 -1
- package/dist/endpoint-envelope.d.ts +15 -37
- package/dist/endpoint-envelope.d.ts.map +1 -1
- package/dist/endpoint-envelope.js +93 -44
- package/dist/endpoint-envelope.js.map +1 -1
- package/dist/endpoint-error.d.ts +33 -0
- package/dist/endpoint-error.d.ts.map +1 -0
- package/dist/endpoint-error.js +34 -0
- package/dist/endpoint-error.js.map +1 -0
- package/dist/endpoint-grants.d.ts +63 -7
- package/dist/endpoint-grants.d.ts.map +1 -1
- package/dist/endpoint-grants.js +118 -9
- package/dist/endpoint-grants.js.map +1 -1
- package/dist/endpoint-invoke.d.ts +138 -0
- package/dist/endpoint-invoke.d.ts.map +1 -0
- package/dist/endpoint-invoke.js +393 -0
- package/dist/endpoint-invoke.js.map +1 -0
- package/dist/endpoint-records.d.ts.map +1 -1
- package/dist/endpoint-records.js +17 -0
- package/dist/endpoint-records.js.map +1 -1
- package/dist/endpoint-serve-kv.d.ts +97 -0
- package/dist/endpoint-serve-kv.d.ts.map +1 -0
- package/dist/endpoint-serve-kv.js +336 -0
- package/dist/endpoint-serve-kv.js.map +1 -0
- package/dist/endpoint-serve.d.ts.map +1 -1
- package/dist/endpoint-serve.js +21 -1
- package/dist/endpoint-serve.js.map +1 -1
- package/dist/endpoint-service.d.ts +1 -1
- package/dist/endpoint-service.d.ts.map +1 -1
- package/dist/endpoint-service.js +34 -10
- package/dist/endpoint-service.js.map +1 -1
- package/dist/endpoint-session-rail.d.ts +127 -0
- package/dist/endpoint-session-rail.d.ts.map +1 -0
- package/dist/endpoint-session-rail.js +325 -0
- package/dist/endpoint-session-rail.js.map +1 -0
- package/dist/endpoint-session.d.ts +1 -115
- package/dist/endpoint-session.d.ts.map +1 -1
- package/dist/endpoint-session.js +4 -316
- package/dist/endpoint-session.js.map +1 -1
- package/dist/endpoint-subjects.d.ts +20 -1
- package/dist/endpoint-subjects.d.ts.map +1 -1
- package/dist/endpoint-subjects.js +20 -1
- package/dist/endpoint-subjects.js.map +1 -1
- package/dist/endpoint-verbs.d.ts +1 -2
- package/dist/endpoint-verbs.d.ts.map +1 -1
- package/dist/endpoint-verbs.js +6 -6
- package/dist/endpoint-verbs.js.map +1 -1
- package/dist/endpoint.d.ts +157 -11
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +471 -47
- package/dist/endpoint.js.map +1 -1
- package/dist/evict.d.ts +47 -0
- package/dist/evict.d.ts.map +1 -1
- package/dist/evict.js +191 -59
- package/dist/evict.js.map +1 -1
- package/dist/identity.d.ts +34 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +46 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/kv-scan.d.ts +8 -0
- package/dist/kv-scan.d.ts.map +1 -1
- package/dist/kv-scan.js +8 -0
- package/dist/kv-scan.js.map +1 -1
- package/dist/lease.d.ts +12 -5
- package/dist/lease.d.ts.map +1 -1
- package/dist/lease.js.map +1 -1
- package/dist/lifecycle-saga.d.ts +174 -0
- package/dist/lifecycle-saga.d.ts.map +1 -0
- package/dist/lifecycle-saga.js +418 -0
- package/dist/lifecycle-saga.js.map +1 -0
- package/dist/lifecycle-state.d.ts +202 -0
- package/dist/lifecycle-state.d.ts.map +1 -0
- package/dist/lifecycle-state.js +347 -0
- package/dist/lifecycle-state.js.map +1 -0
- package/dist/parts.d.ts +13 -0
- package/dist/parts.d.ts.map +1 -0
- package/dist/parts.js +17 -0
- package/dist/parts.js.map +1 -0
- package/dist/provision.d.ts +124 -15
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +578 -121
- package/dist/provision.js.map +1 -1
- package/dist/schema-profile.d.ts +3 -2
- package/dist/schema-profile.d.ts.map +1 -1
- package/dist/schema-profile.js +242 -18
- package/dist/schema-profile.js.map +1 -1
- package/dist/session-browser.d.ts +15 -0
- package/dist/session-browser.d.ts.map +1 -0
- package/dist/session-browser.js +14 -0
- package/dist/session-browser.js.map +1 -0
- package/dist/session-terminal-frames.d.ts +36 -0
- package/dist/session-terminal-frames.d.ts.map +1 -0
- package/dist/session-terminal-frames.js +149 -0
- package/dist/session-terminal-frames.js.map +1 -0
- package/dist/spaces.d.ts.map +1 -1
- package/dist/spaces.js +6 -1
- package/dist/spaces.js.map +1 -1
- package/dist/streams.d.ts +168 -1
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +299 -21
- package/dist/streams.js.map +1 -1
- package/dist/subjects.d.ts +34 -36
- package/dist/subjects.d.ts.map +1 -1
- package/dist/subjects.js +46 -35
- package/dist/subjects.js.map +1 -1
- package/dist/types.d.ts +27 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -1
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { rawDigest, isContractDigest, isWellFormedUnicode } from "./canonical.js";
|
|
2
2
|
import { assertCommandToken, assertIdToken, assertLifecycleToken, endpointToken } from "./endpoint-subjects.js";
|
|
3
3
|
import { SCHEMA_PROFILE } from "./schema-profile.js";
|
|
4
|
+
// The error catalog + EpEnvelopeError live in a node-free module so the browser session bundle can
|
|
5
|
+
// use them without dragging in schema-profile's load-time digest (node:crypto). Re-exported here so
|
|
6
|
+
// every existing `@cotal-ai/core` consumer keeps its import path.
|
|
7
|
+
import { EP_ERROR_CODES, EpEnvelopeError } from "./endpoint-error.js";
|
|
8
|
+
export { EP_ERROR_CODES, EpEnvelopeError } from "./endpoint-error.js";
|
|
4
9
|
/** The envelope schema version — independent of the wire `protocolVersion`; starts at its own
|
|
5
10
|
* v1 inside the v0.4 revision. Other values are rejected (`unsupported-version`). */
|
|
6
11
|
export const EP_ENVELOPE_V = 1;
|
|
7
12
|
// ---- structured errors (§13.3 error catalog) ------------------------------------------------
|
|
8
|
-
/** The §13.3 error catalog. Extensions add codes only under reverse-DNS; any code (catalog or
|
|
9
|
-
* extension) is one token of at most 64 bytes. */
|
|
10
|
-
export const EP_ERROR_CODES = Object.freeze([
|
|
11
|
-
"bad-request", "unsupported-version", "op-mismatch", "class-mismatch", "target-mismatch",
|
|
12
|
-
"sender-mismatch", "unauthenticated", "permission-denied", "not-found", "already-exists",
|
|
13
|
-
"conflict", "contract-mismatch", "contract-invalid", "failed-precondition",
|
|
14
|
-
"deadline-exceeded", "cancelled", "expired", "unavailable", "unimplemented",
|
|
15
|
-
"resource-exhausted", "internal",
|
|
16
|
-
]);
|
|
17
13
|
const EP_ERROR_SET = new Set(EP_ERROR_CODES);
|
|
18
14
|
const LABEL = "[a-z0-9]([a-z0-9-]*[a-z0-9])?";
|
|
19
15
|
/** Reverse-DNS extension token: three or more DNS-shaped labels (`com.acme.throttled`). */
|
|
@@ -24,22 +20,6 @@ export function isEpErrorCode(code) {
|
|
|
24
20
|
return false;
|
|
25
21
|
return EP_ERROR_SET.has(code) || EXTENSION_CODE.test(code);
|
|
26
22
|
}
|
|
27
|
-
/** A consuming-boundary rejection: the catalog code plus a human message. Boundaries convert it
|
|
28
|
-
* to an `EndpointReply` error via {@link EpEnvelopeError.toEpError} (or, on reply-less planes,
|
|
29
|
-
* to the §13.4 decision/quarantine fact carrying the same code). */
|
|
30
|
-
export class EpEnvelopeError extends Error {
|
|
31
|
-
code;
|
|
32
|
-
details;
|
|
33
|
-
constructor(code, message, details) {
|
|
34
|
-
super(message);
|
|
35
|
-
this.code = code;
|
|
36
|
-
this.details = details;
|
|
37
|
-
this.name = "EpEnvelopeError";
|
|
38
|
-
}
|
|
39
|
-
toEpError() {
|
|
40
|
-
return { code: this.code, message: this.message, ...(this.details ? { details: this.details } : {}) };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
23
|
function fail(code, message) {
|
|
44
24
|
throw new EpEnvelopeError(code, message);
|
|
45
25
|
}
|
|
@@ -298,25 +278,96 @@ export function parseEndpointEvent(raw) {
|
|
|
298
278
|
return { v: EP_ENVELOPE_V, topic, ts, data: o.data, ...(correlation !== undefined ? { correlation } : {}) };
|
|
299
279
|
}
|
|
300
280
|
// ---- invocation-time contract validation (§13.7, distinct from registration time) -----------
|
|
281
|
+
/**
|
|
282
|
+
* Report — never refuse on — an over-budget validation on the REQUEST path.
|
|
283
|
+
*
|
|
284
|
+
* §13.8's validate budget used to throw: `bad-request` for args, `internal` for output. It cannot
|
|
285
|
+
* be measured soundly enough to justify that. Elapsed time counts the whole machine (it refused an
|
|
286
|
+
* 82ms cold-JIT validation of a small, schema-VALID object during a gate run). `process.cpuUsage()`
|
|
287
|
+
* counts every thread in the process, so V8's background optimizing-compiler threads and any
|
|
288
|
+
* sibling Worker land in the number too — measured at 16.4ms of process CPU against 0.18ms on the
|
|
289
|
+
* measuring thread, already over this 10ms ceiling with almost no work done here. Node exposes no
|
|
290
|
+
* per-thread CPU below 22.19 and the package floor is `>=22`, so there is no third instrument.
|
|
291
|
+
*
|
|
292
|
+
* A false refusal HERE answers the CALLER: a manager on a loaded or Worker-using host would tell
|
|
293
|
+
* clients their valid arguments are malformed and silently degrade a live control plane. That is
|
|
294
|
+
* strictly worse than the DoS this was guarding, which needs an attacker able to register a
|
|
295
|
+
* contract. So enforcement stays where the attack actually lives — the REGISTRATION path, where
|
|
296
|
+
* {@link import("./schema-profile.js").compileContract} still refuses `contract-invalid`, a false
|
|
297
|
+
* positive fails a boot loudly rather than lying to a caller.
|
|
298
|
+
*
|
|
299
|
+
* WHAT THIS COMMENT USED TO CLAIM, AND WHY IT WAS WRONG. It said the deterministic profile bounds
|
|
300
|
+
* "do the pre-emptive work", i.e. that registration-time bounds REPLACE request-path enforcement.
|
|
301
|
+
* They do not, and that was disproved by execution rather than argued: a four-node schema —
|
|
302
|
+
* trivially inside every byte, depth, ref-chain, node and closure bound — declaring
|
|
303
|
+
* `uniqueItems: true` over an array of OBJECTS makes validation QUADRATIC IN THE CALLER'S DATA.
|
|
304
|
+
* 3,000 valid objects measured 75ms and 5,000 measured 227ms, from ~54KB of entirely legitimate
|
|
305
|
+
* input. No registration power, no oversized payload, no forgery. The profile bounds the SIZE and
|
|
306
|
+
* SHAPE of a schema and the BACKTRACKING class via `maxPatternChars`; it has nothing for keywords
|
|
307
|
+
* whose cost is non-linear in the VALUE being validated.
|
|
308
|
+
*
|
|
309
|
+
* BE PRECISE ABOUT WHAT THE DEMOTION DID AND DID NOT COST, because the obvious reading is wrong.
|
|
310
|
+
* The gap is real and it PRE-DATES the demotion. The old code was
|
|
311
|
+
*
|
|
312
|
+
* const okValid = validate(value); // the whole cost is ALREADY PAID here
|
|
313
|
+
* const cpu = process.cpuUsage(startedCpu); // measured afterwards
|
|
314
|
+
* if (cpuMs > budget) fail("bad-request", …)
|
|
315
|
+
*
|
|
316
|
+
* so the refusal fired AFTER validation ran to completion. On a quadratic payload the enforcing
|
|
317
|
+
* build burns exactly the same CPU as this one; it merely answers with an error instead of a
|
|
318
|
+
* result. AGAINST RESOURCE EXHAUSTION, POST-HOC ENFORCEMENT BOUGHT NOTHING — an authorized caller
|
|
319
|
+
* repeating the call cost the host the same before this change as after. What was removed was a
|
|
320
|
+
* post-hoc classification, never a fence.
|
|
321
|
+
*
|
|
322
|
+
* AN INSTRUMENT ONLY GUARDS WHAT HAPPENS AFTER IT. That is the whole rule, and it is why the
|
|
323
|
+
* reply-payload case is genuinely different: THAT throw preceded a downstream publish, so removing
|
|
324
|
+
* it really did let an oversized reply through. Position, not intent, decides whether a check is a
|
|
325
|
+
* fence or a verdict.
|
|
326
|
+
*
|
|
327
|
+
* So the honest statement is that this path has ALWAYS been unbounded for validation cost, and a
|
|
328
|
+
* deterministic PRE-EMPTIVE defence is owed: a bound on argument bytes and items checked BEFORE
|
|
329
|
+
* `validate` runs, refused as `resource-exhausted` (the caller's arguments are not malformed, they
|
|
330
|
+
* are too expensive to admit — see `assertFactFits` in endpoint-journal.ts for the same shape), plus
|
|
331
|
+
* a registration-time refusal of keywords whose cost is non-linear in the value. `max_payload` is
|
|
332
|
+
* NOT that bound: at ~1 MiB it admits thousands of small objects, which is deep into the quadratic.
|
|
333
|
+
*
|
|
334
|
+
* The transferable lesson stands and is worth more than the incident: one unsound timer was standing
|
|
335
|
+
* in for three jobs and was removed having enumerated one. REMOVING A GUARD REQUIRES ENUMERATING
|
|
336
|
+
* WHAT IT WAS HOLDING UP — and then checking, for each, whether the guard actually PRECEDED the
|
|
337
|
+
* thing it appeared to hold up. Two of the three here did not.
|
|
338
|
+
*
|
|
339
|
+
* The number stays, as an approximate observation, because it is still the only signal that a
|
|
340
|
+
* registered contract is costing more than the profile intended. Treat it as a hint to go look at
|
|
341
|
+
* the contract, never as a verdict about this request.
|
|
342
|
+
*/
|
|
343
|
+
function reportValidateBudget(what, startedCpu, startedMs) {
|
|
344
|
+
const cpu = process.cpuUsage(startedCpu);
|
|
345
|
+
const cpuMs = Math.round((cpu.user + cpu.system) / 1000);
|
|
346
|
+
if (cpuMs <= SCHEMA_PROFILE.validateBudgetMs)
|
|
347
|
+
return;
|
|
348
|
+
console.error(`! schema: ${what} validation took ~${cpuMs}ms of process CPU (§13.8 reference budget ${SCHEMA_PROFILE.validateBudgetMs}ms; ` +
|
|
349
|
+
`${Date.now() - startedMs}ms elapsed). Approximate - process-wide CPU includes JIT/Worker threads. ` +
|
|
350
|
+
`Not a refusal - and note that refusing HERE would not have helped: this fires after validate() completed, so the cost is already paid. Validation cost on this path is bounded by nothing pre-emptively; a byte/item bound before validate is owed.`);
|
|
351
|
+
}
|
|
301
352
|
/** Validate `args` against the command's compiled input schema BEFORE any effect: failure is the
|
|
302
353
|
* invocation-time `bad-request` (registration-time violations are `contract-invalid`,
|
|
303
354
|
* {@link import("./schema-profile.js").ContractInvalidError}). Against the void schema the
|
|
304
355
|
* payload is absent or `null` (§13.7), so `undefined` args validate as `null` here and only
|
|
305
356
|
* here; an explicit `null` passes through unchanged, and it is the SCHEMA (an object-typed
|
|
306
|
-
* input contract) that rejects null for non-void commands.
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
357
|
+
* input contract) that rejects null for non-void commands.
|
|
358
|
+
*
|
|
359
|
+
* The §13.8 validation budget is REPORTED here, not enforced — see {@link reportValidateBudget}
|
|
360
|
+
* for why no available instrument can justify refusing a request on it. The only `bad-request`
|
|
361
|
+
* this raises is the schema's own verdict. Enforcement lives at registration
|
|
362
|
+
* ({@link import("./schema-profile.js").compileContract}), which is where the COMPILE-time DoS
|
|
363
|
+
* lives - not the only place a DoS lives, see the note on `reportValidateBudget` - and where
|
|
364
|
+
* a false positive fails loudly instead of lying to a caller. */
|
|
313
365
|
export function assertArgsValid(validate, args) {
|
|
314
366
|
const value = args === undefined ? null : args;
|
|
367
|
+
const startedCpu = process.cpuUsage();
|
|
315
368
|
const started = Date.now();
|
|
316
369
|
const okValid = validate(value);
|
|
317
|
-
|
|
318
|
-
if (elapsed > SCHEMA_PROFILE.validateBudgetMs)
|
|
319
|
-
fail("bad-request", `args validation took ${elapsed}ms (budget ${SCHEMA_PROFILE.validateBudgetMs}ms; over budget is bad-request, SPEC 13.8)`);
|
|
370
|
+
reportValidateBudget("args", startedCpu, started);
|
|
320
371
|
if (!okValid) {
|
|
321
372
|
const first = validate.errors?.[0];
|
|
322
373
|
fail("bad-request", `args do not validate against the input schema${first ? `: ${first.instancePath || "/"} ${first.message ?? ""}` : ""}`);
|
|
@@ -325,19 +376,17 @@ export function assertArgsValid(validate, args) {
|
|
|
325
376
|
}
|
|
326
377
|
/** Validate an output payload against the command's compiled output schema at EITHER §13.7
|
|
327
378
|
* boundary — the responder's, before the success publish, or the caller's, on the consumed
|
|
328
|
-
* reply — the symmetric
|
|
329
|
-
* §13.
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* mirroring the args side. */
|
|
379
|
+
* reply — the symmetric half of {@link assertArgsValid}. An invalid output is a responder bug
|
|
380
|
+
* (§13.3/§13.7) whichever side detects it, so it is structured `internal`, never the caller's
|
|
381
|
+
* `bad-request`. The §13.8 budget is REPORTED, not enforced, for the same reason as the args side
|
|
382
|
+
* ({@link reportValidateBudget}). A void output is `undefined`, validated as `null` against the
|
|
383
|
+
* void schema, mirroring the args side. */
|
|
334
384
|
export function assertOutputValid(validate, data) {
|
|
335
385
|
const value = data === undefined ? null : data;
|
|
386
|
+
const startedCpu = process.cpuUsage();
|
|
336
387
|
const started = Date.now();
|
|
337
388
|
const okValid = validate(value);
|
|
338
|
-
|
|
339
|
-
if (elapsed > SCHEMA_PROFILE.validateBudgetMs)
|
|
340
|
-
fail("internal", `output validation took ${elapsed}ms (budget ${SCHEMA_PROFILE.validateBudgetMs}ms; an over-budget output validation is a responder bug, SPEC 13.7/13.8)`);
|
|
389
|
+
reportValidateBudget("output", startedCpu, started);
|
|
341
390
|
if (!okValid) {
|
|
342
391
|
const first = validate.errors?.[0];
|
|
343
392
|
fail("internal", `output does not validate against the pinned output schema; an invalid reply is a responder bug, never success (SPEC 13.7)${first ? `: ${first.instancePath || "/"} ${first.message ?? ""}` : ""}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-envelope.js","sourceRoot":"","sources":["../src/endpoint-envelope.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAwB,MAAM,wBAAwB,CAAC;AACtI,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;sFACsF;AACtF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,gGAAgG;AAEhG;mDACmD;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,aAAa,EAAE,qBAAqB,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB;IACxF,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,gBAAgB;IACxF,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,qBAAqB;IAC1E,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe;IAC3E,oBAAoB,EAAE,UAAU;CACxB,CAAC,CAAC;AAEZ,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,cAAc,CAAC,CAAC;AAErD,MAAM,KAAK,GAAG,+BAA+B,CAAC;AAC9C,2FAA2F;AAC3F,MAAM,cAAc,GAAG,IAAI,M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CAAC;AACf,CAAC;AAED;;;;;;4CAM4C;AAC5C,MAAM,UAAU,iBAAiB,CAAC,QAA0B,EAAE,IAAa;IACzE,MAAM,KAAK,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChC,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,EAAE,4HAA4H,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAAY,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The §13.3 endpoint ERROR primitives, split out NODE-FREE (P2 item 6): the catalog codes + the
|
|
3
|
+
* {@link EpEnvelopeError} a consuming boundary throws. The §13.6 session rail + terminal-frame codec
|
|
4
|
+
* need ONLY these, and they run in the browser console bundle — so the error must not drag in the
|
|
5
|
+
* envelope's schema/digest machinery (endpoint-envelope → schema-profile computes a digest at module
|
|
6
|
+
* load, i.e. `node:crypto`). `endpoint-envelope.ts` re-exports everything here, so no consumer's
|
|
7
|
+
* import path changes; the browser-safe modules (rail + codec) import EpEnvelopeError from HERE.
|
|
8
|
+
*/
|
|
9
|
+
/** The §13.3 error catalog. Extensions add codes only under reverse-DNS; any code (catalog or
|
|
10
|
+
* extension) is one token of at most 64 bytes. */
|
|
11
|
+
export declare const EP_ERROR_CODES: readonly ["bad-request", "unsupported-version", "op-mismatch", "class-mismatch", "target-mismatch", "sender-mismatch", "unauthenticated", "permission-denied", "not-found", "already-exists", "conflict", "contract-mismatch", "contract-invalid", "failed-precondition", "deadline-exceeded", "cancelled", "expired", "unavailable", "unimplemented", "resource-exhausted", "internal"];
|
|
12
|
+
export type EpErrorCode = (typeof EP_ERROR_CODES)[number];
|
|
13
|
+
/** One `details[]` entry: `kind` is reverse-DNS-namespaced (§13.3), the rest is open. */
|
|
14
|
+
export interface EpErrorDetail {
|
|
15
|
+
kind: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** The `EndpointReply.error` shape. */
|
|
19
|
+
export interface EpError {
|
|
20
|
+
code: string;
|
|
21
|
+
message: string;
|
|
22
|
+
details?: EpErrorDetail[];
|
|
23
|
+
}
|
|
24
|
+
/** A consuming-boundary rejection: the catalog code plus a human message. Boundaries convert it
|
|
25
|
+
* to an `EndpointReply` error via {@link EpEnvelopeError.toEpError} (or, on reply-less planes,
|
|
26
|
+
* to the §13.4 decision/quarantine fact carrying the same code). */
|
|
27
|
+
export declare class EpEnvelopeError extends Error {
|
|
28
|
+
readonly code: EpErrorCode;
|
|
29
|
+
readonly details?: EpErrorDetail[] | undefined;
|
|
30
|
+
constructor(code: EpErrorCode, message: string, details?: EpErrorDetail[] | undefined);
|
|
31
|
+
toEpError(): EpError;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=endpoint-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-error.d.ts","sourceRoot":"","sources":["../src/endpoint-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;mDACmD;AACnD,eAAO,MAAM,cAAc,0XAMhB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,yFAAyF;AACzF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,uCAAuC;AACvC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED;;qEAEqE;AACrE,qBAAa,eAAgB,SAAQ,KAAK;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW;IAAmB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE;gBAAtE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAW,OAAO,CAAC,EAAE,aAAa,EAAE,YAAA;IAI3F,SAAS,IAAI,OAAO;CAGrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The §13.3 endpoint ERROR primitives, split out NODE-FREE (P2 item 6): the catalog codes + the
|
|
3
|
+
* {@link EpEnvelopeError} a consuming boundary throws. The §13.6 session rail + terminal-frame codec
|
|
4
|
+
* need ONLY these, and they run in the browser console bundle — so the error must not drag in the
|
|
5
|
+
* envelope's schema/digest machinery (endpoint-envelope → schema-profile computes a digest at module
|
|
6
|
+
* load, i.e. `node:crypto`). `endpoint-envelope.ts` re-exports everything here, so no consumer's
|
|
7
|
+
* import path changes; the browser-safe modules (rail + codec) import EpEnvelopeError from HERE.
|
|
8
|
+
*/
|
|
9
|
+
/** The §13.3 error catalog. Extensions add codes only under reverse-DNS; any code (catalog or
|
|
10
|
+
* extension) is one token of at most 64 bytes. */
|
|
11
|
+
export const EP_ERROR_CODES = Object.freeze([
|
|
12
|
+
"bad-request", "unsupported-version", "op-mismatch", "class-mismatch", "target-mismatch",
|
|
13
|
+
"sender-mismatch", "unauthenticated", "permission-denied", "not-found", "already-exists",
|
|
14
|
+
"conflict", "contract-mismatch", "contract-invalid", "failed-precondition",
|
|
15
|
+
"deadline-exceeded", "cancelled", "expired", "unavailable", "unimplemented",
|
|
16
|
+
"resource-exhausted", "internal",
|
|
17
|
+
]);
|
|
18
|
+
/** A consuming-boundary rejection: the catalog code plus a human message. Boundaries convert it
|
|
19
|
+
* to an `EndpointReply` error via {@link EpEnvelopeError.toEpError} (or, on reply-less planes,
|
|
20
|
+
* to the §13.4 decision/quarantine fact carrying the same code). */
|
|
21
|
+
export class EpEnvelopeError extends Error {
|
|
22
|
+
code;
|
|
23
|
+
details;
|
|
24
|
+
constructor(code, message, details) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.code = code;
|
|
27
|
+
this.details = details;
|
|
28
|
+
this.name = "EpEnvelopeError";
|
|
29
|
+
}
|
|
30
|
+
toEpError() {
|
|
31
|
+
return { code: this.code, message: this.message, ...(this.details ? { details: this.details } : {}) };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=endpoint-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-error.js","sourceRoot":"","sources":["../src/endpoint-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;mDACmD;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,aAAa,EAAE,qBAAqB,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB;IACxF,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,gBAAgB;IACxF,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,qBAAqB;IAC1E,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe;IAC3E,oBAAoB,EAAE,UAAU;CACxB,CAAC,CAAC;AAgBZ;;qEAEqE;AACrE,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACnB;IAA6C;IAAlE,YAAqB,IAAiB,EAAE,OAAe,EAAW,OAAyB;QACzF,KAAK,CAAC,OAAO,CAAC,CAAC;QADI,SAAI,GAAJ,IAAI,CAAa;QAA4B,YAAO,GAAP,OAAO,CAAkB;QAEzF,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;IACD,SAAS;QACP,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACxG,CAAC;CACF"}
|
|
@@ -30,12 +30,15 @@ export declare function epCallerReplyGrantRow(space: string, caller: EpCaller):
|
|
|
30
30
|
* mint-time read containment; delivered on the caller's own core subscription only. */
|
|
31
31
|
export declare function epGoalProgressGrantRow(space: string, endpoint: string, caller: EpCaller): string;
|
|
32
32
|
/** All caller-side rows for a capability set: request-publish (+ optional journal) into
|
|
33
|
-
* `pub.allow`, the reply rail
|
|
34
|
-
*
|
|
35
|
-
* handle rows are redemption-minted only
|
|
36
|
-
* {@link epRequestGrantRows} directly.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* `pub.allow`, the reply rail (+ the per-goal progress read for GOAL-BEARING capabilities) into
|
|
34
|
+
* `sub.allow`. This is the STANDING rollup (`permissionsFor` mints long-lived credentials from
|
|
35
|
+
* it), so a `handle`-mode capability is refused here: handle rows are redemption-minted only
|
|
36
|
+
* (§13.2/§13.6), built by the redemption path through {@link epRequestGrantRows} directly.
|
|
37
|
+
* A goal-bearing capability ({@link GOAL_BEARING_COMMANDS}: spawn/launch) adds ONE per-endpoint
|
|
38
|
+
* {@link epGoalProgressGrantRow} — the caller may follow its OWN goal to terminal (P2 item 2, Q1);
|
|
39
|
+
* it is the one read an invoke implies, because the subject pins the caller's own triple. Still
|
|
40
|
+
* NOT included: any OTHER `epe` subtree — those are minted per read capability by the granting
|
|
41
|
+
* authority (Appendix B), not implied by an invoke. */
|
|
39
42
|
export declare function epCallerGrantRows(space: string, caps: EpCapability[], caller: EpCaller): {
|
|
40
43
|
pub: string[];
|
|
41
44
|
sub: string[];
|
|
@@ -62,6 +65,23 @@ export declare const BASELINE_SELF_LIFECYCLE_COMMANDS: readonly ["stop"];
|
|
|
62
65
|
* stays in the BASELINE (the v0.3 self-service tier's only op); it is the lighter self-halt. */
|
|
63
66
|
export declare const SPAWN_CREATE_COMMANDS: readonly ["spawn"];
|
|
64
67
|
export declare const SPAWN_OWNER_LIFECYCLE_COMMANDS: readonly ["despawn", "attach"];
|
|
68
|
+
/** The spawn capability's UNTARGETED additions (the 1c grant-migration table): the connector's
|
|
69
|
+
* persona write (`define-persona`, caller-scoped by the pinned triple) and per-agent status read
|
|
70
|
+
* (`inspect` - the responder narrows the view to the caller's owner domain, like `ps`). These
|
|
71
|
+
* ride the v0.3 privileged tier today; minting them with `spawn` keeps that tier's surface 1:1. */
|
|
72
|
+
export declare const SPAWN_SERVICE_COMMANDS: readonly ["define-persona", "inspect"];
|
|
73
|
+
/** The manager endpoint's read commands (`manager.read` class). */
|
|
74
|
+
export declare const MANAGER_READ_COMMANDS: readonly ["status", "ps", "inspect", "models"];
|
|
75
|
+
/** The manager endpoint's admin-class commands (`manager.admin`): capability-only + untargeted -
|
|
76
|
+
* the broker grant (who holds the row) IS the boundary; minted ONLY into operator instruments,
|
|
77
|
+
* NEVER an agent/spawn profile (the ratified 1c pin). */
|
|
78
|
+
export declare const MANAGER_ADMIN_COMMANDS: readonly ["purge", "launch", "resume-preserved", "commit-resume", "finalize-resume", "prepare-preservation", "commit-preservation", "abort-preservation"];
|
|
79
|
+
/** The ACTION commands (§13.6): submitting one accepts a GOAL, so the caller may follow its OWN
|
|
80
|
+
* goal progress (P2 item 2). `spawn` (create) and `launch` (manifest) both serve as actions on
|
|
81
|
+
* the manager endpoint since 2a; a caller holding one of these capabilities is granted the
|
|
82
|
+
* per-goal live-progress read for that endpoint ({@link epGoalProgressGrantRow}), the one read an
|
|
83
|
+
* invoke DOES imply because it is bounded to the caller's OWN goal subtree. */
|
|
84
|
+
export declare const GOAL_BEARING_COMMANDS: readonly ["spawn", "launch"];
|
|
65
85
|
/** `describe` on ALL endpoints (Appendix B / §13.9 "describe by default"): the ONE
|
|
66
86
|
* subject-wildcard request form in the caller grammar,
|
|
67
87
|
* `ep.one.*.describe.<cO>.<cA>.<cUid>.*` — the endpoint token is the wildcard, the command is
|
|
@@ -80,9 +100,45 @@ export declare function baselineCallerCapabilities(): EpCapability[];
|
|
|
80
100
|
* three that act on an existing agent ride owner mode, target owner pinned to the CALLER's own
|
|
81
101
|
* (§13.2: an owner-mode standing mint never names a foreign owner). */
|
|
82
102
|
export declare function spawnCallerCapabilities(callerOwner: string): EpCapability[];
|
|
103
|
+
/** An operator INSTRUMENT's capability set (the 1c grant-migration table's admin row), per the
|
|
104
|
+
* instrument's v0.3 control tier - the SAME mint sites that grant a `ctl.<tier>` row today
|
|
105
|
+
* (`control-caller-*` / `deployer`) consume this for the ep rails; no new minting authority.
|
|
106
|
+
*
|
|
107
|
+
* `privileged` (the ps/start instrument): the manager reads + untargeted `spawn` +
|
|
108
|
+
* `define-persona` - structurally barred from cross-agent reach, exactly like its ctl row.
|
|
109
|
+
*
|
|
110
|
+
* `admin` (the stop/attach/deploy instrument): everything above plus ANY-mode `despawn`/`attach`
|
|
111
|
+
* (tOwner `"*"`) and the `manager.admin` command family. The 1c admin-reach decision: operator
|
|
112
|
+
* cross-agent terminal/interactive ops ride authz-mode `any` on the SAME commands (no wire
|
|
113
|
+
* synonym) - the any-mode subject row is minted ONLY into operator-authorized credentials: the
|
|
114
|
+
* `control-caller-admin`/`deployer`/`teardown` instruments AND an agent credential explicitly
|
|
115
|
+
* granted the `admin` capability (which by design mirrors the full admin instrument set - its
|
|
116
|
+
* ctl-tier equivalent already held `ctl.<admin>`, so this is parity, not a new escalation). An
|
|
117
|
+
* ordinary agent, incl. the `spawn` capability, never carries it. So the broker grant is the tier boundary exactly as
|
|
118
|
+
* `ctl.<admin>` is today, and the responder maps mode `any` to its admin authorization path. */
|
|
119
|
+
export declare function operatorInstrumentCapabilities(tier: "privileged" | "admin"): EpCapability[];
|
|
120
|
+
/** The SAME tier set, pinned to ONE instance — the issuance `--on <instanceId>` was always meant to
|
|
121
|
+
* get. These instruments are ONE-SHOT, minted per control call, and the resolve that chose the
|
|
122
|
+
* instance runs BEFORE the mint, so the exact id can be handed down and the emitter's
|
|
123
|
+
* `if (cap.instanceId)` branch produces exactly `ep.inst.<endpoint>.<iid>.<command>` for THIS
|
|
124
|
+
* invocation and nothing else. No wildcard instance is minted anywhere, which is what keeps the
|
|
125
|
+
* `inst-route-grant` boundary intact: instance addressing stays with the per-invocation operator
|
|
126
|
+
* instruments that already hold it, and a plain, spawn-capable, or observer credential still gets
|
|
127
|
+
* no instance route at all.
|
|
128
|
+
*
|
|
129
|
+
* `describe` is included EXPLICITLY. The baseline describe row is class-rail only
|
|
130
|
+
* ({@link epDescribeAllGrantRow}), so without this the pinned RESOLVE that must precede a pinned
|
|
131
|
+
* invoke is refused at the broker — and refused invisibly, because the client renders that refusal
|
|
132
|
+
* as a describe timeout. Here it is a concrete endpoint+instance capability, not the normative
|
|
133
|
+
* wildcard form, so the exact-arity discipline of the caller grammar is preserved. */
|
|
134
|
+
export declare function instancePinnedInstrumentCapabilities(tier: "privileged" | "admin", instanceId: string): EpCapability[];
|
|
83
135
|
/** All BASELINE caller rows (Appendix B): the wildcard describe form + the baseline capability
|
|
84
136
|
* rollup into `pub.allow`, and the caller's reply rail into `sub.allow` — ALWAYS present (the
|
|
85
|
-
* baseline implies the reply read even when no per-capability rows are minted).
|
|
137
|
+
* baseline implies the reply read even when no per-capability rows are minted). The §13.7
|
|
138
|
+
* contract-store FETCH (the Direct Get API on the EPC stream) rides the baseline too: describe
|
|
139
|
+
* answers digests, and a caller that may describe may fetch-verify-compile the schemas those
|
|
140
|
+
* digests name (content-addressed public artifacts — a digest is the read capability; the
|
|
141
|
+
* per-caller authorization surface is the describe VIEW, never the schema bytes). */
|
|
86
142
|
export declare function epBaselineGrantRows(space: string, caller: EpCaller): {
|
|
87
143
|
pub: string[];
|
|
88
144
|
sub: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-grants.d.ts","sourceRoot":"","sources":["../src/endpoint-grants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoint-grants.d.ts","sourceRoot":"","sources":["../src/endpoint-grants.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAE7B,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;iEAOiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAwBD;;2FAE2F;AAC3F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,CAS/F;AAED;+FAC+F;AAC/F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAG5F;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE7E;AAED;;wFAEwF;AACxF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAEhG;AAED;;;;;;;;;wDASwD;AACxD,wB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;;;;;;sFAMsF;AACtF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAcrG;AAED;;;;;;;gGAOgG;AAChG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQnH;AAED;;kFAEkF;AAClF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAU/G;AAED;;;;;;;;;;yEAUyE;AACzE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAAE,GAC1F;IAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAQlC"}
|
package/dist/endpoint-grants.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* the service registry machinery.
|
|
11
11
|
*/
|
|
12
12
|
import { spacePrefix } from "./subjects.js";
|
|
13
|
+
import { epcStreamName } from "./endpoint-binding.js";
|
|
13
14
|
import { endpointToken, assertCommandToken, assertLifecycleToken, assertBoundedOwner, epCallerReplyFilter, epResponderReplyPattern, epClassQueueGroup, } from "./endpoint-subjects.js";
|
|
14
15
|
/** Grant-row token block for a capability's authz/target segment, enforcing the §13.2 minting
|
|
15
16
|
* rules per mode: `owner`/`child` standing mints pin `<tOwner>` to the caller's own owner
|
|
@@ -62,22 +63,31 @@ export function epGoalProgressGrantRow(space, endpoint, caller) {
|
|
|
62
63
|
return `${spacePrefix(space)}.epe.${endpointToken(endpoint)}.*.*.goal.${callerBlock(caller)}.>`;
|
|
63
64
|
}
|
|
64
65
|
/** All caller-side rows for a capability set: request-publish (+ optional journal) into
|
|
65
|
-
* `pub.allow`, the reply rail
|
|
66
|
-
*
|
|
67
|
-
* handle rows are redemption-minted only
|
|
68
|
-
* {@link epRequestGrantRows} directly.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
66
|
+
* `pub.allow`, the reply rail (+ the per-goal progress read for GOAL-BEARING capabilities) into
|
|
67
|
+
* `sub.allow`. This is the STANDING rollup (`permissionsFor` mints long-lived credentials from
|
|
68
|
+
* it), so a `handle`-mode capability is refused here: handle rows are redemption-minted only
|
|
69
|
+
* (§13.2/§13.6), built by the redemption path through {@link epRequestGrantRows} directly.
|
|
70
|
+
* A goal-bearing capability ({@link GOAL_BEARING_COMMANDS}: spawn/launch) adds ONE per-endpoint
|
|
71
|
+
* {@link epGoalProgressGrantRow} — the caller may follow its OWN goal to terminal (P2 item 2, Q1);
|
|
72
|
+
* it is the one read an invoke implies, because the subject pins the caller's own triple. Still
|
|
73
|
+
* NOT included: any OTHER `epe` subtree — those are minted per read capability by the granting
|
|
74
|
+
* authority (Appendix B), not implied by an invoke. */
|
|
71
75
|
export function epCallerGrantRows(space, caps, caller) {
|
|
72
76
|
const pub = [];
|
|
77
|
+
const progressEndpoints = [];
|
|
73
78
|
for (const cap of caps) {
|
|
74
79
|
if (cap.target?.mode === "handle")
|
|
75
80
|
throw new Error(`a "handle"-mode capability on "${cap.endpoint}.${cap.command}" is redemption-minted only (SPEC 13.2), never a standing capability`);
|
|
76
81
|
pub.push(...epRequestGrantRows(space, cap, caller));
|
|
77
82
|
if (cap.journal)
|
|
78
83
|
pub.push(epJournalGrantRow(space, cap, caller));
|
|
84
|
+
if (GOAL_BEARING_SET.has(cap.command) && !progressEndpoints.includes(cap.endpoint))
|
|
85
|
+
progressEndpoints.push(cap.endpoint);
|
|
79
86
|
}
|
|
80
|
-
|
|
87
|
+
const sub = caps.length ? [epCallerReplyGrantRow(space, caller)] : [];
|
|
88
|
+
for (const e of progressEndpoints)
|
|
89
|
+
sub.push(epGoalProgressGrantRow(space, e, caller));
|
|
90
|
+
return { pub, sub };
|
|
81
91
|
}
|
|
82
92
|
// ---- the Appendix-B BASELINE capability set (SPEC Appendix B "Agent", §13.9 agent row) ------------
|
|
83
93
|
// "every agent gets the baseline set (`describe` on all endpoints; the delivery endpoint's durable
|
|
@@ -112,6 +122,29 @@ export const BASELINE_SELF_LIFECYCLE_COMMANDS = Object.freeze(["stop"]);
|
|
|
112
122
|
* stays in the BASELINE (the v0.3 self-service tier's only op); it is the lighter self-halt. */
|
|
113
123
|
export const SPAWN_CREATE_COMMANDS = Object.freeze(["spawn"]);
|
|
114
124
|
export const SPAWN_OWNER_LIFECYCLE_COMMANDS = Object.freeze(["despawn", "attach"]);
|
|
125
|
+
/** The spawn capability's UNTARGETED additions (the 1c grant-migration table): the connector's
|
|
126
|
+
* persona write (`define-persona`, caller-scoped by the pinned triple) and per-agent status read
|
|
127
|
+
* (`inspect` - the responder narrows the view to the caller's owner domain, like `ps`). These
|
|
128
|
+
* ride the v0.3 privileged tier today; minting them with `spawn` keeps that tier's surface 1:1. */
|
|
129
|
+
export const SPAWN_SERVICE_COMMANDS = Object.freeze(["define-persona", "inspect"]);
|
|
130
|
+
// ---- operator INSTRUMENT capability sets (the 1c grant-migration table's admin row) --------------
|
|
131
|
+
/** The manager endpoint's read commands (`manager.read` class). */
|
|
132
|
+
export const MANAGER_READ_COMMANDS = Object.freeze(["status", "ps", "inspect", "models"]);
|
|
133
|
+
/** The manager endpoint's admin-class commands (`manager.admin`): capability-only + untargeted -
|
|
134
|
+
* the broker grant (who holds the row) IS the boundary; minted ONLY into operator instruments,
|
|
135
|
+
* NEVER an agent/spawn profile (the ratified 1c pin). */
|
|
136
|
+
export const MANAGER_ADMIN_COMMANDS = Object.freeze([
|
|
137
|
+
"purge", "launch",
|
|
138
|
+
"resume-preserved", "commit-resume", "finalize-resume",
|
|
139
|
+
"prepare-preservation", "commit-preservation", "abort-preservation",
|
|
140
|
+
]);
|
|
141
|
+
/** The ACTION commands (§13.6): submitting one accepts a GOAL, so the caller may follow its OWN
|
|
142
|
+
* goal progress (P2 item 2). `spawn` (create) and `launch` (manifest) both serve as actions on
|
|
143
|
+
* the manager endpoint since 2a; a caller holding one of these capabilities is granted the
|
|
144
|
+
* per-goal live-progress read for that endpoint ({@link epGoalProgressGrantRow}), the one read an
|
|
145
|
+
* invoke DOES imply because it is bounded to the caller's OWN goal subtree. */
|
|
146
|
+
export const GOAL_BEARING_COMMANDS = Object.freeze(["spawn", "launch"]);
|
|
147
|
+
const GOAL_BEARING_SET = new Set(GOAL_BEARING_COMMANDS);
|
|
115
148
|
// PRIVATE module-load snapshots of the command vocabularies: the builders below map over THESE,
|
|
116
149
|
// never the live exports, so the minted surface survives even a hypothetical defeat of the
|
|
117
150
|
// freezes above (the seam-snapshot half of the afa715b closure pattern).
|
|
@@ -119,6 +152,9 @@ const DELIVERY_COMMANDS_SNAP = Object.freeze([...BASELINE_DELIVERY_COMMANDS]);
|
|
|
119
152
|
const SELF_LIFECYCLE_SNAP = Object.freeze([...BASELINE_SELF_LIFECYCLE_COMMANDS]);
|
|
120
153
|
const SPAWN_CREATE_SNAP = Object.freeze([...SPAWN_CREATE_COMMANDS]);
|
|
121
154
|
const SPAWN_OWNER_SNAP = Object.freeze([...SPAWN_OWNER_LIFECYCLE_COMMANDS]);
|
|
155
|
+
const SPAWN_SERVICE_SNAP = Object.freeze([...SPAWN_SERVICE_COMMANDS]);
|
|
156
|
+
const MANAGER_READ_SNAP = Object.freeze([...MANAGER_READ_COMMANDS]);
|
|
157
|
+
const MANAGER_ADMIN_SNAP = Object.freeze([...MANAGER_ADMIN_COMMANDS]);
|
|
122
158
|
/** `describe` on ALL endpoints (Appendix B / §13.9 "describe by default"): the ONE
|
|
123
159
|
* subject-wildcard request form in the caller grammar,
|
|
124
160
|
* `ep.one.*.describe.<cO>.<cA>.<cUid>.*` — the endpoint token is the wildcard, the command is
|
|
@@ -150,14 +186,87 @@ export function spawnCallerCapabilities(callerOwner) {
|
|
|
150
186
|
endpoint: BASELINE_LIFECYCLE_ENDPOINT, command,
|
|
151
187
|
target: { mode: "owner", tOwner: callerOwner },
|
|
152
188
|
})),
|
|
189
|
+
...SPAWN_SERVICE_SNAP.map((command) => ({ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command })),
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
/** An operator INSTRUMENT's capability set (the 1c grant-migration table's admin row), per the
|
|
193
|
+
* instrument's v0.3 control tier - the SAME mint sites that grant a `ctl.<tier>` row today
|
|
194
|
+
* (`control-caller-*` / `deployer`) consume this for the ep rails; no new minting authority.
|
|
195
|
+
*
|
|
196
|
+
* `privileged` (the ps/start instrument): the manager reads + untargeted `spawn` +
|
|
197
|
+
* `define-persona` - structurally barred from cross-agent reach, exactly like its ctl row.
|
|
198
|
+
*
|
|
199
|
+
* `admin` (the stop/attach/deploy instrument): everything above plus ANY-mode `despawn`/`attach`
|
|
200
|
+
* (tOwner `"*"`) and the `manager.admin` command family. The 1c admin-reach decision: operator
|
|
201
|
+
* cross-agent terminal/interactive ops ride authz-mode `any` on the SAME commands (no wire
|
|
202
|
+
* synonym) - the any-mode subject row is minted ONLY into operator-authorized credentials: the
|
|
203
|
+
* `control-caller-admin`/`deployer`/`teardown` instruments AND an agent credential explicitly
|
|
204
|
+
* granted the `admin` capability (which by design mirrors the full admin instrument set - its
|
|
205
|
+
* ctl-tier equivalent already held `ctl.<admin>`, so this is parity, not a new escalation). An
|
|
206
|
+
* ordinary agent, incl. the `spawn` capability, never carries it. So the broker grant is the tier boundary exactly as
|
|
207
|
+
* `ctl.<admin>` is today, and the responder maps mode `any` to its admin authorization path. */
|
|
208
|
+
export function operatorInstrumentCapabilities(tier) {
|
|
209
|
+
const caps = [
|
|
210
|
+
...MANAGER_READ_SNAP.map((command) => ({
|
|
211
|
+
endpoint: BASELINE_LIFECYCLE_ENDPOINT, command,
|
|
212
|
+
// `ps` is the CLASS-SCATTER read (P2 item 3, `cotal ps` default): the instrument publishes it
|
|
213
|
+
// on the `all` scatter rail to gather every instance's rows in a multi-manager space. The
|
|
214
|
+
// other reads stay `one`-only (anycast, or `inst` when a resolve pins `--on`).
|
|
215
|
+
...(command === "ps" ? { routes: ["one", "all"] } : {}),
|
|
216
|
+
})),
|
|
217
|
+
...SPAWN_CREATE_SNAP.map((command) => ({ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command })),
|
|
218
|
+
{ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command: "define-persona" },
|
|
219
|
+
];
|
|
220
|
+
if (tier === "admin") {
|
|
221
|
+
caps.push(...SPAWN_OWNER_SNAP.map((command) => ({
|
|
222
|
+
endpoint: BASELINE_LIFECYCLE_ENDPOINT, command,
|
|
223
|
+
target: { mode: "any", tOwner: "*" },
|
|
224
|
+
})), ...MANAGER_ADMIN_SNAP.map((command) => ({ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command })));
|
|
225
|
+
}
|
|
226
|
+
return caps;
|
|
227
|
+
}
|
|
228
|
+
/** The SAME tier set, pinned to ONE instance — the issuance `--on <instanceId>` was always meant to
|
|
229
|
+
* get. These instruments are ONE-SHOT, minted per control call, and the resolve that chose the
|
|
230
|
+
* instance runs BEFORE the mint, so the exact id can be handed down and the emitter's
|
|
231
|
+
* `if (cap.instanceId)` branch produces exactly `ep.inst.<endpoint>.<iid>.<command>` for THIS
|
|
232
|
+
* invocation and nothing else. No wildcard instance is minted anywhere, which is what keeps the
|
|
233
|
+
* `inst-route-grant` boundary intact: instance addressing stays with the per-invocation operator
|
|
234
|
+
* instruments that already hold it, and a plain, spawn-capable, or observer credential still gets
|
|
235
|
+
* no instance route at all.
|
|
236
|
+
*
|
|
237
|
+
* `describe` is included EXPLICITLY. The baseline describe row is class-rail only
|
|
238
|
+
* ({@link epDescribeAllGrantRow}), so without this the pinned RESOLVE that must precede a pinned
|
|
239
|
+
* invoke is refused at the broker — and refused invisibly, because the client renders that refusal
|
|
240
|
+
* as a describe timeout. Here it is a concrete endpoint+instance capability, not the normative
|
|
241
|
+
* wildcard form, so the exact-arity discipline of the caller grammar is preserved. */
|
|
242
|
+
export function instancePinnedInstrumentCapabilities(tier, instanceId) {
|
|
243
|
+
assertLifecycleToken(instanceId, "instanceId"); // fail loud at mint on a malformed id, never widen a subject
|
|
244
|
+
return [
|
|
245
|
+
{ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command: "describe", instanceId },
|
|
246
|
+
...operatorInstrumentCapabilities(tier).map((cap) => ({ ...cap, instanceId })),
|
|
153
247
|
];
|
|
154
248
|
}
|
|
155
249
|
/** All BASELINE caller rows (Appendix B): the wildcard describe form + the baseline capability
|
|
156
250
|
* rollup into `pub.allow`, and the caller's reply rail into `sub.allow` — ALWAYS present (the
|
|
157
|
-
* baseline implies the reply read even when no per-capability rows are minted).
|
|
251
|
+
* baseline implies the reply read even when no per-capability rows are minted). The §13.7
|
|
252
|
+
* contract-store FETCH (the Direct Get API on the EPC stream) rides the baseline too: describe
|
|
253
|
+
* answers digests, and a caller that may describe may fetch-verify-compile the schemas those
|
|
254
|
+
* digests name (content-addressed public artifacts — a digest is the read capability; the
|
|
255
|
+
* per-caller authorization surface is the describe VIEW, never the schema bytes). */
|
|
158
256
|
export function epBaselineGrantRows(space, caller) {
|
|
159
257
|
const base = epCallerGrantRows(space, baselineCallerCapabilities(), caller);
|
|
160
|
-
return {
|
|
258
|
+
return {
|
|
259
|
+
pub: [
|
|
260
|
+
epDescribeAllGrantRow(space, caller),
|
|
261
|
+
// ONE subject-scoped Direct Get row (the `DIRECT.GET.<stream>.<subject>` form the client's
|
|
262
|
+
// last_by_subj read rides), pinned to the epc subject space — never the bare/stream-wide
|
|
263
|
+
// form. The D32 matrix audit exempts exactly this row shape from the untrusted-profile
|
|
264
|
+
// control-surface prohibition (the store is public content-addressed artifacts).
|
|
265
|
+
`$JS.API.DIRECT.GET.${epcStreamName(space)}.${spacePrefix(space)}.epc.>`,
|
|
266
|
+
...base.pub,
|
|
267
|
+
],
|
|
268
|
+
sub: [epCallerReplyGrantRow(space, caller)],
|
|
269
|
+
};
|
|
161
270
|
}
|
|
162
271
|
/** One registered command's serve-subscribe rows (§13.9 "Serve subscribe"), per registered
|
|
163
272
|
* command and never a cross-command `>`:
|