@anchrd/colab-sdk 0.1.53 → 0.1.55

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 (47) hide show
  1. package/dist/action-blocks/action-blocks.d.ts +1 -0
  2. package/dist/action-blocks/action-blocks.js +22 -0
  3. package/dist/actions/actions.d.ts +356 -23
  4. package/dist/actions/actions.js +21 -6
  5. package/dist/boards/boards.d.ts +0 -14
  6. package/dist/boards/boards.js +3 -18
  7. package/dist/documents/documents.d.ts +2 -0
  8. package/dist/flows/flow-runs.d.ts +34 -0
  9. package/dist/flows/flow-runs.js +48 -4
  10. package/dist/flows/flows.d.ts +5 -10
  11. package/dist/flows/flows.js +5 -4
  12. package/dist/gadgets/gadgets.d.ts +4 -21
  13. package/dist/gadgets/gadgets.js +6 -6
  14. package/dist/goals/goals.d.ts +1 -0
  15. package/dist/goals/goals.js +2 -2
  16. package/dist/grammar/grammar.d.ts +1 -2
  17. package/dist/grammar/grammar.js +5 -7
  18. package/dist/home/home.d.ts +2 -5
  19. package/dist/links/links.d.ts +15 -2
  20. package/dist/links/links.js +25 -13
  21. package/dist/messages/messages.js +5 -4
  22. package/dist/nodes/nodes.d.ts +11 -6
  23. package/dist/nodes/nodes.js +11 -7
  24. package/dist/operators/operators.d.ts +87 -4
  25. package/dist/operators/operators.js +57 -3
  26. package/dist/processes/processes.d.ts +1999 -0
  27. package/dist/processes/processes.js +417 -0
  28. package/dist/runs/runs.d.ts +1 -200
  29. package/dist/runs/runs.js +3 -64
  30. package/dist/schedule/schedule.js +3 -3
  31. package/dist/sdk.d.ts +11 -12
  32. package/dist/sdk.js +11 -12
  33. package/dist/skills/skills.d.ts +1 -0
  34. package/dist/sources/sources.d.ts +4 -13
  35. package/dist/sources/sources.js +4 -4
  36. package/dist/tables/tables.d.ts +114 -1
  37. package/dist/tables/tables.js +86 -2
  38. package/dist/tool.d.ts +1 -0
  39. package/dist/users/users.d.ts +30 -0
  40. package/dist/users/users.js +32 -0
  41. package/dist/written/written.d.ts +2 -4
  42. package/dist/written/written.js +2 -5
  43. package/package.json +2 -1
  44. package/dist/relations/relations.d.ts +0 -342
  45. package/dist/relations/relations.js +0 -129
  46. package/dist/types/types.d.ts +0 -181
  47. package/dist/types/types.js +0 -124
@@ -78,6 +78,8 @@ export const NodeLinkList = z.object({
78
78
  export const gadgetLinkLimits = { visitorHour: 60, linkDay: 2000 };
79
79
  // The path of the door a visitor reaches (`/l/<code>`), its code 12 letters and digits.
80
80
  export const gadgetLinkPath = "/l";
81
+ // How a link opens (E164, E295): with a password, a code by mail, or the sign-in of an account.
82
+ export const gadgetLinkOpens = ["password", "mail", "account"];
81
83
  const GadgetLinkFunction = z
82
84
  .string()
83
85
  .regex(/^[a-z][a-z0-9]*\.[a-z][a-z0-9]*$/)
@@ -116,11 +118,11 @@ export const GadgetLinkCreateInput = z.strictObject({
116
118
  .describe("The link's name for the people who share it; leaving it out gives the gadget's name."),
117
119
  kind: z
118
120
  .enum(["link", "embed"])
119
- .describe("link: opened with a password or a code by mail, at most 90 days. embed: on the allowed domains only, without an end."),
121
+ .describe("link: opened with a password or a code by mail (at most 90 days), or with sign-in by any account of this installation (without an end unless one is given). embed: on the allowed domains only, without an end."),
120
122
  opensWith: z
121
- .enum(["password", "mail"])
123
+ .enum(gadgetLinkOpens)
122
124
  .optional()
123
- .describe("How a link opens: password (the default) or mail, a code the visitor gets by mail. Not for an embed."),
125
+ .describe("How a link opens: password (the default), mail (a code the visitor gets by mail) or account (the visitor signs in with an account of this installation, and the gadget sees who it is). Not for an embed."),
124
126
  functions: z
125
127
  .array(GadgetLinkFunction)
126
128
  .min(1)
@@ -132,7 +134,7 @@ export const GadgetLinkCreateInput = z.strictObject({
132
134
  .min(1)
133
135
  .max(maxLinkDays)
134
136
  .optional()
135
- .describe("A link's days, 1 to 90; leaving it out gives 7. An embed has no end."),
137
+ .describe("A link's days, 1 to 90; leaving it out gives 7, and for a link that opens with account no end. An embed has no end."),
136
138
  password: z
137
139
  .string()
138
140
  .min(8)
@@ -155,14 +157,14 @@ export const GadgetLink = z.object({
155
157
  kind: z.enum(["link", "embed"]),
156
158
  name: z.string(),
157
159
  // How a link opens; null for an embed.
158
- opensWith: z.enum(["password", "mail"]).nullable(),
160
+ opensWith: z.enum(gadgetLinkOpens).nullable(),
159
161
  // Derived every time, never stored: `<installation>/l/<code>`.
160
162
  url: z.string(),
161
163
  functions: z.array(z.string()),
162
164
  domains: z.array(z.string()),
163
165
  password: z.boolean(),
164
166
  limits: z.object({ visitorHour: z.number().int(), linkDay: z.number().int() }),
165
- // Null for an embed.
167
+ // Null for an embed and for a link without an end.
166
168
  expiresAt: z.iso.datetime().nullable(),
167
169
  status: LinkStatus,
168
170
  // The calls the link took in the last seven days, counted by its daily brake.
@@ -179,7 +181,7 @@ export const GadgetLinkCallInput = z.strictObject({
179
181
  function: z.string().min(1).max(64),
180
182
  input: z.record(z.string(), z.unknown()).optional(),
181
183
  password: z.string().max(200).optional(),
182
- visit: z.string().max(200).optional(),
184
+ visit: z.string().max(400).optional(),
183
185
  });
184
186
  // How the visitor's page opens a link (`POST /l/<code>/visits`, #820, E164): with the password, with
185
187
  // the address and the code that came by mail, or for an embed with the token of the bot check.
@@ -188,6 +190,8 @@ export const GadgetLinkVisitInput = z.strictObject({
188
190
  address: z.email().max(254).optional(),
189
191
  code: z.string().max(20).optional(),
190
192
  turnstile: z.string().max(4096).optional(),
193
+ // A link that opens with sign-in (E295): the entry the page at `/l/<code>` was served with.
194
+ entry: z.string().max(400).optional(),
191
195
  });
192
196
  // A code by mail asked for (`POST /l/<code>/codes`).
193
197
  export const GadgetLinkCodeInput = z.strictObject({ address: z.email().max(254) });
@@ -195,13 +199,21 @@ export const GadgetLinkCodeInput = z.strictObject({ address: z.email().max(254)
195
199
  // client files only, never `server.js` or its tests).
196
200
  export const GadgetLinkVisit = z.object({
197
201
  visit: z.string(),
202
+ // Only for a link that opens with sign-in (E295): what the page's sign-out carries in its address.
203
+ leave: z.string().optional(),
198
204
  expiresAt: z.iso.datetime(),
199
205
  gadget: z.object({ name: z.string(), files: z.record(z.string(), z.string()) }),
200
- viewer: z.object({
201
- kind: z.literal("external"),
202
- linkId: z.string(),
203
- rights: z.array(z.string()),
204
- }),
206
+ // An outside visitor, or for a link that opens with sign-in (E295) the person who signed in.
207
+ viewer: z.discriminatedUnion("kind", [
208
+ z.object({ kind: z.literal("external"), linkId: z.string(), rights: z.array(z.string()) }),
209
+ z.object({
210
+ kind: z.literal("human"),
211
+ userId: z.string(),
212
+ name: z.string(),
213
+ linkId: z.string(),
214
+ rights: z.array(z.string()),
215
+ }),
216
+ ]),
205
217
  });
206
218
  // What the page at `/l/<code>` is (#820): which screen it opens with. `unknown` names nothing.
207
219
  export const GadgetLinkPage = z.discriminatedUnion("status", [
@@ -214,7 +226,7 @@ export const GadgetLinkPage = z.discriminatedUnion("status", [
214
226
  z.object({
215
227
  status: z.literal("active"),
216
228
  kind: z.enum(["link", "embed"]),
217
- opensWith: z.enum(["password", "mail"]).nullable(),
229
+ opensWith: z.enum(gadgetLinkOpens).nullable(),
218
230
  gadgetName: z.string(),
219
231
  linkName: z.string(),
220
232
  domains: z.array(z.string()),
@@ -6,7 +6,8 @@ import { IdempotencyKey } from "../primitives/primitives.js";
6
6
  import { MessageMachine } from "../users/users.js";
7
7
  // The chat of a node (#45, Funktionen › Chat, E49, E67): the inputs of `intelligence_message_list`,
8
8
  // `intelligence_message_create` and `intelligence_chat_update`, and their answers. Every node but a
9
- // folder has a chat; it has no row of its own, and its `chatId` is the node's id. Messages are only
9
+ // folder has a chat, and a folder that is a process has one too (E284, #1259); it has no row of its
10
+ // own, and its `chatId` is the node's id. Messages are only
10
11
  // appended: no editing, no following. A message carries up to ten attachments (#1210, E265), each
11
12
  // uploaded into the chat first and named by the message that sends it.
12
13
  export const MessageId = idSchema("message").describe("A message's id, `message_…`, as intelligence_message_list returns it.");
@@ -28,7 +29,7 @@ export function topicOf(name) {
28
29
  return generalNames.has(trimmed.toLowerCase()) ? null : trimmed;
29
30
  }
30
31
  export const MessageListInput = z.strictObject({
31
- nodeId: NodeId.describe("The node whose chat to read: any node you can read except a folder, which has no chat."),
32
+ nodeId: NodeId.describe("The node whose chat to read: any node you can read except a folder, which has no chat unless it is a process."),
32
33
  cursor: z
33
34
  .string()
34
35
  .max(200)
@@ -47,7 +48,7 @@ export const attachmentMaxBytes = 20 * 1024 * 1024;
47
48
  // The Base64 of the largest attachment, padded: what the input's length is held to.
48
49
  const attachmentMaxBase64 = Math.ceil(attachmentMaxBytes / 3) * 4;
49
50
  export const ChatAttachmentCreateInput = z.strictObject({
50
- chatId: NodeId.describe("The chat to attach the file in: the id of its node, `node_…`, any node you can read except a folder."),
51
+ chatId: NodeId.describe("The chat to attach the file in: the id of its node, `node_…`, any node you can read except a folder that is no process."),
51
52
  name: z
52
53
  .string()
53
54
  .trim()
@@ -94,7 +95,7 @@ export const ChatAttachmentRead = z.object({
94
95
  });
95
96
  export const MessageCreateInput = z
96
97
  .strictObject({
97
- nodeId: NodeId.describe("The node whose chat to write in: any node you can read except a folder. Reading is enough to write."),
98
+ nodeId: NodeId.describe("The node whose chat to write in: any node you can read except a folder that is no process. Reading is enough to write."),
98
99
  text: z
99
100
  .string()
100
101
  .trim()
@@ -41,7 +41,6 @@ export type NodeKindRead = z.infer<typeof NodeKindRead>;
41
41
  export declare const responsibleKinds: readonly ["document", "table", "file"];
42
42
  export declare const BoardShownKind: z.ZodEnum<{
43
43
  board: "board";
44
- process: "process";
45
44
  }>;
46
45
  export type BoardShownKind = z.infer<typeof BoardShownKind>;
47
46
  export declare const NodeSection: z.ZodEnum<{
@@ -103,6 +102,7 @@ export declare const NodePath: z.ZodObject<{
103
102
  items: z.ZodArray<z.ZodObject<{
104
103
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
105
104
  name: z.ZodString;
105
+ process: z.ZodBoolean;
106
106
  }, z.core.$strip>>;
107
107
  }, z.core.$strip>;
108
108
  export type NodePath = z.infer<typeof NodePath>;
@@ -148,7 +148,6 @@ export declare const NodeListItem: z.ZodObject<{
148
148
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
149
149
  boardKind: z.ZodNullable<z.ZodEnum<{
150
150
  board: "board";
151
- process: "process";
152
151
  }>>;
153
152
  path: z.ZodOptional<z.ZodObject<{
154
153
  section: z.ZodEnum<{
@@ -159,10 +158,12 @@ export declare const NodeListItem: z.ZodObject<{
159
158
  items: z.ZodArray<z.ZodObject<{
160
159
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
161
160
  name: z.ZodString;
161
+ process: z.ZodBoolean;
162
162
  }, z.core.$strip>>;
163
163
  }, z.core.$strip>>;
164
164
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
165
165
  secret: z.ZodOptional<z.ZodLiteral<true>>;
166
+ process: z.ZodOptional<z.ZodLiteral<true>>;
166
167
  preview: z.ZodOptional<z.ZodTemplateLiteral<`version_${string}`>>;
167
168
  rights: z.ZodOptional<z.ZodObject<{
168
169
  write: z.ZodBoolean;
@@ -213,7 +214,6 @@ export declare const NodeList: z.ZodObject<{
213
214
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
214
215
  boardKind: z.ZodNullable<z.ZodEnum<{
215
216
  board: "board";
216
- process: "process";
217
217
  }>>;
218
218
  path: z.ZodOptional<z.ZodObject<{
219
219
  section: z.ZodEnum<{
@@ -224,10 +224,12 @@ export declare const NodeList: z.ZodObject<{
224
224
  items: z.ZodArray<z.ZodObject<{
225
225
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
226
226
  name: z.ZodString;
227
+ process: z.ZodBoolean;
227
228
  }, z.core.$strip>>;
228
229
  }, z.core.$strip>>;
229
230
  count: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
230
231
  secret: z.ZodOptional<z.ZodLiteral<true>>;
232
+ process: z.ZodOptional<z.ZodLiteral<true>>;
231
233
  preview: z.ZodOptional<z.ZodTemplateLiteral<`version_${string}`>>;
232
234
  rights: z.ZodOptional<z.ZodObject<{
233
235
  write: z.ZodBoolean;
@@ -286,6 +288,7 @@ export declare const NodeHit: z.ZodObject<{
286
288
  items: z.ZodArray<z.ZodObject<{
287
289
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
288
290
  name: z.ZodString;
291
+ process: z.ZodBoolean;
289
292
  }, z.core.$strip>>;
290
293
  }, z.core.$strip>;
291
294
  snippet: z.ZodString;
@@ -303,7 +306,6 @@ export declare const NodeHit: z.ZodObject<{
303
306
  updatedAt: z.ZodISODateTime;
304
307
  boardKind: z.ZodNullable<z.ZodEnum<{
305
308
  board: "board";
306
- process: "process";
307
309
  }>>;
308
310
  secret: z.ZodOptional<z.ZodLiteral<true>>;
309
311
  }, z.core.$strip>;
@@ -319,6 +321,7 @@ export declare const NodeHitGroup: z.ZodObject<{
319
321
  items: z.ZodArray<z.ZodObject<{
320
322
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
321
323
  name: z.ZodString;
324
+ process: z.ZodBoolean;
322
325
  }, z.core.$strip>>;
323
326
  }, z.core.$strip>;
324
327
  count: z.ZodNumber;
@@ -351,6 +354,7 @@ export declare const NodeSearch: z.ZodObject<{
351
354
  items: z.ZodArray<z.ZodObject<{
352
355
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
353
356
  name: z.ZodString;
357
+ process: z.ZodBoolean;
354
358
  }, z.core.$strip>>;
355
359
  }, z.core.$strip>;
356
360
  snippet: z.ZodString;
@@ -368,7 +372,6 @@ export declare const NodeSearch: z.ZodObject<{
368
372
  updatedAt: z.ZodISODateTime;
369
373
  boardKind: z.ZodNullable<z.ZodEnum<{
370
374
  board: "board";
371
- process: "process";
372
375
  }>>;
373
376
  secret: z.ZodOptional<z.ZodLiteral<true>>;
374
377
  }, z.core.$strip>>;
@@ -383,6 +386,7 @@ export declare const NodeSearch: z.ZodObject<{
383
386
  items: z.ZodArray<z.ZodObject<{
384
387
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
385
388
  name: z.ZodString;
389
+ process: z.ZodBoolean;
386
390
  }, z.core.$strip>>;
387
391
  }, z.core.$strip>;
388
392
  count: z.ZodNumber;
@@ -443,7 +447,6 @@ export declare const NodeDetail: z.ZodObject<{
443
447
  rootOf: z.ZodNullable<z.ZodString>;
444
448
  boardKind: z.ZodNullable<z.ZodEnum<{
445
449
  board: "board";
446
- process: "process";
447
450
  }>>;
448
451
  parentId: z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>;
449
452
  path: z.ZodObject<{
@@ -455,6 +458,7 @@ export declare const NodeDetail: z.ZodObject<{
455
458
  items: z.ZodArray<z.ZodObject<{
456
459
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
457
460
  name: z.ZodString;
461
+ process: z.ZodBoolean;
458
462
  }, z.core.$strip>>;
459
463
  }, z.core.$strip>;
460
464
  createdBy: z.ZodObject<{
@@ -478,6 +482,7 @@ export declare const NodeDetail: z.ZodObject<{
478
482
  share: z.ZodBoolean;
479
483
  }, z.core.$strip>;
480
484
  hiddenCount: z.ZodNullable<z.ZodNumber>;
485
+ process: z.ZodOptional<z.ZodLiteral<true>>;
481
486
  size: z.ZodNullable<z.ZodNumber>;
482
487
  rev: z.ZodNumber;
483
488
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
@@ -55,10 +55,10 @@ export const responsibleKinds = [
55
55
  "table",
56
56
  "file",
57
57
  ];
58
- // What a board is as an answer shows it: besides the one a caller makes (`boardKinds` in `boards.ts`),
59
- // a process from before goals. Here, not beside the boards, because the lists carry it too (#227) and
60
- // `boards.ts` imports from this file.
61
- export const BoardShownKind = z.enum(["board", "process"]);
58
+ // What a board is as an answer shows it (#227). One kind since the process boards went (#1266); the
59
+ // field stays so a reader keeps its shape. Here, not beside the boards, because the lists carry it
60
+ // too and `boards.ts` imports from this file.
61
+ export const BoardShownKind = z.enum(["board"]);
62
62
  // The three sections of the tree (Funktionen › Seitenbaum, E67).
63
63
  export const NodeSection = z.enum(["own", "shared", "users"]);
64
64
  // Where a create without a parent lands (#930, after #791): Own unless the caller says Shared. Only
@@ -124,7 +124,8 @@ export const NodePerson = z.object({
124
124
  // The crumbs above a node, from the first level the caller can read, and the section they start in.
125
125
  export const NodePath = z.object({
126
126
  section: NodeSection,
127
- items: z.array(z.object({ nodeId: NodeId, name: z.string() })),
127
+ // `process`: the folder is a process (#1258), so the view Process starts its crumbs there (#1312).
128
+ items: z.array(z.object({ nodeId: NodeId, name: z.string(), process: z.boolean() })),
128
129
  });
129
130
  export const NodeListItem = z.object({
130
131
  nodeId: NodeId,
@@ -147,8 +148,7 @@ export const NodeListItem = z.object({
147
148
  sharedWith: z.number().int(),
148
149
  // When it went into the archive; null for a node that is not archived.
149
150
  archivedAt: z.iso.datetime().nullable(),
150
- // What a board is (#227): the tree, the folder and the archive draw a process apart from a board;
151
- // null for every other kind.
151
+ // What a board is (#227); null for every other kind.
152
152
  boardKind: BoardShownKind.nullable(),
153
153
  // Only in the archive (`archived: true`): where it stood, as the caller can read it, for a folder
154
154
  // how many archived nodes it holds directly, and for a board how many archived tasks (#135).
@@ -156,6 +156,8 @@ export const NodeListItem = z.object({
156
156
  count: z.number().int().nullable().optional(),
157
157
  // Only on a secret document or table (#357): the tree draws the lock.
158
158
  secret: secretFlag,
159
+ // Only on a folder that is a process (#1258): the tree draws the play sign at its icon.
160
+ process: z.literal(true).optional(),
159
161
  // Only over `/api`, on a file whose current version is an image the installation can show smaller
160
162
  // (#1135): that version, so the folder's preview address changes with a new version. `/mcp` leaves
161
163
  // it out; an AI reads the file itself.
@@ -258,6 +260,8 @@ export const NodeDetail = z.object({
258
260
  rights: z.object({ write: z.boolean(), share: z.boolean() }),
259
261
  // Only for a folder: how many hidden nodes it holds ("Versteckte anzeigen").
260
262
  hiddenCount: z.number().int().nullable(),
263
+ // Only on a folder that is a process (#1258): the play sign at its icon.
264
+ process: z.literal(true).optional(),
261
265
  // Bytes of the current version, as in the listing (#38).
262
266
  size: z.number().int().nullable(),
263
267
  rev: z.number().int(),
@@ -819,6 +819,7 @@ export declare const PauseReason: z.ZodEnum<{
819
819
  export type PauseReason = z.infer<typeof PauseReason>;
820
820
  export declare const MachineListInput: z.ZodObject<{
821
821
  personal: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
822
+ archived: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
822
823
  cursor: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
823
824
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
824
825
  }, z.core.$strict>;
@@ -980,6 +981,28 @@ export declare const OperatorMachineRestoreInput: z.ZodObject<{
980
981
  machineId: z.ZodTemplateLiteral<`user_${string}`>;
981
982
  }, z.core.$strict>;
982
983
  export type OperatorMachineRestoreInput = z.infer<typeof OperatorMachineRestoreInput>;
984
+ export declare const OperatorMachinePurgeInput: z.ZodObject<{
985
+ machineId: z.ZodTemplateLiteral<`user_${string}`>;
986
+ }, z.core.$strict>;
987
+ export type OperatorMachinePurgeInput = z.infer<typeof OperatorMachinePurgeInput>;
988
+ export declare const OperatorMachinePurged: z.ZodObject<{
989
+ machineId: z.ZodTemplateLiteral<`user_${string}`>;
990
+ name: z.ZodString;
991
+ runs: z.ZodNumber;
992
+ }, z.core.$strip>;
993
+ export type OperatorMachinePurged = z.infer<typeof OperatorMachinePurged>;
994
+ export declare const OperatorMachineHoldings: z.ZodObject<{
995
+ running: z.ZodNumber;
996
+ responsible: z.ZodNumber;
997
+ goals: z.ZodNumber;
998
+ month: z.ZodNumber;
999
+ tasks: z.ZodNumber;
1000
+ grants: z.ZodNumber;
1001
+ messages: z.ZodNumber;
1002
+ conversations: z.ZodNumber;
1003
+ runs: z.ZodNumber;
1004
+ }, z.core.$strip>;
1005
+ export type OperatorMachineHoldings = z.infer<typeof OperatorMachineHoldings>;
983
1006
  export declare const Operator: z.ZodObject<{
984
1007
  machineId: z.ZodTemplateLiteral<`user_${string}`>;
985
1008
  name: z.ZodString;
@@ -1803,6 +1826,16 @@ export declare const OperatorUserList: z.ZodObject<{
1803
1826
  nextCursor: z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>;
1804
1827
  }, z.core.$strip>;
1805
1828
  export type OperatorUserList = z.infer<typeof OperatorUserList>;
1829
+ export declare const UserRevokeInput: z.ZodObject<{
1830
+ userId: z.ZodTemplateLiteral<`user_${string}`>;
1831
+ }, z.core.$strict>;
1832
+ export type UserRevokeInput = z.infer<typeof UserRevokeInput>;
1833
+ export declare const UserRevoked: z.ZodObject<{
1834
+ userId: z.ZodTemplateLiteral<`user_${string}`>;
1835
+ credentials: z.ZodNumber;
1836
+ mcps: z.ZodNumber;
1837
+ }, z.core.$strip>;
1838
+ export type UserRevoked = z.infer<typeof UserRevoked>;
1806
1839
  export declare const OperatorRunId: z.ZodTemplateLiteral<`run_${string}`>;
1807
1840
  export type OperatorRunId = z.infer<typeof OperatorRunId>;
1808
1841
  export declare const OperatorRunStatus: z.ZodEnum<{
@@ -1968,6 +2001,19 @@ export declare const ClosureFound: z.ZodDiscriminatedUnion<[z.ZodObject<{
1968
2001
  text: z.ZodLiteral<"nothing">;
1969
2002
  }, z.core.$strip>], "text">;
1970
2003
  export type ClosureFound = z.infer<typeof ClosureFound>;
2004
+ export declare const RunNodeUse: z.ZodEnum<{
2005
+ write: "write";
2006
+ read: "read";
2007
+ }>;
2008
+ export type RunNodeUse = z.infer<typeof RunNodeUse>;
2009
+ export declare const RunNode: z.ZodObject<{
2010
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
2011
+ use: z.ZodEnum<{
2012
+ write: "write";
2013
+ read: "read";
2014
+ }>;
2015
+ }, z.core.$strip>;
2016
+ export type RunNode = z.infer<typeof RunNode>;
1971
2017
  export declare const ClosureLine: z.ZodObject<{
1972
2018
  nodeId: z.ZodString;
1973
2019
  kind: z.ZodEnum<{
@@ -2043,6 +2089,15 @@ export declare const ClosureLine: z.ZodObject<{
2043
2089
  text: z.ZodLiteral<"nothing">;
2044
2090
  }, z.core.$strip>], "text">>;
2045
2091
  reported: z.ZodBoolean;
2092
+ processId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>>;
2093
+ actionId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`action_${string}`>>>;
2094
+ outside: z.ZodOptional<z.ZodArray<z.ZodObject<{
2095
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
2096
+ use: z.ZodEnum<{
2097
+ write: "write";
2098
+ read: "read";
2099
+ }>;
2100
+ }, z.core.$strip>>>;
2046
2101
  }, z.core.$strip>;
2047
2102
  export type ClosureLine = z.infer<typeof ClosureLine>;
2048
2103
  export declare const OperatorRun: z.ZodObject<{
@@ -2215,6 +2270,15 @@ export declare const OperatorRun: z.ZodObject<{
2215
2270
  text: z.ZodLiteral<"nothing">;
2216
2271
  }, z.core.$strip>], "text">>;
2217
2272
  reported: z.ZodBoolean;
2273
+ processId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>>;
2274
+ actionId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`action_${string}`>>>;
2275
+ outside: z.ZodOptional<z.ZodArray<z.ZodObject<{
2276
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
2277
+ use: z.ZodEnum<{
2278
+ write: "write";
2279
+ read: "read";
2280
+ }>;
2281
+ }, z.core.$strip>>>;
2218
2282
  }, z.core.$strip>>>;
2219
2283
  responsible: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2220
2284
  userId: z.ZodTemplateLiteral<`user_${string}`>;
@@ -2226,7 +2290,7 @@ export declare const OperatorRun: z.ZodObject<{
2226
2290
  runId: z.ZodTemplateLiteral<`run_${string}`>;
2227
2291
  }, z.core.$strip>;
2228
2292
  export type OperatorRun = z.infer<typeof OperatorRun>;
2229
- export declare const OperatorRunListInput: z.ZodObject<{
2293
+ export declare const RunListInput: z.ZodObject<{
2230
2294
  machineId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
2231
2295
  ownerId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
2232
2296
  personal: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
@@ -2257,17 +2321,18 @@ export declare const OperatorRunListInput: z.ZodObject<{
2257
2321
  stopped: "stopped";
2258
2322
  }>>;
2259
2323
  open: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
2324
+ processId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
2260
2325
  from: z.ZodOptional<z.ZodISODateTime>;
2261
2326
  to: z.ZodOptional<z.ZodISODateTime>;
2262
2327
  search: z.ZodOptional<z.ZodString>;
2263
2328
  cursor: z.ZodOptional<z.ZodTemplateLiteral<`run_${string}`>>;
2264
2329
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
2265
2330
  }, z.core.$strict>;
2266
- export type OperatorRunListInput = z.infer<typeof OperatorRunListInput>;
2267
- export declare const OperatorRunGetInput: z.ZodObject<{
2331
+ export type RunListInput = z.infer<typeof RunListInput>;
2332
+ export declare const RunGetInput: z.ZodObject<{
2268
2333
  runId: z.ZodTemplateLiteral<`run_${string}`>;
2269
2334
  }, z.core.$strict>;
2270
- export type OperatorRunGetInput = z.infer<typeof OperatorRunGetInput>;
2335
+ export type RunGetInput = z.infer<typeof RunGetInput>;
2271
2336
  export declare const RunCancelInput: z.ZodObject<{
2272
2337
  runId: z.ZodTemplateLiteral<`run_${string}`>;
2273
2338
  }, z.core.$strict>;
@@ -2386,6 +2451,15 @@ export declare const RunCompleteAnswer: z.ZodObject<{
2386
2451
  text: z.ZodLiteral<"nothing">;
2387
2452
  }, z.core.$strip>], "text">>;
2388
2453
  reported: z.ZodBoolean;
2454
+ processId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>>;
2455
+ actionId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`action_${string}`>>>;
2456
+ outside: z.ZodOptional<z.ZodArray<z.ZodObject<{
2457
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
2458
+ use: z.ZodEnum<{
2459
+ write: "write";
2460
+ read: "read";
2461
+ }>;
2462
+ }, z.core.$strip>>>;
2389
2463
  }, z.core.$strip>>;
2390
2464
  open: z.ZodInt;
2391
2465
  }, z.core.$strip>;
@@ -2762,6 +2836,15 @@ export declare const OperatorRunList: z.ZodObject<{
2762
2836
  text: z.ZodLiteral<"nothing">;
2763
2837
  }, z.core.$strip>], "text">>;
2764
2838
  reported: z.ZodBoolean;
2839
+ processId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`node_${string}`>>>;
2840
+ actionId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`action_${string}`>>>;
2841
+ outside: z.ZodOptional<z.ZodArray<z.ZodObject<{
2842
+ nodeId: z.ZodTemplateLiteral<`node_${string}`>;
2843
+ use: z.ZodEnum<{
2844
+ write: "write";
2845
+ read: "read";
2846
+ }>;
2847
+ }, z.core.$strip>>>;
2765
2848
  }, z.core.$strip>>>;
2766
2849
  responsible: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2767
2850
  userId: z.ZodTemplateLiteral<`user_${string}`>;
@@ -651,6 +651,7 @@ export const PauseReason = z.enum([
651
651
  ]);
652
652
  export const MachineListInput = z.strictObject({
653
653
  personal: Flag.optional().describe("true: the personal Operators (E143), your own, or every person's for an admin in admin mode. Leaving it out lists the company's Operators; without admin rights you read your own personal ones only, whatever you send."),
654
+ archived: Flag.optional().describe("true: only the archived (deleted) Operators of the same list, to restore them with operator_machine_restore or delete them for good in the browser (E293)."),
654
655
  cursor: MachineId.optional(),
655
656
  limit: Limit.optional(),
656
657
  });
@@ -711,6 +712,33 @@ export const OperatorMachineArchiveInput = z.strictObject({ machineId: MachineId
711
712
  // Bringing a deleted Operator back: its machine comes back under Nutzer, a personal one's section
712
713
  // back into `Eigene › .INSTRUCTIONS` (E143).
713
714
  export const OperatorMachineRestoreInput = z.strictObject({ machineId: MachineId });
715
+ // Deleting an archived Operator for good (#1275, E293): only from the archive, only a person in the
716
+ // browser (D124). The question before it reads what refuses it and what stays without it.
717
+ export const OperatorMachinePurgeInput = z.strictObject({ machineId: MachineId });
718
+ export const OperatorMachinePurged = z.object({
719
+ machineId: MachineId,
720
+ name: z.string(),
721
+ // Its runs, deleted with it.
722
+ runs: z.number().int(),
723
+ });
724
+ // What refuses the purge (something breaks at runtime) and what it lets break (mentions, named
725
+ // before the button, rule destructive).
726
+ export const OperatorMachineHoldings = z.object({
727
+ // Refusing: a run that goes on, live nodes it answers for (goals that report to it included),
728
+ // goals whose rhythm wakes it, and a personal one's runs that count for its person's limit this
729
+ // month.
730
+ running: z.number().int(),
731
+ responsible: z.number().int(),
732
+ goals: z.number().int(),
733
+ month: z.number().int(),
734
+ // Breaking: tasks assigned to it, grants, its chat messages, the KI-Chats held with it, and its
735
+ // runs, which go with it.
736
+ tasks: z.number().int(),
737
+ grants: z.number().int(),
738
+ messages: z.number().int(),
739
+ conversations: z.number().int(),
740
+ runs: z.number().int(),
741
+ });
714
742
  export const Operator = z.object({
715
743
  machineId: MachineId,
716
744
  // The machine's name in `access`, read now.
@@ -841,6 +869,17 @@ export const OperatorUserList = z.object({
841
869
  items: z.array(OperatorUser),
842
870
  nextCursor: UserId.nullable(),
843
871
  });
872
+ // An archived person's own secrets in `operator`, revoked by an admin so the person can be deleted
873
+ // for good (E292, #1272): their own Claude subscription token and every own MCP, in one step. The
874
+ // answer counts what fell, never a name, an address or a value (E144).
875
+ export const UserRevokeInput = z.strictObject({
876
+ userId: UserId.describe("The archived person, `user_…`; a person who is not archived is refused."),
877
+ });
878
+ export const UserRevoked = z.object({
879
+ userId: UserId,
880
+ credentials: z.number().int(),
881
+ mcps: z.number().int(),
882
+ });
844
883
  // ---------------------------------------------------------------------------------------------
845
884
  // The runs of an Operator (#337, Einstellungen › Operator › Protokoll und Nutzung, E75, E81, E82).
846
885
  // A run's id is `run_…` like a run of `intelligence`: both are the resource `run`, in two databases.
@@ -975,7 +1014,8 @@ export const ClosureFound = z.discriminatedUnion("text", [
975
1014
  published: z.boolean(),
976
1015
  problems: z.int().min(0),
977
1016
  }),
978
- // The gadget's level does not allow the outcome.
1017
+ // The gadget's level did not allow the outcome. Not found any more since #1237 (E276); it stays
1018
+ // for closures stored before.
979
1019
  z.object({ text: z.literal("level"), level: z.enum(["report", "draft", "publish"]) }),
980
1020
  // The goal run as it stands.
981
1021
  z.object({ text: z.literal("goalRun"), status: z.string(), followUp: z.boolean() }),
@@ -984,6 +1024,10 @@ export const ClosureFound = z.discriminatedUnion("text", [
984
1024
  // Nothing in the data carries it: no line, no change since the start.
985
1025
  z.object({ text: z.literal("nothing") }),
986
1026
  ]);
1027
+ // How a run used a node (#1261, E288), booked at the `/mcp` door from the right on the tool: `list`
1028
+ // and `get` read, every other action writes.
1029
+ export const RunNodeUse = z.enum(["read", "write"]);
1030
+ export const RunNode = z.object({ nodeId: NodeId, use: RunNodeUse });
987
1031
  // One thing of the closure: what it is, why the run was woken for it, what the Operator reported
988
1032
  // and what Colab found. `outcome` null while nothing is reported yet; `ok` whether the data carry
989
1033
  // it. A run's last word: `open` where nothing holds after the one question.
@@ -1000,6 +1044,14 @@ export const ClosureLine = z.object({
1000
1044
  found: ClosureFound.nullable(),
1001
1045
  // Whether the Operator reported it itself (false where the data alone decided).
1002
1046
  reported: z.boolean(),
1047
+ // The process and the action whose role the row carried at the run's start (#1260, E286); absent
1048
+ // or null where it carried none.
1049
+ processId: NodeId.nullable().optional(),
1050
+ actionId: idSchema("action").nullable().optional(),
1051
+ // "Außerdem angefasst" (#1261, E288): the nodes the run read or wrote outside the micros of the
1052
+ // actions it worked on. Only `operator_run_get` names it, only on a line with a process; never
1053
+ // stored in the closure.
1054
+ outside: z.array(RunNode).optional(),
1003
1055
  });
1004
1056
  export const OperatorRun = z.object({
1005
1057
  runId: OperatorRunId,
@@ -1061,7 +1113,8 @@ export const OperatorRun = z.object({
1061
1113
  responsible: z.object({ userId: UserId, name: z.string() }).nullable().optional(),
1062
1114
  });
1063
1115
  const RunMoment = z.iso.datetime({ offset: true });
1064
- export const OperatorRunListInput = z.strictObject({
1116
+ // The plain name since the runs of process boards and their tools went (#1266).
1117
+ export const RunListInput = z.strictObject({
1065
1118
  machineId: MachineId.optional().describe("Only this Operator's runs, `user_…`. An Operator without admin rights reads its own runs only, whatever it names here."),
1066
1119
  ownerId: UserId.optional().describe("Only the runs of this person's personal Operators, deleted ones included, `user_…`."),
1067
1120
  personal: Flag.optional().describe("true: only the runs of personal Operators; false: only those of the company's Operators."),
@@ -1069,6 +1122,7 @@ export const OperatorRunListInput = z.strictObject({
1069
1122
  vendor: OperatorVendor.optional().describe("Only the runs of the Operators whose model is this vendor's (E230): claude, gpt, deepseek and so on."),
1070
1123
  status: OperatorRunStatus.optional().describe("Only runs in this status."),
1071
1124
  open: Flag.optional().describe("true: only runs whose closure left something open (offen geblieben); false: only the others."),
1125
+ processId: NodeId.optional().describe("Only the runs that worked on an action of this process (the id of its folder, `node_…`)."),
1072
1126
  from: RunMoment.optional().describe("Runs started at or after this moment, ISO."),
1073
1127
  to: RunMoment.optional().describe("Runs started before this moment, ISO."),
1074
1128
  search: z
@@ -1081,7 +1135,7 @@ export const OperatorRunListInput = z.strictObject({
1081
1135
  cursor: OperatorRunId.optional().describe("The nextCursor of the previous page, for the runs after it; newest first."),
1082
1136
  limit: Limit.optional().describe("Runs per page, 1 to 100. Leaving it out gives 20 over MCP and 50 over the API."),
1083
1137
  });
1084
- export const OperatorRunGetInput = z.strictObject({ runId: OperatorRunId });
1138
+ export const RunGetInput = z.strictObject({ runId: OperatorRunId });
1085
1139
  // Stopping a run by hand (E112): its container ends, the run ends `stopped`.
1086
1140
  export const RunCancelInput = z.strictObject({ runId: OperatorRunId });
1087
1141
  // Marks the technical abort of a run read (E141, #825), like a chat: its row leaves the Actions.