@anchrd/colab-sdk 0.1.29 → 0.1.31

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.
@@ -1,6 +1,9 @@
1
1
  import { z } from "zod";
2
+ import { GadgetFile, GadgetFilePath, GadgetTestRun } from "../gadgets/gadgets.js";
2
3
  import { idSchema } from "../ids/ids.js";
3
4
  import { Flag, Limit } from "../list-input.js";
5
+ import { NodePerson } from "../nodes/nodes.js";
6
+ import { Rev } from "../primitives/primitives.js";
4
7
  // The connectors' catalog and call log (#5): the inputs of `connectors_connector_list`,
5
8
  // `connectors_connector_get` and `connectors_call_list` and the answers the UI (#7) reads.
6
9
  // The id from a connector's code (`shopify`), never a ULID: one single word (E64).
@@ -10,7 +13,166 @@ export const ConnectorListInput = z.strictObject({
10
13
  cursor: ConnectorId.optional(),
11
14
  limit: Limit.optional(),
12
15
  });
13
- export const ConnectorGetInput = z.strictObject({ connectorId: ConnectorId });
16
+ // Which state of a built connector (#894): live, the draft, or a published version by its number.
17
+ // Over REST the query string carries text, so digits become the number here.
18
+ export const ConnectorVersionRef = 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)]));
19
+ const ConnectorInclude = z.enum(["files"]);
20
+ export const ConnectorGetInput = z.strictObject({
21
+ connectorId: ConnectorId,
22
+ version: ConnectorVersionRef.optional().describe("Which state to read: live (the default; the draft for a connector never published), draft (only with the right to change it) or the number of a published version."),
23
+ include: z
24
+ .preprocess((value) => (typeof value === "string" ? value.split(",") : value), z.array(ConnectorInclude).min(1).max(1))
25
+ .optional()
26
+ .describe("files: answer the text of every file of that state, not only their paths."),
27
+ });
28
+ // ---- A connector built in Colab (#894, E149, Codebase › Connector-Format) ----
29
+ // The name of a setting or a secret, `GITHUB_APP_ID`: what the connection form and the vault key by.
30
+ export const ConnectorFieldName = z
31
+ .string()
32
+ .regex(/^[A-Z][A-Z0-9_]{0,63}$/)
33
+ .describe("A field's name in capitals, such as SHOP_URL or API_TOKEN.");
34
+ // One field of the connection form in `connector.json`.
35
+ export const ConnectorManifestField = z.strictObject({
36
+ label: z.string().min(1).max(100),
37
+ help: z.string().max(1000).optional(),
38
+ placeholder: z.string().max(200).optional(),
39
+ // Without it the field is required; with a `default` it is optional anyway.
40
+ optional: z.boolean().optional(),
41
+ default: z.string().max(2000).optional(),
42
+ // Checked when a connection is saved, in Colab: a regular expression the value matches in full.
43
+ pattern: z.string().max(500).optional(),
44
+ minLength: z.number().int().min(1).max(10_000).optional(),
45
+ });
46
+ const HeaderName = z.string().regex(/^[A-Za-z0-9-]{1,64}$/);
47
+ const QueryName = z.string().regex(/^[A-Za-z0-9_.-]{1,64}$/);
48
+ // How the bridge sets the credential on every request (#894). The code never sees it.
49
+ export const ConnectorAccess = z.discriminatedUnion("kind", [
50
+ // `Authorization: Bearer <secret>`.
51
+ z.strictObject({ kind: z.literal("bearer"), secret: ConnectorFieldName }),
52
+ // The secret in a header of the provider's choosing, with an optional prefix (`Key `).
53
+ z.strictObject({
54
+ kind: z.literal("header"),
55
+ name: HeaderName,
56
+ prefix: z.string().max(40).optional(),
57
+ secret: ConnectorFieldName,
58
+ }),
59
+ // HTTP basic: the user name from a setting or a secret, the password a secret.
60
+ z.strictObject({
61
+ kind: z.literal("basic"),
62
+ username: ConnectorFieldName,
63
+ password: ConnectorFieldName,
64
+ }),
65
+ // The secret as a query parameter of every request.
66
+ z.strictObject({ kind: z.literal("query"), name: QueryName, secret: ConnectorFieldName }),
67
+ // A GitHub App: the bridge signs the JWT with GITHUB_PRIVATE_KEY and buys an installation token
68
+ // with GITHUB_APP_ID and GITHUB_INSTALLATION_ID; the base is api.github.com.
69
+ z.strictObject({ kind: z.literal("githubApp") }),
70
+ z.strictObject({ kind: z.literal("none") }),
71
+ ]);
72
+ export const connectorAccessKinds = [
73
+ "bearer",
74
+ "header",
75
+ "basic",
76
+ "query",
77
+ "githubApp",
78
+ "none",
79
+ ];
80
+ export const ConnectorManifestTool = z.strictObject({
81
+ description: z.string().min(1).max(4000),
82
+ writes: z.boolean(),
83
+ // A JSON Schema of an object without further keys (`additionalProperties: false`).
84
+ input: z.record(z.string(), z.unknown()),
85
+ });
86
+ // `connector.json`. Strict although it is a file: a misspelt key must be refused, not dropped.
87
+ export const ConnectorManifest = z.strictObject({
88
+ id: ConnectorId,
89
+ name: z.string().min(1).max(100),
90
+ category: z.string().min(1).max(50),
91
+ description: z.string().max(500),
92
+ // Every request's address starts here; `{{settings.NAME}}` puts in a setting.
93
+ base: z.string().min(1).max(500),
94
+ // The only hosts the bridge lets a request reach: a host name, or `{{settings.NAME}}` for the host
95
+ // of a setting's address.
96
+ hosts: z.array(z.string().min(1).max(300)).min(1).max(20),
97
+ access: ConnectorAccess,
98
+ settings: z.record(ConnectorFieldName, ConnectorManifestField).optional(),
99
+ secrets: z.record(ConnectorFieldName, ConnectorManifestField).optional(),
100
+ // Keyed by `<resource>-<action>` (`invoice-list`); the code exports `invoiceList`.
101
+ tools: z.record(z.string(), ConnectorManifestTool).optional(),
102
+ });
103
+ export const connectorManifestPath = "connector.json";
104
+ export const connectorCodePath = "connector.js";
105
+ // The person behind a draft or a version, as `access` names them.
106
+ const ConnectorPerson = NodePerson;
107
+ const ConnectorFiles = z
108
+ .record(GadgetFilePath, z.string().describe("The file's whole text."))
109
+ .describe("Files by path: connector.json, connector.js, tests/*.test.js, tests/fixtures/*, icon.svg.");
110
+ export const ConnectorCreateInput = z.strictObject({
111
+ connectorId: ConnectorId.describe("One lowercase word, the first word of every tool, such as lexoffice. It cannot change later."),
112
+ name: z.string().trim().min(1).max(100),
113
+ description: z.string().trim().max(500),
114
+ category: z.string().trim().min(1).max(50),
115
+ base: z
116
+ .string()
117
+ .trim()
118
+ .min(1)
119
+ .max(500)
120
+ .describe("The API's address, such as https://api.lexoffice.io/v1; only its host is reachable."),
121
+ access: z
122
+ .enum(connectorAccessKinds)
123
+ .describe("How the credential is sent: bearer, header, basic, query, githubApp or none."),
124
+ icon: z
125
+ .string()
126
+ .max(200_000)
127
+ .optional()
128
+ .describe("The logo as SVG text or as a data: URL of a PNG."),
129
+ files: ConnectorFiles.optional().describe("Further first files of the draft. A connector.json among them replaces the one made from the fields above."),
130
+ });
131
+ export const ConnectorUpdateInput = z.strictObject({
132
+ connectorId: ConnectorId,
133
+ files: z
134
+ .record(GadgetFilePath, z.string().nullable())
135
+ .optional()
136
+ .describe("Files to write into the draft by path, each with its whole new text; null removes a file. Files you leave out stay. Without a draft, the draft starts from the live version."),
137
+ fromVersion: z
138
+ .number()
139
+ .int()
140
+ .min(1)
141
+ .optional()
142
+ .describe("Restore: the draft becomes the files of this published version."),
143
+ discard: z.literal(true).optional().describe("Throw the draft away; live stays as it is."),
144
+ rev: Rev,
145
+ });
146
+ export const ConnectorTestInput = z.strictObject({
147
+ connectorId: ConnectorId,
148
+ version: z
149
+ .enum(["live", "draft"])
150
+ .optional()
151
+ .describe("Which state: draft (the default when there is one) or live."),
152
+ connection: z
153
+ .literal(true)
154
+ .optional()
155
+ .describe("Run the connection test test() against the provider, with the company's connection."),
156
+ function: z
157
+ .string()
158
+ .max(100)
159
+ .optional()
160
+ .describe("Run one tool, by its function such as invoice-list, against the provider with the company's connection; its input in input."),
161
+ input: z.record(z.string(), z.unknown()).optional(),
162
+ });
163
+ export const ConnectorPublishInput = z.strictObject({
164
+ connectorId: ConnectorId,
165
+ force: z.literal(true).optional().describe("Publish although the draft's tests fail."),
166
+ rev: Rev,
167
+ });
168
+ export const ConnectorArchiveInput = z.strictObject({ connectorId: ConnectorId, rev: Rev });
169
+ export const ConnectorRestoreInput = z.strictObject({ connectorId: ConnectorId, rev: Rev });
170
+ export const ConnectorChange = z.object({
171
+ path: z.string(),
172
+ change: z.enum(["added", "changed", "removed"]),
173
+ });
174
+ // One run of a connector's tests (#894): the same shape as a gadget's.
175
+ export const ConnectorTestRun = GadgetTestRun;
14
176
  // One field of the form a connection is entered in (#7), from the connector's `settings` and
15
177
  // `secrets` and their `.meta()`. A `secret` field is a password field and is never read back.
16
178
  //
@@ -36,13 +198,73 @@ export const Connector = z.object({
36
198
  name: z.string(),
37
199
  category: z.string(),
38
200
  description: z.string(),
39
- // The SVG as text, for the catalog tile.
201
+ // The SVG as text, or a data: URL of a PNG (#894), for the catalog tile.
40
202
  icon: z.string(),
41
- // From the catalog `anchrd/connectors`, rather than the installation's own.
203
+ // From the catalog `anchrd/connectors`, rather than the installation's own. Always false since
204
+ // #894: every connector is built in the installation.
42
205
  catalog: z.boolean(),
206
+ // Of the live version; of the draft for a connector never published.
43
207
  tools: z.array(ConnectorTool),
44
208
  fields: z.array(ConnectorField),
209
+ // The hosts the bridge lets it reach, and how the credential is sent (#894).
210
+ hosts: z.array(z.string()),
211
+ access: z.string(),
212
+ live: z
213
+ .object({
214
+ version: z.number().int(),
215
+ publishedAt: z.iso.datetime(),
216
+ publishedBy: ConnectorPerson.nullable(),
217
+ })
218
+ .nullable(),
219
+ // Only for whoever may change the connector; null without a draft and for everybody else.
220
+ draft: z
221
+ .object({
222
+ // The number the draft gets when it is published.
223
+ version: z.number().int(),
224
+ updatedAt: z.iso.datetime(),
225
+ updatedBy: ConnectorPerson.nullable(),
226
+ changes: z.array(ConnectorChange),
227
+ // Tools and hosts the draft has and live has not: what a publish adds.
228
+ newTools: z.array(ConnectorTool),
229
+ newHosts: z.array(z.string()),
230
+ tools: z.number().int(),
231
+ })
232
+ .nullable(),
233
+ archivedAt: z.iso.datetime().nullable(),
234
+ // The state the next save sends (E70).
235
+ rev: z.number().int(),
236
+ });
237
+ // `connectors_connector_get` (#894): the catalog entry, and the files of one state with its tests and
238
+ // versions.
239
+ export const ConnectorDetail = Connector.extend({
240
+ // The state the files belong to: a version's number, `draft`, or null without either.
241
+ version: z.union([z.number().int(), z.literal("draft")]).nullable(),
242
+ manifest: ConnectorManifest.nullable(),
243
+ files: z.array(GadgetFile),
244
+ // The last run of the tests; null before the first and for whoever may not change the connector.
245
+ test: ConnectorTestRun.nullable(),
246
+ // Every published version, newest first, with the calls and errors of the last 7 days.
247
+ versions: z.array(z.object({
248
+ version: z.number().int(),
249
+ createdAt: z.iso.datetime(),
250
+ createdBy: ConnectorPerson.nullable(),
251
+ calls: z.number().int(),
252
+ errors: z.number().int(),
253
+ })),
254
+ rights: z.object({ update: z.boolean(), publish: z.boolean() }),
45
255
  });
256
+ // What `connectors_connector_test` answers (#894): the tests, the connection test, or one tool's call.
257
+ export const ConnectorTestAnswer = z.union([
258
+ z.object({ tests: ConnectorTestRun }),
259
+ z.object({
260
+ connection: z.object({
261
+ ok: z.boolean(),
262
+ detail: z.string().nullable(),
263
+ message: z.string().nullable(),
264
+ }),
265
+ }),
266
+ z.object({ output: z.unknown() }),
267
+ ]);
46
268
  export const ConnectorList = z.object({
47
269
  items: z.array(Connector),
48
270
  nextCursor: ConnectorId.nullable(),
@@ -67,6 +289,11 @@ export const Call = z.object({
67
289
  // The provider's HTTP status, 200 on success, null without an answer.
68
290
  status: z.number().int().nullable(),
69
291
  failed: z.boolean(),
292
+ // How it failed (#894): `rejected`, `unauthorized`, `unavailable`, or `host` when the bridge refused
293
+ // a request to a host the connector does not name. Null when it did not fail, and before #894.
294
+ failure: z.string().nullable(),
295
+ // The state that ran (#894): `draft` or a published version; null before #894.
296
+ version: z.union([z.number().int(), z.literal("draft")]).nullable(),
70
297
  durationMs: z.number().int(),
71
298
  createdAt: z.iso.datetime(),
72
299
  // Null for the daily test, which nobody started. Name, kind and picture come from `access`, null
@@ -35,9 +35,9 @@ export declare const CrawlGetInput: z.ZodObject<{
35
35
  export type CrawlGetInput = z.infer<typeof CrawlGetInput>;
36
36
  export declare const CrawlStatus: z.ZodEnum<{
37
37
  done: "done";
38
- failed: "failed";
39
38
  expired: "expired";
40
39
  running: "running";
40
+ failed: "failed";
41
41
  starting: "starting";
42
42
  reading: "reading";
43
43
  }>;
@@ -47,9 +47,9 @@ export declare const Crawl: z.ZodObject<{
47
47
  url: z.ZodString;
48
48
  status: z.ZodEnum<{
49
49
  done: "done";
50
- failed: "failed";
51
50
  expired: "expired";
52
51
  running: "running";
52
+ failed: "failed";
53
53
  starting: "starting";
54
54
  reading: "reading";
55
55
  }>;
@@ -92,9 +92,9 @@ export declare const CrawlDetail: z.ZodObject<{
92
92
  url: z.ZodString;
93
93
  status: z.ZodEnum<{
94
94
  done: "done";
95
- failed: "failed";
96
95
  expired: "expired";
97
96
  running: "running";
97
+ failed: "failed";
98
98
  starting: "starting";
99
99
  reading: "reading";
100
100
  }>;
@@ -23,6 +23,7 @@ export declare const ErrorCurrent: z.ZodObject<{
23
23
  gadgetId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
24
24
  nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
25
25
  machineId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
26
+ connectorId: z.ZodOptional<z.ZodString>;
26
27
  rev: z.ZodNumber;
27
28
  savedBy: z.ZodOptional<z.ZodObject<{
28
29
  userId: z.ZodString;
@@ -58,6 +59,7 @@ export declare const ErrorResponse: z.ZodObject<{
58
59
  gadgetId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
59
60
  nodeId: z.ZodOptional<z.ZodTemplateLiteral<`node_${string}`>>;
60
61
  machineId: z.ZodOptional<z.ZodTemplateLiteral<`user_${string}`>>;
62
+ connectorId: z.ZodOptional<z.ZodString>;
61
63
  rev: z.ZodNumber;
62
64
  savedBy: z.ZodOptional<z.ZodObject<{
63
65
  userId: z.ZodString;
@@ -34,6 +34,8 @@ export const ErrorCurrent = z.strictObject({
34
34
  gadgetId: NodeRef.optional(),
35
35
  nodeId: NodeRef.optional(),
36
36
  machineId: idSchema("user").optional(),
37
+ // A built connector's id (#894), `github`.
38
+ connectorId: z.string().optional(),
37
39
  rev: z.number().int(),
38
40
  savedBy: z.strictObject({ userId: z.string(), name: z.string() }).optional(),
39
41
  savedAt: z.iso.datetime(),
@@ -82,15 +82,15 @@ export declare const GadgetTestInput: z.ZodObject<{
82
82
  }, z.core.$strict>;
83
83
  export type GadgetTestInput = z.infer<typeof GadgetTestInput>;
84
84
  export declare const GadgetCallStatus: z.ZodEnum<{
85
- failed: "failed";
86
85
  succeeded: "succeeded";
86
+ failed: "failed";
87
87
  }>;
88
88
  export type GadgetCallStatus = z.infer<typeof GadgetCallStatus>;
89
89
  export declare const GadgetCallListInput: z.ZodObject<{
90
90
  gadgetId: z.ZodTemplateLiteral<`node_${string}`>;
91
91
  status: z.ZodOptional<z.ZodEnum<{
92
- failed: "failed";
93
92
  succeeded: "succeeded";
93
+ failed: "failed";
94
94
  }>>;
95
95
  version: z.ZodOptional<z.ZodPreprocess<z.ZodUnion<readonly [z.ZodEnum<{
96
96
  live: "live";
@@ -193,8 +193,8 @@ export declare const GadgetTestRun: z.ZodObject<{
193
193
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
194
194
  current: z.ZodBoolean;
195
195
  status: z.ZodEnum<{
196
- failed: "failed";
197
196
  running: "running";
197
+ failed: "failed";
198
198
  passed: "passed";
199
199
  }>;
200
200
  passed: z.ZodNumber;
@@ -297,8 +297,8 @@ export declare const GadgetDetail: z.ZodObject<{
297
297
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
298
298
  current: z.ZodBoolean;
299
299
  status: z.ZodEnum<{
300
- failed: "failed";
301
300
  running: "running";
301
+ failed: "failed";
302
302
  passed: "passed";
303
303
  }>;
304
304
  passed: z.ZodNumber;
@@ -391,8 +391,8 @@ export declare const GadgetCall: z.ZodObject<{
391
391
  function: z.ZodString;
392
392
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
393
393
  status: z.ZodEnum<{
394
- failed: "failed";
395
394
  succeeded: "succeeded";
395
+ failed: "failed";
396
396
  }>;
397
397
  output: z.ZodUnknown;
398
398
  error: z.ZodNullable<z.ZodObject<{
@@ -442,8 +442,8 @@ export declare const GadgetCallItem: z.ZodObject<{
442
442
  function: z.ZodNullable<z.ZodString>;
443
443
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
444
444
  status: z.ZodEnum<{
445
- failed: "failed";
446
445
  succeeded: "succeeded";
446
+ failed: "failed";
447
447
  }>;
448
448
  unavailable: z.ZodBoolean;
449
449
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -470,8 +470,8 @@ export declare const GadgetCallList: z.ZodObject<{
470
470
  function: z.ZodNullable<z.ZodString>;
471
471
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
472
472
  status: z.ZodEnum<{
473
- failed: "failed";
474
473
  succeeded: "succeeded";
474
+ failed: "failed";
475
475
  }>;
476
476
  unavailable: z.ZodBoolean;
477
477
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -499,8 +499,8 @@ export declare const GadgetCallEntry: z.ZodObject<{
499
499
  function: z.ZodNullable<z.ZodString>;
500
500
  version: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"draft">]>;
501
501
  status: z.ZodEnum<{
502
- failed: "failed";
503
502
  succeeded: "succeeded";
503
+ failed: "failed";
504
504
  }>;
505
505
  unavailable: z.ZodBoolean;
506
506
  durationMs: z.ZodNullable<z.ZodNumber>;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { CallId } from "../connectors/connectors.js";
3
2
  import { ErrorCode } from "../error/error.js";
3
+ import { idSchema } from "../ids/ids.js";
4
4
  import { Limit } from "../list-input.js";
5
5
  import { NodeId, NodePath, NodePerson } from "../nodes/nodes.js";
6
6
  import { IdempotencyKey, Rev } from "../primitives/primitives.js";
@@ -11,7 +11,8 @@ import { UserId } from "../users/users.js";
11
11
  // `intelligence_gadget_call_create`, and their answers.
12
12
  const GadgetId = NodeId.describe("The gadget's id, a `node_…` of kind gadget.");
13
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_…`.");
14
+ // ⚠️ Not `CallId` of `connectors.ts`: that module imports this one (#894).
15
+ const GadgetCallId = idSchema("call").describe("An entry of the gadget's log, `call_…`.");
15
16
  // A file's path inside the gadget: `server.js`, `lib/format.js`, `tests/status.test.js`. Segments of
16
17
  // letters, digits, `_`, `-` and `.`, none starting with a dot, so `..` and hidden files cannot exist
17
18
  // and `.colab/` stays Colab's own (the runtime's harness lives there).
@@ -149,6 +149,7 @@ export declare const GoalCheck: z.ZodObject<{
149
149
  gadget: "gadget";
150
150
  goal: "goal";
151
151
  skill: "skill";
152
+ source: "source";
152
153
  }>>;
153
154
  needs: z.ZodNullable<z.ZodEnum<{
154
155
  write: "write";
@@ -219,6 +220,7 @@ export declare const GoalReady: z.ZodObject<{
219
220
  gadget: "gadget";
220
221
  goal: "goal";
221
222
  skill: "skill";
223
+ source: "source";
222
224
  }>>;
223
225
  needs: z.ZodNullable<z.ZodEnum<{
224
226
  write: "write";
@@ -739,6 +741,7 @@ export declare const GoalDetail: z.ZodObject<{
739
741
  gadget: "gadget";
740
742
  goal: "goal";
741
743
  skill: "skill";
744
+ source: "source";
742
745
  }>>;
743
746
  needs: z.ZodNullable<z.ZodEnum<{
744
747
  write: "write";
@@ -37,6 +37,9 @@ export declare const resources: {
37
37
  readonly step: "steps";
38
38
  readonly crawl: "crawls";
39
39
  readonly mcp: "mcps";
40
+ readonly source: "sources";
41
+ readonly query: "queries";
42
+ readonly item: "items";
40
43
  };
41
44
  export declare const actions: readonly ["list", "get", "create", "update", "archive", "restore", "purge"];
42
45
  export declare const verbs: readonly ["invite", "resend", "disable", "enable", "rotate", "share", "move", "start", "complete", "test", "revoke", "remove", "unlock", "publish", "schedule", "unpublish", "cancel"];
@@ -72,6 +72,12 @@ export const resources = {
72
72
  // A person's own MCP server for their personal Operators (#802, E144, Einstellungen › MCPs):
73
73
  // `operator_mcp_*`, its protocol `operator_mcp_call_list`. Named by the ticket and the page.
74
74
  mcp: "mcps",
75
+ // A node that fetches data from outside on a schedule and keeps it (#900, E151, Nodes › Quelle):
76
+ // `intelligence_source_*`; what it fetches is a query (`intelligence_source_query_*`), what it
77
+ // keeps an item (`intelligence_source_item_list`). Named by the ticket.
78
+ source: "sources",
79
+ query: "queries",
80
+ item: "items",
75
81
  };
76
82
  // The closed list of actions with a route of their own shape.
77
83
  export const actions = ["list", "get", "create", "update", "archive", "restore", "purge"];
@@ -2,10 +2,10 @@ import { z } from "zod";
2
2
  export declare const McpId: z.ZodTemplateLiteral<`mcp_${string}`>;
3
3
  export type McpId = z.infer<typeof McpId>;
4
4
  export declare const McpAuth: z.ZodEnum<{
5
- oauth: "oauth";
6
5
  bearer: "bearer";
7
6
  header: "header";
8
7
  none: "none";
8
+ oauth: "oauth";
9
9
  }>;
10
10
  export type McpAuth = z.infer<typeof McpAuth>;
11
11
  export declare const McpState: z.ZodEnum<{
@@ -190,10 +190,10 @@ export declare const McpCreateInput: z.ZodObject<{
190
190
  name: z.ZodOptional<z.ZodString>;
191
191
  url: z.ZodOptional<z.ZodURL>;
192
192
  auth: z.ZodOptional<z.ZodEnum<{
193
- oauth: "oauth";
194
193
  bearer: "bearer";
195
194
  header: "header";
196
195
  none: "none";
196
+ oauth: "oauth";
197
197
  }>>;
198
198
  headerName: z.ZodOptional<z.ZodString>;
199
199
  value: z.ZodOptional<z.ZodString>;
@@ -236,10 +236,10 @@ export declare const Mcp: z.ZodObject<{
236
236
  name: z.ZodString;
237
237
  url: z.ZodString;
238
238
  auth: z.ZodEnum<{
239
- oauth: "oauth";
240
239
  bearer: "bearer";
241
240
  header: "header";
242
241
  none: "none";
242
+ oauth: "oauth";
243
243
  }>;
244
244
  headerName: z.ZodNullable<z.ZodString>;
245
245
  state: z.ZodEnum<{
@@ -272,10 +272,10 @@ export declare const McpList: z.ZodObject<{
272
272
  name: z.ZodString;
273
273
  url: z.ZodString;
274
274
  auth: z.ZodEnum<{
275
- oauth: "oauth";
276
275
  bearer: "bearer";
277
276
  header: "header";
278
277
  none: "none";
278
+ oauth: "oauth";
279
279
  }>;
280
280
  headerName: z.ZodNullable<z.ZodString>;
281
281
  state: z.ZodEnum<{
@@ -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", "file", "gadget", "goal", "skill"];
10
+ export declare const nodeKinds: readonly ["folder", "document", "table", "board", "task", "file", "gadget", "goal", "skill", "source"];
11
11
  export declare const NodeKind: z.ZodEnum<{
12
12
  file: "file";
13
13
  folder: "folder";
@@ -18,6 +18,7 @@ export declare const NodeKind: z.ZodEnum<{
18
18
  gadget: "gadget";
19
19
  goal: "goal";
20
20
  skill: "skill";
21
+ source: "source";
21
22
  }>;
22
23
  export type NodeKind = z.infer<typeof NodeKind>;
23
24
  export declare const responsibleKinds: readonly ["document", "table", "file"];
@@ -39,8 +40,8 @@ export declare const NodeSection: z.ZodEnum<{
39
40
  export type NodeSection = z.infer<typeof NodeSection>;
40
41
  export declare const NodeSort: z.ZodEnum<{
41
42
  name: "name";
42
- kind: "kind";
43
43
  status: "status";
44
+ kind: "kind";
44
45
  updated: "updated";
45
46
  }>;
46
47
  export type NodeSort = z.infer<typeof NodeSort>;
@@ -56,8 +57,8 @@ export declare const NodeListInput: z.ZodObject<{
56
57
  includeHidden: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
57
58
  sort: z.ZodOptional<z.ZodEnum<{
58
59
  name: "name";
59
- kind: "kind";
60
60
  status: "status";
61
+ kind: "kind";
61
62
  updated: "updated";
62
63
  }>>;
63
64
  foldersFirst: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
@@ -101,6 +102,7 @@ export declare const NodeListItem: z.ZodObject<{
101
102
  gadget: "gadget";
102
103
  goal: "goal";
103
104
  skill: "skill";
105
+ source: "source";
104
106
  }>;
105
107
  name: z.ZodString;
106
108
  hidden: z.ZodBoolean;
@@ -172,6 +174,7 @@ export declare const NodeList: z.ZodObject<{
172
174
  gadget: "gadget";
173
175
  goal: "goal";
174
176
  skill: "skill";
177
+ source: "source";
175
178
  }>;
176
179
  name: z.ZodString;
177
180
  hidden: z.ZodBoolean;
@@ -268,6 +271,7 @@ export declare const NodeHit: z.ZodObject<{
268
271
  gadget: "gadget";
269
272
  goal: "goal";
270
273
  skill: "skill";
274
+ source: "source";
271
275
  }>;
272
276
  name: z.ZodString;
273
277
  path: z.ZodObject<{
@@ -340,6 +344,7 @@ export declare const NodeSearch: z.ZodObject<{
340
344
  gadget: "gadget";
341
345
  goal: "goal";
342
346
  skill: "skill";
347
+ source: "source";
343
348
  }>;
344
349
  name: z.ZodString;
345
350
  path: z.ZodObject<{
@@ -471,6 +476,7 @@ export declare const NodeDetail: z.ZodObject<{
471
476
  gadget: "gadget";
472
477
  goal: "goal";
473
478
  skill: "skill";
479
+ source: "source";
474
480
  }>;
475
481
  name: z.ZodString;
476
482
  hidden: z.ZodBoolean;
@@ -39,6 +39,8 @@ export const nodeKinds = [
39
39
  "goal",
40
40
  // #817, E140: how something is done well, with its result, trigger and tests.
41
41
  "skill",
42
+ // #900, E151: fetches data from outside on a schedule and keeps it as items.
43
+ "source",
42
44
  ];
43
45
  export const NodeKind = z.enum(nodeKinds);
44
46
  // Only these kinds have a responsible person (E32): the one who answers for the content's validity.
@@ -937,8 +937,8 @@ export type OperatorUserList = z.infer<typeof OperatorUserList>;
937
937
  export declare const OperatorRunId: z.ZodTemplateLiteral<`run_${string}`>;
938
938
  export type OperatorRunId = z.infer<typeof OperatorRunId>;
939
939
  export declare const OperatorRunStatus: z.ZodEnum<{
940
- failed: "failed";
941
940
  running: "running";
941
+ failed: "failed";
942
942
  completed: "completed";
943
943
  stopped: "stopped";
944
944
  }>;
@@ -1006,8 +1006,8 @@ export declare const OperatorRun: z.ZodObject<{
1006
1006
  retry: "retry";
1007
1007
  }>;
1008
1008
  status: z.ZodEnum<{
1009
- failed: "failed";
1010
1009
  running: "running";
1010
+ failed: "failed";
1011
1011
  completed: "completed";
1012
1012
  stopped: "stopped";
1013
1013
  }>;
@@ -1088,8 +1088,8 @@ export declare const OperatorRunListInput: z.ZodObject<{
1088
1088
  gemini: "gemini";
1089
1089
  }>>;
1090
1090
  status: z.ZodOptional<z.ZodEnum<{
1091
- failed: "failed";
1092
1091
  running: "running";
1092
+ failed: "failed";
1093
1093
  completed: "completed";
1094
1094
  stopped: "stopped";
1095
1095
  }>>;
@@ -1275,8 +1275,8 @@ export declare const OperatorRunList: z.ZodObject<{
1275
1275
  retry: "retry";
1276
1276
  }>;
1277
1277
  status: z.ZodEnum<{
1278
- failed: "failed";
1279
1278
  running: "running";
1279
+ failed: "failed";
1280
1280
  completed: "completed";
1281
1281
  stopped: "stopped";
1282
1282
  }>;