@withgateway/sdk 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +24 -8
  2. package/dist/cli.js +2695 -657
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +2675 -637
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/files/index.d.mts +1 -0
  7. package/dist/files/index.d.ts +1 -0
  8. package/dist/files/index.js +1443 -36
  9. package/dist/files/index.js.map +1 -1
  10. package/dist/files/index.mjs +1441 -28
  11. package/dist/files/index.mjs.map +1 -1
  12. package/dist/{index-Cz8Q6Keo.d.mts → index-D6oi1TWE.d.mts} +93 -34
  13. package/dist/{index-BO2SNSgy.d.ts → index-DAb-FCMg.d.ts} +93 -34
  14. package/dist/index.d.mts +4 -3
  15. package/dist/index.d.ts +4 -3
  16. package/dist/index.js +1986 -235
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +1941 -218
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/media-CbcAfQvd.d.mts +83 -0
  21. package/dist/media-CbcAfQvd.d.ts +83 -0
  22. package/dist/traces/index.d.mts +1 -0
  23. package/dist/traces/index.d.ts +1 -0
  24. package/dist/traces/index.js +1440 -33
  25. package/dist/traces/index.js.map +1 -1
  26. package/dist/traces/index.mjs +1438 -25
  27. package/dist/traces/index.mjs.map +1 -1
  28. package/dist/tracing/index.d.mts +2 -1
  29. package/dist/tracing/index.d.ts +2 -1
  30. package/dist/tracing/index.js +512 -11
  31. package/dist/tracing/index.js.map +1 -1
  32. package/dist/tracing/index.mjs +501 -10
  33. package/dist/tracing/index.mjs.map +1 -1
  34. package/dist/worlds/index.d.mts +614 -25
  35. package/dist/worlds/index.d.ts +614 -25
  36. package/dist/worlds/index.js +1923 -214
  37. package/dist/worlds/index.js.map +1 -1
  38. package/dist/worlds/index.mjs +1910 -201
  39. package/dist/worlds/index.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/runtime/gatewaysdk/environment/_toml.py +3 -10
  42. package/runtime/gatewaysdk/environment/schema/api.py +38 -56
  43. package/runtime/gatewaysdk/environment/schema/grading.py +1 -5
  44. package/runtime/gatewaysdk/environment/schema/host.py +53 -90
  45. package/runtime/gatewaysdk/environment/schema/local.py +15 -7
  46. package/runtime/gatewaysdk/environment/schema/runtime.py +9 -9
  47. package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +3 -3
  48. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +1 -1
  49. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +18 -18
  50. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +4 -2
  51. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +5 -1
  52. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/new-world-sandbox.md +5 -3
  53. package/runtime/gatewaysdk/environment/schema/store.py +15 -6
  54. package/runtime/gatewaysdk/environment/schema/tasks.py +25 -1
  55. package/skills/benchmarks-getting-started/SKILL.md +3 -3
  56. package/skills/connector-schema-authoring/SKILL.md +1 -1
  57. package/skills/connector-schema-authoring/world-schema.md +1 -1
  58. package/skills/worlds-getting-started/SKILL.md +18 -18
  59. package/skills/worlds-getting-started/references/cli-mcp-map.md +4 -2
  60. package/skills/worlds-getting-started/references/gotchas.md +5 -1
  61. package/skills/worlds-getting-started/references/new-world-sandbox.md +5 -3
@@ -1,6 +1,7 @@
1
1
  import { Context, Tracer } from '@opentelemetry/api';
2
2
  import { ScoresClient } from './scores/index.mjs';
3
3
  import { SpanProcessor, Span, ReadableSpan } from '@opentelemetry/sdk-trace-base';
4
+ import { M as MAX_MEDIA_BYTES, f as MediaField, g as MediaReference, h as MediaUploadError, i as MediaUploader } from './media-CbcAfQvd.mjs';
4
5
 
5
6
  /**
6
7
  * End-user identity for GatewaySDK tracing.
@@ -295,49 +296,38 @@ declare function isInitialized(): boolean;
295
296
  */
296
297
  declare function isGatewayConfigured(): boolean;
297
298
 
298
- /**
299
- * Session grouping for GatewaySDK tracing.
300
- *
301
- * Mirrors the Python SDK's `gatewaysdk.tracing.session()` context manager
302
- * (gatewaysdk/tracing/context.py): every trace recorded inside the block
303
- * carries the same session id, so auto-instrumented LLM calls and tool
304
- * spans are grouped into one session without threading the id through
305
- * application code.
306
- *
307
- * The TS tracing package has no ContextVar/context-manager mechanism of its
308
- * own — the identity half (`identify()` / `IdentitySpanProcessor` in
309
- * identity.ts) is the closest analogue, so this follows the same shape: an
310
- * AsyncLocalStorage the current async context reads, and a SpanProcessor
311
- * that stamps it onto every span at start.
312
- */
313
-
314
299
  declare const SESSION_ID_ATTRIBUTE = "gateway.session.id";
315
- /** The ambient session id set by the innermost enclosing `withSession()`
316
- * call, or `undefined` outside one. */
300
+ declare const WORLD_SESSION_ID_ATTRIBUTE = "gateway.trace.metadata.world_session_id";
301
+ /** The session id set by the innermost enclosing `withSession()`, or `undefined`. */
317
302
  declare function getAmbientSessionId(): string | undefined;
303
+ /** The live world session the current code is working in, or `undefined`. */
304
+ declare function getCurrentWorldSessionId(): string | undefined;
318
305
  /**
319
- * Group every trace recorded inside `fn` under one session id — the TS
320
- * twin of the Python SDK's `with tracing.session(session_id): ...`.
306
+ * Group every trace recorded inside `fn` under one session id — the twin of
307
+ * the Python SDK's `with tracing.session(session_id): ...`. Auto-instrumented
308
+ * spans are grouped too; the innermost session wins.
321
309
  *
322
310
  * ```typescript
323
- * import { withSession } from "@withgateway/sdk/tracing";
324
- *
325
311
  * await withSession("checkout-regression-001", async () => {
326
- * await observe("turn-1", async () => { ... }); // carries the session id
312
+ * await observe("turn-1", async () => { ... });
327
313
  * });
328
314
  * ```
329
- *
330
- * Works via AsyncLocalStorage, so it groups auto-instrumented spans too;
331
- * nesting is fine — the innermost session wins for the code that runs
332
- * inside it, the same as Python's context propagation.
333
315
  */
334
316
  declare function withSession<T>(sessionId: string, fn: () => T | Promise<T>): Promise<T>;
335
317
  /**
336
- * Stamps the ambient session id (set by `withSession()`) on every span at
337
- * start. Registered automatically by `tracing.init()`/`initIsolated()`,
338
- * alongside `IdentitySpanProcessor`. An explicit
339
- * `setAttribute(SESSION_ID_ATTRIBUTE, ...)` call after span start wins over
340
- * this ambient default — same rule as `IdentitySpanProcessor`.
318
+ * Trace `fn` as work inside one live world session: spans take the world
319
+ * session's id as their session id and carry `world_session_id` trace
320
+ * metadata. A `withSession()` block inside still wins for the session id;
321
+ * the metadata stays. Without `tracing.init()` nothing is recorded. Twin of
322
+ * Python's `tracing.context.world_session`; callers use
323
+ * `WorldSession.withTraceContext(fn)`.
324
+ */
325
+ declare function withWorldSession<T>(worldSessionId: string, fn: () => T | Promise<T>): Promise<T>;
326
+ /**
327
+ * Stamps the session id and world session id on every span at start.
328
+ * Registered by `tracing.init()`/`initIsolated()`. A session id the span was
329
+ * started with (or is given after it starts) wins over the innermost
330
+ * `withSession()` / `withWorldSession()` block, as in the Python SDK.
341
331
  */
342
332
  declare class SessionSpanProcessor implements SpanProcessor {
343
333
  onStart(span: Span, _parentContext: Context): void;
@@ -346,6 +336,62 @@ declare class SessionSpanProcessor implements SpanProcessor {
346
336
  forceFlush(): Promise<void>;
347
337
  }
348
338
 
339
+ /**
340
+ * Credentials a caller hands a model SDK (an MCP server's `authorization_token`), kept out of every
341
+ * exported span. Twin of `gatewaysdk/tracing/secrets.py`; both run
342
+ * `fixtures/tracing/span-secret-vectors.json`.
343
+ */
344
+
345
+ declare const SECRET_KEYS: ReadonlySet<string>;
346
+ type Attributes = Record<string, unknown>;
347
+ /**
348
+ * Which keys are credentials, and how to keep them out of a span attribute. An attribute whose name
349
+ * contains a key is dropped. An attribute whose value names a key is exported only when the key can
350
+ * be removed as a JSON object key (at any depth, also inside a JSON string nested in JSON) and then
351
+ * neither the name nor any value removed under it (`MIN_SECRET_LENGTH` or longer) appears anywhere
352
+ * in it. Any other attribute that names a key (a cut or non-JSON string, a repr, a query string, a
353
+ * pair list, a command line, prose) is replaced whole by `REDACTED`: no rule can know where every
354
+ * rendering of the value sits beside its name. A removed value withholds the attribute in its
355
+ * percent-encoded or JSON-escaped form too, and a value that cannot be scrubbed for any reason is
356
+ * withheld whole. Attributes that name no key are exported untouched.
357
+ */
358
+ declare class SpanSecrets {
359
+ readonly keys: ReadonlySet<string>;
360
+ constructor(keys?: ReadonlySet<string>);
361
+ isSecret(key: string): boolean;
362
+ drops(attribute: string): boolean;
363
+ strip(value: unknown): unknown;
364
+ scrubAttribute(value: unknown): unknown;
365
+ private scrubbedValue;
366
+ scrubAttributes(attributes: Attributes): Attributes;
367
+ private mentions;
368
+ private scrubbedText;
369
+ private cleaned;
370
+ private carries;
371
+ private removed;
372
+ private stripNested;
373
+ }
374
+ /**
375
+ * Wraps a span processor so every read it makes, at start or at end, is without the credentials
376
+ * `SpanSecrets` names in the span's attributes, event attributes or status message, whichever
377
+ * instrumentor recorded them. `tracing.init()` puts one in front of its exporter and every custom
378
+ * processor. A span that cannot be scrubbed at end is dropped rather than exported as it was.
379
+ */
380
+ declare class SecretRedactingSpanProcessor implements SpanProcessor {
381
+ private readonly inner;
382
+ private readonly secrets;
383
+ constructor(inner: SpanProcessor, secrets?: SpanSecrets);
384
+ private readonly views;
385
+ onStart(span: Span, parentContext: Context): void;
386
+ onEnd(span: ReadableSpan): void;
387
+ private viewFor;
388
+ forceFlush(): Promise<void>;
389
+ shutdown(): Promise<void>;
390
+ private scrubbedAttributes;
391
+ private scrubbedStatus;
392
+ private scrubbedEvent;
393
+ }
394
+
349
395
  type ObservationKind = "AGENT" | "CHAIN" | "TOOL" | "LLM" | "RETRIEVER";
350
396
  interface ObserveOptions {
351
397
  /** Recorded as input.value on the span (JSON-stringified if not a string). */
@@ -524,18 +570,30 @@ declare function observeClaude(stream: AsyncIterable<any>, options: ObserveClaud
524
570
  type _tracingModule_IdentifyOptions = IdentifyOptions;
525
571
  type _tracingModule_IdentitySpanProcessor = IdentitySpanProcessor;
526
572
  declare const _tracingModule_IdentitySpanProcessor: typeof IdentitySpanProcessor;
573
+ declare const _tracingModule_MAX_MEDIA_BYTES: typeof MAX_MEDIA_BYTES;
574
+ declare const _tracingModule_MediaField: typeof MediaField;
575
+ declare const _tracingModule_MediaReference: typeof MediaReference;
576
+ declare const _tracingModule_MediaUploadError: typeof MediaUploadError;
577
+ declare const _tracingModule_MediaUploader: typeof MediaUploader;
527
578
  type _tracingModule_ObservationKind = ObservationKind;
528
579
  type _tracingModule_ObserveClaudeOptions = ObserveClaudeOptions;
529
580
  type _tracingModule_ObserveOptions = ObserveOptions;
581
+ declare const _tracingModule_SECRET_KEYS: typeof SECRET_KEYS;
530
582
  declare const _tracingModule_SESSION_ID_ATTRIBUTE: typeof SESSION_ID_ATTRIBUTE;
583
+ type _tracingModule_SecretRedactingSpanProcessor = SecretRedactingSpanProcessor;
584
+ declare const _tracingModule_SecretRedactingSpanProcessor: typeof SecretRedactingSpanProcessor;
531
585
  type _tracingModule_SessionSpanProcessor = SessionSpanProcessor;
532
586
  declare const _tracingModule_SessionSpanProcessor: typeof SessionSpanProcessor;
587
+ type _tracingModule_SpanSecrets = SpanSecrets;
588
+ declare const _tracingModule_SpanSecrets: typeof SpanSecrets;
533
589
  type _tracingModule_TracingConfig = TracingConfig;
534
590
  type _tracingModule_TracingHandle = TracingHandle;
535
591
  type _tracingModule_TracingState = TracingState;
536
592
  declare const _tracingModule_USER_ID_ATTRIBUTE: typeof USER_ID_ATTRIBUTE;
593
+ declare const _tracingModule_WORLD_SESSION_ID_ATTRIBUTE: typeof WORLD_SESSION_ID_ATTRIBUTE;
537
594
  declare const _tracingModule_flush: typeof flush;
538
595
  declare const _tracingModule_getAmbientSessionId: typeof getAmbientSessionId;
596
+ declare const _tracingModule_getCurrentWorldSessionId: typeof getCurrentWorldSessionId;
539
597
  declare const _tracingModule_identify: typeof identify;
540
598
  declare const _tracingModule_init: typeof init;
541
599
  declare const _tracingModule_initIsolated: typeof initIsolated;
@@ -549,8 +607,9 @@ declare const _tracingModule_resetAmbientUser: typeof resetAmbientUser;
549
607
  declare const _tracingModule_resolveUserId: typeof resolveUserId;
550
608
  declare const _tracingModule_shutdown: typeof shutdown;
551
609
  declare const _tracingModule_withSession: typeof withSession;
610
+ declare const _tracingModule_withWorldSession: typeof withWorldSession;
552
611
  declare namespace _tracingModule {
553
- export { type _tracingModule_IdentifyOptions as IdentifyOptions, _tracingModule_IdentitySpanProcessor as IdentitySpanProcessor, type _tracingModule_ObservationKind as ObservationKind, type _tracingModule_ObserveClaudeOptions as ObserveClaudeOptions, type _tracingModule_ObserveOptions as ObserveOptions, _tracingModule_SESSION_ID_ATTRIBUTE as SESSION_ID_ATTRIBUTE, _tracingModule_SessionSpanProcessor as SessionSpanProcessor, type _tracingModule_TracingConfig as TracingConfig, type _tracingModule_TracingHandle as TracingHandle, type _tracingModule_TracingState as TracingState, _tracingModule_USER_ID_ATTRIBUTE as USER_ID_ATTRIBUTE, _tracingModule_flush as flush, _tracingModule_getAmbientSessionId as getAmbientSessionId, _tracingModule_identify as identify, _tracingModule_init as init, _tracingModule_initIsolated as initIsolated, _tracingModule_isGatewayConfigured as isGatewayConfigured, _tracingModule_isInitialized as isInitialized, _tracingModule_observe as observe, _tracingModule_observeAnthropic as observeAnthropic, _tracingModule_observeClaude as observeClaude, _tracingModule_observeOpenAI as observeOpenAI, _tracingModule_resetAmbientUser as resetAmbientUser, _tracingModule_resolveUserId as resolveUserId, _tracingModule_shutdown as shutdown, _tracingModule_withSession as withSession };
612
+ export { type _tracingModule_IdentifyOptions as IdentifyOptions, _tracingModule_IdentitySpanProcessor as IdentitySpanProcessor, _tracingModule_MAX_MEDIA_BYTES as MAX_MEDIA_BYTES, _tracingModule_MediaField as MediaField, _tracingModule_MediaReference as MediaReference, _tracingModule_MediaUploadError as MediaUploadError, _tracingModule_MediaUploader as MediaUploader, type _tracingModule_ObservationKind as ObservationKind, type _tracingModule_ObserveClaudeOptions as ObserveClaudeOptions, type _tracingModule_ObserveOptions as ObserveOptions, _tracingModule_SECRET_KEYS as SECRET_KEYS, _tracingModule_SESSION_ID_ATTRIBUTE as SESSION_ID_ATTRIBUTE, _tracingModule_SecretRedactingSpanProcessor as SecretRedactingSpanProcessor, _tracingModule_SessionSpanProcessor as SessionSpanProcessor, _tracingModule_SpanSecrets as SpanSecrets, type _tracingModule_TracingConfig as TracingConfig, type _tracingModule_TracingHandle as TracingHandle, type _tracingModule_TracingState as TracingState, _tracingModule_USER_ID_ATTRIBUTE as USER_ID_ATTRIBUTE, _tracingModule_WORLD_SESSION_ID_ATTRIBUTE as WORLD_SESSION_ID_ATTRIBUTE, _tracingModule_flush as flush, _tracingModule_getAmbientSessionId as getAmbientSessionId, _tracingModule_getCurrentWorldSessionId as getCurrentWorldSessionId, _tracingModule_identify as identify, _tracingModule_init as init, _tracingModule_initIsolated as initIsolated, _tracingModule_isGatewayConfigured as isGatewayConfigured, _tracingModule_isInitialized as isInitialized, _tracingModule_observe as observe, _tracingModule_observeAnthropic as observeAnthropic, _tracingModule_observeClaude as observeClaude, _tracingModule_observeOpenAI as observeOpenAI, _tracingModule_resetAmbientUser as resetAmbientUser, _tracingModule_resolveUserId as resolveUserId, _tracingModule_shutdown as shutdown, _tracingModule_withSession as withSession, _tracingModule_withWorldSession as withWorldSession };
554
613
  }
555
614
 
556
- export { type IdentifyOptions as I, type ObservationKind as O, SESSION_ID_ATTRIBUTE as S, type TracingConfig as T, USER_ID_ATTRIBUTE as U, _tracingModule as _, IdentitySpanProcessor as a, type ObserveClaudeOptions as b, type ObserveOptions as c, SessionSpanProcessor as d, type TracingHandle as e, type TracingState as f, flush as g, getAmbientSessionId as h, identify as i, init as j, initIsolated as k, isGatewayConfigured as l, isInitialized as m, observeAnthropic as n, observe as o, observeClaude as p, observeOpenAI as q, resolveUserId as r, resetAmbientUser as s, shutdown as t, withSession as w };
615
+ export { type IdentifyOptions as I, type ObservationKind as O, SECRET_KEYS as S, type TracingConfig as T, USER_ID_ATTRIBUTE as U, WORLD_SESSION_ID_ATTRIBUTE as W, _tracingModule as _, IdentitySpanProcessor as a, type ObserveClaudeOptions as b, type ObserveOptions as c, SESSION_ID_ATTRIBUTE as d, SecretRedactingSpanProcessor as e, SessionSpanProcessor as f, SpanSecrets as g, type TracingHandle as h, identify as i, type TracingState as j, flush as k, getAmbientSessionId as l, getCurrentWorldSessionId as m, init as n, initIsolated as o, isGatewayConfigured as p, isInitialized as q, resolveUserId as r, observe as s, observeAnthropic as t, observeClaude as u, observeOpenAI as v, resetAmbientUser as w, shutdown as x, withSession as y, withWorldSession as z };
@@ -1,6 +1,7 @@
1
1
  import { Context, Tracer } from '@opentelemetry/api';
2
2
  import { ScoresClient } from './scores/index.js';
3
3
  import { SpanProcessor, Span, ReadableSpan } from '@opentelemetry/sdk-trace-base';
4
+ import { M as MAX_MEDIA_BYTES, f as MediaField, g as MediaReference, h as MediaUploadError, i as MediaUploader } from './media-CbcAfQvd.js';
4
5
 
5
6
  /**
6
7
  * End-user identity for GatewaySDK tracing.
@@ -295,49 +296,38 @@ declare function isInitialized(): boolean;
295
296
  */
296
297
  declare function isGatewayConfigured(): boolean;
297
298
 
298
- /**
299
- * Session grouping for GatewaySDK tracing.
300
- *
301
- * Mirrors the Python SDK's `gatewaysdk.tracing.session()` context manager
302
- * (gatewaysdk/tracing/context.py): every trace recorded inside the block
303
- * carries the same session id, so auto-instrumented LLM calls and tool
304
- * spans are grouped into one session without threading the id through
305
- * application code.
306
- *
307
- * The TS tracing package has no ContextVar/context-manager mechanism of its
308
- * own — the identity half (`identify()` / `IdentitySpanProcessor` in
309
- * identity.ts) is the closest analogue, so this follows the same shape: an
310
- * AsyncLocalStorage the current async context reads, and a SpanProcessor
311
- * that stamps it onto every span at start.
312
- */
313
-
314
299
  declare const SESSION_ID_ATTRIBUTE = "gateway.session.id";
315
- /** The ambient session id set by the innermost enclosing `withSession()`
316
- * call, or `undefined` outside one. */
300
+ declare const WORLD_SESSION_ID_ATTRIBUTE = "gateway.trace.metadata.world_session_id";
301
+ /** The session id set by the innermost enclosing `withSession()`, or `undefined`. */
317
302
  declare function getAmbientSessionId(): string | undefined;
303
+ /** The live world session the current code is working in, or `undefined`. */
304
+ declare function getCurrentWorldSessionId(): string | undefined;
318
305
  /**
319
- * Group every trace recorded inside `fn` under one session id — the TS
320
- * twin of the Python SDK's `with tracing.session(session_id): ...`.
306
+ * Group every trace recorded inside `fn` under one session id — the twin of
307
+ * the Python SDK's `with tracing.session(session_id): ...`. Auto-instrumented
308
+ * spans are grouped too; the innermost session wins.
321
309
  *
322
310
  * ```typescript
323
- * import { withSession } from "@withgateway/sdk/tracing";
324
- *
325
311
  * await withSession("checkout-regression-001", async () => {
326
- * await observe("turn-1", async () => { ... }); // carries the session id
312
+ * await observe("turn-1", async () => { ... });
327
313
  * });
328
314
  * ```
329
- *
330
- * Works via AsyncLocalStorage, so it groups auto-instrumented spans too;
331
- * nesting is fine — the innermost session wins for the code that runs
332
- * inside it, the same as Python's context propagation.
333
315
  */
334
316
  declare function withSession<T>(sessionId: string, fn: () => T | Promise<T>): Promise<T>;
335
317
  /**
336
- * Stamps the ambient session id (set by `withSession()`) on every span at
337
- * start. Registered automatically by `tracing.init()`/`initIsolated()`,
338
- * alongside `IdentitySpanProcessor`. An explicit
339
- * `setAttribute(SESSION_ID_ATTRIBUTE, ...)` call after span start wins over
340
- * this ambient default — same rule as `IdentitySpanProcessor`.
318
+ * Trace `fn` as work inside one live world session: spans take the world
319
+ * session's id as their session id and carry `world_session_id` trace
320
+ * metadata. A `withSession()` block inside still wins for the session id;
321
+ * the metadata stays. Without `tracing.init()` nothing is recorded. Twin of
322
+ * Python's `tracing.context.world_session`; callers use
323
+ * `WorldSession.withTraceContext(fn)`.
324
+ */
325
+ declare function withWorldSession<T>(worldSessionId: string, fn: () => T | Promise<T>): Promise<T>;
326
+ /**
327
+ * Stamps the session id and world session id on every span at start.
328
+ * Registered by `tracing.init()`/`initIsolated()`. A session id the span was
329
+ * started with (or is given after it starts) wins over the innermost
330
+ * `withSession()` / `withWorldSession()` block, as in the Python SDK.
341
331
  */
342
332
  declare class SessionSpanProcessor implements SpanProcessor {
343
333
  onStart(span: Span, _parentContext: Context): void;
@@ -346,6 +336,62 @@ declare class SessionSpanProcessor implements SpanProcessor {
346
336
  forceFlush(): Promise<void>;
347
337
  }
348
338
 
339
+ /**
340
+ * Credentials a caller hands a model SDK (an MCP server's `authorization_token`), kept out of every
341
+ * exported span. Twin of `gatewaysdk/tracing/secrets.py`; both run
342
+ * `fixtures/tracing/span-secret-vectors.json`.
343
+ */
344
+
345
+ declare const SECRET_KEYS: ReadonlySet<string>;
346
+ type Attributes = Record<string, unknown>;
347
+ /**
348
+ * Which keys are credentials, and how to keep them out of a span attribute. An attribute whose name
349
+ * contains a key is dropped. An attribute whose value names a key is exported only when the key can
350
+ * be removed as a JSON object key (at any depth, also inside a JSON string nested in JSON) and then
351
+ * neither the name nor any value removed under it (`MIN_SECRET_LENGTH` or longer) appears anywhere
352
+ * in it. Any other attribute that names a key (a cut or non-JSON string, a repr, a query string, a
353
+ * pair list, a command line, prose) is replaced whole by `REDACTED`: no rule can know where every
354
+ * rendering of the value sits beside its name. A removed value withholds the attribute in its
355
+ * percent-encoded or JSON-escaped form too, and a value that cannot be scrubbed for any reason is
356
+ * withheld whole. Attributes that name no key are exported untouched.
357
+ */
358
+ declare class SpanSecrets {
359
+ readonly keys: ReadonlySet<string>;
360
+ constructor(keys?: ReadonlySet<string>);
361
+ isSecret(key: string): boolean;
362
+ drops(attribute: string): boolean;
363
+ strip(value: unknown): unknown;
364
+ scrubAttribute(value: unknown): unknown;
365
+ private scrubbedValue;
366
+ scrubAttributes(attributes: Attributes): Attributes;
367
+ private mentions;
368
+ private scrubbedText;
369
+ private cleaned;
370
+ private carries;
371
+ private removed;
372
+ private stripNested;
373
+ }
374
+ /**
375
+ * Wraps a span processor so every read it makes, at start or at end, is without the credentials
376
+ * `SpanSecrets` names in the span's attributes, event attributes or status message, whichever
377
+ * instrumentor recorded them. `tracing.init()` puts one in front of its exporter and every custom
378
+ * processor. A span that cannot be scrubbed at end is dropped rather than exported as it was.
379
+ */
380
+ declare class SecretRedactingSpanProcessor implements SpanProcessor {
381
+ private readonly inner;
382
+ private readonly secrets;
383
+ constructor(inner: SpanProcessor, secrets?: SpanSecrets);
384
+ private readonly views;
385
+ onStart(span: Span, parentContext: Context): void;
386
+ onEnd(span: ReadableSpan): void;
387
+ private viewFor;
388
+ forceFlush(): Promise<void>;
389
+ shutdown(): Promise<void>;
390
+ private scrubbedAttributes;
391
+ private scrubbedStatus;
392
+ private scrubbedEvent;
393
+ }
394
+
349
395
  type ObservationKind = "AGENT" | "CHAIN" | "TOOL" | "LLM" | "RETRIEVER";
350
396
  interface ObserveOptions {
351
397
  /** Recorded as input.value on the span (JSON-stringified if not a string). */
@@ -524,18 +570,30 @@ declare function observeClaude(stream: AsyncIterable<any>, options: ObserveClaud
524
570
  type _tracingModule_IdentifyOptions = IdentifyOptions;
525
571
  type _tracingModule_IdentitySpanProcessor = IdentitySpanProcessor;
526
572
  declare const _tracingModule_IdentitySpanProcessor: typeof IdentitySpanProcessor;
573
+ declare const _tracingModule_MAX_MEDIA_BYTES: typeof MAX_MEDIA_BYTES;
574
+ declare const _tracingModule_MediaField: typeof MediaField;
575
+ declare const _tracingModule_MediaReference: typeof MediaReference;
576
+ declare const _tracingModule_MediaUploadError: typeof MediaUploadError;
577
+ declare const _tracingModule_MediaUploader: typeof MediaUploader;
527
578
  type _tracingModule_ObservationKind = ObservationKind;
528
579
  type _tracingModule_ObserveClaudeOptions = ObserveClaudeOptions;
529
580
  type _tracingModule_ObserveOptions = ObserveOptions;
581
+ declare const _tracingModule_SECRET_KEYS: typeof SECRET_KEYS;
530
582
  declare const _tracingModule_SESSION_ID_ATTRIBUTE: typeof SESSION_ID_ATTRIBUTE;
583
+ type _tracingModule_SecretRedactingSpanProcessor = SecretRedactingSpanProcessor;
584
+ declare const _tracingModule_SecretRedactingSpanProcessor: typeof SecretRedactingSpanProcessor;
531
585
  type _tracingModule_SessionSpanProcessor = SessionSpanProcessor;
532
586
  declare const _tracingModule_SessionSpanProcessor: typeof SessionSpanProcessor;
587
+ type _tracingModule_SpanSecrets = SpanSecrets;
588
+ declare const _tracingModule_SpanSecrets: typeof SpanSecrets;
533
589
  type _tracingModule_TracingConfig = TracingConfig;
534
590
  type _tracingModule_TracingHandle = TracingHandle;
535
591
  type _tracingModule_TracingState = TracingState;
536
592
  declare const _tracingModule_USER_ID_ATTRIBUTE: typeof USER_ID_ATTRIBUTE;
593
+ declare const _tracingModule_WORLD_SESSION_ID_ATTRIBUTE: typeof WORLD_SESSION_ID_ATTRIBUTE;
537
594
  declare const _tracingModule_flush: typeof flush;
538
595
  declare const _tracingModule_getAmbientSessionId: typeof getAmbientSessionId;
596
+ declare const _tracingModule_getCurrentWorldSessionId: typeof getCurrentWorldSessionId;
539
597
  declare const _tracingModule_identify: typeof identify;
540
598
  declare const _tracingModule_init: typeof init;
541
599
  declare const _tracingModule_initIsolated: typeof initIsolated;
@@ -549,8 +607,9 @@ declare const _tracingModule_resetAmbientUser: typeof resetAmbientUser;
549
607
  declare const _tracingModule_resolveUserId: typeof resolveUserId;
550
608
  declare const _tracingModule_shutdown: typeof shutdown;
551
609
  declare const _tracingModule_withSession: typeof withSession;
610
+ declare const _tracingModule_withWorldSession: typeof withWorldSession;
552
611
  declare namespace _tracingModule {
553
- export { type _tracingModule_IdentifyOptions as IdentifyOptions, _tracingModule_IdentitySpanProcessor as IdentitySpanProcessor, type _tracingModule_ObservationKind as ObservationKind, type _tracingModule_ObserveClaudeOptions as ObserveClaudeOptions, type _tracingModule_ObserveOptions as ObserveOptions, _tracingModule_SESSION_ID_ATTRIBUTE as SESSION_ID_ATTRIBUTE, _tracingModule_SessionSpanProcessor as SessionSpanProcessor, type _tracingModule_TracingConfig as TracingConfig, type _tracingModule_TracingHandle as TracingHandle, type _tracingModule_TracingState as TracingState, _tracingModule_USER_ID_ATTRIBUTE as USER_ID_ATTRIBUTE, _tracingModule_flush as flush, _tracingModule_getAmbientSessionId as getAmbientSessionId, _tracingModule_identify as identify, _tracingModule_init as init, _tracingModule_initIsolated as initIsolated, _tracingModule_isGatewayConfigured as isGatewayConfigured, _tracingModule_isInitialized as isInitialized, _tracingModule_observe as observe, _tracingModule_observeAnthropic as observeAnthropic, _tracingModule_observeClaude as observeClaude, _tracingModule_observeOpenAI as observeOpenAI, _tracingModule_resetAmbientUser as resetAmbientUser, _tracingModule_resolveUserId as resolveUserId, _tracingModule_shutdown as shutdown, _tracingModule_withSession as withSession };
612
+ export { type _tracingModule_IdentifyOptions as IdentifyOptions, _tracingModule_IdentitySpanProcessor as IdentitySpanProcessor, _tracingModule_MAX_MEDIA_BYTES as MAX_MEDIA_BYTES, _tracingModule_MediaField as MediaField, _tracingModule_MediaReference as MediaReference, _tracingModule_MediaUploadError as MediaUploadError, _tracingModule_MediaUploader as MediaUploader, type _tracingModule_ObservationKind as ObservationKind, type _tracingModule_ObserveClaudeOptions as ObserveClaudeOptions, type _tracingModule_ObserveOptions as ObserveOptions, _tracingModule_SECRET_KEYS as SECRET_KEYS, _tracingModule_SESSION_ID_ATTRIBUTE as SESSION_ID_ATTRIBUTE, _tracingModule_SecretRedactingSpanProcessor as SecretRedactingSpanProcessor, _tracingModule_SessionSpanProcessor as SessionSpanProcessor, _tracingModule_SpanSecrets as SpanSecrets, type _tracingModule_TracingConfig as TracingConfig, type _tracingModule_TracingHandle as TracingHandle, type _tracingModule_TracingState as TracingState, _tracingModule_USER_ID_ATTRIBUTE as USER_ID_ATTRIBUTE, _tracingModule_WORLD_SESSION_ID_ATTRIBUTE as WORLD_SESSION_ID_ATTRIBUTE, _tracingModule_flush as flush, _tracingModule_getAmbientSessionId as getAmbientSessionId, _tracingModule_getCurrentWorldSessionId as getCurrentWorldSessionId, _tracingModule_identify as identify, _tracingModule_init as init, _tracingModule_initIsolated as initIsolated, _tracingModule_isGatewayConfigured as isGatewayConfigured, _tracingModule_isInitialized as isInitialized, _tracingModule_observe as observe, _tracingModule_observeAnthropic as observeAnthropic, _tracingModule_observeClaude as observeClaude, _tracingModule_observeOpenAI as observeOpenAI, _tracingModule_resetAmbientUser as resetAmbientUser, _tracingModule_resolveUserId as resolveUserId, _tracingModule_shutdown as shutdown, _tracingModule_withSession as withSession, _tracingModule_withWorldSession as withWorldSession };
554
613
  }
555
614
 
556
- export { type IdentifyOptions as I, type ObservationKind as O, SESSION_ID_ATTRIBUTE as S, type TracingConfig as T, USER_ID_ATTRIBUTE as U, _tracingModule as _, IdentitySpanProcessor as a, type ObserveClaudeOptions as b, type ObserveOptions as c, SessionSpanProcessor as d, type TracingHandle as e, type TracingState as f, flush as g, getAmbientSessionId as h, identify as i, init as j, initIsolated as k, isGatewayConfigured as l, isInitialized as m, observeAnthropic as n, observe as o, observeClaude as p, observeOpenAI as q, resolveUserId as r, resetAmbientUser as s, shutdown as t, withSession as w };
615
+ export { type IdentifyOptions as I, type ObservationKind as O, SECRET_KEYS as S, type TracingConfig as T, USER_ID_ATTRIBUTE as U, WORLD_SESSION_ID_ATTRIBUTE as W, _tracingModule as _, IdentitySpanProcessor as a, type ObserveClaudeOptions as b, type ObserveOptions as c, SESSION_ID_ATTRIBUTE as d, SecretRedactingSpanProcessor as e, SessionSpanProcessor as f, SpanSecrets as g, type TracingHandle as h, identify as i, type TracingState as j, flush as k, getAmbientSessionId as l, getCurrentWorldSessionId as m, init as n, initIsolated as o, isGatewayConfigured as p, isInitialized as q, resolveUserId as r, observe as s, observeAnthropic as t, observeClaude as u, observeOpenAI as v, resetAmbientUser as w, shutdown as x, withSession as y, withWorldSession as z };
package/dist/index.d.mts CHANGED
@@ -7,12 +7,13 @@ export { GatewayAgentDescriptor, GatewaySecurity, GatewaySecurityConfig, Gateway
7
7
  export { DEFAULT_TIMEOUT_SECONDS, ENV_GATEWAY_HOST, ENV_GATEWAY_PUBLIC_KEY, ENV_GATEWAY_SECRET_KEY, LoadSessionOptions, SessionLoadError, SessionObservation, SessionRecording, SessionTrace, basicAuthHeader, loadSession, sessionObservationFromApi, sessions } from './sessions/index.mjs';
8
8
  export { UserEvent, UserEventOptions, UserProfile, UserProfileError, UserProfileUpdate, UsersClient, UsersClientConfig, UsersClientFromEnvConfig, users } from './users/index.mjs';
9
9
  export { AGENT_ID_KEY, SUCCESS_METRIC_NAME_KEY, SUCCESS_SIGNAL_KEY, ScoreDataType, ScoreError, ScoreOptions, ScoresClient, ScoresClientConfig, ScoresClientFromEnvConfig, SuccessOptions, currentTraceId, scores, success } from './scores/index.mjs';
10
- export { ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, BrowserActionEvent, BrowserActionRecorder, BrowserConnection, BrowserMode, BrowserPage, BrowserReconnected, BrowserReconnector, BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, Checkout, CheckoutProvenance, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, DispatchedRun, DryRunImageDecision, DryRunOutcome, DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, EditSessionCloseInput, EditSessionList, EditSessionListQuery, EditSessionResult, EditSessionRollbackInput, EditSessionSummary, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, HostedDryRunClient, HostedDryRunDispatch, HostedDryRunStatus, HostedDryRunVerdict, IDLE_WARNING_MINUTES, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, ListRunsFilter, ListSessionsFilter, LiveTaskSession, LocalMeta, MigrateWorldOptions, NO_GRADER_REASON, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RECOVER_BUDGET_MS, RecoveryResult, RedactMode, RedactPolicy, Redaction, RepairAnswer, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunSetOptions, RunSetResult, RunSummary, RunTaskOptions, RunTaskSummary, SESSION_STATES, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, SandboxChanges, SandboxCheckResult, SandboxCommitResult, SandboxExecResult, SandboxImportInput, SandboxImportPending, SandboxImportResult, SandboxListFilter, SandboxOpenExisting, SandboxOpenNew, SandboxOpenTarget, SandboxOpened, SandboxSummary, SecretScrubber, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SetRunDoc, SettleOptions, SlugDeclaration, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, VERIFIER_REWARD_PREFIX, ValidateReport, ValidatedRun, VerifierGrade, WHITESPACE, WorldBrowser, WorldCallTooLarge, WorldDependency, WorldDeprecation, WorldDescription, WorldEditClient, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionListItem, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVerifier, WorldTaskVerifierRow, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, isBrowserGone, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseErrorBody, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pushBranch, pushSlug, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, releaseConnection, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.mjs';
10
+ export { ACTION_NAMES, ActionArgs, ActionResult, ActionTracer, AiSdkAnthropicOutput, AiSdkComputerCall, AiSdkComputerOutput, AiSdkModelOutput, AnthropicComputer, AnthropicComputer20251124, AnthropicToolResult, ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, BrowserActionEvent, BrowserActionRecorder, BrowserConnection, BrowserMode, BrowserPage, BrowserReconnected, BrowserReconnector, BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, Checkout, CheckoutProvenance, ComputerAction, ComputerCallOutput, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, DispatchedRun, Display, DryRunImageDecision, DryRunOutcome, DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, EditSessionCloseInput, EditSessionList, EditSessionListQuery, EditSessionResult, EditSessionRollbackInput, EditSessionSummary, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, HostedDryRunClient, HostedDryRunDispatch, HostedDryRunStatus, HostedDryRunVerdict, IDLE_WARNING_MINUTES, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, KEY_NAMES, KeyChord, ListRunsFilter, ListSessionsFilter, LiveTaskSession, LocalMeta, MigrateWorldOptions, NOT_EXECUTED, NO_GRADER_REASON, NativeComputer, NativeComputerKinds, NativeComputerOptions, NativeComputerProvider, NativePage, ObservationConversion, ObservationLike, OpenAIComputer, OpenAIPreviewComputer, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, PendingSafetyChecks, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RECOVER_BUDGET_MS, RebaseConflictPath, RecoveryResult, RedactMode, RedactPolicy, Redaction, RepairAnswer, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunSetOptions, RunSetResult, RunSummary, RunTaskOptions, RunTaskSummary, SANDBOX_REQUEST_TIMEOUT_MS, SECRET_KEY, SESSION_STATES, SPAN_PREFIX, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, SafetyCheck, SandboxChanges, SandboxCheckResult, SandboxCommitInput, SandboxCommitResult, SandboxExecResult, SandboxImportInput, SandboxImportPending, SandboxImportResult, SandboxListFilter, SandboxOpenExisting, SandboxOpenNew, SandboxOpenTarget, SandboxOpened, SandboxSummary, Screen, ScreenBrowser, SecretScrubber, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SetRunDoc, SettleOptions, SlugDeclaration, TRANSFORMS, TaskEditClient, TaskEditCloseInput, TaskEditCloseResult, TaskEditRollbackInput, TaskEditRollbackResult, TaskEditSealed, TaskEditStatus, TaskEditTarget, TaskEditTaskRef, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldRef, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, VERIFIER_REWARD_PREFIX, ValidateReport, ValidatedRun, VerifierGrade, WHITESPACE, WorldBrowser, WorldCallTooLarge, WorldDependency, WorldDeprecation, WorldDescription, WorldEditClient, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionListItem, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVerifier, WorldTaskVerifierRow, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, isBrowserGone, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseErrorBody, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, playwrightKey, preserveForm, propose, pull, push, pushBranch, pushSlug, pyText, queryRows, queryRowsSearch, readField, readLocalMeta, readToolCallRecords, rebaseConflicts, redactActionArgs, redactionOf, releaseConnection, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, uncommittedPaths, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.mjs';
11
11
  export { i as files } from './index-FfK4Nump.mjs';
12
12
  export { i as traces } from './index-CiKWoroJ.mjs';
13
13
  export { i as hooks } from './index-C3UzD0G3.mjs';
14
- import { _ as _tracingModule } from './index-Cz8Q6Keo.mjs';
15
- export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-Cz8Q6Keo.mjs';
14
+ import { _ as _tracingModule } from './index-D6oi1TWE.mjs';
15
+ export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-D6oi1TWE.mjs';
16
+ export { P as PLATFORM_TIMEOUT_DEFAULT_MS, a as PLATFORM_TIMEOUT_ENV, b as PlatformEndpoint, c as PlatformMethod, d as PlatformReply, e as PlatformTransport, T as TransportCause, U as UnreachableError, p as platformTimeoutMs } from './media-CbcAfQvd.mjs';
16
17
  import 'async_hooks';
17
18
  import '@opentelemetry/api';
18
19
  import '@opentelemetry/sdk-trace-base';
package/dist/index.d.ts CHANGED
@@ -7,12 +7,13 @@ export { GatewayAgentDescriptor, GatewaySecurity, GatewaySecurityConfig, Gateway
7
7
  export { DEFAULT_TIMEOUT_SECONDS, ENV_GATEWAY_HOST, ENV_GATEWAY_PUBLIC_KEY, ENV_GATEWAY_SECRET_KEY, LoadSessionOptions, SessionLoadError, SessionObservation, SessionRecording, SessionTrace, basicAuthHeader, loadSession, sessionObservationFromApi, sessions } from './sessions/index.js';
8
8
  export { UserEvent, UserEventOptions, UserProfile, UserProfileError, UserProfileUpdate, UsersClient, UsersClientConfig, UsersClientFromEnvConfig, users } from './users/index.js';
9
9
  export { AGENT_ID_KEY, SUCCESS_METRIC_NAME_KEY, SUCCESS_SIGNAL_KEY, ScoreDataType, ScoreError, ScoreOptions, ScoresClient, ScoresClientConfig, ScoresClientFromEnvConfig, SuccessOptions, currentTraceId, scores, success } from './scores/index.js';
10
- export { ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, BrowserActionEvent, BrowserActionRecorder, BrowserConnection, BrowserMode, BrowserPage, BrowserReconnected, BrowserReconnector, BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, Checkout, CheckoutProvenance, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, DispatchedRun, DryRunImageDecision, DryRunOutcome, DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, EditSessionCloseInput, EditSessionList, EditSessionListQuery, EditSessionResult, EditSessionRollbackInput, EditSessionSummary, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, HostedDryRunClient, HostedDryRunDispatch, HostedDryRunStatus, HostedDryRunVerdict, IDLE_WARNING_MINUTES, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, ListRunsFilter, ListSessionsFilter, LiveTaskSession, LocalMeta, MigrateWorldOptions, NO_GRADER_REASON, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RECOVER_BUDGET_MS, RecoveryResult, RedactMode, RedactPolicy, Redaction, RepairAnswer, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunSetOptions, RunSetResult, RunSummary, RunTaskOptions, RunTaskSummary, SESSION_STATES, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, SandboxChanges, SandboxCheckResult, SandboxCommitResult, SandboxExecResult, SandboxImportInput, SandboxImportPending, SandboxImportResult, SandboxListFilter, SandboxOpenExisting, SandboxOpenNew, SandboxOpenTarget, SandboxOpened, SandboxSummary, SecretScrubber, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SetRunDoc, SettleOptions, SlugDeclaration, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, VERIFIER_REWARD_PREFIX, ValidateReport, ValidatedRun, VerifierGrade, WHITESPACE, WorldBrowser, WorldCallTooLarge, WorldDependency, WorldDeprecation, WorldDescription, WorldEditClient, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionListItem, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVerifier, WorldTaskVerifierRow, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, isBrowserGone, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseErrorBody, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pushBranch, pushSlug, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, releaseConnection, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.js';
10
+ export { ACTION_NAMES, ActionArgs, ActionResult, ActionTracer, AiSdkAnthropicOutput, AiSdkComputerCall, AiSdkComputerOutput, AiSdkModelOutput, AnthropicComputer, AnthropicComputer20251124, AnthropicToolResult, ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, BrowserActionEvent, BrowserActionRecorder, BrowserConnection, BrowserMode, BrowserPage, BrowserReconnected, BrowserReconnector, BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, Checkout, CheckoutProvenance, ComputerAction, ComputerCallOutput, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, DispatchedRun, Display, DryRunImageDecision, DryRunOutcome, DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, EditSessionCloseInput, EditSessionList, EditSessionListQuery, EditSessionResult, EditSessionRollbackInput, EditSessionSummary, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, HostedDryRunClient, HostedDryRunDispatch, HostedDryRunStatus, HostedDryRunVerdict, IDLE_WARNING_MINUTES, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, KEY_NAMES, KeyChord, ListRunsFilter, ListSessionsFilter, LiveTaskSession, LocalMeta, MigrateWorldOptions, NOT_EXECUTED, NO_GRADER_REASON, NativeComputer, NativeComputerKinds, NativeComputerOptions, NativeComputerProvider, NativePage, ObservationConversion, ObservationLike, OpenAIComputer, OpenAIPreviewComputer, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, PendingSafetyChecks, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RECOVER_BUDGET_MS, RebaseConflictPath, RecoveryResult, RedactMode, RedactPolicy, Redaction, RepairAnswer, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunSetOptions, RunSetResult, RunSummary, RunTaskOptions, RunTaskSummary, SANDBOX_REQUEST_TIMEOUT_MS, SECRET_KEY, SESSION_STATES, SPAN_PREFIX, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, SafetyCheck, SandboxChanges, SandboxCheckResult, SandboxCommitInput, SandboxCommitResult, SandboxExecResult, SandboxImportInput, SandboxImportPending, SandboxImportResult, SandboxListFilter, SandboxOpenExisting, SandboxOpenNew, SandboxOpenTarget, SandboxOpened, SandboxSummary, Screen, ScreenBrowser, SecretScrubber, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SetRunDoc, SettleOptions, SlugDeclaration, TRANSFORMS, TaskEditClient, TaskEditCloseInput, TaskEditCloseResult, TaskEditRollbackInput, TaskEditRollbackResult, TaskEditSealed, TaskEditStatus, TaskEditTarget, TaskEditTaskRef, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldRef, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, VERIFIER_REWARD_PREFIX, ValidateReport, ValidatedRun, VerifierGrade, WHITESPACE, WorldBrowser, WorldCallTooLarge, WorldDependency, WorldDeprecation, WorldDescription, WorldEditClient, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionListItem, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVerifier, WorldTaskVerifierRow, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, isBrowserGone, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseErrorBody, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, playwrightKey, preserveForm, propose, pull, push, pushBranch, pushSlug, pyText, queryRows, queryRowsSearch, readField, readLocalMeta, readToolCallRecords, rebaseConflicts, redactActionArgs, redactionOf, releaseConnection, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, uncommittedPaths, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.js';
11
11
  export { i as files } from './index-D-_4Ibcn.js';
12
12
  export { i as traces } from './index-BgvvQ3BC.js';
13
13
  export { i as hooks } from './index-C3UzD0G3.js';
14
- import { _ as _tracingModule } from './index-BO2SNSgy.js';
15
- export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-BO2SNSgy.js';
14
+ import { _ as _tracingModule } from './index-DAb-FCMg.js';
15
+ export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-DAb-FCMg.js';
16
+ export { P as PLATFORM_TIMEOUT_DEFAULT_MS, a as PLATFORM_TIMEOUT_ENV, b as PlatformEndpoint, c as PlatformMethod, d as PlatformReply, e as PlatformTransport, T as TransportCause, U as UnreachableError, p as platformTimeoutMs } from './media-CbcAfQvd.js';
16
17
  import 'async_hooks';
17
18
  import '@opentelemetry/api';
18
19
  import '@opentelemetry/sdk-trace-base';