@inkeep/agents-core 0.16.3 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-72MXE5SX.js → chunk-E4SFK6AI.js} +143 -157
- package/dist/{chunk-VPJ6Z5QZ.js → chunk-ID4CFGVF.js} +202 -131
- package/dist/chunk-JTHQYGCX.js +173 -0
- package/dist/chunk-TCLX6C3C.js +271 -0
- package/dist/client-exports.cjs +622 -272
- package/dist/client-exports.d.cts +6 -5
- package/dist/client-exports.d.ts +6 -5
- package/dist/client-exports.js +5 -4
- package/dist/db/schema.cjs +201 -130
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +2734 -1831
- package/dist/index.d.cts +1667 -1550
- package/dist/index.d.ts +1667 -1550
- package/dist/index.js +1880 -1394
- package/dist/{schema-BQk_FMBV.d.ts → schema-Bjy5TkFv.d.cts} +473 -172
- package/dist/{schema-Ct2NlO81.d.cts → schema-CfWbqju2.d.ts} +473 -172
- package/dist/signoz-queries-CifqdbnO.d.cts +269 -0
- package/dist/signoz-queries-CifqdbnO.d.ts +269 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-s9c5CVOe.d.cts → utility-Fxoh7s82.d.cts} +585 -384
- package/dist/{utility-s9c5CVOe.d.ts → utility-Fxoh7s82.d.ts} +585 -384
- package/dist/validation/index.cjs +429 -325
- package/dist/validation/index.d.cts +76 -4
- package/dist/validation/index.d.ts +76 -4
- package/dist/validation/index.js +2 -2
- package/drizzle/0005_wide_shriek.sql +127 -0
- package/drizzle/0006_damp_lenny_balinger.sql +52 -0
- package/drizzle/meta/0005_snapshot.json +2558 -0
- package/drizzle/meta/0006_snapshot.json +2751 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +1 -1
- package/dist/chunk-N43VFJD3.js +0 -134
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ All data access functions follow a consistent functional pattern with dependency
|
|
|
35
35
|
export const getAgentById = (db: DatabaseClient) => async (params: {
|
|
36
36
|
tenantId: string;
|
|
37
37
|
projectId: string;
|
|
38
|
-
|
|
38
|
+
subAgentId: string;
|
|
39
39
|
}) => {
|
|
40
40
|
// Implementation
|
|
41
41
|
};
|
|
@@ -76,7 +76,7 @@ const getAgent = getAgentById(db);
|
|
|
76
76
|
const agent = await getAgent({
|
|
77
77
|
tenantId: 'tenant-1',
|
|
78
78
|
projectId: 'project-1',
|
|
79
|
-
|
|
79
|
+
subAgentId: 'agent-1'
|
|
80
80
|
});
|
|
81
81
|
```
|
|
82
82
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { subAgents, subAgentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, ledgerArtifacts, projects } from './chunk-ID4CFGVF.js';
|
|
1
2
|
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
|
|
2
|
-
import { agents, agentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, externalAgents, apiKeys, credentialReferences, functions, contextConfigs, agentToolRelations, ledgerArtifacts, projects } from './chunk-VPJ6Z5QZ.js';
|
|
3
3
|
import { z } from '@hono/zod-openapi';
|
|
4
4
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
5
5
|
import Ajv from 'ajv';
|
|
@@ -9,7 +9,7 @@ var StopWhenSchema = z.object({
|
|
|
9
9
|
stepCountIs: z.number().min(1).max(1e3).optional()
|
|
10
10
|
});
|
|
11
11
|
var GraphStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true });
|
|
12
|
-
var
|
|
12
|
+
var SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true });
|
|
13
13
|
var MIN_ID_LENGTH = 1;
|
|
14
14
|
var MAX_ID_LENGTH = 255;
|
|
15
15
|
var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
@@ -52,71 +52,73 @@ var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId:
|
|
|
52
52
|
var createGraphScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true });
|
|
53
53
|
var createGraphScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true });
|
|
54
54
|
var createGraphScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true }).partial();
|
|
55
|
-
var
|
|
56
|
-
var
|
|
55
|
+
var SubAgentSelectSchema = createSelectSchema(subAgents);
|
|
56
|
+
var SubAgentInsertSchema = createInsertSchema(subAgents).extend({
|
|
57
57
|
id: resourceIdSchema,
|
|
58
58
|
models: ModelSchema.optional()
|
|
59
59
|
});
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var
|
|
60
|
+
var SubAgentUpdateSchema = SubAgentInsertSchema.partial();
|
|
61
|
+
var SubAgentApiSelectSchema = createGraphScopedApiSchema(SubAgentSelectSchema);
|
|
62
|
+
var SubAgentApiInsertSchema = createGraphScopedApiInsertSchema(SubAgentInsertSchema);
|
|
63
|
+
var SubAgentApiUpdateSchema = createGraphScopedApiUpdateSchema(SubAgentUpdateSchema);
|
|
64
|
+
var SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);
|
|
65
|
+
var SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
66
66
|
id: resourceIdSchema,
|
|
67
67
|
graphId: resourceIdSchema,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
var
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
sourceSubAgentId: resourceIdSchema,
|
|
69
|
+
targetSubAgentId: resourceIdSchema.optional(),
|
|
70
|
+
externalSubAgentId: resourceIdSchema.optional()
|
|
71
|
+
});
|
|
72
|
+
var SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
|
|
73
|
+
var SubAgentRelationApiSelectSchema = createGraphScopedApiSchema(
|
|
74
|
+
SubAgentRelationSelectSchema
|
|
75
|
+
);
|
|
76
|
+
var SubAgentRelationApiInsertSchema = createGraphScopedApiInsertSchema(
|
|
77
|
+
SubAgentRelationInsertSchema
|
|
76
78
|
).extend({
|
|
77
79
|
relationType: z.enum(VALID_RELATION_TYPES)
|
|
78
80
|
}).refine(
|
|
79
81
|
(data) => {
|
|
80
|
-
const hasTarget = data.
|
|
81
|
-
const hasExternal = data.
|
|
82
|
+
const hasTarget = data.targetSubAgentId != null;
|
|
83
|
+
const hasExternal = data.externalSubAgentId != null;
|
|
82
84
|
return hasTarget !== hasExternal;
|
|
83
85
|
},
|
|
84
86
|
{
|
|
85
|
-
message: "Must specify exactly one of
|
|
86
|
-
path: ["
|
|
87
|
+
message: "Must specify exactly one of targetSubAgentId or externalSubAgentId",
|
|
88
|
+
path: ["targetSubAgentId", "externalSubAgentId"]
|
|
87
89
|
}
|
|
88
90
|
);
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
+
var SubAgentRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
|
|
92
|
+
SubAgentRelationUpdateSchema
|
|
91
93
|
).extend({
|
|
92
94
|
relationType: z.enum(VALID_RELATION_TYPES).optional()
|
|
93
95
|
}).refine(
|
|
94
96
|
(data) => {
|
|
95
|
-
const hasTarget = data.
|
|
96
|
-
const hasExternal = data.
|
|
97
|
+
const hasTarget = data.targetSubAgentId != null;
|
|
98
|
+
const hasExternal = data.externalSubAgentId != null;
|
|
97
99
|
if (!hasTarget && !hasExternal) {
|
|
98
100
|
return true;
|
|
99
101
|
}
|
|
100
102
|
return hasTarget !== hasExternal;
|
|
101
103
|
},
|
|
102
104
|
{
|
|
103
|
-
message: "Must specify exactly one of
|
|
104
|
-
path: ["
|
|
105
|
+
message: "Must specify exactly one of targetSubAgentId or externalSubAgentId when updating sub-agent relationships",
|
|
106
|
+
path: ["targetSubAgentId", "externalSubAgentId"]
|
|
105
107
|
}
|
|
106
108
|
);
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
var SubAgentRelationQuerySchema = z.object({
|
|
110
|
+
sourceSubAgentId: z.string().optional(),
|
|
111
|
+
targetSubAgentId: z.string().optional(),
|
|
112
|
+
externalSubAgentId: z.string().optional()
|
|
111
113
|
});
|
|
112
|
-
var
|
|
114
|
+
var ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
113
115
|
id: resourceIdSchema,
|
|
114
116
|
graphId: resourceIdSchema,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
sourceSubAgentId: resourceIdSchema,
|
|
118
|
+
externalSubAgentId: resourceIdSchema
|
|
117
119
|
});
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
+
var ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
|
|
121
|
+
ExternalSubAgentRelationInsertSchema
|
|
120
122
|
);
|
|
121
123
|
var AgentGraphSelectSchema = createSelectSchema(agentGraph);
|
|
122
124
|
var AgentGraphInsertSchema = createInsertSchema(agentGraph).extend({
|
|
@@ -183,32 +185,22 @@ var ToolSelectSchema = createSelectSchema(tools);
|
|
|
183
185
|
var ToolInsertSchema = createInsertSchema(tools).extend({
|
|
184
186
|
id: resourceIdSchema,
|
|
185
187
|
imageUrl: imageUrlSchema,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
reconnectionOptions: z.custom().optional(),
|
|
201
|
-
sessionId: z.string().optional()
|
|
202
|
-
}).optional(),
|
|
203
|
-
activeTools: z.array(z.string()).optional()
|
|
204
|
-
})
|
|
205
|
-
}),
|
|
206
|
-
// Function tools (reference-only, no inline duplication)
|
|
207
|
-
z.object({
|
|
208
|
-
type: z.literal("function")
|
|
209
|
-
// No inline function details - they're in the functions table via functionId
|
|
188
|
+
config: z.object({
|
|
189
|
+
type: z.literal("mcp"),
|
|
190
|
+
mcp: z.object({
|
|
191
|
+
server: z.object({
|
|
192
|
+
url: z.string().url()
|
|
193
|
+
}),
|
|
194
|
+
transport: z.object({
|
|
195
|
+
type: z.enum(MCPTransportType),
|
|
196
|
+
requestInit: z.record(z.string(), z.unknown()).optional(),
|
|
197
|
+
eventSourceInit: z.record(z.string(), z.unknown()).optional(),
|
|
198
|
+
reconnectionOptions: z.custom().optional(),
|
|
199
|
+
sessionId: z.string().optional()
|
|
200
|
+
}).optional(),
|
|
201
|
+
activeTools: z.array(z.string()).optional()
|
|
210
202
|
})
|
|
211
|
-
|
|
203
|
+
})
|
|
212
204
|
});
|
|
213
205
|
var ConversationSelectSchema = createSelectSchema(conversations);
|
|
214
206
|
var ConversationInsertSchema = createInsertSchema(conversations).extend({
|
|
@@ -247,20 +239,20 @@ var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
|
|
|
247
239
|
var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema);
|
|
248
240
|
var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema);
|
|
249
241
|
var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema);
|
|
250
|
-
var
|
|
251
|
-
var
|
|
252
|
-
var
|
|
253
|
-
var
|
|
254
|
-
|
|
242
|
+
var SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);
|
|
243
|
+
var SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);
|
|
244
|
+
var SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
|
|
245
|
+
var SubAgentDataComponentApiSelectSchema = createGraphScopedApiSchema(
|
|
246
|
+
SubAgentDataComponentSelectSchema
|
|
255
247
|
);
|
|
256
|
-
var
|
|
248
|
+
var SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omit({
|
|
257
249
|
tenantId: true,
|
|
258
250
|
projectId: true,
|
|
259
251
|
id: true,
|
|
260
252
|
createdAt: true
|
|
261
253
|
});
|
|
262
|
-
var
|
|
263
|
-
|
|
254
|
+
var SubAgentDataComponentApiUpdateSchema = createGraphScopedApiUpdateSchema(
|
|
255
|
+
SubAgentDataComponentUpdateSchema
|
|
264
256
|
);
|
|
265
257
|
var ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);
|
|
266
258
|
var ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({
|
|
@@ -277,26 +269,26 @@ var ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({
|
|
|
277
269
|
var ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
|
|
278
270
|
ArtifactComponentUpdateSchema
|
|
279
271
|
);
|
|
280
|
-
var
|
|
281
|
-
var
|
|
282
|
-
|
|
272
|
+
var SubAgentArtifactComponentSelectSchema = createSelectSchema(subAgentArtifactComponents);
|
|
273
|
+
var SubAgentArtifactComponentInsertSchema = createInsertSchema(
|
|
274
|
+
subAgentArtifactComponents
|
|
283
275
|
).extend({
|
|
284
276
|
id: resourceIdSchema,
|
|
285
|
-
|
|
277
|
+
subAgentId: resourceIdSchema,
|
|
286
278
|
artifactComponentId: resourceIdSchema
|
|
287
279
|
});
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
|
|
280
|
+
var SubAgentArtifactComponentUpdateSchema = SubAgentArtifactComponentInsertSchema.partial();
|
|
281
|
+
var SubAgentArtifactComponentApiSelectSchema = createGraphScopedApiSchema(
|
|
282
|
+
SubAgentArtifactComponentSelectSchema
|
|
291
283
|
);
|
|
292
|
-
var
|
|
284
|
+
var SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSchema.omit({
|
|
293
285
|
tenantId: true,
|
|
294
286
|
projectId: true,
|
|
295
287
|
id: true,
|
|
296
288
|
createdAt: true
|
|
297
289
|
});
|
|
298
|
-
var
|
|
299
|
-
|
|
290
|
+
var SubAgentArtifactComponentApiUpdateSchema = createGraphScopedApiUpdateSchema(
|
|
291
|
+
SubAgentArtifactComponentUpdateSchema
|
|
300
292
|
);
|
|
301
293
|
var ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
302
294
|
credentialReferenceId: z.string().nullable().optional(),
|
|
@@ -310,7 +302,7 @@ var ExternalAgentApiSelectSchema = createGraphScopedApiSchema(ExternalAgentSelec
|
|
|
310
302
|
var ExternalAgentApiInsertSchema = createGraphScopedApiInsertSchema(ExternalAgentInsertSchema);
|
|
311
303
|
var ExternalAgentApiUpdateSchema = createGraphScopedApiUpdateSchema(ExternalAgentUpdateSchema);
|
|
312
304
|
var AllAgentSchema = z.discriminatedUnion("type", [
|
|
313
|
-
|
|
305
|
+
SubAgentApiSelectSchema.extend({ type: z.literal("internal") }),
|
|
314
306
|
ExternalAgentApiSelectSchema.extend({ type: z.literal("external") })
|
|
315
307
|
]);
|
|
316
308
|
var ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
@@ -418,6 +410,14 @@ var ToolUpdateSchema = ToolInsertSchema.partial();
|
|
|
418
410
|
var ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
|
|
419
411
|
var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
|
|
420
412
|
var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
|
|
413
|
+
var FunctionToolSelectSchema = createSelectSchema(functionTools);
|
|
414
|
+
var FunctionToolInsertSchema = createInsertSchema(functionTools).extend({
|
|
415
|
+
id: resourceIdSchema
|
|
416
|
+
});
|
|
417
|
+
var FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
|
|
418
|
+
var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema);
|
|
419
|
+
var FunctionToolApiInsertSchema = createGraphScopedApiInsertSchema(FunctionToolInsertSchema);
|
|
420
|
+
var FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema);
|
|
421
421
|
var FunctionSelectSchema = createSelectSchema(functions);
|
|
422
422
|
var FunctionInsertSchema = createInsertSchema(functions).extend({
|
|
423
423
|
id: resourceIdSchema
|
|
@@ -465,23 +465,23 @@ var ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSche
|
|
|
465
465
|
var ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
|
|
466
466
|
graphId: true
|
|
467
467
|
});
|
|
468
|
-
var
|
|
469
|
-
var
|
|
468
|
+
var SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);
|
|
469
|
+
var SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({
|
|
470
470
|
id: resourceIdSchema,
|
|
471
|
-
|
|
471
|
+
subAgentId: resourceIdSchema,
|
|
472
472
|
toolId: resourceIdSchema,
|
|
473
473
|
selectedTools: z.array(z.string()).nullish(),
|
|
474
474
|
headers: z.record(z.string(), z.string()).nullish()
|
|
475
475
|
});
|
|
476
|
-
var
|
|
477
|
-
var
|
|
478
|
-
|
|
476
|
+
var SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();
|
|
477
|
+
var SubAgentToolRelationApiSelectSchema = createGraphScopedApiSchema(
|
|
478
|
+
SubAgentToolRelationSelectSchema
|
|
479
479
|
);
|
|
480
|
-
var
|
|
481
|
-
|
|
480
|
+
var SubAgentToolRelationApiInsertSchema = createGraphScopedApiInsertSchema(
|
|
481
|
+
SubAgentToolRelationInsertSchema
|
|
482
482
|
);
|
|
483
|
-
var
|
|
484
|
-
|
|
483
|
+
var SubAgentToolRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
|
|
484
|
+
SubAgentToolRelationUpdateSchema
|
|
485
485
|
);
|
|
486
486
|
var LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
|
|
487
487
|
var LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);
|
|
@@ -511,7 +511,7 @@ var CanUseItemSchema = z.object({
|
|
|
511
511
|
toolSelection: z.array(z.string()).nullish(),
|
|
512
512
|
headers: z.record(z.string(), z.string()).nullish()
|
|
513
513
|
});
|
|
514
|
-
var FullGraphAgentInsertSchema =
|
|
514
|
+
var FullGraphAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
515
515
|
type: z.literal("internal"),
|
|
516
516
|
canUse: z.array(CanUseItemSchema),
|
|
517
517
|
// All tools (both MCP and function tools)
|
|
@@ -521,10 +521,15 @@ var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
|
521
521
|
canDelegateTo: z.array(z.string()).optional()
|
|
522
522
|
});
|
|
523
523
|
var FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
|
|
524
|
-
|
|
524
|
+
subAgents: z.record(
|
|
525
|
+
z.string(),
|
|
526
|
+
z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])
|
|
527
|
+
),
|
|
525
528
|
// Lookup maps for UI to resolve canUse items
|
|
526
529
|
tools: z.record(z.string(), ToolApiInsertSchema).optional(),
|
|
527
|
-
//
|
|
530
|
+
// MCP tools (project-scoped)
|
|
531
|
+
functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),
|
|
532
|
+
// Function tools (graph-scoped)
|
|
528
533
|
functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
|
|
529
534
|
// Get function code for function tools
|
|
530
535
|
contextConfig: z.optional(ContextConfigApiInsertSchema),
|
|
@@ -534,13 +539,20 @@ var FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
|
|
|
534
539
|
graphPrompt: z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
535
540
|
});
|
|
536
541
|
var GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
|
|
537
|
-
|
|
542
|
+
subAgents: z.record(
|
|
538
543
|
z.string(),
|
|
539
544
|
z.discriminatedUnion("type", [
|
|
540
545
|
FullGraphAgentInsertSchema,
|
|
541
546
|
ExternalAgentApiInsertSchema.extend({ type: z.literal("external") })
|
|
542
547
|
])
|
|
543
548
|
),
|
|
549
|
+
// Lookup maps for UI to resolve canUse items
|
|
550
|
+
tools: z.record(z.string(), ToolApiInsertSchema).optional(),
|
|
551
|
+
// MCP tools (project-scoped)
|
|
552
|
+
functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),
|
|
553
|
+
// Function tools (graph-scoped)
|
|
554
|
+
functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
|
|
555
|
+
// Get function code for function tools
|
|
544
556
|
contextConfig: z.optional(ContextConfigApiInsertSchema),
|
|
545
557
|
statusUpdates: z.optional(StatusUpdateSchema),
|
|
546
558
|
models: ModelSchema.optional(),
|
|
@@ -588,9 +600,9 @@ var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
|
|
|
588
600
|
var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
589
601
|
graphs: z.record(z.string(), GraphWithinContextOfProjectSchema),
|
|
590
602
|
tools: z.record(z.string(), ToolApiInsertSchema),
|
|
591
|
-
//
|
|
603
|
+
// MCP tools (project-scoped)
|
|
592
604
|
functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
|
|
593
|
-
//
|
|
605
|
+
// Functions (project-scoped)
|
|
594
606
|
dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),
|
|
595
607
|
artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
596
608
|
statusUpdates: z.optional(StatusUpdateSchema),
|
|
@@ -612,72 +624,46 @@ var HeadersScopeSchema = z.object({
|
|
|
612
624
|
example: "graph_789"
|
|
613
625
|
})
|
|
614
626
|
});
|
|
627
|
+
var TenantId = z.string().openapi({
|
|
628
|
+
description: "Tenant identifier",
|
|
629
|
+
example: "tenant_123"
|
|
630
|
+
});
|
|
631
|
+
var ProjectId = z.string().openapi({
|
|
632
|
+
description: "Project identifier",
|
|
633
|
+
example: "project_456"
|
|
634
|
+
});
|
|
635
|
+
var GraphId = z.string().openapi({
|
|
636
|
+
description: "Graph identifier",
|
|
637
|
+
example: "graph_789"
|
|
638
|
+
});
|
|
639
|
+
var SubAgentId = z.string().openapi({
|
|
640
|
+
description: "Sub-agent identifier",
|
|
641
|
+
example: "sub_agent_123"
|
|
642
|
+
});
|
|
615
643
|
var TenantParamsSchema = z.object({
|
|
616
|
-
tenantId:
|
|
617
|
-
description: "Tenant identifier",
|
|
618
|
-
example: "tenant_123"
|
|
619
|
-
})
|
|
644
|
+
tenantId: TenantId
|
|
620
645
|
}).openapi("TenantParams");
|
|
621
|
-
var
|
|
622
|
-
tenantId: z.string().openapi({
|
|
623
|
-
description: "Tenant identifier",
|
|
624
|
-
example: "tenant_123"
|
|
625
|
-
}),
|
|
626
|
-
projectId: z.string().openapi({
|
|
627
|
-
description: "Project identifier",
|
|
628
|
-
example: "project_456"
|
|
629
|
-
})
|
|
630
|
-
}).openapi("TenantProjectParams");
|
|
631
|
-
var TenantProjectGraphParamsSchema = z.object({
|
|
632
|
-
tenantId: z.string().openapi({
|
|
633
|
-
description: "Tenant identifier",
|
|
634
|
-
example: "tenant_123"
|
|
635
|
-
}),
|
|
636
|
-
projectId: z.string().openapi({
|
|
637
|
-
description: "Project identifier",
|
|
638
|
-
example: "project_456"
|
|
639
|
-
}),
|
|
640
|
-
graphId: z.string().openapi({
|
|
641
|
-
description: "Graph identifier",
|
|
642
|
-
example: "graph_789"
|
|
643
|
-
})
|
|
644
|
-
}).openapi("TenantProjectGraphParams");
|
|
645
|
-
var TenantProjectGraphIdParamsSchema = z.object({
|
|
646
|
-
tenantId: z.string().openapi({
|
|
647
|
-
description: "Tenant identifier",
|
|
648
|
-
example: "tenant_123"
|
|
649
|
-
}),
|
|
650
|
-
projectId: z.string().openapi({
|
|
651
|
-
description: "Project identifier",
|
|
652
|
-
example: "project_456"
|
|
653
|
-
}),
|
|
654
|
-
graphId: z.string().openapi({
|
|
655
|
-
description: "Graph identifier",
|
|
656
|
-
example: "graph_789"
|
|
657
|
-
}),
|
|
646
|
+
var TenantIdParamsSchema = TenantParamsSchema.extend({
|
|
658
647
|
id: resourceIdSchema
|
|
659
|
-
}).openapi("
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}),
|
|
665
|
-
projectId: z.string().openapi({
|
|
666
|
-
description: "Project identifier",
|
|
667
|
-
example: "project_456"
|
|
668
|
-
}),
|
|
648
|
+
}).openapi("TenantIdParams");
|
|
649
|
+
var TenantProjectParamsSchema = TenantParamsSchema.extend({
|
|
650
|
+
projectId: ProjectId
|
|
651
|
+
}).openapi("TenantProjectParams");
|
|
652
|
+
var TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({
|
|
669
653
|
id: resourceIdSchema
|
|
670
654
|
}).openapi("TenantProjectIdParams");
|
|
671
|
-
var
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
}),
|
|
655
|
+
var TenantProjectGraphParamsSchema = TenantProjectParamsSchema.extend({
|
|
656
|
+
graphId: GraphId
|
|
657
|
+
}).openapi("TenantProjectGraphParams");
|
|
658
|
+
var TenantProjectGraphIdParamsSchema = TenantProjectGraphParamsSchema.extend({
|
|
676
659
|
id: resourceIdSchema
|
|
677
|
-
}).openapi("
|
|
678
|
-
var
|
|
660
|
+
}).openapi("TenantProjectGraphIdParams");
|
|
661
|
+
var TenantProjectGraphSubAgentParamsSchema = TenantProjectGraphParamsSchema.extend({
|
|
662
|
+
subAgentId: SubAgentId
|
|
663
|
+
}).openapi("TenantProjectGraphSubAgentParams");
|
|
664
|
+
var TenantProjectGraphSubAgentIdParamsSchema = TenantProjectGraphSubAgentParamsSchema.extend({
|
|
679
665
|
id: resourceIdSchema
|
|
680
|
-
}).openapi("
|
|
666
|
+
}).openapi("TenantProjectGraphSubAgentIdParams");
|
|
681
667
|
var PaginationQueryParamsSchema = z.object({
|
|
682
668
|
page: z.coerce.number().min(1).default(1),
|
|
683
669
|
limit: z.coerce.number().min(1).max(100).default(10)
|
|
@@ -785,4 +771,4 @@ function validatePropsAsJsonSchema(props) {
|
|
|
785
771
|
}
|
|
786
772
|
}
|
|
787
773
|
|
|
788
|
-
export {
|
|
774
|
+
export { AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SandboxConfigSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationQuerySchema, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphSubAgentIdParamsSchema, TenantProjectGraphSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema };
|