@withgateway/sdk 0.2.4 → 0.2.6

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 (85) hide show
  1. package/dist/cli.js +4304 -2381
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +4266 -2343
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/files/index.js +56 -31
  6. package/dist/files/index.js.map +1 -1
  7. package/dist/files/index.mjs +52 -27
  8. package/dist/files/index.mjs.map +1 -1
  9. package/dist/hooks/index.d.mts +1 -1
  10. package/dist/hooks/index.d.ts +1 -1
  11. package/dist/hooks/index.js +280 -8
  12. package/dist/hooks/index.js.map +1 -1
  13. package/dist/hooks/index.mjs +272 -8
  14. package/dist/hooks/index.mjs.map +1 -1
  15. package/dist/{index-1xnxt0Cc.d.ts → index-BO2SNSgy.d.ts} +12 -1
  16. package/dist/{index-B0R3IgsV.d.mts → index-BaKu5ZSU.d.mts} +124 -2
  17. package/dist/{index-B0R3IgsV.d.ts → index-BaKu5ZSU.d.ts} +124 -2
  18. package/dist/{index-C1wDEwH4.d.mts → index-Cz8Q6Keo.d.mts} +12 -1
  19. package/dist/index.d.mts +4 -4
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +1100 -438
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +1079 -424
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/traces/index.js +45 -20
  26. package/dist/traces/index.js.map +1 -1
  27. package/dist/traces/index.mjs +41 -16
  28. package/dist/traces/index.mjs.map +1 -1
  29. package/dist/tracing/index.d.mts +1 -1
  30. package/dist/tracing/index.d.ts +1 -1
  31. package/dist/tracing/index.js +98 -61
  32. package/dist/tracing/index.js.map +1 -1
  33. package/dist/tracing/index.mjs +98 -61
  34. package/dist/tracing/index.mjs.map +1 -1
  35. package/dist/worlds/index.d.mts +179 -25
  36. package/dist/worlds/index.d.ts +179 -25
  37. package/dist/worlds/index.js +639 -284
  38. package/dist/worlds/index.js.map +1 -1
  39. package/dist/worlds/index.mjs +631 -276
  40. package/dist/worlds/index.mjs.map +1 -1
  41. package/package.json +2 -1
  42. package/runtime/gatewaysdk/environment/_bundle.py +15 -25
  43. package/runtime/gatewaysdk/environment/_materialize.py +53 -9
  44. package/runtime/gatewaysdk/environment/_toml.py +13 -0
  45. package/runtime/gatewaysdk/environment/schema/api.py +40 -25
  46. package/runtime/gatewaysdk/environment/schema/batch.py +15 -11
  47. package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +24 -0
  48. package/runtime/gatewaysdk/environment/schema/compiler.py +60 -28
  49. package/runtime/gatewaysdk/environment/schema/conform.py +1 -1
  50. package/runtime/gatewaysdk/environment/schema/connector.py +1 -1
  51. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/readers/merge.ingest.toml +25 -0
  52. package/runtime/gatewaysdk/environment/schema/connectors/google-drive/readers/merge.toml +17 -0
  53. package/runtime/gatewaysdk/environment/schema/data.py +21 -19
  54. package/runtime/gatewaysdk/environment/schema/extract.py +1 -5
  55. package/runtime/gatewaysdk/environment/schema/grading.py +225 -0
  56. package/runtime/gatewaysdk/environment/schema/host.py +156 -546
  57. package/runtime/gatewaysdk/environment/schema/host_surfaces.py +1 -5
  58. package/runtime/gatewaysdk/environment/schema/ingest.py +3 -11
  59. package/runtime/gatewaysdk/environment/schema/local.py +32 -126
  60. package/runtime/gatewaysdk/environment/schema/mapping.py +1 -1
  61. package/runtime/gatewaysdk/environment/schema/platform.py +30 -26
  62. package/runtime/gatewaysdk/environment/schema/proof.py +237 -0
  63. package/runtime/gatewaysdk/environment/schema/redaction.py +1 -1
  64. package/runtime/gatewaysdk/environment/schema/runtime.py +686 -0
  65. package/runtime/gatewaysdk/environment/schema/scaffold.py +9 -2
  66. package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
  67. package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +67 -9
  68. package/runtime/gatewaysdk/environment/schema/skills/hooks-getting-started/SKILL.md +67 -6
  69. package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +4 -1
  70. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +11 -11
  71. package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +17 -1
  72. package/runtime/gatewaysdk/environment/schema/snapshot.py +1 -5
  73. package/runtime/gatewaysdk/environment/schema/tools_world.py +71 -23
  74. package/runtime/gatewaysdk/environment/schema/ui.py +1 -5
  75. package/runtime/gatewaysdk/environment/schema/verbs.py +136 -0
  76. package/runtime/gatewaysdk/environment/schema/workers.py +14 -0
  77. package/runtime/gatewaysdk/environment/schema/world_tests.py +1 -1
  78. package/runtime/gatewaysdk/environment/world.py +507 -0
  79. package/skills/benchmarks-getting-started/SKILL.md +67 -9
  80. package/skills/connector-schema-authoring/connector-worlds.md +8 -1
  81. package/skills/connector-schema-authoring/world-schema.md +1 -1
  82. package/skills/hooks-getting-started/SKILL.md +67 -6
  83. package/skills/world-data-ingestion/SKILL.md +4 -1
  84. package/skills/worlds-getting-started/SKILL.md +11 -11
  85. package/skills/worlds-getting-started/references/cli-mcp-map.md +17 -1
@@ -93,17 +93,32 @@ var init_taskRun = __esm({
93
93
  }
94
94
  });
95
95
 
96
+ // src/worlds/worldDir.ts
97
+ var import_node_crypto3, fs2, path2, CONNECTOR_SPEC, WORLD_SCHEMA_MARKERS, WORLD_ROOT_MARKERS;
98
+ var init_worldDir = __esm({
99
+ "src/worlds/worldDir.ts"() {
100
+ "use strict";
101
+ import_node_crypto3 = require("crypto");
102
+ fs2 = __toESM(require("fs"));
103
+ path2 = __toESM(require("path"));
104
+ CONNECTOR_SPEC = "connector.toml";
105
+ WORLD_SCHEMA_MARKERS = ["schema/world.json", "schema/runtime.json", "schema/lock.json"];
106
+ WORLD_ROOT_MARKERS = [CONNECTOR_SPEC, ...WORLD_SCHEMA_MARKERS];
107
+ }
108
+ });
109
+
96
110
  // src/worlds/hub.ts
97
- var import_node_crypto3, import_node_zlib, fs2, path2, META_RELPATH;
111
+ var import_node_crypto4, import_node_zlib, fs3, path3, META_RELPATH;
98
112
  var init_hub = __esm({
99
113
  "src/worlds/hub.ts"() {
100
114
  "use strict";
101
- import_node_crypto3 = require("crypto");
115
+ import_node_crypto4 = require("crypto");
102
116
  import_node_zlib = require("zlib");
103
- fs2 = __toESM(require("fs"));
104
- path2 = __toESM(require("path"));
117
+ fs3 = __toESM(require("fs"));
118
+ path3 = __toESM(require("path"));
105
119
  init_worlds();
106
- META_RELPATH = path2.join(".gateway", ".env-metadata.json");
120
+ init_worldDir();
121
+ META_RELPATH = path3.join(".gateway", ".env-metadata.json");
107
122
  }
108
123
  });
109
124
 
@@ -132,14 +147,15 @@ var init_json = __esm({
132
147
  });
133
148
 
134
149
  // src/worlds/transforms.ts
135
- var import_node_crypto4, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, hex, SIMPLE, TRANSFORMS;
150
+ var import_node_crypto5, WHITESPACE, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, hex, SIMPLE, TRANSFORMS;
136
151
  var init_transforms = __esm({
137
152
  "src/worlds/transforms.ts"() {
138
153
  "use strict";
139
- import_node_crypto4 = require("crypto");
154
+ import_node_crypto5 = require("crypto");
140
155
  init_json();
141
- WHITESPACE_EDGES = /^[ \t\n\r\f\v]+|[ \t\n\r\f\v]+$/g;
142
- WHITESPACE_RUN = /[ \t\n\r\f\v]+/g;
156
+ WHITESPACE = " \n\r\f\v";
157
+ WHITESPACE_EDGES = new RegExp(`^[${WHITESPACE}]+|[${WHITESPACE}]+$`, "g");
158
+ WHITESPACE_RUN = new RegExp(`[${WHITESPACE}]+`, "g");
143
159
  NOT_DIGIT = /[^0-9]/g;
144
160
  STRIP_PREFIX = "strip_prefix";
145
161
  trim = (value) => value.replace(WHITESPACE_EDGES, "");
@@ -151,7 +167,7 @@ var init_transforms = __esm({
151
167
  const at = value.lastIndexOf("@");
152
168
  return at === -1 ? "" : value.slice(at + 1).toLowerCase();
153
169
  };
154
- hex = (algorithm, value) => (0, import_node_crypto4.createHash)(algorithm).update(value, "utf8").digest("hex");
170
+ hex = (algorithm, value) => (0, import_node_crypto5.createHash)(algorithm).update(value, "utf8").digest("hex");
155
171
  SIMPLE = {
156
172
  lower: (value) => value.toLowerCase(),
157
173
  upper: (value) => value.toUpperCase(),
@@ -171,11 +187,11 @@ var init_transforms = __esm({
171
187
  });
172
188
 
173
189
  // src/worlds/redaction.ts
174
- var import_node_crypto5;
190
+ var import_node_crypto6;
175
191
  var init_redaction = __esm({
176
192
  "src/worlds/redaction.ts"() {
177
193
  "use strict";
178
- import_node_crypto5 = require("crypto");
194
+ import_node_crypto6 = require("crypto");
179
195
  init_json();
180
196
  init_transforms();
181
197
  }
@@ -198,13 +214,21 @@ var init_migrate = __esm({
198
214
  });
199
215
 
200
216
  // src/worlds/ingest.ts
201
- var fs3, os, path3;
217
+ var fs4, os, path4;
202
218
  var init_ingest = __esm({
203
219
  "src/worlds/ingest.ts"() {
204
220
  "use strict";
205
- fs3 = __toESM(require("fs"));
221
+ fs4 = __toESM(require("fs"));
206
222
  os = __toESM(require("os"));
207
- path3 = __toESM(require("path"));
223
+ path4 = __toESM(require("path"));
224
+ init_worlds();
225
+ }
226
+ });
227
+
228
+ // src/worlds/sandbox.ts
229
+ var init_sandbox = __esm({
230
+ "src/worlds/sandbox.ts"() {
231
+ "use strict";
208
232
  init_worlds();
209
233
  }
210
234
  });
@@ -221,9 +245,9 @@ function resolveEnv(options) {
221
245
  }
222
246
  return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
223
247
  }
224
- async function apiRequest(options, method, path4, body) {
248
+ async function apiRequest(options, method, path5, body) {
225
249
  const { host, publicKey, secretKey } = resolveEnv(options);
226
- const res = await fetch(`${host}${path4}`, {
250
+ const res = await fetch(`${host}${path5}`, {
227
251
  method,
228
252
  headers: {
229
253
  "content-type": "application/json",
@@ -232,7 +256,7 @@ async function apiRequest(options, method, path4, body) {
232
256
  ...body === void 0 ? {} : { body: JSON.stringify(body) }
233
257
  });
234
258
  const text = await res.text();
235
- if (!res.ok) throw new ApiError(res.status, method, path4, text.slice(0, 400));
259
+ if (!res.ok) throw new ApiError(res.status, method, path5, text.slice(0, 400));
236
260
  return JSON.parse(text);
237
261
  }
238
262
  var ApiError;
@@ -253,9 +277,10 @@ var init_worlds = __esm({
253
277
  init_query();
254
278
  init_migrate();
255
279
  init_ingest();
280
+ init_sandbox();
256
281
  ApiError = class extends Error {
257
- constructor(status, method, path4, body) {
258
- super(`${method} ${path4} -> ${status}: ${body}`);
282
+ constructor(status, method, path5, body) {
283
+ super(`${method} ${path5} -> ${status}: ${body}`);
259
284
  this.status = status;
260
285
  this.name = "ApiError";
261
286
  }