@anchrd/colab-sdk 0.0.0-stage → 0.1.0
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/README.md +65 -2
- package/dist/actions/actions.d.ts +810 -0
- package/dist/actions/actions.js +177 -0
- package/dist/admin-mode.d.ts +2 -0
- package/dist/admin-mode.js +5 -0
- package/dist/apps/apps.d.ts +108 -0
- package/dist/apps/apps.js +73 -0
- package/dist/archive/archive.d.ts +25 -0
- package/dist/archive/archive.js +27 -0
- package/dist/auth/auth.d.ts +27 -0
- package/dist/auth/auth.js +22 -0
- package/dist/authorization/authorization.d.ts +36 -0
- package/dist/authorization/authorization.js +23 -0
- package/dist/boards/boards.d.ts +612 -0
- package/dist/boards/boards.js +289 -0
- package/dist/columns/columns.d.ts +28 -0
- package/dist/columns/columns.js +28 -0
- package/dist/connections/connections.d.ts +149 -0
- package/dist/connections/connections.js +74 -0
- package/dist/connectors/connectors.d.ts +148 -0
- package/dist/connectors/connectors.js +83 -0
- package/dist/dashboards/dashboards.d.ts +221 -0
- package/dist/dashboards/dashboards.js +520 -0
- package/dist/directory/directory.d.ts +20 -0
- package/dist/directory/directory.js +18 -0
- package/dist/documents/documents.d.ts +61 -0
- package/dist/documents/documents.js +58 -0
- package/dist/error/error.d.ts +34 -0
- package/dist/error/error.js +30 -0
- package/dist/events/events.d.ts +104 -0
- package/dist/events/events.js +69 -0
- package/dist/files/files.d.ts +60 -0
- package/dist/files/files.js +139 -0
- package/dist/functions/functions.d.ts +26 -0
- package/dist/functions/functions.js +28 -0
- package/dist/grammar/grammar.d.ts +62 -0
- package/dist/grammar/grammar.js +197 -0
- package/dist/grants/grants.d.ts +93 -0
- package/dist/grants/grants.js +66 -0
- package/dist/ids/ids.d.ts +5 -0
- package/dist/ids/ids.js +12 -0
- package/dist/instructions/instructions.d.ts +19 -0
- package/dist/instructions/instructions.js +35 -0
- package/dist/interfaces/interfaces.d.ts +41 -0
- package/dist/interfaces/interfaces.js +52 -0
- package/dist/invitations/invitations.d.ts +98 -0
- package/dist/invitations/invitations.js +58 -0
- package/dist/links/links.d.ts +76 -0
- package/dist/links/links.js +73 -0
- package/dist/list-input.d.ts +3 -0
- package/dist/list-input.js +11 -0
- package/dist/machines/machines.d.ts +69 -0
- package/dist/machines/machines.js +39 -0
- package/dist/messages/messages.d.ts +117 -0
- package/dist/messages/messages.js +77 -0
- package/dist/nodes/nodes.d.ts +673 -0
- package/dist/nodes/nodes.js +354 -0
- package/dist/operators/operators.d.ts +898 -0
- package/dist/operators/operators.js +398 -0
- package/dist/pages/pages.d.ts +89 -0
- package/dist/pages/pages.js +62 -0
- package/dist/primitives/primitives.d.ts +5 -0
- package/dist/primitives/primitives.js +19 -0
- package/dist/profile/profile.d.ts +37 -0
- package/dist/profile/profile.js +43 -0
- package/dist/roles/roles.d.ts +135 -0
- package/dist/roles/roles.js +87 -0
- package/dist/runs/runs.d.ts +244 -0
- package/dist/runs/runs.js +137 -0
- package/dist/runtime-config.d.ts +12 -0
- package/dist/runtime-config.js +18 -0
- package/dist/sdk.d.ts +45 -0
- package/dist/sdk.js +48 -0
- package/dist/secrets/secrets.d.ts +65 -0
- package/dist/secrets/secrets.js +57 -0
- package/dist/service-client/service-client.d.ts +35 -0
- package/dist/service-client/service-client.js +90 -0
- package/dist/services/services.d.ts +122 -0
- package/dist/services/services.js +89 -0
- package/dist/sso/sso.d.ts +70 -0
- package/dist/sso/sso.js +54 -0
- package/dist/tables/tables.d.ts +133 -0
- package/dist/tables/tables.js +131 -0
- package/dist/tool.d.ts +31 -0
- package/dist/tool.js +4 -0
- package/dist/user-settings/user-settings.d.ts +44 -0
- package/dist/user-settings/user-settings.js +44 -0
- package/dist/users/users.d.ts +254 -0
- package/dist/users/users.js +125 -0
- package/dist/validation/validation.d.ts +106 -0
- package/dist/validation/validation.js +41 -0
- package/dist/versions/versions.d.ts +100 -0
- package/dist/versions/versions.js +70 -0
- package/package.json +27 -4
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ColumnId, ColumnType, TaskColumn } from "../columns/columns.js";
|
|
3
|
+
import { Schedule } from "../dashboards/dashboards.js";
|
|
4
|
+
import { idSchema } from "../ids/ids.js";
|
|
5
|
+
import { BoardShownKind, BoardSystem, NodeId, NodePerson } from "../nodes/nodes.js";
|
|
6
|
+
import { IdempotencyKey, Rev } from "../primitives/primitives.js";
|
|
7
|
+
import { TicketMove, TicketSubject, TicketSubjectRef } from "../validation/validation.js";
|
|
8
|
+
// Boards, their columns and labels, and tasks (#42, Nodes › Board, Nodes › Aufgabe, E38, E40, E41,
|
|
9
|
+
// E43, E44, E67, E70): the inputs of `intelligence_board_create`, `_get`, `_update`,
|
|
10
|
+
// `intelligence_board_task_list`, `_create`, `intelligence_task_get`, `_update`, and the answers. A
|
|
11
|
+
// board and a task are nodes, so their ids are `node_…`; columns and labels have no tools of their
|
|
12
|
+
// own and are kept as whole lists through `intelligence_board_update`.
|
|
13
|
+
// A ULID in Crockford base32, as `ids.ts` takes it.
|
|
14
|
+
const ulid = z.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/);
|
|
15
|
+
export const BoardId = idSchema("node").describe("The board's id, its node id `node_…`, as intelligence_node_list or intelligence_board_create returned it.");
|
|
16
|
+
export const TaskId = idSchema("node").describe("The task's id, its node id `node_…`, as intelligence_board_task_list returned it.");
|
|
17
|
+
// `label_…` is no word of the grammar (#42): a row of a board, not a resource. Columns are in
|
|
18
|
+
// `columns.ts`.
|
|
19
|
+
export const LabelId = z
|
|
20
|
+
.templateLiteral([z.literal("label"), z.literal("_"), ulid])
|
|
21
|
+
.describe("A label of this board, `label_…`, as intelligence_board_get returned it.");
|
|
22
|
+
// A run of a process (#43). The same id `runs.ts` names `RunId`; written here again because
|
|
23
|
+
// `runs.ts` builds on this file and the graph between the files stays acyclic (trap C009).
|
|
24
|
+
const RunRef = idSchema("run");
|
|
25
|
+
// What a board is (#43, Nodes › Board › Prozess): a board, or a process whose runs are copies of it.
|
|
26
|
+
export const boardKinds = ["board", "process"];
|
|
27
|
+
export const BoardKind = z
|
|
28
|
+
.enum(boardKinds)
|
|
29
|
+
.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.");
|
|
30
|
+
const Name = z.string().max(200);
|
|
31
|
+
const ColumnInput = z.strictObject({
|
|
32
|
+
columnId: ColumnId.optional().describe("The column to keep, as intelligence_board_get returned it. Leaving it out makes a new column."),
|
|
33
|
+
name: Name.describe("The column's name as people read it."),
|
|
34
|
+
type: ColumnType,
|
|
35
|
+
visible: z
|
|
36
|
+
.boolean()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Whether the board shows the column. Leaving it out shows it, except the archive column, which is hidden by default."),
|
|
39
|
+
});
|
|
40
|
+
const Columns = z
|
|
41
|
+
.array(ColumnInput)
|
|
42
|
+
.min(2)
|
|
43
|
+
.max(30)
|
|
44
|
+
.describe("The board's columns, all of them, in their order: a column with columnId is kept, one without is made, and a column left out is removed. Exactly one column of type archive, always last; it cannot be removed. A column that still holds tasks cannot be removed: move them first.");
|
|
45
|
+
export const BoardCreateInput = z.strictObject({
|
|
46
|
+
// ⚠️ Required and nullable (trap C015): null is the top level of Shared.
|
|
47
|
+
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."),
|
|
48
|
+
name: Name.describe("The board's name as people read it."),
|
|
49
|
+
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."),
|
|
50
|
+
idempotencyKey: IdempotencyKey,
|
|
51
|
+
});
|
|
52
|
+
export const BoardGetInput = z.strictObject({ boardId: BoardId });
|
|
53
|
+
// The instruction of a board or a dashboard (E87, #354), Markdown for every AI working on it.
|
|
54
|
+
const BoardInstruction = z.string().max(200_000);
|
|
55
|
+
export const BoardUpdateInput = z.strictObject({
|
|
56
|
+
boardId: BoardId,
|
|
57
|
+
rev: Rev,
|
|
58
|
+
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."),
|
|
59
|
+
schedule: Schedule.optional().describe("When a run of the process or of the validation falls due (Ausführung), as on a dashboard. Leaving it out keeps it; a board made a process without one runs by hand."),
|
|
60
|
+
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."),
|
|
61
|
+
columns: Columns.optional(),
|
|
62
|
+
labels: z
|
|
63
|
+
.array(z.strictObject({
|
|
64
|
+
labelId: LabelId.optional().describe("The label to keep or rename. Leaving it out makes a new label."),
|
|
65
|
+
name: Name.describe("The label's name; one name per board, whatever its case."),
|
|
66
|
+
}))
|
|
67
|
+
.max(200)
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("The board's labels, all of them: a label with labelId is kept or renamed, one without is made, and a label left out is removed from the board and from every task carrying it."),
|
|
70
|
+
});
|
|
71
|
+
export const BoardColumn = z.strictObject({
|
|
72
|
+
columnId: ColumnId,
|
|
73
|
+
name: z.string(),
|
|
74
|
+
type: ColumnType,
|
|
75
|
+
visible: z.boolean(),
|
|
76
|
+
});
|
|
77
|
+
export const BoardLabel = z.strictObject({ labelId: LabelId, name: z.string() });
|
|
78
|
+
// What stands between a board and saving it as a process (#43): the UI shows a box for each, and the
|
|
79
|
+
// server refuses on its own (trap P066).
|
|
80
|
+
export const ProcessCheck = z.strictObject({
|
|
81
|
+
// A machine (an Operator) holds write on the board (#334: any machine, whatever its roles).
|
|
82
|
+
operator: z.boolean(),
|
|
83
|
+
// The first column is of type backlog.
|
|
84
|
+
firstColumnBacklog: z.boolean(),
|
|
85
|
+
// How many tasks of the template stand outside the first column.
|
|
86
|
+
outside: z.number().int(),
|
|
87
|
+
// Every machine that is neither locked nor archived, whatever its roles, by name (#148, #334):
|
|
88
|
+
// whom the settings offer "Für Operator freigeben". Empty when there is none. Readable with the board,
|
|
89
|
+
// without any right in `access`.
|
|
90
|
+
operators: z.array(z.strictObject({ userId: z.string(), name: z.string() })),
|
|
91
|
+
});
|
|
92
|
+
export const BoardDetail = z.strictObject({
|
|
93
|
+
boardId: NodeId,
|
|
94
|
+
name: z.string(),
|
|
95
|
+
kind: BoardShownKind,
|
|
96
|
+
// A system part with a lock, null for every other board.
|
|
97
|
+
system: BoardSystem.nullable(),
|
|
98
|
+
// A process's or the validation's schedule, its zone filled; null for a board.
|
|
99
|
+
schedule: Schedule.nullable(),
|
|
100
|
+
// The board's instruction (E87, #354; the validation's since #47), Markdown; null without one.
|
|
101
|
+
instruction: z.string().nullable(),
|
|
102
|
+
// The next moment a run falls due, null for a board, a manual process or dates that have passed.
|
|
103
|
+
nextRunAt: z.iso.datetime().nullable(),
|
|
104
|
+
// The moment a run is owed for now (passed, unanswered, no run open), else null.
|
|
105
|
+
dueAt: z.iso.datetime().nullable(),
|
|
106
|
+
processCheck: ProcessCheck,
|
|
107
|
+
// Who carries the validation (E79, #378): the holder of the role `validator` while they can act,
|
|
108
|
+
// for every reader of the validation board; null without one and for every other board.
|
|
109
|
+
validator: NodePerson.nullable(),
|
|
110
|
+
columns: z.array(BoardColumn),
|
|
111
|
+
labels: z.array(BoardLabel),
|
|
112
|
+
rights: z.strictObject({ write: z.boolean() }),
|
|
113
|
+
rev: z.number().int(),
|
|
114
|
+
updatedAt: z.iso.datetime(),
|
|
115
|
+
});
|
|
116
|
+
// The most one page of a board's tasks holds: a board is read whole for the kanban.
|
|
117
|
+
const TaskLimit = z.coerce
|
|
118
|
+
.number()
|
|
119
|
+
.int()
|
|
120
|
+
.min(1)
|
|
121
|
+
.max(500)
|
|
122
|
+
.describe("How many tasks one page holds, 1 to 500. Leaving it out gives 200.");
|
|
123
|
+
export const BoardTaskListInput = z.strictObject({
|
|
124
|
+
boardId: BoardId,
|
|
125
|
+
runId: RunRef.optional().describe("The run of this process whose tasks and columns to list. Leaving it out lists the template, the board itself."),
|
|
126
|
+
columnId: ColumnId.optional().describe("Only the tasks in this column."),
|
|
127
|
+
type: ColumnType.optional().describe("Only the tasks in columns of this type. The archive column's tasks are listed only with type archive."),
|
|
128
|
+
assigneeId: idSchema("user").optional().describe("Only the tasks assigned to this person."),
|
|
129
|
+
labelId: LabelId.optional().describe("Only the tasks carrying this label."),
|
|
130
|
+
parentTaskId: TaskId.optional().describe("Only the direct subtasks of this task."),
|
|
131
|
+
cursor: z
|
|
132
|
+
.string()
|
|
133
|
+
.max(1000)
|
|
134
|
+
.optional()
|
|
135
|
+
.describe("The nextCursor of the previous page, unchanged. Leaving it out starts at the top."),
|
|
136
|
+
limit: TaskLimit.optional(),
|
|
137
|
+
});
|
|
138
|
+
const Title = z.string().max(500).describe("The task's title.");
|
|
139
|
+
const Content = z
|
|
140
|
+
.string()
|
|
141
|
+
.max(200_000)
|
|
142
|
+
.describe("The task's text in Markdown. Images linked in it (an image URL, or a link to a file in Colab) show on the card.");
|
|
143
|
+
const Time = z.iso.datetime({ offset: true });
|
|
144
|
+
const StartsAt = Time.describe("When the task starts, ISO 8601.");
|
|
145
|
+
const EndsAt = Time.describe("When the task ends, ISO 8601; only together with a start, not before it.");
|
|
146
|
+
const Labels = z
|
|
147
|
+
.array(Name)
|
|
148
|
+
.max(50)
|
|
149
|
+
.describe("The names of the board's labels the task carries. A name the board does not have yet makes a new label on the board.");
|
|
150
|
+
const DependsOn = z
|
|
151
|
+
.array(TaskId)
|
|
152
|
+
.max(100)
|
|
153
|
+
.describe("The tasks of the same board this one waits for. It is ready once each of them is in a column of type done or discarded.");
|
|
154
|
+
const Position = z
|
|
155
|
+
.string()
|
|
156
|
+
.min(1)
|
|
157
|
+
.max(100)
|
|
158
|
+
.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.");
|
|
159
|
+
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.");
|
|
160
|
+
export const BoardTaskCreateInput = z.strictObject({
|
|
161
|
+
boardId: BoardId,
|
|
162
|
+
runId: RunRef.optional().describe("Create the task in this running run of the process, in one of the run's columns. Leaving it out creates it in the template. A completed run takes no task."),
|
|
163
|
+
title: Title,
|
|
164
|
+
content: Content.optional(),
|
|
165
|
+
columnId: ColumnId.optional().describe("The column to put the task in. Leaving it out puts it in the board's first column."),
|
|
166
|
+
assigneeId: Assignee.optional(),
|
|
167
|
+
startsAt: StartsAt.optional(),
|
|
168
|
+
endsAt: EndsAt.optional(),
|
|
169
|
+
labels: Labels.optional(),
|
|
170
|
+
parentTaskId: TaskId.optional().describe("Make it a subtask of this task of the same board; it is still a card of its own."),
|
|
171
|
+
dependsOn: DependsOn.optional(),
|
|
172
|
+
position: Position.optional(),
|
|
173
|
+
idempotencyKey: IdempotencyKey,
|
|
174
|
+
});
|
|
175
|
+
export const TaskGetInput = z.strictObject({ taskId: TaskId });
|
|
176
|
+
export const TaskUpdateInput = z.strictObject({
|
|
177
|
+
taskId: TaskId,
|
|
178
|
+
rev: Rev,
|
|
179
|
+
title: Title.optional(),
|
|
180
|
+
content: Content.optional(),
|
|
181
|
+
columnId: ColumnId.optional().describe("Move the task to this column of its board. Into the archive column archives it; out of it brings it back."),
|
|
182
|
+
assigneeId: Assignee.optional(),
|
|
183
|
+
startsAt: StartsAt.nullable()
|
|
184
|
+
.optional()
|
|
185
|
+
.describe("When the task starts, ISO 8601; null clears it and the end."),
|
|
186
|
+
endsAt: EndsAt.nullable()
|
|
187
|
+
.optional()
|
|
188
|
+
.describe("When the task ends, ISO 8601, not before the start; null clears it."),
|
|
189
|
+
labels: Labels.optional(),
|
|
190
|
+
parentTaskId: TaskId.nullable()
|
|
191
|
+
.optional()
|
|
192
|
+
.describe("Hang the task under this task of the same board; null makes it a task of its own again."),
|
|
193
|
+
dependsOn: DependsOn.optional(),
|
|
194
|
+
position: Position.optional(),
|
|
195
|
+
waiting: z
|
|
196
|
+
.boolean()
|
|
197
|
+
.optional()
|
|
198
|
+
.describe("true: the task waits, because something is missing that you cannot get yourself, a right above all; say in the task's chat what is missing and mention who can give it. false: it waits no more. The assignee sets and clears it with reading the board alone, and then sends nothing else; a move to another column clears it."),
|
|
199
|
+
comment: z
|
|
200
|
+
.string()
|
|
201
|
+
.max(10_000)
|
|
202
|
+
.optional()
|
|
203
|
+
.describe("Only on a ticket of the validation board, together with columnId: why it moves, kept in the ticket's history. Elsewhere it is invalid."),
|
|
204
|
+
});
|
|
205
|
+
// An image linked in a task's content: an outside URL, or a file in Colab the caller can read.
|
|
206
|
+
export const TaskImage = z.union([
|
|
207
|
+
z.strictObject({ kind: z.literal("url"), url: z.string() }),
|
|
208
|
+
z.strictObject({ kind: z.literal("file"), nodeId: NodeId }),
|
|
209
|
+
]);
|
|
210
|
+
export const BoardTaskItem = z.strictObject({
|
|
211
|
+
taskId: NodeId,
|
|
212
|
+
// The run the task belongs to, null for a task of the board itself (the template of a process).
|
|
213
|
+
runId: RunRef.nullable(),
|
|
214
|
+
title: z.string(),
|
|
215
|
+
column: TaskColumn,
|
|
216
|
+
assignee: NodePerson,
|
|
217
|
+
startsAt: z.iso.datetime().nullable(),
|
|
218
|
+
endsAt: z.iso.datetime().nullable(),
|
|
219
|
+
labels: z.array(BoardLabel),
|
|
220
|
+
parentTaskId: NodeId.nullable(),
|
|
221
|
+
// How deep it hangs as a subtask: 0 for a task of its own.
|
|
222
|
+
depth: z.number().int(),
|
|
223
|
+
// Everything it waits for is in a column of type done or discarded (true without any).
|
|
224
|
+
ready: z.boolean(),
|
|
225
|
+
images: z.array(TaskImage),
|
|
226
|
+
// A ticket of the validation board (#47): the node it validates; null for every other task.
|
|
227
|
+
subject: TicketSubjectRef.nullable(),
|
|
228
|
+
// Whether the caller may change this task, as intelligence_task_update decides it: the board's
|
|
229
|
+
// right for a task, its node's for a ticket (#47: the node's responsible person, the holder of
|
|
230
|
+
// `validator` (#334), an admin in admin mode; only reading while the node is archived).
|
|
231
|
+
rights: z.strictObject({ write: z.boolean() }),
|
|
232
|
+
position: z.string(),
|
|
233
|
+
rev: z.number().int(),
|
|
234
|
+
updatedAt: z.iso.datetime(),
|
|
235
|
+
});
|
|
236
|
+
export const BoardTaskList = z.strictObject({
|
|
237
|
+
items: z.array(BoardTaskItem),
|
|
238
|
+
nextCursor: z.string().nullable(),
|
|
239
|
+
// Over MCP only (E87, #354): the board's instruction, a run's copy of it with `runId`; null
|
|
240
|
+
// without one.
|
|
241
|
+
instruction: z.string().nullable().optional(),
|
|
242
|
+
});
|
|
243
|
+
const TaskRef = z.strictObject({ taskId: NodeId, title: z.string(), column: TaskColumn });
|
|
244
|
+
export const TaskDetail = z.strictObject({
|
|
245
|
+
taskId: NodeId,
|
|
246
|
+
boardId: NodeId,
|
|
247
|
+
runId: RunRef.nullable(),
|
|
248
|
+
title: z.string(),
|
|
249
|
+
content: z.string(),
|
|
250
|
+
column: TaskColumn,
|
|
251
|
+
columnAt: z.iso.datetime(),
|
|
252
|
+
columnBy: NodePerson,
|
|
253
|
+
assignee: NodePerson,
|
|
254
|
+
startsAt: z.iso.datetime().nullable(),
|
|
255
|
+
endsAt: z.iso.datetime().nullable(),
|
|
256
|
+
labels: z.array(BoardLabel),
|
|
257
|
+
parentTaskId: NodeId.nullable(),
|
|
258
|
+
position: z.string(),
|
|
259
|
+
// The crumbs: the board with what board it is (its icon, #385), then every task above it, top down.
|
|
260
|
+
path: z.strictObject({
|
|
261
|
+
board: z.strictObject({ boardId: NodeId, name: z.string(), boardKind: BoardShownKind }),
|
|
262
|
+
tasks: z.array(z.strictObject({ taskId: NodeId, title: z.string() })),
|
|
263
|
+
}),
|
|
264
|
+
// The direct subtasks, and how many of them are done.
|
|
265
|
+
subtasks: z.strictObject({
|
|
266
|
+
items: z.array(TaskRef),
|
|
267
|
+
done: z.number().int(),
|
|
268
|
+
total: z.number().int(),
|
|
269
|
+
}),
|
|
270
|
+
dependencies: z.array(TaskRef),
|
|
271
|
+
ready: z.boolean(),
|
|
272
|
+
images: z.array(TaskImage),
|
|
273
|
+
rights: z.strictObject({ write: z.boolean() }),
|
|
274
|
+
// The task waits (#377, E77): its assignee lacks something, a right above all, and asked in the
|
|
275
|
+
// chat. Shown in place of the column; null while it does not wait.
|
|
276
|
+
waiting: z.strictObject({ since: z.iso.datetime(), by: NodePerson }).nullable(),
|
|
277
|
+
// A ticket of the validation board (#47): the node it validates with its path, and every move,
|
|
278
|
+
// newest first. Both null for every other task.
|
|
279
|
+
subject: TicketSubject.nullable(),
|
|
280
|
+
history: z.array(TicketMove).nullable(),
|
|
281
|
+
createdBy: NodePerson,
|
|
282
|
+
rev: z.number().int(),
|
|
283
|
+
archivedAt: z.iso.datetime().nullable(),
|
|
284
|
+
createdAt: z.iso.datetime(),
|
|
285
|
+
updatedAt: z.iso.datetime(),
|
|
286
|
+
// Over MCP only (E87, #354): the instruction of the task's board, of its run for a run's task;
|
|
287
|
+
// null without one.
|
|
288
|
+
instruction: z.string().nullable().optional(),
|
|
289
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ColumnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
3
|
+
export type ColumnId = z.infer<typeof ColumnId>;
|
|
4
|
+
export declare const columnTypes: readonly ["backlog", "open", "progress", "done", "discarded", "blocked", "archive"];
|
|
5
|
+
export declare const ColumnType: z.ZodEnum<{
|
|
6
|
+
backlog: "backlog";
|
|
7
|
+
open: "open";
|
|
8
|
+
progress: "progress";
|
|
9
|
+
done: "done";
|
|
10
|
+
discarded: "discarded";
|
|
11
|
+
blocked: "blocked";
|
|
12
|
+
archive: "archive";
|
|
13
|
+
}>;
|
|
14
|
+
export type ColumnType = z.infer<typeof ColumnType>;
|
|
15
|
+
export declare const TaskColumn: z.ZodObject<{
|
|
16
|
+
columnId: z.ZodTemplateLiteral<`column_${string}`>;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
backlog: "backlog";
|
|
20
|
+
open: "open";
|
|
21
|
+
progress: "progress";
|
|
22
|
+
done: "done";
|
|
23
|
+
discarded: "discarded";
|
|
24
|
+
blocked: "blocked";
|
|
25
|
+
archive: "archive";
|
|
26
|
+
}>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type TaskColumn = z.infer<typeof TaskColumn>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// A board's columns as other domains name them (#42, #47): the id, the seven types and a column as a
|
|
3
|
+
// task or a node's validation shows it. A base file of its own, so `nodes.ts` can carry a node's
|
|
4
|
+
// validation status without importing `boards.ts`, which imports `nodes.ts` (trap C009).
|
|
5
|
+
// A ULID in Crockford base32, as `ids.ts` takes it.
|
|
6
|
+
const ulid = z.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/);
|
|
7
|
+
// `column_…` is no word of the grammar (#42): a row of a board, not a resource.
|
|
8
|
+
export const ColumnId = z
|
|
9
|
+
.templateLiteral([z.literal("column"), z.literal("_"), ulid])
|
|
10
|
+
.describe("A column of this board, `column_…`, as intelligence_board_get returned it.");
|
|
11
|
+
// The seven types of a column (E40, E43), each shown as an icon.
|
|
12
|
+
export const columnTypes = [
|
|
13
|
+
"backlog",
|
|
14
|
+
"open",
|
|
15
|
+
"progress",
|
|
16
|
+
"done",
|
|
17
|
+
"discarded",
|
|
18
|
+
"blocked",
|
|
19
|
+
"archive",
|
|
20
|
+
];
|
|
21
|
+
export const ColumnType = z
|
|
22
|
+
.enum(columnTypes)
|
|
23
|
+
.describe("What a column means: backlog (not ready yet), open (waiting), progress (being worked on), done (closed with yes), discarded (closed with no: rejected or lost, no error), blocked (an error), archive (the shelf at the bottom of every board, hidden by default).");
|
|
24
|
+
export const TaskColumn = z.strictObject({
|
|
25
|
+
columnId: ColumnId,
|
|
26
|
+
name: z.string(),
|
|
27
|
+
type: ColumnType,
|
|
28
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ConnectionId: z.ZodTemplateLiteral<`connection_${string}`>;
|
|
3
|
+
export declare const ConnectionState: z.ZodEnum<{
|
|
4
|
+
expired: "expired";
|
|
5
|
+
running: "running";
|
|
6
|
+
not_connected: "not_connected";
|
|
7
|
+
unreachable: "unreachable";
|
|
8
|
+
}>;
|
|
9
|
+
export type ConnectionState = z.infer<typeof ConnectionState>;
|
|
10
|
+
export declare const ConnectionListInput: z.ZodObject<{
|
|
11
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
12
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type ConnectionListInput = z.infer<typeof ConnectionListInput>;
|
|
15
|
+
export declare const ConnectionGetInput: z.ZodObject<{
|
|
16
|
+
connectionId: z.ZodTemplateLiteral<`connection_${string}`>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export type ConnectionGetInput = z.infer<typeof ConnectionGetInput>;
|
|
19
|
+
export declare const ConnectionCreateInput: z.ZodObject<{
|
|
20
|
+
connectorId: z.ZodString;
|
|
21
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
22
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type ConnectionCreateInput = z.infer<typeof ConnectionCreateInput>;
|
|
25
|
+
export declare const ConnectionUpdateInput: z.ZodObject<{
|
|
26
|
+
connectionId: z.ZodTemplateLiteral<`connection_${string}`>;
|
|
27
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type ConnectionUpdateInput = z.infer<typeof ConnectionUpdateInput>;
|
|
31
|
+
export declare const ConnectionTestInput: z.ZodObject<{
|
|
32
|
+
connectionId: z.ZodTemplateLiteral<`connection_${string}`>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type ConnectionTestInput = z.infer<typeof ConnectionTestInput>;
|
|
35
|
+
export declare const ConnectionRevokeInput: z.ZodObject<{
|
|
36
|
+
connectionId: z.ZodTemplateLiteral<`connection_${string}`>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type ConnectionRevokeInput = z.infer<typeof ConnectionRevokeInput>;
|
|
39
|
+
export declare const ConnectionCredential: z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
setAt: z.ZodISODateTime;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export type ConnectionCredential = z.infer<typeof ConnectionCredential>;
|
|
44
|
+
export declare const Connection: z.ZodObject<{
|
|
45
|
+
connectorId: z.ZodString;
|
|
46
|
+
connectionId: z.ZodNullable<z.ZodTemplateLiteral<`connection_${string}`>>;
|
|
47
|
+
enabled: z.ZodBoolean;
|
|
48
|
+
configured: z.ZodBoolean;
|
|
49
|
+
state: z.ZodEnum<{
|
|
50
|
+
expired: "expired";
|
|
51
|
+
running: "running";
|
|
52
|
+
not_connected: "not_connected";
|
|
53
|
+
unreachable: "unreachable";
|
|
54
|
+
}>;
|
|
55
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
56
|
+
expiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
57
|
+
expiredStatus: z.ZodNullable<z.ZodNumber>;
|
|
58
|
+
failedCalls: z.ZodNumber;
|
|
59
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
setAt: z.ZodISODateTime;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
export type Connection = z.infer<typeof Connection>;
|
|
65
|
+
export declare const ConnectionDetail: z.ZodObject<{
|
|
66
|
+
connectorId: z.ZodString;
|
|
67
|
+
connectionId: z.ZodNullable<z.ZodTemplateLiteral<`connection_${string}`>>;
|
|
68
|
+
enabled: z.ZodBoolean;
|
|
69
|
+
configured: z.ZodBoolean;
|
|
70
|
+
state: z.ZodEnum<{
|
|
71
|
+
expired: "expired";
|
|
72
|
+
running: "running";
|
|
73
|
+
not_connected: "not_connected";
|
|
74
|
+
unreachable: "unreachable";
|
|
75
|
+
}>;
|
|
76
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
77
|
+
expiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
78
|
+
expiredStatus: z.ZodNullable<z.ZodNumber>;
|
|
79
|
+
failedCalls: z.ZodNumber;
|
|
80
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
setAt: z.ZodISODateTime;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
settings: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type ConnectionDetail = z.infer<typeof ConnectionDetail>;
|
|
87
|
+
export declare const ConnectionList: z.ZodObject<{
|
|
88
|
+
items: z.ZodArray<z.ZodObject<{
|
|
89
|
+
connectorId: z.ZodString;
|
|
90
|
+
connectionId: z.ZodNullable<z.ZodTemplateLiteral<`connection_${string}`>>;
|
|
91
|
+
enabled: z.ZodBoolean;
|
|
92
|
+
configured: z.ZodBoolean;
|
|
93
|
+
state: z.ZodEnum<{
|
|
94
|
+
expired: "expired";
|
|
95
|
+
running: "running";
|
|
96
|
+
not_connected: "not_connected";
|
|
97
|
+
unreachable: "unreachable";
|
|
98
|
+
}>;
|
|
99
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
100
|
+
expiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
101
|
+
expiredStatus: z.ZodNullable<z.ZodNumber>;
|
|
102
|
+
failedCalls: z.ZodNumber;
|
|
103
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
setAt: z.ZodISODateTime;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
export type ConnectionList = z.infer<typeof ConnectionList>;
|
|
111
|
+
export declare const ConnectionTestResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
112
|
+
ok: z.ZodLiteral<true>;
|
|
113
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
115
|
+
ok: z.ZodLiteral<false>;
|
|
116
|
+
error: z.ZodString;
|
|
117
|
+
}, z.core.$strict>], "ok">;
|
|
118
|
+
export type ConnectionTestResult = z.infer<typeof ConnectionTestResult>;
|
|
119
|
+
export declare const ConnectionTested: z.ZodObject<{
|
|
120
|
+
connection: z.ZodObject<{
|
|
121
|
+
connectorId: z.ZodString;
|
|
122
|
+
connectionId: z.ZodNullable<z.ZodTemplateLiteral<`connection_${string}`>>;
|
|
123
|
+
enabled: z.ZodBoolean;
|
|
124
|
+
configured: z.ZodBoolean;
|
|
125
|
+
state: z.ZodEnum<{
|
|
126
|
+
expired: "expired";
|
|
127
|
+
running: "running";
|
|
128
|
+
not_connected: "not_connected";
|
|
129
|
+
unreachable: "unreachable";
|
|
130
|
+
}>;
|
|
131
|
+
checkedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
132
|
+
expiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
133
|
+
expiredStatus: z.ZodNullable<z.ZodNumber>;
|
|
134
|
+
failedCalls: z.ZodNumber;
|
|
135
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
136
|
+
name: z.ZodString;
|
|
137
|
+
setAt: z.ZodISODateTime;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
settings: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
test: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
142
|
+
ok: z.ZodLiteral<true>;
|
|
143
|
+
detail: z.ZodNullable<z.ZodString>;
|
|
144
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
145
|
+
ok: z.ZodLiteral<false>;
|
|
146
|
+
error: z.ZodString;
|
|
147
|
+
}, z.core.$strict>], "ok">;
|
|
148
|
+
}, z.core.$strict>;
|
|
149
|
+
export type ConnectionTested = z.infer<typeof ConnectionTested>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ConnectorId } from "../connectors/connectors.js";
|
|
3
|
+
import { idSchema } from "../ids/ids.js";
|
|
4
|
+
import { Limit } from "../list-input.js";
|
|
5
|
+
// The vault of the connectors (#6): the inputs of `connectors_connection_*` and the answers the UI
|
|
6
|
+
// (#7) reads. A secret goes in and never comes out; an answer names a secret's field, never its value.
|
|
7
|
+
//
|
|
8
|
+
// ⚠️ No field of an answer is called `secrets`, `key` or `secret`: `/mcp` strikes every value under such
|
|
9
|
+
// a key (`redactSecrets` in `shared`), so UI and AI would read different answers. The set secrets are
|
|
10
|
+
// `credentials`, each with `name` and `setAt`.
|
|
11
|
+
export const ConnectionId = idSchema("connection");
|
|
12
|
+
// `not_connected`: never connected, or revoked. `running`: the last test succeeded. `unreachable`: the
|
|
13
|
+
// last test failed for another reason than the credential. `expired`: the provider refused the
|
|
14
|
+
// credential with 401 or 403.
|
|
15
|
+
export const ConnectionState = z.enum(["not_connected", "running", "unreachable", "expired"]);
|
|
16
|
+
// A field's value as the form sends it. Long enough for a private key in PEM; an empty value counts
|
|
17
|
+
// as missing, so it clears an optional field.
|
|
18
|
+
const FieldValues = z.record(z.string().min(1).max(100), z.string().max(20_000));
|
|
19
|
+
export const ConnectionListInput = z.strictObject({
|
|
20
|
+
cursor: ConnectorId.optional(),
|
|
21
|
+
limit: Limit.optional(),
|
|
22
|
+
});
|
|
23
|
+
export const ConnectionGetInput = z.strictObject({ connectionId: ConnectionId });
|
|
24
|
+
export const ConnectionCreateInput = z.strictObject({
|
|
25
|
+
connectorId: ConnectorId,
|
|
26
|
+
settings: FieldValues.optional(),
|
|
27
|
+
secrets: FieldValues.optional(),
|
|
28
|
+
});
|
|
29
|
+
// Settings: the given ones replace theirs, the rest stay. Secrets: only the given ones are replaced.
|
|
30
|
+
export const ConnectionUpdateInput = z.strictObject({
|
|
31
|
+
connectionId: ConnectionId,
|
|
32
|
+
settings: FieldValues.optional(),
|
|
33
|
+
secrets: FieldValues.optional(),
|
|
34
|
+
});
|
|
35
|
+
export const ConnectionTestInput = z.strictObject({ connectionId: ConnectionId });
|
|
36
|
+
export const ConnectionRevokeInput = z.strictObject({ connectionId: ConnectionId });
|
|
37
|
+
// A set secret: its field and when it was set, never its value.
|
|
38
|
+
export const ConnectionCredential = z.strictObject({
|
|
39
|
+
name: z.string(),
|
|
40
|
+
setAt: z.iso.datetime(),
|
|
41
|
+
});
|
|
42
|
+
// One connector's connection as the list shows it, also for a connector never connected.
|
|
43
|
+
export const Connection = z.strictObject({
|
|
44
|
+
connectorId: ConnectorId,
|
|
45
|
+
// Null while the connector was never connected.
|
|
46
|
+
connectionId: ConnectionId.nullable(),
|
|
47
|
+
// The connector stands in the installation's `colab.config.ts`; false for a row whose connector
|
|
48
|
+
// left the list.
|
|
49
|
+
enabled: z.boolean(),
|
|
50
|
+
// Settings and secrets are complete and valid.
|
|
51
|
+
configured: z.boolean(),
|
|
52
|
+
state: ConnectionState,
|
|
53
|
+
checkedAt: z.iso.datetime().nullable(),
|
|
54
|
+
// Since when the provider refuses the credential, and with which status.
|
|
55
|
+
expiredAt: z.iso.datetime().nullable(),
|
|
56
|
+
expiredStatus: z.number().int().nullable(),
|
|
57
|
+
failedCalls: z.number().int(),
|
|
58
|
+
credentials: z.array(ConnectionCredential),
|
|
59
|
+
});
|
|
60
|
+
export const ConnectionDetail = Connection.extend({ settings: z.record(z.string(), z.string()) });
|
|
61
|
+
export const ConnectionList = z.strictObject({
|
|
62
|
+
items: z.array(Connection),
|
|
63
|
+
nextCursor: ConnectorId.nullable(),
|
|
64
|
+
});
|
|
65
|
+
// The connector's own test against its provider; an error is struck of every secret.
|
|
66
|
+
export const ConnectionTestResult = z.discriminatedUnion("ok", [
|
|
67
|
+
z.strictObject({ ok: z.literal(true), detail: z.string().nullable() }),
|
|
68
|
+
z.strictObject({ ok: z.literal(false), error: z.string() }),
|
|
69
|
+
]);
|
|
70
|
+
// The answer of create, update and test: the connection after the test, and the test.
|
|
71
|
+
export const ConnectionTested = z.strictObject({
|
|
72
|
+
connection: ConnectionDetail,
|
|
73
|
+
test: ConnectionTestResult,
|
|
74
|
+
});
|