@anchrd/intel-contract 0.4.2 → 0.7.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.
@@ -16,13 +16,18 @@ export declare const SessionUser: z.ZodObject<{
16
16
  name: z.ZodNullable<z.ZodString>;
17
17
  }, z.core.$strict>;
18
18
  export type SessionUser = z.infer<typeof SessionUser>;
19
- export declare const KnowledgeNodeKind: z.ZodEnum<{
19
+ export declare const IntelCapabilities: z.ZodObject<{
20
+ agentRuntime: z.ZodBoolean;
21
+ }, z.core.$strict>;
22
+ export type IntelCapabilities = z.infer<typeof IntelCapabilities>;
23
+ export declare const NodeKind: z.ZodEnum<{
20
24
  folder: "folder";
21
25
  document: "document";
22
26
  attachment: "attachment";
23
27
  table: "table";
28
+ agent: "agent";
24
29
  }>;
25
- export type KnowledgeNodeKind = z.infer<typeof KnowledgeNodeKind>;
30
+ export type NodeKind = z.infer<typeof NodeKind>;
26
31
  export declare const ResourceVerb: z.ZodEnum<{
27
32
  read: "read";
28
33
  write: "write";
@@ -40,7 +45,7 @@ export declare const SharePrincipal: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
45
  type: z.ZodLiteral<"organization">;
41
46
  }, z.core.$strict>], "type">;
42
47
  export type SharePrincipal = z.infer<typeof SharePrincipal>;
43
- export declare const KnowledgeNode: z.ZodObject<{
48
+ export declare const Node: z.ZodObject<{
44
49
  id: z.ZodString;
45
50
  parentId: z.ZodNullable<z.ZodString>;
46
51
  kind: z.ZodEnum<{
@@ -48,6 +53,7 @@ export declare const KnowledgeNode: z.ZodObject<{
48
53
  document: "document";
49
54
  attachment: "attachment";
50
55
  table: "table";
56
+ agent: "agent";
51
57
  }>;
52
58
  title: z.ZodString;
53
59
  description: z.ZodNullable<z.ZodString>;
@@ -57,8 +63,13 @@ export declare const KnowledgeNode: z.ZodObject<{
57
63
  updatedAt: z.ZodISODateTime;
58
64
  archivedAt: z.ZodNullable<z.ZodISODateTime>;
59
65
  }, z.core.$strict>;
60
- export type KnowledgeNode = z.infer<typeof KnowledgeNode>;
61
- export declare const KnowledgeVersion: z.ZodObject<{
66
+ export type Node = z.infer<typeof Node>;
67
+ export declare const NodeVersionSegment: z.ZodEnum<{
68
+ append: "append";
69
+ snapshot: "snapshot";
70
+ }>;
71
+ export type NodeVersionSegment = z.infer<typeof NodeVersionSegment>;
72
+ export declare const NodeVersion: z.ZodObject<{
62
73
  id: z.ZodString;
63
74
  nodeId: z.ZodString;
64
75
  sequence: z.ZodNumber;
@@ -66,54 +77,64 @@ export declare const KnowledgeVersion: z.ZodObject<{
66
77
  mediaType: z.ZodString;
67
78
  contentHash: z.ZodString;
68
79
  size: z.ZodNumber;
80
+ segment: z.ZodNullable<z.ZodEnum<{
81
+ append: "append";
82
+ snapshot: "snapshot";
83
+ }>>;
69
84
  createdBy: z.ZodString;
70
85
  createdAt: z.ZodISODateTime;
71
86
  }, z.core.$strict>;
72
- export type KnowledgeVersion = z.infer<typeof KnowledgeVersion>;
73
- export declare const ListKnowledgeNodesInput: z.ZodObject<{
87
+ export type NodeVersion = z.infer<typeof NodeVersion>;
88
+ export declare const ListNodesInput: z.ZodObject<{
74
89
  parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
75
90
  includeArchived: z.ZodDefault<z.ZodBoolean>;
76
91
  archivedOnly: z.ZodOptional<z.ZodBoolean>;
77
92
  }, z.core.$strict>;
78
- export type ListKnowledgeNodesInput = z.infer<typeof ListKnowledgeNodesInput>;
79
- export declare const GetKnowledgeNodeInput: z.ZodObject<{
93
+ export type ListNodesInput = z.infer<typeof ListNodesInput>;
94
+ export declare const GetNodeInput: z.ZodObject<{
95
+ nodeId: z.ZodString;
96
+ }, z.core.$strict>;
97
+ export type GetNodeInput = z.infer<typeof GetNodeInput>;
98
+ export declare const GetNodeVersionInput: z.ZodObject<{
80
99
  nodeId: z.ZodString;
100
+ versionId: z.ZodString;
81
101
  }, z.core.$strict>;
82
- export type GetKnowledgeNodeInput = z.infer<typeof GetKnowledgeNodeInput>;
83
- export declare const ListKnowledgeGrantsInput: z.ZodObject<{
102
+ export type GetNodeVersionInput = z.infer<typeof GetNodeVersionInput>;
103
+ export declare const ListGrantsInput: z.ZodObject<{
84
104
  resourceId: z.ZodString;
85
105
  }, z.core.$strict>;
86
- export type ListKnowledgeGrantsInput = z.infer<typeof ListKnowledgeGrantsInput>;
87
- export declare const CreateKnowledgeNodeInput: z.ZodObject<{
106
+ export type ListGrantsInput = z.infer<typeof ListGrantsInput>;
107
+ export declare const CreateNodeInput: z.ZodObject<{
88
108
  parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
89
109
  kind: z.ZodEnum<{
90
110
  folder: "folder";
91
111
  document: "document";
92
112
  attachment: "attachment";
93
113
  table: "table";
114
+ agent: "agent";
94
115
  }>;
95
116
  title: z.ZodString;
96
117
  description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
97
118
  idempotencyKey: z.ZodString;
98
119
  }, z.core.$strict>;
99
- export type CreateKnowledgeNodeInput = z.infer<typeof CreateKnowledgeNodeInput>;
100
- export declare const SaveKnowledgeVersionInput: z.ZodObject<{
120
+ export type CreateNodeInput = z.infer<typeof CreateNodeInput>;
121
+ export declare const SaveNodeVersionInput: z.ZodObject<{
101
122
  nodeId: z.ZodString;
102
123
  baseVersionId: z.ZodNullable<z.ZodString>;
103
124
  content: z.ZodString;
104
125
  mediaType: z.ZodDefault<z.ZodString>;
105
126
  idempotencyKey: z.ZodString;
106
127
  }, z.core.$strict>;
107
- export type SaveKnowledgeVersionInput = z.infer<typeof SaveKnowledgeVersionInput>;
108
- export declare const SaveKnowledgeAttachmentInput: z.ZodObject<{
128
+ export type SaveNodeVersionInput = z.infer<typeof SaveNodeVersionInput>;
129
+ export declare const SaveAttachmentInput: z.ZodObject<{
109
130
  nodeId: z.ZodString;
110
131
  baseVersionId: z.ZodNullable<z.ZodString>;
111
132
  contentBase64: z.ZodString;
112
133
  mediaType: z.ZodString;
113
134
  idempotencyKey: z.ZodString;
114
135
  }, z.core.$strict>;
115
- export type SaveKnowledgeAttachmentInput = z.infer<typeof SaveKnowledgeAttachmentInput>;
116
- export declare const UpdateKnowledgeNodeInput: z.ZodObject<{
136
+ export type SaveAttachmentInput = z.infer<typeof SaveAttachmentInput>;
137
+ export declare const UpdateNodeInput: z.ZodObject<{
117
138
  nodeId: z.ZodString;
118
139
  baseUpdatedAt: z.ZodISODateTime;
119
140
  title: z.ZodOptional<z.ZodString>;
@@ -121,15 +142,15 @@ export declare const UpdateKnowledgeNodeInput: z.ZodObject<{
121
142
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
143
  idempotencyKey: z.ZodString;
123
144
  }, z.core.$strict>;
124
- export type UpdateKnowledgeNodeInput = z.infer<typeof UpdateKnowledgeNodeInput>;
125
- export declare const ArchiveKnowledgeNodeInput: z.ZodObject<{
145
+ export type UpdateNodeInput = z.infer<typeof UpdateNodeInput>;
146
+ export declare const ArchiveNodeInput: z.ZodObject<{
126
147
  nodeId: z.ZodString;
127
148
  baseUpdatedAt: z.ZodISODateTime;
128
149
  archived: z.ZodBoolean;
129
150
  idempotencyKey: z.ZodString;
130
151
  }, z.core.$strict>;
131
- export type ArchiveKnowledgeNodeInput = z.infer<typeof ArchiveKnowledgeNodeInput>;
132
- export declare const KnowledgeNodeList: z.ZodObject<{
152
+ export type ArchiveNodeInput = z.infer<typeof ArchiveNodeInput>;
153
+ export declare const NodeList: z.ZodObject<{
133
154
  items: z.ZodArray<z.ZodObject<{
134
155
  id: z.ZodString;
135
156
  parentId: z.ZodNullable<z.ZodString>;
@@ -138,6 +159,7 @@ export declare const KnowledgeNodeList: z.ZodObject<{
138
159
  document: "document";
139
160
  attachment: "attachment";
140
161
  table: "table";
162
+ agent: "agent";
141
163
  }>;
142
164
  title: z.ZodString;
143
165
  description: z.ZodNullable<z.ZodString>;
@@ -149,8 +171,8 @@ export declare const KnowledgeNodeList: z.ZodObject<{
149
171
  }, z.core.$strict>>;
150
172
  withChildren: z.ZodDefault<z.ZodArray<z.ZodString>>;
151
173
  }, z.core.$strict>;
152
- export type KnowledgeNodeList = z.infer<typeof KnowledgeNodeList>;
153
- export declare const KnowledgeVersionList: z.ZodObject<{
174
+ export type NodeList = z.infer<typeof NodeList>;
175
+ export declare const NodeVersionList: z.ZodObject<{
154
176
  items: z.ZodArray<z.ZodObject<{
155
177
  id: z.ZodString;
156
178
  nodeId: z.ZodString;
@@ -159,12 +181,16 @@ export declare const KnowledgeVersionList: z.ZodObject<{
159
181
  mediaType: z.ZodString;
160
182
  contentHash: z.ZodString;
161
183
  size: z.ZodNumber;
184
+ segment: z.ZodNullable<z.ZodEnum<{
185
+ append: "append";
186
+ snapshot: "snapshot";
187
+ }>>;
162
188
  createdBy: z.ZodString;
163
189
  createdAt: z.ZodISODateTime;
164
190
  }, z.core.$strict>>;
165
191
  }, z.core.$strict>;
166
- export type KnowledgeVersionList = z.infer<typeof KnowledgeVersionList>;
167
- export declare const KnowledgeDocument: z.ZodObject<{
192
+ export type NodeVersionList = z.infer<typeof NodeVersionList>;
193
+ export declare const NodeDocument: z.ZodObject<{
168
194
  node: z.ZodObject<{
169
195
  id: z.ZodString;
170
196
  parentId: z.ZodNullable<z.ZodString>;
@@ -173,6 +199,7 @@ export declare const KnowledgeDocument: z.ZodObject<{
173
199
  document: "document";
174
200
  attachment: "attachment";
175
201
  table: "table";
202
+ agent: "agent";
176
203
  }>;
177
204
  title: z.ZodString;
178
205
  description: z.ZodNullable<z.ZodString>;
@@ -190,13 +217,17 @@ export declare const KnowledgeDocument: z.ZodObject<{
190
217
  mediaType: z.ZodString;
191
218
  contentHash: z.ZodString;
192
219
  size: z.ZodNumber;
220
+ segment: z.ZodNullable<z.ZodEnum<{
221
+ append: "append";
222
+ snapshot: "snapshot";
223
+ }>>;
193
224
  createdBy: z.ZodString;
194
225
  createdAt: z.ZodISODateTime;
195
226
  }, z.core.$strict>>;
196
227
  content: z.ZodNullable<z.ZodString>;
197
228
  }, z.core.$strict>;
198
- export type KnowledgeDocument = z.infer<typeof KnowledgeDocument>;
199
- export declare const KnowledgeAttachment: z.ZodObject<{
229
+ export type NodeDocument = z.infer<typeof NodeDocument>;
230
+ export declare const NodeAttachment: z.ZodObject<{
200
231
  node: z.ZodObject<{
201
232
  id: z.ZodString;
202
233
  parentId: z.ZodNullable<z.ZodString>;
@@ -205,6 +236,7 @@ export declare const KnowledgeAttachment: z.ZodObject<{
205
236
  document: "document";
206
237
  attachment: "attachment";
207
238
  table: "table";
239
+ agent: "agent";
208
240
  }>;
209
241
  title: z.ZodString;
210
242
  description: z.ZodNullable<z.ZodString>;
@@ -222,33 +254,37 @@ export declare const KnowledgeAttachment: z.ZodObject<{
222
254
  mediaType: z.ZodString;
223
255
  contentHash: z.ZodString;
224
256
  size: z.ZodNumber;
257
+ segment: z.ZodNullable<z.ZodEnum<{
258
+ append: "append";
259
+ snapshot: "snapshot";
260
+ }>>;
225
261
  createdBy: z.ZodString;
226
262
  createdAt: z.ZodISODateTime;
227
263
  }, z.core.$strict>;
228
264
  resourceUri: z.ZodString;
229
265
  }, z.core.$strict>;
230
- export type KnowledgeAttachment = z.infer<typeof KnowledgeAttachment>;
266
+ export type NodeAttachment = z.infer<typeof NodeAttachment>;
231
267
  export declare const TableMediaType = "text/csv";
232
268
  export declare const TableColumn: z.ZodString;
233
269
  export declare const TableCell: z.ZodString;
234
270
  export declare const TableRow: z.ZodArray<z.ZodString>;
235
- export declare const DefineKnowledgeTableInput: z.ZodObject<{
271
+ export declare const DefineTableInput: z.ZodObject<{
236
272
  nodeId: z.ZodString;
237
273
  columns: z.ZodArray<z.ZodString>;
238
274
  idempotencyKey: z.ZodString;
239
275
  }, z.core.$strict>;
240
- export type DefineKnowledgeTableInput = z.infer<typeof DefineKnowledgeTableInput>;
241
- export declare const AppendKnowledgeTableRowsInput: z.ZodObject<{
276
+ export type DefineTableInput = z.infer<typeof DefineTableInput>;
277
+ export declare const AppendTableRowsInput: z.ZodObject<{
242
278
  nodeId: z.ZodString;
243
279
  rows: z.ZodArray<z.ZodArray<z.ZodString>>;
244
280
  idempotencyKey: z.ZodString;
245
281
  }, z.core.$strict>;
246
- export type AppendKnowledgeTableRowsInput = z.infer<typeof AppendKnowledgeTableRowsInput>;
247
- export declare const GetKnowledgeTableInput: z.ZodObject<{
282
+ export type AppendTableRowsInput = z.infer<typeof AppendTableRowsInput>;
283
+ export declare const GetTableInput: z.ZodObject<{
248
284
  nodeId: z.ZodString;
249
285
  }, z.core.$strict>;
250
- export type GetKnowledgeTableInput = z.infer<typeof GetKnowledgeTableInput>;
251
- export declare const KnowledgeTable: z.ZodObject<{
286
+ export type GetTableInput = z.infer<typeof GetTableInput>;
287
+ export declare const NodeTable: z.ZodObject<{
252
288
  node: z.ZodObject<{
253
289
  id: z.ZodString;
254
290
  parentId: z.ZodNullable<z.ZodString>;
@@ -257,6 +293,7 @@ export declare const KnowledgeTable: z.ZodObject<{
257
293
  document: "document";
258
294
  attachment: "attachment";
259
295
  table: "table";
296
+ agent: "agent";
260
297
  }>;
261
298
  title: z.ZodString;
262
299
  description: z.ZodNullable<z.ZodString>;
@@ -270,8 +307,8 @@ export declare const KnowledgeTable: z.ZodObject<{
270
307
  rows: z.ZodArray<z.ZodArray<z.ZodString>>;
271
308
  versionId: z.ZodNullable<z.ZodString>;
272
309
  }, z.core.$strict>;
273
- export type KnowledgeTable = z.infer<typeof KnowledgeTable>;
274
- export declare const AppendKnowledgeTableRowsResult: z.ZodObject<{
310
+ export type NodeTable = z.infer<typeof NodeTable>;
311
+ export declare const AppendTableRowsResult: z.ZodObject<{
275
312
  node: z.ZodObject<{
276
313
  id: z.ZodString;
277
314
  parentId: z.ZodNullable<z.ZodString>;
@@ -280,6 +317,7 @@ export declare const AppendKnowledgeTableRowsResult: z.ZodObject<{
280
317
  document: "document";
281
318
  attachment: "attachment";
282
319
  table: "table";
320
+ agent: "agent";
283
321
  }>;
284
322
  title: z.ZodString;
285
323
  description: z.ZodNullable<z.ZodString>;
@@ -297,25 +335,584 @@ export declare const AppendKnowledgeTableRowsResult: z.ZodObject<{
297
335
  mediaType: z.ZodString;
298
336
  contentHash: z.ZodString;
299
337
  size: z.ZodNumber;
338
+ segment: z.ZodNullable<z.ZodEnum<{
339
+ append: "append";
340
+ snapshot: "snapshot";
341
+ }>>;
300
342
  createdBy: z.ZodString;
301
343
  createdAt: z.ZodISODateTime;
302
344
  }, z.core.$strict>;
303
345
  appended: z.ZodNumber;
304
346
  }, z.core.$strict>;
305
- export type AppendKnowledgeTableRowsResult = z.infer<typeof AppendKnowledgeTableRowsResult>;
306
- export declare const KnowledgeLinkRelation: z.ZodEnum<{
347
+ export type AppendTableRowsResult = z.infer<typeof AppendTableRowsResult>;
348
+ export declare const TableRowPosition: z.ZodNumber;
349
+ export declare const UpdateTableRowsInput: z.ZodObject<{
350
+ nodeId: z.ZodString;
351
+ baseVersionId: z.ZodString;
352
+ updates: z.ZodArray<z.ZodObject<{
353
+ position: z.ZodNumber;
354
+ row: z.ZodArray<z.ZodString>;
355
+ }, z.core.$strict>>;
356
+ idempotencyKey: z.ZodString;
357
+ }, z.core.$strict>;
358
+ export type UpdateTableRowsInput = z.infer<typeof UpdateTableRowsInput>;
359
+ export declare const UpdateTableRowsResult: z.ZodObject<{
360
+ node: z.ZodObject<{
361
+ id: z.ZodString;
362
+ parentId: z.ZodNullable<z.ZodString>;
363
+ kind: z.ZodEnum<{
364
+ folder: "folder";
365
+ document: "document";
366
+ attachment: "attachment";
367
+ table: "table";
368
+ agent: "agent";
369
+ }>;
370
+ title: z.ZodString;
371
+ description: z.ZodNullable<z.ZodString>;
372
+ ownerId: z.ZodString;
373
+ currentVersionId: z.ZodNullable<z.ZodString>;
374
+ createdAt: z.ZodISODateTime;
375
+ updatedAt: z.ZodISODateTime;
376
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
377
+ }, z.core.$strict>;
378
+ version: z.ZodObject<{
379
+ id: z.ZodString;
380
+ nodeId: z.ZodString;
381
+ sequence: z.ZodNumber;
382
+ contentKey: z.ZodString;
383
+ mediaType: z.ZodString;
384
+ contentHash: z.ZodString;
385
+ size: z.ZodNumber;
386
+ segment: z.ZodNullable<z.ZodEnum<{
387
+ append: "append";
388
+ snapshot: "snapshot";
389
+ }>>;
390
+ createdBy: z.ZodString;
391
+ createdAt: z.ZodISODateTime;
392
+ }, z.core.$strict>;
393
+ updated: z.ZodNumber;
394
+ }, z.core.$strict>;
395
+ export type UpdateTableRowsResult = z.infer<typeof UpdateTableRowsResult>;
396
+ export declare const DeleteTableRowsInput: z.ZodObject<{
397
+ nodeId: z.ZodString;
398
+ baseVersionId: z.ZodString;
399
+ positions: z.ZodArray<z.ZodNumber>;
400
+ idempotencyKey: z.ZodString;
401
+ }, z.core.$strict>;
402
+ export type DeleteTableRowsInput = z.infer<typeof DeleteTableRowsInput>;
403
+ export declare const DeleteTableRowsResult: z.ZodObject<{
404
+ node: z.ZodObject<{
405
+ id: z.ZodString;
406
+ parentId: z.ZodNullable<z.ZodString>;
407
+ kind: z.ZodEnum<{
408
+ folder: "folder";
409
+ document: "document";
410
+ attachment: "attachment";
411
+ table: "table";
412
+ agent: "agent";
413
+ }>;
414
+ title: z.ZodString;
415
+ description: z.ZodNullable<z.ZodString>;
416
+ ownerId: z.ZodString;
417
+ currentVersionId: z.ZodNullable<z.ZodString>;
418
+ createdAt: z.ZodISODateTime;
419
+ updatedAt: z.ZodISODateTime;
420
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
421
+ }, z.core.$strict>;
422
+ version: z.ZodObject<{
423
+ id: z.ZodString;
424
+ nodeId: z.ZodString;
425
+ sequence: z.ZodNumber;
426
+ contentKey: z.ZodString;
427
+ mediaType: z.ZodString;
428
+ contentHash: z.ZodString;
429
+ size: z.ZodNumber;
430
+ segment: z.ZodNullable<z.ZodEnum<{
431
+ append: "append";
432
+ snapshot: "snapshot";
433
+ }>>;
434
+ createdBy: z.ZodString;
435
+ createdAt: z.ZodISODateTime;
436
+ }, z.core.$strict>;
437
+ deleted: z.ZodNumber;
438
+ }, z.core.$strict>;
439
+ export type DeleteTableRowsResult = z.infer<typeof DeleteTableRowsResult>;
440
+ export declare const RedefineTableColumn: z.ZodObject<{
441
+ name: z.ZodString;
442
+ source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
443
+ }, z.core.$strict>;
444
+ export type RedefineTableColumn = z.infer<typeof RedefineTableColumn>;
445
+ export declare const RedefineTableInput: z.ZodObject<{
446
+ nodeId: z.ZodString;
447
+ baseVersionId: z.ZodString;
448
+ columns: z.ZodArray<z.ZodObject<{
449
+ name: z.ZodString;
450
+ source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
451
+ }, z.core.$strict>>;
452
+ idempotencyKey: z.ZodString;
453
+ }, z.core.$strict>;
454
+ export type RedefineTableInput = z.infer<typeof RedefineTableInput>;
455
+ export declare const AgentMediaType = "application/vnd.anchrd.agent+json";
456
+ export declare const AgentReferenceRole: z.ZodEnum<{
457
+ "system-message": "system-message";
458
+ "semantic-context": "semantic-context";
459
+ memory: "memory";
460
+ }>;
461
+ export type AgentReferenceRole = z.infer<typeof AgentReferenceRole>;
462
+ export declare const AgentReference: z.ZodObject<{
463
+ nodeId: z.ZodString;
464
+ role: z.ZodEnum<{
465
+ "system-message": "system-message";
466
+ "semantic-context": "semantic-context";
467
+ memory: "memory";
468
+ }>;
469
+ }, z.core.$strict>;
470
+ export type AgentReference = z.infer<typeof AgentReference>;
471
+ export declare const AgentScheduleTarget: z.ZodObject<{
472
+ kind: z.ZodEnum<{
473
+ document: "document";
474
+ flow: "flow";
475
+ }>;
476
+ id: z.ZodString;
477
+ }, z.core.$strict>;
478
+ export type AgentScheduleTarget = z.infer<typeof AgentScheduleTarget>;
479
+ export declare const AgentSchedule: z.ZodObject<{
480
+ cron: z.ZodString;
481
+ target: z.ZodObject<{
482
+ kind: z.ZodEnum<{
483
+ document: "document";
484
+ flow: "flow";
485
+ }>;
486
+ id: z.ZodString;
487
+ }, z.core.$strict>;
488
+ }, z.core.$strict>;
489
+ export type AgentSchedule = z.infer<typeof AgentSchedule>;
490
+ export declare const AgentModel: z.ZodObject<{
491
+ provider: z.ZodEnum<{
492
+ "workers-ai": "workers-ai";
493
+ anthropic: "anthropic";
494
+ }>;
495
+ model: z.ZodString;
496
+ }, z.core.$strict>;
497
+ export type AgentModel = z.infer<typeof AgentModel>;
498
+ /**
499
+ * One MCP server as the portal names it. The handle is what the portal puts in front of every tool
500
+ * that server offers (`notion_notion-search` belongs to `notion`), and it is the only identifier
501
+ * Intel can both store and recognise again in a live `tools/list`.
502
+ *
503
+ * ⚠️ A handle is never invented from a tool name. Which servers exist is the portal's answer
504
+ * (`portal_list_servers`), and the prefix is only used to attribute a tool to a server that answer
505
+ * already named — see `packages/api/src/tools/tool-servers` for why splitting on the underscore
506
+ * alone would be ambiguous.
507
+ */
508
+ export declare const ToolServerHandle: z.ZodString;
509
+ export type ToolServerHandle = z.infer<typeof ToolServerHandle>;
510
+ /**
511
+ * What a caller may ASK for: whole MCP servers, and nothing about who delegates them (D30).
512
+ *
513
+ * ⚠️ The absence of `delegatedBy` is the point, and it is why the write shape differs from the read
514
+ * shape at all. Intel writes that field from the session it authorized; a caller who could name
515
+ * somebody else would be handing an agent a portal connection they do not have, and the agent would
516
+ * act on it unattended. Leaving the field out of the input makes that structural instead of a
517
+ * runtime overwrite: a body carrying it is a parse error at the boundary, on every surface, and no
518
+ * screen ever has to invent a value it has no business knowing.
519
+ */
520
+ export declare const AgentToolSelection: z.ZodObject<{
521
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
522
+ }, z.core.$strict>;
523
+ export type AgentToolSelection = z.infer<typeof AgentToolSelection>;
524
+ /**
525
+ * What is STORED and read back: the selection plus whose portal connection it came from (D30).
526
+ *
527
+ * ⚠️ This is a selection, not a permission. Nothing here grants anything: whether a server is
528
+ * reachable is still decided by one live `tools/list` with `delegatedBy`'s own portal token, so a
529
+ * delegator who loses the server or the connection takes it away from the agent at the next run
530
+ * with no edit to this document.
531
+ *
532
+ * ⚠️ Read shape only. It appears in `AgentDefinition` and never in an input — see
533
+ * `AgentToolSelection` for why the two are deliberately different documents rather than one schema
534
+ * with an optional field.
535
+ */
536
+ export declare const AgentToolDelegation: z.ZodObject<{
537
+ delegatedBy: z.ZodString;
538
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
539
+ }, z.core.$strict>;
540
+ export type AgentToolDelegation = z.infer<typeof AgentToolDelegation>;
541
+ export declare const AgentDefinition: z.ZodObject<{
542
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
543
+ delegatedBy: z.ZodString;
544
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
545
+ }, z.core.$strict>>>;
546
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
547
+ nodeId: z.ZodString;
548
+ role: z.ZodEnum<{
549
+ "system-message": "system-message";
550
+ "semantic-context": "semantic-context";
551
+ memory: "memory";
552
+ }>;
553
+ }, z.core.$strict>>>;
554
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
555
+ cron: z.ZodString;
556
+ target: z.ZodObject<{
557
+ kind: z.ZodEnum<{
558
+ document: "document";
559
+ flow: "flow";
560
+ }>;
561
+ id: z.ZodString;
562
+ }, z.core.$strict>;
563
+ }, z.core.$strict>>>;
564
+ model: z.ZodObject<{
565
+ provider: z.ZodEnum<{
566
+ "workers-ai": "workers-ai";
567
+ anthropic: "anthropic";
568
+ }>;
569
+ model: z.ZodString;
570
+ }, z.core.$strict>;
571
+ }, z.core.$strict>;
572
+ export type AgentDefinition = z.infer<typeof AgentDefinition>;
573
+ /**
574
+ * The same document as `AgentDefinition`, minus the one field a caller may not write.
575
+ *
576
+ * ⚠️ Two schemas rather than one, and the split is load-bearing (#208, D30). Everything an agent IS
577
+ * comes from whoever edits it; **whose portal connection it acts on** does not, because that is an
578
+ * authority the editor would be granting to themselves. So the write shape simply has no place to
579
+ * put it: `{ tools: { servers: [...] } }` is what a screen or an MCP client sends, Intel adds
580
+ * `delegatedBy` from the session, and a body that tries to name one is refused by the strict object
581
+ * before any of it is read. The reading shape keeps the field because a reader must be able to see
582
+ * whose connection an agent runs on.
583
+ */
584
+ export declare const AgentDefinitionInput: z.ZodObject<{
585
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
586
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
587
+ }, z.core.$strict>>>;
588
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
589
+ nodeId: z.ZodString;
590
+ role: z.ZodEnum<{
591
+ "system-message": "system-message";
592
+ "semantic-context": "semantic-context";
593
+ memory: "memory";
594
+ }>;
595
+ }, z.core.$strict>>>;
596
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
597
+ cron: z.ZodString;
598
+ target: z.ZodObject<{
599
+ kind: z.ZodEnum<{
600
+ document: "document";
601
+ flow: "flow";
602
+ }>;
603
+ id: z.ZodString;
604
+ }, z.core.$strict>;
605
+ }, z.core.$strict>>>;
606
+ model: z.ZodObject<{
607
+ provider: z.ZodEnum<{
608
+ "workers-ai": "workers-ai";
609
+ anthropic: "anthropic";
610
+ }>;
611
+ model: z.ZodString;
612
+ }, z.core.$strict>;
613
+ }, z.core.$strict>;
614
+ export type AgentDefinitionInput = z.infer<typeof AgentDefinitionInput>;
615
+ export declare const SaveAgentDefinitionInput: z.ZodObject<{
616
+ nodeId: z.ZodString;
617
+ baseVersionId: z.ZodNullable<z.ZodString>;
618
+ definition: z.ZodObject<{
619
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
620
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
621
+ }, z.core.$strict>>>;
622
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
623
+ nodeId: z.ZodString;
624
+ role: z.ZodEnum<{
625
+ "system-message": "system-message";
626
+ "semantic-context": "semantic-context";
627
+ memory: "memory";
628
+ }>;
629
+ }, z.core.$strict>>>;
630
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
631
+ cron: z.ZodString;
632
+ target: z.ZodObject<{
633
+ kind: z.ZodEnum<{
634
+ document: "document";
635
+ flow: "flow";
636
+ }>;
637
+ id: z.ZodString;
638
+ }, z.core.$strict>;
639
+ }, z.core.$strict>>>;
640
+ model: z.ZodObject<{
641
+ provider: z.ZodEnum<{
642
+ "workers-ai": "workers-ai";
643
+ anthropic: "anthropic";
644
+ }>;
645
+ model: z.ZodString;
646
+ }, z.core.$strict>;
647
+ }, z.core.$strict>;
648
+ idempotencyKey: z.ZodString;
649
+ }, z.core.$strict>;
650
+ export type SaveAgentDefinitionInput = z.infer<typeof SaveAgentDefinitionInput>;
651
+ export declare const GetAgentInput: z.ZodObject<{
652
+ nodeId: z.ZodString;
653
+ }, z.core.$strict>;
654
+ export type GetAgentInput = z.infer<typeof GetAgentInput>;
655
+ export declare const PauseAgentInput: z.ZodObject<{
656
+ nodeId: z.ZodString;
657
+ }, z.core.$strict>;
658
+ export type PauseAgentInput = z.infer<typeof PauseAgentInput>;
659
+ export declare const RunAgentNowInput: z.ZodObject<{
660
+ nodeId: z.ZodString;
661
+ target: z.ZodObject<{
662
+ kind: z.ZodEnum<{
663
+ document: "document";
664
+ flow: "flow";
665
+ }>;
666
+ id: z.ZodString;
667
+ }, z.core.$strict>;
668
+ }, z.core.$strict>;
669
+ export type RunAgentNowInput = z.infer<typeof RunAgentNowInput>;
670
+ export declare const ListAgentsInput: z.ZodObject<{
671
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
672
+ includeArchived: z.ZodDefault<z.ZodBoolean>;
673
+ }, z.core.$strict>;
674
+ export type ListAgentsInput = z.infer<typeof ListAgentsInput>;
675
+ export declare const CreateAgentInput: z.ZodObject<{
676
+ parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
677
+ title: z.ZodString;
678
+ description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
679
+ definition: z.ZodObject<{
680
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
681
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
682
+ }, z.core.$strict>>>;
683
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
684
+ nodeId: z.ZodString;
685
+ role: z.ZodEnum<{
686
+ "system-message": "system-message";
687
+ "semantic-context": "semantic-context";
688
+ memory: "memory";
689
+ }>;
690
+ }, z.core.$strict>>>;
691
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
692
+ cron: z.ZodString;
693
+ target: z.ZodObject<{
694
+ kind: z.ZodEnum<{
695
+ document: "document";
696
+ flow: "flow";
697
+ }>;
698
+ id: z.ZodString;
699
+ }, z.core.$strict>;
700
+ }, z.core.$strict>>>;
701
+ model: z.ZodObject<{
702
+ provider: z.ZodEnum<{
703
+ "workers-ai": "workers-ai";
704
+ anthropic: "anthropic";
705
+ }>;
706
+ model: z.ZodString;
707
+ }, z.core.$strict>;
708
+ }, z.core.$strict>;
709
+ idempotencyKey: z.ZodString;
710
+ }, z.core.$strict>;
711
+ export type CreateAgentInput = z.infer<typeof CreateAgentInput>;
712
+ export declare const GateApplicationId: z.ZodString;
713
+ export declare const NodeAgent: z.ZodObject<{
714
+ node: z.ZodObject<{
715
+ id: z.ZodString;
716
+ parentId: z.ZodNullable<z.ZodString>;
717
+ kind: z.ZodEnum<{
718
+ folder: "folder";
719
+ document: "document";
720
+ attachment: "attachment";
721
+ table: "table";
722
+ agent: "agent";
723
+ }>;
724
+ title: z.ZodString;
725
+ description: z.ZodNullable<z.ZodString>;
726
+ ownerId: z.ZodString;
727
+ currentVersionId: z.ZodNullable<z.ZodString>;
728
+ createdAt: z.ZodISODateTime;
729
+ updatedAt: z.ZodISODateTime;
730
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
731
+ }, z.core.$strict>;
732
+ version: z.ZodNullable<z.ZodObject<{
733
+ id: z.ZodString;
734
+ nodeId: z.ZodString;
735
+ sequence: z.ZodNumber;
736
+ contentKey: z.ZodString;
737
+ mediaType: z.ZodString;
738
+ contentHash: z.ZodString;
739
+ size: z.ZodNumber;
740
+ segment: z.ZodNullable<z.ZodEnum<{
741
+ append: "append";
742
+ snapshot: "snapshot";
743
+ }>>;
744
+ createdBy: z.ZodString;
745
+ createdAt: z.ZodISODateTime;
746
+ }, z.core.$strict>>;
747
+ definition: z.ZodNullable<z.ZodObject<{
748
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
749
+ delegatedBy: z.ZodString;
750
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
751
+ }, z.core.$strict>>>;
752
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
753
+ nodeId: z.ZodString;
754
+ role: z.ZodEnum<{
755
+ "system-message": "system-message";
756
+ "semantic-context": "semantic-context";
757
+ memory: "memory";
758
+ }>;
759
+ }, z.core.$strict>>>;
760
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
761
+ cron: z.ZodString;
762
+ target: z.ZodObject<{
763
+ kind: z.ZodEnum<{
764
+ document: "document";
765
+ flow: "flow";
766
+ }>;
767
+ id: z.ZodString;
768
+ }, z.core.$strict>;
769
+ }, z.core.$strict>>>;
770
+ model: z.ZodObject<{
771
+ provider: z.ZodEnum<{
772
+ "workers-ai": "workers-ai";
773
+ anthropic: "anthropic";
774
+ }>;
775
+ model: z.ZodString;
776
+ }, z.core.$strict>;
777
+ }, z.core.$strict>>;
778
+ applicationId: z.ZodNullable<z.ZodString>;
779
+ }, z.core.$strict>;
780
+ export type NodeAgent = z.infer<typeof NodeAgent>;
781
+ /**
782
+ * ⚠️ There is NO key field in this file, and adding one back would be the regression (D29, #207).
783
+ *
784
+ * Until #207 the create answer carried the Application key in plain text, once, and a person had to
785
+ * carry it into a Worker secret by hand — which is why an agent created through the screen could
786
+ * never run (#200). The key now goes from Gate straight into the agent runtime over Intel's service
787
+ * binding and is encrypted into that agent's Durable Object; it reaches no browser, no MCP tool
788
+ * result and no response body at all. `NodeAgent` is a `z.strictObject`, so a field named `key`
789
+ * added anywhere in this file is a parse error at the boundary rather than a leak somebody has to
790
+ * spot in review.
791
+ *
792
+ * What `POST /nodes/agents` and `agent_create` answer is therefore exactly what every read answers:
793
+ * the node, its first definition, and the `applicationId` that NAMES the principal without
794
+ * authenticating it.
795
+ */
796
+ export declare const CreatedAgent: z.ZodObject<{
797
+ node: z.ZodObject<{
798
+ id: z.ZodString;
799
+ parentId: z.ZodNullable<z.ZodString>;
800
+ kind: z.ZodEnum<{
801
+ folder: "folder";
802
+ document: "document";
803
+ attachment: "attachment";
804
+ table: "table";
805
+ agent: "agent";
806
+ }>;
807
+ title: z.ZodString;
808
+ description: z.ZodNullable<z.ZodString>;
809
+ ownerId: z.ZodString;
810
+ currentVersionId: z.ZodNullable<z.ZodString>;
811
+ createdAt: z.ZodISODateTime;
812
+ updatedAt: z.ZodISODateTime;
813
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
814
+ }, z.core.$strict>;
815
+ version: z.ZodNullable<z.ZodObject<{
816
+ id: z.ZodString;
817
+ nodeId: z.ZodString;
818
+ sequence: z.ZodNumber;
819
+ contentKey: z.ZodString;
820
+ mediaType: z.ZodString;
821
+ contentHash: z.ZodString;
822
+ size: z.ZodNumber;
823
+ segment: z.ZodNullable<z.ZodEnum<{
824
+ append: "append";
825
+ snapshot: "snapshot";
826
+ }>>;
827
+ createdBy: z.ZodString;
828
+ createdAt: z.ZodISODateTime;
829
+ }, z.core.$strict>>;
830
+ definition: z.ZodNullable<z.ZodObject<{
831
+ tools: z.ZodDefault<z.ZodNullable<z.ZodObject<{
832
+ delegatedBy: z.ZodString;
833
+ servers: z.ZodDefault<z.ZodArray<z.ZodString>>;
834
+ }, z.core.$strict>>>;
835
+ references: z.ZodDefault<z.ZodArray<z.ZodObject<{
836
+ nodeId: z.ZodString;
837
+ role: z.ZodEnum<{
838
+ "system-message": "system-message";
839
+ "semantic-context": "semantic-context";
840
+ memory: "memory";
841
+ }>;
842
+ }, z.core.$strict>>>;
843
+ schedules: z.ZodDefault<z.ZodArray<z.ZodObject<{
844
+ cron: z.ZodString;
845
+ target: z.ZodObject<{
846
+ kind: z.ZodEnum<{
847
+ document: "document";
848
+ flow: "flow";
849
+ }>;
850
+ id: z.ZodString;
851
+ }, z.core.$strict>;
852
+ }, z.core.$strict>>>;
853
+ model: z.ZodObject<{
854
+ provider: z.ZodEnum<{
855
+ "workers-ai": "workers-ai";
856
+ anthropic: "anthropic";
857
+ }>;
858
+ model: z.ZodString;
859
+ }, z.core.$strict>;
860
+ }, z.core.$strict>>;
861
+ applicationId: z.ZodNullable<z.ZodString>;
862
+ }, z.core.$strict>;
863
+ export type CreatedAgent = z.infer<typeof CreatedAgent>;
864
+ export declare const RotateAgentKeyInput: z.ZodObject<{
865
+ nodeId: z.ZodString;
866
+ }, z.core.$strict>;
867
+ export type RotateAgentKeyInput = z.infer<typeof RotateAgentKeyInput>;
868
+ /**
869
+ * What replacing an agent's key answers.
870
+ *
871
+ * ⚠️ No key, and that is the whole shape of D29: Intel asks Gate for a new one, hands it to the
872
+ * runtime over the service binding, and forgets it inside the same call. What the caller gets is
873
+ * the fact that it happened, so a screen can say so — `applicationId` names the principal whose key
874
+ * was replaced, which is a name and not a credential.
875
+ */
876
+ export declare const AgentKeyRotated: z.ZodObject<{
877
+ nodeId: z.ZodString;
878
+ applicationId: z.ZodString;
879
+ rotatedAt: z.ZodISODateTime;
880
+ }, z.core.$strict>;
881
+ export type AgentKeyRotated = z.infer<typeof AgentKeyRotated>;
882
+ export declare const AgentList: z.ZodObject<{
883
+ items: z.ZodArray<z.ZodObject<{
884
+ id: z.ZodString;
885
+ parentId: z.ZodNullable<z.ZodString>;
886
+ kind: z.ZodEnum<{
887
+ folder: "folder";
888
+ document: "document";
889
+ attachment: "attachment";
890
+ table: "table";
891
+ agent: "agent";
892
+ }>;
893
+ title: z.ZodString;
894
+ description: z.ZodNullable<z.ZodString>;
895
+ ownerId: z.ZodString;
896
+ currentVersionId: z.ZodNullable<z.ZodString>;
897
+ createdAt: z.ZodISODateTime;
898
+ updatedAt: z.ZodISODateTime;
899
+ archivedAt: z.ZodNullable<z.ZodISODateTime>;
900
+ }, z.core.$strict>>;
901
+ }, z.core.$strict>;
902
+ export type AgentList = z.infer<typeof AgentList>;
903
+ export declare const NodeLinkRelation: z.ZodEnum<{
307
904
  references: "references";
308
905
  related: "related";
309
906
  depends_on: "depends_on";
310
907
  implements: "implements";
311
908
  }>;
312
- export type KnowledgeLinkRelation = z.infer<typeof KnowledgeLinkRelation>;
313
- export declare const KnowledgeLinkOrigin: z.ZodEnum<{
909
+ export type NodeLinkRelation = z.infer<typeof NodeLinkRelation>;
910
+ export declare const NodeLinkOrigin: z.ZodEnum<{
314
911
  text: "text";
315
912
  manual: "manual";
316
913
  }>;
317
- export type KnowledgeLinkOrigin = z.infer<typeof KnowledgeLinkOrigin>;
318
- export declare const KnowledgeLink: z.ZodObject<{
914
+ export type NodeLinkOrigin = z.infer<typeof NodeLinkOrigin>;
915
+ export declare const NodeLink: z.ZodObject<{
319
916
  id: z.ZodString;
320
917
  sourceNodeId: z.ZodString;
321
918
  targetNodeId: z.ZodString;
@@ -333,8 +930,8 @@ export declare const KnowledgeLink: z.ZodObject<{
333
930
  createdBy: z.ZodString;
334
931
  createdAt: z.ZodISODateTime;
335
932
  }, z.core.$strict>;
336
- export type KnowledgeLink = z.infer<typeof KnowledgeLink>;
337
- export declare const KnowledgeLinkList: z.ZodObject<{
933
+ export type NodeLink = z.infer<typeof NodeLink>;
934
+ export declare const NodeLinkList: z.ZodObject<{
338
935
  items: z.ZodArray<z.ZodObject<{
339
936
  id: z.ZodString;
340
937
  sourceNodeId: z.ZodString;
@@ -354,29 +951,29 @@ export declare const KnowledgeLinkList: z.ZodObject<{
354
951
  createdAt: z.ZodISODateTime;
355
952
  }, z.core.$strict>>;
356
953
  }, z.core.$strict>;
357
- export type KnowledgeLinkList = z.infer<typeof KnowledgeLinkList>;
954
+ export type NodeLinkList = z.infer<typeof NodeLinkList>;
358
955
  export declare const DocumentLinkInlineType = "documentLink";
359
- export declare const ResolveKnowledgeLinksInput: z.ZodObject<{
956
+ export declare const ResolveNodeLinksInput: z.ZodObject<{
360
957
  nodeIds: z.ZodArray<z.ZodString>;
361
958
  }, z.core.$strict>;
362
- export type ResolveKnowledgeLinksInput = z.infer<typeof ResolveKnowledgeLinksInput>;
363
- export declare const ResolvedKnowledgeLink: z.ZodObject<{
959
+ export type ResolveNodeLinksInput = z.infer<typeof ResolveNodeLinksInput>;
960
+ export declare const ResolvedNodeLink: z.ZodObject<{
364
961
  nodeId: z.ZodString;
365
962
  title: z.ZodString;
366
963
  }, z.core.$strict>;
367
- export type ResolvedKnowledgeLink = z.infer<typeof ResolvedKnowledgeLink>;
368
- export declare const ResolveKnowledgeLinksResult: z.ZodObject<{
964
+ export type ResolvedNodeLink = z.infer<typeof ResolvedNodeLink>;
965
+ export declare const ResolveNodeLinksResult: z.ZodObject<{
369
966
  items: z.ZodArray<z.ZodObject<{
370
967
  nodeId: z.ZodString;
371
968
  title: z.ZodString;
372
969
  }, z.core.$strict>>;
373
970
  }, z.core.$strict>;
374
- export type ResolveKnowledgeLinksResult = z.infer<typeof ResolveKnowledgeLinksResult>;
375
- export declare const KnowledgeGraphInput: z.ZodObject<{
971
+ export type ResolveNodeLinksResult = z.infer<typeof ResolveNodeLinksResult>;
972
+ export declare const NodeGraphInput: z.ZodObject<{
376
973
  limit: z.ZodDefault<z.ZodNumber>;
377
974
  }, z.core.$strict>;
378
- export type KnowledgeGraphInput = z.infer<typeof KnowledgeGraphInput>;
379
- export declare const KnowledgeGraph: z.ZodObject<{
975
+ export type NodeGraphInput = z.infer<typeof NodeGraphInput>;
976
+ export declare const NodeGraph: z.ZodObject<{
380
977
  nodes: z.ZodArray<z.ZodObject<{
381
978
  id: z.ZodString;
382
979
  parentId: z.ZodNullable<z.ZodString>;
@@ -385,6 +982,7 @@ export declare const KnowledgeGraph: z.ZodObject<{
385
982
  document: "document";
386
983
  attachment: "attachment";
387
984
  table: "table";
985
+ agent: "agent";
388
986
  }>;
389
987
  title: z.ZodString;
390
988
  description: z.ZodNullable<z.ZodString>;
@@ -413,7 +1011,7 @@ export declare const KnowledgeGraph: z.ZodObject<{
413
1011
  createdAt: z.ZodISODateTime;
414
1012
  }, z.core.$strict>>;
415
1013
  }, z.core.$strict>;
416
- export type KnowledgeGraph = z.infer<typeof KnowledgeGraph>;
1014
+ export type NodeGraph = z.infer<typeof NodeGraph>;
417
1015
  export declare const BlockNoteMediaType = "application/vnd.anchrd.intel.blocknote+json";
418
1016
  export declare const BlockNoteDocument: z.ZodObject<{
419
1017
  format: z.ZodLiteral<"blocknote">;
@@ -445,7 +1043,7 @@ export declare const ResourceGrant: z.ZodObject<{
445
1043
  createdAt: z.ZodISODateTime;
446
1044
  }, z.core.$strict>;
447
1045
  export type ResourceGrant = z.infer<typeof ResourceGrant>;
448
- export declare const ShareKnowledgeInput: z.ZodObject<{
1046
+ export declare const ShareInput: z.ZodObject<{
449
1047
  resourceId: z.ZodString;
450
1048
  principal: z.ZodDiscriminatedUnion<[z.ZodObject<{
451
1049
  type: z.ZodLiteral<"user">;
@@ -465,19 +1063,19 @@ export declare const ShareKnowledgeInput: z.ZodObject<{
465
1063
  expiresAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
466
1064
  idempotencyKey: z.ZodString;
467
1065
  }, z.core.$strict>;
468
- export type ShareKnowledgeInput = z.infer<typeof ShareKnowledgeInput>;
469
- export declare const RevokeKnowledgeGrantInput: z.ZodObject<{
1066
+ export type ShareInput = z.infer<typeof ShareInput>;
1067
+ export declare const RevokeGrantInput: z.ZodObject<{
470
1068
  resourceId: z.ZodString;
471
1069
  grantId: z.ZodString;
472
1070
  idempotencyKey: z.ZodString;
473
1071
  }, z.core.$strict>;
474
- export type RevokeKnowledgeGrantInput = z.infer<typeof RevokeKnowledgeGrantInput>;
475
- export declare const UnreadableKnowledge: z.ZodObject<{
1072
+ export type RevokeGrantInput = z.infer<typeof RevokeGrantInput>;
1073
+ export declare const UnreadableNodes: z.ZodObject<{
476
1074
  titles: z.ZodArray<z.ZodString>;
477
1075
  hidden: z.ZodNumber;
478
1076
  }, z.core.$strict>;
479
- export type UnreadableKnowledge = z.infer<typeof UnreadableKnowledge>;
480
- export declare const ShareKnowledgeResult: z.ZodObject<{
1077
+ export type UnreadableNodes = z.infer<typeof UnreadableNodes>;
1078
+ export declare const ShareResult: z.ZodObject<{
481
1079
  grant: z.ZodObject<{
482
1080
  id: z.ZodString;
483
1081
  resourceId: z.ZodString;
@@ -505,7 +1103,7 @@ export declare const ShareKnowledgeResult: z.ZodObject<{
505
1103
  hidden: z.ZodNumber;
506
1104
  }, z.core.$strict>;
507
1105
  }, z.core.$strict>;
508
- export type ShareKnowledgeResult = z.infer<typeof ShareKnowledgeResult>;
1106
+ export type ShareResult = z.infer<typeof ShareResult>;
509
1107
  export declare const ResourceGrantList: z.ZodObject<{
510
1108
  resourceId: z.ZodString;
511
1109
  applicableVerbs: z.ZodArray<z.ZodEnum<{
@@ -538,12 +1136,13 @@ export declare const ResourceGrantList: z.ZodObject<{
538
1136
  }, z.core.$strict>>;
539
1137
  }, z.core.$strict>;
540
1138
  export type ResourceGrantList = z.infer<typeof ResourceGrantList>;
541
- export declare const SearchKnowledgeInput: z.ZodObject<{
1139
+ export declare const SearchInput: z.ZodObject<{
542
1140
  query: z.ZodString;
543
1141
  limit: z.ZodDefault<z.ZodNumber>;
1142
+ scopeId: z.ZodOptional<z.ZodString>;
544
1143
  }, z.core.$strict>;
545
- export type SearchKnowledgeInput = z.infer<typeof SearchKnowledgeInput>;
546
- export declare const KnowledgeCitation: z.ZodObject<{
1144
+ export type SearchInput = z.infer<typeof SearchInput>;
1145
+ export declare const NodeCitation: z.ZodObject<{
547
1146
  nodeId: z.ZodString;
548
1147
  versionId: z.ZodString;
549
1148
  title: z.ZodString;
@@ -557,8 +1156,8 @@ export declare const KnowledgeCitation: z.ZodObject<{
557
1156
  hybrid: "hybrid";
558
1157
  }>;
559
1158
  }, z.core.$strict>;
560
- export type KnowledgeCitation = z.infer<typeof KnowledgeCitation>;
561
- export declare const SearchKnowledgeResult: z.ZodObject<{
1159
+ export type NodeCitation = z.infer<typeof NodeCitation>;
1160
+ export declare const SearchResult: z.ZodObject<{
562
1161
  items: z.ZodArray<z.ZodObject<{
563
1162
  nodeId: z.ZodString;
564
1163
  versionId: z.ZodString;
@@ -574,11 +1173,11 @@ export declare const SearchKnowledgeResult: z.ZodObject<{
574
1173
  }>;
575
1174
  }, z.core.$strict>>;
576
1175
  }, z.core.$strict>;
577
- export type SearchKnowledgeResult = z.infer<typeof SearchKnowledgeResult>;
578
- export declare const ReindexKnowledgeResult: z.ZodObject<{
1176
+ export type SearchResult = z.infer<typeof SearchResult>;
1177
+ export declare const ReindexResult: z.ZodObject<{
579
1178
  queued: z.ZodNumber;
580
1179
  }, z.core.$strict>;
581
- export type ReindexKnowledgeResult = z.infer<typeof ReindexKnowledgeResult>;
1180
+ export type ReindexResult = z.infer<typeof ReindexResult>;
582
1181
  export declare const RevokeGrantResult: z.ZodObject<{
583
1182
  revoked: z.ZodBoolean;
584
1183
  }, z.core.$strict>;
@@ -628,6 +1227,53 @@ export declare const ToolCatalog: z.ZodObject<{
628
1227
  }, z.core.$strict>>;
629
1228
  }, z.core.$strict>;
630
1229
  export type ToolCatalog = z.infer<typeof ToolCatalog>;
1230
+ /**
1231
+ * One MCP server the asking user reaches right now, as the portal itself names it (D30).
1232
+ *
1233
+ * ⚠️ `toolCount` is a fact about this moment and this user, not a size. It exists so a picker can
1234
+ * say "9 tools" instead of showing a handle alone, and it must never be read as what an agent will
1235
+ * get: the delegated run asks the portal again, with the delegator's token.
1236
+ */
1237
+ export declare const ToolServer: z.ZodObject<{
1238
+ handle: z.ZodString;
1239
+ name: z.ZodString;
1240
+ toolCount: z.ZodNumber;
1241
+ }, z.core.$strict>;
1242
+ export type ToolServer = z.infer<typeof ToolServer>;
1243
+ export declare const ToolServerCatalog: z.ZodObject<{
1244
+ portalConnected: z.ZodBoolean;
1245
+ items: z.ZodArray<z.ZodObject<{
1246
+ handle: z.ZodString;
1247
+ name: z.ZodString;
1248
+ toolCount: z.ZodNumber;
1249
+ }, z.core.$strict>>;
1250
+ }, z.core.$strict>;
1251
+ export type ToolServerCatalog = z.infer<typeof ToolServerCatalog>;
1252
+ /**
1253
+ * Which of the named servers a tool belongs to, or `null` for none of them.
1254
+ *
1255
+ * ⚠️ THE TRAP: a tool name does not say where its server name ends.
1256
+ *
1257
+ * The portal writes `<server>_<tool>`, and both halves may contain underscores — `intel_flow_get`
1258
+ * reads equally well as server `intel` with tool `flow_get` and as a server called `intel_flow`
1259
+ * with tool `get`. Splitting on the first underscore is therefore a guess that is wrong the day
1260
+ * somebody adds a server whose name contains one, and on the API side being wrong means an agent
1261
+ * delegated server A quietly reaching server B.
1262
+ *
1263
+ * So the prefix is never split. It is only ever MATCHED against handles the portal itself named,
1264
+ * and the longest match wins: with `intel` and `intel_flow` both declared, `intel_flow_get` belongs
1265
+ * to `intel_flow`, which is the only reading in which both declarations stay true.
1266
+ *
1267
+ * ⚠️ This lives in the contract because HOW A NAME IS READ is a property of the wire, and both
1268
+ * surfaces read the same wire: `packages/api` cuts a delegation with it, `packages/ui` groups the
1269
+ * tools screen with it (#212). A second implementation in the browser would be the third answer to
1270
+ * one question — the underscore rule has already been answered differently in two places once
1271
+ * (#106, #107), and the copies disagreed. What deliberately stays OUT of here is everything about
1272
+ * reach: which handles are declared, which are enabled, which may be delegated and which one owns
1273
+ * the portal's own management tools are decisions with consequences, and they belong to
1274
+ * `packages/api/src/tools/tool-servers`. This function only reads a name.
1275
+ */
1276
+ export declare function serverOf(toolName: string, handles: Iterable<string>): string | null;
631
1277
  export declare const TestToolInput: z.ZodObject<{
632
1278
  name: z.ZodString;
633
1279
  arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1263,6 +1909,32 @@ export declare const FlowDocument: z.ZodObject<{
1263
1909
  }, z.core.$strict>>;
1264
1910
  }, z.core.$strict>;
1265
1911
  export type FlowDocument = z.infer<typeof FlowDocument>;
1912
+ export declare const FlowVersionSummary: z.ZodObject<{
1913
+ id: z.ZodString;
1914
+ flowId: z.ZodString;
1915
+ sequence: z.ZodNumber;
1916
+ createdBy: z.ZodString;
1917
+ createdAt: z.ZodISODateTime;
1918
+ published: z.ZodBoolean;
1919
+ }, z.core.$strict>;
1920
+ export type FlowVersionSummary = z.infer<typeof FlowVersionSummary>;
1921
+ export declare const FlowVersionList: z.ZodObject<{
1922
+ flowId: z.ZodString;
1923
+ items: z.ZodArray<z.ZodObject<{
1924
+ id: z.ZodString;
1925
+ flowId: z.ZodString;
1926
+ sequence: z.ZodNumber;
1927
+ createdBy: z.ZodString;
1928
+ createdAt: z.ZodISODateTime;
1929
+ published: z.ZodBoolean;
1930
+ }, z.core.$strict>>;
1931
+ }, z.core.$strict>;
1932
+ export type FlowVersionList = z.infer<typeof FlowVersionList>;
1933
+ export declare const GetFlowVersionInput: z.ZodObject<{
1934
+ flowId: z.ZodString;
1935
+ versionId: z.ZodString;
1936
+ }, z.core.$strict>;
1937
+ export type GetFlowVersionInput = z.infer<typeof GetFlowVersionInput>;
1266
1938
  export declare const FlowList: z.ZodObject<{
1267
1939
  items: z.ZodArray<z.ZodObject<{
1268
1940
  id: z.ZodString;
@@ -1279,19 +1951,19 @@ export declare const FlowList: z.ZodObject<{
1279
1951
  withCalls: z.ZodDefault<z.ZodArray<z.ZodString>>;
1280
1952
  }, z.core.$strict>;
1281
1953
  export type FlowList = z.infer<typeof FlowList>;
1282
- export declare const FlowKnowledgeReference: z.ZodObject<{
1954
+ export declare const ReferencedNode: z.ZodObject<{
1283
1955
  id: z.ZodString;
1284
1956
  title: z.ZodString;
1285
1957
  }, z.core.$strict>;
1286
- export type FlowKnowledgeReference = z.infer<typeof FlowKnowledgeReference>;
1958
+ export type ReferencedNode = z.infer<typeof ReferencedNode>;
1287
1959
  export declare const FlowRequirements: z.ZodObject<{
1288
1960
  flowId: z.ZodString;
1289
1961
  versionId: z.ZodNullable<z.ZodString>;
1290
- knowledge: z.ZodArray<z.ZodObject<{
1962
+ nodes: z.ZodArray<z.ZodObject<{
1291
1963
  id: z.ZodString;
1292
1964
  title: z.ZodString;
1293
1965
  }, z.core.$strict>>;
1294
- hiddenKnowledge: z.ZodNumber;
1966
+ hiddenNodes: z.ZodNumber;
1295
1967
  tools: z.ZodArray<z.ZodString>;
1296
1968
  }, z.core.$strict>;
1297
1969
  export type FlowRequirements = z.infer<typeof FlowRequirements>;
@@ -1483,6 +2155,11 @@ export declare const PublishFlowInput: z.ZodObject<{
1483
2155
  idempotencyKey: z.ZodString;
1484
2156
  }, z.core.$strict>;
1485
2157
  export type PublishFlowInput = z.infer<typeof PublishFlowInput>;
2158
+ export declare const UnpublishFlowInput: z.ZodObject<{
2159
+ flowId: z.ZodString;
2160
+ idempotencyKey: z.ZodString;
2161
+ }, z.core.$strict>;
2162
+ export type UnpublishFlowInput = z.infer<typeof UnpublishFlowInput>;
1486
2163
  export declare const PreviewFlowPublishInput: z.ZodObject<{
1487
2164
  flowId: z.ZodString;
1488
2165
  versionId: z.ZodString;
@@ -1529,6 +2206,7 @@ export declare const RelationNodeKind: z.ZodEnum<{
1529
2206
  document: "document";
1530
2207
  attachment: "attachment";
1531
2208
  table: "table";
2209
+ agent: "agent";
1532
2210
  flow: "flow";
1533
2211
  }>;
1534
2212
  export type RelationNodeKind = z.infer<typeof RelationNodeKind>;
@@ -1539,6 +2217,7 @@ export declare const RelationNode: z.ZodObject<{
1539
2217
  document: "document";
1540
2218
  attachment: "attachment";
1541
2219
  table: "table";
2220
+ agent: "agent";
1542
2221
  flow: "flow";
1543
2222
  }>;
1544
2223
  title: z.ZodString;
@@ -1589,6 +2268,7 @@ export declare const RelationGraph: z.ZodObject<{
1589
2268
  document: "document";
1590
2269
  attachment: "attachment";
1591
2270
  table: "table";
2271
+ agent: "agent";
1592
2272
  flow: "flow";
1593
2273
  }>;
1594
2274
  title: z.ZodString;
@@ -1812,6 +2492,11 @@ export declare const GetFlowRunInput: z.ZodObject<{
1812
2492
  runId: z.ZodString;
1813
2493
  }, z.core.$strict>;
1814
2494
  export type GetFlowRunInput = z.infer<typeof GetFlowRunInput>;
2495
+ export declare const CancelFlowRunInput: z.ZodObject<{
2496
+ runId: z.ZodString;
2497
+ idempotencyKey: z.ZodString;
2498
+ }, z.core.$strict>;
2499
+ export type CancelFlowRunInput = z.infer<typeof CancelFlowRunInput>;
1815
2500
  export declare const CompleteFlowRunStepInput: z.ZodObject<{
1816
2501
  runId: z.ZodString;
1817
2502
  nodeId: z.ZodString;
@@ -1947,3 +2632,70 @@ export declare const FlowRunHistory: z.ZodObject<{
1947
2632
  }, z.core.$strict>>;
1948
2633
  }, z.core.$strict>;
1949
2634
  export type FlowRunHistory = z.infer<typeof FlowRunHistory>;
2635
+ export declare const BundleManifestFilename = "manifest.json";
2636
+ export declare const BundleEntryKind: z.ZodEnum<{
2637
+ folder: "folder";
2638
+ document: "document";
2639
+ attachment: "attachment";
2640
+ table: "table";
2641
+ agent: "agent";
2642
+ flow: "flow";
2643
+ }>;
2644
+ export type BundleEntryKind = z.infer<typeof BundleEntryKind>;
2645
+ export declare const BundleManifestEntry: z.ZodObject<{
2646
+ id: z.ZodString;
2647
+ kind: z.ZodEnum<{
2648
+ folder: "folder";
2649
+ document: "document";
2650
+ attachment: "attachment";
2651
+ table: "table";
2652
+ agent: "agent";
2653
+ flow: "flow";
2654
+ }>;
2655
+ title: z.ZodString;
2656
+ description: z.ZodNullable<z.ZodString>;
2657
+ mediaType: z.ZodNullable<z.ZodString>;
2658
+ path: z.ZodString;
2659
+ }, z.core.$strict>;
2660
+ export type BundleManifestEntry = z.infer<typeof BundleManifestEntry>;
2661
+ export declare const BundleExclusion: z.ZodEnum<{
2662
+ "version-history": "version-history";
2663
+ grants: "grants";
2664
+ "flow-runs": "flow-runs";
2665
+ "archived-nodes": "archived-nodes";
2666
+ }>;
2667
+ export type BundleExclusion = z.infer<typeof BundleExclusion>;
2668
+ export declare const BundleManifest: z.ZodObject<{
2669
+ version: z.ZodLiteral<1>;
2670
+ exportedAt: z.ZodISODateTime;
2671
+ rootId: z.ZodNullable<z.ZodString>;
2672
+ entries: z.ZodArray<z.ZodObject<{
2673
+ id: z.ZodString;
2674
+ kind: z.ZodEnum<{
2675
+ folder: "folder";
2676
+ document: "document";
2677
+ attachment: "attachment";
2678
+ table: "table";
2679
+ agent: "agent";
2680
+ flow: "flow";
2681
+ }>;
2682
+ title: z.ZodString;
2683
+ description: z.ZodNullable<z.ZodString>;
2684
+ mediaType: z.ZodNullable<z.ZodString>;
2685
+ path: z.ZodString;
2686
+ }, z.core.$strict>>;
2687
+ excluded: z.ZodArray<z.ZodEnum<{
2688
+ "version-history": "version-history";
2689
+ grants: "grants";
2690
+ "flow-runs": "flow-runs";
2691
+ "archived-nodes": "archived-nodes";
2692
+ }>>;
2693
+ }, z.core.$strict>;
2694
+ export type BundleManifest = z.infer<typeof BundleManifest>;
2695
+ export declare const BundleImportResult: z.ZodObject<{
2696
+ nodes: z.ZodNumber;
2697
+ flows: z.ZodNumber;
2698
+ rootNodeIds: z.ZodArray<z.ZodString>;
2699
+ replayed: z.ZodBoolean;
2700
+ }, z.core.$strict>;
2701
+ export type BundleImportResult = z.infer<typeof BundleImportResult>;