agentfootprint 9.64.0 → 9.66.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/identity/agentcore.js +118 -2
- package/dist/adapters/identity/agentcore.js.map +1 -1
- package/dist/adapters/observability/agentcore.js +61 -1
- package/dist/adapters/observability/agentcore.js.map +1 -1
- package/dist/adapters/observability/otel.js +12 -3
- package/dist/adapters/observability/otel.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/identity/agentcore.d.ts +115 -1
- package/dist/esm/adapters/identity/agentcore.js +117 -2
- package/dist/esm/adapters/identity/agentcore.js.map +1 -1
- package/dist/esm/adapters/observability/agentcore.d.ts +50 -0
- package/dist/esm/adapters/observability/agentcore.js +59 -0
- package/dist/esm/adapters/observability/agentcore.js.map +1 -1
- package/dist/esm/adapters/observability/otel.d.ts +73 -3
- package/dist/esm/adapters/observability/otel.js +12 -3
- package/dist/esm/adapters/observability/otel.js.map +1 -1
- 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/identity.d.ts +1 -1
- package/dist/esm/identity.js +5 -1
- package/dist/esm/identity.js.map +1 -1
- package/dist/esm/observability-providers.d.ts +1 -1
- package/dist/esm/observability-providers.js +5 -1
- package/dist/esm/observability-providers.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/identity.js +5 -1
- package/dist/identity.js.map +1 -1
- package/dist/observability-providers.js +6 -1
- package/dist/observability-providers.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/identity/agentcore.d.ts +115 -1
- package/dist/types/adapters/identity/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/observability/agentcore.d.ts +50 -0
- package/dist/types/adapters/observability/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/observability/otel.d.ts +73 -3
- package/dist/types/adapters/observability/otel.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/identity.d.ts +1 -1
- package/dist/types/identity.d.ts.map +1 -1
- package/dist/types/observability-providers.d.ts +1 -1
- package/dist/types/observability-providers.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -124,10 +124,57 @@ export interface OtelObservabilityOptions {
|
|
|
124
124
|
/** Service name on every emitted span. Surfaces in your OTel
|
|
125
125
|
* backend's service map. Required. */
|
|
126
126
|
readonly serviceName: string;
|
|
127
|
-
/** OTel Tracer to use. Defaults to
|
|
128
|
-
* `trace
|
|
129
|
-
*
|
|
127
|
+
/** OTel Tracer to use. Defaults to `trace.getTracer(scopeName)` — where
|
|
128
|
+
* `trace` is the lazy-imported `@opentelemetry/api` and `scopeName` is the
|
|
129
|
+
* option below. */
|
|
130
130
|
readonly tracer?: OtelTracerLike;
|
|
131
|
+
/**
|
|
132
|
+
* The INSTRUMENTATION SCOPE name every span is recorded under — what a
|
|
133
|
+
* backend shows as `scope.name`. Default `'agentfootprint'`.
|
|
134
|
+
*
|
|
135
|
+
* ── Why this is a knob and not a constant ────────────────────────────────
|
|
136
|
+
* Some telemetry consumers ROUTE on this name rather than read it. AWS
|
|
137
|
+
* Bedrock AgentCore Evaluations is the case that forced the option: it will
|
|
138
|
+
* score any agent's traces, from anywhere, but only classifies spans whose
|
|
139
|
+
* scope name begins `opentelemetry.instrumentation.` or
|
|
140
|
+
* `openinference.instrumentation.` — everything else is skipped in silence,
|
|
141
|
+
* which is indistinguishable from "your agent was fine".
|
|
142
|
+
*
|
|
143
|
+
* The default does NOT change, because a rename moves every existing
|
|
144
|
+
* dashboard's spans out from under it. Consumers who need a routable name
|
|
145
|
+
* pass one; `agentCoreEvaluationSpans()` in the AgentCore adapter is that
|
|
146
|
+
* one consumer's spelling, kept in that vendor's own file.
|
|
147
|
+
*
|
|
148
|
+
* Ignored when `tracer` is supplied — a tracer you built already has a name.
|
|
149
|
+
*/
|
|
150
|
+
readonly scopeName?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Put the turn's PROMPT and ANSWER TEXT on the agent span (default
|
|
153
|
+
* `false`): `gen_ai.task.input` from the user's prompt and
|
|
154
|
+
* `gen_ai.task.output` from the final answer.
|
|
155
|
+
*
|
|
156
|
+
* ── Off by default, deliberately ─────────────────────────────────────────
|
|
157
|
+
* This adapter's standing rule is that content does not ride spans — the
|
|
158
|
+
* snapshot / audit-log channel carries it under the consumer's own
|
|
159
|
+
* redaction policy. Turning this on EXPORTS raw prompt and answer text to
|
|
160
|
+
* whatever backend the tracer points at, where it is typically retained and
|
|
161
|
+
* searchable, and no redaction of ours stands between the two.
|
|
162
|
+
*
|
|
163
|
+
* ── Why it exists ────────────────────────────────────────────────────────
|
|
164
|
+
* Trace-scoring services read the answer they are grading off the span.
|
|
165
|
+
* AgentCore Evaluations reads exactly these two attributes (after an event
|
|
166
|
+
* body it only emits in its own runtime), so a scorer sees an empty turn
|
|
167
|
+
* without them. Enable it when a consumer's whole purpose is to read the
|
|
168
|
+
* content, and not to make dashboards prettier.
|
|
169
|
+
*
|
|
170
|
+
* ── What it is NOT ───────────────────────────────────────────────────────
|
|
171
|
+
* Per-inference message arrays (`gen_ai.input.messages` /
|
|
172
|
+
* `gen_ai.output.messages`) are NOT emitted: this adapter's `llm_start` /
|
|
173
|
+
* `llm_end` events carry model, usage and stop reason, never the messages,
|
|
174
|
+
* so there is nothing truthful to put there. Turn-level input and output is
|
|
175
|
+
* what we have and all this claims.
|
|
176
|
+
*/
|
|
177
|
+
readonly captureContent?: boolean;
|
|
131
178
|
/** 0..1 — sample rate for turn-level spans. Default `1.0`.
|
|
132
179
|
* Sampling decisions are normally an OTel SDK concern (via
|
|
133
180
|
* `Sampler`); this option is a per-strategy override for cases
|
|
@@ -168,6 +215,13 @@ export interface OtelObservabilityOptions {
|
|
|
168
215
|
* construction, but visible at the call site.
|
|
169
216
|
*/
|
|
170
217
|
readonly onError?: (error: Error, event?: AgentfootprintEvent) => void;
|
|
218
|
+
/**
|
|
219
|
+
* @internal Pre-resolved `@opentelemetry/api` module, for tests that need
|
|
220
|
+
* the path where this adapter builds its OWN tracer — the only path on
|
|
221
|
+
* which {@link OtelObservabilityOptions.scopeName} is observable. Skips the
|
|
222
|
+
* lazy require, exactly as `_client` does on the SDK-backed adapters.
|
|
223
|
+
*/
|
|
224
|
+
readonly _otelApi?: OtelApiModule;
|
|
171
225
|
}
|
|
172
226
|
/** Attribute value union we emit. Matches OTel's `AttributeValue`
|
|
173
227
|
* subset: primitives + homogeneous string arrays
|
|
@@ -201,6 +255,21 @@ export interface OtelSpanLike {
|
|
|
201
255
|
* signals degrade to flattened attributes when absent. */
|
|
202
256
|
addEvent?(name: string, attributes?: Record<string, OtelAttributeValue>): unknown;
|
|
203
257
|
}
|
|
258
|
+
interface OtelApiModule {
|
|
259
|
+
readonly trace?: {
|
|
260
|
+
getTracer(name: string, version?: string): OtelTracerLike;
|
|
261
|
+
setSpan(context: unknown, span: OtelSpanLike): unknown;
|
|
262
|
+
};
|
|
263
|
+
readonly context?: {
|
|
264
|
+
active(): unknown;
|
|
265
|
+
with<T>(ctx: unknown, fn: () => T): T;
|
|
266
|
+
};
|
|
267
|
+
readonly SpanStatusCode?: {
|
|
268
|
+
OK: number;
|
|
269
|
+
ERROR: number;
|
|
270
|
+
UNSET: number;
|
|
271
|
+
};
|
|
272
|
+
}
|
|
204
273
|
/**
|
|
205
274
|
* footprintjs CombinedRecorder (FlowRecorder channel) that forwards
|
|
206
275
|
* decide()/select() operator-level evidence into the paired
|
|
@@ -249,4 +318,5 @@ export interface OtelObservabilityStrategy extends ObservabilityStrategy {
|
|
|
249
318
|
decisionEvidenceRecorder(): OtelDecisionEvidenceRecorder;
|
|
250
319
|
}
|
|
251
320
|
export declare function otelObservability(opts: OtelObservabilityOptions): OtelObservabilityStrategy;
|
|
321
|
+
export {};
|
|
252
322
|
//# sourceMappingURL=otel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel.d.ts","sourceRoot":"","sources":["../../../../src/adapters/observability/otel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;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;+DAE2D;IAC3D,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC;CACnF;AAED,UAAU,aAAa;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;QAC1D,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC;KACxD,CAAC;IACF,QAAQ,CAAC,OAAO,CAAC,EAAE;QACjB,MAAM,IAAI,OAAO,CAAC;QAClB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;KACvC,CAAC;IACF,QAAQ,CAAC,cAAc,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACxE;AAID;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC3C,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC5C;AAED;wEACwE;AACxE,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,wBAAwB,IAAI,4BAA4B,CAAC;CAC1D;AA2GD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,wBAAwB,GAAG,yBAAyB,CA4tB3F"}
|
|
@@ -480,5 +480,48 @@ 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;
|
|
484
527
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/hosting/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1F;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,oBAA8B;IAC3C,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM;CAS7B;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,uBAAiC;IAC9C,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;gBAElB,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAapD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,0BAAoC;IACjD,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBAEb,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,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;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAErB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAHd,IAAI,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;IACd,gFAAgF;IACvE,MAAM,GAAE,MAAY;CAKhC;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,SAAS,GAAG,gBAAgB,EAClC,UAAU,EAAE,cAAc,GACzB,IAAI,CASN"}
|
|
@@ -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 {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpHost.d.ts","sourceRoot":"","sources":["../../../src/hosting/httpHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"httpHost.d.ts","sourceRoot":"","sources":["../../../src/hosting/httpHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AASjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,g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D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3E;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,2DAA2D;AAC3D,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAS,SAAQ,SAAS,EAAE,gBAAgB;IAC3D,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACrD,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC3E;AAsFD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAiW3D;AAibD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,EAC7D,IAAI,EAAE,MAAM,EACZ,GAAG,SAAS,EAAE,MAAM,EAAE,GACrB,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
export { nodeHost, jsonWire, jsonWireWith, DEFAULT_SESSION_HEADER } from './nodeHost.js';
|
|
96
96
|
export type { NodeHost, NodeHostHandle, NodeHostOptions, JsonWireOptions } from './nodeHost.js';
|
|
97
97
|
export { httpHost, headerValue } from './httpHost.js';
|
|
98
|
-
export type { ConversationHandshake, HandshakeFacts, HttpHost, HttpHostHandle, HttpHostOptions, HttpRequestFacts, HttpWire, } from './httpHost.js';
|
|
98
|
+
export type { ConversationHandshake, HandshakeFacts, HttpHost, HttpHostHandle, HttpHostOptions, FailureOrigin, HttpRequestFacts, HttpWire, StreamFrame, StreamFraming, } from './httpHost.js';
|
|
99
99
|
export { memorySessions } from './memorySessions.js';
|
|
100
100
|
export { sqliteSessions, SqliteUnavailableError, UnreadableSessionFileError, } from './sqliteSessions.js';
|
|
101
101
|
export type { SqliteSessions, SqliteSessionsOptions } from './sqliteSessions.js';
|
|
102
102
|
export { toEnvelope, envelopeOwner, envelopeTranscript, toPausedEnvelope, readEnvelope, readPausedRun, checkEnvelope, } from './envelope.js';
|
|
103
103
|
export { standingAgent } from './standingAgent.js';
|
|
104
104
|
export { DEFAULT_MAX_ACTIVE_SESSIONS, DEFAULT_SWEEP_LIMIT } from './types.js';
|
|
105
|
-
export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, UnreadableEnvelopeError, ConversationClosedError, FrameTooLargeError, InvalidWireOpError, ArtifactSessionRequiredError, NoArtifactStoreError, ArtifactNotFoundError, ArtifactNotCarriedError, IdentityNotVerifiedError, VerifierUnavailableError, AdmissionRefusedError, SessionOpNeedsIdentityError, SessionIndexUnavailableError, SessionRetentionUnavailableError, SessionNotFoundError, SessionOwnershipConflictError, SessionsNotCarriedError, } from './errors.js';
|
|
105
|
+
export { requireCapability, HostClosedError, ConcurrentRunError, PauseNotCarriedError, AwaitingDecisionError, NoPendingAskError, UnreadableEnvelopeError, ConversationClosedError, FrameTooLargeError, InvalidWireOpError, ArtifactSessionRequiredError, NoArtifactStoreError, ArtifactNotFoundError, ArtifactNotCarriedError, IdentityNotVerifiedError, VerifierUnavailableError, AdmissionRefusedError, SessionOpNeedsIdentityError, SessionIndexUnavailableError, SessionRetentionUnavailableError, SessionNotFoundError, SessionOwnershipConflictError, SessionsNotCarriedError, RequestTooLargeError, WireRequestRefusal, } from './errors.js';
|
|
106
106
|
export type { IdentityFailureClass } from './errors.js';
|
|
107
107
|
export { sessionRetention } from './sessionRetention.js';
|
|
108
108
|
export { resolveSessionOwner } from './sessionOwnership.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hosting/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzF,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQhG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,QAAQ,EACR,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hosting/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACzF,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAQhG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,qBAAqB,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W,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAC"}
|
|
@@ -25,6 +25,19 @@
|
|
|
25
25
|
* idleMs: 900000 }` declared, session affinity readable from header or
|
|
26
26
|
* query, and a `Sec-WebSocket-Protocol` bearer mapped into
|
|
27
27
|
* `headers.authorization`.
|
|
28
|
+
* • `foundryResponsesHost({ port?, hostname?, model?, maxBodyBytes? })` — an
|
|
29
|
+
* `AgentHost` for Microsoft Foundry's hosted-agent contract: `POST
|
|
30
|
+
* /responses`, a `HEAD` capability probe on the same path, `GET /readiness`
|
|
31
|
+
* answering `{"status":"healthy"}`, port 8088, and the session read from
|
|
32
|
+
* `conversation` / `agent_session_id` / `session_id` in that order. It
|
|
33
|
+
* streams when the BODY says `stream: true` — not the `Accept` header —
|
|
34
|
+
* and frames that stream as the Responses lifecycle.
|
|
35
|
+
* **Inbound only:** it is the door callers arrive at, and says nothing
|
|
36
|
+
* about which model the agent calls. It does NOT provide Workflow
|
|
37
|
+
* Visualizer topology; see the adapter's header.
|
|
38
|
+
* • `responsesWire({ defaultModel?, sessionFields?, health? })` — the
|
|
39
|
+
* Responses PROTOCOL as an `HttpWire`, with no vendor in it, for the next
|
|
40
|
+
* runtime that speaks it on paths of its own.
|
|
28
41
|
* • `agentCoreSessions({ store })` — a `SessionLifecycle` whose checkpoint
|
|
29
42
|
* home you choose at construction: a JSON file in the runtime's own session
|
|
30
43
|
* storage (survives a stop/resume, needs no SDK), or one AgentCore Memory
|
|
@@ -87,6 +100,10 @@
|
|
|
87
100
|
* symbols, one door. Import from the door.
|
|
88
101
|
*/
|
|
89
102
|
export { agentCoreRuntimeHost, agentCoreRuntimeWire, readAgentCoreConversation, agentCoreSessions, DEFAULT_SESSION_STORAGE_PATH, } from './adapters/hosting/agentcore.js';
|
|
103
|
+
export { foundryResponsesHost, DEFAULT_FOUNDRY_PORT, FOUNDRY_INVOKE_PATH, FOUNDRY_READINESS_PATH, FOUNDRY_SESSION_FIELDS, } from './adapters/hosting/foundryResponses.js';
|
|
104
|
+
export type { FoundryResponsesHostOptions } from './adapters/hosting/foundryResponses.js';
|
|
105
|
+
export { responsesWire, readResponsesInput, readResponsesSession, DEFAULT_SESSION_FIELDS, PUBLIC_FAILURE_MESSAGE, } from './adapters/hosting/responsesWire.js';
|
|
106
|
+
export type { ResponsesWireOptions } from './adapters/hosting/responsesWire.js';
|
|
90
107
|
export { agentEngineSessions, DEFAULT_USER_ID, SESSION_STATE_KEY, SESSION_EVENT_AUTHOR, } from './adapters/hosting/googleAgentEngine.js';
|
|
91
108
|
export type { AgentEngineSessions, AgentEngineSessionsOptions, } from './adapters/hosting/googleAgentEngine.js';
|
|
92
109
|
export { firestoreSessions, DEFAULT_SESSION_COLLECTION, EXPIRES_AT_FIELD, FIRESTORE_MAX_DOCUMENT_BYTES, FIRESTORE_MAX_ENVELOPE_BYTES, EnvelopeTooLargeError, FirestoreIndexMissingError, } from './adapters/hosting/firestoreSessions.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosting-providers.d.ts","sourceRoot":"","sources":["../../src/hosting-providers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosting-providers.d.ts","sourceRoot":"","sources":["../../src/hosting-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoGG;AAEH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAM1F,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAE7C,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EACV,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,yCAAyC,CAAC;AAQjD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAM1B,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,qBAAqB,EACrB,gCAAgC,GACjC,MAAM,iCAAiC,CAAC"}
|
package/dist/types/identity.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export { staticTokens, type StaticTokensOptions } from './identity/staticTokens.
|
|
|
34
34
|
export type { AuthorizationRequiredMode, ConsentRequest } from './identity/consent.js';
|
|
35
35
|
export { CredentialConsentRequiredError, type CredentialConsentRequiredContext, } from './identity/CredentialConsentRequiredError.js';
|
|
36
36
|
export { withCredentialRetry, type WithCredentialRetryOptions, } from './identity/withCredentialRetry.js';
|
|
37
|
-
export { agentCoreIdentity, type AgentCoreIdentityOptions, type AgentCoreIdentityClientLike, type AgentCoreOauthResponse, } from './adapters/identity/agentcore.js';
|
|
37
|
+
export { agentCoreIdentity, completeAgentCoreAuthorization, type AgentCoreIdentityOptions, type AgentCoreIdentityClientLike, type AgentCoreOauthResponse, type CompleteAgentCoreAuthorizationOptions, } from './adapters/identity/agentcore.js';
|
|
38
38
|
export { vaultCredentials, type VaultCredentialsOptions } from './adapters/identity/vault.js';
|
|
39
39
|
export { googleIdentity, CLOUD_PLATFORM_SCOPE, type GoogleIdentityOptions, type GoogleImpersonation, type GoogleAuthClientLike, } from './adapters/identity/google.js';
|
|
40
40
|
export { jwksIdentity, MissingJwksSupportError, type JoseBackend, type JwksIdentityOptions, } from './adapters/identity/jwks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,+BAA+B,EAC/B,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIpF,YAAY,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EACL,8BAA8B,EAC9B,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AoB,GAC1B,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,KAAK,WAAW,EAChB,KAAK,mBAAmB,GACzB,MAAM,6BAA6B,CAAC"}
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* behind `agentfootprint/observe`, which re-exports every name here — same
|
|
45
45
|
* symbols, one door. Import from the door.
|
|
46
46
|
*/
|
|
47
|
-
export { agentcoreObservability, type AgentcoreObservabilityOptions, } from './adapters/observability/agentcore.js';
|
|
47
|
+
export { agentcoreObservability, agentCoreEvaluationSpans, AGENTCORE_EVALUATIONS_SCOPE_NAME, type AgentcoreObservabilityOptions, } from './adapters/observability/agentcore.js';
|
|
48
48
|
export { cloudwatchObservability, type CloudwatchObservabilityOptions, } from './adapters/observability/cloudwatch.js';
|
|
49
49
|
export { xrayObservability, type XrayObservabilityOptions, type XRayLikeClient, } from './adapters/observability/xray.js';
|
|
50
50
|
export { otelObservability, type OtelObservabilityOptions, type OtelObservabilityStrategy, type OtelDecisionEvidenceRecorder, type OtelTracerLike, type OtelSpanLike, type OtelSpanOptions, type OtelAttributeValue, } from './adapters/observability/otel.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability-providers.d.ts","sourceRoot":"","sources":["../../src/observability-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EACL,sBAAsB,
|
|
1
|
+
{"version":3,"file":"observability-providers.d.ts","sourceRoot":"","sources":["../../src/observability-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EACL,sBAAsB,EAItB,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,6BAA6B,GACnC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,GACpC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,GACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,GAChB,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAQ/E,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,wBAAwB,GAC9B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,gDAAgD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfootprint",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.66.0",
|
|
4
4
|
"description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|