@withgateway/sdk 0.2.9 → 0.3.1
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 +5 -1
- package/dist/cli.js +3812 -1158
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +3796 -1142
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.d.mts +1 -0
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1358 -21
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +1356 -13
- package/dist/files/index.mjs.map +1 -1
- package/dist/{index-BO2SNSgy.d.ts → index-CBqbB_0J.d.ts} +95 -46
- package/dist/{index-Cz8Q6Keo.d.mts → index-D-AMnAMa.d.mts} +95 -46
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1942 -177
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1890 -146
- package/dist/index.mjs.map +1 -1
- package/dist/media-CbcAfQvd.d.mts +83 -0
- package/dist/media-CbcAfQvd.d.ts +83 -0
- package/dist/traces/index.d.mts +1 -0
- package/dist/traces/index.d.ts +1 -0
- package/dist/traces/index.js +1355 -18
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +1353 -10
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.d.mts +2 -1
- package/dist/tracing/index.d.ts +2 -1
- package/dist/tracing/index.js +550 -30
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +539 -29
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +648 -80
- package/dist/worlds/index.d.ts +648 -80
- package/dist/worlds/index.js +1875 -145
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +1861 -131
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +1 -1
- package/runtime/gatewaysdk/environment/schema/api.py +43 -62
- package/runtime/gatewaysdk/environment/schema/cast.py +31 -4
- package/runtime/gatewaysdk/environment/schema/grading.py +1 -5
- package/runtime/gatewaysdk/environment/schema/host.py +53 -90
- package/runtime/gatewaysdk/environment/schema/local.py +15 -7
- package/runtime/gatewaysdk/environment/schema/platform.py +1 -7
- package/runtime/gatewaysdk/environment/schema/runtime.py +9 -9
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +3 -3
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +2 -2
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +13 -13
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +2 -1
- package/runtime/gatewaysdk/environment/schema/tasks.py +25 -1
- package/skills/connector-schema-authoring/SKILL.md +3 -3
- package/skills/connector-schema-authoring/connector-worlds.md +12 -5
- package/skills/connector-schema-authoring/world-schema.md +8 -0
- package/skills/world-data-ingestion/SKILL.md +2 -2
- package/skills/worlds-getting-started/SKILL.md +13 -13
- package/skills/worlds-getting-started/references/cli-mcp-map.md +2 -1
|
@@ -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.
|
|
@@ -170,15 +171,9 @@ interface TracingState {
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* This module provides the core init(), shutdown(), and flush() functions
|
|
176
|
-
* for managing the OpenTelemetry TracerProvider lifecycle, plus
|
|
177
|
-
* initIsolated() for creating additional self-contained providers (e.g. one
|
|
178
|
-
* process exporting different agents to different Gateway projects).
|
|
179
|
-
*
|
|
180
|
-
* Mirrors the Python SDK's tracing.init() for a consistent developer experience.
|
|
174
|
+
* Check if Gateway is configured via environment variables.
|
|
181
175
|
*/
|
|
176
|
+
declare function isGatewayConfigured(): boolean;
|
|
182
177
|
|
|
183
178
|
/**
|
|
184
179
|
* Handle to an isolated tracing provider created by initIsolated().
|
|
@@ -290,54 +285,39 @@ declare function shutdown(): Promise<void>;
|
|
|
290
285
|
* Check if tracing has been initialized.
|
|
291
286
|
*/
|
|
292
287
|
declare function isInitialized(): boolean;
|
|
293
|
-
/**
|
|
294
|
-
* Check if Gateway is configured via environment variables.
|
|
295
|
-
*/
|
|
296
|
-
declare function isGatewayConfigured(): boolean;
|
|
297
|
-
|
|
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
288
|
|
|
314
289
|
declare const SESSION_ID_ATTRIBUTE = "gateway.session.id";
|
|
315
|
-
|
|
316
|
-
|
|
290
|
+
declare const WORLD_SESSION_ID_ATTRIBUTE = "gateway.trace.metadata.world_session_id";
|
|
291
|
+
/** The session id set by the innermost enclosing `withSession()`, or `undefined`. */
|
|
317
292
|
declare function getAmbientSessionId(): string | undefined;
|
|
293
|
+
/** The live world session the current code is working in, or `undefined`. */
|
|
294
|
+
declare function getCurrentWorldSessionId(): string | undefined;
|
|
318
295
|
/**
|
|
319
|
-
* Group every trace recorded inside `fn` under one session id — the
|
|
320
|
-
*
|
|
296
|
+
* Group every trace recorded inside `fn` under one session id — the twin of
|
|
297
|
+
* the Python SDK's `with tracing.session(session_id): ...`. Auto-instrumented
|
|
298
|
+
* spans are grouped too; the innermost session wins.
|
|
321
299
|
*
|
|
322
300
|
* ```typescript
|
|
323
|
-
* import { withSession } from "@withgateway/sdk/tracing";
|
|
324
|
-
*
|
|
325
301
|
* await withSession("checkout-regression-001", async () => {
|
|
326
|
-
* await observe("turn-1", async () => { ... });
|
|
302
|
+
* await observe("turn-1", async () => { ... });
|
|
327
303
|
* });
|
|
328
304
|
* ```
|
|
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
305
|
*/
|
|
334
306
|
declare function withSession<T>(sessionId: string, fn: () => T | Promise<T>): Promise<T>;
|
|
335
307
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* `
|
|
340
|
-
*
|
|
308
|
+
* Trace `fn` as work inside one live world session: spans take the world
|
|
309
|
+
* session's id as their session id and carry `world_session_id` trace
|
|
310
|
+
* metadata. A `withSession()` block inside still wins for the session id;
|
|
311
|
+
* the metadata stays. Without `tracing.init()` nothing is recorded. Twin of
|
|
312
|
+
* Python's `tracing.context.world_session`; callers use
|
|
313
|
+
* `WorldSession.withTraceContext(fn)`.
|
|
314
|
+
*/
|
|
315
|
+
declare function withWorldSession<T>(worldSessionId: string, fn: () => T | Promise<T>): Promise<T>;
|
|
316
|
+
/**
|
|
317
|
+
* Stamps the session id and world session id on every span at start.
|
|
318
|
+
* Registered by `tracing.init()`/`initIsolated()`. A session id the span was
|
|
319
|
+
* started with (or is given after it starts) wins over the innermost
|
|
320
|
+
* `withSession()` / `withWorldSession()` block, as in the Python SDK.
|
|
341
321
|
*/
|
|
342
322
|
declare class SessionSpanProcessor implements SpanProcessor {
|
|
343
323
|
onStart(span: Span, _parentContext: Context): void;
|
|
@@ -346,6 +326,62 @@ declare class SessionSpanProcessor implements SpanProcessor {
|
|
|
346
326
|
forceFlush(): Promise<void>;
|
|
347
327
|
}
|
|
348
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Credentials a caller hands a model SDK (an MCP server's `authorization_token`), kept out of every
|
|
331
|
+
* exported span. Twin of `gatewaysdk/tracing/secrets.py`; both run
|
|
332
|
+
* `fixtures/tracing/span-secret-vectors.json`.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
declare const SECRET_KEYS: ReadonlySet<string>;
|
|
336
|
+
type Attributes = Record<string, unknown>;
|
|
337
|
+
/**
|
|
338
|
+
* Which keys are credentials, and how to keep them out of a span attribute. An attribute whose name
|
|
339
|
+
* contains a key is dropped. An attribute whose value names a key is exported only when the key can
|
|
340
|
+
* be removed as a JSON object key (at any depth, also inside a JSON string nested in JSON) and then
|
|
341
|
+
* neither the name nor any value removed under it (`MIN_SECRET_LENGTH` or longer) appears anywhere
|
|
342
|
+
* in it. Any other attribute that names a key (a cut or non-JSON string, a repr, a query string, a
|
|
343
|
+
* pair list, a command line, prose) is replaced whole by `REDACTED`: no rule can know where every
|
|
344
|
+
* rendering of the value sits beside its name. A removed value withholds the attribute in its
|
|
345
|
+
* percent-encoded or JSON-escaped form too, and a value that cannot be scrubbed for any reason is
|
|
346
|
+
* withheld whole. Attributes that name no key are exported untouched.
|
|
347
|
+
*/
|
|
348
|
+
declare class SpanSecrets {
|
|
349
|
+
readonly keys: ReadonlySet<string>;
|
|
350
|
+
constructor(keys?: ReadonlySet<string>);
|
|
351
|
+
isSecret(key: string): boolean;
|
|
352
|
+
drops(attribute: string): boolean;
|
|
353
|
+
strip(value: unknown): unknown;
|
|
354
|
+
scrubAttribute(value: unknown): unknown;
|
|
355
|
+
private scrubbedValue;
|
|
356
|
+
scrubAttributes(attributes: Attributes): Attributes;
|
|
357
|
+
private mentions;
|
|
358
|
+
private scrubbedText;
|
|
359
|
+
private cleaned;
|
|
360
|
+
private carries;
|
|
361
|
+
private removed;
|
|
362
|
+
private stripNested;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Wraps a span processor so every read it makes, at start or at end, is without the credentials
|
|
366
|
+
* `SpanSecrets` names in the span's attributes, event attributes or status message, whichever
|
|
367
|
+
* instrumentor recorded them. `tracing.init()` puts one in front of its exporter and every custom
|
|
368
|
+
* processor. A span that cannot be scrubbed at end is dropped rather than exported as it was.
|
|
369
|
+
*/
|
|
370
|
+
declare class SecretRedactingSpanProcessor implements SpanProcessor {
|
|
371
|
+
private readonly inner;
|
|
372
|
+
private readonly secrets;
|
|
373
|
+
constructor(inner: SpanProcessor, secrets?: SpanSecrets);
|
|
374
|
+
private readonly views;
|
|
375
|
+
onStart(span: Span, parentContext: Context): void;
|
|
376
|
+
onEnd(span: ReadableSpan): void;
|
|
377
|
+
private viewFor;
|
|
378
|
+
forceFlush(): Promise<void>;
|
|
379
|
+
shutdown(): Promise<void>;
|
|
380
|
+
private scrubbedAttributes;
|
|
381
|
+
private scrubbedStatus;
|
|
382
|
+
private scrubbedEvent;
|
|
383
|
+
}
|
|
384
|
+
|
|
349
385
|
type ObservationKind = "AGENT" | "CHAIN" | "TOOL" | "LLM" | "RETRIEVER";
|
|
350
386
|
interface ObserveOptions {
|
|
351
387
|
/** Recorded as input.value on the span (JSON-stringified if not a string). */
|
|
@@ -524,18 +560,30 @@ declare function observeClaude(stream: AsyncIterable<any>, options: ObserveClaud
|
|
|
524
560
|
type _tracingModule_IdentifyOptions = IdentifyOptions;
|
|
525
561
|
type _tracingModule_IdentitySpanProcessor = IdentitySpanProcessor;
|
|
526
562
|
declare const _tracingModule_IdentitySpanProcessor: typeof IdentitySpanProcessor;
|
|
563
|
+
declare const _tracingModule_MAX_MEDIA_BYTES: typeof MAX_MEDIA_BYTES;
|
|
564
|
+
declare const _tracingModule_MediaField: typeof MediaField;
|
|
565
|
+
declare const _tracingModule_MediaReference: typeof MediaReference;
|
|
566
|
+
declare const _tracingModule_MediaUploadError: typeof MediaUploadError;
|
|
567
|
+
declare const _tracingModule_MediaUploader: typeof MediaUploader;
|
|
527
568
|
type _tracingModule_ObservationKind = ObservationKind;
|
|
528
569
|
type _tracingModule_ObserveClaudeOptions = ObserveClaudeOptions;
|
|
529
570
|
type _tracingModule_ObserveOptions = ObserveOptions;
|
|
571
|
+
declare const _tracingModule_SECRET_KEYS: typeof SECRET_KEYS;
|
|
530
572
|
declare const _tracingModule_SESSION_ID_ATTRIBUTE: typeof SESSION_ID_ATTRIBUTE;
|
|
573
|
+
type _tracingModule_SecretRedactingSpanProcessor = SecretRedactingSpanProcessor;
|
|
574
|
+
declare const _tracingModule_SecretRedactingSpanProcessor: typeof SecretRedactingSpanProcessor;
|
|
531
575
|
type _tracingModule_SessionSpanProcessor = SessionSpanProcessor;
|
|
532
576
|
declare const _tracingModule_SessionSpanProcessor: typeof SessionSpanProcessor;
|
|
577
|
+
type _tracingModule_SpanSecrets = SpanSecrets;
|
|
578
|
+
declare const _tracingModule_SpanSecrets: typeof SpanSecrets;
|
|
533
579
|
type _tracingModule_TracingConfig = TracingConfig;
|
|
534
580
|
type _tracingModule_TracingHandle = TracingHandle;
|
|
535
581
|
type _tracingModule_TracingState = TracingState;
|
|
536
582
|
declare const _tracingModule_USER_ID_ATTRIBUTE: typeof USER_ID_ATTRIBUTE;
|
|
583
|
+
declare const _tracingModule_WORLD_SESSION_ID_ATTRIBUTE: typeof WORLD_SESSION_ID_ATTRIBUTE;
|
|
537
584
|
declare const _tracingModule_flush: typeof flush;
|
|
538
585
|
declare const _tracingModule_getAmbientSessionId: typeof getAmbientSessionId;
|
|
586
|
+
declare const _tracingModule_getCurrentWorldSessionId: typeof getCurrentWorldSessionId;
|
|
539
587
|
declare const _tracingModule_identify: typeof identify;
|
|
540
588
|
declare const _tracingModule_init: typeof init;
|
|
541
589
|
declare const _tracingModule_initIsolated: typeof initIsolated;
|
|
@@ -549,8 +597,9 @@ declare const _tracingModule_resetAmbientUser: typeof resetAmbientUser;
|
|
|
549
597
|
declare const _tracingModule_resolveUserId: typeof resolveUserId;
|
|
550
598
|
declare const _tracingModule_shutdown: typeof shutdown;
|
|
551
599
|
declare const _tracingModule_withSession: typeof withSession;
|
|
600
|
+
declare const _tracingModule_withWorldSession: typeof withWorldSession;
|
|
552
601
|
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 };
|
|
602
|
+
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
603
|
}
|
|
555
604
|
|
|
556
|
-
export { type IdentifyOptions as I, type ObservationKind as O,
|
|
605
|
+
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.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.
|
|
@@ -170,15 +171,9 @@ interface TracingState {
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* This module provides the core init(), shutdown(), and flush() functions
|
|
176
|
-
* for managing the OpenTelemetry TracerProvider lifecycle, plus
|
|
177
|
-
* initIsolated() for creating additional self-contained providers (e.g. one
|
|
178
|
-
* process exporting different agents to different Gateway projects).
|
|
179
|
-
*
|
|
180
|
-
* Mirrors the Python SDK's tracing.init() for a consistent developer experience.
|
|
174
|
+
* Check if Gateway is configured via environment variables.
|
|
181
175
|
*/
|
|
176
|
+
declare function isGatewayConfigured(): boolean;
|
|
182
177
|
|
|
183
178
|
/**
|
|
184
179
|
* Handle to an isolated tracing provider created by initIsolated().
|
|
@@ -290,54 +285,39 @@ declare function shutdown(): Promise<void>;
|
|
|
290
285
|
* Check if tracing has been initialized.
|
|
291
286
|
*/
|
|
292
287
|
declare function isInitialized(): boolean;
|
|
293
|
-
/**
|
|
294
|
-
* Check if Gateway is configured via environment variables.
|
|
295
|
-
*/
|
|
296
|
-
declare function isGatewayConfigured(): boolean;
|
|
297
|
-
|
|
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
288
|
|
|
314
289
|
declare const SESSION_ID_ATTRIBUTE = "gateway.session.id";
|
|
315
|
-
|
|
316
|
-
|
|
290
|
+
declare const WORLD_SESSION_ID_ATTRIBUTE = "gateway.trace.metadata.world_session_id";
|
|
291
|
+
/** The session id set by the innermost enclosing `withSession()`, or `undefined`. */
|
|
317
292
|
declare function getAmbientSessionId(): string | undefined;
|
|
293
|
+
/** The live world session the current code is working in, or `undefined`. */
|
|
294
|
+
declare function getCurrentWorldSessionId(): string | undefined;
|
|
318
295
|
/**
|
|
319
|
-
* Group every trace recorded inside `fn` under one session id — the
|
|
320
|
-
*
|
|
296
|
+
* Group every trace recorded inside `fn` under one session id — the twin of
|
|
297
|
+
* the Python SDK's `with tracing.session(session_id): ...`. Auto-instrumented
|
|
298
|
+
* spans are grouped too; the innermost session wins.
|
|
321
299
|
*
|
|
322
300
|
* ```typescript
|
|
323
|
-
* import { withSession } from "@withgateway/sdk/tracing";
|
|
324
|
-
*
|
|
325
301
|
* await withSession("checkout-regression-001", async () => {
|
|
326
|
-
* await observe("turn-1", async () => { ... });
|
|
302
|
+
* await observe("turn-1", async () => { ... });
|
|
327
303
|
* });
|
|
328
304
|
* ```
|
|
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
305
|
*/
|
|
334
306
|
declare function withSession<T>(sessionId: string, fn: () => T | Promise<T>): Promise<T>;
|
|
335
307
|
/**
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* `
|
|
340
|
-
*
|
|
308
|
+
* Trace `fn` as work inside one live world session: spans take the world
|
|
309
|
+
* session's id as their session id and carry `world_session_id` trace
|
|
310
|
+
* metadata. A `withSession()` block inside still wins for the session id;
|
|
311
|
+
* the metadata stays. Without `tracing.init()` nothing is recorded. Twin of
|
|
312
|
+
* Python's `tracing.context.world_session`; callers use
|
|
313
|
+
* `WorldSession.withTraceContext(fn)`.
|
|
314
|
+
*/
|
|
315
|
+
declare function withWorldSession<T>(worldSessionId: string, fn: () => T | Promise<T>): Promise<T>;
|
|
316
|
+
/**
|
|
317
|
+
* Stamps the session id and world session id on every span at start.
|
|
318
|
+
* Registered by `tracing.init()`/`initIsolated()`. A session id the span was
|
|
319
|
+
* started with (or is given after it starts) wins over the innermost
|
|
320
|
+
* `withSession()` / `withWorldSession()` block, as in the Python SDK.
|
|
341
321
|
*/
|
|
342
322
|
declare class SessionSpanProcessor implements SpanProcessor {
|
|
343
323
|
onStart(span: Span, _parentContext: Context): void;
|
|
@@ -346,6 +326,62 @@ declare class SessionSpanProcessor implements SpanProcessor {
|
|
|
346
326
|
forceFlush(): Promise<void>;
|
|
347
327
|
}
|
|
348
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Credentials a caller hands a model SDK (an MCP server's `authorization_token`), kept out of every
|
|
331
|
+
* exported span. Twin of `gatewaysdk/tracing/secrets.py`; both run
|
|
332
|
+
* `fixtures/tracing/span-secret-vectors.json`.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
declare const SECRET_KEYS: ReadonlySet<string>;
|
|
336
|
+
type Attributes = Record<string, unknown>;
|
|
337
|
+
/**
|
|
338
|
+
* Which keys are credentials, and how to keep them out of a span attribute. An attribute whose name
|
|
339
|
+
* contains a key is dropped. An attribute whose value names a key is exported only when the key can
|
|
340
|
+
* be removed as a JSON object key (at any depth, also inside a JSON string nested in JSON) and then
|
|
341
|
+
* neither the name nor any value removed under it (`MIN_SECRET_LENGTH` or longer) appears anywhere
|
|
342
|
+
* in it. Any other attribute that names a key (a cut or non-JSON string, a repr, a query string, a
|
|
343
|
+
* pair list, a command line, prose) is replaced whole by `REDACTED`: no rule can know where every
|
|
344
|
+
* rendering of the value sits beside its name. A removed value withholds the attribute in its
|
|
345
|
+
* percent-encoded or JSON-escaped form too, and a value that cannot be scrubbed for any reason is
|
|
346
|
+
* withheld whole. Attributes that name no key are exported untouched.
|
|
347
|
+
*/
|
|
348
|
+
declare class SpanSecrets {
|
|
349
|
+
readonly keys: ReadonlySet<string>;
|
|
350
|
+
constructor(keys?: ReadonlySet<string>);
|
|
351
|
+
isSecret(key: string): boolean;
|
|
352
|
+
drops(attribute: string): boolean;
|
|
353
|
+
strip(value: unknown): unknown;
|
|
354
|
+
scrubAttribute(value: unknown): unknown;
|
|
355
|
+
private scrubbedValue;
|
|
356
|
+
scrubAttributes(attributes: Attributes): Attributes;
|
|
357
|
+
private mentions;
|
|
358
|
+
private scrubbedText;
|
|
359
|
+
private cleaned;
|
|
360
|
+
private carries;
|
|
361
|
+
private removed;
|
|
362
|
+
private stripNested;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Wraps a span processor so every read it makes, at start or at end, is without the credentials
|
|
366
|
+
* `SpanSecrets` names in the span's attributes, event attributes or status message, whichever
|
|
367
|
+
* instrumentor recorded them. `tracing.init()` puts one in front of its exporter and every custom
|
|
368
|
+
* processor. A span that cannot be scrubbed at end is dropped rather than exported as it was.
|
|
369
|
+
*/
|
|
370
|
+
declare class SecretRedactingSpanProcessor implements SpanProcessor {
|
|
371
|
+
private readonly inner;
|
|
372
|
+
private readonly secrets;
|
|
373
|
+
constructor(inner: SpanProcessor, secrets?: SpanSecrets);
|
|
374
|
+
private readonly views;
|
|
375
|
+
onStart(span: Span, parentContext: Context): void;
|
|
376
|
+
onEnd(span: ReadableSpan): void;
|
|
377
|
+
private viewFor;
|
|
378
|
+
forceFlush(): Promise<void>;
|
|
379
|
+
shutdown(): Promise<void>;
|
|
380
|
+
private scrubbedAttributes;
|
|
381
|
+
private scrubbedStatus;
|
|
382
|
+
private scrubbedEvent;
|
|
383
|
+
}
|
|
384
|
+
|
|
349
385
|
type ObservationKind = "AGENT" | "CHAIN" | "TOOL" | "LLM" | "RETRIEVER";
|
|
350
386
|
interface ObserveOptions {
|
|
351
387
|
/** Recorded as input.value on the span (JSON-stringified if not a string). */
|
|
@@ -524,18 +560,30 @@ declare function observeClaude(stream: AsyncIterable<any>, options: ObserveClaud
|
|
|
524
560
|
type _tracingModule_IdentifyOptions = IdentifyOptions;
|
|
525
561
|
type _tracingModule_IdentitySpanProcessor = IdentitySpanProcessor;
|
|
526
562
|
declare const _tracingModule_IdentitySpanProcessor: typeof IdentitySpanProcessor;
|
|
563
|
+
declare const _tracingModule_MAX_MEDIA_BYTES: typeof MAX_MEDIA_BYTES;
|
|
564
|
+
declare const _tracingModule_MediaField: typeof MediaField;
|
|
565
|
+
declare const _tracingModule_MediaReference: typeof MediaReference;
|
|
566
|
+
declare const _tracingModule_MediaUploadError: typeof MediaUploadError;
|
|
567
|
+
declare const _tracingModule_MediaUploader: typeof MediaUploader;
|
|
527
568
|
type _tracingModule_ObservationKind = ObservationKind;
|
|
528
569
|
type _tracingModule_ObserveClaudeOptions = ObserveClaudeOptions;
|
|
529
570
|
type _tracingModule_ObserveOptions = ObserveOptions;
|
|
571
|
+
declare const _tracingModule_SECRET_KEYS: typeof SECRET_KEYS;
|
|
530
572
|
declare const _tracingModule_SESSION_ID_ATTRIBUTE: typeof SESSION_ID_ATTRIBUTE;
|
|
573
|
+
type _tracingModule_SecretRedactingSpanProcessor = SecretRedactingSpanProcessor;
|
|
574
|
+
declare const _tracingModule_SecretRedactingSpanProcessor: typeof SecretRedactingSpanProcessor;
|
|
531
575
|
type _tracingModule_SessionSpanProcessor = SessionSpanProcessor;
|
|
532
576
|
declare const _tracingModule_SessionSpanProcessor: typeof SessionSpanProcessor;
|
|
577
|
+
type _tracingModule_SpanSecrets = SpanSecrets;
|
|
578
|
+
declare const _tracingModule_SpanSecrets: typeof SpanSecrets;
|
|
533
579
|
type _tracingModule_TracingConfig = TracingConfig;
|
|
534
580
|
type _tracingModule_TracingHandle = TracingHandle;
|
|
535
581
|
type _tracingModule_TracingState = TracingState;
|
|
536
582
|
declare const _tracingModule_USER_ID_ATTRIBUTE: typeof USER_ID_ATTRIBUTE;
|
|
583
|
+
declare const _tracingModule_WORLD_SESSION_ID_ATTRIBUTE: typeof WORLD_SESSION_ID_ATTRIBUTE;
|
|
537
584
|
declare const _tracingModule_flush: typeof flush;
|
|
538
585
|
declare const _tracingModule_getAmbientSessionId: typeof getAmbientSessionId;
|
|
586
|
+
declare const _tracingModule_getCurrentWorldSessionId: typeof getCurrentWorldSessionId;
|
|
539
587
|
declare const _tracingModule_identify: typeof identify;
|
|
540
588
|
declare const _tracingModule_init: typeof init;
|
|
541
589
|
declare const _tracingModule_initIsolated: typeof initIsolated;
|
|
@@ -549,8 +597,9 @@ declare const _tracingModule_resetAmbientUser: typeof resetAmbientUser;
|
|
|
549
597
|
declare const _tracingModule_resolveUserId: typeof resolveUserId;
|
|
550
598
|
declare const _tracingModule_shutdown: typeof shutdown;
|
|
551
599
|
declare const _tracingModule_withSession: typeof withSession;
|
|
600
|
+
declare const _tracingModule_withWorldSession: typeof withWorldSession;
|
|
552
601
|
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 };
|
|
602
|
+
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
603
|
}
|
|
555
604
|
|
|
556
|
-
export { type IdentifyOptions as I, type ObservationKind as O,
|
|
605
|
+
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,
|
|
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, SurfaceDescriptor, 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, WorldRequest, WorldRequestLog, 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, surfaceDescriptor, 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-
|
|
15
|
-
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-
|
|
14
|
+
import { _ as _tracingModule } from './index-D-AMnAMa.mjs';
|
|
15
|
+
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-D-AMnAMa.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,
|
|
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, SurfaceDescriptor, 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, WorldRequest, WorldRequestLog, 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, surfaceDescriptor, 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-
|
|
15
|
-
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-
|
|
14
|
+
import { _ as _tracingModule } from './index-CBqbB_0J.js';
|
|
15
|
+
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-CBqbB_0J.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';
|