@cotal-ai/core 0.15.0 → 0.17.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 +75 -12
- 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.d.ts.map +1 -1
- package/dist/channels.js +18 -9
- 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 +24 -1
- package/dist/endpoint-contract-store.d.ts.map +1 -1
- package/dist/endpoint-contract-store.js +79 -27
- 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 +48 -7
- package/dist/endpoint-grants.d.ts.map +1 -1
- package/dist/endpoint-grants.js +97 -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 +340 -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 +10 -1
- package/dist/endpoint-subjects.d.ts.map +1 -1
- package/dist/endpoint-subjects.js +10 -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 +169 -15
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +491 -43
- package/dist/endpoint.js.map +1 -1
- package/dist/identity.d.ts +19 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +12 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/kv-scan.d.ts +105 -0
- package/dist/kv-scan.d.ts.map +1 -0
- package/dist/kv-scan.js +192 -0
- package/dist/kv-scan.js.map +1 -0
- 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/members.d.ts +8 -4
- package/dist/members.d.ts.map +1 -1
- package/dist/members.js +19 -9
- package/dist/members.js.map +1 -1
- 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 +106 -9
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +506 -110
- 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 +53 -1
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +135 -8
- package/dist/streams.js.map +1 -1
- package/dist/subjects.d.ts +32 -26
- package/dist/subjects.d.ts.map +1 -1
- package/dist/subjects.js +38 -25
- 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
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,66 @@ 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" },
|
|
153
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;
|
|
154
227
|
}
|
|
155
228
|
/** All BASELINE caller rows (Appendix B): the wildcard describe form + the baseline capability
|
|
156
229
|
* 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).
|
|
230
|
+
* baseline implies the reply read even when no per-capability rows are minted). The §13.7
|
|
231
|
+
* contract-store FETCH (the Direct Get API on the EPC stream) rides the baseline too: describe
|
|
232
|
+
* answers digests, and a caller that may describe may fetch-verify-compile the schemas those
|
|
233
|
+
* digests name (content-addressed public artifacts — a digest is the read capability; the
|
|
234
|
+
* per-caller authorization surface is the describe VIEW, never the schema bytes). */
|
|
158
235
|
export function epBaselineGrantRows(space, caller) {
|
|
159
236
|
const base = epCallerGrantRows(space, baselineCallerCapabilities(), caller);
|
|
160
|
-
return {
|
|
237
|
+
return {
|
|
238
|
+
pub: [
|
|
239
|
+
epDescribeAllGrantRow(space, caller),
|
|
240
|
+
// ONE subject-scoped Direct Get row (the `DIRECT.GET.<stream>.<subject>` form the client's
|
|
241
|
+
// last_by_subj read rides), pinned to the epc subject space — never the bare/stream-wide
|
|
242
|
+
// form. The D32 matrix audit exempts exactly this row shape from the untrusted-profile
|
|
243
|
+
// control-surface prohibition (the store is public content-addressed artifacts).
|
|
244
|
+
`$JS.API.DIRECT.GET.${epcStreamName(space)}.${spacePrefix(space)}.epc.>`,
|
|
245
|
+
...base.pub,
|
|
246
|
+
],
|
|
247
|
+
sub: [epCallerReplyGrantRow(space, caller)],
|
|
248
|
+
};
|
|
161
249
|
}
|
|
162
250
|
/** One registered command's serve-subscribe rows (§13.9 "Serve subscribe"), per registered
|
|
163
251
|
* command and never a cross-command `>`:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint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CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,KAAK,IAAI;KACnD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;yEAUyE;AACzE,MAAM,UAAU,gBAAgB,CAC9B,KAAa,EACb,KAA2F;IAE3F,IAAI,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,yHAAyH,CAAC,CAAC;IAC7I,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,iBAAiB,EAAE,UAAU,CAAC;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5I,MAAM,GAAG,GAAG,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,uCAAuC;IAC7H,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,oBAAoB,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;IACrJ,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { NatsConnection } from "@nats-io/transport-node";
|
|
2
|
+
import { type CompiledContract } from "./schema-profile.js";
|
|
3
|
+
import { type EpCaller } from "./endpoint-subjects.js";
|
|
4
|
+
import type { EpVerbTarget, EpAttributedReply, EpScatterResult } from "./endpoint-verbs.js";
|
|
5
|
+
/** A resolved command contract: the compiled input/output validators (recompiled from the store,
|
|
6
|
+
* digest-verified against the registered declaration) plus the command's §13.2 admission facts. */
|
|
7
|
+
export interface ResolvedCommand {
|
|
8
|
+
command: string;
|
|
9
|
+
contract: {
|
|
10
|
+
input: CompiledContract;
|
|
11
|
+
output: CompiledContract;
|
|
12
|
+
};
|
|
13
|
+
class: string;
|
|
14
|
+
targeted: boolean;
|
|
15
|
+
modes: readonly string[];
|
|
16
|
+
capability: string;
|
|
17
|
+
}
|
|
18
|
+
/** An endpoint's resolved invocation surface: every command the caller may see, with recompiled
|
|
19
|
+
* digest-verified contracts. Built from a fresh `describe` + store fetch. Carries the `caller`
|
|
20
|
+
* triple the describe ran as, so {@link invokeCommand} reuses the same authenticated identity,
|
|
21
|
+
* and the ANSWERING incarnation's identity off the describe reply SUBJECT (broker-authenticated:
|
|
22
|
+
* the §13.9 serve publish row pins `instanceId`+`epoch`, a responder cannot stamp another's) -
|
|
23
|
+
* {@link invokeCommand}'s default currency check binds the invoke to this incarnation. */
|
|
24
|
+
export interface ResolvedService {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
owner: string;
|
|
27
|
+
caller: EpCaller;
|
|
28
|
+
responder: {
|
|
29
|
+
instanceId: string;
|
|
30
|
+
epoch: number;
|
|
31
|
+
};
|
|
32
|
+
commands: Map<string, ResolvedCommand>;
|
|
33
|
+
/** Set when the service was resolved PINNED to one instance's `inst` route (P2 item 3 `--on`):
|
|
34
|
+
* {@link invokeCommand} then routes commands to that exact instance, never the class `one` queue,
|
|
35
|
+
* so a multi-manager space can be addressed per-instance. Absent ⇒ class anycast (the default). */
|
|
36
|
+
pinnedInstanceId?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The reserved `describe` command as a raw request/reply (§13.7: describe pins NO contract, so it
|
|
40
|
+
* carries no `op` digests — {@link epCall} always stamps digests and the serve boundary rejects a
|
|
41
|
+
* digest-bearing describe as `contract-mismatch`, so this is a purpose-built raw path). It
|
|
42
|
+
* REQUEST-BINDS its reply exactly as {@link epCall}'s `parseAttributedReply` does (§13.2): the
|
|
43
|
+
* responder grant `epResponderReplyPattern` spans EVERY caller suffix, so any live responder can
|
|
44
|
+
* publish on the caller's rail at any nonce — acceptance therefore checks the reply SUBJECT's
|
|
45
|
+
* endpoint + nonce AND the body's echoed request id, not just "first `{ok:true}` on the rail".
|
|
46
|
+
* A reply that fails any of these is IGNORED (not rejected: an attacker racing a wrong-nonce reply
|
|
47
|
+
* must not be able to fail an honest describe), and the wait continues to the deadline.
|
|
48
|
+
*/
|
|
49
|
+
export declare function describeEndpoint(nc: NatsConnection, space: string, endpoint: string, caller: EpCaller, opts?: {
|
|
50
|
+
deadlineMs?: number;
|
|
51
|
+
instanceId?: string;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
answer: DescribeAnswer;
|
|
54
|
+
responder: {
|
|
55
|
+
instanceId: string;
|
|
56
|
+
epoch: number;
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
/** The describe answer shape a caller reads (a subset — the fields the resolver needs). */
|
|
60
|
+
interface DescribeAnswer {
|
|
61
|
+
public: boolean;
|
|
62
|
+
descriptor: {
|
|
63
|
+
endpoint: string;
|
|
64
|
+
owner: string;
|
|
65
|
+
clusters: {
|
|
66
|
+
digest: string;
|
|
67
|
+
commands: string[];
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* DESCRIBE an endpoint and resolve its full invocation surface: send the reserved `describe`
|
|
73
|
+
* command (untargeted, void args), then for every VISIBLE cluster fetch + verify its document
|
|
74
|
+
* from the store and recompile each command's input/output contracts. The result lets a caller
|
|
75
|
+
* invoke any visible command by name with no compile-time knowledge of the endpoint's schemas.
|
|
76
|
+
*
|
|
77
|
+
* `describe` itself pins no contract (§13.7), so it is issued as a raw void-arg request
|
|
78
|
+
* ({@link describeEndpoint}), never through the digest-stamping {@link epCall}.
|
|
79
|
+
*/
|
|
80
|
+
export declare function resolveService(nc: NatsConnection, space: string, endpoint: string, caller: EpCaller, opts?: {
|
|
81
|
+
deadlineMs?: number;
|
|
82
|
+
instanceId?: string;
|
|
83
|
+
}): Promise<ResolvedService>;
|
|
84
|
+
/**
|
|
85
|
+
* INVOKE one named command on a resolved service: validate nothing here (the compiled input
|
|
86
|
+
* contract in {@link epCall}'s request builder gates args before publish, and the responder's
|
|
87
|
+
* digest-bound boundary re-validates), route on the `one` rail, return the attributed reply. A
|
|
88
|
+
* command absent from the resolved surface is `not-found` (the caller cannot see it, or it does
|
|
89
|
+
* not exist); a targeted command needs its `target`.
|
|
90
|
+
*
|
|
91
|
+
* Currency: `opts.currentEpoch` (e.g. the registry-read `serviceEpochReader`) when supplied;
|
|
92
|
+
* otherwise the DESCRIBE-BOUND default - accept exactly the incarnation that answered this
|
|
93
|
+
* service's resolve (its broker-authenticated `instanceId`+`epoch` off the describe reply
|
|
94
|
+
* subject) and refuse `failed-precondition` when a DIFFERENT instance wins the `one` queue
|
|
95
|
+
* (a superseded-or-split responder; re-resolve to adopt a legitimate successor). The bind needs
|
|
96
|
+
* no registry read grant, and it is strictly stronger than no check: two live instances of a
|
|
97
|
+
* single-instance endpoint can never both pass one resolved handle.
|
|
98
|
+
*/
|
|
99
|
+
export declare function invokeCommand(nc: NatsConnection, space: string, service: ResolvedService, command: string, args: Record<string, unknown> | undefined, opts: {
|
|
100
|
+
target?: EpVerbTarget;
|
|
101
|
+
deadlineMs?: number;
|
|
102
|
+
currentEpoch?: (instanceId: string) => Promise<number> | number;
|
|
103
|
+
}): Promise<EpAttributedReply>;
|
|
104
|
+
/** Submit an ACTION command and FOLLOW its goal to the terminal (P2 item 2, 2b): since 2a a
|
|
105
|
+
* spawn/launch reply is the ACCEPTANCE (returned before the agent is live), so a consumer that
|
|
106
|
+
* wants the old block-until-outcome behaviour follows the caller-scoped progress subtree to the
|
|
107
|
+
* terminal here. The subscription opens BEFORE `submit` runs (a fast join could terminalize within
|
|
108
|
+
* milliseconds of the acceptance), buffering terminals by goalId. The reply is then RESOLVED from
|
|
109
|
+
* the terminal: `succeeded` → the terminal's data (today's live reply — name/id/role/agent/mode/
|
|
110
|
+
* lifecycleUid), `failed`/`uncertain`/`cancelled` → a non-ok reply carrying the cause. A reply with
|
|
111
|
+
* NO goalId (a refuse-at-accept, or a non-action command) passes through unchanged. UX is preserved:
|
|
112
|
+
* the call still returns on the real outcome. The caller needs the per-goal progress read row
|
|
113
|
+
* ({@link epGoalProgressGrantRow}) — minted with any goal-bearing capability. */
|
|
114
|
+
export declare function submitAndFollowGoal(nc: NatsConnection, space: string, endpoint: string, caller: EpCaller, deadlineMs: number, submit: () => Promise<EpAttributedReply>): Promise<EpAttributedReply>;
|
|
115
|
+
/**
|
|
116
|
+
* SCATTER one untargeted command to the LIVE class (§13.5): resolve the command's contract off the
|
|
117
|
+
* same digest-verified surface {@link invokeCommand} uses, then run the registry-wired scatter —
|
|
118
|
+
* freeze the expected set from the records registry, publish ONCE on the `all` rail, gather one
|
|
119
|
+
* attributed reply per instance, and reconcile registration currency post-classification. The
|
|
120
|
+
* returned `replies` map is keyed by instanceId (per-instance attribution, SPEC §13.5); a frozen
|
|
121
|
+
* instance that produced no on-time reply is a `missing` slot — reported UNREACHABLE, never silently
|
|
122
|
+
* omitted. The caller's connection carries the §13.9 records-read grant the freeze/reconcile ride (a
|
|
123
|
+
* scoped read of the endpoint's `svc` registry); `jsm`/`kv` are opened over it here.
|
|
124
|
+
*
|
|
125
|
+
* A scatter addresses EVERY instance, so a targeted command is refused (a per-instance target is
|
|
126
|
+
* incoherent with the `all` rail) and a handle PINNED to one instance is refused (a pin is the
|
|
127
|
+
* anti-scatter — use {@link invokeCommand} for `--on`). "No args" marshals to the contract's
|
|
128
|
+
* canonical empty form exactly as {@link invokeCommand}.
|
|
129
|
+
*/
|
|
130
|
+
export declare function scatterCommand(nc: NatsConnection, space: string, service: ResolvedService, command: string, args: Record<string, unknown> | undefined, opts: {
|
|
131
|
+
deadlineMs: number;
|
|
132
|
+
reconcileDeadlineMs?: number;
|
|
133
|
+
lateDrainMs?: number;
|
|
134
|
+
}): Promise<EpScatterResult>;
|
|
135
|
+
/** A digest reference's bare hex, exported so a CLI can print the resolved surface's digests. */
|
|
136
|
+
export declare function contractDigestHexOf(value: unknown): string;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=endpoint-invoke.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-invoke.d.ts","sourceRoot":"","sources":["../src/endpoint-invoke.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,yBAAyB,CAAC;AAG5E,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQ7E,OAAO,EAAyD,KAAK,QAAQ,EAAgB,MAAM,wBAAwB,CAAC;AAE5H,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK5F;oGACoG;AACpG,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QAAE,KAAK,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;2FAK2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACvC;;wGAEoG;IACpG,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;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