@withgateway/sdk 0.6.0 → 0.9.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.
Files changed (119) hide show
  1. package/dist/agents/index.d.mts +573 -0
  2. package/dist/agents/index.d.ts +573 -0
  3. package/dist/agents/index.js +1443 -0
  4. package/dist/agents/index.js.map +1 -0
  5. package/dist/agents/index.mjs +1394 -0
  6. package/dist/agents/index.mjs.map +1 -0
  7. package/dist/apiError-DHpfbmdx.d.mts +17 -0
  8. package/dist/apiError-DHpfbmdx.d.ts +17 -0
  9. package/dist/cli.js +5019 -1599
  10. package/dist/cli.js.map +1 -1
  11. package/dist/cli.mjs +5003 -1584
  12. package/dist/cli.mjs.map +1 -1
  13. package/dist/files/index.d.mts +3 -1
  14. package/dist/files/index.d.ts +3 -1
  15. package/dist/files/index.js +371 -102
  16. package/dist/files/index.js.map +1 -1
  17. package/dist/files/index.mjs +371 -102
  18. package/dist/files/index.mjs.map +1 -1
  19. package/dist/hooks/index.js +346 -136
  20. package/dist/hooks/index.js.map +1 -1
  21. package/dist/hooks/index.mjs +346 -136
  22. package/dist/hooks/index.mjs.map +1 -1
  23. package/dist/{index-LA-PMRJT.d.ts → index-DIN14Lhg.d.ts} +1 -1
  24. package/dist/{index-Di9nNqOY.d.mts → index-DuB-eQ0Z.d.mts} +1 -1
  25. package/dist/index.d.mts +7 -4
  26. package/dist/index.d.ts +7 -4
  27. package/dist/index.js +2689 -401
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +2650 -394
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/media-CQUC7TkS.d.mts +39 -0
  32. package/dist/media-DQnBloaX.d.ts +39 -0
  33. package/dist/traces/index.d.mts +3 -1
  34. package/dist/traces/index.d.ts +3 -1
  35. package/dist/traces/index.js +371 -102
  36. package/dist/traces/index.js.map +1 -1
  37. package/dist/traces/index.mjs +371 -102
  38. package/dist/traces/index.mjs.map +1 -1
  39. package/dist/tracing/index.d.mts +3 -2
  40. package/dist/tracing/index.d.ts +3 -2
  41. package/dist/tracing/index.js +257 -16
  42. package/dist/tracing/index.js.map +1 -1
  43. package/dist/tracing/index.mjs +257 -16
  44. package/dist/tracing/index.mjs.map +1 -1
  45. package/dist/transport-CpRe7zgd.d.mts +123 -0
  46. package/dist/transport-CpRe7zgd.d.ts +123 -0
  47. package/dist/worlds/index.d.mts +1983 -1745
  48. package/dist/worlds/index.d.ts +1983 -1745
  49. package/dist/worlds/index.js +1295 -226
  50. package/dist/worlds/index.js.map +1 -1
  51. package/dist/worlds/index.mjs +1290 -222
  52. package/dist/worlds/index.mjs.map +1 -1
  53. package/package.json +6 -1
  54. package/runtime/gatewaysdk/environment/bundle_manifest.py +243 -0
  55. package/runtime/gatewaysdk/environment/schema/__main__.py +2 -2
  56. package/runtime/gatewaysdk/environment/schema/_slack_fidelity.py +8 -23
  57. package/runtime/gatewaysdk/environment/schema/api.py +3 -4
  58. package/runtime/gatewaysdk/environment/schema/assertions.py +7 -1
  59. package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +1 -0
  60. package/runtime/gatewaysdk/environment/schema/call_log.py +20 -0
  61. package/runtime/gatewaysdk/environment/schema/database/base.py +2 -2
  62. package/runtime/gatewaysdk/environment/schema/host.py +74 -11
  63. package/runtime/gatewaysdk/environment/schema/host_browser.py +48 -0
  64. package/runtime/gatewaysdk/environment/schema/host_control.py +33 -2
  65. package/runtime/gatewaysdk/environment/schema/host_handoff.py +4 -1
  66. package/runtime/gatewaysdk/environment/schema/host_requests.py +14 -0
  67. package/runtime/gatewaysdk/environment/schema/host_session.py +13 -2
  68. package/runtime/gatewaysdk/environment/schema/host_surfaces.py +6 -0
  69. package/runtime/gatewaysdk/environment/schema/host_versions.py +96 -19
  70. package/runtime/gatewaysdk/environment/schema/journal.py +7 -2
  71. package/runtime/gatewaysdk/environment/schema/local.py +32 -7
  72. package/runtime/gatewaysdk/environment/schema/page_checks.py +123 -0
  73. package/runtime/gatewaysdk/environment/schema/platform.py +23 -267
  74. package/runtime/gatewaysdk/environment/schema/platform_templates.py +332 -0
  75. package/runtime/gatewaysdk/environment/schema/request_ledger.py +4 -1
  76. package/runtime/gatewaysdk/environment/schema/run_parameters.py +25 -0
  77. package/runtime/gatewaysdk/environment/schema/runtime.py +43 -5
  78. package/runtime/gatewaysdk/environment/schema/scaffold.py +367 -217
  79. package/runtime/gatewaysdk/environment/schema/session_files.py +13 -2
  80. package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +1 -1
  81. package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +1 -2
  82. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +4 -2
  83. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +7 -7
  84. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +32 -2
  85. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +6 -6
  86. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/journal-checks.md +17 -2
  87. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/new-world-sandbox.md +1 -1
  88. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/ui-map.md +3 -2
  89. package/runtime/gatewaysdk/environment/schema/slack.py +55 -10
  90. package/runtime/gatewaysdk/environment/schema/snapshot.py +28 -2
  91. package/runtime/gatewaysdk/environment/schema/tasks.py +25 -2
  92. package/runtime/gatewaysdk/environment/schema/template_record.py +131 -0
  93. package/runtime/gatewaysdk/environment/schema/tools_world.py +7 -5
  94. package/runtime/gatewaysdk/environment/schema/ui.py +54 -33
  95. package/runtime/gatewaysdk/environment/schema/ui_interactions.py +419 -0
  96. package/runtime/gatewaysdk/environment/schema/ui_recorder.js +895 -0
  97. package/runtime/gatewaysdk/environment/schema/ui_replay.py +366 -0
  98. package/runtime/gatewaysdk/environment/schema/ui_replay_record.LICENSE +25 -0
  99. package/runtime/gatewaysdk/environment/schema/ui_replay_record.js +109 -0
  100. package/runtime/gatewaysdk/environment/schema/validation.py +10 -1
  101. package/runtime/gatewaysdk/environment/schema/worker.py +5 -1
  102. package/runtime/gatewaysdk/environment/schema/workers.py +8 -1
  103. package/runtime/gatewaysdk/environment/schema/world_host.py +44 -15
  104. package/runtime/gatewaysdk/environment/secret_values.py +1 -1
  105. package/runtime/gatewaysdk/environment/world.py +34 -43
  106. package/runtime/gatewaysdk/environment/world_session_contract.py +7 -34
  107. package/skills/benchmarks-getting-started/SKILL.md +1 -1
  108. package/skills/connector-schema-authoring/SKILL.md +1 -2
  109. package/skills/connector-schema-authoring/connector-worlds.md +2 -2
  110. package/skills/connector-schema-authoring/world-schema.md +29 -23
  111. package/skills/world-data-ingestion/SKILL.md +4 -2
  112. package/skills/worlds-getting-started/SKILL.md +7 -7
  113. package/skills/worlds-getting-started/references/cli-mcp-map.md +32 -2
  114. package/skills/worlds-getting-started/references/gotchas.md +6 -6
  115. package/skills/worlds-getting-started/references/journal-checks.md +17 -2
  116. package/skills/worlds-getting-started/references/new-world-sandbox.md +1 -1
  117. package/skills/worlds-getting-started/references/ui-map.md +3 -2
  118. package/dist/media-BIApiPzS.d.mts +0 -102
  119. package/dist/media-BIApiPzS.d.ts +0 -102
@@ -19,7 +19,7 @@ What `open` does and does not do:
19
19
  - The slug goes through the one world slug validator and must be free in the project. A taken
20
20
  slug is a 409 `world_exists`; the sandbox never renames it (pick another slug).
21
21
  - `--from custom` seeds the working tree with exactly what `gateway worlds schema init <slug>`
22
- writes; `--from <template>` with a shipped template (`gateway worlds schema templates`,
22
+ writes; `--from <template>` with an official template (`gateway worlds schema templates`,
23
23
  `GET /api/public/worlds/templates`). An unknown template is a 400 that names the list.
24
24
  - No world, container or version is created at open. `open`/`status` say so:
25
25
  `containerId: null`, `baseVersionId: null`, `baseContentHash: null`, `branch: "main"`,
@@ -5,8 +5,9 @@ is the world's container.
5
5
 
6
6
  | Thing | Where |
7
7
  | --- | --- |
8
- | Connectors, shipped and workspace, with Create world / Clone; New connector | Connectors page `/project/{projectId}/connectors` |
9
- | One connector: Overview (verdict + schema), API (served routes, tools), Worlds (built from it, Cancel/Retry) | `/project/{projectId}/connectors/{slug}` |
8
+ | Public worlds of every organization, then connectors, shipped and workspace, with Create world / Clone; New connector | WorldHub `/project/{projectId}/worldhub` (`/connectors` redirects) |
9
+ | One connector: Overview (verdict + schema), API (served routes, tools), Worlds (built from it, Cancel/Retry), UI | `/project/{projectId}/worldhub/{slug}` |
10
+ | A public world as another organization sees it: Overview (schema of `main`), API, History (code changes only) | `/project/{projectId}/worldhub/worlds/{containerId}` |
10
11
  | A world: tabs Overview, Scenarios, Schema, Results, Evals, History | `/project/{projectId}/world?env={containerId}&tab=<tab>` |
11
12
  | Schema tab: entities, tool schemas, the pin back to the connector, and the Redaction tile (per-field hash / preserve / round / drop, salt = connector slug) | `...&tab=schema` |
12
13
  | Overview: provenance (type, "Created from <connector> <version>", author), then Relationships — Links picture, Uses (pin → resolved version, entity mappings with transform chains), Used by; unresolved pins shown, never omitted | `...&tab=overview` |
@@ -1,102 +0,0 @@
1
- declare const PLATFORM_TIMEOUT_ENV = "GATEWAY_TIMEOUT_MS";
2
- /** How long one platform request may go unanswered before it is abandoned; `GATEWAY_TIMEOUT_MS` overrides it. */
3
- declare const PLATFORM_TIMEOUT_DEFAULT_MS = 120000;
4
- type PlatformEndpoint = {
5
- host: string;
6
- publicKey: string;
7
- secretKey: string;
8
- };
9
- type PlatformMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
10
- type PlatformReply = {
11
- status: number;
12
- ok: boolean;
13
- text: string;
14
- };
15
- /** The request budget in force: `GATEWAY_TIMEOUT_MS` when set, else the default. */
16
- declare function platformTimeoutMs(env?: NodeJS.ProcessEnv): number;
17
- /** Why a request got no answer, from the socket-level error undici hides under `fetch failed`. */
18
- declare class TransportCause {
19
- readonly reason: string;
20
- readonly detail: string | null;
21
- readonly next: string;
22
- private constructor();
23
- static timeout(timeoutMs: number): TransportCause;
24
- static of(error: unknown): TransportCause;
25
- describe(): string;
26
- }
27
- /** A platform request that never got an answer: one line naming the request, the host, the cause and the next step. */
28
- declare class UnreachableError extends Error {
29
- readonly host: string;
30
- readonly method: string;
31
- readonly route: string;
32
- readonly failure: TransportCause;
33
- constructor(host: string, method: string, route: string, failure: TransportCause);
34
- }
35
- /**
36
- * Another attempt after a gateway 5xx (502, 503, 504) or no answer at all, for a request whose repeat is harmless: a
37
- * keyed filing step, which the platform answers with the first filing. Every other request gets one attempt (`NONE`).
38
- */
39
- declare class RetryPolicy {
40
- readonly delaysMs: readonly number[];
41
- private readonly wait;
42
- readonly budgetMs: number;
43
- private readonly now;
44
- static readonly NONE: RetryPolicy;
45
- /** A platform restart or a short edge outage: no wait starts that would end past five minutes, so a step ends
46
- * within the budget plus one request timeout. */
47
- static readonly FILING: RetryPolicy;
48
- static readonly TRANSIENT_STATUSES: ReadonlySet<number>;
49
- constructor(delaysMs: readonly number[], wait?: (ms: number) => Promise<void>, budgetMs?: number, now?: () => number);
50
- run(attempt: () => Promise<PlatformReply>): Promise<PlatformReply>;
51
- }
52
- /** The one door every CLI and SDK request to the platform goes through: Basic auth with the project key, a per-request timeout, and a transport failure turned into an `UnreachableError`. */
53
- declare class PlatformTransport {
54
- private readonly endpoint;
55
- private readonly timeoutMs;
56
- constructor(endpoint: PlatformEndpoint, timeoutMs?: number);
57
- /** A request that legitimately takes longer (a sandbox exec, a world create) waits its own budget; every other one waits the default. */
58
- budget(ownMs?: number): number;
59
- send(method: PlatformMethod, route: string, body?: unknown, opts?: {
60
- timeoutMs?: number;
61
- retry?: RetryPolicy;
62
- }): Promise<PlatformReply>;
63
- private once;
64
- }
65
-
66
- declare const MAX_MEDIA_BYTES: number;
67
- type MediaField = "input" | "output" | "metadata";
68
- declare class MediaUploadError extends Error {
69
- readonly status?: number | undefined;
70
- constructor(message: string, status?: number | undefined);
71
- }
72
- declare class MediaReference {
73
- readonly mediaId: string;
74
- readonly contentType: string;
75
- constructor(mediaId: string, contentType: string);
76
- toString(): string;
77
- }
78
- type PutBytes = (url: string, data: Buffer, headers: Record<string, string>) => Promise<{
79
- status: number;
80
- error: string | null;
81
- }>;
82
- /** Uploads media for one project (the key pair's). */
83
- declare class MediaUploader {
84
- private readonly transport;
85
- private readonly put;
86
- maxBytes: number;
87
- constructor(transport: PlatformTransport, put?: PutBytes, maxBytes?: number);
88
- /** The uploader for `GATEWAY_HOST` / `GATEWAY_PUBLIC_KEY` /
89
- * `GATEWAY_SECRET_KEY` only; null when any is unset, so a run traced with a saved login uploads none. */
90
- static fromEnv(env?: NodeJS.ProcessEnv): MediaUploader | null;
91
- /** Store `data` linked to the trace (and observation) and return its reference. */
92
- upload(data: Buffer, link: {
93
- contentType: string;
94
- traceId: string;
95
- observationId: string | null;
96
- field: MediaField;
97
- }): Promise<MediaReference>;
98
- private store;
99
- private send;
100
- }
101
-
102
- export { MAX_MEDIA_BYTES as M, PLATFORM_TIMEOUT_DEFAULT_MS as P, RetryPolicy as R, TransportCause as T, UnreachableError as U, PLATFORM_TIMEOUT_ENV as a, type PlatformEndpoint as b, type PlatformMethod as c, type PlatformReply as d, PlatformTransport as e, type MediaField as f, MediaReference as g, MediaUploadError as h, MediaUploader as i, platformTimeoutMs as p };
@@ -1,102 +0,0 @@
1
- declare const PLATFORM_TIMEOUT_ENV = "GATEWAY_TIMEOUT_MS";
2
- /** How long one platform request may go unanswered before it is abandoned; `GATEWAY_TIMEOUT_MS` overrides it. */
3
- declare const PLATFORM_TIMEOUT_DEFAULT_MS = 120000;
4
- type PlatformEndpoint = {
5
- host: string;
6
- publicKey: string;
7
- secretKey: string;
8
- };
9
- type PlatformMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
10
- type PlatformReply = {
11
- status: number;
12
- ok: boolean;
13
- text: string;
14
- };
15
- /** The request budget in force: `GATEWAY_TIMEOUT_MS` when set, else the default. */
16
- declare function platformTimeoutMs(env?: NodeJS.ProcessEnv): number;
17
- /** Why a request got no answer, from the socket-level error undici hides under `fetch failed`. */
18
- declare class TransportCause {
19
- readonly reason: string;
20
- readonly detail: string | null;
21
- readonly next: string;
22
- private constructor();
23
- static timeout(timeoutMs: number): TransportCause;
24
- static of(error: unknown): TransportCause;
25
- describe(): string;
26
- }
27
- /** A platform request that never got an answer: one line naming the request, the host, the cause and the next step. */
28
- declare class UnreachableError extends Error {
29
- readonly host: string;
30
- readonly method: string;
31
- readonly route: string;
32
- readonly failure: TransportCause;
33
- constructor(host: string, method: string, route: string, failure: TransportCause);
34
- }
35
- /**
36
- * Another attempt after a gateway 5xx (502, 503, 504) or no answer at all, for a request whose repeat is harmless: a
37
- * keyed filing step, which the platform answers with the first filing. Every other request gets one attempt (`NONE`).
38
- */
39
- declare class RetryPolicy {
40
- readonly delaysMs: readonly number[];
41
- private readonly wait;
42
- readonly budgetMs: number;
43
- private readonly now;
44
- static readonly NONE: RetryPolicy;
45
- /** A platform restart or a short edge outage: no wait starts that would end past five minutes, so a step ends
46
- * within the budget plus one request timeout. */
47
- static readonly FILING: RetryPolicy;
48
- static readonly TRANSIENT_STATUSES: ReadonlySet<number>;
49
- constructor(delaysMs: readonly number[], wait?: (ms: number) => Promise<void>, budgetMs?: number, now?: () => number);
50
- run(attempt: () => Promise<PlatformReply>): Promise<PlatformReply>;
51
- }
52
- /** The one door every CLI and SDK request to the platform goes through: Basic auth with the project key, a per-request timeout, and a transport failure turned into an `UnreachableError`. */
53
- declare class PlatformTransport {
54
- private readonly endpoint;
55
- private readonly timeoutMs;
56
- constructor(endpoint: PlatformEndpoint, timeoutMs?: number);
57
- /** A request that legitimately takes longer (a sandbox exec, a world create) waits its own budget; every other one waits the default. */
58
- budget(ownMs?: number): number;
59
- send(method: PlatformMethod, route: string, body?: unknown, opts?: {
60
- timeoutMs?: number;
61
- retry?: RetryPolicy;
62
- }): Promise<PlatformReply>;
63
- private once;
64
- }
65
-
66
- declare const MAX_MEDIA_BYTES: number;
67
- type MediaField = "input" | "output" | "metadata";
68
- declare class MediaUploadError extends Error {
69
- readonly status?: number | undefined;
70
- constructor(message: string, status?: number | undefined);
71
- }
72
- declare class MediaReference {
73
- readonly mediaId: string;
74
- readonly contentType: string;
75
- constructor(mediaId: string, contentType: string);
76
- toString(): string;
77
- }
78
- type PutBytes = (url: string, data: Buffer, headers: Record<string, string>) => Promise<{
79
- status: number;
80
- error: string | null;
81
- }>;
82
- /** Uploads media for one project (the key pair's). */
83
- declare class MediaUploader {
84
- private readonly transport;
85
- private readonly put;
86
- maxBytes: number;
87
- constructor(transport: PlatformTransport, put?: PutBytes, maxBytes?: number);
88
- /** The uploader for `GATEWAY_HOST` / `GATEWAY_PUBLIC_KEY` /
89
- * `GATEWAY_SECRET_KEY` only; null when any is unset, so a run traced with a saved login uploads none. */
90
- static fromEnv(env?: NodeJS.ProcessEnv): MediaUploader | null;
91
- /** Store `data` linked to the trace (and observation) and return its reference. */
92
- upload(data: Buffer, link: {
93
- contentType: string;
94
- traceId: string;
95
- observationId: string | null;
96
- field: MediaField;
97
- }): Promise<MediaReference>;
98
- private store;
99
- private send;
100
- }
101
-
102
- export { MAX_MEDIA_BYTES as M, PLATFORM_TIMEOUT_DEFAULT_MS as P, RetryPolicy as R, TransportCause as T, UnreachableError as U, PLATFORM_TIMEOUT_ENV as a, type PlatformEndpoint as b, type PlatformMethod as c, type PlatformReply as d, PlatformTransport as e, type MediaField as f, MediaReference as g, MediaUploadError as h, MediaUploader as i, platformTimeoutMs as p };