@anchrd/colab-sdk 0.1.10 → 0.1.12
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 +64 -11
- package/dist/actions/actions.js +22 -7
- package/dist/boards/boards.d.ts +321 -10
- package/dist/boards/boards.js +111 -13
- package/dist/card-kinds/card-kinds.d.ts +265 -0
- package/dist/card-kinds/card-kinds.js +153 -0
- package/dist/error/error.d.ts +6 -4
- package/dist/error/error.js +4 -3
- package/dist/gadgets/gadgets.d.ts +532 -0
- package/dist/gadgets/gadgets.js +329 -0
- package/dist/grammar/grammar.d.ts +1 -1
- package/dist/grammar/grammar.js +8 -1
- package/dist/nodes/nodes.d.ts +10 -10
- package/dist/nodes/nodes.js +4 -3
- package/dist/operators/operators.d.ts +4 -4
- package/dist/operators/operators.js +2 -2
- package/dist/runs/runs.d.ts +41 -70
- package/dist/runs/runs.js +14 -73
- package/dist/schedule/schedule.d.ts +36 -0
- package/dist/schedule/schedule.js +93 -0
- package/dist/sdk.d.ts +8 -6
- package/dist/sdk.js +8 -6
- package/dist/tables/tables.d.ts +8 -0
- package/dist/tables/tables.js +29 -4
- package/dist/users/users.js +2 -2
- package/dist/validation/validation.d.ts +2 -55
- package/dist/validation/validation.js +3 -22
- package/dist/versions/versions.d.ts +233 -1
- package/dist/versions/versions.js +57 -10
- package/package.json +1 -1
- package/dist/dashboards/dashboards.d.ts +0 -221
- package/dist/dashboards/dashboards.js +0 -520
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CallId } from "../connectors/connectors.js";
|
|
3
|
+
import { ErrorCode } from "../error/error.js";
|
|
4
|
+
import { Limit } from "../list-input.js";
|
|
5
|
+
import { NodeId, NodePath, NodePerson } from "../nodes/nodes.js";
|
|
6
|
+
import { IdempotencyKey, Rev } from "../primitives/primitives.js";
|
|
7
|
+
import { UserId } from "../users/users.js";
|
|
8
|
+
// Gadgets (#642, E118, Nodes › Gadget): a small application an AI builds and Colab runs. Its files
|
|
9
|
+
// without a build step, every change into the draft, publishing as a version, and calling a function
|
|
10
|
+
// of its backend. The inputs of `intelligence_gadget_create`, `_get`, `_update`, `_publish` and
|
|
11
|
+
// `intelligence_gadget_call_create`, and their answers.
|
|
12
|
+
const GadgetId = NodeId.describe("The gadget's id, a `node_…` of kind gadget.");
|
|
13
|
+
// One entry of a gadget's log (#643), `call_…` like a connector's call (the resource `call`).
|
|
14
|
+
const GadgetCallId = CallId.describe("An entry of the gadget's log, `call_…`.");
|
|
15
|
+
// A file's path inside the gadget: `server.js`, `lib/format.js`, `tests/status.test.js`. Segments of
|
|
16
|
+
// letters, digits, `_`, `-` and `.`, none starting with a dot, so `..` and hidden files cannot exist
|
|
17
|
+
// and `.colab/` stays Colab's own (the runtime's harness lives there).
|
|
18
|
+
export const GadgetFilePath = z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(200)
|
|
22
|
+
.regex(/^[A-Za-z0-9_-][A-Za-z0-9_.-]*(\/[A-Za-z0-9_-][A-Za-z0-9_.-]*)*$/)
|
|
23
|
+
.describe("A path inside the gadget such as server.js or lib/format.js: segments of letters, digits, _, - and ., separated by /, none starting with a dot.");
|
|
24
|
+
// The limits of a gadget's files: every version is stored as one text of at most 1 MB.
|
|
25
|
+
export const gadgetLimits = { files: 200, bytes: 1024 * 1024 };
|
|
26
|
+
// The manifest `gadget.json` (E118): what the AI and the UI learn about the gadget's functions. Strict
|
|
27
|
+
// although it is a file and not a tool's input: a misspelt key in it must be refused, not dropped.
|
|
28
|
+
export const GadgetFunctionName = z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(64)
|
|
32
|
+
.regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/)
|
|
33
|
+
.describe("The function's name, exported by server.js under the same name.");
|
|
34
|
+
// One function of the manifest, under its name in `functions`.
|
|
35
|
+
export const GadgetFunction = z.strictObject({
|
|
36
|
+
description: z.string().max(2000).describe("What the function does, for the AI that calls it."),
|
|
37
|
+
input: z
|
|
38
|
+
.record(z.string(), z.unknown())
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("A JSON Schema of the function's input, an object; Colab checks every call against it. Leaving it out takes any object."),
|
|
41
|
+
});
|
|
42
|
+
export const GadgetManifest = z.strictObject({
|
|
43
|
+
name: z.string().min(1).max(200).describe("The gadget's name in the manifest."),
|
|
44
|
+
description: z.string().max(2000).optional().describe("What the gadget is for."),
|
|
45
|
+
functions: z
|
|
46
|
+
.record(GadgetFunctionName, GadgetFunction)
|
|
47
|
+
.describe("The functions server.js exports, each under its name."),
|
|
48
|
+
});
|
|
49
|
+
// Which state of the gadget: the live version, the draft, or a published version by its number.
|
|
50
|
+
// Over REST the query string carries text, so digits become the number here.
|
|
51
|
+
export const GadgetVersionRef = z.preprocess((value) => (typeof value === "string" && /^[1-9][0-9]{0,8}$/.test(value) ? Number(value) : value), z.union([z.enum(["live", "draft"]), z.number().int().min(1)]));
|
|
52
|
+
// Who answers for errors and red tests, and how far they may go (Nodes › Gadget › Einstellungen):
|
|
53
|
+
// only report, repair as a draft (the default), or repair and publish.
|
|
54
|
+
export const GadgetLevel = z.enum(["report", "draft", "publish"]);
|
|
55
|
+
export const gadgetLogDays = [7, 14, 30];
|
|
56
|
+
const LogDays = z
|
|
57
|
+
.union([z.literal(7), z.literal(14), z.literal(30)])
|
|
58
|
+
.describe("How many days the log keeps a call: 7, 14 or 30.");
|
|
59
|
+
const FileContent = z.string().describe("The file's whole text.");
|
|
60
|
+
export const GadgetCreateInput = z.strictObject({
|
|
61
|
+
parentId: NodeId.describe("The folder to create the gadget in, one you can write to."),
|
|
62
|
+
name: z
|
|
63
|
+
.string()
|
|
64
|
+
.max(200)
|
|
65
|
+
.describe("The name as people read it. A name that starts with a dot hides it from listings."),
|
|
66
|
+
files: z
|
|
67
|
+
.record(GadgetFilePath, FileContent)
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("The gadget's first files by path, such as gadget.json, server.js, client.js and tests/*.test.js. They become its draft; nothing is live until it is published. Leaving it out creates an empty gadget."),
|
|
70
|
+
idempotencyKey: IdempotencyKey,
|
|
71
|
+
});
|
|
72
|
+
// `include` over REST is one comma-separated value (`?include=files`): a query string carries text.
|
|
73
|
+
const GadgetInclude = z.enum(["files"]);
|
|
74
|
+
export const GadgetGetInput = z.strictObject({
|
|
75
|
+
gadgetId: GadgetId,
|
|
76
|
+
version: GadgetVersionRef.optional().describe("Which state to read: live (the default), draft (only with the right to change it) or the number of a published version."),
|
|
77
|
+
include: z
|
|
78
|
+
.preprocess((value) => (typeof value === "string" ? value.split(",") : value), z.array(GadgetInclude).min(1).max(1))
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("files: answer the text of every file of that state, not only their paths."),
|
|
81
|
+
});
|
|
82
|
+
const GadgetSettingsInput = z.strictObject({
|
|
83
|
+
responsibleId: UserId.nullable()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("The Operator or person who gets every new error and red test as an Action; null for nobody, then the publisher gets a hint."),
|
|
86
|
+
level: GadgetLevel.optional().describe("How far the responsible goes: report, draft (repair as a draft, the default) or publish (repair and publish, only with every test green and no new rights)."),
|
|
87
|
+
logDays: LogDays.optional(),
|
|
88
|
+
});
|
|
89
|
+
export const GadgetUpdateInput = z.strictObject({
|
|
90
|
+
gadgetId: GadgetId,
|
|
91
|
+
files: z
|
|
92
|
+
.record(GadgetFilePath, FileContent.nullable())
|
|
93
|
+
.optional()
|
|
94
|
+
.describe("Files to write into the draft by path, each with its whole new text; null removes a file. Files you leave out stay as they are. Without a draft, the draft starts from the live version."),
|
|
95
|
+
settings: GadgetSettingsInput.optional().describe("The gadget's settings; only the fields you send change. They apply at once, not through the draft."),
|
|
96
|
+
fromVersion: z
|
|
97
|
+
.number()
|
|
98
|
+
.int()
|
|
99
|
+
.min(1)
|
|
100
|
+
.optional()
|
|
101
|
+
.describe("Restore: the draft becomes the files of this published version; it goes live only when published."),
|
|
102
|
+
discard: z
|
|
103
|
+
.literal(true)
|
|
104
|
+
.optional()
|
|
105
|
+
.describe("Throw the draft away; the live version stays as it is."),
|
|
106
|
+
rev: Rev,
|
|
107
|
+
});
|
|
108
|
+
export const GadgetPublishInput = z.strictObject({
|
|
109
|
+
gadgetId: GadgetId,
|
|
110
|
+
force: z
|
|
111
|
+
.literal(true)
|
|
112
|
+
.optional()
|
|
113
|
+
.describe("Publish although tests fail. Never for a machine: an Operator publishes only with every test green."),
|
|
114
|
+
rev: Rev,
|
|
115
|
+
});
|
|
116
|
+
export const GadgetTestInput = z.strictObject({
|
|
117
|
+
gadgetId: GadgetId,
|
|
118
|
+
version: z
|
|
119
|
+
.enum(["live", "draft"])
|
|
120
|
+
.optional()
|
|
121
|
+
.describe("Which state to test: draft (the default when there is one) or live. Tests run with your own rights against a storage of their own, never live's."),
|
|
122
|
+
});
|
|
123
|
+
// The log's filters (#643, Nodes › Gadget › Konsole › Log).
|
|
124
|
+
export const GadgetCallStatus = z.enum(["succeeded", "failed"]);
|
|
125
|
+
export const GadgetCallListInput = z.strictObject({
|
|
126
|
+
gadgetId: GadgetId,
|
|
127
|
+
status: GadgetCallStatus.optional().describe("Only calls that succeeded, or only those that failed. Leaving it out gives both."),
|
|
128
|
+
version: GadgetVersionRef.optional().describe("Only the calls of one state: live (the version live now), draft, or a published version's number. Leaving it out gives every state."),
|
|
129
|
+
function: GadgetFunctionName.optional().describe("Only the calls of this function. The interface opened in the browser has no function."),
|
|
130
|
+
since: z.iso
|
|
131
|
+
.datetime()
|
|
132
|
+
.optional()
|
|
133
|
+
.describe("Only calls from this moment on, ISO 8601. The log keeps 7, 14 or 30 days."),
|
|
134
|
+
query: z
|
|
135
|
+
.string()
|
|
136
|
+
.min(1)
|
|
137
|
+
.max(200)
|
|
138
|
+
.optional()
|
|
139
|
+
.describe("Words in the function's name, the error message or the console output."),
|
|
140
|
+
cursor: z
|
|
141
|
+
.string()
|
|
142
|
+
.max(200)
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("The nextCursor of the previous page, unchanged. Leaving it out starts with the newest."),
|
|
145
|
+
limit: Limit.optional().describe("How many calls one page holds, 1 to 100. Leaving it out gives 50."),
|
|
146
|
+
});
|
|
147
|
+
export const GadgetCallGetInput = z.strictObject({
|
|
148
|
+
gadgetId: GadgetId,
|
|
149
|
+
callId: GadgetCallId,
|
|
150
|
+
});
|
|
151
|
+
// What the interface in the browser sends into the log (#643): the console and the uncaught errors of
|
|
152
|
+
// one opening of the gadget. Not a tool, a door of the UI (`POST /api/intelligence/gadgets/:gadgetId/log`).
|
|
153
|
+
const ClientConsoleLine = z.strictObject({
|
|
154
|
+
level: z.enum(["log", "info", "warn", "error", "debug"]),
|
|
155
|
+
text: z.string().max(16_384),
|
|
156
|
+
});
|
|
157
|
+
const ClientError = z.strictObject({
|
|
158
|
+
message: z.string().max(4096),
|
|
159
|
+
stack: z.string().max(16_384).optional(),
|
|
160
|
+
});
|
|
161
|
+
export const GadgetClientLog = z.strictObject({
|
|
162
|
+
// Leaving it out opens a new entry ("Geöffnet"); with it, the lines join that entry, which only
|
|
163
|
+
// its own caller may add to.
|
|
164
|
+
callId: GadgetCallId.optional(),
|
|
165
|
+
version: GadgetVersionRef.optional(),
|
|
166
|
+
console: z.array(ClientConsoleLine).max(200).optional(),
|
|
167
|
+
errors: z.array(ClientError).max(20).optional(),
|
|
168
|
+
});
|
|
169
|
+
export const GadgetCallCreateInput = z.strictObject({
|
|
170
|
+
gadgetId: GadgetId,
|
|
171
|
+
function: GadgetFunctionName.describe("The function to call, one of the manifest's functions of that version."),
|
|
172
|
+
input: z
|
|
173
|
+
.record(z.string(), z.unknown())
|
|
174
|
+
.optional()
|
|
175
|
+
.describe("The function's input, an object matching its schema in gadget.json. Leaving it out sends {}."),
|
|
176
|
+
version: GadgetVersionRef.optional().describe("Which state to run: live (the default, with the rights of whoever published it; anybody who reads the gadget may call it), draft or the number of a published version (both with your own rights, and only with the right to change the gadget)."),
|
|
177
|
+
});
|
|
178
|
+
// One file of a state: its path and size, and its text only with `include: files`.
|
|
179
|
+
export const GadgetFile = z.object({
|
|
180
|
+
path: z.string(),
|
|
181
|
+
size: z.number().int(),
|
|
182
|
+
content: z.string().optional(),
|
|
183
|
+
});
|
|
184
|
+
export const GadgetChange = z.object({
|
|
185
|
+
path: z.string(),
|
|
186
|
+
change: z.enum(["added", "changed", "removed"]),
|
|
187
|
+
});
|
|
188
|
+
export const GadgetSettings = z.object({
|
|
189
|
+
responsible: NodePerson.nullable(),
|
|
190
|
+
level: GadgetLevel,
|
|
191
|
+
logDays: z.number().int(),
|
|
192
|
+
});
|
|
193
|
+
// One test of a run (#643): where it stands (its file and the names of the describes around it), how
|
|
194
|
+
// it ended, and for a failure the message and the place in the test file.
|
|
195
|
+
export const GadgetTestResult = z.object({
|
|
196
|
+
file: z.string(),
|
|
197
|
+
path: z.array(z.string()),
|
|
198
|
+
name: z.string(),
|
|
199
|
+
status: z.enum(["passed", "failed"]),
|
|
200
|
+
durationMs: z.number().int(),
|
|
201
|
+
message: z.string().nullable(),
|
|
202
|
+
location: z
|
|
203
|
+
.object({ file: z.string(), line: z.number().int(), column: z.number().int() })
|
|
204
|
+
.nullable(),
|
|
205
|
+
});
|
|
206
|
+
// A run of a gadget's tests (#643, Nodes › Gadget › Konsole › Tests).
|
|
207
|
+
export const GadgetTestRun = z.object({
|
|
208
|
+
// The state that was tested: a version's number or `draft`.
|
|
209
|
+
version: z.union([z.number().int(), z.literal("draft")]),
|
|
210
|
+
// True while that state stands as it was tested: the draft unchanged, the version still there.
|
|
211
|
+
current: z.boolean(),
|
|
212
|
+
status: z.enum(["passed", "failed"]),
|
|
213
|
+
passed: z.number().int(),
|
|
214
|
+
failed: z.number().int(),
|
|
215
|
+
at: z.iso.datetime(),
|
|
216
|
+
by: NodePerson,
|
|
217
|
+
durationMs: z.number().int(),
|
|
218
|
+
// The run itself broke: a test file did not load, or the run took too long.
|
|
219
|
+
error: z.object({ message: z.string(), stack: z.string().optional() }).nullable(),
|
|
220
|
+
tests: z.array(GadgetTestResult),
|
|
221
|
+
});
|
|
222
|
+
export const GadgetDetail = z.object({
|
|
223
|
+
gadgetId: GadgetId,
|
|
224
|
+
name: z.string(),
|
|
225
|
+
hidden: z.boolean(),
|
|
226
|
+
// Null at the top level of Shared, and where the caller cannot read the parent.
|
|
227
|
+
parentId: NodeId.nullable(),
|
|
228
|
+
path: NodePath,
|
|
229
|
+
// The state the files and the manifest below belong to: a version's number, `draft`, or null for
|
|
230
|
+
// a gadget that has no live version yet when live was asked for.
|
|
231
|
+
version: z.union([z.number().int(), z.literal("draft")]).nullable(),
|
|
232
|
+
// Null when that state has no gadget.json, or the draft's cannot be read.
|
|
233
|
+
manifest: GadgetManifest.nullable(),
|
|
234
|
+
files: z.array(GadgetFile),
|
|
235
|
+
live: z
|
|
236
|
+
.object({
|
|
237
|
+
version: z.number().int(),
|
|
238
|
+
publishedAt: z.iso.datetime(),
|
|
239
|
+
publishedBy: NodePerson,
|
|
240
|
+
})
|
|
241
|
+
.nullable(),
|
|
242
|
+
// Only for whoever may change the gadget; null without a draft and for a reader.
|
|
243
|
+
draft: z
|
|
244
|
+
.object({
|
|
245
|
+
updatedAt: z.iso.datetime(),
|
|
246
|
+
updatedBy: NodePerson,
|
|
247
|
+
changes: z.array(GadgetChange),
|
|
248
|
+
// The Colab tools the draft's backend names and the live one does not ("Keine neuen Rechte"),
|
|
249
|
+
// read from the text of its files: a name built at run time is not seen.
|
|
250
|
+
newTools: z.array(z.string()),
|
|
251
|
+
})
|
|
252
|
+
.nullable(),
|
|
253
|
+
// The last run of the tests (#643); null for a reader and before the first.
|
|
254
|
+
test: GadgetTestRun.nullable(),
|
|
255
|
+
// The live version over the last 7 days (#643): calls, errors (a connector's `unavailable` is
|
|
256
|
+
// none) and the last call. Null for a reader and without a live version.
|
|
257
|
+
usage: z
|
|
258
|
+
.object({
|
|
259
|
+
calls: z.number().int(),
|
|
260
|
+
errors: z.number().int(),
|
|
261
|
+
lastCallAt: z.iso.datetime().nullable(),
|
|
262
|
+
})
|
|
263
|
+
.nullable(),
|
|
264
|
+
// Only for whoever may change the gadget; null for a reader.
|
|
265
|
+
settings: GadgetSettings.nullable(),
|
|
266
|
+
rights: z.object({ write: z.boolean() }),
|
|
267
|
+
// The state the next save sends (E70).
|
|
268
|
+
rev: z.number().int(),
|
|
269
|
+
archivedAt: z.iso.datetime().nullable(),
|
|
270
|
+
});
|
|
271
|
+
// One use of the `colab` binding during a call: which tool, how long, and the error code it answered
|
|
272
|
+
// with (null when it answered).
|
|
273
|
+
export const GadgetToolUse = z.object({
|
|
274
|
+
name: z.string(),
|
|
275
|
+
durationMs: z.number().int(),
|
|
276
|
+
code: ErrorCode.nullable(),
|
|
277
|
+
});
|
|
278
|
+
export const GadgetConsoleLine = z.object({
|
|
279
|
+
level: z.enum(["log", "info", "warn", "error", "debug"]),
|
|
280
|
+
text: z.string(),
|
|
281
|
+
});
|
|
282
|
+
// One call of a function as one unit (#642): what it answered or how it failed, its console and the
|
|
283
|
+
// tools it used. The log of #643 stores exactly this.
|
|
284
|
+
export const GadgetCall = z.object({
|
|
285
|
+
// Its entry in the log (#643), for intelligence_gadget_call_get; null when the log could not be
|
|
286
|
+
// written (the call ran all the same).
|
|
287
|
+
callId: GadgetCallId.nullable(),
|
|
288
|
+
gadgetId: GadgetId,
|
|
289
|
+
function: z.string(),
|
|
290
|
+
version: z.union([z.number().int(), z.literal("draft")]),
|
|
291
|
+
status: z.enum(["succeeded", "failed"]),
|
|
292
|
+
// The function's answer as JSON; null when it failed or answered nothing.
|
|
293
|
+
output: z.unknown(),
|
|
294
|
+
error: z.object({ message: z.string(), stack: z.string().optional() }).nullable(),
|
|
295
|
+
durationMs: z.number().int(),
|
|
296
|
+
console: z.array(GadgetConsoleLine),
|
|
297
|
+
tools: z.array(GadgetToolUse),
|
|
298
|
+
});
|
|
299
|
+
// One entry of the log as the list shows it (#643): a call of a function on the server, or the
|
|
300
|
+
// interface opened in the browser (`function` null, "Geöffnet").
|
|
301
|
+
export const GadgetCallItem = z.object({
|
|
302
|
+
callId: GadgetCallId,
|
|
303
|
+
gadgetId: GadgetId,
|
|
304
|
+
at: z.iso.datetime(),
|
|
305
|
+
// Who called: the person or machine, never the publisher the live version runs as.
|
|
306
|
+
by: NodePerson,
|
|
307
|
+
origin: z.enum(["server", "client"]),
|
|
308
|
+
function: z.string().nullable(),
|
|
309
|
+
version: z.union([z.number().int(), z.literal("draft")]),
|
|
310
|
+
status: GadgetCallStatus,
|
|
311
|
+
// Failed because a connector answered `unavailable`: nothing the gadget can help, so it wakes
|
|
312
|
+
// nobody and counts as no error.
|
|
313
|
+
unavailable: z.boolean(),
|
|
314
|
+
// Null for the interface, which has no duration of its own.
|
|
315
|
+
durationMs: z.number().int().nullable(),
|
|
316
|
+
// The first error's message; the stack comes with intelligence_gadget_call_get.
|
|
317
|
+
message: z.string().nullable(),
|
|
318
|
+
});
|
|
319
|
+
export const GadgetCallList = z.object({
|
|
320
|
+
items: z.array(GadgetCallItem),
|
|
321
|
+
nextCursor: z.string().nullable(),
|
|
322
|
+
});
|
|
323
|
+
// One entry whole (#643): its errors with their stacks, its console (at most 64 kB, secrets struck)
|
|
324
|
+
// and the tools it used.
|
|
325
|
+
export const GadgetCallEntry = GadgetCallItem.extend({
|
|
326
|
+
errors: z.array(z.object({ message: z.string(), stack: z.string().optional() })),
|
|
327
|
+
console: z.array(GadgetConsoleLine),
|
|
328
|
+
tools: z.array(GadgetToolUse),
|
|
329
|
+
});
|
|
@@ -6,7 +6,7 @@ export declare const resources: {
|
|
|
6
6
|
readonly table: "tables";
|
|
7
7
|
readonly board: "boards";
|
|
8
8
|
readonly task: "tasks";
|
|
9
|
-
readonly
|
|
9
|
+
readonly gadget: "gadgets";
|
|
10
10
|
readonly file: "files";
|
|
11
11
|
readonly run: "runs";
|
|
12
12
|
readonly version: "versions";
|
package/dist/grammar/grammar.js
CHANGED
|
@@ -21,7 +21,8 @@ export const resources = {
|
|
|
21
21
|
table: "tables",
|
|
22
22
|
board: "boards",
|
|
23
23
|
task: "tasks",
|
|
24
|
-
|
|
24
|
+
// A small application an AI builds and Colab runs (#642, E118): `intelligence_gadget_*`.
|
|
25
|
+
gadget: "gadgets",
|
|
25
26
|
file: "files",
|
|
26
27
|
run: "runs",
|
|
27
28
|
version: "versions",
|
|
@@ -162,6 +163,12 @@ const routeExceptions = {
|
|
|
162
163
|
// (`intelligence / document`), and the answer is the set that fell (#24, trap P334). There is no
|
|
163
164
|
// one `grantId` to put into the path.
|
|
164
165
|
access_role_grant_revoke: { method: "POST", path: "/api/access/roles/:roleId/grants/revoke" },
|
|
166
|
+
// A change of MANY tasks of one board (#625, E114): each entry names its own `taskId` in the body,
|
|
167
|
+
// so there is no one `taskId` to put into the path.
|
|
168
|
+
intelligence_board_task_update: {
|
|
169
|
+
method: "PATCH",
|
|
170
|
+
path: "/api/intelligence/boards/:boardId/tasks",
|
|
171
|
+
},
|
|
165
172
|
};
|
|
166
173
|
// `access_user_invite` → `POST /api/access/users/:userId/invite`.
|
|
167
174
|
export function toolRoute(name) {
|
package/dist/nodes/nodes.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const SecretFields: {
|
|
|
7
7
|
secret: z.ZodOptional<z.ZodLiteral<true>>;
|
|
8
8
|
locked: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
};
|
|
10
|
-
export declare const nodeKinds: readonly ["folder", "document", "table", "board", "task", "
|
|
10
|
+
export declare const nodeKinds: readonly ["folder", "document", "table", "board", "task", "file", "gadget"];
|
|
11
11
|
export declare const NodeKind: z.ZodEnum<{
|
|
12
12
|
file: "file";
|
|
13
13
|
folder: "folder";
|
|
@@ -15,7 +15,7 @@ export declare const NodeKind: z.ZodEnum<{
|
|
|
15
15
|
table: "table";
|
|
16
16
|
board: "board";
|
|
17
17
|
task: "task";
|
|
18
|
-
|
|
18
|
+
gadget: "gadget";
|
|
19
19
|
}>;
|
|
20
20
|
export type NodeKind = z.infer<typeof NodeKind>;
|
|
21
21
|
export declare const responsibleKinds: readonly ["document", "table", "file"];
|
|
@@ -37,8 +37,8 @@ export declare const NodeSection: z.ZodEnum<{
|
|
|
37
37
|
export type NodeSection = z.infer<typeof NodeSection>;
|
|
38
38
|
export declare const NodeSort: z.ZodEnum<{
|
|
39
39
|
name: "name";
|
|
40
|
-
status: "status";
|
|
41
40
|
kind: "kind";
|
|
41
|
+
status: "status";
|
|
42
42
|
updated: "updated";
|
|
43
43
|
}>;
|
|
44
44
|
export type NodeSort = z.infer<typeof NodeSort>;
|
|
@@ -54,8 +54,8 @@ export declare const NodeListInput: z.ZodObject<{
|
|
|
54
54
|
includeHidden: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
|
|
55
55
|
sort: z.ZodOptional<z.ZodEnum<{
|
|
56
56
|
name: "name";
|
|
57
|
-
status: "status";
|
|
58
57
|
kind: "kind";
|
|
58
|
+
status: "status";
|
|
59
59
|
updated: "updated";
|
|
60
60
|
}>>;
|
|
61
61
|
foldersFirst: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
|
|
@@ -95,7 +95,7 @@ export declare const NodeListItem: z.ZodObject<{
|
|
|
95
95
|
table: "table";
|
|
96
96
|
board: "board";
|
|
97
97
|
task: "task";
|
|
98
|
-
|
|
98
|
+
gadget: "gadget";
|
|
99
99
|
}>;
|
|
100
100
|
name: z.ZodString;
|
|
101
101
|
hidden: z.ZodBoolean;
|
|
@@ -164,7 +164,7 @@ export declare const NodeList: z.ZodObject<{
|
|
|
164
164
|
table: "table";
|
|
165
165
|
board: "board";
|
|
166
166
|
task: "task";
|
|
167
|
-
|
|
167
|
+
gadget: "gadget";
|
|
168
168
|
}>;
|
|
169
169
|
name: z.ZodString;
|
|
170
170
|
hidden: z.ZodBoolean;
|
|
@@ -254,7 +254,7 @@ export declare const NodeHit: z.ZodObject<{
|
|
|
254
254
|
table: "table";
|
|
255
255
|
board: "board";
|
|
256
256
|
task: "task";
|
|
257
|
-
|
|
257
|
+
gadget: "gadget";
|
|
258
258
|
}>;
|
|
259
259
|
name: z.ZodString;
|
|
260
260
|
path: z.ZodObject<{
|
|
@@ -324,7 +324,7 @@ export declare const NodeSearch: z.ZodObject<{
|
|
|
324
324
|
table: "table";
|
|
325
325
|
board: "board";
|
|
326
326
|
task: "task";
|
|
327
|
-
|
|
327
|
+
gadget: "gadget";
|
|
328
328
|
}>;
|
|
329
329
|
name: z.ZodString;
|
|
330
330
|
path: z.ZodObject<{
|
|
@@ -384,8 +384,8 @@ export declare const NodeSearch: z.ZodObject<{
|
|
|
384
384
|
}, z.core.$strip>>;
|
|
385
385
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
386
386
|
semantic: z.ZodEnum<{
|
|
387
|
-
ok: "ok";
|
|
388
387
|
unavailable: "unavailable";
|
|
388
|
+
ok: "ok";
|
|
389
389
|
}>;
|
|
390
390
|
}, z.core.$strip>;
|
|
391
391
|
export type NodeSearch = z.infer<typeof NodeSearch>;
|
|
@@ -452,7 +452,7 @@ export declare const NodeDetail: z.ZodObject<{
|
|
|
452
452
|
table: "table";
|
|
453
453
|
board: "board";
|
|
454
454
|
task: "task";
|
|
455
|
-
|
|
455
|
+
gadget: "gadget";
|
|
456
456
|
}>;
|
|
457
457
|
name: z.ZodString;
|
|
458
458
|
hidden: z.ZodBoolean;
|
package/dist/nodes/nodes.js
CHANGED
|
@@ -32,8 +32,9 @@ export const nodeKinds = [
|
|
|
32
32
|
"table",
|
|
33
33
|
"board",
|
|
34
34
|
"task",
|
|
35
|
-
"dashboard",
|
|
36
35
|
"file",
|
|
36
|
+
// #642, E118: a small application with files, a draft and published versions.
|
|
37
|
+
"gadget",
|
|
37
38
|
];
|
|
38
39
|
export const NodeKind = z.enum(nodeKinds);
|
|
39
40
|
// Only these kinds have a responsible person (E32): the one who answers for the content's validity.
|
|
@@ -66,7 +67,7 @@ export const NodeQuery = z
|
|
|
66
67
|
.trim()
|
|
67
68
|
.min(2)
|
|
68
69
|
.max(200)
|
|
69
|
-
.describe("Search instead of listing: words to find in titles, the text of documents, tables, files and tasks
|
|
70
|
+
.describe("Search instead of listing: words to find in titles, the text of documents, tables, files and tasks, at least two characters; each word also finds longer words it begins (preis finds Preisliste). Only what you can read, never archived nodes or chats. parentId narrows it to that folder and everything below it, section to own, shared or users; leaving both out searches own and shared together. The hits come in the order of their rank, grouped by folder; sort, foldersFirst and includeHidden do not apply.");
|
|
70
71
|
export const NodeListInput = z.strictObject({
|
|
71
72
|
parentId: NodeId.optional().describe("List the children of this folder. Give exactly one of parentId, section and nodeIds; with query at most one of parentId and section."),
|
|
72
73
|
section: NodeSection.optional().describe("List a section of the tree instead of a folder: own (what lies in your own root folder), shared (the tops of everything others let you reach) or users (every other person's root folder, only for an admin in admin mode)."),
|
|
@@ -256,7 +257,7 @@ export const NodeDetail = z.object({
|
|
|
256
257
|
validation: NodeValidation.nullable(),
|
|
257
258
|
// Over MCP only: the INSTRUCTIONS of the node's folder, the node itself for a folder (#39).
|
|
258
259
|
instructions: Instructions.optional(),
|
|
259
|
-
// Over MCP only, for a board
|
|
260
|
+
// Over MCP only, for a board and a task (E87, #354): the board's own
|
|
260
261
|
// instruction, a task's board's (its run's copy for a run's task); null without one.
|
|
261
262
|
instruction: z.string().nullable().optional(),
|
|
262
263
|
// Only on a secret document or table (#357, E94): the password's id (for its settings), whether
|
|
@@ -614,8 +614,8 @@ export type OperatorList = z.infer<typeof OperatorList>;
|
|
|
614
614
|
export declare const OperatorRunId: z.ZodTemplateLiteral<`run_${string}`>;
|
|
615
615
|
export type OperatorRunId = z.infer<typeof OperatorRunId>;
|
|
616
616
|
export declare const OperatorRunStatus: z.ZodEnum<{
|
|
617
|
-
running: "running";
|
|
618
617
|
failed: "failed";
|
|
618
|
+
running: "running";
|
|
619
619
|
completed: "completed";
|
|
620
620
|
stopped: "stopped";
|
|
621
621
|
}>;
|
|
@@ -666,8 +666,8 @@ export declare const OperatorRun: z.ZodObject<{
|
|
|
666
666
|
retry: "retry";
|
|
667
667
|
}>;
|
|
668
668
|
status: z.ZodEnum<{
|
|
669
|
-
running: "running";
|
|
670
669
|
failed: "failed";
|
|
670
|
+
running: "running";
|
|
671
671
|
completed: "completed";
|
|
672
672
|
stopped: "stopped";
|
|
673
673
|
}>;
|
|
@@ -728,8 +728,8 @@ export declare const OperatorRunListInput: z.ZodObject<{
|
|
|
728
728
|
gemini: "gemini";
|
|
729
729
|
}>>;
|
|
730
730
|
status: z.ZodOptional<z.ZodEnum<{
|
|
731
|
-
running: "running";
|
|
732
731
|
failed: "failed";
|
|
732
|
+
running: "running";
|
|
733
733
|
completed: "completed";
|
|
734
734
|
stopped: "stopped";
|
|
735
735
|
}>>;
|
|
@@ -882,8 +882,8 @@ export declare const OperatorRunList: z.ZodObject<{
|
|
|
882
882
|
retry: "retry";
|
|
883
883
|
}>;
|
|
884
884
|
status: z.ZodEnum<{
|
|
885
|
-
running: "running";
|
|
886
885
|
failed: "failed";
|
|
886
|
+
running: "running";
|
|
887
887
|
completed: "completed";
|
|
888
888
|
stopped: "stopped";
|
|
889
889
|
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Schedule } from "../dashboards/dashboards.js";
|
|
3
2
|
import { idSchema } from "../ids/ids.js";
|
|
4
3
|
import { Limit } from "../list-input.js";
|
|
5
4
|
import { MachineId } from "../machines/machines.js";
|
|
6
5
|
import { RoleId } from "../roles/roles.js";
|
|
6
|
+
import { Schedule } from "../schedule/schedule.js";
|
|
7
7
|
import { OperatorProvider, UserId } from "../users/users.js";
|
|
8
8
|
// The package `operator` (#336, Einstellungen › Operator): the credentials at a provider ("Zugang",
|
|
9
9
|
// `operator_credential_*`) and the Operators themselves (`operator_machine_*`). An Operator is a machine
|
|
@@ -213,7 +213,7 @@ export const Subagents = z.strictObject({
|
|
|
213
213
|
max: z.int().min(1).max(10),
|
|
214
214
|
});
|
|
215
215
|
// When an Operator wakes (Springt an): once something changed, after `quietMinutes` without a further
|
|
216
|
-
// change; or at fixed times, with the schedule of processes
|
|
216
|
+
// change; or at fixed times, with the schedule of processes.
|
|
217
217
|
export const Trigger = z.discriminatedUnion("on", [
|
|
218
218
|
z.strictObject({ on: z.literal("change"), quietMinutes: z.int().min(0).max(1440) }),
|
|
219
219
|
z.strictObject({ on: z.literal("schedule"), schedule: Schedule }),
|