@anchrd/colab-sdk 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actions.d.ts +95 -0
- package/dist/actions/actions.js +14 -0
- package/dist/boards/boards.d.ts +22 -0
- package/dist/boards/boards.js +20 -2
- package/dist/error/error.d.ts +7 -0
- package/dist/error/error.js +8 -0
- package/dist/grammar/grammar.d.ts +6 -0
- package/dist/grammar/grammar.js +54 -0
- package/dist/sdk.d.ts +4 -4
- package/dist/sdk.js +4 -4
- package/dist/tool.d.ts +2 -3
- package/package.json +1 -1
|
@@ -44,6 +44,7 @@ export declare const ActionTask: z.ZodObject<{
|
|
|
44
44
|
}>;
|
|
45
45
|
}, z.core.$strip>>;
|
|
46
46
|
handedOver: z.ZodBoolean;
|
|
47
|
+
rev: z.ZodNumber;
|
|
47
48
|
}, z.core.$strip>;
|
|
48
49
|
export type ActionTask = z.infer<typeof ActionTask>;
|
|
49
50
|
export declare const ActionChat: z.ZodObject<{
|
|
@@ -82,6 +83,25 @@ export declare const ActionProcess: z.ZodObject<{
|
|
|
82
83
|
dueAt: z.ZodISODateTime;
|
|
83
84
|
}, z.core.$strip>;
|
|
84
85
|
export type ActionProcess = z.infer<typeof ActionProcess>;
|
|
86
|
+
export declare const ActionRunTask: z.ZodObject<{
|
|
87
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
88
|
+
title: z.ZodString;
|
|
89
|
+
column: z.ZodObject<{
|
|
90
|
+
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
type: z.ZodEnum<{
|
|
93
|
+
backlog: "backlog";
|
|
94
|
+
open: "open";
|
|
95
|
+
progress: "progress";
|
|
96
|
+
done: "done";
|
|
97
|
+
discarded: "discarded";
|
|
98
|
+
blocked: "blocked";
|
|
99
|
+
archive: "archive";
|
|
100
|
+
}>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
rev: z.ZodNumber;
|
|
103
|
+
}, z.core.$strip>;
|
|
104
|
+
export type ActionRunTask = z.infer<typeof ActionRunTask>;
|
|
85
105
|
export declare const ActionRun: z.ZodObject<{
|
|
86
106
|
runId: z.ZodTemplateLiteral<`run_${string}`>;
|
|
87
107
|
status: z.ZodEnum<{
|
|
@@ -90,6 +110,24 @@ export declare const ActionRun: z.ZodObject<{
|
|
|
90
110
|
done: "done";
|
|
91
111
|
running: "running";
|
|
92
112
|
}>;
|
|
113
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
114
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
115
|
+
title: z.ZodString;
|
|
116
|
+
column: z.ZodObject<{
|
|
117
|
+
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
type: z.ZodEnum<{
|
|
120
|
+
backlog: "backlog";
|
|
121
|
+
open: "open";
|
|
122
|
+
progress: "progress";
|
|
123
|
+
done: "done";
|
|
124
|
+
discarded: "discarded";
|
|
125
|
+
blocked: "blocked";
|
|
126
|
+
archive: "archive";
|
|
127
|
+
}>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
rev: z.ZodNumber;
|
|
130
|
+
}, z.core.$strip>>;
|
|
93
131
|
}, z.core.$strip>;
|
|
94
132
|
export type ActionRun = z.infer<typeof ActionRun>;
|
|
95
133
|
export declare const ActionGadget: z.ZodObject<{
|
|
@@ -180,6 +218,7 @@ export declare const ActionItem: z.ZodObject<{
|
|
|
180
218
|
}>;
|
|
181
219
|
}, z.core.$strip>>;
|
|
182
220
|
handedOver: z.ZodBoolean;
|
|
221
|
+
rev: z.ZodNumber;
|
|
183
222
|
}, z.core.$strip>>;
|
|
184
223
|
chat: z.ZodNullable<z.ZodObject<{
|
|
185
224
|
unreadCount: z.ZodNumber;
|
|
@@ -223,6 +262,24 @@ export declare const ActionItem: z.ZodObject<{
|
|
|
223
262
|
done: "done";
|
|
224
263
|
running: "running";
|
|
225
264
|
}>;
|
|
265
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
266
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
267
|
+
title: z.ZodString;
|
|
268
|
+
column: z.ZodObject<{
|
|
269
|
+
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
270
|
+
name: z.ZodString;
|
|
271
|
+
type: z.ZodEnum<{
|
|
272
|
+
backlog: "backlog";
|
|
273
|
+
open: "open";
|
|
274
|
+
progress: "progress";
|
|
275
|
+
done: "done";
|
|
276
|
+
discarded: "discarded";
|
|
277
|
+
blocked: "blocked";
|
|
278
|
+
archive: "archive";
|
|
279
|
+
}>;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
rev: z.ZodNumber;
|
|
282
|
+
}, z.core.$strip>>;
|
|
226
283
|
}, z.core.$strip>>;
|
|
227
284
|
gadget: z.ZodNullable<z.ZodObject<{
|
|
228
285
|
problem: z.ZodEnum<{
|
|
@@ -513,6 +570,7 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
513
570
|
}>;
|
|
514
571
|
}, z.core.$strip>>;
|
|
515
572
|
handedOver: z.ZodBoolean;
|
|
573
|
+
rev: z.ZodNumber;
|
|
516
574
|
}, z.core.$strip>>;
|
|
517
575
|
chat: z.ZodNullable<z.ZodObject<{
|
|
518
576
|
unreadCount: z.ZodNumber;
|
|
@@ -556,6 +614,24 @@ export declare const ActionRow: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
556
614
|
done: "done";
|
|
557
615
|
running: "running";
|
|
558
616
|
}>;
|
|
617
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
618
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
619
|
+
title: z.ZodString;
|
|
620
|
+
column: z.ZodObject<{
|
|
621
|
+
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
622
|
+
name: z.ZodString;
|
|
623
|
+
type: z.ZodEnum<{
|
|
624
|
+
backlog: "backlog";
|
|
625
|
+
open: "open";
|
|
626
|
+
progress: "progress";
|
|
627
|
+
done: "done";
|
|
628
|
+
discarded: "discarded";
|
|
629
|
+
blocked: "blocked";
|
|
630
|
+
archive: "archive";
|
|
631
|
+
}>;
|
|
632
|
+
}, z.core.$strip>;
|
|
633
|
+
rev: z.ZodNumber;
|
|
634
|
+
}, z.core.$strip>>;
|
|
559
635
|
}, z.core.$strip>>;
|
|
560
636
|
gadget: z.ZodNullable<z.ZodObject<{
|
|
561
637
|
problem: z.ZodEnum<{
|
|
@@ -727,6 +803,7 @@ export declare const ActionList: z.ZodObject<{
|
|
|
727
803
|
}>;
|
|
728
804
|
}, z.core.$strip>>;
|
|
729
805
|
handedOver: z.ZodBoolean;
|
|
806
|
+
rev: z.ZodNumber;
|
|
730
807
|
}, z.core.$strip>>;
|
|
731
808
|
chat: z.ZodNullable<z.ZodObject<{
|
|
732
809
|
unreadCount: z.ZodNumber;
|
|
@@ -770,6 +847,24 @@ export declare const ActionList: z.ZodObject<{
|
|
|
770
847
|
done: "done";
|
|
771
848
|
running: "running";
|
|
772
849
|
}>;
|
|
850
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
851
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
852
|
+
title: z.ZodString;
|
|
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
|
+
rev: z.ZodNumber;
|
|
867
|
+
}, z.core.$strip>>;
|
|
773
868
|
}, z.core.$strip>>;
|
|
774
869
|
gadget: z.ZodNullable<z.ZodObject<{
|
|
775
870
|
problem: z.ZodEnum<{
|
package/dist/actions/actions.js
CHANGED
|
@@ -38,6 +38,8 @@ export const ActionTask = z.object({
|
|
|
38
38
|
buttons: z.array(TaskColumn),
|
|
39
39
|
// A machine moved it into its column last: "handed over by the Operator".
|
|
40
40
|
handedOver: z.boolean(),
|
|
41
|
+
// The task's rev (E70, #671): intelligence_task_update takes it without reading the task first.
|
|
42
|
+
rev: z.number().int(),
|
|
41
43
|
});
|
|
42
44
|
export const ActionChat = z.object({
|
|
43
45
|
// The messages of others not read yet, by the person themselves (not their AI).
|
|
@@ -56,9 +58,21 @@ export const ActionProcess = z.object({
|
|
|
56
58
|
// The moment of the schedule the next run stands for.
|
|
57
59
|
dueAt: z.iso.datetime(),
|
|
58
60
|
});
|
|
61
|
+
// A card of a process run that is the reader's own (#671): what the run waits on from them, with the
|
|
62
|
+
// rev its next save sends, so an Operator writes it without reading the run first.
|
|
63
|
+
export const ActionRunTask = z.object({
|
|
64
|
+
taskId: NodeId,
|
|
65
|
+
title: z.string(),
|
|
66
|
+
column: TaskColumn,
|
|
67
|
+
rev: z.number().int(),
|
|
68
|
+
});
|
|
59
69
|
export const ActionRun = z.object({
|
|
60
70
|
runId: RunId,
|
|
61
71
|
status: RunStatus,
|
|
72
|
+
// The cards of this run assigned to the reader, in every column, in the order of the run's columns
|
|
73
|
+
// and their position; never another's. Empty without one, and always for the validation, whose run
|
|
74
|
+
// copies no cards.
|
|
75
|
+
tasks: z.array(ActionRunTask),
|
|
62
76
|
});
|
|
63
77
|
// A gadget whose live version broke (#643, Nodes › Gadget › Einstellungen): every new error and every
|
|
64
78
|
// red test waits on its responsible; without one, on its publisher as a hint to name one. Open until
|
package/dist/boards/boards.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const BoardUpdateInput: z.ZodObject<{
|
|
|
43
43
|
board: "board";
|
|
44
44
|
process: "process";
|
|
45
45
|
}>>;
|
|
46
|
+
responsibleId: z.ZodOptional<z.ZodNullable<z.ZodTemplateLiteral<`user_${string}`>>>;
|
|
46
47
|
schedule: z.ZodOptional<z.ZodObject<{
|
|
47
48
|
rhythm: z.ZodEnum<{
|
|
48
49
|
manual: "manual";
|
|
@@ -164,6 +165,7 @@ export declare const ProcessCheck: z.ZodObject<{
|
|
|
164
165
|
userId: z.ZodString;
|
|
165
166
|
name: z.ZodString;
|
|
166
167
|
}, z.core.$strip>>;
|
|
168
|
+
responsibleWrites: z.ZodBoolean;
|
|
167
169
|
}, z.core.$strip>;
|
|
168
170
|
export type ProcessCheck = z.infer<typeof ProcessCheck>;
|
|
169
171
|
export declare const BoardDetail: z.ZodObject<{
|
|
@@ -214,6 +216,7 @@ export declare const BoardDetail: z.ZodObject<{
|
|
|
214
216
|
userId: z.ZodString;
|
|
215
217
|
name: z.ZodString;
|
|
216
218
|
}, z.core.$strip>>;
|
|
219
|
+
responsibleWrites: z.ZodBoolean;
|
|
217
220
|
}, z.core.$strip>;
|
|
218
221
|
validator: z.ZodNullable<z.ZodObject<{
|
|
219
222
|
userId: z.ZodString;
|
|
@@ -223,6 +226,14 @@ export declare const BoardDetail: z.ZodObject<{
|
|
|
223
226
|
human: "human";
|
|
224
227
|
}>>;
|
|
225
228
|
}, z.core.$strip>>;
|
|
229
|
+
responsible: z.ZodNullable<z.ZodObject<{
|
|
230
|
+
userId: z.ZodString;
|
|
231
|
+
name: z.ZodNullable<z.ZodString>;
|
|
232
|
+
kind: z.ZodNullable<z.ZodEnum<{
|
|
233
|
+
machine: "machine";
|
|
234
|
+
human: "human";
|
|
235
|
+
}>>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
226
237
|
columns: z.ZodArray<z.ZodObject<{
|
|
227
238
|
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
228
239
|
name: z.ZodString;
|
|
@@ -921,3 +932,14 @@ export declare const TaskDetail: z.ZodObject<{
|
|
|
921
932
|
}, z.core.$strip>>>;
|
|
922
933
|
}, z.core.$strip>;
|
|
923
934
|
export type TaskDetail = z.infer<typeof TaskDetail>;
|
|
935
|
+
export declare const TaskSaved: z.ZodObject<{
|
|
936
|
+
taskId: z.ZodTemplateLiteral<`node_${string}`>;
|
|
937
|
+
rev: z.ZodNumber;
|
|
938
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
939
|
+
code: z.ZodEnum<{
|
|
940
|
+
followup_failed: "followup_failed";
|
|
941
|
+
}>;
|
|
942
|
+
message: z.ZodString;
|
|
943
|
+
}, z.core.$strip>>;
|
|
944
|
+
}, z.core.$strip>;
|
|
945
|
+
export type TaskSaved = z.infer<typeof TaskSaved>;
|
package/dist/boards/boards.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
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
|
+
import { Warning } from "../error/error.js";
|
|
4
5
|
import { idSchema } from "../ids/ids.js";
|
|
5
6
|
import { Flag } from "../list-input.js";
|
|
6
7
|
import { BoardShownKind, BoardSystem, NodeId, NodePerson } from "../nodes/nodes.js";
|
|
7
8
|
import { IdempotencyKey, Rev } from "../primitives/primitives.js";
|
|
8
9
|
import { Schedule } from "../schedule/schedule.js";
|
|
10
|
+
import { UserId } from "../users/users.js";
|
|
9
11
|
import { TicketSubject, TicketSubjectRef } from "../validation/validation.js";
|
|
10
12
|
import { TaskMove } from "../versions/versions.js";
|
|
11
13
|
// Boards, their columns and labels, and tasks (#42, Nodes › Board, Nodes › Aufgabe, E38, E40, E41,
|
|
@@ -29,7 +31,7 @@ const RunRef = idSchema("run");
|
|
|
29
31
|
export const boardKinds = ["board", "process"];
|
|
30
32
|
export const BoardKind = z
|
|
31
33
|
.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,
|
|
34
|
+
.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
35
|
const Name = z.string().max(200);
|
|
34
36
|
// A column's description (#624), Markdown for every AI working on the board.
|
|
35
37
|
const ColumnDescription = z.string().max(20_000);
|
|
@@ -61,7 +63,11 @@ const BoardInstruction = z.string().max(200_000);
|
|
|
61
63
|
export const BoardUpdateInput = z.strictObject({
|
|
62
64
|
boardId: BoardId,
|
|
63
65
|
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,
|
|
66
|
+
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."),
|
|
67
|
+
// E125: a process has one responsible, a board none.
|
|
68
|
+
responsibleId: UserId.nullable()
|
|
69
|
+
.optional()
|
|
70
|
+
.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
71
|
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
72
|
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."),
|
|
67
73
|
columns: Columns.optional(),
|
|
@@ -97,6 +103,9 @@ export const ProcessCheck = z.object({
|
|
|
97
103
|
// whom the settings offer "Für Operator freigeben". Empty when there is none. Readable with the board,
|
|
98
104
|
// without any right in `access`.
|
|
99
105
|
operators: z.array(z.object({ userId: z.string(), name: z.string() })),
|
|
106
|
+
// The process's responsible writes on the board (E125); true without one and on a board that is
|
|
107
|
+
// no process.
|
|
108
|
+
responsibleWrites: z.boolean(),
|
|
100
109
|
});
|
|
101
110
|
export const BoardDetail = z.object({
|
|
102
111
|
boardId: NodeId,
|
|
@@ -116,6 +125,8 @@ export const BoardDetail = z.object({
|
|
|
116
125
|
// Who carries the validation (E79, #378): the holder of the role `validator` while they can act,
|
|
117
126
|
// for every reader of the validation board; null without one and for every other board.
|
|
118
127
|
validator: NodePerson.nullable(),
|
|
128
|
+
// Who is responsible for a process (E125); null for nobody and on every board that is no process.
|
|
129
|
+
responsible: NodePerson.nullable(),
|
|
119
130
|
columns: z.array(BoardColumn),
|
|
120
131
|
// The card kinds with their fields in order (#638, E115); empty on a board of free cards.
|
|
121
132
|
cardKinds: z.array(CardKind),
|
|
@@ -385,3 +396,10 @@ export const TaskDetail = z.object({
|
|
|
385
396
|
// with its description; `current` marks the task's own.
|
|
386
397
|
columns: z.array(BoardColumn.extend({ current: z.boolean() })).optional(),
|
|
387
398
|
});
|
|
399
|
+
// `intelligence_task_update` in place of the task when the change is saved and a step after the
|
|
400
|
+
// save failed (#623): the task's id, the rev for its next change and the warning that says so.
|
|
401
|
+
export const TaskSaved = z.object({
|
|
402
|
+
taskId: NodeId,
|
|
403
|
+
rev: z.number().int(),
|
|
404
|
+
warnings: z.array(Warning),
|
|
405
|
+
});
|
package/dist/error/error.d.ts
CHANGED
|
@@ -34,3 +34,10 @@ export declare const ErrorResponse: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strict>], "code">;
|
|
35
35
|
}, z.core.$strict>;
|
|
36
36
|
export type ErrorResponse = z.infer<typeof ErrorResponse>;
|
|
37
|
+
export declare const Warning: z.ZodObject<{
|
|
38
|
+
code: z.ZodEnum<{
|
|
39
|
+
followup_failed: "followup_failed";
|
|
40
|
+
}>;
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type Warning = z.infer<typeof Warning>;
|
package/dist/error/error.js
CHANGED
|
@@ -29,3 +29,11 @@ export const ErrorResponse = z.strictObject({
|
|
|
29
29
|
}),
|
|
30
30
|
]),
|
|
31
31
|
});
|
|
32
|
+
// What a write answers beside its result when it went through and something stands out (E126): a
|
|
33
|
+
// hint for the AI, never a refusal; a fixed code and a sentence. #623 brings the first code, #672
|
|
34
|
+
// takes the field to every write over `/mcp` and adds its own.
|
|
35
|
+
// - `followup_failed`: the change is saved, and a step after the save failed and was reported.
|
|
36
|
+
export const Warning = z.object({
|
|
37
|
+
code: z.enum(["followup_failed"]),
|
|
38
|
+
message: z.string(),
|
|
39
|
+
});
|
|
@@ -39,6 +39,11 @@ export declare const verbs: readonly ["invite", "resend", "disable", "enable", "
|
|
|
39
39
|
export type Package = (typeof packages)[number];
|
|
40
40
|
export type Resource = keyof typeof resources;
|
|
41
41
|
export type Action = (typeof actions)[number] | (typeof verbs)[number];
|
|
42
|
+
export type ActionAnnotations = {
|
|
43
|
+
readOnlyHint: boolean;
|
|
44
|
+
destructiveHint?: boolean;
|
|
45
|
+
idempotentHint?: boolean;
|
|
46
|
+
};
|
|
42
47
|
export type ToolName = {
|
|
43
48
|
package: Package;
|
|
44
49
|
resources: readonly Resource[];
|
|
@@ -60,4 +65,5 @@ export declare function parseToolName(name: string): ToolName;
|
|
|
60
65
|
export declare function toolRoute(name: string): Route;
|
|
61
66
|
export declare function toolPermission(name: string): string;
|
|
62
67
|
export declare function toolEvent(name: string): string;
|
|
68
|
+
export declare function toolAnnotations(name: string): ActionAnnotations | undefined;
|
|
63
69
|
export declare function toolSchemaName(name: string): string;
|
package/dist/grammar/grammar.js
CHANGED
|
@@ -94,6 +94,54 @@ export const verbs = [
|
|
|
94
94
|
// the same (E112): `operator_run_cancel`.
|
|
95
95
|
"cancel",
|
|
96
96
|
];
|
|
97
|
+
const reads = { readOnlyHint: true };
|
|
98
|
+
// Takes nothing away for good. `archive`, `disable` and `unpublish` have their way back (`restore`,
|
|
99
|
+
// `enable`, `publish`); an `update` changes only what it names, a node's against the `rev` it read
|
|
100
|
+
// (E70), and the node keeps its versions.
|
|
101
|
+
const writes = {
|
|
102
|
+
readOnlyHint: false,
|
|
103
|
+
destructiveHint: false,
|
|
104
|
+
idempotentHint: false,
|
|
105
|
+
};
|
|
106
|
+
// Destructive as in the rule `destructive`: afterwards nothing is there that another call brings
|
|
107
|
+
// back. A purged node, a revoked grant or session, a removed interface, a rotated key, a cancelled
|
|
108
|
+
// run at a provider.
|
|
109
|
+
const destroys = {
|
|
110
|
+
readOnlyHint: false,
|
|
111
|
+
destructiveHint: true,
|
|
112
|
+
idempotentHint: false,
|
|
113
|
+
};
|
|
114
|
+
// ⚠️ No action that writes is marked idempotent: a second `archive`, `purge` or `revoke` finds nothing
|
|
115
|
+
// left and refuses, a second `update` of a node with the same `rev` answers `conflict`, a second
|
|
116
|
+
// `create` makes a second thing. A client reading `idempotentHint: true` would take its retry after a
|
|
117
|
+
// timeout for done (rule `destructive`); `false` is the protocol's default and promises nothing. A
|
|
118
|
+
// `Record` over every word: a new verb does not compile without its hints.
|
|
119
|
+
const actionAnnotations = {
|
|
120
|
+
list: reads,
|
|
121
|
+
get: reads,
|
|
122
|
+
create: writes,
|
|
123
|
+
update: writes,
|
|
124
|
+
archive: writes,
|
|
125
|
+
restore: writes,
|
|
126
|
+
purge: destroys,
|
|
127
|
+
invite: writes,
|
|
128
|
+
resend: writes,
|
|
129
|
+
disable: writes,
|
|
130
|
+
enable: writes,
|
|
131
|
+
rotate: destroys,
|
|
132
|
+
share: writes,
|
|
133
|
+
move: writes,
|
|
134
|
+
start: writes,
|
|
135
|
+
complete: writes,
|
|
136
|
+
test: writes,
|
|
137
|
+
revoke: destroys,
|
|
138
|
+
remove: destroys,
|
|
139
|
+
unlock: writes,
|
|
140
|
+
publish: writes,
|
|
141
|
+
schedule: writes,
|
|
142
|
+
unpublish: writes,
|
|
143
|
+
cancel: destroys,
|
|
144
|
+
};
|
|
97
145
|
export function isPackage(word) {
|
|
98
146
|
return packages.includes(word);
|
|
99
147
|
}
|
|
@@ -210,6 +258,12 @@ export function toolEvent(name) {
|
|
|
210
258
|
const { resources: chain, action } = parseToolName(name);
|
|
211
259
|
return [...chain, action].join(".");
|
|
212
260
|
}
|
|
261
|
+
// `access_role_archive` → the hints of `archive`, by the last word. A connector's tool ends in an
|
|
262
|
+
// action too (`shopify_order_list`); a name that does not, which the structure test refuses, has none.
|
|
263
|
+
export function toolAnnotations(name) {
|
|
264
|
+
const action = name.split("_").at(-1) ?? "";
|
|
265
|
+
return isAction(action) ? actionAnnotations[action] : undefined;
|
|
266
|
+
}
|
|
213
267
|
// `access_user_invite` → `UserInviteInput`.
|
|
214
268
|
export function toolSchemaName(name) {
|
|
215
269
|
const { resources: chain, action } = parseToolName(name);
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { ActionChat, ActionGadget, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
|
|
1
|
+
export { ActionChat, ActionGadget, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionRunTask, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
|
|
2
2
|
export { adminModeHeader, adminModeOn } from "./admin-mode.js";
|
|
3
3
|
export { App, AppId, AppList, AppListInput, AppRevoked, AppRevokeInput, OwnAppListQuery, OwnSessionListQuery, Session, SessionId, SessionList, SessionListInput, SessionRevokeInput, SessionsRevoked, } from "./apps/apps.js";
|
|
4
4
|
export { NodeArchived, NodeArchiveInput, NodePurged, NodePurgeInput, NodeRestoreInput, } from "./archive/archive.js";
|
|
5
5
|
export { PasskeyDeleteInput, SetPasswordInput, SignUpInput, } from "./auth/auth.js";
|
|
6
6
|
export { AuthorizationRequest, AuthorizationResponse, Identity, Rules, } from "./authorization/authorization.js";
|
|
7
|
-
export { BoardColumn, BoardCreateInput, BoardDetail, BoardGetInput, BoardId, BoardKind, BoardLabel, BoardTaskCreated, BoardTaskCreateInput, BoardTaskItem, BoardTaskList, BoardTaskListInput, BoardTaskUpdated, BoardTaskUpdateInput, BoardUpdateInput, boardKinds, LabelId, maxBulkTasks, ProcessCheck, TaskDetail, TaskGetInput, TaskId, TaskImage, TaskUpdateInput, } from "./boards/boards.js";
|
|
7
|
+
export { BoardColumn, BoardCreateInput, BoardDetail, BoardGetInput, BoardId, BoardKind, BoardLabel, BoardTaskCreated, BoardTaskCreateInput, BoardTaskItem, BoardTaskList, BoardTaskListInput, BoardTaskUpdated, BoardTaskUpdateInput, BoardUpdateInput, boardKinds, LabelId, maxBulkTasks, ProcessCheck, TaskDetail, TaskGetInput, TaskId, TaskImage, TaskSaved, TaskUpdateInput, } from "./boards/boards.js";
|
|
8
8
|
export { CardField, CardFieldId, CardFieldInput, CardFieldOption, CardFieldType, CardFieldValue, CardKind, CardKindIcon, CardKindId, CardKindInput, CardOptionId, ChecklistItem, cardFieldTypes, cardKindIcons, emptyValue, TaskFields, TaskKind, } from "./card-kinds/card-kinds.js";
|
|
9
9
|
export { ColumnId, ColumnType, columnTypes, TaskColumn } from "./columns/columns.js";
|
|
10
10
|
export { Connection, ConnectionCreateInput, ConnectionCredential, ConnectionDetail, ConnectionGetInput, ConnectionId, ConnectionList, ConnectionListInput, ConnectionRevokeInput, ConnectionState, ConnectionTested, ConnectionTestInput, ConnectionTestResult, ConnectionUpdateInput, } from "./connections/connections.js";
|
|
11
11
|
export { Call, CallId, CallList, CallListInput, CallSource, Connector, ConnectorField, ConnectorGetInput, ConnectorId, ConnectorList, ConnectorListInput, ConnectorTool, } from "./connectors/connectors.js";
|
|
12
12
|
export { DirectoryPrincipal, DirectorySearchInput } from "./directory/directory.js";
|
|
13
13
|
export { DocumentCreateInput, DocumentDetail, DocumentGetInput, DocumentUpdateInput, } from "./documents/documents.js";
|
|
14
|
-
export { ErrorCode, ErrorIssue, ErrorResponse, errorCodes } from "./error/error.js";
|
|
14
|
+
export { ErrorCode, ErrorIssue, ErrorResponse, errorCodes, Warning, } from "./error/error.js";
|
|
15
15
|
export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, } from "./events/events.js";
|
|
16
16
|
export { FileCreateInput, FileDetail, type FileFormat, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
|
|
17
17
|
export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
|
|
18
18
|
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, } from "./gadgets/gadgets.js";
|
|
19
|
-
export { type Action, actions, hasRoute, isAction, isPackage, isWord, type Package, packages, parseConnectorFunction, parseToolName, type Resource, type Route, resources, type ToolName, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
19
|
+
export { type Action, actions, hasRoute, isAction, isPackage, isWord, type Package, packages, parseConnectorFunction, parseToolName, type Resource, type Route, resources, type ToolName, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
20
20
|
export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
|
|
21
21
|
export { createId, type Id, idSchema } from "./ids/ids.js";
|
|
22
22
|
export { Instructions, InstructionsLink, instructionsNames, isInstructionsName, validationSection, } from "./instructions/instructions.js";
|
package/dist/sdk.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// The contract between UI, backends and outside services, published as `@anchrd/colab-sdk`. The
|
|
2
2
|
// package exports only this file, so everything public is named here once.
|
|
3
3
|
// biome-ignore lint/performance/noBarrelFile: this file IS the entry point of the package.
|
|
4
|
-
export { ActionChat, ActionGadget, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
|
|
4
|
+
export { ActionChat, ActionGadget, ActionItem, ActionList, ActionListInput, ActionNotice, ActionNoticeButton, ActionNoticeCrumb, ActionNoticeItem, ActionNoticeKind, ActionNoticeReason, ActionNoticeTitle, ActionProcess, ActionRow, ActionRun, ActionRunTask, ActionSection, ActionTask, actionFilters, isNodeRow, MachineInstructions, } from "./actions/actions.js";
|
|
5
5
|
export { adminModeHeader, adminModeOn } from "./admin-mode.js";
|
|
6
6
|
export { App, AppId, AppList, AppListInput, AppRevoked, AppRevokeInput, OwnAppListQuery, OwnSessionListQuery, Session, SessionId, SessionList, SessionListInput, SessionRevokeInput, SessionsRevoked, } from "./apps/apps.js";
|
|
7
7
|
export { NodeArchived, NodeArchiveInput, NodePurged, NodePurgeInput, NodeRestoreInput, } from "./archive/archive.js";
|
|
8
8
|
export { PasskeyDeleteInput, SetPasswordInput, SignUpInput, } from "./auth/auth.js";
|
|
9
9
|
export { AuthorizationRequest, AuthorizationResponse, Identity, Rules, } from "./authorization/authorization.js";
|
|
10
|
-
export { BoardColumn, BoardCreateInput, BoardDetail, BoardGetInput, BoardId, BoardKind, BoardLabel, BoardTaskCreated, BoardTaskCreateInput, BoardTaskItem, BoardTaskList, BoardTaskListInput, BoardTaskUpdated, BoardTaskUpdateInput, BoardUpdateInput, boardKinds, LabelId, maxBulkTasks, ProcessCheck, TaskDetail, TaskGetInput, TaskId, TaskImage, TaskUpdateInput, } from "./boards/boards.js";
|
|
10
|
+
export { BoardColumn, BoardCreateInput, BoardDetail, BoardGetInput, BoardId, BoardKind, BoardLabel, BoardTaskCreated, BoardTaskCreateInput, BoardTaskItem, BoardTaskList, BoardTaskListInput, BoardTaskUpdated, BoardTaskUpdateInput, BoardUpdateInput, boardKinds, LabelId, maxBulkTasks, ProcessCheck, TaskDetail, TaskGetInput, TaskId, TaskImage, TaskSaved, TaskUpdateInput, } from "./boards/boards.js";
|
|
11
11
|
export { CardField, CardFieldId, CardFieldInput, CardFieldOption, CardFieldType, CardFieldValue, CardKind, CardKindIcon, CardKindId, CardKindInput, CardOptionId, ChecklistItem, cardFieldTypes, cardKindIcons, emptyValue, TaskFields, TaskKind, } from "./card-kinds/card-kinds.js";
|
|
12
12
|
export { ColumnId, ColumnType, columnTypes, TaskColumn } from "./columns/columns.js";
|
|
13
13
|
export { Connection, ConnectionCreateInput, ConnectionCredential, ConnectionDetail, ConnectionGetInput, ConnectionId, ConnectionList, ConnectionListInput, ConnectionRevokeInput, ConnectionState, ConnectionTested, ConnectionTestInput, ConnectionTestResult, ConnectionUpdateInput, } from "./connections/connections.js";
|
|
14
14
|
export { Call, CallId, CallList, CallListInput, CallSource, Connector, ConnectorField, ConnectorGetInput, ConnectorId, ConnectorList, ConnectorListInput, ConnectorTool, } from "./connectors/connectors.js";
|
|
15
15
|
export { DirectoryPrincipal, DirectorySearchInput } from "./directory/directory.js";
|
|
16
16
|
export { DocumentCreateInput, DocumentDetail, DocumentGetInput, DocumentUpdateInput, } from "./documents/documents.js";
|
|
17
|
-
export { ErrorCode, ErrorIssue, ErrorResponse, errorCodes } from "./error/error.js";
|
|
17
|
+
export { ErrorCode, ErrorIssue, ErrorResponse, errorCodes, Warning, } from "./error/error.js";
|
|
18
18
|
export { ActorKind, Event, EventId, EventKind, EventList, EventListInput, } from "./events/events.js";
|
|
19
19
|
export { FileCreateInput, FileDetail, FileGetInput, FileId, FileTextState, FileUpdateInput, FileUpload, fileFormatExtensions, fileFormatOf, fileTextStates, maxFileBytes, UploadTicket, uploadTicketHeader, uploadTicketLifetimeMs, } from "./files/files.js";
|
|
20
20
|
export { FunctionRemoved, ServiceInterfaceFunctionCreateInput, ServiceInterfaceFunctionRemoveInput, ServiceInterfaceFunctionUpdateInput, } from "./functions/functions.js";
|
|
21
21
|
export { GadgetCall, GadgetCallCreateInput, GadgetCallEntry, GadgetCallGetInput, GadgetCallItem, GadgetCallList, GadgetCallListInput, GadgetCallStatus, GadgetChange, GadgetClientLog, GadgetConsoleLine, GadgetCreateInput, GadgetDetail, GadgetFile, GadgetFilePath, GadgetFunction, GadgetFunctionName, GadgetGetInput, GadgetLevel, GadgetManifest, GadgetPublishInput, GadgetSettings, GadgetTestInput, GadgetTestResult, GadgetTestRun, GadgetToolUse, GadgetUpdateInput, GadgetVersionRef, gadgetLimits, gadgetLogDays, } from "./gadgets/gadgets.js";
|
|
22
|
-
export { actions, hasRoute, isAction, isPackage, isWord, packages, parseConnectorFunction, parseToolName, resources, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
22
|
+
export { actions, hasRoute, isAction, isPackage, isWord, packages, parseConnectorFunction, parseToolName, resources, toolAnnotations, toolEvent, toolPermission, toolRoute, toolSchemaName, verbs, } from "./grammar/grammar.js";
|
|
23
23
|
export { GrantId, GrantRight, NodeGrant, NodeGrantList, NodeGrantListInput, NodeGrantRevoked, NodeGrantRevokeInput, NodeShared, NodeShareInput, } from "./grants/grants.js";
|
|
24
24
|
export { createId, idSchema } from "./ids/ids.js";
|
|
25
25
|
export { Instructions, InstructionsLink, instructionsNames, isInstructionsName, validationSection, } from "./instructions/instructions.js";
|
package/dist/tool.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
|
-
import type { Package } from "./grammar/grammar.js";
|
|
2
|
+
import type { ActionAnnotations, Package } from "./grammar/grammar.js";
|
|
3
3
|
export type ToolInput = z.ZodObject<z.core.$ZodShape, z.core.$strict>;
|
|
4
4
|
export type Permission = `${Package} / ${string} / ${string}`;
|
|
5
5
|
export type Actor = {
|
|
@@ -14,8 +14,7 @@ export type ToolContext = {
|
|
|
14
14
|
actor: Actor;
|
|
15
15
|
source?: ToolSource;
|
|
16
16
|
};
|
|
17
|
-
export type ToolAnnotations = {
|
|
18
|
-
readOnlyHint?: boolean;
|
|
17
|
+
export type ToolAnnotations = Partial<ActionAnnotations> & {
|
|
19
18
|
openWorldHint?: boolean;
|
|
20
19
|
};
|
|
21
20
|
export type Tool<Input extends ToolInput = ToolInput> = {
|
package/package.json
CHANGED