@anchrd/colab-sdk 0.1.33 → 0.1.35
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/connectors/connectors.d.ts +84 -0
- package/dist/error/error.d.ts +1 -0
- package/dist/error/error.js +27 -1
- package/dist/gadgets/gadgets.d.ts +99 -12
- package/dist/gadgets/gadgets.js +26 -8
- package/dist/goals/goals.d.ts +12 -0
- package/dist/goals/goals.js +3 -0
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +1 -1
- package/dist/skills/skills.d.ts +6 -0
- package/dist/skills/skills.js +5 -0
- package/dist/sources/sources.d.ts +28 -0
- package/dist/written/written.d.ts +1 -0
- package/package.json +1 -1
|
@@ -219,7 +219,33 @@ export declare const ConnectorTestRun: z.ZodObject<{
|
|
|
219
219
|
line: z.ZodNumber;
|
|
220
220
|
column: z.ZodNumber;
|
|
221
221
|
}, z.core.$strip>>;
|
|
222
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
durationMs: z.ZodNumber;
|
|
225
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
226
|
+
not_found: "not_found";
|
|
227
|
+
invalid: "invalid";
|
|
228
|
+
conflict: "conflict";
|
|
229
|
+
unauthenticated: "unauthenticated";
|
|
230
|
+
unavailable: "unavailable";
|
|
231
|
+
}>>;
|
|
232
|
+
}, z.core.$strip>>>;
|
|
222
233
|
}, z.core.$strip>>;
|
|
234
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
235
|
+
file: z.ZodString;
|
|
236
|
+
durationMs: z.ZodNumber;
|
|
237
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
238
|
+
name: z.ZodString;
|
|
239
|
+
durationMs: z.ZodNumber;
|
|
240
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
241
|
+
not_found: "not_found";
|
|
242
|
+
invalid: "invalid";
|
|
243
|
+
conflict: "conflict";
|
|
244
|
+
unauthenticated: "unauthenticated";
|
|
245
|
+
unavailable: "unavailable";
|
|
246
|
+
}>>;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>>>;
|
|
223
249
|
note: z.ZodOptional<z.ZodString>;
|
|
224
250
|
limits: z.ZodObject<{
|
|
225
251
|
testMs: z.ZodNumber;
|
|
@@ -229,6 +255,8 @@ export declare const ConnectorTestRun: z.ZodObject<{
|
|
|
229
255
|
fileMemoryMb: z.ZodNumber;
|
|
230
256
|
filesAtOnce: z.ZodNumber;
|
|
231
257
|
runMs: z.ZodNumber;
|
|
258
|
+
hooksMs: z.ZodNumber;
|
|
259
|
+
hooksTools: z.ZodNumber;
|
|
232
260
|
}, z.core.$strip>;
|
|
233
261
|
}, z.core.$strip>;
|
|
234
262
|
export type ConnectorTestRun = z.infer<typeof ConnectorTestRun>;
|
|
@@ -484,7 +512,33 @@ export declare const ConnectorDetail: z.ZodObject<{
|
|
|
484
512
|
line: z.ZodNumber;
|
|
485
513
|
column: z.ZodNumber;
|
|
486
514
|
}, z.core.$strip>>;
|
|
515
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
516
|
+
name: z.ZodString;
|
|
517
|
+
durationMs: z.ZodNumber;
|
|
518
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
519
|
+
not_found: "not_found";
|
|
520
|
+
invalid: "invalid";
|
|
521
|
+
conflict: "conflict";
|
|
522
|
+
unauthenticated: "unauthenticated";
|
|
523
|
+
unavailable: "unavailable";
|
|
524
|
+
}>>;
|
|
525
|
+
}, z.core.$strip>>>;
|
|
487
526
|
}, z.core.$strip>>;
|
|
527
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
528
|
+
file: z.ZodString;
|
|
529
|
+
durationMs: z.ZodNumber;
|
|
530
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
531
|
+
name: z.ZodString;
|
|
532
|
+
durationMs: z.ZodNumber;
|
|
533
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
534
|
+
not_found: "not_found";
|
|
535
|
+
invalid: "invalid";
|
|
536
|
+
conflict: "conflict";
|
|
537
|
+
unauthenticated: "unauthenticated";
|
|
538
|
+
unavailable: "unavailable";
|
|
539
|
+
}>>;
|
|
540
|
+
}, z.core.$strip>>;
|
|
541
|
+
}, z.core.$strip>>>;
|
|
488
542
|
note: z.ZodOptional<z.ZodString>;
|
|
489
543
|
limits: z.ZodObject<{
|
|
490
544
|
testMs: z.ZodNumber;
|
|
@@ -494,6 +548,8 @@ export declare const ConnectorDetail: z.ZodObject<{
|
|
|
494
548
|
fileMemoryMb: z.ZodNumber;
|
|
495
549
|
filesAtOnce: z.ZodNumber;
|
|
496
550
|
runMs: z.ZodNumber;
|
|
551
|
+
hooksMs: z.ZodNumber;
|
|
552
|
+
hooksTools: z.ZodNumber;
|
|
497
553
|
}, z.core.$strip>;
|
|
498
554
|
}, z.core.$strip>>;
|
|
499
555
|
versions: z.ZodArray<z.ZodObject<{
|
|
@@ -556,7 +612,33 @@ export declare const ConnectorTestAnswer: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
556
612
|
line: z.ZodNumber;
|
|
557
613
|
column: z.ZodNumber;
|
|
558
614
|
}, z.core.$strip>>;
|
|
615
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
616
|
+
name: z.ZodString;
|
|
617
|
+
durationMs: z.ZodNumber;
|
|
618
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
619
|
+
not_found: "not_found";
|
|
620
|
+
invalid: "invalid";
|
|
621
|
+
conflict: "conflict";
|
|
622
|
+
unauthenticated: "unauthenticated";
|
|
623
|
+
unavailable: "unavailable";
|
|
624
|
+
}>>;
|
|
625
|
+
}, z.core.$strip>>>;
|
|
559
626
|
}, z.core.$strip>>;
|
|
627
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
628
|
+
file: z.ZodString;
|
|
629
|
+
durationMs: z.ZodNumber;
|
|
630
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
631
|
+
name: z.ZodString;
|
|
632
|
+
durationMs: z.ZodNumber;
|
|
633
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
634
|
+
not_found: "not_found";
|
|
635
|
+
invalid: "invalid";
|
|
636
|
+
conflict: "conflict";
|
|
637
|
+
unauthenticated: "unauthenticated";
|
|
638
|
+
unavailable: "unavailable";
|
|
639
|
+
}>>;
|
|
640
|
+
}, z.core.$strip>>;
|
|
641
|
+
}, z.core.$strip>>>;
|
|
560
642
|
note: z.ZodOptional<z.ZodString>;
|
|
561
643
|
limits: z.ZodObject<{
|
|
562
644
|
testMs: z.ZodNumber;
|
|
@@ -566,6 +648,8 @@ export declare const ConnectorTestAnswer: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
566
648
|
fileMemoryMb: z.ZodNumber;
|
|
567
649
|
filesAtOnce: z.ZodNumber;
|
|
568
650
|
runMs: z.ZodNumber;
|
|
651
|
+
hooksMs: z.ZodNumber;
|
|
652
|
+
hooksTools: z.ZodNumber;
|
|
569
653
|
}, z.core.$strip>;
|
|
570
654
|
}, z.core.$strip>;
|
|
571
655
|
}, z.core.$strip>, z.ZodObject<{
|
package/dist/error/error.d.ts
CHANGED
package/dist/error/error.js
CHANGED
|
@@ -132,6 +132,28 @@ function jsonSchemaOf(schema) {
|
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
// The generic id keys an AI sends out of habit, where a tool takes the id under its own name (#959).
|
|
136
|
+
const genericIdKeys = new Set(["nodeId", "id"]);
|
|
137
|
+
const ownIdKey = /^[a-z]+Id$/;
|
|
138
|
+
// "Unknown key nodeId; this tool takes documentId." when the top level got a generic id key and the
|
|
139
|
+
// tool requires exactly one `<resource>Id`. Only the sentence: the input stays refused, there is no
|
|
140
|
+
// silent alias (E64, `z.strictObject`).
|
|
141
|
+
function idKeyHint(root, error) {
|
|
142
|
+
if (!root || !Array.isArray(root.required))
|
|
143
|
+
return null;
|
|
144
|
+
// A tool that takes `nodeId` itself wants it, not its other id (`parentId` of a move, `userId` of
|
|
145
|
+
// a share): a hint there would name the wrong key.
|
|
146
|
+
if (root.required.some((key) => genericIdKeys.has(key)))
|
|
147
|
+
return null;
|
|
148
|
+
const own = root.required.filter((key) => typeof key === "string" && ownIdKey.test(key) && !genericIdKeys.has(key));
|
|
149
|
+
if (own.length !== 1)
|
|
150
|
+
return null;
|
|
151
|
+
const sent = error.issues
|
|
152
|
+
.filter((issue) => issue.code === "unrecognized_keys" && issue.path.length === 0)
|
|
153
|
+
.flatMap((issue) => (issue.code === "unrecognized_keys" ? issue.keys : []))
|
|
154
|
+
.find((key) => genericIdKeys.has(key));
|
|
155
|
+
return sent ? `Unknown key ${sent}; this tool takes ${own[0]}.` : null;
|
|
156
|
+
}
|
|
135
157
|
const dotted = (path) => path.length === 0 ? "its top level" : path.map(String).join(".");
|
|
136
158
|
// `invalid` for an input its tool's schema refused (#678), at `/api` and `/mcp` alike: each issue
|
|
137
159
|
// with the field's path, Zod's sentence and the form the field expects; a key the schema does not
|
|
@@ -153,10 +175,11 @@ export function invalidInput(schema, error) {
|
|
|
153
175
|
return { path, message: issue.message, ...(expected && { expected }) };
|
|
154
176
|
});
|
|
155
177
|
const places = [...new Set(issues.map((issue) => dotted(issue.path)))];
|
|
178
|
+
const hint = idKeyHint(root, error);
|
|
156
179
|
return {
|
|
157
180
|
error: {
|
|
158
181
|
code: "invalid",
|
|
159
|
-
message: `The input does not match the schema at ${places.join(", ")}: issues name what each expects. Nothing was done.`,
|
|
182
|
+
message: `${hint ? `${hint} ` : ""}The input does not match the schema at ${places.join(", ")}: issues name what each expects. Nothing was done.`,
|
|
160
183
|
issues,
|
|
161
184
|
},
|
|
162
185
|
};
|
|
@@ -170,6 +193,8 @@ export function invalidInput(schema, error) {
|
|
|
170
193
|
// - `mail_failed`: the mail of an invitation was not accepted (#743); the invitation stands.
|
|
171
194
|
// - `unused`: a credential that no Operator uses yet (#676).
|
|
172
195
|
// - `too_long`: an INSTRUCTIONS was saved with more words than an AI follows reliably (E67, #675).
|
|
196
|
+
// - `unchanged`: the call asked for what stands already and wrote nothing; the sentence says what
|
|
197
|
+
// holds and where it comes from (a share, #957).
|
|
173
198
|
export const Warning = z.object({
|
|
174
199
|
code: z.enum([
|
|
175
200
|
"followup_failed",
|
|
@@ -178,6 +203,7 @@ export const Warning = z.object({
|
|
|
178
203
|
"unused",
|
|
179
204
|
"too_long",
|
|
180
205
|
"goal_link",
|
|
206
|
+
"unchanged",
|
|
181
207
|
]),
|
|
182
208
|
message: z.string(),
|
|
183
209
|
});
|
|
@@ -176,6 +176,18 @@ export declare const GadgetSettings: z.ZodObject<{
|
|
|
176
176
|
logDays: z.ZodNumber;
|
|
177
177
|
}, z.core.$strip>;
|
|
178
178
|
export type GadgetSettings = z.infer<typeof GadgetSettings>;
|
|
179
|
+
export declare const GadgetToolUse: z.ZodObject<{
|
|
180
|
+
name: z.ZodString;
|
|
181
|
+
durationMs: z.ZodNumber;
|
|
182
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
183
|
+
not_found: "not_found";
|
|
184
|
+
invalid: "invalid";
|
|
185
|
+
conflict: "conflict";
|
|
186
|
+
unauthenticated: "unauthenticated";
|
|
187
|
+
unavailable: "unavailable";
|
|
188
|
+
}>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export type GadgetToolUse = z.infer<typeof GadgetToolUse>;
|
|
179
191
|
export declare const GadgetTestResult: z.ZodObject<{
|
|
180
192
|
file: z.ZodString;
|
|
181
193
|
path: z.ZodArray<z.ZodString>;
|
|
@@ -191,8 +203,35 @@ export declare const GadgetTestResult: z.ZodObject<{
|
|
|
191
203
|
line: z.ZodNumber;
|
|
192
204
|
column: z.ZodNumber;
|
|
193
205
|
}, z.core.$strip>>;
|
|
206
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
durationMs: z.ZodNumber;
|
|
209
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
210
|
+
not_found: "not_found";
|
|
211
|
+
invalid: "invalid";
|
|
212
|
+
conflict: "conflict";
|
|
213
|
+
unauthenticated: "unauthenticated";
|
|
214
|
+
unavailable: "unavailable";
|
|
215
|
+
}>>;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
194
217
|
}, z.core.$strip>;
|
|
195
218
|
export type GadgetTestResult = z.infer<typeof GadgetTestResult>;
|
|
219
|
+
export declare const GadgetTestHooks: z.ZodObject<{
|
|
220
|
+
file: z.ZodString;
|
|
221
|
+
durationMs: z.ZodNumber;
|
|
222
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
durationMs: z.ZodNumber;
|
|
225
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
226
|
+
not_found: "not_found";
|
|
227
|
+
invalid: "invalid";
|
|
228
|
+
conflict: "conflict";
|
|
229
|
+
unauthenticated: "unauthenticated";
|
|
230
|
+
unavailable: "unavailable";
|
|
231
|
+
}>>;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type GadgetTestHooks = z.infer<typeof GadgetTestHooks>;
|
|
196
235
|
export declare const testLimits: {
|
|
197
236
|
readonly testMs: 30000;
|
|
198
237
|
readonly testTools: 50;
|
|
@@ -201,6 +240,8 @@ export declare const testLimits: {
|
|
|
201
240
|
readonly fileMemoryMb: 128;
|
|
202
241
|
readonly filesAtOnce: 5;
|
|
203
242
|
readonly runMs: 300000;
|
|
243
|
+
readonly hooksMs: 60000;
|
|
244
|
+
readonly hooksTools: 100;
|
|
204
245
|
};
|
|
205
246
|
export declare const TestLimits: z.ZodObject<{
|
|
206
247
|
testMs: z.ZodNumber;
|
|
@@ -210,6 +251,8 @@ export declare const TestLimits: z.ZodObject<{
|
|
|
210
251
|
fileMemoryMb: z.ZodNumber;
|
|
211
252
|
filesAtOnce: z.ZodNumber;
|
|
212
253
|
runMs: z.ZodNumber;
|
|
254
|
+
hooksMs: z.ZodNumber;
|
|
255
|
+
hooksTools: z.ZodNumber;
|
|
213
256
|
}, z.core.$strip>;
|
|
214
257
|
export type TestLimits = z.infer<typeof TestLimits>;
|
|
215
258
|
export declare const testLimitsText: string;
|
|
@@ -252,7 +295,33 @@ export declare const GadgetTestRun: z.ZodObject<{
|
|
|
252
295
|
line: z.ZodNumber;
|
|
253
296
|
column: z.ZodNumber;
|
|
254
297
|
}, z.core.$strip>>;
|
|
298
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
durationMs: z.ZodNumber;
|
|
301
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
302
|
+
not_found: "not_found";
|
|
303
|
+
invalid: "invalid";
|
|
304
|
+
conflict: "conflict";
|
|
305
|
+
unauthenticated: "unauthenticated";
|
|
306
|
+
unavailable: "unavailable";
|
|
307
|
+
}>>;
|
|
308
|
+
}, z.core.$strip>>>;
|
|
255
309
|
}, z.core.$strip>>;
|
|
310
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
311
|
+
file: z.ZodString;
|
|
312
|
+
durationMs: z.ZodNumber;
|
|
313
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
314
|
+
name: z.ZodString;
|
|
315
|
+
durationMs: z.ZodNumber;
|
|
316
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
317
|
+
not_found: "not_found";
|
|
318
|
+
invalid: "invalid";
|
|
319
|
+
conflict: "conflict";
|
|
320
|
+
unauthenticated: "unauthenticated";
|
|
321
|
+
unavailable: "unavailable";
|
|
322
|
+
}>>;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
}, z.core.$strip>>>;
|
|
256
325
|
note: z.ZodOptional<z.ZodString>;
|
|
257
326
|
limits: z.ZodObject<{
|
|
258
327
|
testMs: z.ZodNumber;
|
|
@@ -262,6 +331,8 @@ export declare const GadgetTestRun: z.ZodObject<{
|
|
|
262
331
|
fileMemoryMb: z.ZodNumber;
|
|
263
332
|
filesAtOnce: z.ZodNumber;
|
|
264
333
|
runMs: z.ZodNumber;
|
|
334
|
+
hooksMs: z.ZodNumber;
|
|
335
|
+
hooksTools: z.ZodNumber;
|
|
265
336
|
}, z.core.$strip>;
|
|
266
337
|
}, z.core.$strip>;
|
|
267
338
|
export type GadgetTestRun = z.infer<typeof GadgetTestRun>;
|
|
@@ -366,7 +437,33 @@ export declare const GadgetDetail: z.ZodObject<{
|
|
|
366
437
|
line: z.ZodNumber;
|
|
367
438
|
column: z.ZodNumber;
|
|
368
439
|
}, z.core.$strip>>;
|
|
440
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
441
|
+
name: z.ZodString;
|
|
442
|
+
durationMs: z.ZodNumber;
|
|
443
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
444
|
+
not_found: "not_found";
|
|
445
|
+
invalid: "invalid";
|
|
446
|
+
conflict: "conflict";
|
|
447
|
+
unauthenticated: "unauthenticated";
|
|
448
|
+
unavailable: "unavailable";
|
|
449
|
+
}>>;
|
|
450
|
+
}, z.core.$strip>>>;
|
|
369
451
|
}, z.core.$strip>>;
|
|
452
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
453
|
+
file: z.ZodString;
|
|
454
|
+
durationMs: z.ZodNumber;
|
|
455
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
456
|
+
name: z.ZodString;
|
|
457
|
+
durationMs: z.ZodNumber;
|
|
458
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
459
|
+
not_found: "not_found";
|
|
460
|
+
invalid: "invalid";
|
|
461
|
+
conflict: "conflict";
|
|
462
|
+
unauthenticated: "unauthenticated";
|
|
463
|
+
unavailable: "unavailable";
|
|
464
|
+
}>>;
|
|
465
|
+
}, z.core.$strip>>;
|
|
466
|
+
}, z.core.$strip>>>;
|
|
370
467
|
note: z.ZodOptional<z.ZodString>;
|
|
371
468
|
limits: z.ZodObject<{
|
|
372
469
|
testMs: z.ZodNumber;
|
|
@@ -376,6 +473,8 @@ export declare const GadgetDetail: z.ZodObject<{
|
|
|
376
473
|
fileMemoryMb: z.ZodNumber;
|
|
377
474
|
filesAtOnce: z.ZodNumber;
|
|
378
475
|
runMs: z.ZodNumber;
|
|
476
|
+
hooksMs: z.ZodNumber;
|
|
477
|
+
hooksTools: z.ZodNumber;
|
|
379
478
|
}, z.core.$strip>;
|
|
380
479
|
}, z.core.$strip>>;
|
|
381
480
|
usage: z.ZodNullable<z.ZodObject<{
|
|
@@ -406,18 +505,6 @@ export declare const GadgetDetail: z.ZodObject<{
|
|
|
406
505
|
archivedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
407
506
|
}, z.core.$strip>;
|
|
408
507
|
export type GadgetDetail = z.infer<typeof GadgetDetail>;
|
|
409
|
-
export declare const GadgetToolUse: z.ZodObject<{
|
|
410
|
-
name: z.ZodString;
|
|
411
|
-
durationMs: z.ZodNumber;
|
|
412
|
-
code: z.ZodNullable<z.ZodEnum<{
|
|
413
|
-
not_found: "not_found";
|
|
414
|
-
invalid: "invalid";
|
|
415
|
-
conflict: "conflict";
|
|
416
|
-
unauthenticated: "unauthenticated";
|
|
417
|
-
unavailable: "unavailable";
|
|
418
|
-
}>>;
|
|
419
|
-
}, z.core.$strip>;
|
|
420
|
-
export type GadgetToolUse = z.infer<typeof GadgetToolUse>;
|
|
421
508
|
export declare const GadgetConsoleLine: z.ZodObject<{
|
|
422
509
|
level: z.ZodEnum<{
|
|
423
510
|
error: "error";
|
package/dist/gadgets/gadgets.js
CHANGED
|
@@ -193,6 +193,13 @@ export const GadgetSettings = z.object({
|
|
|
193
193
|
level: GadgetLevel,
|
|
194
194
|
logDays: z.number().int(),
|
|
195
195
|
});
|
|
196
|
+
// One use of the `colab` binding during a call: which tool, how long, and the error code it answered
|
|
197
|
+
// with (null when it answered).
|
|
198
|
+
export const GadgetToolUse = z.object({
|
|
199
|
+
name: z.string(),
|
|
200
|
+
durationMs: z.number().int(),
|
|
201
|
+
code: ErrorCode.nullable(),
|
|
202
|
+
});
|
|
196
203
|
// One test of a run (#643): where it stands (its file and the names of the describes around it), how
|
|
197
204
|
// it ended, and for a failure the message and the place in the test file.
|
|
198
205
|
export const GadgetTestResult = z.object({
|
|
@@ -205,11 +212,23 @@ export const GadgetTestResult = z.object({
|
|
|
205
212
|
location: z
|
|
206
213
|
.object({ file: z.string(), line: z.number().int(), column: z.number().int() })
|
|
207
214
|
.nullable(),
|
|
215
|
+
// A gadget's test (#949): the tools it called, each with its duration, as the log of a call has
|
|
216
|
+
// them. A connector's or a source's test has none.
|
|
217
|
+
calls: z.array(GadgetToolUse).optional(),
|
|
218
|
+
});
|
|
219
|
+
// The `beforeAll` and `afterAll` of one test file of a gadget (#949): how long they took together
|
|
220
|
+
// and the tools they called. Only for a file that has either.
|
|
221
|
+
export const GadgetTestHooks = z.object({
|
|
222
|
+
file: z.string(),
|
|
223
|
+
durationMs: z.number().int(),
|
|
224
|
+
calls: z.array(GadgetToolUse),
|
|
208
225
|
});
|
|
209
226
|
// The limits of a run of the tests of a gadget, a connector or a source (#937): the one place they
|
|
210
227
|
// stand. Every test file runs as a job of its own in a fresh isolate; the hosts, the descriptions of
|
|
211
228
|
// the three test tools, the field `limits` of every run and the customer pages read them from here.
|
|
212
229
|
// `testTools` counts for a gadget's tests only, whose `colab` has the budget of a live call (E150).
|
|
230
|
+
// `hooksMs` and `hooksTools` are the budget of a file's `beforeAll` and `afterAll` together (#949),
|
|
231
|
+
// apart from every test's: a file builds its data once instead of in every test.
|
|
213
232
|
// The memory is Cloudflare's per isolate and set nowhere in Colab; it stands here so it is named.
|
|
214
233
|
export const testLimits = {
|
|
215
234
|
testMs: 30_000,
|
|
@@ -219,6 +238,8 @@ export const testLimits = {
|
|
|
219
238
|
fileMemoryMb: 128,
|
|
220
239
|
filesAtOnce: 5,
|
|
221
240
|
runMs: 300_000,
|
|
241
|
+
hooksMs: 60_000,
|
|
242
|
+
hooksTools: 100,
|
|
222
243
|
};
|
|
223
244
|
export const TestLimits = z.object({
|
|
224
245
|
testMs: z.number().int(),
|
|
@@ -228,9 +249,11 @@ export const TestLimits = z.object({
|
|
|
228
249
|
fileMemoryMb: z.number().int(),
|
|
229
250
|
filesAtOnce: z.number().int(),
|
|
230
251
|
runMs: z.number().int(),
|
|
252
|
+
hooksMs: z.number().int(),
|
|
253
|
+
hooksTools: z.number().int(),
|
|
231
254
|
});
|
|
232
255
|
// The limits in one sentence, for the descriptions of the test tools (#937).
|
|
233
|
-
export const testLimitsText = `Every test file runs on its own, in a fresh isolate with ${testLimits.fileMemoryMb} MB, at most ${testLimits.fileMs / 1000} seconds and ${testLimits.fileCpuMs / 1000} seconds of CPU; ${testLimits.filesAtOnce} files run at once, the whole run at most ${testLimits.runMs / 1000} seconds. Each test has ${testLimits.testMs / 1000} seconds, a gadget's test ${testLimits.testTools} tools. A file that breaks off is red with its reason; the others still count. The answer names these limits under limits.`;
|
|
256
|
+
export const testLimitsText = `Every test file runs on its own, in a fresh isolate with ${testLimits.fileMemoryMb} MB, at most ${testLimits.fileMs / 1000} seconds and ${testLimits.fileCpuMs / 1000} seconds of CPU; ${testLimits.filesAtOnce} files run at once, the whole run at most ${testLimits.runMs / 1000} seconds. Each test has ${testLimits.testMs / 1000} seconds, a gadget's test ${testLimits.testTools} tools. beforeAll and afterAll of a file have ${testLimits.hooksMs / 1000} seconds together, in a gadget ${testLimits.hooksTools} tools, apart from the tests'. A file that breaks off is red with its reason; the others still count. The answer names these limits under limits.`;
|
|
234
257
|
// A run of a gadget's tests (#643, Nodes › Gadget › Konsole › Tests). `running` (#888, E150): the run
|
|
235
258
|
// goes on in the queue after `intelligence_gadget_test` answered; `at` is when it started, the
|
|
236
259
|
// counts are 0 and `tests` empty until `intelligence_gadget_get` shows it ended.
|
|
@@ -248,6 +271,8 @@ export const GadgetTestRun = z.object({
|
|
|
248
271
|
// The run itself broke: a test file did not load, or the run took too long.
|
|
249
272
|
error: z.object({ message: z.string(), stack: z.string().optional() }).nullable(),
|
|
250
273
|
tests: z.array(GadgetTestResult),
|
|
274
|
+
// A gadget's files with `beforeAll` or `afterAll` (#949).
|
|
275
|
+
hooks: z.array(GadgetTestHooks).optional(),
|
|
251
276
|
// Only in the answer of `intelligence_gadget_test` to a run still going (#913): where to follow it.
|
|
252
277
|
note: z.string().optional(),
|
|
253
278
|
// The limits the run is held to (#937), the same for a gadget, a connector and a source.
|
|
@@ -302,13 +327,6 @@ export const GadgetDetail = z.object({
|
|
|
302
327
|
rev: z.number().int(),
|
|
303
328
|
archivedAt: z.iso.datetime().nullable(),
|
|
304
329
|
});
|
|
305
|
-
// One use of the `colab` binding during a call: which tool, how long, and the error code it answered
|
|
306
|
-
// with (null when it answered).
|
|
307
|
-
export const GadgetToolUse = z.object({
|
|
308
|
-
name: z.string(),
|
|
309
|
-
durationMs: z.number().int(),
|
|
310
|
-
code: ErrorCode.nullable(),
|
|
311
|
-
});
|
|
312
330
|
export const GadgetConsoleLine = z.object({
|
|
313
331
|
level: z.enum(["log", "info", "warn", "error", "debug"]),
|
|
314
332
|
text: z.string(),
|
package/dist/goals/goals.d.ts
CHANGED
|
@@ -199,6 +199,10 @@ export declare const GoalCheck: z.ZodObject<{
|
|
|
199
199
|
name: z.ZodString;
|
|
200
200
|
tools: z.ZodArray<z.ZodString>;
|
|
201
201
|
}, z.core.$strip>>;
|
|
202
|
+
via: z.ZodNullable<z.ZodObject<{
|
|
203
|
+
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
204
|
+
name: z.ZodString;
|
|
205
|
+
}, z.core.$strip>>;
|
|
202
206
|
}, z.core.$strip>;
|
|
203
207
|
export type GoalCheck = z.infer<typeof GoalCheck>;
|
|
204
208
|
export declare const GoalReady: z.ZodObject<{
|
|
@@ -270,6 +274,10 @@ export declare const GoalReady: z.ZodObject<{
|
|
|
270
274
|
name: z.ZodString;
|
|
271
275
|
tools: z.ZodArray<z.ZodString>;
|
|
272
276
|
}, z.core.$strip>>;
|
|
277
|
+
via: z.ZodNullable<z.ZodObject<{
|
|
278
|
+
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
279
|
+
name: z.ZodString;
|
|
280
|
+
}, z.core.$strip>>;
|
|
273
281
|
}, z.core.$strip>>;
|
|
274
282
|
questionCostUsd: z.ZodNullable<z.ZodNumber>;
|
|
275
283
|
}, z.core.$strip>;
|
|
@@ -793,6 +801,10 @@ export declare const GoalDetail: z.ZodObject<{
|
|
|
793
801
|
name: z.ZodString;
|
|
794
802
|
tools: z.ZodArray<z.ZodString>;
|
|
795
803
|
}, z.core.$strip>>;
|
|
804
|
+
via: z.ZodNullable<z.ZodObject<{
|
|
805
|
+
nodeId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
806
|
+
name: z.ZodString;
|
|
807
|
+
}, z.core.$strip>>;
|
|
796
808
|
}, z.core.$strip>>;
|
|
797
809
|
questionCostUsd: z.ZodNullable<z.ZodNumber>;
|
|
798
810
|
}, z.core.$strip>;
|
package/dist/goals/goals.js
CHANGED
|
@@ -98,6 +98,9 @@ export const GoalCheck = z.object({
|
|
|
98
98
|
connector: z
|
|
99
99
|
.object({ connectorId: z.string(), name: z.string(), tools: z.array(z.string()) })
|
|
100
100
|
.nullable(),
|
|
101
|
+
// A reference a skill links rather than the goal (#956): that skill, which the goal links or the
|
|
102
|
+
// Operator runs every goal by. Null for everything the goal names itself.
|
|
103
|
+
via: z.object({ nodeId: NodeId, name: z.string() }).nullable(),
|
|
101
104
|
});
|
|
102
105
|
export const GoalReady = z.object({
|
|
103
106
|
// Green: nothing is red, Play may start a run.
|
package/dist/sdk.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, EventS
|
|
|
17
17
|
export { ExcerptCursor, excerptChars, RowsExcerpt, TextExcerpt } from "./excerpt/excerpt.js";
|
|
18
18
|
export { FileCreateInput, FileDetail, type FileFormat, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
|
|
19
19
|
export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
|
|
20
|
-
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
|
|
20
|
+
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
|
|
21
21
|
export { GoalCheck, GoalCreateInput, GoalDetail, GoalFields, GoalFollowUp, GoalGetInput, GoalId, GoalPlanning, GoalPlanStep, GoalReady, GoalReport, GoalRunCancelInput, GoalRunCompleteInput, GoalRunCreateInput, GoalRunDetail, GoalRunGetInput, GoalRunItem, GoalRunList, GoalRunListInput, GoalRunStatus, GoalRunTrigger, GoalRunUpdateInput, GoalSession, GoalUpdateInput, goalPlannings, goalRunStatuses, } from "./goals/goals.js";
|
|
22
22
|
export { type Action, actions, hasRoute, isAction, isPackage, isWord, type Package, packages, parseConnectorFunction, parseToolName, type Resource, type Route, resources, type ToolName, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
23
23
|
export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
|
package/dist/sdk.js
CHANGED
|
@@ -20,7 +20,7 @@ export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, EventS
|
|
|
20
20
|
export { ExcerptCursor, excerptChars, RowsExcerpt, TextExcerpt } from "./excerpt/excerpt.js";
|
|
21
21
|
export { FileCreateInput, FileDetail, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
|
|
22
22
|
export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
|
|
23
|
-
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
|
|
23
|
+
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestHooks, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, TestLimits, testLimits, testLimitsText, } from "./gadgets/gadgets.js";
|
|
24
24
|
export { GoalCheck, GoalCreateInput, GoalDetail, GoalFields, GoalFollowUp, GoalGetInput, GoalId, GoalPlanning, GoalPlanStep, GoalReady, GoalReport, GoalRunCancelInput, GoalRunCompleteInput, GoalRunCreateInput, GoalRunDetail, GoalRunGetInput, GoalRunItem, GoalRunList, GoalRunListInput, GoalRunStatus, GoalRunTrigger, GoalRunUpdateInput, GoalSession, GoalUpdateInput, goalPlannings, goalRunStatuses, } from "./goals/goals.js";
|
|
25
25
|
export { actions, hasRoute, isAction, isPackage, isWord, packages, parseConnectorFunction, parseToolName, resources, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
26
26
|
export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
|
package/dist/skills/skills.d.ts
CHANGED
|
@@ -107,6 +107,8 @@ export declare const SkillCaseResult: z.ZodObject<{
|
|
|
107
107
|
durationMs: z.ZodOptional<z.ZodInt>;
|
|
108
108
|
problem: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
109
109
|
runId: z.ZodNullable<z.ZodTemplateLiteral<`run_${string}`>>;
|
|
110
|
+
realReads: z.ZodOptional<z.ZodInt>;
|
|
111
|
+
excluded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
112
|
}, z.core.$strip>;
|
|
111
113
|
export type SkillCaseResult = z.infer<typeof SkillCaseResult>;
|
|
112
114
|
export declare const SkillTriggerHit: z.ZodObject<{
|
|
@@ -199,6 +201,8 @@ export declare const SkillTestReport: z.ZodObject<{
|
|
|
199
201
|
durationMs: z.ZodOptional<z.ZodInt>;
|
|
200
202
|
problem: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
201
203
|
runId: z.ZodNullable<z.ZodTemplateLiteral<`run_${string}`>>;
|
|
204
|
+
realReads: z.ZodOptional<z.ZodInt>;
|
|
205
|
+
excluded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
206
|
}, z.core.$strip>>;
|
|
203
207
|
problem: z.ZodNullable<z.ZodString>;
|
|
204
208
|
}, z.core.$strip>;
|
|
@@ -310,6 +314,8 @@ export declare const SkillDetail: z.ZodObject<{
|
|
|
310
314
|
durationMs: z.ZodOptional<z.ZodInt>;
|
|
311
315
|
problem: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
316
|
runId: z.ZodNullable<z.ZodTemplateLiteral<`run_${string}`>>;
|
|
317
|
+
realReads: z.ZodOptional<z.ZodInt>;
|
|
318
|
+
excluded: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
313
319
|
}, z.core.$strip>>;
|
|
314
320
|
problem: z.ZodNullable<z.ZodString>;
|
|
315
321
|
}, z.core.$strip>>;
|
package/dist/skills/skills.js
CHANGED
|
@@ -125,6 +125,11 @@ export const SkillCaseResult = z.object({
|
|
|
125
125
|
problem: z.string().nullable().optional(),
|
|
126
126
|
// The probe run of the case's last attempt, its trace in the log.
|
|
127
127
|
runId: RunId.nullable(),
|
|
128
|
+
// How many reading calls without a recording read Colab for real, with the Operator's rights, over
|
|
129
|
+
// every run of the case (#965, E159); absent in a report from before.
|
|
130
|
+
realReads: z.int().optional(),
|
|
131
|
+
// The points of the result its `ohne` left out, not graded (#965); absent in a report from before.
|
|
132
|
+
excluded: z.array(z.string()).optional(),
|
|
128
133
|
});
|
|
129
134
|
export const SkillTriggerHit = z.object({
|
|
130
135
|
kind: z.enum(["should", "shouldNot"]),
|
|
@@ -866,7 +866,33 @@ export declare const SourceDetail: z.ZodObject<{
|
|
|
866
866
|
line: z.ZodNumber;
|
|
867
867
|
column: z.ZodNumber;
|
|
868
868
|
}, z.core.$strip>>;
|
|
869
|
+
calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
870
|
+
name: z.ZodString;
|
|
871
|
+
durationMs: z.ZodNumber;
|
|
872
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
873
|
+
not_found: "not_found";
|
|
874
|
+
invalid: "invalid";
|
|
875
|
+
conflict: "conflict";
|
|
876
|
+
unauthenticated: "unauthenticated";
|
|
877
|
+
unavailable: "unavailable";
|
|
878
|
+
}>>;
|
|
879
|
+
}, z.core.$strip>>>;
|
|
869
880
|
}, z.core.$strip>>;
|
|
881
|
+
hooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
882
|
+
file: z.ZodString;
|
|
883
|
+
durationMs: z.ZodNumber;
|
|
884
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
885
|
+
name: z.ZodString;
|
|
886
|
+
durationMs: z.ZodNumber;
|
|
887
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
888
|
+
not_found: "not_found";
|
|
889
|
+
invalid: "invalid";
|
|
890
|
+
conflict: "conflict";
|
|
891
|
+
unauthenticated: "unauthenticated";
|
|
892
|
+
unavailable: "unavailable";
|
|
893
|
+
}>>;
|
|
894
|
+
}, z.core.$strip>>;
|
|
895
|
+
}, z.core.$strip>>>;
|
|
870
896
|
note: z.ZodOptional<z.ZodString>;
|
|
871
897
|
limits: z.ZodObject<{
|
|
872
898
|
testMs: z.ZodNumber;
|
|
@@ -876,6 +902,8 @@ export declare const SourceDetail: z.ZodObject<{
|
|
|
876
902
|
fileMemoryMb: z.ZodNumber;
|
|
877
903
|
filesAtOnce: z.ZodNumber;
|
|
878
904
|
runMs: z.ZodNumber;
|
|
905
|
+
hooksMs: z.ZodNumber;
|
|
906
|
+
hooksTools: z.ZodNumber;
|
|
879
907
|
}, z.core.$strip>;
|
|
880
908
|
}, z.core.$strip>>;
|
|
881
909
|
settings: z.ZodNullable<z.ZodObject<{
|
package/package.json
CHANGED