@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
@@ -29,6 +29,50 @@ export declare const BoardCreateInput: z.ZodObject<{
29
29
  visible: z.ZodOptional<z.ZodBoolean>;
30
30
  description: z.ZodOptional<z.ZodString>;
31
31
  }, z.core.$strict>>>;
32
+ cardKinds: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
+ kindId: z.ZodOptional<z.ZodTemplateLiteral<`kind_${string}`>>;
34
+ name: z.ZodString;
35
+ icon: z.ZodOptional<z.ZodEnum<{
36
+ message: "message";
37
+ user: "user";
38
+ package: "package";
39
+ target: "target";
40
+ search: "search";
41
+ flag: "flag";
42
+ route: "route";
43
+ "arrow-right": "arrow-right";
44
+ "square-check": "square-check";
45
+ "file-text": "file-text";
46
+ bulb: "bulb";
47
+ calendar: "calendar";
48
+ star: "star";
49
+ bolt: "bolt";
50
+ bug: "bug";
51
+ rocket: "rocket";
52
+ }>>;
53
+ description: z.ZodOptional<z.ZodString>;
54
+ standard: z.ZodOptional<z.ZodBoolean>;
55
+ fields: z.ZodArray<z.ZodObject<{
56
+ fieldId: z.ZodOptional<z.ZodTemplateLiteral<`field_${string}`>>;
57
+ name: z.ZodString;
58
+ type: z.ZodEnum<{
59
+ number: "number";
60
+ date: "date";
61
+ list: "list";
62
+ link: "link";
63
+ text: "text";
64
+ checklist: "checklist";
65
+ select: "select";
66
+ }>;
67
+ description: z.ZodOptional<z.ZodString>;
68
+ required: z.ZodOptional<z.ZodBoolean>;
69
+ visible: z.ZodOptional<z.ZodBoolean>;
70
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
+ optionId: z.ZodOptional<z.ZodTemplateLiteral<`option_${string}`>>;
72
+ name: z.ZodString;
73
+ }, z.core.$strict>>>;
74
+ }, z.core.$strict>>;
75
+ }, z.core.$strict>>>;
32
76
  idempotencyKey: z.ZodString;
33
77
  }, z.core.$strict>;
34
78
  export type BoardCreateInput = z.infer<typeof BoardCreateInput>;
@@ -43,6 +87,7 @@ export declare const BoardUpdateInput: z.ZodObject<{
43
87
  board: "board";
44
88
  process: "process";
45
89
  }>>;
90
+ responsibleId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>>;
46
91
  schedule: z.ZodOptional<z.ZodObject<{
47
92
  rhythm: z.ZodEnum<{
48
93
  manual: "manual";
@@ -92,6 +137,7 @@ export declare const BoardUpdateInput: z.ZodObject<{
92
137
  message: "message";
93
138
  user: "user";
94
139
  package: "package";
140
+ target: "target";
95
141
  search: "search";
96
142
  flag: "flag";
97
143
  route: "route";
@@ -99,7 +145,6 @@ export declare const BoardUpdateInput: z.ZodObject<{
99
145
  "square-check": "square-check";
100
146
  "file-text": "file-text";
101
147
  bulb: "bulb";
102
- target: "target";
103
148
  calendar: "calendar";
104
149
  star: "star";
105
150
  bolt: "bolt";
@@ -164,8 +209,49 @@ export declare const ProcessCheck: z.ZodObject<{
164
209
  userId: z.ZodString;
165
210
  name: z.ZodString;
166
211
  }, z.core.$strip>>;
212
+ responsibleWrites: z.ZodBoolean;
213
+ missing: z.ZodArray<z.ZodObject<{
214
+ code: z.ZodEnum<{
215
+ test_failed: "test_failed";
216
+ no_role: "no_role";
217
+ no_folder: "no_folder";
218
+ credential_invalid: "credential_invalid";
219
+ incomplete: "incomplete";
220
+ no_right: "no_right";
221
+ no_kind: "no_kind";
222
+ no_assignee: "no_assignee";
223
+ no_machine: "no_machine";
224
+ }>;
225
+ machineId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
226
+ credentialId: z.ZodOptional<z.ZodTemplateLiteral<`credential_${string}`>>;
227
+ connectorId: z.ZodOptional<z.ZodString>;
228
+ connectionId: z.ZodOptional<z.ZodTemplateLiteral<`connection_${string}`>>;
229
+ taskId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
230
+ documentId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
231
+ userId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
232
+ nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
233
+ message: z.ZodString;
234
+ right: z.ZodOptional<z.ZodString>;
235
+ givenBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ userId: z.ZodString;
237
+ name: z.ZodString;
238
+ }, z.core.$strip>>>;
239
+ call: z.ZodOptional<z.ZodObject<{
240
+ tool: z.ZodString;
241
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
242
+ }, z.core.$strip>>;
243
+ }, z.core.$strip>>;
167
244
  }, z.core.$strip>;
168
245
  export type ProcessCheck = z.infer<typeof ProcessCheck>;
246
+ export declare const TemplateNote: z.ZodObject<{
247
+ message: z.ZodString;
248
+ runs: z.ZodArray<z.ZodObject<{
249
+ runId: z.ZodTemplateLiteral<`run_${string}`>;
250
+ startedAt: z.ZodISODateTime;
251
+ dueAt: z.ZodNullable<z.ZodISODateTime>;
252
+ }, z.core.$strip>>;
253
+ }, z.core.$strip>;
254
+ export type TemplateNote = z.infer<typeof TemplateNote>;
169
255
  export declare const BoardDetail: z.ZodObject<{
170
256
  boardId: z.ZodTemplateLiteral<`node_${string}`>;
171
257
  name: z.ZodString;
@@ -214,6 +300,38 @@ export declare const BoardDetail: z.ZodObject<{
214
300
  userId: z.ZodString;
215
301
  name: z.ZodString;
216
302
  }, z.core.$strip>>;
303
+ responsibleWrites: z.ZodBoolean;
304
+ missing: z.ZodArray<z.ZodObject<{
305
+ code: z.ZodEnum<{
306
+ test_failed: "test_failed";
307
+ no_role: "no_role";
308
+ no_folder: "no_folder";
309
+ credential_invalid: "credential_invalid";
310
+ incomplete: "incomplete";
311
+ no_right: "no_right";
312
+ no_kind: "no_kind";
313
+ no_assignee: "no_assignee";
314
+ no_machine: "no_machine";
315
+ }>;
316
+ machineId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
317
+ credentialId: z.ZodOptional<z.ZodTemplateLiteral<`credential_${string}`>>;
318
+ connectorId: z.ZodOptional<z.ZodString>;
319
+ connectionId: z.ZodOptional<z.ZodTemplateLiteral<`connection_${string}`>>;
320
+ taskId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
321
+ documentId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
322
+ userId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
323
+ nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
324
+ message: z.ZodString;
325
+ right: z.ZodOptional<z.ZodString>;
326
+ givenBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
327
+ userId: z.ZodString;
328
+ name: z.ZodString;
329
+ }, z.core.$strip>>>;
330
+ call: z.ZodOptional<z.ZodObject<{
331
+ tool: z.ZodString;
332
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
333
+ }, z.core.$strip>>;
334
+ }, z.core.$strip>>;
217
335
  }, z.core.$strip>;
218
336
  validator: z.ZodNullable<z.ZodObject<{
219
337
  userId: z.ZodString;
@@ -223,6 +341,14 @@ export declare const BoardDetail: z.ZodObject<{
223
341
  human: "human";
224
342
  }>>;
225
343
  }, z.core.$strip>>;
344
+ responsible: z.ZodNullable<z.ZodObject<{
345
+ userId: z.ZodString;
346
+ name: z.ZodNullable<z.ZodString>;
347
+ kind: z.ZodNullable<z.ZodEnum<{
348
+ machine: "machine";
349
+ human: "human";
350
+ }>>;
351
+ }, z.core.$strip>>;
226
352
  columns: z.ZodArray<z.ZodObject<{
227
353
  columnId: z.ZodTemplateLiteral<`column_${string}`>;
228
354
  name: z.ZodString;
@@ -245,6 +371,7 @@ export declare const BoardDetail: z.ZodObject<{
245
371
  message: "message";
246
372
  user: "user";
247
373
  package: "package";
374
+ target: "target";
248
375
  search: "search";
249
376
  flag: "flag";
250
377
  route: "route";
@@ -252,7 +379,6 @@ export declare const BoardDetail: z.ZodObject<{
252
379
  "square-check": "square-check";
253
380
  "file-text": "file-text";
254
381
  bulb: "bulb";
255
- target: "target";
256
382
  calendar: "calendar";
257
383
  star: "star";
258
384
  bolt: "bolt";
@@ -291,8 +417,17 @@ export declare const BoardDetail: z.ZodObject<{
291
417
  }, z.core.$strip>;
292
418
  rev: z.ZodNumber;
293
419
  updatedAt: z.ZodISODateTime;
420
+ template: z.ZodOptional<z.ZodObject<{
421
+ message: z.ZodString;
422
+ runs: z.ZodArray<z.ZodObject<{
423
+ runId: z.ZodTemplateLiteral<`run_${string}`>;
424
+ startedAt: z.ZodISODateTime;
425
+ dueAt: z.ZodNullable<z.ZodISODateTime>;
426
+ }, z.core.$strip>>;
427
+ }, z.core.$strip>>;
294
428
  }, z.core.$strip>;
295
429
  export type BoardDetail = z.infer<typeof BoardDetail>;
430
+ export declare const compactTaskLimit = 50;
296
431
  export declare const maxBulkTasks = 100;
297
432
  export declare const BoardTaskListInput: z.ZodObject<{
298
433
  boardId: z.ZodTemplateLiteral<`node_${string}`>;
@@ -314,6 +449,7 @@ export declare const BoardTaskListInput: z.ZodObject<{
314
449
  content: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
315
450
  cursor: z.ZodOptional<z.ZodString>;
316
451
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
452
+ known: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
317
453
  }, z.core.$strict>;
318
454
  export type BoardTaskListInput = z.infer<typeof BoardTaskListInput>;
319
455
  export declare const BoardTaskCreateInput: z.ZodObject<{
@@ -361,6 +497,7 @@ export declare const BoardTaskCreated: z.ZodObject<{
361
497
  export type BoardTaskCreated = z.infer<typeof BoardTaskCreated>;
362
498
  export declare const TaskGetInput: z.ZodObject<{
363
499
  taskId: z.ZodTemplateLiteral<`node_${string}`>;
500
+ known: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>>;
364
501
  }, z.core.$strict>;
365
502
  export type TaskGetInput = z.infer<typeof TaskGetInput>;
366
503
  export declare const TaskUpdateInput: z.ZodObject<{
@@ -470,6 +607,7 @@ export declare const BoardTaskItem: z.ZodObject<{
470
607
  message: "message";
471
608
  user: "user";
472
609
  package: "package";
610
+ target: "target";
473
611
  search: "search";
474
612
  flag: "flag";
475
613
  route: "route";
@@ -477,7 +615,6 @@ export declare const BoardTaskItem: z.ZodObject<{
477
615
  "square-check": "square-check";
478
616
  "file-text": "file-text";
479
617
  bulb: "bulb";
480
- target: "target";
481
618
  calendar: "calendar";
482
619
  star: "star";
483
620
  bolt: "bolt";
@@ -570,6 +707,7 @@ export declare const BoardTaskList: z.ZodObject<{
570
707
  message: "message";
571
708
  user: "user";
572
709
  package: "package";
710
+ target: "target";
573
711
  search: "search";
574
712
  flag: "flag";
575
713
  route: "route";
@@ -577,7 +715,6 @@ export declare const BoardTaskList: z.ZodObject<{
577
715
  "square-check": "square-check";
578
716
  "file-text": "file-text";
579
717
  bulb: "bulb";
580
- target: "target";
581
718
  calendar: "calendar";
582
719
  star: "star";
583
720
  bolt: "bolt";
@@ -621,7 +758,13 @@ export declare const BoardTaskList: z.ZodObject<{
621
758
  content: z.ZodOptional<z.ZodString>;
622
759
  }, z.core.$strip>>;
623
760
  nextCursor: z.ZodNullable<z.ZodString>;
624
- instruction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
761
+ instruction: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
762
+ digest: z.ZodString;
763
+ markdown: z.ZodString;
764
+ }, z.core.$strip>, z.ZodObject<{
765
+ digest: z.ZodString;
766
+ known: z.ZodLiteral<true>;
767
+ }, z.core.$strip>]>>>;
625
768
  columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
626
769
  columnId: z.ZodTemplateLiteral<`column_${string}`>;
627
770
  name: z.ZodString;
@@ -637,8 +780,103 @@ export declare const BoardTaskList: z.ZodObject<{
637
780
  visible: z.ZodBoolean;
638
781
  description: z.ZodString;
639
782
  }, z.core.$strip>>>;
783
+ template: z.ZodOptional<z.ZodObject<{
784
+ message: z.ZodString;
785
+ runs: z.ZodArray<z.ZodObject<{
786
+ runId: z.ZodTemplateLiteral<`run_${string}`>;
787
+ startedAt: z.ZodISODateTime;
788
+ dueAt: z.ZodNullable<z.ZodISODateTime>;
789
+ }, z.core.$strip>>;
790
+ }, z.core.$strip>>;
640
791
  }, z.core.$strip>;
641
792
  export type BoardTaskList = z.infer<typeof BoardTaskList>;
793
+ export declare const BoardTaskBrief: z.ZodObject<{
794
+ column: z.ZodObject<{
795
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
796
+ name: z.ZodString;
797
+ type: z.ZodEnum<{
798
+ backlog: "backlog";
799
+ open: "open";
800
+ progress: "progress";
801
+ done: "done";
802
+ discarded: "discarded";
803
+ blocked: "blocked";
804
+ archive: "archive";
805
+ }>;
806
+ }, z.core.$strip>;
807
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
808
+ rev: z.ZodNumber;
809
+ title: z.ZodString;
810
+ assignee: z.ZodObject<{
811
+ userId: z.ZodString;
812
+ name: z.ZodNullable<z.ZodString>;
813
+ kind: z.ZodNullable<z.ZodEnum<{
814
+ machine: "machine";
815
+ human: "human";
816
+ }>>;
817
+ }, z.core.$strip>;
818
+ }, z.core.$strip>;
819
+ export type BoardTaskBrief = z.infer<typeof BoardTaskBrief>;
820
+ export declare const BoardTaskBriefList: z.ZodObject<{
821
+ nextCursor: z.ZodNullable<z.ZodString>;
822
+ instruction: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
823
+ digest: z.ZodString;
824
+ markdown: z.ZodString;
825
+ }, z.core.$strip>, z.ZodObject<{
826
+ digest: z.ZodString;
827
+ known: z.ZodLiteral<true>;
828
+ }, z.core.$strip>]>>>;
829
+ columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
830
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
831
+ name: z.ZodString;
832
+ type: z.ZodEnum<{
833
+ backlog: "backlog";
834
+ open: "open";
835
+ progress: "progress";
836
+ done: "done";
837
+ discarded: "discarded";
838
+ blocked: "blocked";
839
+ archive: "archive";
840
+ }>;
841
+ visible: z.ZodBoolean;
842
+ description: z.ZodString;
843
+ }, z.core.$strip>>>;
844
+ template: z.ZodOptional<z.ZodObject<{
845
+ message: z.ZodString;
846
+ runs: z.ZodArray<z.ZodObject<{
847
+ runId: z.ZodTemplateLiteral<`run_${string}`>;
848
+ startedAt: z.ZodISODateTime;
849
+ dueAt: z.ZodNullable<z.ZodISODateTime>;
850
+ }, z.core.$strip>>;
851
+ }, z.core.$strip>>;
852
+ items: z.ZodArray<z.ZodObject<{
853
+ column: z.ZodObject<{
854
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
855
+ name: z.ZodString;
856
+ type: z.ZodEnum<{
857
+ backlog: "backlog";
858
+ open: "open";
859
+ progress: "progress";
860
+ done: "done";
861
+ discarded: "discarded";
862
+ blocked: "blocked";
863
+ archive: "archive";
864
+ }>;
865
+ }, z.core.$strip>;
866
+ taskId: z.ZodTemplateLiteral<`node_${string}`>;
867
+ rev: z.ZodNumber;
868
+ title: z.ZodString;
869
+ assignee: z.ZodObject<{
870
+ userId: z.ZodString;
871
+ name: z.ZodNullable<z.ZodString>;
872
+ kind: z.ZodNullable<z.ZodEnum<{
873
+ machine: "machine";
874
+ human: "human";
875
+ }>>;
876
+ }, z.core.$strip>;
877
+ }, z.core.$strip>>;
878
+ }, z.core.$strip>;
879
+ export type BoardTaskBriefList = z.infer<typeof BoardTaskBriefList>;
642
880
  export declare const TaskDetail: z.ZodObject<{
643
881
  taskId: z.ZodTemplateLiteral<`node_${string}`>;
644
882
  boardId: z.ZodTemplateLiteral<`node_${string}`>;
@@ -722,6 +960,7 @@ export declare const TaskDetail: z.ZodObject<{
722
960
  message: "message";
723
961
  user: "user";
724
962
  package: "package";
963
+ target: "target";
725
964
  search: "search";
726
965
  flag: "flag";
727
966
  route: "route";
@@ -729,7 +968,6 @@ export declare const TaskDetail: z.ZodObject<{
729
968
  "square-check": "square-check";
730
969
  "file-text": "file-text";
731
970
  bulb: "bulb";
732
- target: "target";
733
971
  calendar: "calendar";
734
972
  star: "star";
735
973
  bolt: "bolt";
@@ -764,6 +1002,7 @@ export declare const TaskDetail: z.ZodObject<{
764
1002
  message: "message";
765
1003
  user: "user";
766
1004
  package: "package";
1005
+ target: "target";
767
1006
  search: "search";
768
1007
  flag: "flag";
769
1008
  route: "route";
@@ -771,7 +1010,6 @@ export declare const TaskDetail: z.ZodObject<{
771
1010
  "square-check": "square-check";
772
1011
  "file-text": "file-text";
773
1012
  bulb: "bulb";
774
- target: "target";
775
1013
  calendar: "calendar";
776
1014
  star: "star";
777
1015
  bolt: "bolt";
@@ -795,6 +1033,7 @@ export declare const TaskDetail: z.ZodObject<{
795
1033
  message: "message";
796
1034
  user: "user";
797
1035
  package: "package";
1036
+ target: "target";
798
1037
  search: "search";
799
1038
  flag: "flag";
800
1039
  route: "route";
@@ -802,7 +1041,6 @@ export declare const TaskDetail: z.ZodObject<{
802
1041
  "square-check": "square-check";
803
1042
  "file-text": "file-text";
804
1043
  bulb: "bulb";
805
- target: "target";
806
1044
  calendar: "calendar";
807
1045
  star: "star";
808
1046
  bolt: "bolt";
@@ -902,7 +1140,13 @@ export declare const TaskDetail: z.ZodObject<{
902
1140
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
903
1141
  createdAt: z.ZodISODateTime;
904
1142
  updatedAt: z.ZodISODateTime;
905
- instruction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1143
+ instruction: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
1144
+ digest: z.ZodString;
1145
+ markdown: z.ZodString;
1146
+ }, z.core.$strip>, z.ZodObject<{
1147
+ digest: z.ZodString;
1148
+ known: z.ZodLiteral<true>;
1149
+ }, z.core.$strip>]>>>;
906
1150
  columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
907
1151
  columnId: z.ZodTemplateLiteral<`column_${string}`>;
908
1152
  name: z.ZodString;
@@ -2,10 +2,13 @@ import { z } from "zod";
2
2
  import { CardKind, CardKindsInput, TaskFields, TaskFieldsInput, TaskKind, TaskKindInput, } from "../card-kinds/card-kinds.js";
3
3
  import { ColumnId, ColumnType, TaskColumn } from "../columns/columns.js";
4
4
  import { idSchema } from "../ids/ids.js";
5
+ import { InstructionRead, Known } from "../instructions/instructions.js";
5
6
  import { Flag } from "../list-input.js";
7
+ import { Missing } from "../missing/missing.js";
6
8
  import { BoardShownKind, BoardSystem, NodeId, NodePerson } from "../nodes/nodes.js";
7
9
  import { IdempotencyKey, Rev } from "../primitives/primitives.js";
8
10
  import { Schedule } from "../schedule/schedule.js";
11
+ import { UserId } from "../users/users.js";
9
12
  import { TicketSubject, TicketSubjectRef } from "../validation/validation.js";
10
13
  import { TaskMove } from "../versions/versions.js";
11
14
  // Boards, their columns and labels, and tasks (#42, Nodes › Board, Nodes › Aufgabe, E38, E40, E41,
@@ -29,7 +32,7 @@ const RunRef = idSchema("run");
29
32
  export const boardKinds = ["board", "process"];
30
33
  export const BoardKind = z
31
34
  .enum(boardKinds)
32
- .describe("board: a board people work on. process: a template whose runs the Operator works through, each a copy of its columns and tasks; it needs a machine (an Operator) with write on it, a first column of type backlog, and every task of the template in that first column.");
35
+ .describe("board: a board people work on. process: a template whose runs the Operator works through, each a copy of its columns and tasks; it needs a machine (an Operator) with write on it, a first column of type backlog, every task of the template in that first column, and a responsible who writes on it (or none).");
33
36
  const Name = z.string().max(200);
34
37
  // A column's description (#624), Markdown for every AI working on the board.
35
38
  const ColumnDescription = z.string().max(20_000);
@@ -52,7 +55,9 @@ export const BoardCreateInput = z.strictObject({
52
55
  // ⚠️ Required and nullable (trap C015): null is the top level of Shared.
53
56
  parentId: NodeId.nullable().describe("The folder to create the board in, one you can write to; null creates it on the top level of Shared, visible to you until you share it."),
54
57
  name: Name.describe("The board's name as people read it."),
55
- columns: Columns.optional().describe("The board's columns in their order, without columnId. Exactly one of type archive, last. Leaving it out gives Backlog, Open, In progress, Done and Archive, named in your language."),
58
+ columns: Columns.optional().describe("The board's columns in their order, without columnId, each with its description if it has one. Exactly one of type archive, last. Leaving it out gives Backlog, Open, In progress, Done and Archive, named in your language."),
59
+ // #675: a copied template has its kinds with the create, not with a second call.
60
+ cardKinds: CardKindsInput.optional().describe("The board's card kinds in their order, each with its fields, as intelligence_board_update takes them but without kindId, fieldId and optionId. The first is the standard unless one says standard. Leaving it out makes a board of free cards."),
56
61
  idempotencyKey: IdempotencyKey,
57
62
  });
58
63
  export const BoardGetInput = z.strictObject({ boardId: BoardId });
@@ -61,9 +66,13 @@ const BoardInstruction = z.string().max(200_000);
61
66
  export const BoardUpdateInput = z.strictObject({
62
67
  boardId: BoardId,
63
68
  rev: Rev,
64
- kind: BoardKind.optional().describe("Make the board a process or a board again. Saving a process is refused with conflict while no machine can write on the board, the first column is not of type backlog, or a task of the template stands outside the first column."),
69
+ kind: BoardKind.optional().describe("Make the board a process or a board again. Saving a process is refused with conflict while no machine can write on the board, the first column is not of type backlog, a task of the template stands outside the first column, or its responsible no longer writes on the board."),
70
+ // E125: a process has one responsible, a board none.
71
+ responsibleId: UserId.nullable()
72
+ .optional()
73
+ .describe("The process's responsible: a person or machine who writes on the board, `user_…`; null for nobody, then whoever made it a process gets the hints. They get the start of a run and a run that stands as an Action and open its first checkpoints. Only with a process. Leaving it out keeps it; a board made a process without one gets whoever makes it a process, when they write on it."),
65
74
  schedule: Schedule.optional().describe("When a run of the process or of the validation falls due (Ausführung). Leaving it out keeps it; a board made a process without one runs by hand."),
66
- instruction: BoardInstruction.optional().describe("The board's instruction, Markdown: what the board is about and how every AI working on it goes about it. It comes along with every read of the board and its tasks over MCP. On the validation board only an admin in admin mode changes it. An empty text removes it; leaving it out keeps it."),
75
+ instruction: BoardInstruction.optional().describe("The board's instruction, Markdown: what the board is about and how every AI working on it goes about it. It comes along with every read of the board and its tasks over MCP, as only its digest where the read sends that digest under known. On the validation board only an admin in admin mode changes it. An empty text removes it; leaving it out keeps it."),
67
76
  columns: Columns.optional(),
68
77
  cardKinds: CardKindsInput.optional(),
69
78
  labels: z
@@ -97,6 +106,27 @@ export const ProcessCheck = z.object({
97
106
  // whom the settings offer "Für Operator freigeben". Empty when there is none. Readable with the board,
98
107
  // without any right in `access`.
99
108
  operators: z.array(z.object({ userId: z.string(), name: z.string() })),
109
+ // The process's responsible writes on the board (E125); true without one and on a board that is
110
+ // no process.
111
+ responsibleWrites: z.boolean(),
112
+ // The template check of a process (#675): what a run of its template needs and Colab can check
113
+ // without knowing what a field means, each entry with the card's `taskId`: a card without a kind
114
+ // on a board with kinds, an empty required field, an assignee who is gone or does not write on the
115
+ // board, a node a link field names that the assignee cannot read. The same entries a save of the
116
+ // process and a template card's create answer under `missing`. Empty on a board that is no process.
117
+ missing: z.array(Missing),
118
+ });
119
+ // A process read without `runId` is its template, not a run (#678): said so over MCP, with the runs
120
+ // that run now, so an AI works on a run's cards and not on the template's. Absent on a board that is
121
+ // no process, and with `runId`.
122
+ export const TemplateNote = z.object({
123
+ message: z.string(),
124
+ runs: z.array(z.object({
125
+ runId: RunRef,
126
+ startedAt: z.iso.datetime(),
127
+ // The moment of the schedule the run stands for; null for one started by hand.
128
+ dueAt: z.iso.datetime().nullable(),
129
+ })),
100
130
  });
101
131
  export const BoardDetail = z.object({
102
132
  boardId: NodeId,
@@ -116,6 +146,8 @@ export const BoardDetail = z.object({
116
146
  // Who carries the validation (E79, #378): the holder of the role `validator` while they can act,
117
147
  // for every reader of the validation board; null without one and for every other board.
118
148
  validator: NodePerson.nullable(),
149
+ // Who is responsible for a process (E125); null for nobody and on every board that is no process.
150
+ responsible: NodePerson.nullable(),
119
151
  columns: z.array(BoardColumn),
120
152
  // The card kinds with their fields in order (#638, E115); empty on a board of free cards.
121
153
  cardKinds: z.array(CardKind),
@@ -123,6 +155,8 @@ export const BoardDetail = z.object({
123
155
  rights: z.object({ write: z.boolean() }),
124
156
  rev: z.number().int(),
125
157
  updatedAt: z.iso.datetime(),
158
+ // Over MCP only, on a process (#678): this is the template, and the runs that run now.
159
+ template: TemplateNote.optional(),
126
160
  });
127
161
  // The most one page of a board's tasks holds: a board is read whole for the kanban.
128
162
  const TaskLimit = z.coerce
@@ -130,7 +164,10 @@ const TaskLimit = z.coerce
130
164
  .int()
131
165
  .min(1)
132
166
  .max(500)
133
- .describe("How many tasks one page holds, 1 to 500. Leaving it out gives 200. With content at most 100, and leaving it out gives 100.");
167
+ .describe("How many tasks one page holds, 1 to 500. Leaving it out gives 50 over MCP and 200 over the API. With content at most 100, and leaving it out gives 100.");
168
+ // Over MCP a page without `content` holds this many tasks unless `limit` says otherwise (E127,
169
+ // #674); the board view, a gadget and every other caller keep 200.
170
+ export const compactTaskLimit = 50;
134
171
  // The most tasks one call reads by id, creates or changes (#625, E114).
135
172
  export const maxBulkTasks = 100;
136
173
  export const BoardTaskListInput = z.strictObject({
@@ -146,13 +183,14 @@ export const BoardTaskListInput = z.strictObject({
146
183
  .preprocess((value) => (typeof value === "string" ? value.split(",") : value), z.array(TaskId).min(1).max(maxBulkTasks))
147
184
  .optional()
148
185
  .describe("Only these tasks of the board (of the run, with runId), 1 to 100, also from the archive column: one you cannot read or that is not there is left out without a note."),
149
- content: Flag.optional().describe("true: every task also carries its Markdown text as content, beside its rev, so you check a whole board without reading task by task. A page then holds at most 100 tasks."),
186
+ content: Flag.optional().describe("true: every task comes whole, with its dates, labels, subtask depth, readiness, images, card kind and fields, and its Markdown text as content, so you check a whole board without reading task by task. A page then holds at most 100 tasks. Without it each task is compact: taskId, title, column, assignee and rev."),
150
187
  cursor: z
151
188
  .string()
152
189
  .max(1000)
153
190
  .optional()
154
191
  .describe("The nextCursor of the previous page, unchanged. Leaving it out starts at the top."),
155
192
  limit: TaskLimit.optional(),
193
+ known: Known.optional(),
156
194
  });
157
195
  const Title = z.string().max(500).describe("The task's title.");
158
196
  const Content = z
@@ -174,7 +212,7 @@ const Position = z
174
212
  .string()
175
213
  .min(1)
176
214
  .max(100)
177
- .describe("The place in the column: a fractional-indexing key between the positions of the neighbours, as intelligence_board_task_list returns them. Leaving it out puts the task at the end of its column.");
215
+ .describe("The place in the column: a fractional-indexing key between the positions of the neighbours, as intelligence_board_task_list returns them with content: true, or intelligence_task_get. Leaving it out puts the task at the end of its column.");
178
216
  const Assignee = idSchema("user").describe("The one person responsible for the task, someone who can read the board. Leaving it out on create makes it you, on a process the first machine that can write on it.");
179
217
  // The fields of one new task, alone or as an entry of `tasks` (#625).
180
218
  const newTask = {
@@ -224,7 +262,7 @@ export const BoardTaskCreateInput = z.strictObject({
224
262
  export const BoardTaskCreated = z.object({
225
263
  tasks: z.array(z.object({ ref: z.string(), taskId: NodeId, rev: z.number().int() })),
226
264
  });
227
- export const TaskGetInput = z.strictObject({ taskId: TaskId });
265
+ export const TaskGetInput = z.strictObject({ taskId: TaskId, known: Known.optional() });
228
266
  export const TaskUpdateInput = z.strictObject({
229
267
  taskId: TaskId,
230
268
  rev: Rev,
@@ -318,12 +356,25 @@ export const BoardTaskList = z.object({
318
356
  items: z.array(BoardTaskItem),
319
357
  nextCursor: z.string().nullable(),
320
358
  // Over MCP only (E87, #354): the board's instruction, a run's copy of it with `runId`; null
321
- // without one.
322
- instruction: z.string().nullable().optional(),
359
+ // without one, the reference when known (E123, #677).
360
+ instruction: InstructionRead.optional(),
323
361
  // Over MCP only (#624): every column of the board (of the run, with `runId`) in order, with its
324
362
  // description, once per page.
325
363
  columns: z.array(BoardColumn).optional(),
364
+ // Over MCP only, on a process without `runId` (#678): these are the template's cards, and the runs
365
+ // that run now.
366
+ template: TemplateNote.optional(),
367
+ });
368
+ // A card as the list answers it over MCP without `content` (E127, #674): what finds a card and moves
369
+ // it on, without its text and the rest of the card.
370
+ export const BoardTaskBrief = BoardTaskItem.pick({
371
+ taskId: true,
372
+ title: true,
373
+ column: true,
374
+ assignee: true,
375
+ rev: true,
326
376
  });
377
+ export const BoardTaskBriefList = BoardTaskList.extend({ items: z.array(BoardTaskBrief) });
327
378
  // A subtask or a task waited for; `kind` its card kind (#638), null without one.
328
379
  const TaskRef = z.object({
329
380
  taskId: NodeId,
@@ -379,8 +430,8 @@ export const TaskDetail = z.object({
379
430
  createdAt: z.iso.datetime(),
380
431
  updatedAt: z.iso.datetime(),
381
432
  // Over MCP only (E87, #354): the instruction of the task's board, of its run for a run's task;
382
- // null without one.
383
- instruction: z.string().nullable().optional(),
433
+ // null without one, the reference when known (E123, #677).
434
+ instruction: InstructionRead.optional(),
384
435
  // Over MCP only (#624): every column of the task's board (of its run for a run's task) in order,
385
436
  // with its description; `current` marks the task's own.
386
437
  columns: z.array(BoardColumn.extend({ current: z.boolean() })).optional(),