@withgateway/sdk 0.2.4 → 0.2.5

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 (46) hide show
  1. package/dist/cli.js +1798 -1713
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +2412 -2327
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/files/index.js +47 -31
  6. package/dist/files/index.js.map +1 -1
  7. package/dist/files/index.mjs +43 -27
  8. package/dist/files/index.mjs.map +1 -1
  9. package/dist/index.d.mts +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +390 -287
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +375 -271
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/traces/index.js +36 -20
  16. package/dist/traces/index.js.map +1 -1
  17. package/dist/traces/index.mjs +32 -16
  18. package/dist/traces/index.mjs.map +1 -1
  19. package/dist/tracing/index.js +2 -1
  20. package/dist/tracing/index.js.map +1 -1
  21. package/dist/tracing/index.mjs +2 -1
  22. package/dist/tracing/index.mjs.map +1 -1
  23. package/dist/worlds/index.d.mts +26 -22
  24. package/dist/worlds/index.d.ts +26 -22
  25. package/dist/worlds/index.js +307 -203
  26. package/dist/worlds/index.js.map +1 -1
  27. package/dist/worlds/index.mjs +297 -193
  28. package/dist/worlds/index.mjs.map +1 -1
  29. package/package.json +2 -1
  30. package/runtime/gatewaysdk/environment/_bundle.py +14 -24
  31. package/runtime/gatewaysdk/environment/schema/api.py +37 -18
  32. package/runtime/gatewaysdk/environment/schema/data.py +21 -19
  33. package/runtime/gatewaysdk/environment/schema/grading.py +225 -0
  34. package/runtime/gatewaysdk/environment/schema/host.py +156 -546
  35. package/runtime/gatewaysdk/environment/schema/ingest.py +3 -11
  36. package/runtime/gatewaysdk/environment/schema/local.py +32 -126
  37. package/runtime/gatewaysdk/environment/schema/platform.py +14 -22
  38. package/runtime/gatewaysdk/environment/schema/proof.py +237 -0
  39. package/runtime/gatewaysdk/environment/schema/runtime.py +686 -0
  40. package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
  41. package/runtime/gatewaysdk/environment/schema/skills/hooks-getting-started/SKILL.md +6 -4
  42. package/runtime/gatewaysdk/environment/schema/tools_world.py +75 -23
  43. package/runtime/gatewaysdk/environment/schema/verbs.py +136 -0
  44. package/runtime/gatewaysdk/environment/schema/workers.py +14 -0
  45. package/runtime/gatewaysdk/environment/world.py +391 -0
  46. package/skills/hooks-getting-started/SKILL.md +6 -4
@@ -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,13 @@ 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"));
208
224
  init_worlds();
209
225
  }
210
226
  });
@@ -221,9 +237,9 @@ function resolveEnv(options) {
221
237
  }
222
238
  return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
223
239
  }
224
- async function apiRequest(options, method, path4, body) {
240
+ async function apiRequest(options, method, path5, body) {
225
241
  const { host, publicKey, secretKey } = resolveEnv(options);
226
- const res = await fetch(`${host}${path4}`, {
242
+ const res = await fetch(`${host}${path5}`, {
227
243
  method,
228
244
  headers: {
229
245
  "content-type": "application/json",
@@ -232,7 +248,7 @@ async function apiRequest(options, method, path4, body) {
232
248
  ...body === void 0 ? {} : { body: JSON.stringify(body) }
233
249
  });
234
250
  const text = await res.text();
235
- if (!res.ok) throw new ApiError(res.status, method, path4, text.slice(0, 400));
251
+ if (!res.ok) throw new ApiError(res.status, method, path5, text.slice(0, 400));
236
252
  return JSON.parse(text);
237
253
  }
238
254
  var ApiError;
@@ -254,8 +270,8 @@ var init_worlds = __esm({
254
270
  init_migrate();
255
271
  init_ingest();
256
272
  ApiError = class extends Error {
257
- constructor(status, method, path4, body) {
258
- super(`${method} ${path4} -> ${status}: ${body}`);
273
+ constructor(status, method, path5, body) {
274
+ super(`${method} ${path5} -> ${status}: ${body}`);
259
275
  this.status = status;
260
276
  this.name = "ApiError";
261
277
  }