@withgateway/sdk 0.2.3 → 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.
- package/dist/cli.js +13267 -5869
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +13272 -5874
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.js +83 -31
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +79 -28
- package/dist/files/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +4355 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +4243 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/{index-Dpo-t8iO.d.ts → index-1xnxt0Cc.d.ts} +58 -2
- package/dist/index-B0R3IgsV.d.mts +1279 -0
- package/dist/index-B0R3IgsV.d.ts +1279 -0
- package/dist/{index-B5HUQQDE.d.mts → index-C1wDEwH4.d.mts} +58 -2
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +6698 -1606
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6793 -1713
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.js +72 -20
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +68 -17
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.d.mts +1 -1
- package/dist/tracing/index.d.ts +1 -1
- package/dist/tracing/index.js +47 -3
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +42 -2
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +390 -27
- package/dist/worlds/index.d.ts +390 -27
- package/dist/worlds/index.js +2291 -366
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +2281 -356
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +7 -1
- package/runtime/gatewaysdk/environment/_bundle.py +14 -24
- package/runtime/gatewaysdk/environment/_materialize.py +3 -3
- package/runtime/gatewaysdk/environment/schema/api.py +153 -20
- package/runtime/gatewaysdk/environment/schema/compiler.py +14 -0
- package/runtime/gatewaysdk/environment/schema/data.py +21 -19
- package/runtime/gatewaysdk/environment/schema/grading.py +225 -0
- package/runtime/gatewaysdk/environment/schema/host.py +171 -535
- package/runtime/gatewaysdk/environment/schema/ingest.py +3 -11
- package/runtime/gatewaysdk/environment/schema/local.py +32 -126
- package/runtime/gatewaysdk/environment/schema/platform.py +14 -22
- package/runtime/gatewaysdk/environment/schema/proof.py +237 -0
- package/runtime/gatewaysdk/environment/schema/runtime.py +686 -0
- package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
- package/runtime/gatewaysdk/environment/schema/skills/hooks-getting-started/SKILL.md +156 -0
- package/runtime/gatewaysdk/environment/schema/snapshot.py +6 -5
- package/runtime/gatewaysdk/environment/schema/tasks.py +12 -2
- package/runtime/gatewaysdk/environment/schema/tools_world.py +75 -23
- package/runtime/gatewaysdk/environment/schema/verbs.py +136 -0
- package/runtime/gatewaysdk/environment/schema/workers.py +44 -13
- package/runtime/gatewaysdk/environment/world.py +391 -0
- package/skills/hooks-getting-started/SKILL.md +156 -0
package/dist/traces/index.js
CHANGED
|
@@ -60,17 +60,65 @@ var init_tasks = __esm({
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
// src/worlds/taskSessions.ts
|
|
64
|
+
var init_taskSessions = __esm({
|
|
65
|
+
"src/worlds/taskSessions.ts"() {
|
|
66
|
+
"use strict";
|
|
67
|
+
init_worlds();
|
|
68
|
+
init_browser();
|
|
69
|
+
init_session();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// src/worlds/evals.ts
|
|
74
|
+
var init_evals = __esm({
|
|
75
|
+
"src/worlds/evals.ts"() {
|
|
76
|
+
"use strict";
|
|
77
|
+
init_worlds();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// src/worlds/taskRun.ts
|
|
82
|
+
var import_node_crypto2, fs, path;
|
|
83
|
+
var init_taskRun = __esm({
|
|
84
|
+
"src/worlds/taskRun.ts"() {
|
|
85
|
+
"use strict";
|
|
86
|
+
import_node_crypto2 = require("crypto");
|
|
87
|
+
fs = __toESM(require("fs"));
|
|
88
|
+
path = __toESM(require("path"));
|
|
89
|
+
init_browser();
|
|
90
|
+
init_evals();
|
|
91
|
+
init_session();
|
|
92
|
+
init_taskSessions();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
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
|
+
|
|
63
110
|
// src/worlds/hub.ts
|
|
64
|
-
var
|
|
111
|
+
var import_node_crypto4, import_node_zlib, fs3, path3, META_RELPATH;
|
|
65
112
|
var init_hub = __esm({
|
|
66
113
|
"src/worlds/hub.ts"() {
|
|
67
114
|
"use strict";
|
|
68
|
-
|
|
115
|
+
import_node_crypto4 = require("crypto");
|
|
69
116
|
import_node_zlib = require("zlib");
|
|
70
|
-
|
|
71
|
-
|
|
117
|
+
fs3 = __toESM(require("fs"));
|
|
118
|
+
path3 = __toESM(require("path"));
|
|
72
119
|
init_worlds();
|
|
73
|
-
|
|
120
|
+
init_worldDir();
|
|
121
|
+
META_RELPATH = path3.join(".gateway", ".env-metadata.json");
|
|
74
122
|
}
|
|
75
123
|
});
|
|
76
124
|
|
|
@@ -99,14 +147,15 @@ var init_json = __esm({
|
|
|
99
147
|
});
|
|
100
148
|
|
|
101
149
|
// src/worlds/transforms.ts
|
|
102
|
-
var
|
|
150
|
+
var import_node_crypto5, WHITESPACE, WHITESPACE_EDGES, WHITESPACE_RUN, NOT_DIGIT, STRIP_PREFIX, trim, emailLocalPart, emailDomain, hex, SIMPLE, TRANSFORMS;
|
|
103
151
|
var init_transforms = __esm({
|
|
104
152
|
"src/worlds/transforms.ts"() {
|
|
105
153
|
"use strict";
|
|
106
|
-
|
|
154
|
+
import_node_crypto5 = require("crypto");
|
|
107
155
|
init_json();
|
|
108
|
-
|
|
109
|
-
|
|
156
|
+
WHITESPACE = " \n\r\f\v";
|
|
157
|
+
WHITESPACE_EDGES = new RegExp(`^[${WHITESPACE}]+|[${WHITESPACE}]+$`, "g");
|
|
158
|
+
WHITESPACE_RUN = new RegExp(`[${WHITESPACE}]+`, "g");
|
|
110
159
|
NOT_DIGIT = /[^0-9]/g;
|
|
111
160
|
STRIP_PREFIX = "strip_prefix";
|
|
112
161
|
trim = (value) => value.replace(WHITESPACE_EDGES, "");
|
|
@@ -118,7 +167,7 @@ var init_transforms = __esm({
|
|
|
118
167
|
const at = value.lastIndexOf("@");
|
|
119
168
|
return at === -1 ? "" : value.slice(at + 1).toLowerCase();
|
|
120
169
|
};
|
|
121
|
-
hex = (algorithm, value) => (0,
|
|
170
|
+
hex = (algorithm, value) => (0, import_node_crypto5.createHash)(algorithm).update(value, "utf8").digest("hex");
|
|
122
171
|
SIMPLE = {
|
|
123
172
|
lower: (value) => value.toLowerCase(),
|
|
124
173
|
upper: (value) => value.toUpperCase(),
|
|
@@ -138,11 +187,11 @@ var init_transforms = __esm({
|
|
|
138
187
|
});
|
|
139
188
|
|
|
140
189
|
// src/worlds/redaction.ts
|
|
141
|
-
var
|
|
190
|
+
var import_node_crypto6;
|
|
142
191
|
var init_redaction = __esm({
|
|
143
192
|
"src/worlds/redaction.ts"() {
|
|
144
193
|
"use strict";
|
|
145
|
-
|
|
194
|
+
import_node_crypto6 = require("crypto");
|
|
146
195
|
init_json();
|
|
147
196
|
init_transforms();
|
|
148
197
|
}
|
|
@@ -165,13 +214,13 @@ var init_migrate = __esm({
|
|
|
165
214
|
});
|
|
166
215
|
|
|
167
216
|
// src/worlds/ingest.ts
|
|
168
|
-
var
|
|
217
|
+
var fs4, os, path4;
|
|
169
218
|
var init_ingest = __esm({
|
|
170
219
|
"src/worlds/ingest.ts"() {
|
|
171
220
|
"use strict";
|
|
172
|
-
|
|
221
|
+
fs4 = __toESM(require("fs"));
|
|
173
222
|
os = __toESM(require("os"));
|
|
174
|
-
|
|
223
|
+
path4 = __toESM(require("path"));
|
|
175
224
|
init_worlds();
|
|
176
225
|
}
|
|
177
226
|
});
|
|
@@ -188,9 +237,9 @@ function resolveEnv(options) {
|
|
|
188
237
|
}
|
|
189
238
|
return { host: host.replace(/\/+$/, ""), publicKey, secretKey };
|
|
190
239
|
}
|
|
191
|
-
async function apiRequest(options, method,
|
|
240
|
+
async function apiRequest(options, method, path5, body) {
|
|
192
241
|
const { host, publicKey, secretKey } = resolveEnv(options);
|
|
193
|
-
const res = await fetch(`${host}${
|
|
242
|
+
const res = await fetch(`${host}${path5}`, {
|
|
194
243
|
method,
|
|
195
244
|
headers: {
|
|
196
245
|
"content-type": "application/json",
|
|
@@ -199,7 +248,7 @@ async function apiRequest(options, method, path3, body) {
|
|
|
199
248
|
...body === void 0 ? {} : { body: JSON.stringify(body) }
|
|
200
249
|
});
|
|
201
250
|
const text = await res.text();
|
|
202
|
-
if (!res.ok) throw new ApiError(res.status, method,
|
|
251
|
+
if (!res.ok) throw new ApiError(res.status, method, path5, text.slice(0, 400));
|
|
203
252
|
return JSON.parse(text);
|
|
204
253
|
}
|
|
205
254
|
var ApiError;
|
|
@@ -208,6 +257,9 @@ var init_worlds = __esm({
|
|
|
208
257
|
"use strict";
|
|
209
258
|
init_session();
|
|
210
259
|
init_tasks();
|
|
260
|
+
init_taskSessions();
|
|
261
|
+
init_taskRun();
|
|
262
|
+
init_evals();
|
|
211
263
|
init_browser();
|
|
212
264
|
init_hub();
|
|
213
265
|
init_validate();
|
|
@@ -218,8 +270,8 @@ var init_worlds = __esm({
|
|
|
218
270
|
init_migrate();
|
|
219
271
|
init_ingest();
|
|
220
272
|
ApiError = class extends Error {
|
|
221
|
-
constructor(status, method,
|
|
222
|
-
super(`${method} ${
|
|
273
|
+
constructor(status, method, path5, body) {
|
|
274
|
+
super(`${method} ${path5} -> ${status}: ${body}`);
|
|
223
275
|
this.status = status;
|
|
224
276
|
this.name = "ApiError";
|
|
225
277
|
}
|