@inkeep/agents-core 0.0.0-dev-20251009194333 → 0.0.0-dev-20251009215610
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-VPJ6Z5QZ.js → chunk-5LRSB445.js} +115 -118
- package/dist/{chunk-TO2HNKGP.js → chunk-BVURASVM.js} +74 -110
- package/dist/chunk-TCLX6C3C.js +271 -0
- package/dist/chunk-ZSQFZL3Y.js +173 -0
- package/dist/client-exports.cjs +483 -225
- 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 +114 -117
- 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 +1687 -1360
- package/dist/index.d.cts +1530 -1524
- package/dist/index.d.ts +1530 -1524
- package/dist/index.js +1016 -989
- package/dist/{schema-Ct2NlO81.d.cts → schema-B1rukNyF.d.ts} +118 -137
- package/dist/{schema-BQk_FMBV.d.ts → schema-BIYOOKX_.d.cts} +118 -137
- 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-BEeDGMP9.d.cts} +226 -297
- package/dist/{utility-s9c5CVOe.d.ts → utility-BEeDGMP9.d.ts} +226 -297
- package/dist/validation/index.cjs +243 -238
- 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/meta/0005_snapshot.json +2558 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/dist/chunk-L53XWAYG.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
|
|
|
@@ -5,18 +5,9 @@ import { sqliteTable, text, primaryKey, foreignKey, blob, integer, index, unique
|
|
|
5
5
|
// src/db/schema.ts
|
|
6
6
|
var schema_exports = {};
|
|
7
7
|
__export(schema_exports, {
|
|
8
|
-
agentArtifactComponents: () => agentArtifactComponents,
|
|
9
|
-
agentArtifactComponentsRelations: () => agentArtifactComponentsRelations,
|
|
10
|
-
agentDataComponents: () => agentDataComponents,
|
|
11
|
-
agentDataComponentsRelations: () => agentDataComponentsRelations,
|
|
12
8
|
agentGraph: () => agentGraph,
|
|
13
9
|
agentGraphRelations: () => agentGraphRelations,
|
|
14
|
-
agentRelations: () => agentRelations,
|
|
15
|
-
agentRelationsRelations: () => agentRelationsRelations,
|
|
16
|
-
agentToolRelations: () => agentToolRelations,
|
|
17
10
|
agentToolRelationsRelations: () => agentToolRelationsRelations,
|
|
18
|
-
agents: () => agents,
|
|
19
|
-
agentsRelations: () => agentsRelations,
|
|
20
11
|
apiKeys: () => apiKeys,
|
|
21
12
|
apiKeysRelations: () => apiKeysRelations,
|
|
22
13
|
artifactComponents: () => artifactComponents,
|
|
@@ -41,6 +32,15 @@ __export(schema_exports, {
|
|
|
41
32
|
messagesRelations: () => messagesRelations,
|
|
42
33
|
projects: () => projects,
|
|
43
34
|
projectsRelations: () => projectsRelations,
|
|
35
|
+
subAgentArtifactComponents: () => subAgentArtifactComponents,
|
|
36
|
+
subAgentArtifactComponentsRelations: () => subAgentArtifactComponentsRelations,
|
|
37
|
+
subAgentDataComponents: () => subAgentDataComponents,
|
|
38
|
+
subAgentDataComponentsRelations: () => subAgentDataComponentsRelations,
|
|
39
|
+
subAgentRelations: () => subAgentRelations,
|
|
40
|
+
subAgentRelationsRelations: () => subAgentRelationsRelations,
|
|
41
|
+
subAgentToolRelations: () => subAgentToolRelations,
|
|
42
|
+
subAgents: () => subAgents,
|
|
43
|
+
subAgentsRelations: () => subAgentsRelations,
|
|
44
44
|
taskRelations: () => taskRelations,
|
|
45
45
|
taskRelationsRelations: () => taskRelationsRelations,
|
|
46
46
|
tasks: () => tasks,
|
|
@@ -60,9 +60,9 @@ var graphScoped = {
|
|
|
60
60
|
...projectScoped,
|
|
61
61
|
graphId: text("graph_id").notNull()
|
|
62
62
|
};
|
|
63
|
-
var
|
|
63
|
+
var subAgentScoped = {
|
|
64
64
|
...graphScoped,
|
|
65
|
-
|
|
65
|
+
subAgentId: text("sub_agent_id").notNull()
|
|
66
66
|
};
|
|
67
67
|
var uiProperties = {
|
|
68
68
|
name: text("name").notNull(),
|
|
@@ -93,7 +93,7 @@ var agentGraph = sqliteTable(
|
|
|
93
93
|
...projectScoped,
|
|
94
94
|
name: text("name").notNull(),
|
|
95
95
|
description: text("description"),
|
|
96
|
-
|
|
96
|
+
defaultSubAgentId: text("default_sub_agent_id"),
|
|
97
97
|
// Reference to shared context configuration for all agents in this graph
|
|
98
98
|
contextConfigId: text("context_config_id"),
|
|
99
99
|
// add fk relationship
|
|
@@ -172,8 +172,8 @@ var contextCache = sqliteTable(
|
|
|
172
172
|
)
|
|
173
173
|
]
|
|
174
174
|
);
|
|
175
|
-
var
|
|
176
|
-
"
|
|
175
|
+
var subAgents = sqliteTable(
|
|
176
|
+
"sub_agents",
|
|
177
177
|
{
|
|
178
178
|
...graphScoped,
|
|
179
179
|
...uiProperties,
|
|
@@ -195,17 +195,16 @@ var agents = sqliteTable(
|
|
|
195
195
|
}).onDelete("cascade")
|
|
196
196
|
]
|
|
197
197
|
);
|
|
198
|
-
var
|
|
199
|
-
"
|
|
198
|
+
var subAgentRelations = sqliteTable(
|
|
199
|
+
"sub_agent_relations",
|
|
200
200
|
{
|
|
201
201
|
...graphScoped,
|
|
202
|
-
|
|
202
|
+
sourceSubAgentId: text("source_sub_agent_id").notNull(),
|
|
203
203
|
// For internal relationships
|
|
204
|
-
|
|
204
|
+
targetSubAgentId: text("target_sub_agent_id"),
|
|
205
205
|
// For external relationships
|
|
206
|
-
|
|
206
|
+
externalSubAgentId: text("external_sub_agent_id"),
|
|
207
207
|
relationType: text("relation_type"),
|
|
208
|
-
// 'transfer' | 'delegate'
|
|
209
208
|
...timestamps
|
|
210
209
|
},
|
|
211
210
|
(table) => [
|
|
@@ -213,7 +212,7 @@ var agentRelations = sqliteTable(
|
|
|
213
212
|
foreignKey({
|
|
214
213
|
columns: [table.tenantId, table.projectId, table.graphId],
|
|
215
214
|
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
216
|
-
name: "
|
|
215
|
+
name: "sub_agent_relations_graph_fk"
|
|
217
216
|
}).onDelete("cascade")
|
|
218
217
|
]
|
|
219
218
|
);
|
|
@@ -249,7 +248,7 @@ var externalAgents = sqliteTable(
|
|
|
249
248
|
var tasks = sqliteTable(
|
|
250
249
|
"tasks",
|
|
251
250
|
{
|
|
252
|
-
...
|
|
251
|
+
...subAgentScoped,
|
|
253
252
|
contextId: text("context_id").notNull(),
|
|
254
253
|
status: text("status").notNull(),
|
|
255
254
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
@@ -258,9 +257,9 @@ var tasks = sqliteTable(
|
|
|
258
257
|
(table) => [
|
|
259
258
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
260
259
|
foreignKey({
|
|
261
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
262
|
-
foreignColumns: [
|
|
263
|
-
name: "
|
|
260
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
261
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
262
|
+
name: "tasks_sub_agent_fk"
|
|
264
263
|
}).onDelete("cascade")
|
|
265
264
|
]
|
|
266
265
|
);
|
|
@@ -300,10 +299,10 @@ var dataComponents = sqliteTable(
|
|
|
300
299
|
}).onDelete("cascade")
|
|
301
300
|
]
|
|
302
301
|
);
|
|
303
|
-
var
|
|
304
|
-
"
|
|
302
|
+
var subAgentDataComponents = sqliteTable(
|
|
303
|
+
"sub_agent_data_components",
|
|
305
304
|
{
|
|
306
|
-
...
|
|
305
|
+
...subAgentScoped,
|
|
307
306
|
dataComponentId: text("data_component_id").notNull(),
|
|
308
307
|
createdAt: text("created_at").notNull().default(sql`CURRENT_TIMESTAMP`)
|
|
309
308
|
},
|
|
@@ -311,15 +310,15 @@ var agentDataComponents = sqliteTable(
|
|
|
311
310
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
312
311
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
313
312
|
foreignKey({
|
|
314
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
315
|
-
foreignColumns: [
|
|
316
|
-
name: "
|
|
313
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
314
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
315
|
+
name: "sub_agent_data_components_sub_agent_fk"
|
|
317
316
|
}).onDelete("cascade"),
|
|
318
317
|
// Foreign key constraint to data_components table
|
|
319
318
|
foreignKey({
|
|
320
319
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
321
320
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
322
|
-
name: "
|
|
321
|
+
name: "sub_agent_data_components_data_component_fk"
|
|
323
322
|
}).onDelete("cascade")
|
|
324
323
|
]
|
|
325
324
|
);
|
|
@@ -340,22 +339,22 @@ var artifactComponents = sqliteTable(
|
|
|
340
339
|
}).onDelete("cascade")
|
|
341
340
|
]
|
|
342
341
|
);
|
|
343
|
-
var
|
|
344
|
-
"
|
|
342
|
+
var subAgentArtifactComponents = sqliteTable(
|
|
343
|
+
"sub_agent_artifact_components",
|
|
345
344
|
{
|
|
346
|
-
...
|
|
345
|
+
...subAgentScoped,
|
|
347
346
|
artifactComponentId: text("artifact_component_id").notNull(),
|
|
348
347
|
createdAt: text("created_at").notNull().default(sql`CURRENT_TIMESTAMP`)
|
|
349
348
|
},
|
|
350
349
|
(table) => [
|
|
351
350
|
primaryKey({
|
|
352
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
351
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId, table.id]
|
|
353
352
|
}),
|
|
354
353
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
355
354
|
foreignKey({
|
|
356
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
357
|
-
foreignColumns: [
|
|
358
|
-
name: "
|
|
355
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
356
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
357
|
+
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
359
358
|
}).onDelete("cascade"),
|
|
360
359
|
// Foreign key constraint to artifact_components table
|
|
361
360
|
foreignKey({
|
|
@@ -365,7 +364,7 @@ var agentArtifactComponents = sqliteTable(
|
|
|
365
364
|
artifactComponents.projectId,
|
|
366
365
|
artifactComponents.id
|
|
367
366
|
],
|
|
368
|
-
name: "
|
|
367
|
+
name: "sub_agent_artifact_components_artifact_component_fk"
|
|
369
368
|
}).onDelete("cascade")
|
|
370
369
|
]
|
|
371
370
|
);
|
|
@@ -421,10 +420,10 @@ var functions = sqliteTable(
|
|
|
421
420
|
}).onDelete("cascade")
|
|
422
421
|
]
|
|
423
422
|
);
|
|
424
|
-
var
|
|
425
|
-
"
|
|
423
|
+
var subAgentToolRelations = sqliteTable(
|
|
424
|
+
"sub_agent_tool_relations",
|
|
426
425
|
{
|
|
427
|
-
...
|
|
426
|
+
...subAgentScoped,
|
|
428
427
|
toolId: text("tool_id").notNull(),
|
|
429
428
|
selectedTools: blob("selected_tools", { mode: "json" }).$type(),
|
|
430
429
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
@@ -434,15 +433,15 @@ var agentToolRelations = sqliteTable(
|
|
|
434
433
|
primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
435
434
|
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
436
435
|
foreignKey({
|
|
437
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
438
|
-
foreignColumns: [
|
|
439
|
-
name: "
|
|
436
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
437
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
438
|
+
name: "sub_agent_tool_relations_agent_fk"
|
|
440
439
|
}).onDelete("cascade"),
|
|
441
440
|
// Foreign key constraint to tools table
|
|
442
441
|
foreignKey({
|
|
443
442
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
444
443
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
445
|
-
name: "
|
|
444
|
+
name: "sub_agent_tool_relations_tool_fk"
|
|
446
445
|
}).onDelete("cascade")
|
|
447
446
|
]
|
|
448
447
|
);
|
|
@@ -451,7 +450,7 @@ var conversations = sqliteTable(
|
|
|
451
450
|
{
|
|
452
451
|
...projectScoped,
|
|
453
452
|
userId: text("user_id"),
|
|
454
|
-
|
|
453
|
+
activeSubAgentId: text("active_sub_agent_id").notNull(),
|
|
455
454
|
title: text("title"),
|
|
456
455
|
lastContextResolution: text("last_context_resolution"),
|
|
457
456
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
@@ -475,15 +474,15 @@ var messages = sqliteTable(
|
|
|
475
474
|
role: text("role").notNull(),
|
|
476
475
|
// 'user' | 'agent' | 'system'
|
|
477
476
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
478
|
-
|
|
477
|
+
fromSubAgentId: text("from_sub_agent_id"),
|
|
479
478
|
// Populated when message is from an agent
|
|
480
|
-
|
|
479
|
+
toSubAgentId: text("to_sub_agent_id"),
|
|
481
480
|
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
482
481
|
// External agent sender tracking
|
|
483
|
-
fromExternalAgentId: text("
|
|
482
|
+
fromExternalAgentId: text("from_external_sub_agent_id"),
|
|
484
483
|
// Populated when message is directed from an external agent
|
|
485
484
|
// External agent recipient tracking
|
|
486
|
-
toExternalAgentId: text("
|
|
485
|
+
toExternalAgentId: text("to_external_sub_agent_id"),
|
|
487
486
|
// Populated when message is directed to an external agent
|
|
488
487
|
// Message content stored as JSON to support both formats
|
|
489
488
|
content: blob("content", { mode: "json" }).$type().notNull(),
|
|
@@ -492,8 +491,6 @@ var messages = sqliteTable(
|
|
|
492
491
|
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
493
492
|
messageType: text("message_type").notNull().default("chat"),
|
|
494
493
|
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
495
|
-
// Legacy agent association (consider deprecating in favor of fromAgentId/toAgentId)
|
|
496
|
-
agentId: text("agent_id"),
|
|
497
494
|
taskId: text("task_id"),
|
|
498
495
|
parentMessageId: text("parent_message_id"),
|
|
499
496
|
// Remove self-reference constraint here
|
|
@@ -620,10 +617,9 @@ var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
|
620
617
|
childRelations: many(taskRelations, {
|
|
621
618
|
relationName: "parentTask"
|
|
622
619
|
}),
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
references: [agents.id]
|
|
620
|
+
subAgent: one(subAgents, {
|
|
621
|
+
fields: [tasks.subAgentId],
|
|
622
|
+
references: [subAgents.id]
|
|
627
623
|
}),
|
|
628
624
|
// A task can have many messages associated with it
|
|
629
625
|
messages: many(messages),
|
|
@@ -631,7 +627,7 @@ var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
|
631
627
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
632
628
|
}));
|
|
633
629
|
var projectsRelations = relations(projects, ({ many }) => ({
|
|
634
|
-
|
|
630
|
+
subAgents: many(subAgents),
|
|
635
631
|
agentGraphs: many(agentGraph),
|
|
636
632
|
tools: many(tools),
|
|
637
633
|
contextConfigs: many(contextConfigs),
|
|
@@ -669,17 +665,17 @@ var contextCacheRelations = relations(contextCache, ({ one }) => ({
|
|
|
669
665
|
references: [contextConfigs.id]
|
|
670
666
|
})
|
|
671
667
|
}));
|
|
672
|
-
var
|
|
668
|
+
var subAgentsRelations = relations(subAgents, ({ many, one }) => ({
|
|
673
669
|
project: one(projects, {
|
|
674
|
-
fields: [
|
|
670
|
+
fields: [subAgents.tenantId, subAgents.projectId],
|
|
675
671
|
references: [projects.tenantId, projects.id]
|
|
676
672
|
}),
|
|
677
673
|
tasks: many(tasks),
|
|
678
674
|
defaultForGraphs: many(agentGraph),
|
|
679
|
-
sourceRelations: many(
|
|
675
|
+
sourceRelations: many(subAgentRelations, {
|
|
680
676
|
relationName: "sourceRelations"
|
|
681
677
|
}),
|
|
682
|
-
targetRelations: many(
|
|
678
|
+
targetRelations: many(subAgentRelations, {
|
|
683
679
|
relationName: "targetRelations"
|
|
684
680
|
}),
|
|
685
681
|
sentMessages: many(messages, {
|
|
@@ -691,18 +687,18 @@ var agentsRelations = relations(agents, ({ many, one }) => ({
|
|
|
691
687
|
associatedMessages: many(messages, {
|
|
692
688
|
relationName: "associatedAgent"
|
|
693
689
|
}),
|
|
694
|
-
toolRelations: many(
|
|
695
|
-
dataComponentRelations: many(
|
|
696
|
-
artifactComponentRelations: many(
|
|
690
|
+
toolRelations: many(subAgentToolRelations),
|
|
691
|
+
dataComponentRelations: many(subAgentDataComponents),
|
|
692
|
+
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
697
693
|
}));
|
|
698
694
|
var agentGraphRelations = relations(agentGraph, ({ one }) => ({
|
|
699
695
|
project: one(projects, {
|
|
700
696
|
fields: [agentGraph.tenantId, agentGraph.projectId],
|
|
701
697
|
references: [projects.tenantId, projects.id]
|
|
702
698
|
}),
|
|
703
|
-
|
|
704
|
-
fields: [agentGraph.
|
|
705
|
-
references: [
|
|
699
|
+
defaultSubAgent: one(subAgents, {
|
|
700
|
+
fields: [agentGraph.defaultSubAgentId],
|
|
701
|
+
references: [subAgents.id]
|
|
706
702
|
}),
|
|
707
703
|
contextConfig: one(contextConfigs, {
|
|
708
704
|
fields: [agentGraph.contextConfigId],
|
|
@@ -714,7 +710,7 @@ var externalAgentsRelations = relations(externalAgents, ({ one, many }) => ({
|
|
|
714
710
|
fields: [externalAgents.tenantId, externalAgents.projectId],
|
|
715
711
|
references: [projects.tenantId, projects.id]
|
|
716
712
|
}),
|
|
717
|
-
|
|
713
|
+
subAgentRelations: many(subAgentRelations),
|
|
718
714
|
credentialReference: one(credentialReferences, {
|
|
719
715
|
fields: [externalAgents.credentialReferenceId],
|
|
720
716
|
references: [credentialReferences.id]
|
|
@@ -730,13 +726,13 @@ var apiKeysRelations = relations(apiKeys, ({ one }) => ({
|
|
|
730
726
|
references: [agentGraph.id]
|
|
731
727
|
})
|
|
732
728
|
}));
|
|
733
|
-
var agentToolRelationsRelations = relations(
|
|
734
|
-
|
|
735
|
-
fields: [
|
|
736
|
-
references: [
|
|
729
|
+
var agentToolRelationsRelations = relations(subAgentToolRelations, ({ one }) => ({
|
|
730
|
+
subAgent: one(subAgents, {
|
|
731
|
+
fields: [subAgentToolRelations.subAgentId],
|
|
732
|
+
references: [subAgents.id]
|
|
737
733
|
}),
|
|
738
734
|
tool: one(tools, {
|
|
739
|
-
fields: [
|
|
735
|
+
fields: [subAgentToolRelations.toolId],
|
|
740
736
|
references: [tools.id]
|
|
741
737
|
})
|
|
742
738
|
}));
|
|
@@ -748,7 +744,7 @@ var toolsRelations = relations(tools, ({ one, many }) => ({
|
|
|
748
744
|
fields: [tools.tenantId, tools.projectId],
|
|
749
745
|
references: [projects.tenantId, projects.id]
|
|
750
746
|
}),
|
|
751
|
-
|
|
747
|
+
subAgentRelations: many(subAgentToolRelations),
|
|
752
748
|
credentialReference: one(credentialReferences, {
|
|
753
749
|
fields: [tools.credentialReferenceId],
|
|
754
750
|
references: [credentialReferences.id]
|
|
@@ -764,9 +760,9 @@ var conversationsRelations = relations(conversations, ({ one, many }) => ({
|
|
|
764
760
|
references: [projects.tenantId, projects.id]
|
|
765
761
|
}),
|
|
766
762
|
messages: many(messages),
|
|
767
|
-
|
|
768
|
-
fields: [conversations.
|
|
769
|
-
references: [
|
|
763
|
+
activeSubAgent: one(subAgents, {
|
|
764
|
+
fields: [conversations.activeSubAgentId],
|
|
765
|
+
references: [subAgents.id]
|
|
770
766
|
})
|
|
771
767
|
}));
|
|
772
768
|
var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
@@ -774,20 +770,14 @@ var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
|
774
770
|
fields: [messages.conversationId],
|
|
775
771
|
references: [conversations.id]
|
|
776
772
|
}),
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
references: [agents.id],
|
|
781
|
-
relationName: "associatedAgent"
|
|
782
|
-
}),
|
|
783
|
-
fromAgent: one(agents, {
|
|
784
|
-
fields: [messages.fromAgentId],
|
|
785
|
-
references: [agents.id],
|
|
773
|
+
fromSubAgent: one(subAgents, {
|
|
774
|
+
fields: [messages.fromSubAgentId],
|
|
775
|
+
references: [subAgents.id],
|
|
786
776
|
relationName: "sentMessages"
|
|
787
777
|
}),
|
|
788
|
-
|
|
789
|
-
fields: [messages.
|
|
790
|
-
references: [
|
|
778
|
+
toSubAgent: one(subAgents, {
|
|
779
|
+
fields: [messages.toSubAgentId],
|
|
780
|
+
references: [subAgents.id],
|
|
791
781
|
relationName: "receivedMessages"
|
|
792
782
|
}),
|
|
793
783
|
fromExternalAgent: one(externalAgents, {
|
|
@@ -813,33 +803,40 @@ var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
|
813
803
|
relationName: "parentChild"
|
|
814
804
|
})
|
|
815
805
|
}));
|
|
816
|
-
var artifactComponentsRelations = relations(artifactComponents, ({ many }) => ({
|
|
817
|
-
|
|
806
|
+
var artifactComponentsRelations = relations(artifactComponents, ({ many, one }) => ({
|
|
807
|
+
project: one(projects, {
|
|
808
|
+
fields: [artifactComponents.tenantId, artifactComponents.projectId],
|
|
809
|
+
references: [projects.tenantId, projects.id]
|
|
810
|
+
}),
|
|
811
|
+
subAgentRelations: many(subAgentArtifactComponents)
|
|
818
812
|
}));
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
813
|
+
var subAgentArtifactComponentsRelations = relations(
|
|
814
|
+
subAgentArtifactComponents,
|
|
815
|
+
({ one }) => ({
|
|
816
|
+
subAgent: one(subAgents, {
|
|
817
|
+
fields: [subAgentArtifactComponents.subAgentId],
|
|
818
|
+
references: [subAgents.id]
|
|
819
|
+
}),
|
|
820
|
+
artifactComponent: one(artifactComponents, {
|
|
821
|
+
fields: [subAgentArtifactComponents.artifactComponentId],
|
|
822
|
+
references: [artifactComponents.id]
|
|
823
|
+
})
|
|
827
824
|
})
|
|
828
|
-
|
|
825
|
+
);
|
|
829
826
|
var dataComponentsRelations = relations(dataComponents, ({ many, one }) => ({
|
|
830
827
|
project: one(projects, {
|
|
831
828
|
fields: [dataComponents.tenantId, dataComponents.projectId],
|
|
832
829
|
references: [projects.tenantId, projects.id]
|
|
833
830
|
}),
|
|
834
|
-
|
|
831
|
+
subAgentRelations: many(subAgentDataComponents)
|
|
835
832
|
}));
|
|
836
|
-
var
|
|
837
|
-
|
|
838
|
-
fields: [
|
|
839
|
-
references: [
|
|
833
|
+
var subAgentDataComponentsRelations = relations(subAgentDataComponents, ({ one }) => ({
|
|
834
|
+
subAgent: one(subAgents, {
|
|
835
|
+
fields: [subAgentDataComponents.subAgentId],
|
|
836
|
+
references: [subAgents.id]
|
|
840
837
|
}),
|
|
841
838
|
dataComponent: one(dataComponents, {
|
|
842
|
-
fields: [
|
|
839
|
+
fields: [subAgentDataComponents.dataComponentId],
|
|
843
840
|
references: [dataComponents.id]
|
|
844
841
|
})
|
|
845
842
|
}));
|
|
@@ -856,25 +853,25 @@ var ledgerArtifactsRelations = relations(ledgerArtifacts, ({ one }) => ({
|
|
|
856
853
|
var functionsRelations = relations(functions, ({ many }) => ({
|
|
857
854
|
tools: many(tools)
|
|
858
855
|
}));
|
|
859
|
-
var
|
|
856
|
+
var subAgentRelationsRelations = relations(subAgentRelations, ({ one }) => ({
|
|
860
857
|
graph: one(agentGraph, {
|
|
861
|
-
fields: [
|
|
858
|
+
fields: [subAgentRelations.graphId],
|
|
862
859
|
references: [agentGraph.id]
|
|
863
860
|
}),
|
|
864
|
-
|
|
865
|
-
fields: [
|
|
866
|
-
references: [
|
|
861
|
+
sourceSubAgent: one(subAgents, {
|
|
862
|
+
fields: [subAgentRelations.sourceSubAgentId],
|
|
863
|
+
references: [subAgents.id],
|
|
867
864
|
relationName: "sourceRelations"
|
|
868
865
|
}),
|
|
869
|
-
|
|
870
|
-
fields: [
|
|
871
|
-
references: [
|
|
866
|
+
targetSubAgent: one(subAgents, {
|
|
867
|
+
fields: [subAgentRelations.targetSubAgentId],
|
|
868
|
+
references: [subAgents.id],
|
|
872
869
|
relationName: "targetRelations"
|
|
873
870
|
}),
|
|
874
871
|
externalAgent: one(externalAgents, {
|
|
875
|
-
fields: [
|
|
872
|
+
fields: [subAgentRelations.externalSubAgentId],
|
|
876
873
|
references: [externalAgents.id]
|
|
877
874
|
})
|
|
878
875
|
}));
|
|
879
876
|
|
|
880
|
-
export {
|
|
877
|
+
export { agentGraph, agentGraphRelations, agentToolRelationsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
|