@anchrd/colab-sdk 0.1.36 → 0.1.38

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 (49) hide show
  1. package/dist/actions/actions.d.ts +34 -23
  2. package/dist/actions/actions.js +5 -2
  3. package/dist/archive/archive.d.ts +1 -0
  4. package/dist/archive/archive.js +3 -0
  5. package/dist/boards/boards.d.ts +21 -21
  6. package/dist/columns/columns.d.ts +2 -2
  7. package/dist/connectors/connectors.d.ts +6 -6
  8. package/dist/crawls/crawls.d.ts +3 -3
  9. package/dist/error/error.d.ts +9 -3
  10. package/dist/error/error.js +12 -3
  11. package/dist/gadgets/gadgets.d.ts +147 -9
  12. package/dist/gadgets/gadgets.js +156 -0
  13. package/dist/goals/goals.d.ts +56 -10
  14. package/dist/goals/goals.js +36 -7
  15. package/dist/grammar/grammar.d.ts +2 -0
  16. package/dist/grammar/grammar.js +10 -0
  17. package/dist/home/home.d.ts +312 -0
  18. package/dist/home/home.js +53 -0
  19. package/dist/links/links.d.ts +166 -0
  20. package/dist/links/links.js +149 -0
  21. package/dist/mcps/mcps.d.ts +3 -3
  22. package/dist/messages/messages.d.ts +26 -0
  23. package/dist/messages/messages.js +33 -0
  24. package/dist/nodes/nodes.d.ts +46 -20
  25. package/dist/nodes/nodes.js +11 -3
  26. package/dist/operators/operators.d.ts +737 -47
  27. package/dist/operators/operators.js +388 -71
  28. package/dist/organisation/organisation.d.ts +2 -0
  29. package/dist/organisation/organisation.js +9 -0
  30. package/dist/primitives/primitives.d.ts +9 -0
  31. package/dist/primitives/primitives.js +16 -0
  32. package/dist/roles/roles.d.ts +1 -0
  33. package/dist/roles/roles.js +3 -0
  34. package/dist/runs/runs.d.ts +2 -2
  35. package/dist/sdk.d.ts +12 -11
  36. package/dist/sdk.js +12 -11
  37. package/dist/skills/skills.d.ts +37 -7
  38. package/dist/skills/skills.js +50 -0
  39. package/dist/sources/sources.d.ts +82 -20
  40. package/dist/sources/sources.js +71 -12
  41. package/dist/tables/tables.d.ts +42 -0
  42. package/dist/tables/tables.js +55 -2
  43. package/dist/tool.d.ts +1 -0
  44. package/dist/tree-order/tree-order.d.ts +2 -2
  45. package/dist/tree-order/tree-order.js +1 -1
  46. package/dist/users/users.d.ts +2 -0
  47. package/dist/users/users.js +3 -2
  48. package/dist/versions/versions.d.ts +13 -13
  49. package/package.json +1 -1
@@ -4,6 +4,7 @@ import { idSchema } from "../ids/ids.js";
4
4
  import { Limit } from "../list-input.js";
5
5
  import { CreateSection, NodeId, NodePath, NodePerson } from "../nodes/nodes.js";
6
6
  import { IdempotencyKey, Rev } from "../primitives/primitives.js";
7
+ import { ServiceId } from "../services/services.js";
7
8
  import { UserId } from "../users/users.js";
8
9
  // Gadgets (#642, E118, Nodes › Gadget): a small application an AI builds and Colab runs. Its files
9
10
  // without a build step, every change into the draft, publishing as a version, and calling a function
@@ -32,6 +33,13 @@ export const GadgetFunctionName = z
32
33
  .max(64)
33
34
  .regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/)
34
35
  .describe("The function's name, exported by server.js under the same name.");
36
+ // The right a function needs (#790, E162): `interface.function` of the service in `access.service`,
37
+ // each word one word like every word of a right (E64).
38
+ export const GadgetRequires = z
39
+ .string()
40
+ .max(129)
41
+ .regex(/^[a-z][a-z0-9]*\.[a-z][a-z0-9]*$/)
42
+ .describe("The function of the gadget's service a caller needs, as interface.function, such as leads.read.");
35
43
  // One function of the manifest, under its name in `functions`.
36
44
  export const GadgetFunction = z.strictObject({
37
45
  description: z.string().max(2000).describe("What the function does, for the AI that calls it."),
@@ -39,10 +47,24 @@ export const GadgetFunction = z.strictObject({
39
47
  .record(z.string(), z.unknown())
40
48
  .optional()
41
49
  .describe("A JSON Schema of the function's input, an object; Colab checks every call against it. Leaving it out takes any object."),
50
+ requires: GadgetRequires.optional(),
51
+ });
52
+ // Rights per person over a service of Access (#790, E162): the gadget names a service an admin set
53
+ // up, and every function names the function of that service it requires.
54
+ export const GadgetAccess = z.strictObject({
55
+ service: ServiceId.describe("The service of Access whose functions this gadget's functions require, `service_…`. An admin creates it and switches it on in roles."),
42
56
  });
57
+ // The nodes a gadget reads and writes with rights of its own (#986, E163): node id to `read` or
58
+ // `write`. Granted at publish, only as far as the one who publishes holds them.
59
+ export const GadgetUseRight = z.enum(["read", "write"]);
60
+ export const GadgetUses = z
61
+ .record(NodeId, GadgetUseRight)
62
+ .describe("The nodes the gadget reads or writes with rights of its own, each node id with read or write. Granted when it goes live, only as far as you hold them yourself.");
43
63
  export const GadgetManifest = z.strictObject({
44
64
  name: z.string().min(1).max(200).describe("The gadget's name in the manifest."),
45
65
  description: z.string().max(2000).optional().describe("What the gadget is for."),
66
+ access: GadgetAccess.optional(),
67
+ uses: GadgetUses.optional(),
46
68
  functions: z
47
69
  .record(GadgetFunctionName, GadgetFunction)
48
70
  .describe("The functions server.js exports, each under its name."),
@@ -70,6 +92,19 @@ export const GadgetCreateInput = z.strictObject({
70
92
  .record(GadgetFilePath, FileContent)
71
93
  .optional()
72
94
  .describe("The gadget's first files by path, such as gadget.json, server.js, client.js and tests/*.test.js. They become its draft; nothing is live until it is published. Leaving it out creates an empty gadget."),
95
+ from: z
96
+ .strictObject({
97
+ gadgetId: NodeId.describe("The gadget to duplicate."),
98
+ as: z
99
+ .enum(["copy", "link"])
100
+ .describe("copy: its own code and history from here on, starting as a draft of the original's live state, for whoever may change the original. link: the original's code, following every version it publishes and read only here, with its own settings, data and storage; for whoever may read an original that is live."),
101
+ uses: z
102
+ .record(NodeId, NodeId)
103
+ .optional()
104
+ .describe("Only for a link: for a node of the original's uses, the node it uses here instead, with the same right (Daten an dieser Stelle). Nodes left out stay the original's."),
105
+ })
106
+ .optional()
107
+ .describe("Duplicate a gadget instead of giving files (E216)."),
73
108
  idempotencyKey: IdempotencyKey,
74
109
  });
75
110
  // `include` over REST is one comma-separated value (`?include=files`): a query string carries text.
@@ -81,6 +116,19 @@ export const GadgetGetInput = z.strictObject({
81
116
  .preprocess((value) => (typeof value === "string" ? value.split(",") : value), z.array(GadgetInclude).min(1).max(1))
82
117
  .optional()
83
118
  .describe("files: answer the text of every file of that state, not only their paths."),
119
+ // ⚠️ Over REST a query string carries text only: `?compare=6,live` is the same as the object.
120
+ compare: z
121
+ .preprocess((value) => {
122
+ if (typeof value !== "string")
123
+ return value;
124
+ const [from, to, ...rest] = value.split(",");
125
+ return rest.length === 0 && to !== undefined ? { from, to } : value;
126
+ }, z.strictObject({
127
+ from: GadgetVersionRef.describe("The older side: a version's number, live or draft."),
128
+ to: GadgetVersionRef.describe("The newer side: a version's number, live or draft."),
129
+ }))
130
+ .optional()
131
+ .describe("Also answer what changed from one state to another, file by file with both texts (the diff). Only for whoever may change the gadget."),
84
132
  });
85
133
  const GadgetSettingsInput = z.strictObject({
86
134
  responsibleId: UserId.nullable()
@@ -88,6 +136,14 @@ const GadgetSettingsInput = z.strictObject({
88
136
  .describe("The Operator or person who gets every new error and red test as an Action; null for nobody, then the publisher gets a hint."),
89
137
  level: GadgetLevel.optional().describe("How far the responsible goes: report, draft (repair as a draft, the default) or publish (repair and publish, only with every test green and no new rights)."),
90
138
  logDays: LogDays.optional(),
139
+ uses: z
140
+ .record(NodeId, NodeId)
141
+ .optional()
142
+ .describe("Only at a link: for a node of the original's uses, the node it uses here instead (Daten an dieser Stelle); the whole mapping, a node left out uses the original's again."),
143
+ original: z
144
+ .null()
145
+ .optional()
146
+ .describe("Only at a link: null turns it into a copy with its own code and history (In Kopie umwandeln)."),
91
147
  });
92
148
  export const GadgetUpdateInput = z.strictObject({
93
149
  gadgetId: GadgetId,
@@ -168,7 +224,21 @@ export const GadgetClientLog = z.strictObject({
168
224
  version: GadgetVersionRef.optional(),
169
225
  console: z.array(ClientConsoleLine).max(200).optional(),
170
226
  errors: z.array(ClientError).max(20).optional(),
227
+ // How long the gadget took to start in this opening (E224, #1058): from writing its document to
228
+ // its module having run. Kept once per entry.
229
+ startMs: z.number().int().min(0).max(600_000).optional(),
171
230
  });
231
+ // A commit's dist (E224, #1058), what `GET /api/intelligence/gadgets/:gadgetId/dist/:commit` answers:
232
+ // the interface bundled into one module with its stylesheet, or why it does not bundle.
233
+ export const GadgetDistAnswer = z.union([
234
+ z.object({
235
+ js: z.string(),
236
+ css: z.string(),
237
+ bytes: z.number().int(),
238
+ gzipBytes: z.number().int(),
239
+ }),
240
+ z.object({ buildError: z.string() }),
241
+ ]);
172
242
  export const GadgetCallCreateInput = z.strictObject({
173
243
  gadgetId: GadgetId,
174
244
  function: GadgetFunctionName.describe("The function to call, one of the manifest's functions of that version."),
@@ -188,6 +258,11 @@ export const GadgetChange = z.object({
188
258
  path: z.string(),
189
259
  change: z.enum(["added", "changed", "removed"]),
190
260
  });
261
+ // A file of a diff (E216): its change with both texts, null on the side it is missing.
262
+ export const GadgetDiffFile = GadgetChange.extend({
263
+ before: z.string().nullable(),
264
+ after: z.string().nullable(),
265
+ });
191
266
  export const GadgetSettings = z.object({
192
267
  responsible: NodePerson.nullable(),
193
268
  level: GadgetLevel,
@@ -288,6 +363,10 @@ export const GadgetDetail = z.object({
288
363
  // The state the files and the manifest below belong to: a version's number, `draft`, or null for
289
364
  // a gadget that has no live version yet when live was asked for.
290
365
  version: z.union([z.number().int(), z.literal("draft")]).nullable(),
366
+ // The commit of that state (E224, #1058), whose dist the interface loads from
367
+ // `GET /api/intelligence/gadgets/:gadgetId/dist/:commit`; null without one (no live version yet,
368
+ // or a draft from before E215 that no commit holds).
369
+ commit: z.string().nullable(),
291
370
  // Null when that state has no gadget.json, or the draft's cannot be read.
292
371
  manifest: GadgetManifest.nullable(),
293
372
  files: z.array(GadgetFile),
@@ -307,6 +386,10 @@ export const GadgetDetail = z.object({
307
386
  // The Colab tools the draft's backend names and the live one does not ("Keine neuen Rechte"),
308
387
  // read from the text of its files: a name built at run time is not seen.
309
388
  newTools: z.array(z.string()),
389
+ // The nodes the draft's `uses` adds or raises to write against live (#986, "Nutzt neu").
390
+ newUses: z
391
+ .array(z.object({ nodeId: z.string(), name: z.string().nullable(), right: GadgetUseRight }))
392
+ .optional(),
310
393
  })
311
394
  .nullable(),
312
395
  // The last run of the tests (#643); null for a reader and before the first.
@@ -320,9 +403,77 @@ export const GadgetDetail = z.object({
320
403
  lastCallAt: z.iso.datetime().nullable(),
321
404
  })
322
405
  .nullable(),
406
+ // The dist of this state against the limit (E224, #1058): its size (JavaScript and CSS) and the
407
+ // median start time of its last five openings, null before one; `error` when it does not bundle.
408
+ // Above a limit `warnings` says so; a publish warns with them and does not refuse. Optional, and
409
+ // only for whoever may change the gadget, without a commit, or while no dist is built yet.
410
+ dist: z
411
+ .object({
412
+ bytes: z.number().int(),
413
+ gzipBytes: z.number().int(),
414
+ startMs: z.number().int().nullable(),
415
+ limits: z.object({ bytes: z.number().int(), startMs: z.number().int() }),
416
+ warnings: z.array(z.string()),
417
+ error: z.string().nullable(),
418
+ })
419
+ .nullable()
420
+ .optional(),
323
421
  // Only for whoever may change the gadget; null for a reader.
324
422
  settings: GadgetSettings.nullable(),
325
423
  rights: z.object({ write: z.boolean() }),
424
+ // The service of `access.service` in this state's manifest and what the caller holds of it (#790,
425
+ // E162): its functions as `interface.function`, and of them the ones the caller may call. `name`
426
+ // is null when the service is gone; an archived one holds nothing. Null without `access`.
427
+ access: z
428
+ .object({
429
+ serviceId: z.string(),
430
+ name: z.string().nullable(),
431
+ archived: z.boolean(),
432
+ functions: z.array(z.string()),
433
+ held: z.array(z.string()),
434
+ })
435
+ .nullable()
436
+ .optional(),
437
+ // The nodes of `uses` in this state (#986, E163), only for whoever may change the gadget: name
438
+ // (null where the reader cannot read it), the right, and `missing` for a node archived or out of
439
+ // the gadget's reach. Null for a reader and without `uses`.
440
+ uses: z
441
+ .array(z.object({
442
+ nodeId: z.string(),
443
+ name: z.string().nullable(),
444
+ path: z.array(z.string()),
445
+ right: GadgetUseRight,
446
+ missing: z.boolean(),
447
+ // Lies in Own (under a root folder): goes along when the gadget moves to Shared.
448
+ own: z.boolean().optional(),
449
+ }))
450
+ .nullable()
451
+ .optional(),
452
+ // A link (E216): its original, whose live version runs here, and what it uses here instead of
453
+ // the original's nodes. Null for an original and a copy.
454
+ link: z
455
+ .object({
456
+ originalId: NodeId,
457
+ // Null where the caller cannot read the original.
458
+ name: z.string().nullable(),
459
+ uses: z.record(z.string(), z.string()),
460
+ })
461
+ .nullable()
462
+ .optional(),
463
+ // An original's links (E216), only for whoever may change it: they run its live version.
464
+ links: z
465
+ .array(z.object({ gadgetId: NodeId, name: z.string().nullable() }))
466
+ .nullable()
467
+ .optional(),
468
+ // What `compare` asked for: the files that changed between the two states.
469
+ diff: z
470
+ .object({
471
+ from: z.union([z.number().int(), z.literal("draft")]).nullable(),
472
+ to: z.union([z.number().int(), z.literal("draft")]).nullable(),
473
+ files: z.array(GadgetDiffFile),
474
+ })
475
+ .nullable()
476
+ .optional(),
326
477
  // The state the next save sends (E70).
327
478
  rev: z.number().int(),
328
479
  archivedAt: z.iso.datetime().nullable(),
@@ -347,6 +498,11 @@ export const GadgetCall = z.object({
347
498
  durationMs: z.number().int(),
348
499
  console: z.array(GadgetConsoleLine),
349
500
  tools: z.array(GadgetToolUse),
501
+ // A live call that did not run because a node of `uses` is missing (#986): each with its name for
502
+ // whoever may change the gadget, null for a reader.
503
+ missing: z
504
+ .array(z.object({ nodeId: z.string().nullable(), name: z.string().nullable() }))
505
+ .optional(),
350
506
  });
351
507
  // One entry of the log as the list shows it (#643): a call of a function on the server, or the
352
508
  // interface opened in the browser (`function` null, "Geöffnet").
@@ -143,7 +143,8 @@ export declare const GoalCheck: z.ZodObject<{
143
143
  }>;
144
144
  nodeId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
145
145
  name: z.ZodNullable<z.ZodString>;
146
- nodeKind: z.ZodNullable<z.ZodEnum<{
146
+ nodeKind: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
147
+ unknown: "unknown";
147
148
  file: "file";
148
149
  folder: "folder";
149
150
  document: "document";
@@ -154,7 +155,7 @@ export declare const GoalCheck: z.ZodObject<{
154
155
  goal: "goal";
155
156
  skill: "skill";
156
157
  source: "source";
157
- }>>;
158
+ }>>>;
158
159
  needs: z.ZodNullable<z.ZodEnum<{
159
160
  write: "write";
160
161
  read: "read";
@@ -218,7 +219,8 @@ export declare const GoalReady: z.ZodObject<{
218
219
  }>;
219
220
  nodeId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
220
221
  name: z.ZodNullable<z.ZodString>;
221
- nodeKind: z.ZodNullable<z.ZodEnum<{
222
+ nodeKind: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
223
+ unknown: "unknown";
222
224
  file: "file";
223
225
  folder: "folder";
224
226
  document: "document";
@@ -229,7 +231,7 @@ export declare const GoalReady: z.ZodObject<{
229
231
  goal: "goal";
230
232
  skill: "skill";
231
233
  source: "source";
232
- }>>;
234
+ }>>>;
233
235
  needs: z.ZodNullable<z.ZodEnum<{
234
236
  write: "write";
235
237
  read: "read";
@@ -300,7 +302,13 @@ export declare const GoalPlanStep: z.ZodObject<{
300
302
  how: z.ZodNullable<z.ZodString>;
301
303
  result: z.ZodNullable<z.ZodString>;
302
304
  done: z.ZodBoolean;
303
- taskId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
305
+ evidence: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
306
+ agent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
308
+ title: z.ZodString;
309
+ result: z.ZodNullable<z.ZodString>;
310
+ done: z.ZodBoolean;
311
+ }, z.core.$strip>>>;
304
312
  }, z.core.$strip>;
305
313
  export type GoalPlanStep = z.infer<typeof GoalPlanStep>;
306
314
  export declare const GoalFollowUp: z.ZodObject<{
@@ -338,8 +346,17 @@ export declare const GoalSession: z.ZodObject<{
338
346
  costUsd: z.ZodNullable<z.ZodNumber>;
339
347
  }, z.core.$strip>;
340
348
  export type GoalSession = z.infer<typeof GoalSession>;
349
+ export declare const GoalProof: z.ZodObject<{
350
+ criterion: z.ZodString;
351
+ evidence: z.ZodString;
352
+ }, z.core.$strip>;
353
+ export type GoalProof = z.infer<typeof GoalProof>;
341
354
  export declare const GoalReport: z.ZodObject<{
342
355
  result: z.ZodString;
356
+ proof: z.ZodOptional<z.ZodArray<z.ZodObject<{
357
+ criterion: z.ZodString;
358
+ evidence: z.ZodString;
359
+ }, z.core.$strip>>>;
343
360
  changed: z.ZodNullable<z.ZodString>;
344
361
  open: z.ZodNullable<z.ZodString>;
345
362
  learned: z.ZodNullable<z.ZodString>;
@@ -495,7 +512,13 @@ export declare const GoalRunDetail: z.ZodObject<{
495
512
  how: z.ZodNullable<z.ZodString>;
496
513
  result: z.ZodNullable<z.ZodString>;
497
514
  done: z.ZodBoolean;
498
- taskId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
515
+ evidence: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
516
+ agent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
517
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
518
+ title: z.ZodString;
519
+ result: z.ZodNullable<z.ZodString>;
520
+ done: z.ZodBoolean;
521
+ }, z.core.$strip>>>;
499
522
  }, z.core.$strip>>;
500
523
  state: z.ZodNullable<z.ZodString>;
501
524
  followUp: z.ZodNullable<z.ZodObject<{
@@ -533,6 +556,10 @@ export declare const GoalRunDetail: z.ZodObject<{
533
556
  }, z.core.$strip>>;
534
557
  report: z.ZodNullable<z.ZodObject<{
535
558
  result: z.ZodString;
559
+ proof: z.ZodOptional<z.ZodArray<z.ZodObject<{
560
+ criterion: z.ZodString;
561
+ evidence: z.ZodString;
562
+ }, z.core.$strip>>>;
536
563
  changed: z.ZodNullable<z.ZodString>;
537
564
  open: z.ZodNullable<z.ZodString>;
538
565
  learned: z.ZodNullable<z.ZodString>;
@@ -614,6 +641,7 @@ export declare const GoalRunDetail: z.ZodObject<{
614
641
  messageId: z.ZodTemplateLiteral<`message_${string}`>;
615
642
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
616
643
  text: z.ZodString;
644
+ topic: z.ZodNullable<z.ZodString>;
617
645
  author: z.ZodObject<{
618
646
  userId: z.ZodString;
619
647
  name: z.ZodNullable<z.ZodString>;
@@ -630,6 +658,7 @@ export declare const GoalRunDetail: z.ZodObject<{
630
658
  claude: "claude";
631
659
  codex: "codex";
632
660
  gemini: "gemini";
661
+ gateway: "gateway";
633
662
  }>>;
634
663
  }, z.core.$strip>>;
635
664
  appHandle: z.ZodNullable<z.ZodString>;
@@ -745,7 +774,8 @@ export declare const GoalDetail: z.ZodObject<{
745
774
  }>;
746
775
  nodeId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
747
776
  name: z.ZodNullable<z.ZodString>;
748
- nodeKind: z.ZodNullable<z.ZodEnum<{
777
+ nodeKind: z.ZodNullable<z.ZodCatch<z.ZodEnum<{
778
+ unknown: "unknown";
749
779
  file: "file";
750
780
  folder: "folder";
751
781
  document: "document";
@@ -756,7 +786,7 @@ export declare const GoalDetail: z.ZodObject<{
756
786
  goal: "goal";
757
787
  skill: "skill";
758
788
  source: "source";
759
- }>>;
789
+ }>>>;
760
790
  needs: z.ZodNullable<z.ZodEnum<{
761
791
  write: "write";
762
792
  read: "read";
@@ -856,7 +886,13 @@ export declare const GoalDetail: z.ZodObject<{
856
886
  how: z.ZodNullable<z.ZodString>;
857
887
  result: z.ZodNullable<z.ZodString>;
858
888
  done: z.ZodBoolean;
859
- taskId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
889
+ evidence: z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>;
890
+ agent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
891
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
892
+ title: z.ZodString;
893
+ result: z.ZodNullable<z.ZodString>;
894
+ done: z.ZodBoolean;
895
+ }, z.core.$strip>>>;
860
896
  }, z.core.$strip>>;
861
897
  state: z.ZodNullable<z.ZodString>;
862
898
  followUp: z.ZodNullable<z.ZodObject<{
@@ -894,6 +930,10 @@ export declare const GoalDetail: z.ZodObject<{
894
930
  }, z.core.$strip>>;
895
931
  report: z.ZodNullable<z.ZodObject<{
896
932
  result: z.ZodString;
933
+ proof: z.ZodOptional<z.ZodArray<z.ZodObject<{
934
+ criterion: z.ZodString;
935
+ evidence: z.ZodString;
936
+ }, z.core.$strip>>>;
897
937
  changed: z.ZodNullable<z.ZodString>;
898
938
  open: z.ZodNullable<z.ZodString>;
899
939
  learned: z.ZodNullable<z.ZodString>;
@@ -975,6 +1015,7 @@ export declare const GoalDetail: z.ZodObject<{
975
1015
  messageId: z.ZodTemplateLiteral<`message_${string}`>;
976
1016
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
977
1017
  text: z.ZodString;
1018
+ topic: z.ZodNullable<z.ZodString>;
978
1019
  author: z.ZodObject<{
979
1020
  userId: z.ZodString;
980
1021
  name: z.ZodNullable<z.ZodString>;
@@ -991,6 +1032,7 @@ export declare const GoalDetail: z.ZodObject<{
991
1032
  claude: "claude";
992
1033
  codex: "codex";
993
1034
  gemini: "gemini";
1035
+ gateway: "gateway";
994
1036
  }>>;
995
1037
  }, z.core.$strip>>;
996
1038
  appHandle: z.ZodNullable<z.ZodString>;
@@ -1095,7 +1137,7 @@ export declare const GoalRunUpdateInput: z.ZodObject<{
1095
1137
  how: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1096
1138
  result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1097
1139
  done: z.ZodOptional<z.ZodBoolean>;
1098
- taskId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>>;
1140
+ evidence: z.ZodOptional<z.ZodArray<z.ZodTemplateLiteral<`node_${string}`>>>;
1099
1141
  }, z.core.$strict>>>;
1100
1142
  state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1101
1143
  followUp: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1121,6 +1163,10 @@ export declare const GoalRunCompleteInput: z.ZodObject<{
1121
1163
  participants: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1122
1164
  frame: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1123
1165
  }, z.core.$strict>;
1166
+ proof: z.ZodOptional<z.ZodArray<z.ZodObject<{
1167
+ criterion: z.ZodString;
1168
+ evidence: z.ZodString;
1169
+ }, z.core.$strict>>>;
1124
1170
  }, z.core.$strict>;
1125
1171
  export type GoalRunCompleteInput = z.infer<typeof GoalRunCompleteInput>;
1126
1172
  export declare const GoalRunCancelInput: z.ZodObject<{
@@ -3,8 +3,8 @@ import { idSchema } from "../ids/ids.js";
3
3
  import { Limit } from "../list-input.js";
4
4
  import { Message } from "../messages/messages.js";
5
5
  import { Missing } from "../missing/missing.js";
6
- import { CreateSection, NodeId, NodeKind, NodePath, NodePerson } from "../nodes/nodes.js";
7
- import { IdempotencyKey, Rev } from "../primitives/primitives.js";
6
+ import { CreateSection, NodeId, NodeKindRead, NodePath, NodePerson } from "../nodes/nodes.js";
7
+ import { IdempotencyKey, PlanSubstep, planEvidenceMax, Rev } from "../primitives/primitives.js";
8
8
  import { Schedule } from "../schedule/schedule.js";
9
9
  import { UserId } from "../users/users.js";
10
10
  // Goals (#813, Nodes › Ziel, E139): the inputs of `intelligence_goal_create|get|update` and
@@ -82,7 +82,7 @@ export const GoalCheck = z.object({
82
82
  nodeId: NodeId.nullable(),
83
83
  // The node's name and kind as the caller may read them; null where they may not, or it is gone.
84
84
  name: z.string().nullable(),
85
- nodeKind: NodeKind.nullable(),
85
+ nodeKind: NodeKindRead.nullable(),
86
86
  // The right the Operator needs on the node: write on a board, where it hands over work as cards,
87
87
  // read on everything else.
88
88
  needs: z.enum(["read", "write"]).nullable(),
@@ -125,8 +125,12 @@ export const GoalPlanStep = z.object({
125
125
  how: Paragraph.nullable(),
126
126
  result: Paragraph.nullable(),
127
127
  done: z.boolean(),
128
- // The card this step was handed over as, on a normal board; null when the Operator does it itself.
129
- taskId: NodeId.nullable(),
128
+ // What the step left (E219, #1037): any node, a document, a table, a card handed over, a file. A
129
+ // step stored before with a `taskId` shows that card here.
130
+ evidence: z.array(NodeId),
131
+ // The subagent of the Operator's run the step went to, and its plan beneath it (E220, #1038).
132
+ agent: z.string().nullable().optional(),
133
+ steps: z.array(PlanSubstep).optional(),
130
134
  });
131
135
  const GoalPlanStepInput = z.strictObject({
132
136
  title: Line.describe("The step in a few words."),
@@ -135,9 +139,11 @@ const GoalPlanStepInput = z.strictObject({
135
139
  .describe("How it is done, and by whom: yourself, or a card for someone else."),
136
140
  result: Paragraph.nullable().optional().describe("What the step left, once it is done."),
137
141
  done: z.boolean().optional().describe("Whether the step is done; leaving it out means not yet."),
138
- taskId: NodeId.nullable()
142
+ evidence: z
143
+ .array(NodeId)
144
+ .max(planEvidenceMax)
139
145
  .optional()
140
- .describe("The card the step was handed over as, on a normal board."),
146
+ .describe("What the step left: the nodes it made or used as proof (a document, a table, a card handed over, a file)."),
141
147
  });
142
148
  export const GoalFollowUp = z.object({
143
149
  at: z.iso.datetime(),
@@ -172,8 +178,13 @@ const reportParts = {
172
178
  .describe("Who worked on it, people and Operators."),
173
179
  frame: ReportText.nullable().optional().describe("Time and money spent against the frame."),
174
180
  };
181
+ // One criterion of the goal's "Fertig wenn" with its proof (E219, #1037): a link to a node or a
182
+ // value someone can check.
183
+ export const GoalProof = z.object({ criterion: z.string(), evidence: z.string() });
175
184
  export const GoalReport = z.object({
176
185
  result: z.string(),
186
+ // The proof per criterion of a run that was reached (E219); empty for a goal without "Fertig wenn".
187
+ proof: z.array(GoalProof).optional(),
177
188
  changed: z.string().nullable(),
178
189
  open: z.string().nullable(),
179
190
  learned: z.string().nullable(),
@@ -323,6 +334,24 @@ export const GoalRunCompleteInput = z.strictObject({
323
334
  .enum(["reached", "missed"])
324
335
  .describe("reached when every point of done-when holds, missed otherwise. Ignored for a run that is already over (Colab or a person ended it): then only the report is added."),
325
336
  report: z.strictObject(reportParts).describe("The report of the run, sent to Report to."),
337
+ proof: z
338
+ .array(z.strictObject({
339
+ criterion: z
340
+ .string()
341
+ .trim()
342
+ .min(1)
343
+ .max(500)
344
+ .describe("The criterion, as the goal words it."),
345
+ evidence: z
346
+ .string()
347
+ .trim()
348
+ .min(1)
349
+ .max(2000)
350
+ .describe("Its proof: a link to the node (`/n/node_…`) or a value someone can check."),
351
+ }))
352
+ .max(50)
353
+ .optional()
354
+ .describe("With reached: one entry per point of the goal's done-when (Fertig wenn), in its order. reached is refused while one has no proof; missed needs none."),
326
355
  });
327
356
  export const GoalRunCancelInput = z.strictObject({
328
357
  goalId: GoalId,
@@ -34,6 +34,7 @@ export declare const resources: {
34
34
  readonly credential: "credentials";
35
35
  readonly provider: "providers";
36
36
  readonly secret: "secrets";
37
+ readonly token: "tokens";
37
38
  readonly step: "steps";
38
39
  readonly crawl: "crawls";
39
40
  readonly mcp: "mcps";
@@ -41,6 +42,7 @@ export declare const resources: {
41
42
  readonly query: "queries";
42
43
  readonly item: "items";
43
44
  readonly organisation: "organisations";
45
+ readonly home: "homes";
44
46
  };
45
47
  export declare const actions: readonly ["list", "get", "create", "update", "archive", "restore", "purge"];
46
48
  export declare const verbs: readonly ["invite", "resend", "disable", "enable", "rotate", "share", "move", "start", "complete", "test", "revoke", "remove", "unlock", "publish", "schedule", "unpublish", "cancel"];
@@ -63,6 +63,10 @@ export const resources = {
63
63
  // password, `_get` shows it to an admin in admin mode, `_remove` makes the node public again. One
64
64
  // per node, with an id of its own like every sub-resource (`secret_…`).
65
65
  secret: "secrets",
66
+ // A Git token of a code node's repository (E215, #976), a sub-resource of the skill, decided by
67
+ // the orchestrator (2026-11-04): `intelligence_skill_token_create` gives one for `git clone` or
68
+ // `git push`, with an expiry; never stored, never in a protocol.
69
+ token: "tokens",
66
70
  // One step of an Operator run as its CLI's output showed it (E112), a sub-resource of the run:
67
71
  // `operator_run_step_list`. Not `event`, the protocol's resource, and not `message`, a chat's.
68
72
  step: "steps",
@@ -81,6 +85,10 @@ export const resources = {
81
85
  // The company as a whole (#930, Organisation › System): its default time zone and language,
82
86
  // `access_organisation_get` and `_update`. One per installation, so its routes carry no id.
83
87
  organisation: "organisations",
88
+ // The start of an installation (#1020, E208, Seiten › Startfläche): `intelligence_home_get`, which
89
+ // gadget stands under `/`, the setup steps and Colab's news. One per installation like
90
+ // `organisation`, so its route carries no id. The word the orchestrator gave the start for #993.
91
+ home: "homes",
84
92
  };
85
93
  // The closed list of actions with a route of their own shape.
86
94
  export const actions = ["list", "get", "create", "update", "archive", "restore", "purge"];
@@ -244,6 +252,8 @@ const routeExceptions = {
244
252
  // The one organisation of an installation (#930): there is no `organisationId` to name.
245
253
  access_organisation_get: { method: "GET", path: "/api/access/organisation" },
246
254
  access_organisation_update: { method: "PATCH", path: "/api/access/organisation" },
255
+ // The one start of an installation (#1020): there is no `homeId` to name either.
256
+ intelligence_home_get: { method: "GET", path: "/api/intelligence/home" },
247
257
  };
248
258
  // `access_user_invite` → `POST /api/access/users/:userId/invite`.
249
259
  export function toolRoute(name) {