@anchrd/colab-sdk 0.1.16 → 0.1.18

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 (38) hide show
  1. package/dist/actions/actions.d.ts +151 -2
  2. package/dist/actions/actions.js +50 -6
  3. package/dist/boards/boards.d.ts +253 -9
  4. package/dist/boards/boards.js +63 -12
  5. package/dist/card-kinds/card-kinds.d.ts +5 -5
  6. package/dist/documents/documents.d.ts +59 -2
  7. package/dist/documents/documents.js +18 -4
  8. package/dist/error/error.d.ts +58 -4
  9. package/dist/error/error.js +146 -3
  10. package/dist/events/events.d.ts +15 -0
  11. package/dist/events/events.js +10 -0
  12. package/dist/excerpt/excerpt.d.ts +16 -0
  13. package/dist/excerpt/excerpt.js +33 -0
  14. package/dist/files/files.d.ts +6 -0
  15. package/dist/files/files.js +5 -1
  16. package/dist/grammar/grammar.d.ts +6 -0
  17. package/dist/grammar/grammar.js +54 -0
  18. package/dist/instructions/instructions.d.ts +36 -0
  19. package/dist/instructions/instructions.js +29 -0
  20. package/dist/missing/missing.d.ts +56 -0
  21. package/dist/missing/missing.js +66 -0
  22. package/dist/nodes/nodes.d.ts +21 -5
  23. package/dist/nodes/nodes.js +10 -7
  24. package/dist/operators/operators.d.ts +13 -3
  25. package/dist/operators/operators.js +19 -4
  26. package/dist/primitives/primitives.js +1 -1
  27. package/dist/runs/runs.d.ts +1 -1
  28. package/dist/sdk.d.ts +13 -10
  29. package/dist/sdk.js +13 -10
  30. package/dist/sso/sso.js +3 -2
  31. package/dist/tables/tables.d.ts +32 -0
  32. package/dist/tables/tables.js +12 -1
  33. package/dist/tool.d.ts +5 -3
  34. package/dist/versions/versions.d.ts +102 -0
  35. package/dist/versions/versions.js +14 -0
  36. package/dist/written/written.d.ts +206 -0
  37. package/dist/written/written.js +90 -0
  38. package/package.json +1 -1
@@ -9,6 +9,7 @@ export declare const ActionListInput: z.ZodObject<{
9
9
  userId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
10
10
  cursor: z.ZodOptional<z.ZodString>;
11
11
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
12
+ known: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
12
13
  }, z.core.$strict>;
13
14
  export type ActionListInput = z.infer<typeof ActionListInput>;
14
15
  export declare const ActionSection: z.ZodEnum<{
@@ -44,6 +45,8 @@ export declare const ActionTask: z.ZodObject<{
44
45
  }>;
45
46
  }, z.core.$strip>>;
46
47
  handedOver: z.ZodBoolean;
48
+ rev: z.ZodNumber;
49
+ startsToday: z.ZodOptional<z.ZodLiteral<true>>;
47
50
  }, z.core.$strip>;
48
51
  export type ActionTask = z.infer<typeof ActionTask>;
49
52
  export declare const ActionChat: z.ZodObject<{
@@ -82,6 +85,30 @@ export declare const ActionProcess: z.ZodObject<{
82
85
  dueAt: z.ZodISODateTime;
83
86
  }, z.core.$strip>;
84
87
  export type ActionProcess = z.infer<typeof ActionProcess>;
88
+ export declare const ActionRunHint: z.ZodEnum<{
89
+ started: "started";
90
+ stalled: "stalled";
91
+ }>;
92
+ export type ActionRunHint = z.infer<typeof ActionRunHint>;
93
+ export declare const ActionRunTask: z.ZodObject<{
94
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
95
+ title: z.ZodString;
96
+ column: z.ZodObject<{
97
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
98
+ name: z.ZodString;
99
+ type: z.ZodEnum<{
100
+ backlog: "backlog";
101
+ open: "open";
102
+ progress: "progress";
103
+ done: "done";
104
+ discarded: "discarded";
105
+ blocked: "blocked";
106
+ archive: "archive";
107
+ }>;
108
+ }, z.core.$strip>;
109
+ rev: z.ZodNumber;
110
+ }, z.core.$strip>;
111
+ export type ActionRunTask = z.infer<typeof ActionRunTask>;
85
112
  export declare const ActionRun: z.ZodObject<{
86
113
  runId: z.ZodTemplateLiteral<`run_${string}`>;
87
114
  status: z.ZodEnum<{
@@ -90,6 +117,28 @@ export declare const ActionRun: z.ZodObject<{
90
117
  done: "done";
91
118
  running: "running";
92
119
  }>;
120
+ tasks: z.ZodArray<z.ZodObject<{
121
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
122
+ title: z.ZodString;
123
+ column: z.ZodObject<{
124
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
125
+ name: z.ZodString;
126
+ type: z.ZodEnum<{
127
+ backlog: "backlog";
128
+ open: "open";
129
+ progress: "progress";
130
+ done: "done";
131
+ discarded: "discarded";
132
+ blocked: "blocked";
133
+ archive: "archive";
134
+ }>;
135
+ }, z.core.$strip>;
136
+ rev: z.ZodNumber;
137
+ }, z.core.$strip>>;
138
+ hint: z.ZodOptional<z.ZodEnum<{
139
+ started: "started";
140
+ stalled: "stalled";
141
+ }>>;
93
142
  }, z.core.$strip>;
94
143
  export type ActionRun = z.infer<typeof ActionRun>;
95
144
  export declare const ActionGadget: z.ZodObject<{
@@ -108,6 +157,10 @@ export declare const ActionGadget: z.ZodObject<{
108
157
  hint: z.ZodBoolean;
109
158
  }, z.core.$strip>;
110
159
  export type ActionGadget = z.infer<typeof ActionGadget>;
160
+ export declare const ActionValidation: z.ZodObject<{
161
+ newTickets: z.ZodNumber;
162
+ }, z.core.$strip>;
163
+ export type ActionValidation = z.infer<typeof ActionValidation>;
111
164
  export declare const ActionItem: z.ZodObject<{
112
165
  node: z.ZodObject<{
113
166
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
@@ -180,6 +233,8 @@ export declare const ActionItem: z.ZodObject<{
180
233
  }>;
181
234
  }, z.core.$strip>>;
182
235
  handedOver: z.ZodBoolean;
236
+ rev: z.ZodNumber;
237
+ startsToday: z.ZodOptional<z.ZodLiteral<true>>;
183
238
  }, z.core.$strip>>;
184
239
  chat: z.ZodNullable<z.ZodObject<{
185
240
  unreadCount: z.ZodNumber;
@@ -223,6 +278,28 @@ export declare const ActionItem: z.ZodObject<{
223
278
  done: "done";
224
279
  running: "running";
225
280
  }>;
281
+ tasks: z.ZodArray<z.ZodObject<{
282
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
283
+ title: z.ZodString;
284
+ column: z.ZodObject<{
285
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
286
+ name: z.ZodString;
287
+ type: z.ZodEnum<{
288
+ backlog: "backlog";
289
+ open: "open";
290
+ progress: "progress";
291
+ done: "done";
292
+ discarded: "discarded";
293
+ blocked: "blocked";
294
+ archive: "archive";
295
+ }>;
296
+ }, z.core.$strip>;
297
+ rev: z.ZodNumber;
298
+ }, z.core.$strip>>;
299
+ hint: z.ZodOptional<z.ZodEnum<{
300
+ started: "started";
301
+ stalled: "stalled";
302
+ }>>;
226
303
  }, z.core.$strip>>;
227
304
  gadget: z.ZodNullable<z.ZodObject<{
228
305
  problem: z.ZodEnum<{
@@ -239,6 +316,9 @@ export declare const ActionItem: z.ZodObject<{
239
316
  }>;
240
317
  hint: z.ZodBoolean;
241
318
  }, z.core.$strip>>;
319
+ validation: z.ZodOptional<z.ZodObject<{
320
+ newTickets: z.ZodNumber;
321
+ }, z.core.$strip>>;
242
322
  }, z.core.$strip>;
243
323
  export type ActionItem = z.infer<typeof ActionItem>;
244
324
  export declare const ActionNoticeKind: z.ZodEnum<{
@@ -513,6 +593,8 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
513
593
  }>;
514
594
  }, z.core.$strip>>;
515
595
  handedOver: z.ZodBoolean;
596
+ rev: z.ZodNumber;
597
+ startsToday: z.ZodOptional<z.ZodLiteral<true>>;
516
598
  }, z.core.$strip>>;
517
599
  chat: z.ZodNullable<z.ZodObject<{
518
600
  unreadCount: z.ZodNumber;
@@ -556,6 +638,28 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
556
638
  done: "done";
557
639
  running: "running";
558
640
  }>;
641
+ tasks: z.ZodArray<z.ZodObject<{
642
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
643
+ title: z.ZodString;
644
+ column: z.ZodObject<{
645
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
646
+ name: z.ZodString;
647
+ type: z.ZodEnum<{
648
+ backlog: "backlog";
649
+ open: "open";
650
+ progress: "progress";
651
+ done: "done";
652
+ discarded: "discarded";
653
+ blocked: "blocked";
654
+ archive: "archive";
655
+ }>;
656
+ }, z.core.$strip>;
657
+ rev: z.ZodNumber;
658
+ }, z.core.$strip>>;
659
+ hint: z.ZodOptional<z.ZodEnum<{
660
+ started: "started";
661
+ stalled: "stalled";
662
+ }>>;
559
663
  }, z.core.$strip>>;
560
664
  gadget: z.ZodNullable<z.ZodObject<{
561
665
  problem: z.ZodEnum<{
@@ -572,6 +676,9 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
572
676
  }>;
573
677
  hint: z.ZodBoolean;
574
678
  }, z.core.$strip>>;
679
+ validation: z.ZodOptional<z.ZodObject<{
680
+ newTickets: z.ZodNumber;
681
+ }, z.core.$strip>>;
575
682
  }, z.core.$strip>, z.ZodObject<{
576
683
  notice: z.ZodObject<{
577
684
  package: z.ZodEnum<{
@@ -654,6 +761,17 @@ export declare const MachineInstructions: z.ZodObject<{
654
761
  version: z.ZodNullable<z.ZodInt>;
655
762
  }, z.core.$strip>;
656
763
  export type MachineInstructions = z.infer<typeof MachineInstructions>;
764
+ export declare const MachineInstructionsRead: z.ZodUnion<readonly [z.ZodObject<{
765
+ path: z.ZodString;
766
+ status: z.ZodNullable<z.ZodString>;
767
+ markdown: z.ZodString;
768
+ version: z.ZodNullable<z.ZodInt>;
769
+ digest: z.ZodString;
770
+ }, z.core.$strip>, z.ZodObject<{
771
+ digest: z.ZodString;
772
+ known: z.ZodLiteral<true>;
773
+ }, z.core.$strip>]>;
774
+ export type MachineInstructionsRead = z.infer<typeof MachineInstructionsRead>;
657
775
  export declare const ActionList: z.ZodObject<{
658
776
  items: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
659
777
  node: z.ZodObject<{
@@ -727,6 +845,8 @@ export declare const ActionList: z.ZodObject<{
727
845
  }>;
728
846
  }, z.core.$strip>>;
729
847
  handedOver: z.ZodBoolean;
848
+ rev: z.ZodNumber;
849
+ startsToday: z.ZodOptional<z.ZodLiteral<true>>;
730
850
  }, z.core.$strip>>;
731
851
  chat: z.ZodNullable<z.ZodObject<{
732
852
  unreadCount: z.ZodNumber;
@@ -770,6 +890,28 @@ export declare const ActionList: z.ZodObject<{
770
890
  done: "done";
771
891
  running: "running";
772
892
  }>;
893
+ tasks: z.ZodArray<z.ZodObject<{
894
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
895
+ title: z.ZodString;
896
+ column: z.ZodObject<{
897
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
898
+ name: z.ZodString;
899
+ type: z.ZodEnum<{
900
+ backlog: "backlog";
901
+ open: "open";
902
+ progress: "progress";
903
+ done: "done";
904
+ discarded: "discarded";
905
+ blocked: "blocked";
906
+ archive: "archive";
907
+ }>;
908
+ }, z.core.$strip>;
909
+ rev: z.ZodNumber;
910
+ }, z.core.$strip>>;
911
+ hint: z.ZodOptional<z.ZodEnum<{
912
+ started: "started";
913
+ stalled: "stalled";
914
+ }>>;
773
915
  }, z.core.$strip>>;
774
916
  gadget: z.ZodNullable<z.ZodObject<{
775
917
  problem: z.ZodEnum<{
@@ -786,6 +928,9 @@ export declare const ActionList: z.ZodObject<{
786
928
  }>;
787
929
  hint: z.ZodBoolean;
788
930
  }, z.core.$strip>>;
931
+ validation: z.ZodOptional<z.ZodObject<{
932
+ newTickets: z.ZodNumber;
933
+ }, z.core.$strip>>;
789
934
  }, z.core.$strip>, z.ZodObject<{
790
935
  notice: z.ZodObject<{
791
936
  package: z.ZodEnum<{
@@ -861,11 +1006,15 @@ export declare const ActionList: z.ZodObject<{
861
1006
  }, z.core.$strip>]>>;
862
1007
  nextCursor: z.ZodNullable<z.ZodString>;
863
1008
  count: z.ZodNumber;
864
- instructions: z.ZodOptional<z.ZodObject<{
1009
+ instructions: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
865
1010
  path: z.ZodString;
866
1011
  status: z.ZodNullable<z.ZodString>;
867
1012
  markdown: z.ZodString;
868
1013
  version: z.ZodNullable<z.ZodInt>;
869
- }, z.core.$strip>>;
1014
+ digest: z.ZodString;
1015
+ }, z.core.$strip>, z.ZodObject<{
1016
+ digest: z.ZodString;
1017
+ known: z.ZodLiteral<true>;
1018
+ }, z.core.$strip>]>>;
870
1019
  }, z.core.$strip>;
871
1020
  export type ActionList = z.infer<typeof ActionList>;
@@ -3,7 +3,7 @@ import { ColumnType, TaskColumn } from "../columns/columns.js";
3
3
  import { CallId } from "../connectors/connectors.js";
4
4
  import { GadgetLevel } from "../gadgets/gadgets.js";
5
5
  import { packages } from "../grammar/grammar.js";
6
- import { InstructionsLink } from "../instructions/instructions.js";
6
+ import { Digest, InstructionsLink, Known, KnownText } from "../instructions/instructions.js";
7
7
  import { Limit as PageSize } from "../list-input.js";
8
8
  import { MessageAuthor, MessageId } from "../messages/messages.js";
9
9
  import { BoardShownKind, NodeId, NodeKind, NodePath } from "../nodes/nodes.js";
@@ -18,7 +18,7 @@ export const ActionListInput = z.strictObject({
18
18
  filter: z
19
19
  .enum(actionFilters)
20
20
  .optional()
21
- .describe("Which rows: all, tasks (tasks, due processes, open runs and broken gadgets you answer for) or chats (rows with something unread, a task's chat included). Notices of other parts of Colab come only with all. Leaving it out gives all. count always counts all."),
21
+ .describe("Which rows: all, tasks (tasks, due processes, open runs, the validation's tickets in New for the holder of validator, and broken gadgets you answer for) or chats (rows with something unread, a task's chat included). Notices of other parts of Colab come only with all. Leaving it out gives all. count always counts all."),
22
22
  userId: UserId.optional().describe("Whose Actions to read, `user_…`. Only an admin in admin mode reads another person's, to see where they are stuck; anyone else gets not_found. Leaving it out reads your own."),
23
23
  cursor: z
24
24
  .string()
@@ -26,6 +26,7 @@ export const ActionListInput = z.strictObject({
26
26
  .optional()
27
27
  .describe("The nextCursor of the previous page, unchanged, for the rows after it. Leaving it out starts with the newest."),
28
28
  limit: PageSize.optional().describe("How many rows one page holds, 1 to 100. Leaving it out gives 50."),
29
+ known: Known.optional(),
29
30
  });
30
31
  // The two sections of the page: waiting (open tasks, chats, a due process) and in progress (tasks
31
32
  // in progress, an open run).
@@ -38,6 +39,11 @@ export const ActionTask = z.object({
38
39
  buttons: z.array(TaskColumn),
39
40
  // A machine moved it into its column last: "handed over by the Operator".
40
41
  handedOver: z.boolean(),
42
+ // The task's rev (E70, #671): intelligence_task_update takes it without reading the task first.
43
+ rev: z.number().int(),
44
+ // Its start date was reached within the last 24 hours (E124): the row says "starts today", and
45
+ // `since` is that moment when it came later than the task into its column. Absent otherwise.
46
+ startsToday: z.literal(true).optional(),
41
47
  });
42
48
  export const ActionChat = z.object({
43
49
  // The messages of others not read yet, by the person themselves (not their AI).
@@ -56,9 +62,27 @@ export const ActionProcess = z.object({
56
62
  // The moment of the schedule the next run stands for.
57
63
  dueAt: z.iso.datetime(),
58
64
  });
65
+ // A hint to the responsible of a process (E124, E125): `started`, a run began and waits on them to
66
+ // move its first tasks into Open; `stalled`, no task of the run is in Open or In progress though not
67
+ // all are closed, and they move the next one on. Gone as soon as a task of the run is open again.
68
+ export const ActionRunHint = z.enum(["started", "stalled"]);
69
+ // A card of a process run that is the reader's own (#671): what the run waits on from them, with the
70
+ // rev its next save sends, so an Operator writes it without reading the run first.
71
+ export const ActionRunTask = z.object({
72
+ taskId: NodeId,
73
+ title: z.string(),
74
+ column: TaskColumn,
75
+ rev: z.number().int(),
76
+ });
59
77
  export const ActionRun = z.object({
60
78
  runId: RunId,
61
79
  status: RunStatus,
80
+ // The cards of this run assigned to the reader, in every column, in the order of the run's columns
81
+ // and their position; never another's. Empty without one, and always for the validation, whose run
82
+ // copies no cards.
83
+ tasks: z.array(ActionRunTask),
84
+ // Only for the responsible of the run's process, while the run waits on them (E124, E125).
85
+ hint: ActionRunHint.optional(),
62
86
  });
63
87
  // A gadget whose live version broke (#643, Nodes › Gadget › Einstellungen): every new error and every
64
88
  // red test waits on its responsible; without one, on its publisher as a hint to name one. Open until
@@ -75,8 +99,17 @@ export const ActionGadget = z.object({
75
99
  // Nobody is responsible: the row reaches the publisher only to name one.
76
100
  hint: z.boolean(),
77
101
  });
102
+ // The tickets of the validation that wait on the holder of `validator` (E132): its latest run found
103
+ // tickets in New, and they still lie there, so the holder goes on until they are checked. On the
104
+ // validation board's row, beside its open run or its due moment, or alone.
105
+ export const ActionValidation = z.object({
106
+ // How many tickets lie in New now (a column of type backlog of the validation board), those that
107
+ // came after the run started included.
108
+ newTickets: z.number().int().positive(),
109
+ });
78
110
  // One row: the node, where it waits, since when, and what makes it wait. Exactly one of task,
79
111
  // process, run and gadget, or none of them on a row that is a chat alone; chat beside any of them.
112
+ // `validation` stands on the validation board's row only, beside process or run or alone.
80
113
  export const ActionItem = z.object({
81
114
  node: z.object({
82
115
  nodeId: NodeId,
@@ -92,14 +125,19 @@ export const ActionItem = z.object({
92
125
  boardKind: BoardShownKind.nullable(),
93
126
  }),
94
127
  section: ActionSection,
95
- // Since when it waits: a task since it came into its column, a chat since its first unread
96
- // message, a due process since its moment, an open run since it started.
128
+ // Since when it waits: a task since it came into its column (or its start date was reached), a
129
+ // chat since its first unread message, a due process since its moment, an open run since it
130
+ // started, a run that stands since its last task left Open or In progress, the tickets left in
131
+ // New since the run that found them ended.
97
132
  since: z.iso.datetime(),
98
133
  task: ActionTask.nullable(),
99
134
  chat: ActionChat.nullable(),
100
135
  process: ActionProcess.nullable(),
101
136
  run: ActionRun.nullable(),
102
137
  gadget: ActionGadget.nullable(),
138
+ // Absent on every row but the validation board's of the holder of `validator`, and there too
139
+ // once no ticket its latest run found lies in New any more.
140
+ validation: ActionValidation.optional(),
103
141
  });
104
142
  // What another package puts into a person's Actions (#334, E81, E82): "access invalid" for every
105
143
  // admin, "Operator paused" for its responsible person. Gathered when asked like every row, never
@@ -184,6 +222,12 @@ export function isNodeRow(row) {
184
222
  export const MachineInstructions = InstructionsLink.extend({
185
223
  version: z.int().min(1).nullable(),
186
224
  });
225
+ // As `intelligence_action_list` answers them (E123, #677): whole with the digest of all four fields,
226
+ // or only the reference when the machine sent that digest under `known`.
227
+ export const MachineInstructionsRead = z.union([
228
+ MachineInstructions.extend({ digest: Digest }),
229
+ KnownText,
230
+ ]);
187
231
  export const ActionList = z.object({
188
232
  // Newest first by since, then by node id (a notice by package and noticeKey). The filters tasks
189
233
  // and chats leave the notices out.
@@ -193,6 +237,6 @@ export const ActionList = z.object({
193
237
  count: z.number().int(),
194
238
  // Only for a machine reading its own Actions over MCP, never over REST: the INSTRUCTIONS of its
195
239
  // root folder as one link of #39's chain with its version, empty when there is none (traps P033,
196
- // P034).
197
- instructions: MachineInstructions.optional(),
240
+ // P034); only the reference when it sent their digest under `known` (E123).
241
+ instructions: MachineInstructionsRead.optional(),
198
242
  });