@goodtiming/baton-sdk 0.4.0 → 0.5.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 +83 -3
- package/dist/index.cjs +850 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +821 -83
- package/dist/index.d.ts +821 -83
- package/dist/index.js +826 -173
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const SDK_VERSION = "ts-0.
|
|
3
|
+
declare const SDK_VERSION = "ts-0.5.0";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Zod schemas + TS types for the Baton event stream per SPEC §11.4.
|
|
@@ -42,6 +42,7 @@ declare const ToolCallEndPayloadSchema: z.ZodObject<{
|
|
|
42
42
|
tool_name: z.ZodString;
|
|
43
43
|
result: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
44
44
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
46
|
}, z.core.$strict>;
|
|
46
47
|
type ToolCallEndPayload = z.infer<typeof ToolCallEndPayloadSchema>;
|
|
47
48
|
/** Emitted when the call FAILED, which MCP expresses two ways (SPEC §11.4.3):
|
|
@@ -85,6 +86,8 @@ declare const ToolCallErrorPayloadSchema: z.ZodObject<{
|
|
|
85
86
|
error_body: z.ZodString;
|
|
86
87
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
87
88
|
result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
89
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
+
failure_kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
91
|
}, z.core.$strict>;
|
|
89
92
|
type ToolCallErrorPayload = z.infer<typeof ToolCallErrorPayloadSchema>;
|
|
90
93
|
/** Agent-supplied context. All fields nullable per SPEC §5.1.1 — the agent
|
|
@@ -156,8 +159,137 @@ declare const EventTypeSchema: z.ZodEnum<{
|
|
|
156
159
|
tool_call_error: "tool_call_error";
|
|
157
160
|
annotation: "annotation";
|
|
158
161
|
surface_snapshot: "surface_snapshot";
|
|
162
|
+
resource_list_start: "resource_list_start";
|
|
163
|
+
resource_list_end: "resource_list_end";
|
|
164
|
+
resource_list_error: "resource_list_error";
|
|
165
|
+
resource_read_start: "resource_read_start";
|
|
166
|
+
resource_read_end: "resource_read_end";
|
|
167
|
+
resource_read_error: "resource_read_error";
|
|
168
|
+
prompt_list_start: "prompt_list_start";
|
|
169
|
+
prompt_list_end: "prompt_list_end";
|
|
170
|
+
prompt_list_error: "prompt_list_error";
|
|
171
|
+
prompt_get_start: "prompt_get_start";
|
|
172
|
+
prompt_get_end: "prompt_get_end";
|
|
173
|
+
prompt_get_error: "prompt_get_error";
|
|
159
174
|
}>;
|
|
160
175
|
type EventType = z.infer<typeof EventTypeSchema>;
|
|
176
|
+
/** `resources/list` reached the server. Deliberately EMPTY — a list request
|
|
177
|
+
* has no subject, and the envelope already names the session, the tenant and
|
|
178
|
+
* the vendor. `.strict()` with no members is the claim, not an oversight. */
|
|
179
|
+
declare const ResourceListStartPayloadSchema: z.ZodObject<{}, z.core.$strict>;
|
|
180
|
+
type ResourceListStartPayload = z.infer<typeof ResourceListStartPayloadSchema>;
|
|
181
|
+
/** `resources/list` returned.
|
|
182
|
+
*
|
|
183
|
+
* ⚠ `count` counts the `resources` array ALONE. Resource TEMPLATES are a
|
|
184
|
+
* separate MCP method with their own result array and are not added in, so a
|
|
185
|
+
* template-only server reports `0` — correctly — and a consumer MUST NOT read
|
|
186
|
+
* that as "this server has no resources". */
|
|
187
|
+
declare const ResourceListEndPayloadSchema: z.ZodObject<{
|
|
188
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
189
|
+
count: z.ZodNumber;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
type ResourceListEndPayload = z.infer<typeof ResourceListEndPayloadSchema>;
|
|
192
|
+
/** `resources/list` failed. See `ResourceReadErrorPayloadSchema` for how
|
|
193
|
+
* `error_type` is spelled across producers and why `error_body` is kept. */
|
|
194
|
+
declare const ResourceListErrorPayloadSchema: z.ZodObject<{
|
|
195
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
196
|
+
error_type: z.ZodString;
|
|
197
|
+
error_body: z.ZodString;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
type ResourceListErrorPayload = z.infer<typeof ResourceListErrorPayloadSchema>;
|
|
200
|
+
/** `resources/read` reached the server.
|
|
201
|
+
*
|
|
202
|
+
* ⚠ **`uri` is ALSO inside `params`.** The proxy builds `params` by removing
|
|
203
|
+
* `_meta` from the request's params and nothing else, and `uri` is one of
|
|
204
|
+
* them — so the subject appears twice. Recorded rather than deduplicated: the
|
|
205
|
+
* dedicated member is what a consumer reads, the bag is what the caller
|
|
206
|
+
* actually sent, and a producer that stripped `uri` out of it would stop being
|
|
207
|
+
* able to say that. */
|
|
208
|
+
declare const ResourceReadStartPayloadSchema: z.ZodObject<{
|
|
209
|
+
uri: z.ZodString;
|
|
210
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
type ResourceReadStartPayload = z.infer<typeof ResourceReadStartPayloadSchema>;
|
|
213
|
+
/** `resources/read` returned.
|
|
214
|
+
*
|
|
215
|
+
* ⚠ **No content member, and that is the design.** The resource BODY is
|
|
216
|
+
* customer data of exactly the kind the response-capture switch exists to keep
|
|
217
|
+
* off the wire, and the only producer there was never sent it. URI plus timing
|
|
218
|
+
* is what makes a failing or slow read visible without it. */
|
|
219
|
+
declare const ResourceReadEndPayloadSchema: z.ZodObject<{
|
|
220
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
221
|
+
uri: z.ZodString;
|
|
222
|
+
}, z.core.$strict>;
|
|
223
|
+
type ResourceReadEndPayload = z.infer<typeof ResourceReadEndPayloadSchema>;
|
|
224
|
+
/** `resources/read` failed.
|
|
225
|
+
*
|
|
226
|
+
* ⚠ **`error_type` is an unconstrained string and the producers do NOT agree
|
|
227
|
+
* on how to spell it** — stated here for all six error payloads.
|
|
228
|
+
* `baton-proxy` reads the WIRE, so it holds the upstream's JSON-RPC error and
|
|
229
|
+
* files the numeric `code` as a string; this package holds a live exception
|
|
230
|
+
* and files its class name, the way §11.4.3's RAISE shape already does for
|
|
231
|
+
* tools. Both conform — §11.4.3 says this member separates SHAPES and is not a
|
|
232
|
+
* closed set of values — and a consumer MUST NOT read one producer's spelling
|
|
233
|
+
* as the vocabulary.
|
|
234
|
+
*
|
|
235
|
+
* ⚠ **`error_body` is KEPT under every capture mode.** It is a failed FETCH's
|
|
236
|
+
* message, not anything a resource returned, so nothing here is
|
|
237
|
+
* result-derived. */
|
|
238
|
+
declare const ResourceReadErrorPayloadSchema: z.ZodObject<{
|
|
239
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
240
|
+
error_type: z.ZodString;
|
|
241
|
+
error_body: z.ZodString;
|
|
242
|
+
uri: z.ZodString;
|
|
243
|
+
}, z.core.$strict>;
|
|
244
|
+
type ResourceReadErrorPayload = z.infer<typeof ResourceReadErrorPayloadSchema>;
|
|
245
|
+
/** `prompts/list` reached the server. Empty, for the reason
|
|
246
|
+
* `ResourceListStartPayloadSchema` carries. */
|
|
247
|
+
declare const PromptListStartPayloadSchema: z.ZodObject<{}, z.core.$strict>;
|
|
248
|
+
type PromptListStartPayload = z.infer<typeof PromptListStartPayloadSchema>;
|
|
249
|
+
/** `prompts/list` returned. `count` counts the `prompts` array. */
|
|
250
|
+
declare const PromptListEndPayloadSchema: z.ZodObject<{
|
|
251
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
252
|
+
count: z.ZodNumber;
|
|
253
|
+
}, z.core.$strict>;
|
|
254
|
+
type PromptListEndPayload = z.infer<typeof PromptListEndPayloadSchema>;
|
|
255
|
+
/** `prompts/list` failed. See `ResourceReadErrorPayloadSchema`. */
|
|
256
|
+
declare const PromptListErrorPayloadSchema: z.ZodObject<{
|
|
257
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
258
|
+
error_type: z.ZodString;
|
|
259
|
+
error_body: z.ZodString;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
type PromptListErrorPayload = z.infer<typeof PromptListErrorPayloadSchema>;
|
|
262
|
+
/** `prompts/get` reached the server.
|
|
263
|
+
*
|
|
264
|
+
* ⚠ **`params` is the request's `arguments` member ALONE, not the whole params
|
|
265
|
+
* bag** — the opposite of `ResourceReadStartPayloadSchema`'s choice, measured
|
|
266
|
+
* in the proxy. The two are inconsistent in the only producer that existed;
|
|
267
|
+
* the inconsistency is recorded so a reader does not expect `name` inside
|
|
268
|
+
* `params` the way `uri` does appear there. */
|
|
269
|
+
declare const PromptGetStartPayloadSchema: z.ZodObject<{
|
|
270
|
+
name: z.ZodString;
|
|
271
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
272
|
+
}, z.core.$strict>;
|
|
273
|
+
type PromptGetStartPayload = z.infer<typeof PromptGetStartPayloadSchema>;
|
|
274
|
+
/** `prompts/get` returned.
|
|
275
|
+
*
|
|
276
|
+
* ⚠ **No rendered messages.** A prompt's text is authored by the SERVER rather
|
|
277
|
+
* than fetched by a tool, so whether it is customer content at all is a
|
|
278
|
+
* decision nobody has taken — and the standing answer, from the only producer,
|
|
279
|
+
* is that it does not egress. */
|
|
280
|
+
declare const PromptGetEndPayloadSchema: z.ZodObject<{
|
|
281
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
282
|
+
name: z.ZodString;
|
|
283
|
+
}, z.core.$strict>;
|
|
284
|
+
type PromptGetEndPayload = z.infer<typeof PromptGetEndPayloadSchema>;
|
|
285
|
+
/** `prompts/get` failed. See `ResourceReadErrorPayloadSchema`. */
|
|
286
|
+
declare const PromptGetErrorPayloadSchema: z.ZodObject<{
|
|
287
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
288
|
+
error_type: z.ZodString;
|
|
289
|
+
error_body: z.ZodString;
|
|
290
|
+
name: z.ZodString;
|
|
291
|
+
}, z.core.$strict>;
|
|
292
|
+
type PromptGetErrorPayload = z.infer<typeof PromptGetErrorPayloadSchema>;
|
|
161
293
|
declare const ToolCallStartEventSchema: z.ZodObject<{
|
|
162
294
|
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_start">>;
|
|
163
295
|
payload: z.ZodObject<{
|
|
@@ -185,14 +317,459 @@ declare const ToolCallStartEventSchema: z.ZodObject<{
|
|
|
185
317
|
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
186
318
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
187
319
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
188
|
-
}, z.core.$strict>;
|
|
189
|
-
type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;
|
|
190
|
-
declare const ToolCallEndEventSchema: z.ZodObject<{
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;
|
|
322
|
+
declare const ToolCallEndEventSchema: z.ZodObject<{
|
|
323
|
+
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_end">>;
|
|
324
|
+
payload: z.ZodObject<{
|
|
325
|
+
tool_name: z.ZodString;
|
|
326
|
+
result: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
327
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
328
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
329
|
+
}, z.core.$strict>;
|
|
330
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
331
|
+
tenant_id: z.ZodString;
|
|
332
|
+
vendor_id: z.ZodString;
|
|
333
|
+
session_id: z.ZodString;
|
|
334
|
+
sequence_number: z.ZodNumber;
|
|
335
|
+
captured_at: z.ZodString;
|
|
336
|
+
consent_token: z.ZodString;
|
|
337
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
338
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
339
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
340
|
+
id: z.ZodString;
|
|
341
|
+
source: z.ZodString;
|
|
342
|
+
form: z.ZodString;
|
|
343
|
+
}, z.core.$strict>>>;
|
|
344
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
345
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
346
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;
|
|
349
|
+
declare const ToolCallErrorEventSchema: z.ZodObject<{
|
|
350
|
+
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_error">>;
|
|
351
|
+
payload: z.ZodObject<{
|
|
352
|
+
tool_name: z.ZodString;
|
|
353
|
+
error_type: z.ZodString;
|
|
354
|
+
error_body: z.ZodString;
|
|
355
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
356
|
+
result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
357
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
failure_kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
361
|
+
tenant_id: z.ZodString;
|
|
362
|
+
vendor_id: z.ZodString;
|
|
363
|
+
session_id: z.ZodString;
|
|
364
|
+
sequence_number: z.ZodNumber;
|
|
365
|
+
captured_at: z.ZodString;
|
|
366
|
+
consent_token: z.ZodString;
|
|
367
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
368
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
369
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
370
|
+
id: z.ZodString;
|
|
371
|
+
source: z.ZodString;
|
|
372
|
+
form: z.ZodString;
|
|
373
|
+
}, z.core.$strict>>>;
|
|
374
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
375
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
376
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
377
|
+
}, z.core.$strict>;
|
|
378
|
+
type ToolCallErrorEvent = z.infer<typeof ToolCallErrorEventSchema>;
|
|
379
|
+
declare const AnnotationEventSchema: z.ZodObject<{
|
|
380
|
+
event_type: z.ZodDefault<z.ZodLiteral<"annotation">>;
|
|
381
|
+
payload: z.ZodObject<{
|
|
382
|
+
intent: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
383
|
+
expected_outcome: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
384
|
+
signal_type: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
385
|
+
workflow: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
386
|
+
suggested_improvement: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
387
|
+
context: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
388
|
+
intent_source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
389
|
+
tool_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
392
|
+
tenant_id: z.ZodString;
|
|
393
|
+
vendor_id: z.ZodString;
|
|
394
|
+
session_id: z.ZodString;
|
|
395
|
+
sequence_number: z.ZodNumber;
|
|
396
|
+
captured_at: z.ZodString;
|
|
397
|
+
consent_token: z.ZodString;
|
|
398
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
399
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
400
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
401
|
+
id: z.ZodString;
|
|
402
|
+
source: z.ZodString;
|
|
403
|
+
form: z.ZodString;
|
|
404
|
+
}, z.core.$strict>>>;
|
|
405
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
406
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
407
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
408
|
+
}, z.core.$strict>;
|
|
409
|
+
type AnnotationEvent = z.infer<typeof AnnotationEventSchema>;
|
|
410
|
+
declare const SurfaceSnapshotEventSchema: z.ZodObject<{
|
|
411
|
+
event_type: z.ZodDefault<z.ZodLiteral<"surface_snapshot">>;
|
|
412
|
+
payload: z.ZodObject<{
|
|
413
|
+
surface_hash: z.ZodString;
|
|
414
|
+
server_info: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
415
|
+
capabilities: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
416
|
+
instructions: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
417
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
418
|
+
seam_augmentations: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
419
|
+
}, z.core.$strict>;
|
|
420
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
421
|
+
tenant_id: z.ZodString;
|
|
422
|
+
vendor_id: z.ZodString;
|
|
423
|
+
session_id: z.ZodString;
|
|
424
|
+
sequence_number: z.ZodNumber;
|
|
425
|
+
captured_at: z.ZodString;
|
|
426
|
+
consent_token: z.ZodString;
|
|
427
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
428
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
429
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
430
|
+
id: z.ZodString;
|
|
431
|
+
source: z.ZodString;
|
|
432
|
+
form: z.ZodString;
|
|
433
|
+
}, z.core.$strict>>>;
|
|
434
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
435
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
436
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
437
|
+
}, z.core.$strict>;
|
|
438
|
+
type SurfaceSnapshotEvent = z.infer<typeof SurfaceSnapshotEventSchema>;
|
|
439
|
+
declare const ResourceListStartEventSchema: z.ZodObject<{
|
|
440
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_start">>;
|
|
441
|
+
payload: z.ZodObject<{}, z.core.$strict>;
|
|
442
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
443
|
+
tenant_id: z.ZodString;
|
|
444
|
+
vendor_id: z.ZodString;
|
|
445
|
+
session_id: z.ZodString;
|
|
446
|
+
sequence_number: z.ZodNumber;
|
|
447
|
+
captured_at: z.ZodString;
|
|
448
|
+
consent_token: z.ZodString;
|
|
449
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
450
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
451
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
452
|
+
id: z.ZodString;
|
|
453
|
+
source: z.ZodString;
|
|
454
|
+
form: z.ZodString;
|
|
455
|
+
}, z.core.$strict>>>;
|
|
456
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
457
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
458
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
type ResourceListStartEvent = z.infer<typeof ResourceListStartEventSchema>;
|
|
461
|
+
declare const ResourceListEndEventSchema: z.ZodObject<{
|
|
462
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_end">>;
|
|
463
|
+
payload: z.ZodObject<{
|
|
464
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
465
|
+
count: z.ZodNumber;
|
|
466
|
+
}, z.core.$strict>;
|
|
467
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
468
|
+
tenant_id: z.ZodString;
|
|
469
|
+
vendor_id: z.ZodString;
|
|
470
|
+
session_id: z.ZodString;
|
|
471
|
+
sequence_number: z.ZodNumber;
|
|
472
|
+
captured_at: z.ZodString;
|
|
473
|
+
consent_token: z.ZodString;
|
|
474
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
475
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
476
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
477
|
+
id: z.ZodString;
|
|
478
|
+
source: z.ZodString;
|
|
479
|
+
form: z.ZodString;
|
|
480
|
+
}, z.core.$strict>>>;
|
|
481
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
482
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
483
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
484
|
+
}, z.core.$strict>;
|
|
485
|
+
type ResourceListEndEvent = z.infer<typeof ResourceListEndEventSchema>;
|
|
486
|
+
declare const ResourceListErrorEventSchema: z.ZodObject<{
|
|
487
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_error">>;
|
|
488
|
+
payload: z.ZodObject<{
|
|
489
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
490
|
+
error_type: z.ZodString;
|
|
491
|
+
error_body: z.ZodString;
|
|
492
|
+
}, z.core.$strict>;
|
|
493
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
494
|
+
tenant_id: z.ZodString;
|
|
495
|
+
vendor_id: z.ZodString;
|
|
496
|
+
session_id: z.ZodString;
|
|
497
|
+
sequence_number: z.ZodNumber;
|
|
498
|
+
captured_at: z.ZodString;
|
|
499
|
+
consent_token: z.ZodString;
|
|
500
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
501
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
502
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
503
|
+
id: z.ZodString;
|
|
504
|
+
source: z.ZodString;
|
|
505
|
+
form: z.ZodString;
|
|
506
|
+
}, z.core.$strict>>>;
|
|
507
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
508
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
509
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
510
|
+
}, z.core.$strict>;
|
|
511
|
+
type ResourceListErrorEvent = z.infer<typeof ResourceListErrorEventSchema>;
|
|
512
|
+
declare const ResourceReadStartEventSchema: z.ZodObject<{
|
|
513
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_start">>;
|
|
514
|
+
payload: z.ZodObject<{
|
|
515
|
+
uri: z.ZodString;
|
|
516
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
517
|
+
}, z.core.$strict>;
|
|
518
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
519
|
+
tenant_id: z.ZodString;
|
|
520
|
+
vendor_id: z.ZodString;
|
|
521
|
+
session_id: z.ZodString;
|
|
522
|
+
sequence_number: z.ZodNumber;
|
|
523
|
+
captured_at: z.ZodString;
|
|
524
|
+
consent_token: z.ZodString;
|
|
525
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
526
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
527
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
528
|
+
id: z.ZodString;
|
|
529
|
+
source: z.ZodString;
|
|
530
|
+
form: z.ZodString;
|
|
531
|
+
}, z.core.$strict>>>;
|
|
532
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
533
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
534
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
535
|
+
}, z.core.$strict>;
|
|
536
|
+
type ResourceReadStartEvent = z.infer<typeof ResourceReadStartEventSchema>;
|
|
537
|
+
declare const ResourceReadEndEventSchema: z.ZodObject<{
|
|
538
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_end">>;
|
|
539
|
+
payload: z.ZodObject<{
|
|
540
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
541
|
+
uri: z.ZodString;
|
|
542
|
+
}, z.core.$strict>;
|
|
543
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
544
|
+
tenant_id: z.ZodString;
|
|
545
|
+
vendor_id: z.ZodString;
|
|
546
|
+
session_id: z.ZodString;
|
|
547
|
+
sequence_number: z.ZodNumber;
|
|
548
|
+
captured_at: z.ZodString;
|
|
549
|
+
consent_token: z.ZodString;
|
|
550
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
551
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
552
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
553
|
+
id: z.ZodString;
|
|
554
|
+
source: z.ZodString;
|
|
555
|
+
form: z.ZodString;
|
|
556
|
+
}, z.core.$strict>>>;
|
|
557
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
558
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
559
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
560
|
+
}, z.core.$strict>;
|
|
561
|
+
type ResourceReadEndEvent = z.infer<typeof ResourceReadEndEventSchema>;
|
|
562
|
+
declare const ResourceReadErrorEventSchema: z.ZodObject<{
|
|
563
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_error">>;
|
|
564
|
+
payload: z.ZodObject<{
|
|
565
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
566
|
+
error_type: z.ZodString;
|
|
567
|
+
error_body: z.ZodString;
|
|
568
|
+
uri: z.ZodString;
|
|
569
|
+
}, z.core.$strict>;
|
|
570
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
571
|
+
tenant_id: z.ZodString;
|
|
572
|
+
vendor_id: z.ZodString;
|
|
573
|
+
session_id: z.ZodString;
|
|
574
|
+
sequence_number: z.ZodNumber;
|
|
575
|
+
captured_at: z.ZodString;
|
|
576
|
+
consent_token: z.ZodString;
|
|
577
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
578
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
579
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
580
|
+
id: z.ZodString;
|
|
581
|
+
source: z.ZodString;
|
|
582
|
+
form: z.ZodString;
|
|
583
|
+
}, z.core.$strict>>>;
|
|
584
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
585
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
586
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
587
|
+
}, z.core.$strict>;
|
|
588
|
+
type ResourceReadErrorEvent = z.infer<typeof ResourceReadErrorEventSchema>;
|
|
589
|
+
declare const PromptListStartEventSchema: z.ZodObject<{
|
|
590
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_start">>;
|
|
591
|
+
payload: z.ZodObject<{}, z.core.$strict>;
|
|
592
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
593
|
+
tenant_id: z.ZodString;
|
|
594
|
+
vendor_id: z.ZodString;
|
|
595
|
+
session_id: z.ZodString;
|
|
596
|
+
sequence_number: z.ZodNumber;
|
|
597
|
+
captured_at: z.ZodString;
|
|
598
|
+
consent_token: z.ZodString;
|
|
599
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
600
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
601
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
602
|
+
id: z.ZodString;
|
|
603
|
+
source: z.ZodString;
|
|
604
|
+
form: z.ZodString;
|
|
605
|
+
}, z.core.$strict>>>;
|
|
606
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
607
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
608
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
609
|
+
}, z.core.$strict>;
|
|
610
|
+
type PromptListStartEvent = z.infer<typeof PromptListStartEventSchema>;
|
|
611
|
+
declare const PromptListEndEventSchema: z.ZodObject<{
|
|
612
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_end">>;
|
|
613
|
+
payload: z.ZodObject<{
|
|
614
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
615
|
+
count: z.ZodNumber;
|
|
616
|
+
}, z.core.$strict>;
|
|
617
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
618
|
+
tenant_id: z.ZodString;
|
|
619
|
+
vendor_id: z.ZodString;
|
|
620
|
+
session_id: z.ZodString;
|
|
621
|
+
sequence_number: z.ZodNumber;
|
|
622
|
+
captured_at: z.ZodString;
|
|
623
|
+
consent_token: z.ZodString;
|
|
624
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
625
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
626
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
627
|
+
id: z.ZodString;
|
|
628
|
+
source: z.ZodString;
|
|
629
|
+
form: z.ZodString;
|
|
630
|
+
}, z.core.$strict>>>;
|
|
631
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
632
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
633
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
634
|
+
}, z.core.$strict>;
|
|
635
|
+
type PromptListEndEvent = z.infer<typeof PromptListEndEventSchema>;
|
|
636
|
+
declare const PromptListErrorEventSchema: z.ZodObject<{
|
|
637
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_error">>;
|
|
638
|
+
payload: z.ZodObject<{
|
|
639
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
640
|
+
error_type: z.ZodString;
|
|
641
|
+
error_body: z.ZodString;
|
|
642
|
+
}, z.core.$strict>;
|
|
643
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
644
|
+
tenant_id: z.ZodString;
|
|
645
|
+
vendor_id: z.ZodString;
|
|
646
|
+
session_id: z.ZodString;
|
|
647
|
+
sequence_number: z.ZodNumber;
|
|
648
|
+
captured_at: z.ZodString;
|
|
649
|
+
consent_token: z.ZodString;
|
|
650
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
651
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
652
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
653
|
+
id: z.ZodString;
|
|
654
|
+
source: z.ZodString;
|
|
655
|
+
form: z.ZodString;
|
|
656
|
+
}, z.core.$strict>>>;
|
|
657
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
658
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
659
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
660
|
+
}, z.core.$strict>;
|
|
661
|
+
type PromptListErrorEvent = z.infer<typeof PromptListErrorEventSchema>;
|
|
662
|
+
declare const PromptGetStartEventSchema: z.ZodObject<{
|
|
663
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_start">>;
|
|
664
|
+
payload: z.ZodObject<{
|
|
665
|
+
name: z.ZodString;
|
|
666
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
667
|
+
}, z.core.$strict>;
|
|
668
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
669
|
+
tenant_id: z.ZodString;
|
|
670
|
+
vendor_id: z.ZodString;
|
|
671
|
+
session_id: z.ZodString;
|
|
672
|
+
sequence_number: z.ZodNumber;
|
|
673
|
+
captured_at: z.ZodString;
|
|
674
|
+
consent_token: z.ZodString;
|
|
675
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
676
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
677
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
678
|
+
id: z.ZodString;
|
|
679
|
+
source: z.ZodString;
|
|
680
|
+
form: z.ZodString;
|
|
681
|
+
}, z.core.$strict>>>;
|
|
682
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
683
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
684
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
685
|
+
}, z.core.$strict>;
|
|
686
|
+
type PromptGetStartEvent = z.infer<typeof PromptGetStartEventSchema>;
|
|
687
|
+
declare const PromptGetEndEventSchema: z.ZodObject<{
|
|
688
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_end">>;
|
|
689
|
+
payload: z.ZodObject<{
|
|
690
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
691
|
+
name: z.ZodString;
|
|
692
|
+
}, z.core.$strict>;
|
|
693
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
694
|
+
tenant_id: z.ZodString;
|
|
695
|
+
vendor_id: z.ZodString;
|
|
696
|
+
session_id: z.ZodString;
|
|
697
|
+
sequence_number: z.ZodNumber;
|
|
698
|
+
captured_at: z.ZodString;
|
|
699
|
+
consent_token: z.ZodString;
|
|
700
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
701
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
702
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
703
|
+
id: z.ZodString;
|
|
704
|
+
source: z.ZodString;
|
|
705
|
+
form: z.ZodString;
|
|
706
|
+
}, z.core.$strict>>>;
|
|
707
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
708
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
709
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
710
|
+
}, z.core.$strict>;
|
|
711
|
+
type PromptGetEndEvent = z.infer<typeof PromptGetEndEventSchema>;
|
|
712
|
+
declare const PromptGetErrorEventSchema: z.ZodObject<{
|
|
713
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_error">>;
|
|
714
|
+
payload: z.ZodObject<{
|
|
715
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
716
|
+
error_type: z.ZodString;
|
|
717
|
+
error_body: z.ZodString;
|
|
718
|
+
name: z.ZodString;
|
|
719
|
+
}, z.core.$strict>;
|
|
720
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
721
|
+
tenant_id: z.ZodString;
|
|
722
|
+
vendor_id: z.ZodString;
|
|
723
|
+
session_id: z.ZodString;
|
|
724
|
+
sequence_number: z.ZodNumber;
|
|
725
|
+
captured_at: z.ZodString;
|
|
726
|
+
consent_token: z.ZodString;
|
|
727
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
728
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
729
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
730
|
+
id: z.ZodString;
|
|
731
|
+
source: z.ZodString;
|
|
732
|
+
form: z.ZodString;
|
|
733
|
+
}, z.core.$strict>>>;
|
|
734
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
735
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
736
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
737
|
+
}, z.core.$strict>;
|
|
738
|
+
type PromptGetErrorEvent = z.infer<typeof PromptGetErrorEventSchema>;
|
|
739
|
+
declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
740
|
+
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_start">>;
|
|
741
|
+
payload: z.ZodObject<{
|
|
742
|
+
tool_name: z.ZodString;
|
|
743
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
744
|
+
call_intent: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
745
|
+
call_expected: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
746
|
+
call_workflow: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
747
|
+
intent_source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
748
|
+
}, z.core.$strict>;
|
|
749
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
750
|
+
tenant_id: z.ZodString;
|
|
751
|
+
vendor_id: z.ZodString;
|
|
752
|
+
session_id: z.ZodString;
|
|
753
|
+
sequence_number: z.ZodNumber;
|
|
754
|
+
captured_at: z.ZodString;
|
|
755
|
+
consent_token: z.ZodString;
|
|
756
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
757
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
758
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
759
|
+
id: z.ZodString;
|
|
760
|
+
source: z.ZodString;
|
|
761
|
+
form: z.ZodString;
|
|
762
|
+
}, z.core.$strict>>>;
|
|
763
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
764
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
765
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
766
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
191
767
|
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_end">>;
|
|
192
768
|
payload: z.ZodObject<{
|
|
193
769
|
tool_name: z.ZodString;
|
|
194
770
|
result: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
195
771
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
772
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
773
|
}, z.core.$strict>;
|
|
197
774
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
198
775
|
tenant_id: z.ZodString;
|
|
@@ -211,9 +788,7 @@ declare const ToolCallEndEventSchema: z.ZodObject<{
|
|
|
211
788
|
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
212
789
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
213
790
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
214
|
-
}, z.core.$strict
|
|
215
|
-
type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;
|
|
216
|
-
declare const ToolCallErrorEventSchema: z.ZodObject<{
|
|
791
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
217
792
|
event_type: z.ZodDefault<z.ZodLiteral<"tool_call_error">>;
|
|
218
793
|
payload: z.ZodObject<{
|
|
219
794
|
tool_name: z.ZodString;
|
|
@@ -221,6 +796,8 @@ declare const ToolCallErrorEventSchema: z.ZodObject<{
|
|
|
221
796
|
error_body: z.ZodString;
|
|
222
797
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
223
798
|
result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
799
|
+
result_capture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
800
|
+
failure_kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
801
|
}, z.core.$strict>;
|
|
225
802
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
226
803
|
tenant_id: z.ZodString;
|
|
@@ -239,9 +816,7 @@ declare const ToolCallErrorEventSchema: z.ZodObject<{
|
|
|
239
816
|
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
240
817
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
241
818
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
242
|
-
}, z.core.$strict
|
|
243
|
-
type ToolCallErrorEvent = z.infer<typeof ToolCallErrorEventSchema>;
|
|
244
|
-
declare const AnnotationEventSchema: z.ZodObject<{
|
|
819
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
820
|
event_type: z.ZodDefault<z.ZodLiteral<"annotation">>;
|
|
246
821
|
payload: z.ZodObject<{
|
|
247
822
|
intent: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -270,9 +845,7 @@ declare const AnnotationEventSchema: z.ZodObject<{
|
|
|
270
845
|
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
271
846
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
272
847
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
273
|
-
}, z.core.$strict
|
|
274
|
-
type AnnotationEvent = z.infer<typeof AnnotationEventSchema>;
|
|
275
|
-
declare const SurfaceSnapshotEventSchema: z.ZodObject<{
|
|
848
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
276
849
|
event_type: z.ZodDefault<z.ZodLiteral<"surface_snapshot">>;
|
|
277
850
|
payload: z.ZodObject<{
|
|
278
851
|
surface_hash: z.ZodString;
|
|
@@ -299,17 +872,31 @@ declare const SurfaceSnapshotEventSchema: z.ZodObject<{
|
|
|
299
872
|
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
300
873
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
301
874
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
302
|
-
}, z.core.$strict
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
875
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
876
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_start">>;
|
|
877
|
+
payload: z.ZodObject<{}, z.core.$strict>;
|
|
878
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
879
|
+
tenant_id: z.ZodString;
|
|
880
|
+
vendor_id: z.ZodString;
|
|
881
|
+
session_id: z.ZodString;
|
|
882
|
+
sequence_number: z.ZodNumber;
|
|
883
|
+
captured_at: z.ZodString;
|
|
884
|
+
consent_token: z.ZodString;
|
|
885
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
886
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
887
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
888
|
+
id: z.ZodString;
|
|
889
|
+
source: z.ZodString;
|
|
890
|
+
form: z.ZodString;
|
|
891
|
+
}, z.core.$strict>>>;
|
|
892
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
893
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
894
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
895
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
896
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_end">>;
|
|
306
897
|
payload: z.ZodObject<{
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
call_intent: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
310
|
-
call_expected: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
311
|
-
call_workflow: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
312
|
-
intent_source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
898
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
899
|
+
count: z.ZodNumber;
|
|
313
900
|
}, z.core.$strict>;
|
|
314
901
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
315
902
|
tenant_id: z.ZodString;
|
|
@@ -329,11 +916,11 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
329
916
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
330
917
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
331
918
|
}, z.core.$strict>, z.ZodObject<{
|
|
332
|
-
event_type: z.ZodDefault<z.ZodLiteral<"
|
|
919
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_list_error">>;
|
|
333
920
|
payload: z.ZodObject<{
|
|
334
|
-
tool_name: z.ZodString;
|
|
335
|
-
result: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
|
|
336
921
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
922
|
+
error_type: z.ZodString;
|
|
923
|
+
error_body: z.ZodString;
|
|
337
924
|
}, z.core.$strict>;
|
|
338
925
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
339
926
|
tenant_id: z.ZodString;
|
|
@@ -353,13 +940,101 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
353
940
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
354
941
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
355
942
|
}, z.core.$strict>, z.ZodObject<{
|
|
356
|
-
event_type: z.ZodDefault<z.ZodLiteral<"
|
|
943
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_start">>;
|
|
357
944
|
payload: z.ZodObject<{
|
|
358
|
-
|
|
945
|
+
uri: z.ZodString;
|
|
946
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
947
|
+
}, z.core.$strict>;
|
|
948
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
949
|
+
tenant_id: z.ZodString;
|
|
950
|
+
vendor_id: z.ZodString;
|
|
951
|
+
session_id: z.ZodString;
|
|
952
|
+
sequence_number: z.ZodNumber;
|
|
953
|
+
captured_at: z.ZodString;
|
|
954
|
+
consent_token: z.ZodString;
|
|
955
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
956
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
957
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
958
|
+
id: z.ZodString;
|
|
959
|
+
source: z.ZodString;
|
|
960
|
+
form: z.ZodString;
|
|
961
|
+
}, z.core.$strict>>>;
|
|
962
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
963
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
964
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
965
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
966
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_end">>;
|
|
967
|
+
payload: z.ZodObject<{
|
|
968
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
969
|
+
uri: z.ZodString;
|
|
970
|
+
}, z.core.$strict>;
|
|
971
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
972
|
+
tenant_id: z.ZodString;
|
|
973
|
+
vendor_id: z.ZodString;
|
|
974
|
+
session_id: z.ZodString;
|
|
975
|
+
sequence_number: z.ZodNumber;
|
|
976
|
+
captured_at: z.ZodString;
|
|
977
|
+
consent_token: z.ZodString;
|
|
978
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
979
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
980
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
981
|
+
id: z.ZodString;
|
|
982
|
+
source: z.ZodString;
|
|
983
|
+
form: z.ZodString;
|
|
984
|
+
}, z.core.$strict>>>;
|
|
985
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
986
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
987
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
988
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
989
|
+
event_type: z.ZodDefault<z.ZodLiteral<"resource_read_error">>;
|
|
990
|
+
payload: z.ZodObject<{
|
|
991
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
359
992
|
error_type: z.ZodString;
|
|
360
993
|
error_body: z.ZodString;
|
|
994
|
+
uri: z.ZodString;
|
|
995
|
+
}, z.core.$strict>;
|
|
996
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
997
|
+
tenant_id: z.ZodString;
|
|
998
|
+
vendor_id: z.ZodString;
|
|
999
|
+
session_id: z.ZodString;
|
|
1000
|
+
sequence_number: z.ZodNumber;
|
|
1001
|
+
captured_at: z.ZodString;
|
|
1002
|
+
consent_token: z.ZodString;
|
|
1003
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
1004
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
1005
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1006
|
+
id: z.ZodString;
|
|
1007
|
+
source: z.ZodString;
|
|
1008
|
+
form: z.ZodString;
|
|
1009
|
+
}, z.core.$strict>>>;
|
|
1010
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1011
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1012
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1013
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1014
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_start">>;
|
|
1015
|
+
payload: z.ZodObject<{}, z.core.$strict>;
|
|
1016
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
1017
|
+
tenant_id: z.ZodString;
|
|
1018
|
+
vendor_id: z.ZodString;
|
|
1019
|
+
session_id: z.ZodString;
|
|
1020
|
+
sequence_number: z.ZodNumber;
|
|
1021
|
+
captured_at: z.ZodString;
|
|
1022
|
+
consent_token: z.ZodString;
|
|
1023
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
1024
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
1025
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1026
|
+
id: z.ZodString;
|
|
1027
|
+
source: z.ZodString;
|
|
1028
|
+
form: z.ZodString;
|
|
1029
|
+
}, z.core.$strict>>>;
|
|
1030
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1031
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1032
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1033
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1034
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_end">>;
|
|
1035
|
+
payload: z.ZodObject<{
|
|
361
1036
|
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
362
|
-
|
|
1037
|
+
count: z.ZodNumber;
|
|
363
1038
|
}, z.core.$strict>;
|
|
364
1039
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
365
1040
|
tenant_id: z.ZodString;
|
|
@@ -379,16 +1054,11 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
379
1054
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
380
1055
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
381
1056
|
}, z.core.$strict>, z.ZodObject<{
|
|
382
|
-
event_type: z.ZodDefault<z.ZodLiteral<"
|
|
1057
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_list_error">>;
|
|
383
1058
|
payload: z.ZodObject<{
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
workflow: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
388
|
-
suggested_improvement: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
389
|
-
context: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
390
|
-
intent_source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
391
|
-
tool_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1059
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
1060
|
+
error_type: z.ZodString;
|
|
1061
|
+
error_body: z.ZodString;
|
|
392
1062
|
}, z.core.$strict>;
|
|
393
1063
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
394
1064
|
tenant_id: z.ZodString;
|
|
@@ -408,14 +1078,58 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
408
1078
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
409
1079
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
410
1080
|
}, z.core.$strict>, z.ZodObject<{
|
|
411
|
-
event_type: z.ZodDefault<z.ZodLiteral<"
|
|
1081
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_start">>;
|
|
412
1082
|
payload: z.ZodObject<{
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
1083
|
+
name: z.ZodString;
|
|
1084
|
+
params: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1085
|
+
}, z.core.$strict>;
|
|
1086
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
1087
|
+
tenant_id: z.ZodString;
|
|
1088
|
+
vendor_id: z.ZodString;
|
|
1089
|
+
session_id: z.ZodString;
|
|
1090
|
+
sequence_number: z.ZodNumber;
|
|
1091
|
+
captured_at: z.ZodString;
|
|
1092
|
+
consent_token: z.ZodString;
|
|
1093
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
1094
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
1095
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1096
|
+
id: z.ZodString;
|
|
1097
|
+
source: z.ZodString;
|
|
1098
|
+
form: z.ZodString;
|
|
1099
|
+
}, z.core.$strict>>>;
|
|
1100
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1101
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1102
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1103
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1104
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_end">>;
|
|
1105
|
+
payload: z.ZodObject<{
|
|
1106
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
1107
|
+
name: z.ZodString;
|
|
1108
|
+
}, z.core.$strict>;
|
|
1109
|
+
event_id: z.ZodDefault<z.ZodUUID>;
|
|
1110
|
+
tenant_id: z.ZodString;
|
|
1111
|
+
vendor_id: z.ZodString;
|
|
1112
|
+
session_id: z.ZodString;
|
|
1113
|
+
sequence_number: z.ZodNumber;
|
|
1114
|
+
captured_at: z.ZodString;
|
|
1115
|
+
consent_token: z.ZodString;
|
|
1116
|
+
sdk_version: z.ZodDefault<z.ZodString>;
|
|
1117
|
+
agent_runtime: z.ZodDefault<z.ZodString>;
|
|
1118
|
+
principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
1119
|
+
id: z.ZodString;
|
|
1120
|
+
source: z.ZodString;
|
|
1121
|
+
form: z.ZodString;
|
|
1122
|
+
}, z.core.$strict>>>;
|
|
1123
|
+
transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1124
|
+
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1125
|
+
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
1126
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1127
|
+
event_type: z.ZodDefault<z.ZodLiteral<"prompt_get_error">>;
|
|
1128
|
+
payload: z.ZodObject<{
|
|
1129
|
+
duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
1130
|
+
error_type: z.ZodString;
|
|
1131
|
+
error_body: z.ZodString;
|
|
1132
|
+
name: z.ZodString;
|
|
419
1133
|
}, z.core.$strict>;
|
|
420
1134
|
event_id: z.ZodDefault<z.ZodUUID>;
|
|
421
1135
|
tenant_id: z.ZodString;
|
|
@@ -435,7 +1149,17 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
435
1149
|
call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
436
1150
|
runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
437
1151
|
}, z.core.$strict>], "event_type">;
|
|
438
|
-
|
|
1152
|
+
/** ⚠ DERIVED, not hand-listed. It used to be a third list of the same
|
|
1153
|
+
* seventeen members, after `EventTypeSchema` and `EventSchema`'s own branches,
|
|
1154
|
+
* and the twelve lifecycle types made that visible: three lists to keep in
|
|
1155
|
+
* step. `EventSchema` is the discriminated union over exactly these schemas,
|
|
1156
|
+
* so its inferred output type IS this union — verified mutually assignable
|
|
1157
|
+
* against the hand-written version before the switch.
|
|
1158
|
+
*
|
|
1159
|
+
* `EventTypeSchema` stays hand-written on purpose: `test/packaging.test.ts`
|
|
1160
|
+
* derives its export guard FROM it, which makes it the source of truth rather
|
|
1161
|
+
* than a fourth copy. */
|
|
1162
|
+
type Event = z.infer<typeof EventSchema>;
|
|
439
1163
|
|
|
440
1164
|
/**
|
|
441
1165
|
* Source-side PII scrubbing for event payloads (SPEC §7).
|
|
@@ -666,19 +1390,6 @@ declare class HttpSink implements Sink {
|
|
|
666
1390
|
* generated corpus — for the same reason: one person reaching two SDKs must be one
|
|
667
1391
|
* actor downstream, and nothing but a differential corpus can prove it.
|
|
668
1392
|
*/
|
|
669
|
-
/** The HMAC KEY GENERATION, and nothing else.
|
|
670
|
-
*
|
|
671
|
-
* It is not a provenance marker and not a privacy classifier. Provenance is
|
|
672
|
-
* `PrincipalWire.source` and the classification is `PrincipalWire.form`, and
|
|
673
|
-
* both ride every mode — including `"raw"`, where no tag exists at all, which
|
|
674
|
-
* is the gap a tag can structurally never close. `h2:` is reserved for a key
|
|
675
|
-
* rotation. SPEC §11.4 and the §13 entry carry the full derivation.
|
|
676
|
-
*
|
|
677
|
-
* ⚠ **This value is a WIRE CONSTANT.** `test/identity.test.ts` pins it against
|
|
678
|
-
* Python's generated corpus by literal, not through this name — an assertion
|
|
679
|
-
* written as ``startsWith(`${HASH_SCHEME}:`)`` is self-referential and cannot
|
|
680
|
-
* see this constant change. */
|
|
681
|
-
declare const HASH_SCHEME = "h1";
|
|
682
1393
|
/** Where a principal came from. `"asserted"` is a vendor's own resolver,
|
|
683
1394
|
* which nothing in the protocol checks, and is the only value this SDK
|
|
684
1395
|
* emits — `integrations/mcp/principalResolution.ts` has the why, and the
|
|
@@ -707,11 +1418,9 @@ interface Principal {
|
|
|
707
1418
|
*
|
|
708
1419
|
* `tenantId` is folded into the HMAC MESSAGE (not just the key) so the same
|
|
709
1420
|
* principal under two tenants can never collide or be cross-tenant-correlated.
|
|
710
|
-
* Returns
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
* `(tenantId, principal, issuer)` is identical under every scheme and only the
|
|
714
|
-
* prefix moves. What that buys is in `HASH_SCHEME`.
|
|
1421
|
+
* Returns the BARE lowercase hex digest — no tag, no prefix, no scheme. It
|
|
1422
|
+
* returned `"h1:<hex>"` until 0.4.1; the tag was never part of the HMAC
|
|
1423
|
+
* message, so taking it off moved no digit of the digest.
|
|
715
1424
|
*
|
|
716
1425
|
* ⚠ **`issuer` null/undefined MUST hash byte-identically to the pre-issuer
|
|
717
1426
|
* form** — the append-only message layout is what guarantees it, and every
|
|
@@ -721,18 +1430,6 @@ declare function hashPrincipalId(rawPrincipal: string, options: {
|
|
|
721
1430
|
tenantId: string;
|
|
722
1431
|
key: Uint8Array | string;
|
|
723
1432
|
issuer?: string | null | undefined;
|
|
724
|
-
/** The key generation, defaulting to the current one exactly as Python's
|
|
725
|
-
* does. A caller passes this only to reproduce a digest under a
|
|
726
|
-
* superseded key.
|
|
727
|
-
*
|
|
728
|
-
* `| undefined` explicitly, for the same `exactOptionalPropertyTypes`
|
|
729
|
-
* reason `issuer` carries above — and it bites HARDER here, because this
|
|
730
|
-
* option exists precisely to be omittable. Without it the natural vendor
|
|
731
|
-
* shape, forwarding an optional off their own config
|
|
732
|
-
* (`scheme: cfg.scheme` where `cfg.scheme: string | undefined`), is a
|
|
733
|
-
* compile error on the published types. No in-repo caller can see that:
|
|
734
|
-
* they either omit it or pass a concrete string from the corpus. */
|
|
735
|
-
scheme?: string | undefined;
|
|
736
1433
|
}): string;
|
|
737
1434
|
|
|
738
1435
|
/** `BatonConfig.resolvePrincipal` — the ASSERTED identity provenance.
|
|
@@ -745,12 +1442,14 @@ declare function hashPrincipalId(rawPrincipal: string, options: {
|
|
|
745
1442
|
* **Hook only — there is deliberately no ATTESTED rung here yet**, so every
|
|
746
1443
|
* principal this SDK emits carries `source: "asserted"`.
|
|
747
1444
|
*
|
|
748
|
-
* ⚠ **The missing rung
|
|
749
|
-
*
|
|
750
|
-
*
|
|
751
|
-
*
|
|
752
|
-
*
|
|
753
|
-
*
|
|
1445
|
+
* ⚠ **The missing rung has no shape on the value, and never will again.** This
|
|
1446
|
+
* note said "saying `no h1: rung` would be false, because this SDK does emit
|
|
1447
|
+
* `h1:`" — true until 0.4.1, when the tag came off the value entirely (SPEC
|
|
1448
|
+
* §11.4, §13 entry 0.8.11). A hashed principal is now the bare digest, so there
|
|
1449
|
+
* is no prefix to be right or wrong about: the missing thing is the
|
|
1450
|
+
* `source: "attested"` VALUE, and a consumer reads `source` to learn it. SPEC
|
|
1451
|
+
* §11.4 forbids presenting an asserted principal as verified, and this arm has
|
|
1452
|
+
* only asserted to present.
|
|
754
1453
|
*
|
|
755
1454
|
* Python reads `claims["sub"]` off a verified access token; TypeScript's
|
|
756
1455
|
* `AuthInfo` has no `claims` field at all (it is
|
|
@@ -794,6 +1493,19 @@ interface PrincipalResolutionContext {
|
|
|
794
1493
|
* means "no opinion about this caller", which is not an error. */
|
|
795
1494
|
type ResolvePrincipalHook = (context: PrincipalResolutionContext) => Principal | null | Promise<Principal | null>;
|
|
796
1495
|
|
|
1496
|
+
/** The registered values of `resultCaptureMode` (SPEC §11.4), and the single
|
|
1497
|
+
* source of truth for them.
|
|
1498
|
+
*
|
|
1499
|
+
* Shaped after `identity.ts`'s `FORM_BY_MODE` → `PRINCIPAL_ID_MODES`, whose
|
|
1500
|
+
* own note says why: a second hand-written list makes the guarantee "two lists
|
|
1501
|
+
* happen to agree", which is the prose-shaped binding that pattern exists to
|
|
1502
|
+
* replace. `config.ts` builds its validator set from THIS array rather than
|
|
1503
|
+
* restating the literals, so a mode cannot be accepted at the door without
|
|
1504
|
+
* someone having given it a payload shape below. */
|
|
1505
|
+
declare const RESULT_CAPTURE_MODES: readonly ["full", "off"];
|
|
1506
|
+
/** What a vendor may set. Derived, so the type and the registry cannot drift. */
|
|
1507
|
+
type ResultCaptureMode = (typeof RESULT_CAPTURE_MODES)[number];
|
|
1508
|
+
|
|
797
1509
|
/**
|
|
798
1510
|
* `BatonConfig` — vendor-side configuration for `withBaton`. A trimmed
|
|
799
1511
|
* mirror of `baton` (Python)'s `integrations/_config.py::VendorConfig`.
|
|
@@ -902,6 +1614,32 @@ interface BatonConfig {
|
|
|
902
1614
|
* nothing. A tool registered with no `inputSchema` at all is left alone
|
|
903
1615
|
* regardless of this setting (see `schemaCompat.injectGoalParams`). */
|
|
904
1616
|
intentParamMode?: "optional" | "required" | "off";
|
|
1617
|
+
/** Whether tool RESPONSE data is captured at all (SPEC §11.4).
|
|
1618
|
+
*
|
|
1619
|
+
* `"full"` (the default) captures as it always has. `"off"` means nothing
|
|
1620
|
+
* **derived from what your tool returns** leaves this process: no `result` on
|
|
1621
|
+
* `tool_call_end` or `tool_call_error`, and no `error_body` on the
|
|
1622
|
+
* returned-failure shape, where that text is unwrapped from the result. Each
|
|
1623
|
+
* affected event carries `result_capture: "off"`, so a reader has a FACT
|
|
1624
|
+
* rather than an absence to guess from — without it a missing result is
|
|
1625
|
+
* indistinguishable from "the tool returned nothing", and a consumer
|
|
1626
|
+
* manufactures a failure that never happened.
|
|
1627
|
+
*
|
|
1628
|
+
* **Requests are unaffected**: `params` are captured in both modes.
|
|
1629
|
+
*
|
|
1630
|
+
* ⚠ The message of an error your handler THROWS is KEPT — it is your own code
|
|
1631
|
+
* speaking about a call that never returned, so it is not result-derived
|
|
1632
|
+
* (SPEC §11.4.3). Thrown messages are a classic leak channel; if that is also
|
|
1633
|
+
* a problem for you, say so and the mode grows a stricter value.
|
|
1634
|
+
*
|
|
1635
|
+
* Not a scrubber rule, deliberately (SPEC §7): a scrubber TRANSFORMS a value
|
|
1636
|
+
* that still crosses the network, this DECLARES that nothing crosses. Under
|
|
1637
|
+
* `"off"` the scrubber is never invoked on the result at all.
|
|
1638
|
+
*
|
|
1639
|
+
* What it costs you, and the rest of the reasoning: README, "Not capturing
|
|
1640
|
+
* responses at all". Kept there rather than repeated here — the two copies
|
|
1641
|
+
* had already drifted apart in wording by the time this was written. */
|
|
1642
|
+
resultCaptureMode?: ResultCaptureMode;
|
|
905
1643
|
/** Per-request principal identity — the ASSERTED provenance behind the
|
|
906
1644
|
* envelope's `principal` (SPEC §11.4 rung 0), which emits
|
|
907
1645
|
* `source: "asserted"`. It is the only provenance this SDK has.
|
|
@@ -1064,4 +1802,4 @@ interface SupportedMcpServer {
|
|
|
1064
1802
|
/** Install Baton into an `McpServer`. See module docstring for usage. */
|
|
1065
1803
|
declare function withBaton(server: SupportedMcpServer, supplied?: BatonConfig): BatonHandle;
|
|
1066
1804
|
|
|
1067
|
-
export { type AnnotationEvent, AnnotationEventSchema, type AnnotationPayload, AnnotationPayloadSchema, type BatonConfig, BatonHandle, DEFAULT_CONSENT_TOKEN, DEPTH_LIMIT, type Event, EventSchema, type EventType, EventTypeSchema,
|
|
1805
|
+
export { type AnnotationEvent, AnnotationEventSchema, type AnnotationPayload, AnnotationPayloadSchema, type BatonConfig, BatonHandle, DEFAULT_CONSENT_TOKEN, DEPTH_LIMIT, type Event, EventSchema, type EventType, EventTypeSchema, HttpSink, type HttpSinkOptions, PRINCIPAL_FORM_HASHED, PRINCIPAL_FORM_RAW, PRINCIPAL_SOURCE_ASSERTED, type Principal, type PrincipalIdMode, type PrincipalResolutionContext, PrincipalWireSchema, type PromptGetEndEvent, PromptGetEndEventSchema, type PromptGetEndPayload, PromptGetEndPayloadSchema, type PromptGetErrorEvent, PromptGetErrorEventSchema, type PromptGetErrorPayload, PromptGetErrorPayloadSchema, type PromptGetStartEvent, PromptGetStartEventSchema, type PromptGetStartPayload, PromptGetStartPayloadSchema, type PromptListEndEvent, PromptListEndEventSchema, type PromptListEndPayload, PromptListEndPayloadSchema, type PromptListErrorEvent, PromptListErrorEventSchema, type PromptListErrorPayload, PromptListErrorPayloadSchema, type PromptListStartEvent, PromptListStartEventSchema, type PromptListStartPayload, PromptListStartPayloadSchema, type ResolvePrincipalHook, type ResourceListEndEvent, ResourceListEndEventSchema, type ResourceListEndPayload, ResourceListEndPayloadSchema, type ResourceListErrorEvent, ResourceListErrorEventSchema, type ResourceListErrorPayload, ResourceListErrorPayloadSchema, type ResourceListStartEvent, ResourceListStartEventSchema, type ResourceListStartPayload, ResourceListStartPayloadSchema, type ResourceReadEndEvent, ResourceReadEndEventSchema, type ResourceReadEndPayload, ResourceReadEndPayloadSchema, type ResourceReadErrorEvent, ResourceReadErrorEventSchema, type ResourceReadErrorPayload, ResourceReadErrorPayloadSchema, type ResourceReadStartEvent, ResourceReadStartEventSchema, type ResourceReadStartPayload, ResourceReadStartPayloadSchema, type ResultCaptureMode, SDK_VERSION, Scrubber, type Sink, StdoutSink, type StdoutSinkOptions, type SupportedMcpServer, type SurfaceSnapshotEvent, SurfaceSnapshotEventSchema, type SurfaceSnapshotPayload, SurfaceSnapshotPayloadSchema, type ToolCallEndEvent, ToolCallEndEventSchema, type ToolCallEndPayload, ToolCallEndPayloadSchema, type ToolCallErrorEvent, ToolCallErrorEventSchema, type ToolCallErrorPayload, ToolCallErrorPayloadSchema, type ToolCallStartEvent, ToolCallStartEventSchema, type ToolCallStartPayload, ToolCallStartPayloadSchema, hashPrincipalId, identityScrub, safeWrite, withBaton };
|