@axonflow/sdk 9.2.0 → 9.3.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/README.md +121 -0
- package/dist/cjs/adapters/langgraph.d.ts.map +1 -1
- package/dist/cjs/adapters/langgraph.js +20 -0
- package/dist/cjs/adapters/langgraph.js.map +1 -1
- package/dist/cjs/authzen.d.ts +35 -10
- package/dist/cjs/authzen.d.ts.map +1 -1
- package/dist/cjs/authzen.js +45 -19
- package/dist/cjs/authzen.js.map +1 -1
- package/dist/cjs/client.d.ts +69 -10
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +338 -52
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/heartbeat.d.ts +55 -4
- package/dist/cjs/heartbeat.d.ts.map +1 -1
- package/dist/cjs/heartbeat.js +86 -7
- package/dist/cjs/heartbeat.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +12 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/read-identity.d.ts +267 -0
- package/dist/cjs/read-identity.d.ts.map +1 -0
- package/dist/cjs/read-identity.js +329 -0
- package/dist/cjs/read-identity.js.map +1 -0
- package/dist/cjs/telemetry.d.ts +108 -0
- package/dist/cjs/telemetry.d.ts.map +1 -1
- package/dist/cjs/telemetry.js +318 -35
- package/dist/cjs/telemetry.js.map +1 -1
- package/dist/cjs/types/authzen.gen.d.ts +4 -2
- package/dist/cjs/types/authzen.gen.d.ts.map +1 -1
- package/dist/cjs/types/authzen.gen.js +10 -4
- package/dist/cjs/types/authzen.gen.js.map +1 -1
- package/dist/cjs/types/config.d.ts +43 -1
- package/dist/cjs/types/config.d.ts.map +1 -1
- package/dist/cjs/types/hitl.js +1 -1
- package/dist/cjs/types/hitl.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/adapters/langgraph.d.ts.map +1 -1
- package/dist/esm/adapters/langgraph.js +20 -0
- package/dist/esm/adapters/langgraph.js.map +1 -1
- package/dist/esm/authzen.d.ts +35 -10
- package/dist/esm/authzen.d.ts.map +1 -1
- package/dist/esm/authzen.js +38 -14
- package/dist/esm/authzen.js.map +1 -1
- package/dist/esm/client.d.ts +69 -10
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +338 -52
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/heartbeat.d.ts +55 -4
- package/dist/esm/heartbeat.d.ts.map +1 -1
- package/dist/esm/heartbeat.js +85 -7
- package/dist/esm/heartbeat.js.map +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/read-identity.d.ts +267 -0
- package/dist/esm/read-identity.d.ts.map +1 -0
- package/dist/esm/read-identity.js +320 -0
- package/dist/esm/read-identity.js.map +1 -0
- package/dist/esm/telemetry.d.ts +108 -0
- package/dist/esm/telemetry.d.ts.map +1 -1
- package/dist/esm/telemetry.js +313 -35
- package/dist/esm/telemetry.js.map +1 -1
- package/dist/esm/types/authzen.gen.d.ts +4 -2
- package/dist/esm/types/authzen.gen.d.ts.map +1 -1
- package/dist/esm/types/authzen.gen.js +8 -2
- package/dist/esm/types/authzen.gen.js.map +1 -1
- package/dist/esm/types/config.d.ts +43 -1
- package/dist/esm/types/config.d.ts.map +1 -1
- package/dist/esm/types/hitl.js +1 -1
- package/dist/esm/types/hitl.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/heartbeat.d.ts
CHANGED
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
* AxonFlow emits at most one heartbeat per environment every
|
|
7
7
|
* 7 days during SDK activity.
|
|
8
8
|
*
|
|
9
|
-
* The gate is consulted at
|
|
10
|
-
*
|
|
9
|
+
* The gate is consulted at every public HTTP request site, via
|
|
10
|
+
* `_preRequestHook`. It is NOT consulted at client construction
|
|
11
|
+
* (axonflow-enterprise#3682): every framework adapter takes a client, so an
|
|
12
|
+
* adapter registering from its own constructor could never reach a
|
|
13
|
+
* constructor-time ping. A client that is constructed and never used does not
|
|
14
|
+
* ping. Each gate run:
|
|
11
15
|
*
|
|
12
16
|
* 1. Re-evaluates `AXONFLOW_TELEMETRY=off` cheaply (lock-free) so a
|
|
13
17
|
* mid-process opt-out toggle takes effect immediately.
|
|
@@ -36,6 +40,25 @@
|
|
|
36
40
|
export declare const HEARTBEAT_INTERVAL_MS: number;
|
|
37
41
|
/** 1 hour in milliseconds — bounds how often we stat() the stamp file. */
|
|
38
42
|
export declare const HEARTBEAT_GUARD_INTERVAL_MS: number;
|
|
43
|
+
/**
|
|
44
|
+
* How long the gate waits before re-consulting, given how many attempts in a
|
|
45
|
+
* row failed to deliver. Doubling from `HEARTBEAT_GUARD_INTERVAL_MS`, capped at
|
|
46
|
+
* `HEARTBEAT_INTERVAL_MS`.
|
|
47
|
+
*
|
|
48
|
+
* Without it the SDK has no backoff at all, and two deliberate design choices
|
|
49
|
+
* combine into a defect: the 7-day stamp only advances on DELIVERY, and the
|
|
50
|
+
* gate is re-evaluated on every request. In a deployment where egress to the
|
|
51
|
+
* checkpoint is blocked — the normal state of the air-gapped and in-VPC
|
|
52
|
+
* self-hosted topologies this SDK supports — every process would issue a
|
|
53
|
+
* `/health` GET against the CUSTOMER'S OWN platform once an hour,
|
|
54
|
+
* indefinitely, with a failed POST beside it. Unsolicited hourly traffic
|
|
55
|
+
* against someone else's platform, for a heartbeat disclosed as weekly, is not
|
|
56
|
+
* defensible.
|
|
57
|
+
*
|
|
58
|
+
* Backing off loses no ping: the stamp is still untouched, so the first attempt
|
|
59
|
+
* after the widened interval sends normally.
|
|
60
|
+
*/
|
|
61
|
+
export declare function guardIntervalFor(consecutiveFailures: number): number;
|
|
39
62
|
/**
|
|
40
63
|
* Resolve the OS-native stamp file path, or `null` if no user cache
|
|
41
64
|
* directory is available (Lambda etc.). Hand-rolled rather than via the
|
|
@@ -61,6 +84,32 @@ export declare class HeartbeatState {
|
|
|
61
84
|
lastCheckedMs: number | null;
|
|
62
85
|
inFlight: Promise<void> | null;
|
|
63
86
|
readonly stampPath: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Consecutive attempts that did NOT deliver. Widens the re-check interval so
|
|
89
|
+
* a deployment that can never reach the checkpoint stops probing its own
|
|
90
|
+
* platform every hour forever. Reset on delivery.
|
|
91
|
+
*/
|
|
92
|
+
consecutiveFailures: number;
|
|
93
|
+
/**
|
|
94
|
+
* When this PROCESS last DELIVERED a ping.
|
|
95
|
+
*
|
|
96
|
+
* The stamp file is the cross-restart record of that, but it is not always
|
|
97
|
+
* available: `resolveStampPath` returns null where there is no usable cache
|
|
98
|
+
* dir (HOME unset — distroless and scratch containers, Lambda custom
|
|
99
|
+
* runtimes), and `writeStampAtomic` silently fails on a read-only root
|
|
100
|
+
* filesystem (`readOnlyRootFilesystem: true` is ordinary Kubernetes
|
|
101
|
+
* hardening). In both, `readStampMtimeMs` returns null forever.
|
|
102
|
+
*
|
|
103
|
+
* The failure backoff cannot bound that case, because it resets on delivery
|
|
104
|
+
* and these deliveries SUCCEED: the gate re-opens every hour, the ping lands,
|
|
105
|
+
* the stamp cannot be written, and the next hour repeats it — 168x the "at
|
|
106
|
+
* most one ping per machine every 7 days" this SDK discloses, in exactly the
|
|
107
|
+
* environments least able to notice.
|
|
108
|
+
*
|
|
109
|
+
* So the cadence is enforced in memory too. Redundant whenever the stamp
|
|
110
|
+
* works, and the only bound when it does not.
|
|
111
|
+
*/
|
|
112
|
+
lastDeliveredMs: number | null;
|
|
64
113
|
constructor(stampPath?: string | null | typeof USE_DEFAULT_CACHE_DIR);
|
|
65
114
|
/**
|
|
66
115
|
* Returns the stamp file's mtime as wall-clock ms-since-epoch, or null
|
|
@@ -102,8 +151,10 @@ export declare function restoreHeartbeatStateForTest(state: HeartbeatState): voi
|
|
|
102
151
|
*/
|
|
103
152
|
export declare function flushHeartbeat(): Promise<void> | null;
|
|
104
153
|
/**
|
|
105
|
-
* Central gate for telemetry pings. Called from
|
|
106
|
-
*
|
|
154
|
+
* Central gate for telemetry pings. Called from `_preRequestHook` on every
|
|
155
|
+
* public HTTP entry point — and NOT from the AxonFlow constructor, which
|
|
156
|
+
* stopped pinging in axonflow-enterprise#3682 so that an adapter registering
|
|
157
|
+
* from its own constructor can reach the first ping.
|
|
107
158
|
*
|
|
108
159
|
* The `pingFn` callback returns a Promise<boolean> indicating delivery
|
|
109
160
|
* success. The stamp is written ONLY when this resolves to true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../src/heartbeat.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../../src/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAKH,8BAA8B;AAC9B,eAAO,MAAM,qBAAqB,QAA0B,CAAC;AAE7D,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAS1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAoBhD;AAED,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,eAAkD,CAAC;AAErF;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAc;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;IACpC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAQ;IAC7C,SAAgB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;;;OAIG;IACI,mBAAmB,SAAK;IAE/B;;;;;;;;;;;;;;;;;;OAkBG;IACI,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;gBAEjC,SAAS,GAAE,MAAM,GAAG,IAAI,GAAG,OAAO,qBAA6C;IAI3F;;;;OAIG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;IASjC;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAsBxC;AAMD,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,qBAAqB,GACtD,cAAc,CAIhB;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAExE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAErD;AAYD;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CACtC,kBAAkB,EAAE,OAAO,EAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAC7B,OAAO,CAAC,IAAI,CAAC,CA4Df"}
|
package/dist/cjs/heartbeat.js
CHANGED
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
* AxonFlow emits at most one heartbeat per environment every
|
|
8
8
|
* 7 days during SDK activity.
|
|
9
9
|
*
|
|
10
|
-
* The gate is consulted at
|
|
11
|
-
*
|
|
10
|
+
* The gate is consulted at every public HTTP request site, via
|
|
11
|
+
* `_preRequestHook`. It is NOT consulted at client construction
|
|
12
|
+
* (axonflow-enterprise#3682): every framework adapter takes a client, so an
|
|
13
|
+
* adapter registering from its own constructor could never reach a
|
|
14
|
+
* constructor-time ping. A client that is constructed and never used does not
|
|
15
|
+
* ping. Each gate run:
|
|
12
16
|
*
|
|
13
17
|
* 1. Re-evaluates `AXONFLOW_TELEMETRY=off` cheaply (lock-free) so a
|
|
14
18
|
* mid-process opt-out toggle takes effect immediately.
|
|
@@ -68,6 +72,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
68
72
|
})();
|
|
69
73
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
74
|
exports.HeartbeatState = exports.USE_DEFAULT_CACHE_DIR = exports.HEARTBEAT_GUARD_INTERVAL_MS = exports.HEARTBEAT_INTERVAL_MS = void 0;
|
|
75
|
+
exports.guardIntervalFor = guardIntervalFor;
|
|
71
76
|
exports.resolveStampPath = resolveStampPath;
|
|
72
77
|
exports.getHeartbeatStateForTest = getHeartbeatStateForTest;
|
|
73
78
|
exports.replaceHeartbeatStateForTest = replaceHeartbeatStateForTest;
|
|
@@ -80,6 +85,34 @@ const path = __importStar(require("path"));
|
|
|
80
85
|
exports.HEARTBEAT_INTERVAL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
81
86
|
/** 1 hour in milliseconds — bounds how often we stat() the stamp file. */
|
|
82
87
|
exports.HEARTBEAT_GUARD_INTERVAL_MS = 60 * 60 * 1000;
|
|
88
|
+
/**
|
|
89
|
+
* Ceiling on how many times the guard interval may double. 16 doublings
|
|
90
|
+
* already exceed the 7-day cap by orders of magnitude; the clamp exists so an
|
|
91
|
+
* unbounded failure counter cannot produce an absurd interval.
|
|
92
|
+
*/
|
|
93
|
+
const MAX_BACKOFF_DOUBLINGS = 16;
|
|
94
|
+
/**
|
|
95
|
+
* How long the gate waits before re-consulting, given how many attempts in a
|
|
96
|
+
* row failed to deliver. Doubling from `HEARTBEAT_GUARD_INTERVAL_MS`, capped at
|
|
97
|
+
* `HEARTBEAT_INTERVAL_MS`.
|
|
98
|
+
*
|
|
99
|
+
* Without it the SDK has no backoff at all, and two deliberate design choices
|
|
100
|
+
* combine into a defect: the 7-day stamp only advances on DELIVERY, and the
|
|
101
|
+
* gate is re-evaluated on every request. In a deployment where egress to the
|
|
102
|
+
* checkpoint is blocked — the normal state of the air-gapped and in-VPC
|
|
103
|
+
* self-hosted topologies this SDK supports — every process would issue a
|
|
104
|
+
* `/health` GET against the CUSTOMER'S OWN platform once an hour,
|
|
105
|
+
* indefinitely, with a failed POST beside it. Unsolicited hourly traffic
|
|
106
|
+
* against someone else's platform, for a heartbeat disclosed as weekly, is not
|
|
107
|
+
* defensible.
|
|
108
|
+
*
|
|
109
|
+
* Backing off loses no ping: the stamp is still untouched, so the first attempt
|
|
110
|
+
* after the widened interval sends normally.
|
|
111
|
+
*/
|
|
112
|
+
function guardIntervalFor(consecutiveFailures) {
|
|
113
|
+
const doublings = Math.min(consecutiveFailures, MAX_BACKOFF_DOUBLINGS);
|
|
114
|
+
return Math.min(exports.HEARTBEAT_GUARD_INTERVAL_MS * 2 ** doublings, exports.HEARTBEAT_INTERVAL_MS);
|
|
115
|
+
}
|
|
83
116
|
/**
|
|
84
117
|
* Resolve the OS-native stamp file path, or `null` if no user cache
|
|
85
118
|
* directory is available (Lambda etc.). Hand-rolled rather than via the
|
|
@@ -128,6 +161,32 @@ class HeartbeatState {
|
|
|
128
161
|
constructor(stampPath = exports.USE_DEFAULT_CACHE_DIR) {
|
|
129
162
|
this.lastCheckedMs = null;
|
|
130
163
|
this.inFlight = null;
|
|
164
|
+
/**
|
|
165
|
+
* Consecutive attempts that did NOT deliver. Widens the re-check interval so
|
|
166
|
+
* a deployment that can never reach the checkpoint stops probing its own
|
|
167
|
+
* platform every hour forever. Reset on delivery.
|
|
168
|
+
*/
|
|
169
|
+
this.consecutiveFailures = 0;
|
|
170
|
+
/**
|
|
171
|
+
* When this PROCESS last DELIVERED a ping.
|
|
172
|
+
*
|
|
173
|
+
* The stamp file is the cross-restart record of that, but it is not always
|
|
174
|
+
* available: `resolveStampPath` returns null where there is no usable cache
|
|
175
|
+
* dir (HOME unset — distroless and scratch containers, Lambda custom
|
|
176
|
+
* runtimes), and `writeStampAtomic` silently fails on a read-only root
|
|
177
|
+
* filesystem (`readOnlyRootFilesystem: true` is ordinary Kubernetes
|
|
178
|
+
* hardening). In both, `readStampMtimeMs` returns null forever.
|
|
179
|
+
*
|
|
180
|
+
* The failure backoff cannot bound that case, because it resets on delivery
|
|
181
|
+
* and these deliveries SUCCEED: the gate re-opens every hour, the ping lands,
|
|
182
|
+
* the stamp cannot be written, and the next hour repeats it — 168x the "at
|
|
183
|
+
* most one ping per machine every 7 days" this SDK discloses, in exactly the
|
|
184
|
+
* environments least able to notice.
|
|
185
|
+
*
|
|
186
|
+
* So the cadence is enforced in memory too. Redundant whenever the stamp
|
|
187
|
+
* works, and the only bound when it does not.
|
|
188
|
+
*/
|
|
189
|
+
this.lastDeliveredMs = null;
|
|
131
190
|
this.stampPath = stampPath === exports.USE_DEFAULT_CACHE_DIR ? resolveStampPath() : stampPath;
|
|
132
191
|
}
|
|
133
192
|
/**
|
|
@@ -228,8 +287,10 @@ function isOptedOut() {
|
|
|
228
287
|
return process.env.AXONFLOW_TELEMETRY?.trim().toLowerCase() === 'off';
|
|
229
288
|
}
|
|
230
289
|
/**
|
|
231
|
-
* Central gate for telemetry pings. Called from
|
|
232
|
-
*
|
|
290
|
+
* Central gate for telemetry pings. Called from `_preRequestHook` on every
|
|
291
|
+
* public HTTP entry point — and NOT from the AxonFlow constructor, which
|
|
292
|
+
* stopped pinging in axonflow-enterprise#3682 so that an adapter registering
|
|
293
|
+
* from its own constructor can reach the first ping.
|
|
233
294
|
*
|
|
234
295
|
* The `pingFn` callback returns a Promise<boolean> indicating delivery
|
|
235
296
|
* success. The stamp is written ONLY when this resolves to true,
|
|
@@ -250,12 +311,19 @@ async function maybeSendHeartbeat(isTelemetryEnabled, pingFn) {
|
|
|
250
311
|
if (h.inFlight)
|
|
251
312
|
return;
|
|
252
313
|
const nowMs = Date.now();
|
|
253
|
-
// 3. In-memory
|
|
254
|
-
if (h.lastCheckedMs !== null &&
|
|
314
|
+
// 3. In-memory guard, WIDENED by consecutive delivery failures.
|
|
315
|
+
if (h.lastCheckedMs !== null &&
|
|
316
|
+
nowMs - h.lastCheckedMs < guardIntervalFor(h.consecutiveFailures)) {
|
|
255
317
|
return;
|
|
256
318
|
}
|
|
257
319
|
h.lastCheckedMs = nowMs;
|
|
258
|
-
// 4.
|
|
320
|
+
// 4. In-memory 7-day cadence, checked BEFORE the stamp. Where the stamp
|
|
321
|
+
// cannot be persisted this is the only thing standing between a delivered
|
|
322
|
+
// ping and an hourly one — see `lastDeliveredMs`.
|
|
323
|
+
if (h.lastDeliveredMs !== null && nowMs - h.lastDeliveredMs < exports.HEARTBEAT_INTERVAL_MS) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
// 5. Stamp file mtime gate.
|
|
259
327
|
const mtimeMs = h.readStampMtimeMs();
|
|
260
328
|
if (mtimeMs !== null && nowMs - mtimeMs < exports.HEARTBEAT_INTERVAL_MS) {
|
|
261
329
|
return;
|
|
@@ -265,12 +333,23 @@ async function maybeSendHeartbeat(isTelemetryEnabled, pingFn) {
|
|
|
265
333
|
h.inFlight = (async () => {
|
|
266
334
|
try {
|
|
267
335
|
const ok = await pingFn();
|
|
336
|
+
// Recorded for EVERY attempt: the failure counter drives the widened
|
|
337
|
+
// guard, and the delivery instant bounds the success cadence when the
|
|
338
|
+
// stamp file is unavailable. A pass that stopped at a fresh stamp never
|
|
339
|
+
// reaches here, and must not — a suppressed pass is the gate working,
|
|
340
|
+
// not an attempt that failed.
|
|
268
341
|
if (ok) {
|
|
342
|
+
h.consecutiveFailures = 0;
|
|
343
|
+
h.lastDeliveredMs = Date.now();
|
|
269
344
|
await h.writeStampAtomic();
|
|
270
345
|
}
|
|
346
|
+
else {
|
|
347
|
+
h.consecutiveFailures += 1;
|
|
348
|
+
}
|
|
271
349
|
}
|
|
272
350
|
catch {
|
|
273
351
|
// pingFn must never throw in practice, but defend anyway.
|
|
352
|
+
h.consecutiveFailures += 1;
|
|
274
353
|
}
|
|
275
354
|
finally {
|
|
276
355
|
h.inFlight = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../../src/heartbeat.ts"],"names":[],"mappings":";AAAA
|
|
1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O,GAAG,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACrC,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,GAAG,OAAO,GAAG,6BAAqB,EAAE,CAAC;QAChE,OAAO;IACT,CAAC;IAED,qEAAqE;IACrE,+DAA+D;IAC/D,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;YAC1B,qEAAqE;YACrE,sEAAsE;YACtE,wEAAwE;YACxE,sEAAsE;YACtE,8BAA8B;YAC9B,IAAI,EAAE,EAAE,CAAC;gBACP,CAAC,CAAC,mBAAmB,GAAG,CAAC,CAAC;gBAC1B,CAAC,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;gBAC/B,MAAM,CAAC,CAAC,gBAAgB,EAAE,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,0DAA0D;YAC1D,CAAC,CAAC,mBAAmB,IAAI,CAAC,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACT,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
export { AxonFlow } from './client';
|
|
52
|
+
export { HEADER_READ_SCOPE, HEADER_USER_TOKEN, ReadScope, ReadScopeError } from './read-identity';
|
|
53
|
+
export type { ReadIdentityOptions } from './read-identity';
|
|
52
54
|
export { wasRedacted } from './types/connector';
|
|
53
55
|
export type { ConnectorResponse, ConnectorMetadata, ConnectorInstallRequest, PolicyMatchInfo, DynamicPolicyInfo, DynamicPolicyMatch, ConnectorHealthStatus, PolicyInfo, MCPPolicyInfo, ExfiltrationCheckInfo, MCPCheckInputOptions, MCPCheckInputResponse, MCPCheckOutputOptions, MCPCheckOutputResponse, MCPExplainPolicy, } from './types/connector';
|
|
54
56
|
export { AxonFlowError, ConfigurationError, ConnectionError, ConnectorError, PlanExecutionError, VersionConflictError, PolicyViolationError, AuthenticationError, RateLimitError, TimeoutError, IdempotencyKeyMismatchError, APIError, ObligationNotFulfillableError, } from './errors';
|
|
@@ -84,4 +86,5 @@ export type { TryRegistration } from './community';
|
|
|
84
86
|
export { VERSION } from './version';
|
|
85
87
|
import { AxonFlow } from './client';
|
|
86
88
|
export default AxonFlow;
|
|
89
|
+
export { registerAdapter } from './telemetry';
|
|
87
90
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EAKrB,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EAKtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,2BAA2B,EAC3B,QAAQ,EACR,6BAA6B,GAC9B,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,WAAW,EA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vB,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAUzB,cAAc,qBAAqB,CAAC;AAIpC,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,iCAAiC,EACjC,mCAAmC,EACnC,+BAA+B,EAC/B,4BAA4B,EAC5B,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,MAAM,GACP,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG3F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,eAAe,QAAQ,CAAC;AAIxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -64,10 +64,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
64
64
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
65
65
|
};
|
|
66
66
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.
|
|
68
|
-
exports.VERSION = exports.registerTry = exports.toWire = exports.buildEnvelope = exports.AuthZENRefusal = exports.AuthZENProtocolError = exports.AuthZENDecision = void 0;
|
|
67
|
+
exports.AUTHZEN_UNKNOWN_REQUIRED_ABSENT = exports.AUTHZEN_UNKNOWN_NOT_SUPPLIED = exports.AUTHZEN_UNKNOWN_MALFORMED_VALUE = exports.AUTHZEN_UNKNOWN_CLOSURE_UNAVAILABLE = exports.AUTHZEN_UNKNOWN_CLOSURE_TRUNCATED = exports.AUTHZEN_PROFILE_HEADER = exports.AUTHZEN_PATH = exports.AUTHZEN_ATTRIBUTE_MARKER = exports.ExecutionHelpers = exports.WorkflowApprovalRequiredError = exports.WorkflowBlockedError = exports.AxonFlowLangGraphAdapter = exports.governTools = exports.GovernedTool = exports.WorkflowHelpers = exports.CATEGORY_MEDIA_PII = exports.CATEGORY_MEDIA_DOCUMENT = exports.CATEGORY_MEDIA_BIOMETRIC = exports.CATEGORY_MEDIA_SAFETY = exports.endpointPathMatches = exports.hasRequestRedaction = exports.DECIDE_PATH = exports.RESPONSE_REDACTION_PATH = exports.REQUEST_REDACTION_PATH = exports.VERDICT_NEEDS_APPROVAL = exports.VERDICT_DENY = exports.VERDICT_ALLOW = exports.CONTENT_TYPE_TEXT = exports.PHASE_RESPONSE = exports.PHASE_REQUEST = exports.OBLIGATION_REDACT_PII = exports.ObligationNotFulfillableError = exports.APIError = exports.IdempotencyKeyMismatchError = exports.TimeoutError = exports.RateLimitError = exports.AuthenticationError = exports.PolicyViolationError = exports.VersionConflictError = exports.PlanExecutionError = exports.ConnectorError = exports.ConnectionError = exports.ConfigurationError = exports.AxonFlowError = exports.wasRedacted = exports.ReadScopeError = exports.ReadScope = exports.HEADER_USER_TOKEN = exports.HEADER_READ_SCOPE = exports.AxonFlow = void 0;
|
|
68
|
+
exports.registerAdapter = exports.VERSION = exports.registerTry = exports.toWire = exports.buildEnvelope = exports.AuthZENRefusal = exports.AuthZENProtocolError = exports.AuthZENDecision = exports.AuthZENAttribute = exports.AUTHZEN_UNKNOWN_STALE = exports.AUTHZEN_UNKNOWN_SCHEMA_MISMATCH = exports.AUTHZEN_UNKNOWN_RESOLUTION_FAILED = void 0;
|
|
69
69
|
var client_1 = require("./client");
|
|
70
70
|
Object.defineProperty(exports, "AxonFlow", { enumerable: true, get: function () { return client_1.AxonFlow; } });
|
|
71
|
+
// Read-path per-user identity and the platform's read-scope contract (#2922).
|
|
72
|
+
var read_identity_1 = require("./read-identity");
|
|
73
|
+
Object.defineProperty(exports, "HEADER_READ_SCOPE", { enumerable: true, get: function () { return read_identity_1.HEADER_READ_SCOPE; } });
|
|
74
|
+
Object.defineProperty(exports, "HEADER_USER_TOKEN", { enumerable: true, get: function () { return read_identity_1.HEADER_USER_TOKEN; } });
|
|
75
|
+
Object.defineProperty(exports, "ReadScope", { enumerable: true, get: function () { return read_identity_1.ReadScope; } });
|
|
76
|
+
Object.defineProperty(exports, "ReadScopeError", { enumerable: true, get: function () { return read_identity_1.ReadScopeError; } });
|
|
71
77
|
// Export connector utilities
|
|
72
78
|
var connector_1 = require("./types/connector");
|
|
73
79
|
Object.defineProperty(exports, "wasRedacted", { enumerable: true, get: function () { return connector_1.wasRedacted; } });
|
|
@@ -158,4 +164,8 @@ Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () {
|
|
|
158
164
|
// Default export for convenience
|
|
159
165
|
const client_2 = require("./client");
|
|
160
166
|
exports.default = client_2.AxonFlow;
|
|
167
|
+
// Telemetry: declaring a framework adapter on the existing heartbeat.
|
|
168
|
+
// See telemetry.ts registerAdapter; it performs no I/O.
|
|
169
|
+
var telemetry_1 = require("./telemetry");
|
|
170
|
+
Object.defineProperty(exports, "registerAdapter", { enumerable: true, get: function () { return telemetry_1.registerAdapter; } });
|
|
161
171
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;;;;;;;;;;;;;;;;AAEH,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AAEjB,6BAA6B;AAC7B,+CAAgD;AAAvC,wGAAA,WAAW,OAAA;AA6BpB,i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C9C,qCAkBmB;AAjBjB,mHAAA,wBAAwB,OAAA;AACxB,uGAAA,YAAY,OAAA;AACZ,iHAAA,sBAAsB,OAAA;AACtB,4HAAA,iCAAiC,OAAA;AACjC,8HAAA,mCAAmC,OAAA;AACnC,0HAAA,+BAA+B,OAAA;AAC/B,uHAAA,4BAA4B,OAAA;AAC5B,0HAAA,+BAA+B,OAAA;AAC/B,4HAAA,iCAAiC,OAAA;AACjC,0HAAA,+BAA+B,OAAA;AAC/B,gHAAA,qBAAqB,OAAA;AACrB,2GAAA,gBAAgB,OAAA;AAChB,0GAAA,eAAe,OAAA;AACf,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,wGAAA,aAAa,OAAA;AACb,iGAAA,MAAM,OAAA;AAIR,4CAA4C;AAC5C,yCAA0C;AAAjC,wGAAA,WAAW,OAAA;AAGpB,iBAAiB;AACjB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAEhB,iCAAiC;AACjC,qCAAoC;AACpC,kBAAe,iBAAQ,CAAC;AAExB,sEAAsE;AACtE,wDAAwD;AACxD,yCAA8C;AAArC,4GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-path per-user identity and the platform's read-scope contract.
|
|
3
|
+
*
|
|
4
|
+
* Since platform #2922 the role-scoped read routes (audit / decisions /
|
|
5
|
+
* overrides) answer from the identity the CALLER presents, not from the tenant
|
|
6
|
+
* credential alone. The tenant credential in `Authorization` says which
|
|
7
|
+
* organization is asking; it does not say WHO. A caller that presents no
|
|
8
|
+
* per-user identity to an enterprise stack is not "a caller who sees
|
|
9
|
+
* everything" and is not "a caller who sees nothing by coincidence" — it is a
|
|
10
|
+
* caller the platform cannot scope, and every scoped read it makes returns
|
|
11
|
+
* zero rows by construction.
|
|
12
|
+
*
|
|
13
|
+
* This module carries the whole surface:
|
|
14
|
+
*
|
|
15
|
+
* - the per-user identity itself (`userToken` on the config for a client-wide
|
|
16
|
+
* identity, the per-call `{ userToken }` option on a read, and
|
|
17
|
+
* `client.asUser(token)` for a process acting on behalf of several people),
|
|
18
|
+
* stamped as the `X-User-Token` header from exactly ONE site — the client's
|
|
19
|
+
* `_fetch` wrapper, which every request goes through. There is no per-method
|
|
20
|
+
* header plumbing, deliberately: the platform reads the header once in its
|
|
21
|
+
* own proxy middleware (`platform/agent/proxy.go` `proxyAuthMiddleware`),
|
|
22
|
+
* not per route, so a per-method sprinkle here would be a second, drifting
|
|
23
|
+
* copy of a decision the platform makes in one place.
|
|
24
|
+
*
|
|
25
|
+
* - the response side of the same contract: `X-Axonflow-Read-Scope`, which the
|
|
26
|
+
* platform stamps on every scoped read (`platform/orchestrator/read_scope.go`
|
|
27
|
+
* `applyReadScopeHeader`) to say which of the three scopes the answer was
|
|
28
|
+
* computed under. Without it, a 404 from explain and an empty list from
|
|
29
|
+
* `listDecisions` are indistinguishable from "the row is not there", which is
|
|
30
|
+
* how a governed read comes to report a confident, vacuous nothing.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The request header carrying the per-user identity.
|
|
34
|
+
*
|
|
35
|
+
* This constant is the SDK's only spelling of it. The header is set in exactly
|
|
36
|
+
* one place (`applyReadIdentity`, called from the client's `_fetch`); if you
|
|
37
|
+
* find yourself setting it in a method, the method is the wrong altitude.
|
|
38
|
+
*/
|
|
39
|
+
export declare const HEADER_USER_TOKEN = "X-User-Token";
|
|
40
|
+
/** The response header the platform stamps on scoped reads. */
|
|
41
|
+
export declare const HEADER_READ_SCOPE = "X-Axonflow-Read-Scope";
|
|
42
|
+
/**
|
|
43
|
+
* The scope the platform computed a role-scoped read under, taken from the
|
|
44
|
+
* `X-Axonflow-Read-Scope` response header.
|
|
45
|
+
*
|
|
46
|
+
* A plain string union widened with `(string & {})` rather than a closed enum,
|
|
47
|
+
* for one deliberate reason: a scope value a newer platform names and this
|
|
48
|
+
* build does not recognise must round-trip verbatim instead of being narrowed
|
|
49
|
+
* away or folded into a neighbour.
|
|
50
|
+
*
|
|
51
|
+
* Three named values are the platform's closed set. Two states are NOT in it
|
|
52
|
+
* and are deliberately distinct from each other and from the three:
|
|
53
|
+
*
|
|
54
|
+
* - `''` (ReadScope.Absent) — the response carried no such header. That is
|
|
55
|
+
* what a pre-#2922 platform, a non-scoped route, or a proxy that dropped the
|
|
56
|
+
* header looks like. It means "not stated", never "none": treating an absent
|
|
57
|
+
* header as a scope of `none` would turn every older stack's perfectly good
|
|
58
|
+
* read into a refusal.
|
|
59
|
+
*
|
|
60
|
+
* - any other non-empty string — preserved verbatim so a caller can see what it
|
|
61
|
+
* was, and never a trigger for a refusal: this header is the platform's
|
|
62
|
+
* account of a decision it has ALREADY made and applied, so an unrecognised
|
|
63
|
+
* value is a reporting gap on our side, not a licence to invent an outcome.
|
|
64
|
+
*/
|
|
65
|
+
export type ReadScope = 'tenant' | 'own-rows' | 'none' | '' | (string & {});
|
|
66
|
+
export declare const ReadScope: {
|
|
67
|
+
/** No `X-Axonflow-Read-Scope` header at all. Distinct from `None`. */
|
|
68
|
+
readonly Absent: ReadScope;
|
|
69
|
+
/**
|
|
70
|
+
* Tenant-wide: a tenant-wide role (admin / owner / policy_admin), or a
|
|
71
|
+
* Community / Community-SaaS deployment where the whole tenant is the one
|
|
72
|
+
* operator.
|
|
73
|
+
*/
|
|
74
|
+
readonly Tenant: ReadScope;
|
|
75
|
+
/**
|
|
76
|
+
* Narrowed to the rows attributed to the identity presented. A miss under
|
|
77
|
+
* this scope means "not among yours", which is NOT the same statement as
|
|
78
|
+
* "not there" — see `ReadScopeError`.
|
|
79
|
+
*/
|
|
80
|
+
readonly OwnRows: ReadScope;
|
|
81
|
+
/**
|
|
82
|
+
* The platform RESOLVED no per-user identity and the caller holds no
|
|
83
|
+
* tenant-wide authority, so it returned zero rows by construction. Under this
|
|
84
|
+
* scope a read CANNOT have returned data, so its empty answer says nothing
|
|
85
|
+
* about what exists.
|
|
86
|
+
*
|
|
87
|
+
* "Resolved none" is wider than "presented none", and the difference is worth
|
|
88
|
+
* knowing before you go looking in the wrong place. A token that validates
|
|
89
|
+
* perfectly still resolves to no identity when its address is one the
|
|
90
|
+
* platform reserves for SHARED, non-personal identities — the whole of
|
|
91
|
+
* `@axonflow.local` and `@axonflow.internal`, plus the community and
|
|
92
|
+
* evaluator addresses. Those name a pool of callers rather than a person, and
|
|
93
|
+
* scoping a read to one would return the pool, so the platform deliberately
|
|
94
|
+
* censuses them to nothing. A per-user token minted with an address in one of
|
|
95
|
+
* those domains therefore reads exactly like no token at all. (Easy to hit:
|
|
96
|
+
* the platform's own `generate-jwt.sh` defaults to
|
|
97
|
+
* `demo-user@axonflow.local`.)
|
|
98
|
+
*/
|
|
99
|
+
readonly None: ReadScope;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The scope the platform reported on `response`.
|
|
103
|
+
*
|
|
104
|
+
* Trimmed and lower-cased, for the same reason the platform's own header
|
|
105
|
+
* helpers are: a proxy that normalises header casing or appends whitespace must
|
|
106
|
+
* not silently change the answer. The cost of getting that wrong is one-sided
|
|
107
|
+
* and quiet — a scope spelled `None` would fall to the unrecognised branch and
|
|
108
|
+
* the vacuous empty page it describes would come back as data again. An
|
|
109
|
+
* unrecognised value is otherwise unchanged, so it still round-trips.
|
|
110
|
+
*/
|
|
111
|
+
export declare function readScopeOf(response: Response | null | undefined): ReadScope;
|
|
112
|
+
/**
|
|
113
|
+
* A role-scoped read whose answer was decided by the caller's identity scope
|
|
114
|
+
* rather than by the data.
|
|
115
|
+
*
|
|
116
|
+
* It exists because "no rows" and "no identity" are the same bytes on the wire.
|
|
117
|
+
* The platform distinguishes them in the `X-Axonflow-Read-Scope` header; this
|
|
118
|
+
* error is that distinction made visible, so a read that could not have
|
|
119
|
+
* succeeded reports a cause instead of a confident nothing.
|
|
120
|
+
*
|
|
121
|
+
* Two shapes, told apart by `identityMissing`:
|
|
122
|
+
*
|
|
123
|
+
* - `ReadScope.None` — no identity was RESOLVED; the read returned zero rows by
|
|
124
|
+
* construction and says nothing about what exists. Remedy: present an
|
|
125
|
+
* identity whose address is a real person's — see `ReadScope.None` for why a
|
|
126
|
+
* valid token can still resolve to nothing.
|
|
127
|
+
* - `ReadScope.OwnRows` — an identity WAS resolved, and the row is not among
|
|
128
|
+
* the ones attributed to it. That does NOT mean the row exists and belongs to
|
|
129
|
+
* somebody else: the platform answers "not attributed to you" and "not there
|
|
130
|
+
* at all" with the identical 404, deliberately, so that a miss cannot be used
|
|
131
|
+
* to probe for another user's rows. This error therefore reports the scope,
|
|
132
|
+
* not a claim about what exists.
|
|
133
|
+
*
|
|
134
|
+
* The presented token is never included in the message: it is safe to log,
|
|
135
|
+
* which is the point of putting the diagnosis in a type rather than in a string
|
|
136
|
+
* the caller assembles from the credential.
|
|
137
|
+
*/
|
|
138
|
+
export declare class ReadScopeError extends Error {
|
|
139
|
+
readonly scope: ReadScope;
|
|
140
|
+
readonly statusCode: number;
|
|
141
|
+
readonly resource: string;
|
|
142
|
+
readonly identifier?: string;
|
|
143
|
+
constructor(args: {
|
|
144
|
+
scope: ReadScope;
|
|
145
|
+
statusCode: number;
|
|
146
|
+
resource?: string;
|
|
147
|
+
identifier?: string;
|
|
148
|
+
});
|
|
149
|
+
/**
|
|
150
|
+
* Whether the read failed because no per-user identity was resolved, as
|
|
151
|
+
* opposed to one being resolved and not matching.
|
|
152
|
+
*/
|
|
153
|
+
get identityMissing(): boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The typed refusal for a scoped read that came back with nothing, or
|
|
157
|
+
* `undefined` when the scope does not explain the result.
|
|
158
|
+
*
|
|
159
|
+
* `undefined` for `ReadScope.Tenant` (the caller could see the whole tenant and
|
|
160
|
+
* it still was not there — a genuine miss), for `ReadScope.Absent` (the
|
|
161
|
+
* platform did not state a scope; see `ReadScope` for why absent is not none),
|
|
162
|
+
* and for any scope value this build does not recognise (a newer platform's;
|
|
163
|
+
* reporting a cause we cannot actually read would be a confident wrong
|
|
164
|
+
* diagnosis).
|
|
165
|
+
*/
|
|
166
|
+
export declare function readScopeErrorFor(args: {
|
|
167
|
+
resource: string;
|
|
168
|
+
identifier?: string;
|
|
169
|
+
scope: ReadScope;
|
|
170
|
+
statusCode: number;
|
|
171
|
+
}): ReadScopeError | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* The typed refusal for a scoped read that came back EMPTY under a scope that
|
|
174
|
+
* could not have returned a row; `undefined` in every other case.
|
|
175
|
+
*
|
|
176
|
+
* One helper rather than a check at each read, because "the page is empty and
|
|
177
|
+
* the scope is none" is one rule and the reads that need it decode their body
|
|
178
|
+
* on more than one path each. A rule copied per return site is a rule that ends
|
|
179
|
+
* up applied on some of them.
|
|
180
|
+
*
|
|
181
|
+
* The emptiness guard is as load-bearing as the scope guard: a non-empty page
|
|
182
|
+
* is never turned into an error, whatever the header says. And only
|
|
183
|
+
* `ReadScope.None` refuses — an own-rows or tenant-wide read that legitimately
|
|
184
|
+
* found nothing is a real answer, and replacing it with an error would swap one
|
|
185
|
+
* wrong report for another.
|
|
186
|
+
*/
|
|
187
|
+
export declare function refuseVacuousScopedPage(response: Response | null | undefined, resource: string, rows: number): ReadScopeError | undefined;
|
|
188
|
+
/** Options every read method accepts on top of its own. */
|
|
189
|
+
export interface ReadIdentityOptions {
|
|
190
|
+
/**
|
|
191
|
+
* Per-user identity for THIS call only, overriding the client-wide
|
|
192
|
+
* `userToken`.
|
|
193
|
+
*
|
|
194
|
+
* Use it when one process acts on behalf of several people. An empty string
|
|
195
|
+
* is not an identity: it makes this read explicitly unidentified rather than
|
|
196
|
+
* falling back to the client-wide one. That distinction has to exist, because
|
|
197
|
+
* "unidentified" is a state the platform treats as different from every other
|
|
198
|
+
* (see `ReadScope.None`).
|
|
199
|
+
*
|
|
200
|
+
* For a process acting for several people across MANY methods, prefer
|
|
201
|
+
* `client.asUser(token)`: this option is only accepted by the read methods,
|
|
202
|
+
* while a derived client reaches every method with no carve-out.
|
|
203
|
+
*/
|
|
204
|
+
userToken?: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Drop every credential from `headers` because the request is leaving the
|
|
208
|
+
* origin they were issued for.
|
|
209
|
+
*
|
|
210
|
+
* Case-insensitive on the way in: a caller may have spelled a header
|
|
211
|
+
* differently, and two spellings of one header is one credential that survives.
|
|
212
|
+
*/
|
|
213
|
+
export declare function stripCredentialsOffOrigin(headers: Record<string, string>): void;
|
|
214
|
+
/**
|
|
215
|
+
* Stamp the per-user identity on `headers`, if there is one, for a request to
|
|
216
|
+
* `target` from a client configured for `endpoint`.
|
|
217
|
+
*
|
|
218
|
+
* Called from the client's `_fetch` — the one site every request goes through —
|
|
219
|
+
* so the identity travels on every request without any method knowing about it.
|
|
220
|
+
* That is on purpose and mirrors the platform: the agent reads `X-User-Token`
|
|
221
|
+
* once, in the middleware in front of every proxied route, and the routes
|
|
222
|
+
* themselves never look at it.
|
|
223
|
+
*
|
|
224
|
+
* **The header is NOT inert on the routes that are not reads.** It is validated
|
|
225
|
+
* on every route the agent proxies: `proxyAuthMiddleware` resolves it before
|
|
226
|
+
* dispatch and answers `401 invalid user token` for a present-but-INVALID one —
|
|
227
|
+
* on `/api/v1/plans`, `/api/v1/policies`, `/api/v1/connectors`,
|
|
228
|
+
* `/api/v1/process`, `/api/v1/budgets`, `/api/v1/cost`, `/api/v1/executions`
|
|
229
|
+
* and the rest. So a stale or rotated token does not degrade to "unscoped
|
|
230
|
+
* reads"; it turns `listConnectors`, `installConnector` and policy CRUD into
|
|
231
|
+
* 401s. Fail-closed is the right direction, but it puts the value in the same
|
|
232
|
+
* rotation story as `clientSecret`.
|
|
233
|
+
*
|
|
234
|
+
* Genuinely inert only on the routes the agent SERVES ITSELF — only `proxy.go`
|
|
235
|
+
* and `mcp_identity.go` read the header at all: `/api/request`,
|
|
236
|
+
* `/api/v1/decide` (whose identity comes from the request BODY's `user_token`,
|
|
237
|
+
* which is the whole reason the read path needed a surface of its own),
|
|
238
|
+
* `/api/v1/access/evaluation`, `/api/v1/static-policies/*`,
|
|
239
|
+
* `/api/v1/circuit-breaker/*`, `/api/v1/hitl/*`, `/api/v1/mcp/check-input`,
|
|
240
|
+
* `/api/v1/mcp/check-output`, `/api/v1/register`, `/api/policy/pre-check`,
|
|
241
|
+
* `/api/audit/llm-call` and `/health`.
|
|
242
|
+
*
|
|
243
|
+
* **It is never sent anywhere but the configured endpoint.** `target` is
|
|
244
|
+
* compared against `endpoint` and the header is removed when they differ. That
|
|
245
|
+
* guard exists because of redirects: the fetch spec strips `Authorization` on a
|
|
246
|
+
* cross-origin redirect, but its list is fixed and `X-User-Token` is not on it.
|
|
247
|
+
* Measured on Node 25: the redirect target received `authorization: undefined`
|
|
248
|
+
* and `x-user-token: SENTINEL`. The client follows redirects manually while an
|
|
249
|
+
* identity is attached, re-entering this function on each hop, so the identity
|
|
250
|
+
* is dropped the moment the origin changes.
|
|
251
|
+
*
|
|
252
|
+
* The token is a CREDENTIAL. It is written to the header and nowhere else: it
|
|
253
|
+
* is never logged, never carried in an error message, and never reaches
|
|
254
|
+
* telemetry — the heartbeat uses raw `fetch`, deliberately not the wrapper this
|
|
255
|
+
* is called from.
|
|
256
|
+
*/
|
|
257
|
+
/**
|
|
258
|
+
* @param headers the request's header bag, MUTATED in place.
|
|
259
|
+
*
|
|
260
|
+
* A plain record rather than a `Headers` instance, deliberately: this SDK
|
|
261
|
+
* builds its requests with plain objects, and converting them here would change
|
|
262
|
+
* the shape every existing caller and test observes on `fetch`. Widening the
|
|
263
|
+
* blast radius of an identity fix to "every request's header representation"
|
|
264
|
+
* is how a small change acquires a long tail of unrelated failures.
|
|
265
|
+
*/
|
|
266
|
+
export declare function applyReadIdentity(headers: Record<string, string>, target: URL, endpoint: string | undefined, token: string | undefined): void;
|
|
267
|
+
//# sourceMappingURL=read-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-identity.d.ts","sourceRoot":"","sources":["../../src/read-identity.ts"],"names":[],"mappings":"AAAA;;;;;;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