@withgateway/sdk 0.4.0 → 0.6.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 (94) hide show
  1. package/dist/cli.js +1128 -783
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +1130 -785
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/files/index.js +47 -18
  6. package/dist/files/index.js.map +1 -1
  7. package/dist/files/index.mjs +47 -18
  8. package/dist/files/index.mjs.map +1 -1
  9. package/dist/{index-mJhG3vZU.d.mts → index-Di9nNqOY.d.mts} +26 -3
  10. package/dist/{index-DUHmS74p.d.ts → index-LA-PMRJT.d.ts} +26 -3
  11. package/dist/index.d.mts +3 -3
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +179 -43
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +176 -43
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/replay/index.d.mts +1 -1
  18. package/dist/replay/index.d.ts +1 -1
  19. package/dist/replay/index.js.map +1 -1
  20. package/dist/replay/index.mjs.map +1 -1
  21. package/dist/traces/index.js +47 -18
  22. package/dist/traces/index.js.map +1 -1
  23. package/dist/traces/index.mjs +47 -18
  24. package/dist/traces/index.mjs.map +1 -1
  25. package/dist/tracing/index.d.mts +1 -1
  26. package/dist/tracing/index.d.ts +1 -1
  27. package/dist/tracing/index.js +1 -1
  28. package/dist/tracing/index.js.map +1 -1
  29. package/dist/tracing/index.mjs +1 -1
  30. package/dist/tracing/index.mjs.map +1 -1
  31. package/dist/worlds/index.d.mts +184 -85
  32. package/dist/worlds/index.d.ts +184 -85
  33. package/dist/worlds/index.js +176 -43
  34. package/dist/worlds/index.js.map +1 -1
  35. package/dist/worlds/index.mjs +176 -43
  36. package/dist/worlds/index.mjs.map +1 -1
  37. package/package.json +1 -1
  38. package/runtime/gatewaysdk/environment/_bundle.py +4 -6
  39. package/runtime/gatewaysdk/environment/_world.py +24 -1
  40. package/runtime/gatewaysdk/environment/runtime.py +45 -2
  41. package/runtime/gatewaysdk/environment/schema/api.py +24 -3
  42. package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +1 -0
  43. package/runtime/gatewaysdk/environment/schema/call_capture.py +13 -1
  44. package/runtime/gatewaysdk/environment/schema/call_log.py +46 -0
  45. package/runtime/gatewaysdk/environment/schema/call_redaction.py +6 -0
  46. package/runtime/gatewaysdk/environment/schema/compiler.py +4 -1
  47. package/runtime/gatewaysdk/environment/schema/conform.py +32 -8
  48. package/runtime/gatewaysdk/environment/schema/connector.py +5 -0
  49. package/runtime/gatewaysdk/environment/schema/connectors/custom/handlers.py +2 -1
  50. package/runtime/gatewaysdk/environment/schema/connectors/github/api/handlers.py +217 -58
  51. package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +9 -19
  52. package/runtime/gatewaysdk/environment/schema/connectors/github/scenarios/default/seed/github_webhooks.json +10 -2
  53. package/runtime/gatewaysdk/environment/schema/connectors/github/tests/webhooks.json +47 -0
  54. package/runtime/gatewaysdk/environment/schema/connectors/github/world.json +21 -0
  55. package/runtime/gatewaysdk/environment/schema/connectors/jamf/api/handlers.py +185 -18
  56. package/runtime/gatewaysdk/environment/schema/connectors/jamf/connector.toml +29 -14
  57. package/runtime/gatewaysdk/environment/schema/connectors/jamf/provenance.json +43 -12
  58. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scenarios/default/seed/jamf_webhooks.json +2 -2
  59. package/runtime/gatewaysdk/environment/schema/connectors/jamf/scope.toml +4 -17
  60. package/runtime/gatewaysdk/environment/schema/connectors/jamf/tests/webhooks.json +107 -0
  61. package/runtime/gatewaysdk/environment/schema/connectors/jamf/vendor-openapi.json +1 -1
  62. package/runtime/gatewaysdk/environment/schema/connectors/linear/api/handlers.py +85 -1
  63. package/runtime/gatewaysdk/environment/schema/connectors/linear/connector.toml +19 -31
  64. package/runtime/gatewaysdk/environment/schema/connectors/linear/provenance.json +18 -8
  65. package/runtime/gatewaysdk/environment/schema/connectors/linear/scenarios/default/seed/webhooks.json +19 -3
  66. package/runtime/gatewaysdk/environment/schema/connectors/linear/tests/test_webhooks.py +71 -0
  67. package/runtime/gatewaysdk/environment/schema/database/guard.py +2 -1
  68. package/runtime/gatewaysdk/environment/schema/handler_errors.py +27 -1
  69. package/runtime/gatewaysdk/environment/schema/journal.py +4 -3
  70. package/runtime/gatewaysdk/environment/schema/local.py +1 -0
  71. package/runtime/gatewaysdk/environment/schema/openapi_schemas.py +20 -5
  72. package/runtime/gatewaysdk/environment/schema/platform.py +16 -219
  73. package/runtime/gatewaysdk/environment/schema/runtime.py +7 -0
  74. package/runtime/gatewaysdk/environment/schema/scaffold.py +2 -1
  75. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +3 -3
  76. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +19 -22
  77. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +7 -9
  78. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +3 -3
  79. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +14 -11
  80. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +36 -5
  81. package/runtime/gatewaysdk/environment/schema/snapshot.py +2 -2
  82. package/runtime/gatewaysdk/environment/schema/tools_world.py +19 -0
  83. package/runtime/gatewaysdk/environment/schema/verbs.py +6 -0
  84. package/runtime/gatewaysdk/environment/schema/webhooks.py +687 -0
  85. package/runtime/gatewaysdk/environment/schema/world_host.py +20 -3
  86. package/runtime/gatewaysdk/environment/schema/world_tests.py +74 -0
  87. package/skills/connector-schema-authoring/CONNECTORS.md +3 -3
  88. package/skills/connector-schema-authoring/SKILL.md +19 -22
  89. package/skills/connector-schema-authoring/connector-worlds.md +153 -11
  90. package/skills/connector-schema-authoring/world-schema.md +7 -6
  91. package/skills/world-data-ingestion/SKILL.md +7 -9
  92. package/skills/worlds-getting-started/SKILL.md +3 -3
  93. package/skills/worlds-getting-started/references/cli-mcp-map.md +14 -11
  94. package/skills/worlds-getting-started/references/gotchas.md +36 -5
@@ -283,6 +283,15 @@ type NativeComputerOptions = {
283
283
  * screenshots with the `GATEWAY_*` keys when tracing is initialized. */
284
284
  tracer?: ActionTracer;
285
285
  };
286
+ /** The major version of the `ai` package the tools are handed to. */
287
+ type AiSdkMajor = 6 | 7;
288
+ type AiSdkOptions<V extends AiSdkMajor = 6> = {
289
+ /** The Anthropic kinds' screenshot part. Default 6: `image-data`, which
290
+ * AI SDK 7 still accepts with a deprecation warning. 7: the `file` part with
291
+ * `{ type: "data", data }`, which AI SDK 6 does not accept. The OpenAI kinds
292
+ * return the provider's own `computer_screenshot` output and ignore it. */
293
+ version?: V;
294
+ };
286
295
  type Kind = new (browser: ScreenBrowser, options?: NativeComputerOptions) => NativeComputer;
287
296
  /** `item[name]` for the first spelling that is set (`scroll_x`, `scrollX`). */
288
297
  declare function readField(item: unknown, ...names: string[]): unknown;
@@ -305,7 +314,7 @@ declare abstract class NativeComputer {
305
314
  abstract parse(raw: unknown): ComputerAction;
306
315
  /** The options to spread into the Vercel AI SDK's provider-defined computer
307
316
  * tool (`execute` and its companions), backed by this computer. */
308
- abstract aiSdk(): object;
317
+ abstract aiSdk(options?: AiSdkOptions<AiSdkMajor>): object;
309
318
  /** Run one provider-shaped action (an OpenAI action object, or an Anthropic
310
319
  * `{ action: "left_click", ... }` input) and return what it produced: the
311
320
  * door for any agent framework that hands actions over one at a time. */
@@ -345,12 +354,6 @@ declare class KeyChord {
345
354
  }
346
355
 
347
356
  /**
348
- * Anthropic's computer use: the `computer_toolset_20260801` toolset (GA, no
349
- * beta header) and the older `computer_20251124` tool as a second kind.
350
- * With the toolset each action is its own `tool_use` block named after the
351
- * action and marked `"toolset_name": "computer"`; a turn may carry several.
352
- * They run in order; the first failure is reported with `is_error` and every
353
- * later block in the turn is answered as not executed.
354
357
  * Docs: https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool
355
358
  * Twin of `gatewaysdk/native_computer/anthropic.py`.
356
359
  */
@@ -361,16 +364,28 @@ type AiSdkAnthropicOutput = {
361
364
  type: "image";
362
365
  data: string;
363
366
  } | string;
364
- type AiSdkModelOutput = {
367
+ type ImageParts = {
368
+ 6: {
369
+ type: "image-data";
370
+ data: string;
371
+ mediaType: "image/png";
372
+ };
373
+ 7: {
374
+ type: "file";
375
+ mediaType: "image/png";
376
+ data: {
377
+ type: "data";
378
+ data: string;
379
+ };
380
+ };
381
+ };
382
+ type AiSdkImagePart<V extends AiSdkMajor = AiSdkMajor> = ImageParts[V];
383
+ type AiSdkModelOutput<V extends AiSdkMajor = 6> = {
365
384
  type: "text";
366
385
  value: string;
367
386
  } | {
368
387
  type: "content";
369
- value: {
370
- type: "image-data";
371
- data: string;
372
- mediaType: "image/png";
373
- }[];
388
+ value: AiSdkImagePart<V>[];
374
389
  };
375
390
  type AnthropicContent = {
376
391
  type: "text";
@@ -412,23 +427,27 @@ declare class AnthropicComputer extends NativeComputer {
412
427
  execute(content: Iterable<unknown>): Promise<AnthropicToolResult[]>;
413
428
  /** The content an `ActionResult` goes back to the model as. */
414
429
  static content(result: ActionResult): AnthropicContent[];
415
- /** For `anthropic.tools.computerToolset_20260801({ ...computer.aiSdk() })`
416
- * (or `computer_20251124` with the legacy kind): `execute` runs one action
417
- * and returns `{ type: "image", data }` or text; `toModelOutput` turns that
418
- * into the tool result. Calls run one at a time, and once a call fails the
430
+ /** For `anthropic.tools.computerToolset_20260801(computer.aiSdk({ version: 7 }))`
431
+ * (AI SDK 7 only), or `computer_20251124` with the legacy kind (AI SDK 6
432
+ * and 7): `execute` runs one action and returns `{ type: "image", data }` or
433
+ * text; `toModelOutput` turns that into the tool result in the part shape
434
+ * of `options.version`. Calls run one at a time, and once a call fails the
419
435
  * rest of that step's calls answer as not executed. */
420
- aiSdk(): {
436
+ aiSdk<V extends AiSdkMajor = 6>(options?: AiSdkOptions<V>): {
421
437
  execute: (input: unknown, options?: {
422
438
  messages?: readonly unknown[];
423
439
  }) => Promise<AiSdkAnthropicOutput>;
424
440
  toModelOutput: (options: {
425
441
  output: AiSdkAnthropicOutput;
426
- }) => AiSdkModelOutput;
442
+ }) => AiSdkModelOutput<V>;
427
443
  };
428
444
  static aiSdkOutput(result: ActionResult): AiSdkAnthropicOutput;
429
- /** `image-data` is what AI SDK 6's Anthropic provider turns into an image
430
- * block; AI SDK 7 still accepts it (and converts it to a `file` part). */
431
- static aiSdkModelOutput(output: AiSdkAnthropicOutput): AiSdkModelOutput;
445
+ /** A screenshot as the image part of AI SDK `options.version`:
446
+ * `image-data` for 6 (the default), `file` with `{ type: "data", data }`
447
+ * for 7. */
448
+ static aiSdkModelOutput<V extends AiSdkMajor = 6>(output: AiSdkAnthropicOutput, options?: AiSdkOptions<V>): AiSdkModelOutput<V>;
449
+ private static imagePart;
450
+ private static modelOutput;
432
451
  protected envelope(block: unknown, content: AnthropicContent[] | string, isError?: boolean): AnthropicToolResult;
433
452
  private runBlock;
434
453
  }
@@ -522,13 +541,7 @@ declare class OpenAIPreviewComputer extends OpenAIComputer {
522
541
  tool(): Record<string, unknown>;
523
542
  }
524
543
 
525
- /**
526
- * Native computer use: Anthropic's and OpenAI's pixel-based computer-use
527
- * tools served by a world session's browser. Kinds: `anthropic`
528
- * (`computer_toolset_20260801`), `anthropic-computer-20251124`, `openai`
529
- * (Responses `computer`) and `openai-preview` (`computer_use_preview`).
530
- * Python twin: `gatewaysdk/native_computer/`.
531
- */
544
+ /** Python twin: `gatewaysdk/native_computer/`. */
532
545
 
533
546
  /** The class each provider name builds, so a caller gets the kind's own
534
547
  * `execute` without a cast. */
@@ -710,6 +723,64 @@ declare function schemaFromSignature(spec: WorldToolSpec): {
710
723
  };
711
724
  };
712
725
 
726
+ declare const WORLD_REQUEST_VIAS: readonly ["api", "ui", "tool", "webhook"];
727
+ /** One request with its exchange: the request's headers (credentials `[redacted]`) and the first 64 KB of each body, `null` for a body that is not text. */
728
+ type WorldRequestEntry = Omit<WorldRequest, "request" | "response"> & {
729
+ request: WorldRequest["request"] & {
730
+ headers: Record<string, string>;
731
+ body: string | null;
732
+ };
733
+ response: WorldRequest["response"] & {
734
+ body: string | null;
735
+ };
736
+ };
737
+ type WorldRequestFilter = {
738
+ session?: string;
739
+ version?: string;
740
+ via?: string;
741
+ operation?: string;
742
+ status?: string;
743
+ since?: string;
744
+ until?: string;
745
+ cursor?: string;
746
+ limit?: number;
747
+ };
748
+ declare class WorldRequestFilterError extends Error {
749
+ }
750
+ /** The platform's 409 `requests_not_recorded`: the session's engine keeps no request ledger, only World Host
751
+ * sessions record requests. Its message is the platform's own sentence. */
752
+ declare class WorldRequestsNotRecorded extends Error {
753
+ static from(error: unknown): unknown;
754
+ static mapped<T>(read: Promise<T>): Promise<T>;
755
+ }
756
+ /** The filters of a request-ledger read, checked and put in the platform's form: `via` and `status` lower-cased,
757
+ * `since`/`until` as UTC instants (a date alone is its midnight, a time without a zone is UTC). Twin of
758
+ * `gatewaysdk.world_requests.WorldRequestQuery`; both run `conformance/world-request-cli.json`. */
759
+ declare class WorldRequestQuery {
760
+ private readonly entries;
761
+ private constructor();
762
+ static parse(filter?: WorldRequestFilter): WorldRequestQuery;
763
+ private static via;
764
+ private static status;
765
+ get filtered(): boolean;
766
+ params(): [string, string][];
767
+ search(): string;
768
+ }
769
+ /** A world's request ledger: every request the world received, from every session and version, through every
770
+ * door (`via`: api, ui, tool, webhook), kept for the world's life. Reading it records nothing. Twin of
771
+ * `gatewaysdk.world_requests.WorldRequestLedger`. */
772
+ declare class WorldRequestLedger {
773
+ private readonly options;
774
+ constructor(options?: WorldsClientOptions);
775
+ /** A page of the world's requests, newest first; `nextCursor` reads the page after it. Narrowed to a session
776
+ * whose engine records none: `WorldRequestsNotRecorded`. */
777
+ list(slug: string, query?: WorldRequestQuery): Promise<WorldRequestPage>;
778
+ /** One of the world's requests, with its headers and bodies. */
779
+ get(slug: string, requestId: string): Promise<WorldRequestEntry>;
780
+ /** A page of one session's requests, newest first; `WorldRequestsNotRecorded` when its engine records none. */
781
+ forSession(sessionId: string, query?: WorldRequestQuery): Promise<WorldRequestPage>;
782
+ }
783
+
713
784
  /** One entry of a world's request ledger as a list carries it: what was asked
714
785
  * and what came back, without its headers and bodies. */
715
786
  type WorldRequest = {
@@ -720,7 +791,7 @@ type WorldRequest = {
720
791
  worldSlug: string;
721
792
  sessionId: string;
722
793
  versionId: string;
723
- via: "api" | "ui" | "tool" | null;
794
+ via: (typeof WORLD_REQUEST_VIAS)[number] | null;
724
795
  operation: string | null;
725
796
  method: string | null;
726
797
  path: string | null;
@@ -760,7 +831,7 @@ declare function worldRequestsUnrecorded(counts: {
760
831
  }): string | null;
761
832
  /**
762
833
  * A session's entries in its world's request ledger: every request the world
763
- * received, through every door (`via`: api, ui, tool), kept for the life of
834
+ * received, through every door (`via`: api, ui, tool, webhook), kept for the life of
764
835
  * the world. Read page by page without recording anything in the session; the
765
836
  * platform's call ledger (`export()`) holds what it brokered — tool calls,
766
837
  * seeds, grades. One entry's headers and bodies are `GET
@@ -2616,62 +2687,90 @@ type RunSetResult = {
2616
2687
  /** A low or missing reward is a result, not a failure; every task runs even after one fails. */
2617
2688
  declare function runSet(datasetId: string, agent: (run: TaskRun) => TaskRunResult | Promise<TaskRunResult>, opts: RunSetOptions): Promise<RunSetResult>;
2618
2689
 
2619
- declare const WORLD_REQUEST_VIAS: readonly ["api", "ui", "tool"];
2620
- /** One request with its exchange: the request's headers (credentials `[redacted]`) and the first 64 KB of each body, `null` for a body that is not text. */
2621
- type WorldRequestEntry = Omit<WorldRequest, "request" | "response"> & {
2622
- request: WorldRequest["request"] & {
2623
- headers: Record<string, string>;
2624
- body: string | null;
2625
- };
2626
- response: WorldRequest["response"] & {
2627
- body: string | null;
2628
- };
2690
+ declare const WORLD_WEBHOOK_PAGE_MAX = 100;
2691
+ type WorldWebhookSubscription = {
2692
+ key: Record<string, unknown>;
2693
+ url: string | null;
2694
+ events: string[];
2695
+ scope: Record<string, string[]>;
2696
+ enabled: boolean;
2697
+ /** Deliveries this subscription was sent since the session's feed began. */
2698
+ sent: number;
2629
2699
  };
2630
- type WorldRequestFilter = {
2631
- session?: string;
2632
- version?: string;
2633
- via?: string;
2634
- operation?: string;
2635
- status?: string;
2636
- since?: string;
2637
- until?: string;
2638
- cursor?: string;
2639
- limit?: number;
2700
+ type WorldWebhookDelivery = {
2701
+ seq: number;
2702
+ id: string;
2703
+ eventId: string;
2704
+ eventType: string;
2705
+ subscription: Record<string, unknown>;
2706
+ url: string;
2707
+ headers: Record<string, string>;
2708
+ payload: string;
2709
+ at: number;
2640
2710
  };
2641
- declare class WorldRequestFilterError extends Error {
2642
- }
2643
- /** The platform's 409 `requests_not_recorded`: the session's engine keeps no request ledger, only World Host
2644
- * sessions record requests. Its message is the platform's own sentence. */
2645
- declare class WorldRequestsNotRecorded extends Error {
2646
- static from(error: unknown): unknown;
2647
- static mapped<T>(read: Promise<T>): Promise<T>;
2648
- }
2649
- /** The filters of a request-ledger read, checked and put in the platform's form: `via` and `status` lower-cased,
2650
- * `since`/`until` as UTC instants (a date alone is its midnight, a time without a zone is UTC). Twin of
2651
- * `gatewaysdk.world_requests.WorldRequestQuery`; both run `conformance/world-request-cli.json`. */
2652
- declare class WorldRequestQuery {
2653
- private readonly entries;
2654
- private constructor();
2655
- static parse(filter?: WorldRequestFilter): WorldRequestQuery;
2656
- private static via;
2657
- private static status;
2658
- get filtered(): boolean;
2659
- params(): [string, string][];
2660
- search(): string;
2661
- }
2662
- /** A world's request ledger: every request the world received, from every session and version, through every
2663
- * door (`via`: api, ui, tool), kept for the world's life. Reading it records nothing. Twin of
2664
- * `gatewaysdk.world_requests.WorldRequestLedger`. */
2665
- declare class WorldRequestLedger {
2711
+ type WorldWebhookPage = {
2712
+ declared: boolean;
2713
+ subscriptions: WorldWebhookSubscription[];
2714
+ truncated: boolean;
2715
+ epoch: string;
2716
+ reset: boolean;
2717
+ deliveries: WorldWebhookDelivery[];
2718
+ next: number;
2719
+ more: boolean;
2720
+ missed: number;
2721
+ answered: number;
2722
+ };
2723
+ /** A page as the read key sees it: which event went to which subscription and when. */
2724
+ type WorldWebhookListing = Omit<WorldWebhookPage, "deliveries"> & {
2725
+ deliveries: Pick<WorldWebhookDelivery, "seq" | "id" | "eventType" | "subscription" | "at">[];
2726
+ };
2727
+ type WorldWebhookAnswer = {
2728
+ id: string;
2729
+ status: number;
2730
+ durationMs: number;
2731
+ error: string | null;
2732
+ };
2733
+ type ForwardedDelivery = {
2734
+ delivery: WorldWebhookDelivery;
2735
+ answer: WorldWebhookAnswer;
2736
+ };
2737
+ /** The webhooks a World Host session's world declares and has sent, without their signed headers. */
2738
+ declare function listWebhooks(options: WorldsClientOptions, sessionId: string, page?: {
2739
+ after?: number;
2740
+ limit?: number;
2741
+ epoch?: string;
2742
+ tail?: boolean;
2743
+ }): Promise<WorldWebhookListing>;
2744
+ /**
2745
+ * The forward lane: polls a session's deliveries (secret key), replays each to `forwardTo` exactly as signed,
2746
+ * so a receiver on this machine verifies it as it would the vendor's, and hands each receiver's answer back
2747
+ * on the next poll, where the world's request ledger keeps it beside the delivery.
2748
+ */
2749
+ declare class WorldWebhookForwarder {
2666
2750
  private readonly options;
2667
- constructor(options?: WorldsClientOptions);
2668
- /** A page of the world's requests, newest first; `nextCursor` reads the page after it. Narrowed to a session
2669
- * whose engine records none: `WorldRequestsNotRecorded`. */
2670
- list(slug: string, query?: WorldRequestQuery): Promise<WorldRequestPage>;
2671
- /** One of the world's requests, with its headers and bodies. */
2672
- get(slug: string, requestId: string): Promise<WorldRequestEntry>;
2673
- /** A page of one session's requests, newest first; `WorldRequestsNotRecorded` when its engine records none. */
2674
- forSession(sessionId: string, query?: WorldRequestQuery): Promise<WorldRequestPage>;
2751
+ private readonly sessionId;
2752
+ private readonly forwardTo;
2753
+ private after;
2754
+ private epoch;
2755
+ private answers;
2756
+ private readonly send;
2757
+ constructor(options: WorldsClientOptions, sessionId: string, forwardTo: string, opts?: {
2758
+ fetch?: typeof fetch;
2759
+ });
2760
+ get cursor(): number;
2761
+ /** Where forwarding begins: the deliveries the session still holds (`replay`), or only those it sends from now. */
2762
+ start(replay: boolean): Promise<WorldWebhookPage | null>;
2763
+ /** One poll: the answers held so far sent, the next page forwarded. A poll that fails keeps its answers for the next. */
2764
+ round(): Promise<{
2765
+ page: WorldWebhookPage;
2766
+ forwarded: ForwardedDelivery[];
2767
+ }>;
2768
+ /** Sends the answers still held; the cursor stays, so a delivery this poll returns is forwarded by the next round. */
2769
+ settle(): Promise<number>;
2770
+ private follow;
2771
+ private withAnswers;
2772
+ private poll;
2773
+ private forward;
2675
2774
  }
2676
2775
 
2677
2776
  /** One entry the archive rules dropped: a whole directory (`name/`, `files`
@@ -4171,4 +4270,4 @@ declare function openWorld(slugRef: string, options?: WorldsClientOptions): Prom
4171
4270
  /** Resolve `slug` at one READY `versionId`, with that version's task list; another world's version, a draft or an unknown id is a 404, never the head. */
4172
4271
  declare function openWorldVersion(slug: string, versionId: string, options?: WorldsClientOptions): Promise<WorldSet>;
4173
4272
 
4174
- export { ACTION_NAMES, type ActingUser, type ActionArgs, type ActionResult, ActionTracer, type AiSdkAnthropicOutput, type AiSdkComputerCall, type AiSdkComputerOutput, type AiSdkModelOutput, AnthropicComputer, AnthropicComputer20251124, type AnthropicToolResult, ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, type BrowserActionEvent, BrowserActionRecorder, type BrowserConnection, type BrowserMode, type BrowserPage, BrowserReconnected, BrowserReconnector, type BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, type Checkout, CheckoutProvenance, ComputerAction, type ComputerCallOutput, type CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, type DispatchedRun, Display, type DryRunImageDecision, DryRunOutcome, type DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, type EditSessionCloseInput, type EditSessionList, type EditSessionListQuery, type EditSessionResult, type EditSessionRollbackInput, type EditSessionSummary, type EvalSample, type FinalizeEvaluationOptions, GatewayEvalsClient, GradePayload, GradeRefused, type GradeResult, type GradedJournal, HostedDryRunClient, type HostedDryRunDispatch, type HostedDryRunStatus, type HostedDryRunVerdict, IDLE_WARNING_MINUTES, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, KEY_NAMES, KeyChord, type ListRunsFilter, type ListSessionsFilter, type LiveTaskSession, type LocalMeta, type MigrateWorldOptions, NOT_EXECUTED, NO_GRADER_REASON, NativeComputer, type NativeComputerKinds, type NativeComputerOptions, type NativeComputerProvider, type NativePage, type ObservationConversion, type ObservationLike, OpenAIComputer, OpenAIPreviewComputer, type OpenSessionOptions, type OpenTaskOptions, PLATFORM_SESSION_HEADER, type ParsedToolCall, PendingSafetyChecks, type Plaintext, PlatformMethod, type PlaywrightBrowserLike, type PlaywrightLike, PushSlugConflict, type PushSlugResolution, RECOVER_BUDGET_MS, REQUESTS_NOT_RECORDED, REQUEST_BODY_CAPTURE_BYTES, REQUEST_LOG_PAGE_MAX, type RebaseConflictPath, type RecoveryResult, type RedactMode, type RedactPolicy, type Redaction, type RegradedRollout, type RepairAnswer, type ResolvedWorldVersion, RetryPolicy, type RowsRefusal, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, type RunSetOptions, type RunSetResult, type RunSummary, type RunTaskOptions, type RunTaskSummary, SANDBOX_EXEC_REPORT_MARGIN_MS, SANDBOX_EXEC_START_ATTEMPTS, SANDBOX_EXEC_TIMEOUT_MAX_S, SANDBOX_EXEC_WAIT_MS, SANDBOX_FILE_MAX_BYTES, SANDBOX_REQUEST_TIMEOUT_MS, SANDBOX_WRITE_CHUNK_BYTES, SANDBOX_WRITE_SKIPPED, SECRET_KEY, SESSION_AUTH_MODES, SESSION_STATES, SPAN_PREFIX, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, type SafetyCheck, type SandboxChanges, type SandboxCheckResult, type SandboxCommitInput, type SandboxCommitPending, type SandboxCommitResult, type SandboxExecResult, type SandboxExecRunning, type SandboxImportInput, type SandboxImportPending, type SandboxImportResult, type SandboxListFilter, type SandboxOpenExisting, type SandboxOpenNew, type SandboxOpenTarget, type SandboxOpened, type SandboxSummary, Score, Screen, type ScreenBrowser, SecretScrubber, type SeedResult, type SessionAuthMode, type SessionRunReport, type SessionRunResult, type SessionSurfaces, type SetRunDoc, type SettleOptions, type SlugDeclaration, type SurfaceDescriptor, TOOL_CONTRACT_UNREAD, TRANSFORMS, TaskEditClient, type TaskEditCloseInput, type TaskEditCloseResult, type TaskEditRollbackInput, type TaskEditRollbackResult, type TaskEditSealed, type TaskEditStatus, type TaskEditTarget, type TaskEditTaskRef, type TaskExport, type TaskGrade, TaskGrades, type TaskManifest, type TaskManifestSession, type TaskRegrade, type TaskRegradeScope, TaskRun, type TaskRunResult, TaskSessions, type TaskSessionsResponse, type TaskTrial, type TaskTrialCheck, type TaskTrialRequest, type TaskTrialTarget, type TaskWorldRef, type TaskWorldSessionState, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, VERIFIER_REWARD_PREFIX, type ValidateReport, type ValidatedRun, type VerifierGrade, WHITESPACE, WORLD_REQUEST_VIAS, WorldBrowser, WorldCallTooLarge, type WorldDependency, type WorldDeprecation, type WorldDescription, WorldEditClient, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, WorldNotice, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, type WorldRequest, type WorldRequestEntry, type WorldRequestFilter, WorldRequestFilterError, WorldRequestLedger, WorldRequestLog, type WorldRequestPage, WorldRequestQuery, WorldRequestsNotRecorded, WorldSandboxClient, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionListItem, WorldSessionOpenFailed, type WorldSessionRestart, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSqlOptions, type WorldSqlResult, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVerifier, type WorldTaskVerifierRow, type WorldTaskVersionSummary, type WorldTaskWorld, type WorldTaskWorldValidation, type WorldToolSpec, type WorldToolkit, WorldToolsUnread, type WorldsClientOptions, WriteTreeFilter, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertSessionAuthMode, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, capabilityLabel, captureToolCalls, carriedWarnings, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, invalidFields, isBrowserGone, isSandboxCommitPending, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, localTreeState, messageOf, 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, rowsRefusal, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, sqlRows, stillStartingHint, storedForms, surfaceDescriptor, surfaceKinds, taskGradeError, taskLabel, taskRunFailure, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, uncommittedPaths, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, worldRequestsUnrecorded, writeLocalMeta };
4273
+ export { ACTION_NAMES, type ActingUser, type ActionArgs, type ActionResult, ActionTracer, type AiSdkAnthropicOutput, type AiSdkComputerCall, type AiSdkComputerOutput, type AiSdkImagePart, type AiSdkMajor, type AiSdkModelOutput, type AiSdkOptions, AnthropicComputer, AnthropicComputer20251124, type AnthropicToolResult, ApiError, BROWSER_GONE_PATTERNS, BROWSER_TIERS, type BrowserActionEvent, BrowserActionRecorder, type BrowserConnection, type BrowserMode, type BrowserPage, BrowserReconnected, BrowserReconnector, type BrowserTier, BrowserUnrecoverable, CALL_BODY_LIMIT_BYTES, CALL_BODY_LIMIT_LABEL, COMPUTER_USE_SPECS, type Checkout, CheckoutProvenance, ComputerAction, type ComputerCallOutput, type CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DRY_RUN_AGENT, DRY_RUN_KIND, DetachedPushError, type DispatchedRun, Display, type DryRunImageDecision, DryRunOutcome, type DryRunSettlement, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EXPLORATORY_TASK, EXPLORATORY_TASK_SOURCE, type EditSessionCloseInput, type EditSessionList, type EditSessionListQuery, type EditSessionResult, type EditSessionRollbackInput, type EditSessionSummary, type EvalSample, type FinalizeEvaluationOptions, type ForwardedDelivery, GatewayEvalsClient, GradePayload, GradeRefused, type GradeResult, type GradedJournal, HostedDryRunClient, type HostedDryRunDispatch, type HostedDryRunStatus, type HostedDryRunVerdict, IDLE_WARNING_MINUTES, type IngestExplode, type IngestFieldSpec, type IngestMapping, type IngestMode, type IngestOptions, type IngestRefusal, type IngestReport, type IngestSource, type IngestSourceReport, type IngestToolCallsOptions, type IngestToolCallsReport, KEY_NAMES, KeyChord, type ListRunsFilter, type ListSessionsFilter, type LiveTaskSession, type LocalMeta, type MigrateWorldOptions, NOT_EXECUTED, NO_GRADER_REASON, NativeComputer, type NativeComputerKinds, type NativeComputerOptions, type NativeComputerProvider, type NativePage, type ObservationConversion, type ObservationLike, OpenAIComputer, OpenAIPreviewComputer, type OpenSessionOptions, type OpenTaskOptions, PLATFORM_SESSION_HEADER, type ParsedToolCall, PendingSafetyChecks, type Plaintext, PlatformMethod, type PlaywrightBrowserLike, type PlaywrightLike, PushSlugConflict, type PushSlugResolution, RECOVER_BUDGET_MS, REQUESTS_NOT_RECORDED, REQUEST_BODY_CAPTURE_BYTES, REQUEST_LOG_PAGE_MAX, type RebaseConflictPath, type RecoveryResult, type RedactMode, type RedactPolicy, type Redaction, type RegradedRollout, type RepairAnswer, type ResolvedWorldVersion, RetryPolicy, type RowsRefusal, type RunConfigInput, type RunConfigSummary, type RunProvenance, type RunReport, type RunSetOptions, type RunSetResult, type RunSummary, type RunTaskOptions, type RunTaskSummary, SANDBOX_EXEC_REPORT_MARGIN_MS, SANDBOX_EXEC_START_ATTEMPTS, SANDBOX_EXEC_TIMEOUT_MAX_S, SANDBOX_EXEC_WAIT_MS, SANDBOX_FILE_MAX_BYTES, SANDBOX_REQUEST_TIMEOUT_MS, SANDBOX_WRITE_CHUNK_BYTES, SANDBOX_WRITE_SKIPPED, SECRET_KEY, SESSION_AUTH_MODES, SESSION_STATES, SPAN_PREFIX, STATUS_WAIT_CAP_SECONDS, STRIP_PREFIX, SURFACE_KINDS, type SafetyCheck, type SandboxChanges, type SandboxCheckResult, type SandboxCommitInput, type SandboxCommitPending, type SandboxCommitResult, type SandboxExecResult, type SandboxExecRunning, type SandboxImportInput, type SandboxImportPending, type SandboxImportResult, type SandboxListFilter, type SandboxOpenExisting, type SandboxOpenNew, type SandboxOpenTarget, type SandboxOpened, type SandboxSummary, Score, Screen, type ScreenBrowser, SecretScrubber, type SeedResult, type SessionAuthMode, type SessionRunReport, type SessionRunResult, type SessionSurfaces, type SetRunDoc, type SettleOptions, type SlugDeclaration, type SurfaceDescriptor, TOOL_CONTRACT_UNREAD, TRANSFORMS, TaskEditClient, type TaskEditCloseInput, type TaskEditCloseResult, type TaskEditRollbackInput, type TaskEditRollbackResult, type TaskEditSealed, type TaskEditStatus, type TaskEditTarget, type TaskEditTaskRef, type TaskExport, type TaskGrade, TaskGrades, type TaskManifest, type TaskManifestSession, type TaskRegrade, type TaskRegradeScope, TaskRun, type TaskRunResult, TaskSessions, type TaskSessionsResponse, type TaskTrial, type TaskTrialCheck, type TaskTrialRequest, type TaskTrialTarget, type TaskWorldRef, type TaskWorldSessionState, type ToolCallRecord, type ToolCallSink, type ToolFunctions, type Transform, VERIFIER_REWARD_PREFIX, type ValidateReport, type ValidatedRun, type VerifierGrade, WHITESPACE, WORLD_REQUEST_VIAS, WORLD_WEBHOOK_PAGE_MAX, WorldBrowser, WorldCallTooLarge, type WorldDependency, type WorldDeprecation, type WorldDescription, WorldEditClient, type WorldEntity, type WorldEntityMapping, type WorldField, type WorldMigrationRefusal, type WorldMigrationReport, WorldNotice, type WorldQueryAcrossOptions, type WorldQueryAcrossResult, type WorldQueryCompare, type WorldQueryCompareStatus, type WorldQueryGroup, type WorldQueryOptions, type WorldQueryResult, type WorldQuerySnapshot, type WorldQueryWhere, type WorldRelationship, type WorldRequest, type WorldRequestEntry, type WorldRequestFilter, WorldRequestFilterError, WorldRequestLedger, WorldRequestLog, type WorldRequestPage, WorldRequestQuery, WorldRequestsNotRecorded, WorldSandboxClient, WorldSession, type WorldSessionCall, WorldSessionCallError, type WorldSessionListItem, WorldSessionOpenFailed, type WorldSessionRestart, type WorldSessionState, type WorldSessionTask, WorldSessionTimeout, WorldSet, type WorldSqlOptions, type WorldSqlResult, type WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, type WorldTaskCheck, type WorldTaskDetail, type WorldTaskFieldOp, type WorldTaskGrader, type WorldTaskIdRef, type WorldTaskInfo, type WorldTaskPage, type WorldTaskRef, type WorldTaskRubricCriterion, type WorldTaskRubricGrader, type WorldTaskScalar, type WorldTaskSeed, type WorldTaskSpec, type WorldTaskSummary, type WorldTaskValidation, type WorldTaskVerifier, type WorldTaskVerifierRow, type WorldTaskVersionSummary, type WorldTaskWorld, type WorldTaskWorldValidation, type WorldToolSpec, type WorldToolkit, WorldToolsUnread, type WorldWebhookAnswer, type WorldWebhookDelivery, WorldWebhookForwarder, type WorldWebhookListing, type WorldWebhookPage, type WorldWebhookSubscription, type WorldsClientOptions, WriteTreeFilter, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, assertBrowserTier, assertSessionAuthMode, assertTaskRef, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, capabilityLabel, captureToolCalls, carriedWarnings, checkoutIdentity, closeConnection, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, idleWarning, ingest, ingestToolCalls, invalidFields, isBrowserGone, isSandboxCommitPending, isSandboxImportPending, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listRuns, listSessions, listTaskSessions, listTasks, listWebhooks, localTreeState, messageOf, 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, rowsRefusal, runSessions, runSet, runTask, schemaFromSignature, serializeCallBody, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, sqlRows, stillStartingHint, storedForms, surfaceDescriptor, surfaceKinds, taskGradeError, taskLabel, taskRunFailure, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, uncommittedPaths, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, worldRequestsUnrecorded, writeLocalMeta };