agentfootprint 9.63.0 → 9.65.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/adapters/hosting/foundryResponses.js +110 -0
- package/dist/adapters/hosting/foundryResponses.js.map +1 -0
- package/dist/adapters/hosting/responsesWire.js +322 -0
- package/dist/adapters/hosting/responsesWire.js.map +1 -0
- package/dist/adapters/observability/otel.js +5 -2
- package/dist/adapters/observability/otel.js.map +1 -1
- package/dist/core/agent/coverage/absent.js +14 -11
- package/dist/core/agent/coverage/absent.js.map +1 -1
- package/dist/core/agent/coverage/evidence.js +77 -34
- package/dist/core/agent/coverage/evidence.js.map +1 -1
- package/dist/core/agent/evidence/evidenceIndex.js +15 -14
- package/dist/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/core/agent/toolArgsValidation.js +142 -18
- package/dist/core/agent/toolArgsValidation.js.map +1 -1
- package/dist/esm/adapters/hosting/foundryResponses.d.ts +89 -0
- package/dist/esm/adapters/hosting/foundryResponses.js +106 -0
- package/dist/esm/adapters/hosting/foundryResponses.js.map +1 -0
- package/dist/esm/adapters/hosting/responsesWire.d.ts +75 -0
- package/dist/esm/adapters/hosting/responsesWire.js +316 -0
- package/dist/esm/adapters/hosting/responsesWire.js.map +1 -0
- package/dist/esm/adapters/observability/otel.js +5 -2
- package/dist/esm/adapters/observability/otel.js.map +1 -1
- package/dist/esm/core/agent/coverage/absent.d.ts +14 -11
- package/dist/esm/core/agent/coverage/absent.js +14 -11
- package/dist/esm/core/agent/coverage/absent.js.map +1 -1
- package/dist/esm/core/agent/coverage/evidence.d.ts +52 -28
- package/dist/esm/core/agent/coverage/evidence.js +77 -34
- package/dist/esm/core/agent/coverage/evidence.js.map +1 -1
- package/dist/esm/core/agent/evidence/evidenceIndex.d.ts +8 -7
- package/dist/esm/core/agent/evidence/evidenceIndex.js +15 -14
- package/dist/esm/core/agent/evidence/evidenceIndex.js.map +1 -1
- package/dist/esm/core/agent/toolArgsValidation.d.ts +62 -17
- package/dist/esm/core/agent/toolArgsValidation.js +142 -18
- package/dist/esm/core/agent/toolArgsValidation.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +9 -4
- package/dist/esm/events/payloads.d.ts +9 -0
- package/dist/esm/hosting/errors.d.ts +43 -0
- package/dist/esm/hosting/errors.js +52 -0
- package/dist/esm/hosting/errors.js.map +1 -1
- package/dist/esm/hosting/httpHost.d.ts +133 -4
- package/dist/esm/hosting/httpHost.js +120 -22
- package/dist/esm/hosting/httpHost.js.map +1 -1
- package/dist/esm/hosting/index.d.ts +2 -2
- package/dist/esm/hosting/index.js +1 -1
- package/dist/esm/hosting/index.js.map +1 -1
- package/dist/esm/hosting-providers.d.ts +17 -0
- package/dist/esm/hosting-providers.js +19 -0
- package/dist/esm/hosting-providers.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/hosting/errors.js +55 -1
- package/dist/hosting/errors.js.map +1 -1
- package/dist/hosting/httpHost.js +119 -21
- package/dist/hosting/httpHost.js.map +1 -1
- package/dist/hosting/index.js +4 -2
- package/dist/hosting/index.js.map +1 -1
- package/dist/hosting-providers.js +30 -1
- package/dist/hosting-providers.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/adapters/hosting/foundryResponses.d.ts +90 -0
- package/dist/types/adapters/hosting/foundryResponses.d.ts.map +1 -0
- package/dist/types/adapters/hosting/responsesWire.d.ts +76 -0
- package/dist/types/adapters/hosting/responsesWire.d.ts.map +1 -0
- package/dist/types/adapters/observability/otel.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/absent.d.ts +14 -11
- package/dist/types/core/agent/coverage/absent.d.ts.map +1 -1
- package/dist/types/core/agent/coverage/evidence.d.ts +52 -28
- package/dist/types/core/agent/coverage/evidence.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts +8 -7
- package/dist/types/core/agent/evidence/evidenceIndex.d.ts.map +1 -1
- package/dist/types/core/agent/toolArgsValidation.d.ts +62 -17
- package/dist/types/core/agent/toolArgsValidation.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +9 -4
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +9 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/hosting/errors.d.ts +43 -0
- package/dist/types/hosting/errors.d.ts.map +1 -1
- package/dist/types/hosting/httpHost.d.ts +133 -4
- package/dist/types/hosting/httpHost.d.ts.map +1 -1
- package/dist/types/hosting/index.d.ts +2 -2
- package/dist/types/hosting/index.d.ts.map +1 -1
- package/dist/types/hosting-providers.d.ts +17 -0
- package/dist/types/hosting-providers.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* toolArgsValidation — validate LLM-produced tool args against the tool's
|
|
3
3
|
* declared `inputSchema` BEFORE dispatch (backlog #9).
|
|
4
4
|
*
|
|
5
|
-
* Pattern: pure function module — no
|
|
6
|
-
*
|
|
5
|
+
* Pattern: pure function module — no events, and no state beyond one compiled-
|
|
6
|
+
* regex cache (which doubles as the warn-once ledger for `pattern`s
|
|
7
|
+
* that do not compile); the toolCalls stage owns when to call it and
|
|
8
|
+
* what to do with the verdict.
|
|
7
9
|
* Role: The model writes tool args as free-form JSON; nothing guaranteed
|
|
8
10
|
* they match the schema the tool advertised. Dispatching garbage
|
|
9
11
|
* surfaced as deep tool stack traces (or worse, silent misbehavior).
|
|
@@ -14,25 +16,136 @@
|
|
|
14
16
|
* ── Honest-subset contract ────────────────────────────────────────────────
|
|
15
17
|
* This is NOT a full JSON Schema implementation. It enforces the core that
|
|
16
18
|
* tool schemas in the wild actually use, and IGNORES everything else
|
|
17
|
-
* (permissive on unknown keywords — a schema using `
|
|
18
|
-
*
|
|
19
|
+
* (permissive on unknown keywords — a schema using `oneOf`/`$ref` still
|
|
20
|
+
* validates the supported core, never false-rejects on the rest):
|
|
19
21
|
*
|
|
20
22
|
* ENFORCED: `type` (object/array/string/number/integer/boolean/null,
|
|
21
23
|
* union arrays), `required`, `properties` (recursive),
|
|
22
24
|
* `items` (single-schema, recursive), `enum` (primitives),
|
|
23
|
-
* `additionalProperties: false` ONLY when explicitly set
|
|
24
|
-
*
|
|
25
|
+
* `additionalProperties: false` ONLY when explicitly set,
|
|
26
|
+
* and the STRING SHAPE keywords `pattern` / `minLength` /
|
|
27
|
+
* `maxLength`.
|
|
28
|
+
* IGNORED: format, numeric min/max, oneOf/anyOf/allOf/not, $ref,
|
|
25
29
|
* const, dependencies, …
|
|
26
30
|
*
|
|
27
|
-
* ──
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* the
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* ── Why string SHAPE joined the subset ────────────────────────────────────
|
|
32
|
+
* A tool result ended with an offer ("I can also map these ids to volume
|
|
33
|
+
* names"); the person answered "yes please"; the model bound that sentence as
|
|
34
|
+
* the IDENTIFIER argument and dispatched. The tool's schema declared the
|
|
35
|
+
* identifier's shape and this boundary did not read it, so a call that could
|
|
36
|
+
* never succeed cost a round trip — and the consumer hand-rolled an
|
|
37
|
+
* affirmative blocklist to do what the declaration already said. A declared
|
|
38
|
+
* shape a boundary ignores is worse than no declaration: the author believes
|
|
39
|
+
* it is enforced.
|
|
40
|
+
*
|
|
41
|
+
* `pattern` is JSON Schema's own semantics — UNANCHORED, ECMA-262, applied to
|
|
42
|
+
* strings only. A regex the schema author got wrong must never take dispatch
|
|
43
|
+
* with it: it is compiled once, and a compile failure degrades to no-pattern
|
|
44
|
+
* plus one developer warning.
|
|
45
|
+
*
|
|
46
|
+
* ── Security: what an issue may echo ──────────────────────────────────────
|
|
47
|
+
* `type` / `enum` / `required` / `additionalProperties` issues name the PATH,
|
|
48
|
+
* the EXPECTED shape, and the TYPE of what arrived — never the supplied value.
|
|
49
|
+
* Enum expectations echo SCHEMA values only (already LLM-visible in the tools
|
|
50
|
+
* block).
|
|
51
|
+
*
|
|
52
|
+
* String-SHAPE issues are the one exception, and it is a narrow one: the
|
|
53
|
+
* complaint IS the value's shape, so `expected string, got string` teaches
|
|
54
|
+
* nothing and the correction cannot converge. They carry `value` — a capped
|
|
55
|
+
* excerpt ({@link MAX_VALUE_CHARS}) of the offending string — plus `hint`, the
|
|
56
|
+
* parameter's own `description`, which is where an author writes what the
|
|
57
|
+
* identifier looks like. Neither adds exposure: the value is the model's own
|
|
58
|
+
* tool-call argument, already verbatim in the history this message is appended
|
|
59
|
+
* to. The OTel adapter renders `path`/`expected`/`got` only, so third-party
|
|
60
|
+
* telemetry stays value-free either way.
|
|
33
61
|
*/
|
|
34
62
|
/** Cap so a pathological schema/args pair can't flood history or events. */
|
|
35
63
|
const MAX_ISSUES = 10;
|
|
64
|
+
/** Ceiling on the echoed excerpt of an offending string. Enough to recognize
|
|
65
|
+
* a sentence bound where an identifier belonged; short enough that a 5 MB
|
|
66
|
+
* argument cannot ride the message into history. */
|
|
67
|
+
const MAX_VALUE_CHARS = 80;
|
|
68
|
+
/**
|
|
69
|
+
* Ceiling on compiled `pattern`s held. Schemas are finite in a process, so
|
|
70
|
+
* this is a fence against dynamically-minted ones rather than a tuning knob:
|
|
71
|
+
* past it, patterns compile per call (and a broken one warns again) instead of
|
|
72
|
+
* the map growing without bound.
|
|
73
|
+
*/
|
|
74
|
+
const MAX_CACHED_PATTERNS = 256;
|
|
75
|
+
/**
|
|
76
|
+
* Compiled `pattern`s, and the warn-once ledger for the broken ones. A `null`
|
|
77
|
+
* entry means "this pattern does not compile" — recorded so a schema bug is
|
|
78
|
+
* reported once to the developer rather than once per dispatch.
|
|
79
|
+
*/
|
|
80
|
+
const patternCache = new Map();
|
|
81
|
+
function compilePattern(pattern) {
|
|
82
|
+
const cached = patternCache.get(pattern);
|
|
83
|
+
if (cached !== undefined)
|
|
84
|
+
return cached;
|
|
85
|
+
let compiled = null;
|
|
86
|
+
try {
|
|
87
|
+
// No flags: JSON Schema `pattern` is an unanchored ECMA-262 match, and a
|
|
88
|
+
// `g` flag would make the RegExp stateful across calls.
|
|
89
|
+
compiled = new RegExp(pattern);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
console.warn(`[agentfootprint] a tool inputSchema declares a \`pattern\` that is not a valid regular ` +
|
|
93
|
+
`expression (${pattern}) — it is IGNORED, so this argument's shape is NOT enforced. ` +
|
|
94
|
+
`Fix the expression or drop the keyword.`);
|
|
95
|
+
}
|
|
96
|
+
if (patternCache.size < MAX_CACHED_PATTERNS)
|
|
97
|
+
patternCache.set(pattern, compiled);
|
|
98
|
+
return compiled;
|
|
99
|
+
}
|
|
100
|
+
/** A length bound this validator will act on: a non-negative integer. Anything
|
|
101
|
+
* else is outside the honest subset and ignored rather than guessed at. */
|
|
102
|
+
function lengthBound(raw) {
|
|
103
|
+
return typeof raw === 'number' && Number.isInteger(raw) && raw >= 0 ? raw : undefined;
|
|
104
|
+
}
|
|
105
|
+
function excerptOf(value) {
|
|
106
|
+
return value.length <= MAX_VALUE_CHARS ? value : `${value.slice(0, MAX_VALUE_CHARS)}…`;
|
|
107
|
+
}
|
|
108
|
+
function descriptionOf(schema) {
|
|
109
|
+
const raw = schema.description;
|
|
110
|
+
if (typeof raw !== 'string')
|
|
111
|
+
return undefined;
|
|
112
|
+
const trimmed = raw.trim();
|
|
113
|
+
return trimmed === '' ? undefined : trimmed;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The string SHAPE keywords. At most ONE issue per argument: `pattern`
|
|
117
|
+
* describes the value completely, so adding "and it is too short" is a second
|
|
118
|
+
* sentence about one mistake.
|
|
119
|
+
*/
|
|
120
|
+
function checkStringShape(value, schema, path, issues) {
|
|
121
|
+
const hint = descriptionOf(schema);
|
|
122
|
+
const teach = (expected, got) => {
|
|
123
|
+
issues.push({
|
|
124
|
+
path,
|
|
125
|
+
expected,
|
|
126
|
+
got,
|
|
127
|
+
value: excerptOf(value),
|
|
128
|
+
...(hint !== undefined && { hint }),
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
const pattern = schema.pattern;
|
|
132
|
+
if (typeof pattern === 'string') {
|
|
133
|
+
const regex = compilePattern(pattern);
|
|
134
|
+
if (regex !== null && !regex.test(value)) {
|
|
135
|
+
teach(`a string matching ${pattern}`, 'string');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const min = lengthBound(schema.minLength);
|
|
140
|
+
if (min !== undefined && value.length < min) {
|
|
141
|
+
teach(`a string of at least ${min} characters`, `string of length ${value.length}`);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const max = lengthBound(schema.maxLength);
|
|
145
|
+
if (max !== undefined && value.length > max) {
|
|
146
|
+
teach(`a string of at most ${max} characters`, `string of length ${value.length}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
36
149
|
function typeNameOf(value) {
|
|
37
150
|
if (value === null)
|
|
38
151
|
return 'null';
|
|
@@ -94,6 +207,12 @@ function validateNode(value, schema, path, issues) {
|
|
|
94
207
|
return;
|
|
95
208
|
}
|
|
96
209
|
}
|
|
210
|
+
// String SHAPE — same place, same dial, same result shape as `type`/`enum`
|
|
211
|
+
// above. Applies to strings only, which is JSON Schema's own rule.
|
|
212
|
+
if (typeof value === 'string') {
|
|
213
|
+
checkStringShape(value, schema, path, issues);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
97
216
|
// Object keywords.
|
|
98
217
|
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
99
218
|
const record = value;
|
|
@@ -169,17 +288,22 @@ export function validateToolArgs(args, inputSchema) {
|
|
|
169
288
|
return { ok: issues.length === 0, issues };
|
|
170
289
|
}
|
|
171
290
|
/**
|
|
172
|
-
* Render the MODEL-VISIBLE tool result for a rejected call. Names paths
|
|
173
|
-
* expectations
|
|
174
|
-
*
|
|
175
|
-
* is
|
|
291
|
+
* Render the MODEL-VISIBLE tool result for a rejected call. Names paths and
|
|
292
|
+
* expectations; reports received TYPES for structural issues and the capped
|
|
293
|
+
* offending VALUE for string-shape ones, because a shape complaint that will
|
|
294
|
+
* not say which string it is about cannot be acted on. `JSON.stringify` quotes
|
|
295
|
+
* and escapes the excerpt, so a multi-line argument stays one line.
|
|
296
|
+
*
|
|
297
|
+
* The parameter's own `description` follows on its own line when the schema
|
|
298
|
+
* declares one: that sentence is usually the whole correction.
|
|
176
299
|
*/
|
|
177
300
|
export function formatToolArgIssues(toolName, issues) {
|
|
178
301
|
const lines = issues.map((issue) => {
|
|
179
302
|
const where = issue.path === '' ? 'arguments' : `'${issue.path}'`;
|
|
180
|
-
|
|
303
|
+
const head = issue.expected === 'required'
|
|
181
304
|
? `- ${where} is required but missing`
|
|
182
|
-
: `- ${where}: expected ${issue.expected}, got ${issue.got}`;
|
|
305
|
+
: `- ${where}: expected ${issue.expected}, got ${issue.value === undefined ? issue.got : JSON.stringify(issue.value)}`;
|
|
306
|
+
return issue.hint === undefined ? head : `${head}\n ${where} is described as: ${issue.hint}`;
|
|
183
307
|
});
|
|
184
308
|
return (`Invalid arguments for tool '${toolName}' — the call was not executed.\n` +
|
|
185
309
|
`${lines.join('\n')}\n` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolArgsValidation.js","sourceRoot":"","sources":["../../../../src/core/agent/toolArgsValidation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"toolArgsValidation.js","sourceRoot":"","sources":["../../../../src/core/agent/toolArgsValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAgCH,4EAA4E;AAC5E,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;qDAEqD;AACrD,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAIhC;;;;GAIG;AACH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,KAAK,UAAU;YAC3B,CAAC,CAAC,KAAK,KAAK,0BAA0B;YACtC,CAAC,CAAC,KAAK,KAAK,cAAc,KAAK,CAAC,QAAQ,SACpC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CACpE,EAAE,CAAC;QACT,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,KAAK,qBAAqB,KAAK,CAAC,IAAI,EAAE,CAAC;IAChG,CAAC,CAAC,CAAC;IACH,OAAO,CACL,+BAA+B,QAAQ,kCAAkC;QACzE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;QACvB,uEAAuE,CACxE,CAAC;AACJ,CAAC"}
|
|
@@ -204,12 +204,17 @@ export interface AgentOptions {
|
|
|
204
204
|
* are validated against the tool's declared `inputSchema` BEFORE dispatch.
|
|
205
205
|
* On mismatch the tool is NOT executed — the model receives a structured
|
|
206
206
|
* retry message as the tool result (paths + expected shapes + received
|
|
207
|
-
* TYPES
|
|
208
|
-
*
|
|
207
|
+
* TYPES) and corrects itself on the next iteration. Emits
|
|
208
|
+
* `agentfootprint.validation.args_invalid`.
|
|
209
209
|
* `'warn'` emits the event but executes anyway; `'off'` disables.
|
|
210
210
|
* Validation is an honest JSON-Schema subset (type/required/properties/
|
|
211
|
-
* items/enum/explicit additionalProperties:false
|
|
212
|
-
*
|
|
211
|
+
* items/enum/explicit additionalProperties:false, plus the string SHAPE
|
|
212
|
+
* keywords pattern/minLength/maxLength) — unsupported keywords are
|
|
213
|
+
* ignored, never false-rejecting.
|
|
214
|
+
*
|
|
215
|
+
* A string-shape refusal quotes a CAPPED excerpt of the offending value
|
|
216
|
+
* and the parameter's own `description`, because "expected string, got
|
|
217
|
+
* string" cannot be acted on; every other issue still names types only.
|
|
213
218
|
*/
|
|
214
219
|
readonly toolArgValidation?: ToolArgValidationMode;
|
|
215
220
|
/**
|
|
@@ -951,6 +951,15 @@ export interface ValidationArgsInvalidPayload {
|
|
|
951
951
|
readonly path: string;
|
|
952
952
|
readonly expected: string;
|
|
953
953
|
readonly got: string;
|
|
954
|
+
/**
|
|
955
|
+
* A capped excerpt of the offending STRING — present on string-shape
|
|
956
|
+
* issues (`pattern` / `minLength` / `maxLength`) only, where the
|
|
957
|
+
* complaint IS the value's shape. Structural issues (type, enum,
|
|
958
|
+
* required, additionalProperties) still carry no value at all.
|
|
959
|
+
*/
|
|
960
|
+
readonly value?: string;
|
|
961
|
+
/** The parameter's own schema `description`, when it declares one. */
|
|
962
|
+
readonly hint?: string;
|
|
954
963
|
}>;
|
|
955
964
|
readonly enforced: boolean;
|
|
956
965
|
}
|
|
@@ -480,4 +480,47 @@ export declare class SessionsNotCarriedError extends Error {
|
|
|
480
480
|
* // or branch instead of insisting:
|
|
481
481
|
* if (host.capabilities.includes('streaming')) { ... }
|
|
482
482
|
*/
|
|
483
|
+
/**
|
|
484
|
+
* Thrown when a request body exceeds the ceiling the host was given.
|
|
485
|
+
*
|
|
486
|
+
* A body is memory this process pays for while somebody else fills it, so a
|
|
487
|
+
* host with a ceiling stops reading at it rather than discovering the limit as
|
|
488
|
+
* an out-of-memory kill. The read is abandoned at the byte that crossed the
|
|
489
|
+
* line — nothing further is buffered, and the bytes already read are dropped.
|
|
490
|
+
*
|
|
491
|
+
* There is no default ceiling: see `HttpHostOptions.maxBodyBytes` for why the
|
|
492
|
+
* absence is deliberate and what it costs.
|
|
493
|
+
*/
|
|
494
|
+
export declare class RequestTooLargeError extends Error {
|
|
495
|
+
readonly limitBytes: number;
|
|
496
|
+
readonly code: "ERR_REQUEST_TOO_LARGE";
|
|
497
|
+
constructor(limitBytes: number, hostName: string);
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* A dialect's refusal of THIS request — its own status, its own code.
|
|
501
|
+
*
|
|
502
|
+
* `readRequest` is a wire's one chance to look at a body before a turn is paid
|
|
503
|
+
* for, and some dialects can tell from the shape alone that they cannot serve
|
|
504
|
+
* it: an input item kind this dialect does not carry, a field whose type is
|
|
505
|
+
* wrong. Throwing this says so with a status the caller can act on, instead of
|
|
506
|
+
* a 500 that reads as "the server broke" for a request the caller could fix.
|
|
507
|
+
*
|
|
508
|
+
* The distinction it keeps: this is the REQUEST being wrong. A dialect that
|
|
509
|
+
* throws anything else from `readRequest` still gets that request's 500, which
|
|
510
|
+
* is the honest answer when the dialect itself is what failed.
|
|
511
|
+
*
|
|
512
|
+
* @example A dialect refusing an input kind it does not carry
|
|
513
|
+
* throw new WireRequestRefusal(
|
|
514
|
+
* 'unsupported_input',
|
|
515
|
+
* 'image input is not carried by this dialect',
|
|
516
|
+
* );
|
|
517
|
+
*/
|
|
518
|
+
export declare class WireRequestRefusal extends Error {
|
|
519
|
+
readonly code: string;
|
|
520
|
+
/** HTTP status for this refusal. Default 400 — the request is what is wrong. */
|
|
521
|
+
readonly status: number;
|
|
522
|
+
constructor(code: string, detail: string,
|
|
523
|
+
/** HTTP status for this refusal. Default 400 — the request is what is wrong. */
|
|
524
|
+
status?: number);
|
|
525
|
+
}
|
|
483
526
|
export declare function requireCapability(host: AgentHost | ConversationHost, capability: HostCapability): void;
|
|
@@ -718,6 +718,58 @@ export class SessionsNotCarriedError extends Error {
|
|
|
718
718
|
* // or branch instead of insisting:
|
|
719
719
|
* if (host.capabilities.includes('streaming')) { ... }
|
|
720
720
|
*/
|
|
721
|
+
/**
|
|
722
|
+
* Thrown when a request body exceeds the ceiling the host was given.
|
|
723
|
+
*
|
|
724
|
+
* A body is memory this process pays for while somebody else fills it, so a
|
|
725
|
+
* host with a ceiling stops reading at it rather than discovering the limit as
|
|
726
|
+
* an out-of-memory kill. The read is abandoned at the byte that crossed the
|
|
727
|
+
* line — nothing further is buffered, and the bytes already read are dropped.
|
|
728
|
+
*
|
|
729
|
+
* There is no default ceiling: see `HttpHostOptions.maxBodyBytes` for why the
|
|
730
|
+
* absence is deliberate and what it costs.
|
|
731
|
+
*/
|
|
732
|
+
export class RequestTooLargeError extends Error {
|
|
733
|
+
limitBytes;
|
|
734
|
+
code = 'ERR_REQUEST_TOO_LARGE';
|
|
735
|
+
constructor(limitBytes, hostName) {
|
|
736
|
+
super(`[hosting] the '${hostName}' host refuses a request body over ${String(limitBytes)} ` +
|
|
737
|
+
`bytes. Raise maxBodyBytes if this deployment genuinely carries larger requests.`);
|
|
738
|
+
this.limitBytes = limitBytes;
|
|
739
|
+
this.name = 'RequestTooLargeError';
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* A dialect's refusal of THIS request — its own status, its own code.
|
|
744
|
+
*
|
|
745
|
+
* `readRequest` is a wire's one chance to look at a body before a turn is paid
|
|
746
|
+
* for, and some dialects can tell from the shape alone that they cannot serve
|
|
747
|
+
* it: an input item kind this dialect does not carry, a field whose type is
|
|
748
|
+
* wrong. Throwing this says so with a status the caller can act on, instead of
|
|
749
|
+
* a 500 that reads as "the server broke" for a request the caller could fix.
|
|
750
|
+
*
|
|
751
|
+
* The distinction it keeps: this is the REQUEST being wrong. A dialect that
|
|
752
|
+
* throws anything else from `readRequest` still gets that request's 500, which
|
|
753
|
+
* is the honest answer when the dialect itself is what failed.
|
|
754
|
+
*
|
|
755
|
+
* @example A dialect refusing an input kind it does not carry
|
|
756
|
+
* throw new WireRequestRefusal(
|
|
757
|
+
* 'unsupported_input',
|
|
758
|
+
* 'image input is not carried by this dialect',
|
|
759
|
+
* );
|
|
760
|
+
*/
|
|
761
|
+
export class WireRequestRefusal extends Error {
|
|
762
|
+
code;
|
|
763
|
+
status;
|
|
764
|
+
constructor(code, detail,
|
|
765
|
+
/** HTTP status for this refusal. Default 400 — the request is what is wrong. */
|
|
766
|
+
status = 400) {
|
|
767
|
+
super(`[hosting] ${detail}`);
|
|
768
|
+
this.code = code;
|
|
769
|
+
this.status = status;
|
|
770
|
+
this.name = 'WireRequestRefusal';
|
|
771
|
+
}
|
|
772
|
+
}
|
|
721
773
|
export function requireCapability(host, capability) {
|
|
722
774
|
if (host.capabilities.includes(capability))
|
|
723
775
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/hosting/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,GAAG,iBAA0B,CAAC;IAC3C,6BAA6B;IACpB,QAAQ,CAAS;IAE1B,YAAY,QAAgB;QAC1B,KAAK,CACH,kBAAkB,QAAQ,sDAAsD;YAC9E,wFAAwF;YACxF,iDAAiD,CACpD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,GAAG,oBAA6B,CAAC;IAC9C,gDAAgD;IACvC,SAAS,CAAS;IAC3B,mEAAmE;IAC1D,WAAW,CAAU;IAE9B,YAAY,SAAiB,EAAE,WAAoB;QACjD,KAAK,CACH,sBAAsB,SAAS,+BAA+B;YAC5D,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,WAAW,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,yEAAyE;YACzE,mEAAmE;YACnE,4DAA4D;YAC5D,qEAAqE,CACxE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,WAAW,KAAK,SAAS;YAAE,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IAChE,CAAC;CACF;AAED;;;;;;;;;;;;;;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MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,CAAC,IAAI,4BAA4B,UAAU,KAAK;QACpE,eAAe,GAAG,wBAAwB;QAC1C,+BAA+B,UAAU,uCAAuC;QAChF,oFAAoF,CACvF,CAAC;AACJ,CAAC"}
|
|
@@ -90,6 +90,72 @@ export interface HttpRequestFacts {
|
|
|
90
90
|
* going out as one body or as a stream of frames — those are {@link httpHost}'s
|
|
91
91
|
* job, identical for every wire, which is the entire point of separating them.
|
|
92
92
|
*/
|
|
93
|
+
/**
|
|
94
|
+
* One Server-Sent Event: the name it is announced under, and the body that
|
|
95
|
+
* rides with it.
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* Where a failure came from.
|
|
99
|
+
*
|
|
100
|
+
* `'refused'` is the handler CHOOSING to fail with words it picked for the
|
|
101
|
+
* caller. `'threw'` is an exception this host caught — the message is the
|
|
102
|
+
* author's note to their own logs, and may name a query, a path or a token.
|
|
103
|
+
*
|
|
104
|
+
* The distinction exists because a dialect that sanitises has to sanitise the
|
|
105
|
+
* right one: replacing both silences deliberate refusals, and replacing
|
|
106
|
+
* neither publishes stack-trace prose to whoever is on the other end.
|
|
107
|
+
*/
|
|
108
|
+
export type FailureOrigin = 'refused' | 'threw';
|
|
109
|
+
export interface StreamFrame {
|
|
110
|
+
readonly event: string;
|
|
111
|
+
readonly data: unknown;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The frames ONE streaming response is made of.
|
|
115
|
+
*
|
|
116
|
+
* ── Why this exists ──────────────────────────────────────────────────────────
|
|
117
|
+
* A wire's body methods answer "what do the fields say". This answers a
|
|
118
|
+
* different question: "what SHAPE is a stream". This host's own dialect frames
|
|
119
|
+
* one homogeneous `chunk` per piece and one terminal frame, and that is a real
|
|
120
|
+
* shape — but it is not the only one. Several protocols in wide use frame a
|
|
121
|
+
* stream as a LIFECYCLE instead: named events that open a response, announce
|
|
122
|
+
* that output is beginning, carry deltas, close each part, and close the
|
|
123
|
+
* response — every event referring to one response object by id, often
|
|
124
|
+
* numbered.
|
|
125
|
+
*
|
|
126
|
+
* Those cannot be expressed as "a body shape per chunk", because one host
|
|
127
|
+
* lifecycle point becomes SEVERAL frames, and because the frames share state
|
|
128
|
+
* (an id minted once, a counter that only goes up). So a dialect that frames
|
|
129
|
+
* this way supplies one of these PER RESPONSE and keeps that state in it.
|
|
130
|
+
*
|
|
131
|
+
* ── The default is one of these ──────────────────────────────────────────────
|
|
132
|
+
* A wire that supplies none gets framing built from its own body methods —
|
|
133
|
+
* `chunk`/`complete`/`error`, exactly as before. The incumbent shape is an
|
|
134
|
+
* INSTANCE of this seam rather than a special case beside it, which is the
|
|
135
|
+
* reason to believe the seam is in the right place.
|
|
136
|
+
*/
|
|
137
|
+
export interface StreamFraming {
|
|
138
|
+
/**
|
|
139
|
+
* Frames to write the moment the stream opens, before the handler runs.
|
|
140
|
+
* Absent or empty means the stream announces itself with nothing, which is
|
|
141
|
+
* this host's own behaviour.
|
|
142
|
+
*/
|
|
143
|
+
open?(): readonly StreamFrame[];
|
|
144
|
+
/** Frames for one piece of streamed output. */
|
|
145
|
+
chunk(text: string): readonly StreamFrame[];
|
|
146
|
+
/** Frames that close a response that completed. */
|
|
147
|
+
complete(output: string): readonly StreamFrame[];
|
|
148
|
+
/** Frames that close a response that failed. */
|
|
149
|
+
failure(message: string, code?: string, origin?: FailureOrigin): readonly StreamFrame[];
|
|
150
|
+
/**
|
|
151
|
+
* Frames that close a response ending in one of the other terminals. Absent
|
|
152
|
+
* means the single-frame default, so a framing written for text alone keeps
|
|
153
|
+
* working when an artifact or a paused run comes back through it.
|
|
154
|
+
*/
|
|
155
|
+
awaiting?(pending: PendingAsk): readonly StreamFrame[];
|
|
156
|
+
artifact?(result: ArtifactWireResult): readonly StreamFrame[];
|
|
157
|
+
sessions?(result: SessionWireResult): readonly StreamFrame[];
|
|
158
|
+
}
|
|
93
159
|
export interface HttpWire {
|
|
94
160
|
/**
|
|
95
161
|
* Pull the port's vocabulary out of one request. Anything the wire cannot
|
|
@@ -151,12 +217,47 @@ export interface HttpWire {
|
|
|
151
217
|
*/
|
|
152
218
|
readonly responseHeaders?: Readonly<Record<string, string>>;
|
|
153
219
|
};
|
|
220
|
+
/**
|
|
221
|
+
* Did THIS caller ask for a stream?
|
|
222
|
+
*
|
|
223
|
+
* Absent, the answer is the HTTP one: an `Accept` of `text/event-stream`.
|
|
224
|
+
* That is the right default and the wrong rule for dialects that carry the
|
|
225
|
+
* choice in the body instead — where a client sets a field and never touches
|
|
226
|
+
* `Accept`, and a host reading only the header answers one JSON body to a
|
|
227
|
+
* caller waiting for events.
|
|
228
|
+
*
|
|
229
|
+
* Present, this is the whole answer: a dialect that says how its callers ask
|
|
230
|
+
* is not second-guessed by the header. Read before any reply is framed, so it
|
|
231
|
+
* decides `content-type` for the request.
|
|
232
|
+
*/
|
|
233
|
+
wantsStream?(facts: HttpRequestFacts): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Framing for ONE streaming response — see {@link StreamFraming}.
|
|
236
|
+
*
|
|
237
|
+
* Called once per streaming request, so whatever the framing has to remember
|
|
238
|
+
* across its frames (an id minted for this response, a sequence counter) is
|
|
239
|
+
* per-response state and never shared between callers. Absent, this host
|
|
240
|
+
* frames the stream with the wire's own body shapes.
|
|
241
|
+
*/
|
|
242
|
+
stream?(facts: HttpRequestFacts): StreamFraming;
|
|
154
243
|
/** Body for a health probe. `uptimeMs` is how long this host has been serving. */
|
|
155
244
|
health(uptimeMs: number): unknown;
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Body for a reply that completed.
|
|
247
|
+
*
|
|
248
|
+
* `facts` is the request that produced it, for dialects whose reply repeats
|
|
249
|
+
* something the request said — a model name, a conversation id. Absent only
|
|
250
|
+
* where there is no request to show: this host has none to give when a body
|
|
251
|
+
* is built outside a request's own lifecycle.
|
|
252
|
+
*/
|
|
253
|
+
output(output: string, facts?: HttpRequestFacts): unknown;
|
|
254
|
+
/**
|
|
255
|
+
* Body for a reply that failed. `code` is the refusal's stable code, when it
|
|
256
|
+
* has one — and its PRESENCE is the signal that the message was authored by
|
|
257
|
+
* this library rather than thrown by somebody's handler, which is what lets a
|
|
258
|
+
* dialect decide what is safe to repeat to a caller.
|
|
259
|
+
*/
|
|
260
|
+
failure(message: string, code?: string, facts?: HttpRequestFacts, origin?: FailureOrigin): unknown;
|
|
160
261
|
/** Body for one streamed piece, when the caller asked for Server-Sent Events. */
|
|
161
262
|
chunk(text: string): unknown;
|
|
162
263
|
/**
|
|
@@ -355,6 +456,34 @@ export interface HttpHostOptions {
|
|
|
355
456
|
* });
|
|
356
457
|
*/
|
|
357
458
|
readonly onUnhandled?: (req: IncomingMessage, res: ServerResponse) => void;
|
|
459
|
+
/**
|
|
460
|
+
* Ceiling on a request body, in bytes. Default: **none**.
|
|
461
|
+
*
|
|
462
|
+
* ── Why the default is no ceiling ────────────────────────────────────────
|
|
463
|
+
* Not because unbounded is right — it is not. A body is memory this process
|
|
464
|
+
* pays for while somebody else fills it, and a host without a ceiling can be
|
|
465
|
+
* stopped by one caller with a large POST. The default is absent because
|
|
466
|
+
* every adapter built on this file inherited unbounded reads before this
|
|
467
|
+
* option existed, and a number chosen here would silently start refusing
|
|
468
|
+
* requests that deployments are serving today.
|
|
469
|
+
*
|
|
470
|
+
* **Set it.** A deployment that knows the largest body it legitimately
|
|
471
|
+
* carries should say so; a request over the line is refused with
|
|
472
|
+
* `ERR_REQUEST_TOO_LARGE` (413) and the read is abandoned at the byte that
|
|
473
|
+
* crossed it, rather than buffered to the end and then judged.
|
|
474
|
+
*/
|
|
475
|
+
readonly maxBodyBytes?: number;
|
|
476
|
+
/**
|
|
477
|
+
* Answer `HEAD` on the invoke path with 204, instead of the 404 an unowned
|
|
478
|
+
* method gets. Default `false`.
|
|
479
|
+
*
|
|
480
|
+
* Some deployment contracts probe a door before using it — "is the agent
|
|
481
|
+
* here?" — and a probe is not a turn: nothing is read, nothing is run, and
|
|
482
|
+
* the body is empty by definition. Opt-in, because a host that answered it
|
|
483
|
+
* unasked would change what every existing adapter says to a method it has
|
|
484
|
+
* always declined.
|
|
485
|
+
*/
|
|
486
|
+
readonly invokeHeadProbe?: boolean;
|
|
358
487
|
}
|
|
359
488
|
/** A {@link HostHandle} that also says where it landed. */
|
|
360
489
|
export interface HttpHostHandle extends HostHandle {
|