@inkeep/agents-core 0.24.2 → 0.26.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/dist/{chunk-5B6IOJZY.js → chunk-ALZI4IXB.js} +57 -17
- package/dist/{chunk-ZGJI6UNK.js → chunk-HMVAAUTK.js} +42 -23
- package/dist/{chunk-HN77JIDP.js → chunk-NXC2HZQL.js} +46 -13
- package/dist/client-exports.cjs +99 -36
- package/dist/client-exports.d.cts +7 -11
- package/dist/client-exports.d.ts +7 -11
- package/dist/client-exports.js +3 -11
- package/dist/db/schema.cjs +56 -16
- 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 +1052 -577
- package/dist/index.d.cts +276 -86
- package/dist/index.d.ts +276 -86
- package/dist/index.js +894 -530
- package/dist/{schema-PgBNwsV-.d.ts → schema-CDKDLrBu.d.ts} +188 -62
- package/dist/{schema-B8NMPwEM.d.cts → schema-P1kG10Kn.d.cts} +188 -62
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-mGrlR4Ta.d.cts → utility-CWjvUL4k.d.cts} +329 -71
- package/dist/{utility-mGrlR4Ta.d.ts → utility-CWjvUL4k.d.ts} +329 -71
- package/dist/validation/index.cjs +146 -50
- package/dist/validation/index.d.cts +5 -5
- package/dist/validation/index.d.ts +5 -5
- package/dist/validation/index.js +2 -2
- package/drizzle/0011_slippery_korg.sql +36 -0
- package/drizzle/meta/0011_snapshot.json +2849 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -143,7 +143,6 @@ var subAgentRelations = sqliteCore.sqliteTable(
|
|
|
143
143
|
...agentScoped,
|
|
144
144
|
sourceSubAgentId: sqliteCore.text("source_sub_agent_id").notNull(),
|
|
145
145
|
targetSubAgentId: sqliteCore.text("target_sub_agent_id"),
|
|
146
|
-
externalSubAgentId: sqliteCore.text("external_sub_agent_id"),
|
|
147
146
|
relationType: sqliteCore.text("relation_type"),
|
|
148
147
|
...timestamps
|
|
149
148
|
},
|
|
@@ -159,19 +158,18 @@ var subAgentRelations = sqliteCore.sqliteTable(
|
|
|
159
158
|
var externalAgents = sqliteCore.sqliteTable(
|
|
160
159
|
"external_agents",
|
|
161
160
|
{
|
|
162
|
-
...
|
|
161
|
+
...projectScoped,
|
|
163
162
|
...uiProperties,
|
|
164
163
|
baseUrl: sqliteCore.text("base_url").notNull(),
|
|
165
164
|
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
166
|
-
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
167
165
|
...timestamps
|
|
168
166
|
},
|
|
169
167
|
(table) => [
|
|
170
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
168
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
171
169
|
sqliteCore.foreignKey({
|
|
172
|
-
columns: [table.tenantId, table.projectId
|
|
173
|
-
foreignColumns: [
|
|
174
|
-
name: "
|
|
170
|
+
columns: [table.tenantId, table.projectId],
|
|
171
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
172
|
+
name: "external_agents_project_fk"
|
|
175
173
|
}).onDelete("cascade"),
|
|
176
174
|
sqliteCore.foreignKey({
|
|
177
175
|
columns: [table.tenantId, table.projectId, table.credentialReferenceId],
|
|
@@ -390,6 +388,28 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
|
390
388
|
}).onDelete("cascade")
|
|
391
389
|
]
|
|
392
390
|
);
|
|
391
|
+
var subAgentExternalAgentRelations = sqliteCore.sqliteTable(
|
|
392
|
+
"sub_agent_external_agent_relations",
|
|
393
|
+
{
|
|
394
|
+
...subAgentScoped,
|
|
395
|
+
externalAgentId: sqliteCore.text("external_agent_id").notNull(),
|
|
396
|
+
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
397
|
+
...timestamps
|
|
398
|
+
},
|
|
399
|
+
(table) => [
|
|
400
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
401
|
+
sqliteCore.foreignKey({
|
|
402
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
403
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
404
|
+
name: "sub_agent_external_agent_relations_sub_agent_fk"
|
|
405
|
+
}).onDelete("cascade"),
|
|
406
|
+
sqliteCore.foreignKey({
|
|
407
|
+
columns: [table.tenantId, table.projectId, table.externalAgentId],
|
|
408
|
+
foreignColumns: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
|
|
409
|
+
name: "sub_agent_external_agent_relations_external_agent_fk"
|
|
410
|
+
}).onDelete("cascade")
|
|
411
|
+
]
|
|
412
|
+
);
|
|
393
413
|
var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
394
414
|
"sub_agent_function_tool_relations",
|
|
395
415
|
{
|
|
@@ -651,7 +671,7 @@ drizzleOrm.relations(externalAgents, ({ one, many }) => ({
|
|
|
651
671
|
fields: [externalAgents.tenantId, externalAgents.projectId],
|
|
652
672
|
references: [projects.tenantId, projects.id]
|
|
653
673
|
}),
|
|
654
|
-
|
|
674
|
+
subAgentExternalAgentRelations: many(subAgentExternalAgentRelations),
|
|
655
675
|
credentialReference: one(credentialReferences, {
|
|
656
676
|
fields: [externalAgents.credentialReferenceId],
|
|
657
677
|
references: [credentialReferences.id]
|
|
@@ -723,13 +743,13 @@ drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
|
723
743
|
relationName: "receivedMessages"
|
|
724
744
|
}),
|
|
725
745
|
fromExternalAgent: one(externalAgents, {
|
|
726
|
-
fields: [messages.fromExternalAgentId],
|
|
727
|
-
references: [externalAgents.id],
|
|
746
|
+
fields: [messages.tenantId, messages.projectId, messages.fromExternalAgentId],
|
|
747
|
+
references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
|
|
728
748
|
relationName: "receivedExternalMessages"
|
|
729
749
|
}),
|
|
730
750
|
toExternalAgent: one(externalAgents, {
|
|
731
|
-
fields: [messages.toExternalAgentId],
|
|
732
|
-
references: [externalAgents.id],
|
|
751
|
+
fields: [messages.tenantId, messages.projectId, messages.toExternalAgentId],
|
|
752
|
+
references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
|
|
733
753
|
relationName: "sentExternalMessages"
|
|
734
754
|
}),
|
|
735
755
|
task: one(tasks, {
|
|
@@ -813,10 +833,6 @@ drizzleOrm.relations(subAgentRelations, ({ one }) => ({
|
|
|
813
833
|
fields: [subAgentRelations.targetSubAgentId],
|
|
814
834
|
references: [subAgents.id],
|
|
815
835
|
relationName: "targetRelations"
|
|
816
|
-
}),
|
|
817
|
-
externalAgent: one(externalAgents, {
|
|
818
|
-
fields: [subAgentRelations.externalSubAgentId],
|
|
819
|
-
references: [externalAgents.id]
|
|
820
836
|
})
|
|
821
837
|
}));
|
|
822
838
|
drizzleOrm.relations(functionTools, ({ one, many }) => ({
|
|
@@ -847,6 +863,28 @@ drizzleOrm.relations(
|
|
|
847
863
|
})
|
|
848
864
|
})
|
|
849
865
|
);
|
|
866
|
+
drizzleOrm.relations(
|
|
867
|
+
subAgentExternalAgentRelations,
|
|
868
|
+
({ one }) => ({
|
|
869
|
+
subAgent: one(subAgents, {
|
|
870
|
+
fields: [
|
|
871
|
+
subAgentExternalAgentRelations.tenantId,
|
|
872
|
+
subAgentExternalAgentRelations.projectId,
|
|
873
|
+
subAgentExternalAgentRelations.agentId,
|
|
874
|
+
subAgentExternalAgentRelations.subAgentId
|
|
875
|
+
],
|
|
876
|
+
references: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id]
|
|
877
|
+
}),
|
|
878
|
+
externalAgent: one(externalAgents, {
|
|
879
|
+
fields: [
|
|
880
|
+
subAgentExternalAgentRelations.tenantId,
|
|
881
|
+
subAgentExternalAgentRelations.projectId,
|
|
882
|
+
subAgentExternalAgentRelations.externalAgentId
|
|
883
|
+
],
|
|
884
|
+
references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id]
|
|
885
|
+
})
|
|
886
|
+
})
|
|
887
|
+
);
|
|
850
888
|
|
|
851
889
|
// src/types/utility.ts
|
|
852
890
|
var TOOL_STATUS_VALUES = ["healthy", "unhealthy", "unknown", "needs_auth"];
|
|
@@ -1159,16 +1197,15 @@ var SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
|
1159
1197
|
SubAgentArtifactComponentUpdateSchema
|
|
1160
1198
|
);
|
|
1161
1199
|
var ExternalAgentSelectSchema = drizzleZod.createSelectSchema(externalAgents).extend({
|
|
1162
|
-
credentialReferenceId: zodOpenapi.z.string().nullable().optional()
|
|
1163
|
-
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullable().optional()
|
|
1200
|
+
credentialReferenceId: zodOpenapi.z.string().nullable().optional()
|
|
1164
1201
|
});
|
|
1165
1202
|
var ExternalAgentInsertSchema = drizzleZod.createInsertSchema(externalAgents).extend({
|
|
1166
1203
|
id: resourceIdSchema
|
|
1167
1204
|
});
|
|
1168
1205
|
var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
|
|
1169
|
-
var ExternalAgentApiSelectSchema =
|
|
1170
|
-
var ExternalAgentApiInsertSchema =
|
|
1171
|
-
var ExternalAgentApiUpdateSchema =
|
|
1206
|
+
var ExternalAgentApiSelectSchema = createApiSchema(ExternalAgentSelectSchema).openapi("ExternalAgent");
|
|
1207
|
+
var ExternalAgentApiInsertSchema = createApiInsertSchema(ExternalAgentInsertSchema).openapi("ExternalAgentCreate");
|
|
1208
|
+
var ExternalAgentApiUpdateSchema = createApiUpdateSchema(ExternalAgentUpdateSchema).openapi("ExternalAgentUpdate");
|
|
1172
1209
|
var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
|
|
1173
1210
|
SubAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("internal") }),
|
|
1174
1211
|
ExternalAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("external") })
|
|
@@ -1233,7 +1270,8 @@ var CredentialReferenceInsertSchema = drizzleZod.createInsertSchema(credentialRe
|
|
|
1233
1270
|
var CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
1234
1271
|
var CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema).extend({
|
|
1235
1272
|
type: zodOpenapi.z.enum(CredentialStoreType),
|
|
1236
|
-
tools: zodOpenapi.z.array(ToolSelectSchema).optional()
|
|
1273
|
+
tools: zodOpenapi.z.array(ToolSelectSchema).optional(),
|
|
1274
|
+
externalAgents: zodOpenapi.z.array(ExternalAgentSelectSchema).optional()
|
|
1237
1275
|
}).openapi("CredentialReference");
|
|
1238
1276
|
var CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
1239
1277
|
CredentialReferenceInsertSchema
|
|
@@ -1362,6 +1400,27 @@ var SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
|
1362
1400
|
var SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
1363
1401
|
SubAgentToolRelationUpdateSchema
|
|
1364
1402
|
).openapi("SubAgentToolRelationUpdate");
|
|
1403
|
+
var SubAgentExternalAgentRelationSelectSchema = drizzleZod.createSelectSchema(
|
|
1404
|
+
subAgentExternalAgentRelations
|
|
1405
|
+
);
|
|
1406
|
+
var SubAgentExternalAgentRelationInsertSchema = drizzleZod.createInsertSchema(
|
|
1407
|
+
subAgentExternalAgentRelations
|
|
1408
|
+
).extend({
|
|
1409
|
+
id: resourceIdSchema,
|
|
1410
|
+
subAgentId: resourceIdSchema,
|
|
1411
|
+
externalAgentId: resourceIdSchema,
|
|
1412
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1413
|
+
});
|
|
1414
|
+
var SubAgentExternalAgentRelationUpdateSchema = SubAgentExternalAgentRelationInsertSchema.partial();
|
|
1415
|
+
var SubAgentExternalAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
1416
|
+
SubAgentExternalAgentRelationSelectSchema
|
|
1417
|
+
).openapi("SubAgentExternalAgentRelation");
|
|
1418
|
+
var SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
1419
|
+
SubAgentExternalAgentRelationInsertSchema
|
|
1420
|
+
).omit({ id: true, subAgentId: true }).openapi("SubAgentExternalAgentRelationCreate");
|
|
1421
|
+
var SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
1422
|
+
SubAgentExternalAgentRelationUpdateSchema
|
|
1423
|
+
).openapi("SubAgentExternalAgentRelationUpdate");
|
|
1365
1424
|
var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
|
|
1366
1425
|
var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
|
|
1367
1426
|
var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
|
|
@@ -1390,6 +1449,11 @@ var CanUseItemSchema = zodOpenapi.z.object({
|
|
|
1390
1449
|
toolSelection: zodOpenapi.z.array(zodOpenapi.z.string()).nullish(),
|
|
1391
1450
|
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1392
1451
|
}).openapi("CanUseItem");
|
|
1452
|
+
var canDelegateToExternalAgentSchema = zodOpenapi.z.object({
|
|
1453
|
+
externalAgentId: zodOpenapi.z.string(),
|
|
1454
|
+
subAgentExternalAgentRelationId: zodOpenapi.z.string().optional(),
|
|
1455
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
|
|
1456
|
+
});
|
|
1393
1457
|
var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
1394
1458
|
type: zodOpenapi.z.literal("internal"),
|
|
1395
1459
|
canUse: zodOpenapi.z.array(CanUseItemSchema),
|
|
@@ -1397,16 +1461,22 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
|
1397
1461
|
dataComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1398
1462
|
artifactComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1399
1463
|
canTransferTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1400
|
-
canDelegateTo: zodOpenapi.z.array(
|
|
1464
|
+
canDelegateTo: zodOpenapi.z.array(
|
|
1465
|
+
zodOpenapi.z.union([
|
|
1466
|
+
zodOpenapi.z.string(),
|
|
1467
|
+
// Internal subAgent ID
|
|
1468
|
+
canDelegateToExternalAgentSchema
|
|
1469
|
+
// External agent with headers
|
|
1470
|
+
])
|
|
1471
|
+
).optional()
|
|
1401
1472
|
});
|
|
1402
1473
|
var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
1403
|
-
subAgents: zodOpenapi.z.record(
|
|
1404
|
-
zodOpenapi.z.string(),
|
|
1405
|
-
zodOpenapi.z.union([FullAgentAgentInsertSchema, ExternalAgentApiInsertSchema])
|
|
1406
|
-
),
|
|
1474
|
+
subAgents: zodOpenapi.z.record(zodOpenapi.z.string(), FullAgentAgentInsertSchema),
|
|
1407
1475
|
// Lookup maps for UI to resolve canUse items
|
|
1408
1476
|
tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema).optional(),
|
|
1409
1477
|
// MCP tools (project-scoped)
|
|
1478
|
+
externalAgents: zodOpenapi.z.record(zodOpenapi.z.string(), ExternalAgentApiInsertSchema).optional(),
|
|
1479
|
+
// External agents (project-scoped)
|
|
1410
1480
|
functionTools: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionToolApiInsertSchema).optional(),
|
|
1411
1481
|
// Function tools (agent-scoped)
|
|
1412
1482
|
functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
|
|
@@ -1468,6 +1538,7 @@ var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
|
1468
1538
|
functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
|
|
1469
1539
|
dataComponents: zodOpenapi.z.record(zodOpenapi.z.string(), DataComponentApiInsertSchema).optional(),
|
|
1470
1540
|
artifactComponents: zodOpenapi.z.record(zodOpenapi.z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
1541
|
+
externalAgents: zodOpenapi.z.record(zodOpenapi.z.string(), ExternalAgentApiInsertSchema).optional(),
|
|
1471
1542
|
statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
|
|
1472
1543
|
credentialReferences: zodOpenapi.z.record(zodOpenapi.z.string(), CredentialReferenceApiInsertSchema).optional(),
|
|
1473
1544
|
createdAt: zodOpenapi.z.string().optional(),
|
|
@@ -1623,12 +1694,6 @@ var PaginationQueryParamsSchema = zodOpenapi.z.object({
|
|
|
1623
1694
|
});
|
|
1624
1695
|
|
|
1625
1696
|
// src/validation/agentFull.ts
|
|
1626
|
-
function isInternalAgent(agent) {
|
|
1627
|
-
return "prompt" in agent;
|
|
1628
|
-
}
|
|
1629
|
-
function isExternalAgent(agent) {
|
|
1630
|
-
return "baseUrl" in agent;
|
|
1631
|
-
}
|
|
1632
1697
|
function validateAndTypeAgentData(data) {
|
|
1633
1698
|
return AgentWithinContextOfProjectSchema.parse(data);
|
|
1634
1699
|
}
|
|
@@ -1638,7 +1703,7 @@ function validateToolReferences(agentData, availableToolIds) {
|
|
|
1638
1703
|
}
|
|
1639
1704
|
const errors = [];
|
|
1640
1705
|
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
1641
|
-
if (
|
|
1706
|
+
if (subAgent.canUse && Array.isArray(subAgent.canUse)) {
|
|
1642
1707
|
for (const canUseItem of subAgent.canUse) {
|
|
1643
1708
|
if (!availableToolIds.has(canUseItem.toolId)) {
|
|
1644
1709
|
errors.push(`Agent '${subAgentId}' references non-existent tool '${canUseItem.toolId}'`);
|
|
@@ -1657,7 +1722,7 @@ function validateDataComponentReferences(agentData, availableDataComponentIds) {
|
|
|
1657
1722
|
}
|
|
1658
1723
|
const errors = [];
|
|
1659
1724
|
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
1660
|
-
if (
|
|
1725
|
+
if (subAgent.dataComponents) {
|
|
1661
1726
|
for (const dataComponentId of subAgent.dataComponents) {
|
|
1662
1727
|
if (!availableDataComponentIds.has(dataComponentId)) {
|
|
1663
1728
|
errors.push(
|
|
@@ -1678,7 +1743,7 @@ function validateArtifactComponentReferences(agentData, availableArtifactCompone
|
|
|
1678
1743
|
}
|
|
1679
1744
|
const errors = [];
|
|
1680
1745
|
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
1681
|
-
if (
|
|
1746
|
+
if (subAgent.artifactComponents) {
|
|
1682
1747
|
for (const artifactComponentId of subAgent.artifactComponents) {
|
|
1683
1748
|
if (!availableArtifactComponentIds.has(artifactComponentId)) {
|
|
1684
1749
|
errors.push(
|
|
@@ -1696,32 +1761,56 @@ ${errors.join("\n")}`);
|
|
|
1696
1761
|
function validateAgentRelationships(agentData) {
|
|
1697
1762
|
const errors = [];
|
|
1698
1763
|
const availableAgentIds = new Set(Object.keys(agentData.subAgents));
|
|
1764
|
+
const availableExternalAgentIds = new Set(Object.keys(agentData.externalAgents ?? {}));
|
|
1699
1765
|
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
1700
|
-
if (
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1766
|
+
if (subAgent.canTransferTo && Array.isArray(subAgent.canTransferTo)) {
|
|
1767
|
+
for (const targetId of subAgent.canTransferTo) {
|
|
1768
|
+
if (!availableAgentIds.has(targetId)) {
|
|
1769
|
+
errors.push(
|
|
1770
|
+
`Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in agent`
|
|
1771
|
+
);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo)) {
|
|
1776
|
+
for (const targetItem of subAgent.canDelegateTo) {
|
|
1777
|
+
console.log("targetItem", targetItem);
|
|
1778
|
+
if (typeof targetItem === "string") {
|
|
1779
|
+
console.log("targetItem is string", targetItem);
|
|
1780
|
+
if (!availableAgentIds.has(targetItem) && !availableExternalAgentIds.has(targetItem)) {
|
|
1704
1781
|
errors.push(
|
|
1705
|
-
`Agent '${subAgentId}' has
|
|
1782
|
+
`Agent '${subAgentId}' has delegation target '${targetItem}' that doesn't exist in agent`
|
|
1706
1783
|
);
|
|
1707
1784
|
}
|
|
1708
1785
|
}
|
|
1709
1786
|
}
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
if (errors.length > 0)
|
|
1790
|
+
throw new Error(`Agent relationship validation failed:
|
|
1791
|
+
${errors.join("\n")}`);
|
|
1792
|
+
}
|
|
1793
|
+
function validateSubAgentExternalAgentRelations(agentData, availableExternalAgentIds) {
|
|
1794
|
+
if (!availableExternalAgentIds) {
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
const errors = [];
|
|
1798
|
+
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
1799
|
+
if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo)) {
|
|
1800
|
+
for (const targetItem of subAgent.canDelegateTo) {
|
|
1801
|
+
if (typeof targetItem === "object" && "externalAgentId" in targetItem) {
|
|
1802
|
+
if (!availableExternalAgentIds.has(targetItem.externalAgentId)) {
|
|
1713
1803
|
errors.push(
|
|
1714
|
-
`Agent '${subAgentId}' has delegation target '${
|
|
1804
|
+
`Agent '${subAgentId}' has delegation target '${targetItem.externalAgentId}' that doesn't exist in agent`
|
|
1715
1805
|
);
|
|
1716
1806
|
}
|
|
1717
1807
|
}
|
|
1718
1808
|
}
|
|
1719
1809
|
}
|
|
1720
1810
|
}
|
|
1721
|
-
if (errors.length > 0)
|
|
1722
|
-
throw new Error(`
|
|
1811
|
+
if (errors.length > 0)
|
|
1812
|
+
throw new Error(`Sub agent external agent relation validation failed:
|
|
1723
1813
|
${errors.join("\n")}`);
|
|
1724
|
-
}
|
|
1725
1814
|
}
|
|
1726
1815
|
function validateAgentStructure(agentData, projectResources) {
|
|
1727
1816
|
if (agentData.defaultSubAgentId && !agentData.subAgents[agentData.defaultSubAgentId]) {
|
|
@@ -1731,6 +1820,7 @@ function validateAgentStructure(agentData, projectResources) {
|
|
|
1731
1820
|
validateToolReferences(agentData, projectResources.toolIds);
|
|
1732
1821
|
validateDataComponentReferences(agentData, projectResources.dataComponentIds);
|
|
1733
1822
|
validateArtifactComponentReferences(agentData, projectResources.artifactComponentIds);
|
|
1823
|
+
validateSubAgentExternalAgentRelations(agentData, projectResources.externalAgentIds);
|
|
1734
1824
|
}
|
|
1735
1825
|
validateAgentRelationships(agentData);
|
|
1736
1826
|
}
|
|
@@ -2166,6 +2256,12 @@ exports.SubAgentDataComponentListResponse = SubAgentDataComponentListResponse;
|
|
|
2166
2256
|
exports.SubAgentDataComponentResponse = SubAgentDataComponentResponse;
|
|
2167
2257
|
exports.SubAgentDataComponentSelectSchema = SubAgentDataComponentSelectSchema;
|
|
2168
2258
|
exports.SubAgentDataComponentUpdateSchema = SubAgentDataComponentUpdateSchema;
|
|
2259
|
+
exports.SubAgentExternalAgentRelationApiInsertSchema = SubAgentExternalAgentRelationApiInsertSchema;
|
|
2260
|
+
exports.SubAgentExternalAgentRelationApiSelectSchema = SubAgentExternalAgentRelationApiSelectSchema;
|
|
2261
|
+
exports.SubAgentExternalAgentRelationApiUpdateSchema = SubAgentExternalAgentRelationApiUpdateSchema;
|
|
2262
|
+
exports.SubAgentExternalAgentRelationInsertSchema = SubAgentExternalAgentRelationInsertSchema;
|
|
2263
|
+
exports.SubAgentExternalAgentRelationSelectSchema = SubAgentExternalAgentRelationSelectSchema;
|
|
2264
|
+
exports.SubAgentExternalAgentRelationUpdateSchema = SubAgentExternalAgentRelationUpdateSchema;
|
|
2169
2265
|
exports.SubAgentInsertSchema = SubAgentInsertSchema;
|
|
2170
2266
|
exports.SubAgentListResponse = SubAgentListResponse;
|
|
2171
2267
|
exports.SubAgentRelationApiInsertSchema = SubAgentRelationApiInsertSchema;
|
|
@@ -2220,9 +2316,8 @@ exports.ToolStatusSchema = ToolStatusSchema;
|
|
|
2220
2316
|
exports.ToolUpdateSchema = ToolUpdateSchema;
|
|
2221
2317
|
exports.TransferDataSchema = TransferDataSchema;
|
|
2222
2318
|
exports.URL_SAFE_ID_PATTERN = URL_SAFE_ID_PATTERN;
|
|
2319
|
+
exports.canDelegateToExternalAgentSchema = canDelegateToExternalAgentSchema;
|
|
2223
2320
|
exports.generateIdFromName = generateIdFromName;
|
|
2224
|
-
exports.isExternalAgent = isExternalAgent;
|
|
2225
|
-
exports.isInternalAgent = isInternalAgent;
|
|
2226
2321
|
exports.isValidResourceId = isValidResourceId;
|
|
2227
2322
|
exports.resourceIdSchema = resourceIdSchema;
|
|
2228
2323
|
exports.validateAgentRelationships = validateAgentRelationships;
|
|
@@ -2232,4 +2327,5 @@ exports.validateArtifactComponentReferences = validateArtifactComponentReference
|
|
|
2232
2327
|
exports.validateDataComponentReferences = validateDataComponentReferences;
|
|
2233
2328
|
exports.validatePreview = validatePreview;
|
|
2234
2329
|
exports.validatePropsAsJsonSchema = validatePropsAsJsonSchema;
|
|
2330
|
+
exports.validateSubAgentExternalAgentRelations = validateSubAgentExternalAgentRelations;
|
|
2235
2331
|
exports.validateToolReferences = validateToolReferences;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { f_ as AgentWithinContextOfProjectSchema, z as FullAgentDefinition } from '../utility-CWjvUL4k.cjs';
|
|
3
|
+
export { e0 as AgentApiInsertSchema, d$ as AgentApiSelectSchema, e1 as AgentApiUpdateSchema, dZ as AgentInsertSchema, gu as AgentListResponse, ge as AgentResponse, dY as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, d_ as AgentUpdateSchema, f4 as AllAgentSchema, f9 as ApiKeyApiCreationResponseSchema, fa as ApiKeyApiInsertSchema, f8 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f6 as ApiKeyInsertSchema, gy as ApiKeyListResponse, gi as ApiKeyResponse, f5 as ApiKeySelectSchema, f7 as ApiKeyUpdateSchema, eS as ArtifactComponentApiInsertSchema, eR as ArtifactComponentApiSelectSchema, eT as ArtifactComponentApiUpdateSchema, eP as ArtifactComponentInsertSchema, gD as ArtifactComponentListResponse, gn as ArtifactComponentResponse, eO as ArtifactComponentSelectSchema, eQ as ArtifactComponentUpdateSchema, fY as CanUseItemSchema, ez as ContextCacheApiInsertSchema, ey as ContextCacheApiSelectSchema, eA as ContextCacheApiUpdateSchema, ew as ContextCacheInsertSchema, ev as ContextCacheSelectSchema, ex as ContextCacheUpdateSchema, fC as ContextConfigApiInsertSchema, fB as ContextConfigApiSelectSchema, fD as ContextConfigApiUpdateSchema, fz as ContextConfigInsertSchema, gx as ContextConfigListResponse, gh as ContextConfigResponse, fy as ContextConfigSelectSchema, fA as ContextConfigUpdateSchema, en as ConversationApiInsertSchema, em as ConversationApiSelectSchema, eo as ConversationApiUpdateSchema, ek as ConversationInsertSchema, gG as ConversationListResponse, gq as ConversationResponse, ej as ConversationSelectSchema, el as ConversationUpdateSchema, ff as CredentialReferenceApiInsertSchema, fe as CredentialReferenceApiSelectSchema, fg as CredentialReferenceApiUpdateSchema, fc as CredentialReferenceInsertSchema, gz as CredentialReferenceListResponse, gj as CredentialReferenceResponse, fb as CredentialReferenceSelectSchema, fd as CredentialReferenceUpdateSchema, eG as DataComponentApiInsertSchema, eF as DataComponentApiSelectSchema, eH as DataComponentApiUpdateSchema, eD as DataComponentBaseSchema, eC as DataComponentInsertSchema, gC as DataComponentListResponse, gm as DataComponentResponse, eB as DataComponentSelectSchema, eE as DataComponentUpdateSchema, g2 as ErrorResponseSchema, g3 as ExistsResponseSchema, f2 as ExternalAgentApiInsertSchema, f1 as ExternalAgentApiSelectSchema, f3 as ExternalAgentApiUpdateSchema, e$ as ExternalAgentInsertSchema, gw as ExternalAgentListResponse, gg as ExternalAgentResponse, e_ as ExternalAgentSelectSchema, f0 as ExternalAgentUpdateSchema, dX as ExternalSubAgentRelationApiInsertSchema, dW as ExternalSubAgentRelationInsertSchema, fw as FetchConfigSchema, fx as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, gb as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fu as FunctionInsertSchema, gA as FunctionListResponse, gk as FunctionResponse, ft as FunctionSelectSchema, fr as FunctionToolApiInsertSchema, fq as FunctionToolApiSelectSchema, fs as FunctionToolApiUpdateSchema, dI as FunctionToolConfig, dH as FunctionToolConfigSchema, fo as FunctionToolInsertSchema, gB as FunctionToolListResponse, gl as FunctionToolResponse, fn as FunctionToolSelectSchema, fp as FunctionToolUpdateSchema, fv as FunctionUpdateSchema, gM as HeadersScopeSchema, fU as LedgerArtifactApiInsertSchema, fT as LedgerArtifactApiSelectSchema, fV as LedgerArtifactApiUpdateSchema, fR as LedgerArtifactInsertSchema, fQ as LedgerArtifactSelectSchema, fS as LedgerArtifactUpdateSchema, g0 as ListResponseSchema, dC as MAX_ID_LENGTH, fi as MCPToolConfigSchema, dB as MIN_ID_LENGTH, eg as McpToolDefinitionSchema, fh as McpToolSchema, ee as McpTransportConfigSchema, et as MessageApiInsertSchema, es as MessageApiSelectSchema, eu as MessageApiUpdateSchema, eq as MessageInsertSchema, gH as MessageListResponse, gr as MessageResponse, ep as MessageSelectSchema, er as MessageUpdateSchema, dF as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gV as PaginationQueryParamsSchema, f$ as PaginationSchema, g9 as ProjectApiInsertSchema, g8 as ProjectApiSelectSchema, ga as ProjectApiUpdateSchema, g6 as ProjectInsertSchema, gs as ProjectListResponse, dG as ProjectModelSchema, gc as ProjectResponse, g5 as ProjectSelectSchema, g7 as ProjectUpdateSchema, g4 as RemovedResponseSchema, g1 as SingleResponseSchema, fW as StatusComponentSchema, fX as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dN as SubAgentApiInsertSchema, dM as SubAgentApiSelectSchema, dO as SubAgentApiUpdateSchema, eY as SubAgentArtifactComponentApiInsertSchema, eX as SubAgentArtifactComponentApiSelectSchema, eZ as SubAgentArtifactComponentApiUpdateSchema, eV as SubAgentArtifactComponentInsertSchema, gL as SubAgentArtifactComponentListResponse, gJ as SubAgentArtifactComponentResponse, eU as SubAgentArtifactComponentSelectSchema, eW as SubAgentArtifactComponentUpdateSchema, eM as SubAgentDataComponentApiInsertSchema, eL as SubAgentDataComponentApiSelectSchema, eN as SubAgentDataComponentApiUpdateSchema, eJ as SubAgentDataComponentInsertSchema, gK as SubAgentDataComponentListResponse, gI as SubAgentDataComponentResponse, eI as SubAgentDataComponentSelectSchema, eK as SubAgentDataComponentUpdateSchema, fO as SubAgentExternalAgentRelationApiInsertSchema, fN as SubAgentExternalAgentRelationApiSelectSchema, fP as SubAgentExternalAgentRelationApiUpdateSchema, fL as SubAgentExternalAgentRelationInsertSchema, fK as SubAgentExternalAgentRelationSelectSchema, fM as SubAgentExternalAgentRelationUpdateSchema, dK as SubAgentInsertSchema, gt as SubAgentListResponse, dT as SubAgentRelationApiInsertSchema, dS as SubAgentRelationApiSelectSchema, dU as SubAgentRelationApiUpdateSchema, dQ as SubAgentRelationInsertSchema, gE as SubAgentRelationListResponse, dV as SubAgentRelationQuerySchema, go as SubAgentRelationResponse, dP as SubAgentRelationSelectSchema, dR as SubAgentRelationUpdateSchema, gd as SubAgentResponse, dJ as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fI as SubAgentToolRelationApiInsertSchema, fH as SubAgentToolRelationApiSelectSchema, fJ as SubAgentToolRelationApiUpdateSchema, fF as SubAgentToolRelationInsertSchema, gF as SubAgentToolRelationListResponse, gp as SubAgentToolRelationResponse, fE as SubAgentToolRelationSelectSchema, fG as SubAgentToolRelationUpdateSchema, dL as SubAgentUpdateSchema, e6 as TaskApiInsertSchema, e5 as TaskApiSelectSchema, e7 as TaskApiUpdateSchema, e3 as TaskInsertSchema, ec as TaskRelationApiInsertSchema, eb as TaskRelationApiSelectSchema, ed as TaskRelationApiUpdateSchema, e9 as TaskRelationInsertSchema, e8 as TaskRelationSelectSchema, ea as TaskRelationUpdateSchema, e2 as TaskSelectSchema, e4 as TaskUpdateSchema, gO as TenantIdParamsSchema, gN as TenantParamsSchema, gS as TenantProjectAgentIdParamsSchema, gR as TenantProjectAgentParamsSchema, gU as TenantProjectAgentSubAgentIdParamsSchema, gT as TenantProjectAgentSubAgentParamsSchema, gQ as TenantProjectIdParamsSchema, gP as TenantProjectParamsSchema, fl as ToolApiInsertSchema, fk as ToolApiSelectSchema, fm as ToolApiUpdateSchema, ei as ToolInsertSchema, gv as ToolListResponse, gf as ToolResponse, eh as ToolSelectSchema, ef as ToolStatusSchema, fj as ToolUpdateSchema, dD as URL_SAFE_ID_PATTERN, fZ as canDelegateToExternalAgentSchema, dE as resourceIdSchema } from '../utility-CWjvUL4k.cjs';
|
|
4
4
|
export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.cjs';
|
|
5
5
|
import 'drizzle-zod';
|
|
6
6
|
import 'drizzle-orm/sqlite-core';
|
|
7
7
|
import '@hono/zod-openapi';
|
|
8
8
|
|
|
9
|
-
declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
|
|
10
|
-
declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
|
|
11
9
|
declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
|
|
12
10
|
/**
|
|
13
11
|
* Validates that all tool IDs referenced in agents exist in the tools record
|
|
@@ -29,6 +27,7 @@ declare function validateArtifactComponentReferences(agentData: FullAgentDefinit
|
|
|
29
27
|
* Validates agent relationships (transfer and delegation targets exist)
|
|
30
28
|
*/
|
|
31
29
|
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
30
|
+
declare function validateSubAgentExternalAgentRelations(agentData: FullAgentDefinition, availableExternalAgentIds?: Set<string>): void;
|
|
32
31
|
/**
|
|
33
32
|
* Validates the agent structure before creation/update
|
|
34
33
|
* Note: With scoped architecture, project-scoped resource validation should be done at project level
|
|
@@ -37,6 +36,7 @@ declare function validateAgentStructure(agentData: FullAgentDefinition, projectR
|
|
|
37
36
|
toolIds?: Set<string>;
|
|
38
37
|
dataComponentIds?: Set<string>;
|
|
39
38
|
artifactComponentIds?: Set<string>;
|
|
39
|
+
externalAgentIds?: Set<string>;
|
|
40
40
|
}): void;
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -151,4 +151,4 @@ declare function validatePreview(preview: {
|
|
|
151
151
|
data: Record<string, unknown>;
|
|
152
152
|
}): PreviewValidationResult;
|
|
153
153
|
|
|
154
|
-
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type PreviewValidationResult, type TransferData, TransferDataSchema, generateIdFromName,
|
|
154
|
+
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type PreviewValidationResult, type TransferData, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validatePreview, validateSubAgentExternalAgentRelations, validateToolReferences };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { f_ as AgentWithinContextOfProjectSchema, z as FullAgentDefinition } from '../utility-CWjvUL4k.js';
|
|
3
|
+
export { e0 as AgentApiInsertSchema, d$ as AgentApiSelectSchema, e1 as AgentApiUpdateSchema, dZ as AgentInsertSchema, gu as AgentListResponse, ge as AgentResponse, dY as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, d_ as AgentUpdateSchema, f4 as AllAgentSchema, f9 as ApiKeyApiCreationResponseSchema, fa as ApiKeyApiInsertSchema, f8 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f6 as ApiKeyInsertSchema, gy as ApiKeyListResponse, gi as ApiKeyResponse, f5 as ApiKeySelectSchema, f7 as ApiKeyUpdateSchema, eS as ArtifactComponentApiInsertSchema, eR as ArtifactComponentApiSelectSchema, eT as ArtifactComponentApiUpdateSchema, eP as ArtifactComponentInsertSchema, gD as ArtifactComponentListResponse, gn as ArtifactComponentResponse, eO as ArtifactComponentSelectSchema, eQ as ArtifactComponentUpdateSchema, fY as CanUseItemSchema, ez as ContextCacheApiInsertSchema, ey as ContextCacheApiSelectSchema, eA as ContextCacheApiUpdateSchema, ew as ContextCacheInsertSchema, ev as ContextCacheSelectSchema, ex as ContextCacheUpdateSchema, fC as ContextConfigApiInsertSchema, fB as ContextConfigApiSelectSchema, fD as ContextConfigApiUpdateSchema, fz as ContextConfigInsertSchema, gx as ContextConfigListResponse, gh as ContextConfigResponse, fy as ContextConfigSelectSchema, fA as ContextConfigUpdateSchema, en as ConversationApiInsertSchema, em as ConversationApiSelectSchema, eo as ConversationApiUpdateSchema, ek as ConversationInsertSchema, gG as ConversationListResponse, gq as ConversationResponse, ej as ConversationSelectSchema, el as ConversationUpdateSchema, ff as CredentialReferenceApiInsertSchema, fe as CredentialReferenceApiSelectSchema, fg as CredentialReferenceApiUpdateSchema, fc as CredentialReferenceInsertSchema, gz as CredentialReferenceListResponse, gj as CredentialReferenceResponse, fb as CredentialReferenceSelectSchema, fd as CredentialReferenceUpdateSchema, eG as DataComponentApiInsertSchema, eF as DataComponentApiSelectSchema, eH as DataComponentApiUpdateSchema, eD as DataComponentBaseSchema, eC as DataComponentInsertSchema, gC as DataComponentListResponse, gm as DataComponentResponse, eB as DataComponentSelectSchema, eE as DataComponentUpdateSchema, g2 as ErrorResponseSchema, g3 as ExistsResponseSchema, f2 as ExternalAgentApiInsertSchema, f1 as ExternalAgentApiSelectSchema, f3 as ExternalAgentApiUpdateSchema, e$ as ExternalAgentInsertSchema, gw as ExternalAgentListResponse, gg as ExternalAgentResponse, e_ as ExternalAgentSelectSchema, f0 as ExternalAgentUpdateSchema, dX as ExternalSubAgentRelationApiInsertSchema, dW as ExternalSubAgentRelationInsertSchema, fw as FetchConfigSchema, fx as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, gb as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fu as FunctionInsertSchema, gA as FunctionListResponse, gk as FunctionResponse, ft as FunctionSelectSchema, fr as FunctionToolApiInsertSchema, fq as FunctionToolApiSelectSchema, fs as FunctionToolApiUpdateSchema, dI as FunctionToolConfig, dH as FunctionToolConfigSchema, fo as FunctionToolInsertSchema, gB as FunctionToolListResponse, gl as FunctionToolResponse, fn as FunctionToolSelectSchema, fp as FunctionToolUpdateSchema, fv as FunctionUpdateSchema, gM as HeadersScopeSchema, fU as LedgerArtifactApiInsertSchema, fT as LedgerArtifactApiSelectSchema, fV as LedgerArtifactApiUpdateSchema, fR as LedgerArtifactInsertSchema, fQ as LedgerArtifactSelectSchema, fS as LedgerArtifactUpdateSchema, g0 as ListResponseSchema, dC as MAX_ID_LENGTH, fi as MCPToolConfigSchema, dB as MIN_ID_LENGTH, eg as McpToolDefinitionSchema, fh as McpToolSchema, ee as McpTransportConfigSchema, et as MessageApiInsertSchema, es as MessageApiSelectSchema, eu as MessageApiUpdateSchema, eq as MessageInsertSchema, gH as MessageListResponse, gr as MessageResponse, ep as MessageSelectSchema, er as MessageUpdateSchema, dF as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gV as PaginationQueryParamsSchema, f$ as PaginationSchema, g9 as ProjectApiInsertSchema, g8 as ProjectApiSelectSchema, ga as ProjectApiUpdateSchema, g6 as ProjectInsertSchema, gs as ProjectListResponse, dG as ProjectModelSchema, gc as ProjectResponse, g5 as ProjectSelectSchema, g7 as ProjectUpdateSchema, g4 as RemovedResponseSchema, g1 as SingleResponseSchema, fW as StatusComponentSchema, fX as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dN as SubAgentApiInsertSchema, dM as SubAgentApiSelectSchema, dO as SubAgentApiUpdateSchema, eY as SubAgentArtifactComponentApiInsertSchema, eX as SubAgentArtifactComponentApiSelectSchema, eZ as SubAgentArtifactComponentApiUpdateSchema, eV as SubAgentArtifactComponentInsertSchema, gL as SubAgentArtifactComponentListResponse, gJ as SubAgentArtifactComponentResponse, eU as SubAgentArtifactComponentSelectSchema, eW as SubAgentArtifactComponentUpdateSchema, eM as SubAgentDataComponentApiInsertSchema, eL as SubAgentDataComponentApiSelectSchema, eN as SubAgentDataComponentApiUpdateSchema, eJ as SubAgentDataComponentInsertSchema, gK as SubAgentDataComponentListResponse, gI as SubAgentDataComponentResponse, eI as SubAgentDataComponentSelectSchema, eK as SubAgentDataComponentUpdateSchema, fO as SubAgentExternalAgentRelationApiInsertSchema, fN as SubAgentExternalAgentRelationApiSelectSchema, fP as SubAgentExternalAgentRelationApiUpdateSchema, fL as SubAgentExternalAgentRelationInsertSchema, fK as SubAgentExternalAgentRelationSelectSchema, fM as SubAgentExternalAgentRelationUpdateSchema, dK as SubAgentInsertSchema, gt as SubAgentListResponse, dT as SubAgentRelationApiInsertSchema, dS as SubAgentRelationApiSelectSchema, dU as SubAgentRelationApiUpdateSchema, dQ as SubAgentRelationInsertSchema, gE as SubAgentRelationListResponse, dV as SubAgentRelationQuerySchema, go as SubAgentRelationResponse, dP as SubAgentRelationSelectSchema, dR as SubAgentRelationUpdateSchema, gd as SubAgentResponse, dJ as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fI as SubAgentToolRelationApiInsertSchema, fH as SubAgentToolRelationApiSelectSchema, fJ as SubAgentToolRelationApiUpdateSchema, fF as SubAgentToolRelationInsertSchema, gF as SubAgentToolRelationListResponse, gp as SubAgentToolRelationResponse, fE as SubAgentToolRelationSelectSchema, fG as SubAgentToolRelationUpdateSchema, dL as SubAgentUpdateSchema, e6 as TaskApiInsertSchema, e5 as TaskApiSelectSchema, e7 as TaskApiUpdateSchema, e3 as TaskInsertSchema, ec as TaskRelationApiInsertSchema, eb as TaskRelationApiSelectSchema, ed as TaskRelationApiUpdateSchema, e9 as TaskRelationInsertSchema, e8 as TaskRelationSelectSchema, ea as TaskRelationUpdateSchema, e2 as TaskSelectSchema, e4 as TaskUpdateSchema, gO as TenantIdParamsSchema, gN as TenantParamsSchema, gS as TenantProjectAgentIdParamsSchema, gR as TenantProjectAgentParamsSchema, gU as TenantProjectAgentSubAgentIdParamsSchema, gT as TenantProjectAgentSubAgentParamsSchema, gQ as TenantProjectIdParamsSchema, gP as TenantProjectParamsSchema, fl as ToolApiInsertSchema, fk as ToolApiSelectSchema, fm as ToolApiUpdateSchema, ei as ToolInsertSchema, gv as ToolListResponse, gf as ToolResponse, eh as ToolSelectSchema, ef as ToolStatusSchema, fj as ToolUpdateSchema, dD as URL_SAFE_ID_PATTERN, fZ as canDelegateToExternalAgentSchema, dE as resourceIdSchema } from '../utility-CWjvUL4k.js';
|
|
4
4
|
export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.js';
|
|
5
5
|
import 'drizzle-zod';
|
|
6
6
|
import 'drizzle-orm/sqlite-core';
|
|
7
7
|
import '@hono/zod-openapi';
|
|
8
8
|
|
|
9
|
-
declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
|
|
10
|
-
declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
|
|
11
9
|
declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
|
|
12
10
|
/**
|
|
13
11
|
* Validates that all tool IDs referenced in agents exist in the tools record
|
|
@@ -29,6 +27,7 @@ declare function validateArtifactComponentReferences(agentData: FullAgentDefinit
|
|
|
29
27
|
* Validates agent relationships (transfer and delegation targets exist)
|
|
30
28
|
*/
|
|
31
29
|
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
30
|
+
declare function validateSubAgentExternalAgentRelations(agentData: FullAgentDefinition, availableExternalAgentIds?: Set<string>): void;
|
|
32
31
|
/**
|
|
33
32
|
* Validates the agent structure before creation/update
|
|
34
33
|
* Note: With scoped architecture, project-scoped resource validation should be done at project level
|
|
@@ -37,6 +36,7 @@ declare function validateAgentStructure(agentData: FullAgentDefinition, projectR
|
|
|
37
36
|
toolIds?: Set<string>;
|
|
38
37
|
dataComponentIds?: Set<string>;
|
|
39
38
|
artifactComponentIds?: Set<string>;
|
|
39
|
+
externalAgentIds?: Set<string>;
|
|
40
40
|
}): void;
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -151,4 +151,4 @@ declare function validatePreview(preview: {
|
|
|
151
151
|
data: Record<string, unknown>;
|
|
152
152
|
}): PreviewValidationResult;
|
|
153
153
|
|
|
154
|
-
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type PreviewValidationResult, type TransferData, TransferDataSchema, generateIdFromName,
|
|
154
|
+
export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type PreviewValidationResult, type TransferData, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validatePreview, validateSubAgentExternalAgentRelations, validateToolReferences };
|
package/dist/validation/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName,
|
|
2
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from '../chunk-
|
|
1
|
+
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validatePreview, validateSubAgentExternalAgentRelations, validateToolReferences } from '../chunk-HMVAAUTK.js';
|
|
2
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, resourceIdSchema, validatePropsAsJsonSchema } from '../chunk-NXC2HZQL.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
CREATE TABLE `sub_agent_external_agent_relations` (
|
|
2
|
+
`tenant_id` text NOT NULL,
|
|
3
|
+
`id` text NOT NULL,
|
|
4
|
+
`project_id` text NOT NULL,
|
|
5
|
+
`agent_id` text NOT NULL,
|
|
6
|
+
`sub_agent_id` text NOT NULL,
|
|
7
|
+
`external_agent_id` text NOT NULL,
|
|
8
|
+
`headers` blob,
|
|
9
|
+
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
10
|
+
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
11
|
+
PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
|
|
12
|
+
FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
13
|
+
FOREIGN KEY (`tenant_id`,`project_id`,`external_agent_id`) REFERENCES `external_agents`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
|
|
14
|
+
);
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
17
|
+
CREATE TABLE `__new_external_agents` (
|
|
18
|
+
`tenant_id` text NOT NULL,
|
|
19
|
+
`id` text NOT NULL,
|
|
20
|
+
`project_id` text NOT NULL,
|
|
21
|
+
`name` text NOT NULL,
|
|
22
|
+
`description` text NOT NULL,
|
|
23
|
+
`base_url` text NOT NULL,
|
|
24
|
+
`credential_reference_id` text,
|
|
25
|
+
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
26
|
+
`updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
27
|
+
PRIMARY KEY(`tenant_id`, `project_id`, `id`),
|
|
28
|
+
FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade,
|
|
29
|
+
FOREIGN KEY (`tenant_id`,`project_id`,`credential_reference_id`) REFERENCES `credential_references`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE set null
|
|
30
|
+
);
|
|
31
|
+
--> statement-breakpoint
|
|
32
|
+
INSERT INTO `__new_external_agents`("tenant_id", "id", "project_id", "name", "description", "base_url", "credential_reference_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "base_url", "credential_reference_id", "created_at", "updated_at" FROM `external_agents`;--> statement-breakpoint
|
|
33
|
+
DROP TABLE `external_agents`;--> statement-breakpoint
|
|
34
|
+
ALTER TABLE `__new_external_agents` RENAME TO `external_agents`;--> statement-breakpoint
|
|
35
|
+
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
36
|
+
ALTER TABLE `sub_agent_relations` DROP COLUMN `external_sub_agent_id`;
|