@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/dist/db/schema.cjs
CHANGED
|
@@ -16,9 +16,9 @@ var graphScoped = {
|
|
|
16
16
|
...projectScoped,
|
|
17
17
|
graphId: sqliteCore.text("graph_id").notNull()
|
|
18
18
|
};
|
|
19
|
-
var
|
|
19
|
+
var subAgentScoped = {
|
|
20
20
|
...graphScoped,
|
|
21
|
-
|
|
21
|
+
subAgentId: sqliteCore.text("sub_agent_id").notNull()
|
|
22
22
|
};
|
|
23
23
|
var uiProperties = {
|
|
24
24
|
name: sqliteCore.text("name").notNull(),
|
|
@@ -49,7 +49,7 @@ var agentGraph = sqliteCore.sqliteTable(
|
|
|
49
49
|
...projectScoped,
|
|
50
50
|
name: sqliteCore.text("name").notNull(),
|
|
51
51
|
description: sqliteCore.text("description"),
|
|
52
|
-
|
|
52
|
+
defaultSubAgentId: sqliteCore.text("default_sub_agent_id"),
|
|
53
53
|
// Reference to shared context configuration for all agents in this graph
|
|
54
54
|
contextConfigId: sqliteCore.text("context_config_id"),
|
|
55
55
|
// add fk relationship
|
|
@@ -128,8 +128,8 @@ var contextCache = sqliteCore.sqliteTable(
|
|
|
128
128
|
)
|
|
129
129
|
]
|
|
130
130
|
);
|
|
131
|
-
var
|
|
132
|
-
"
|
|
131
|
+
var subAgents = sqliteCore.sqliteTable(
|
|
132
|
+
"sub_agents",
|
|
133
133
|
{
|
|
134
134
|
...graphScoped,
|
|
135
135
|
...uiProperties,
|
|
@@ -151,17 +151,16 @@ var agents = sqliteCore.sqliteTable(
|
|
|
151
151
|
}).onDelete("cascade")
|
|
152
152
|
]
|
|
153
153
|
);
|
|
154
|
-
var
|
|
155
|
-
"
|
|
154
|
+
var subAgentRelations = sqliteCore.sqliteTable(
|
|
155
|
+
"sub_agent_relations",
|
|
156
156
|
{
|
|
157
157
|
...graphScoped,
|
|
158
|
-
|
|
158
|
+
sourceSubAgentId: sqliteCore.text("source_sub_agent_id").notNull(),
|
|
159
159
|
// For internal relationships
|
|
160
|
-
|
|
160
|
+
targetSubAgentId: sqliteCore.text("target_sub_agent_id"),
|
|
161
161
|
// For external relationships
|
|
162
|
-
|
|
162
|
+
externalSubAgentId: sqliteCore.text("external_sub_agent_id"),
|
|
163
163
|
relationType: sqliteCore.text("relation_type"),
|
|
164
|
-
// 'transfer' | 'delegate'
|
|
165
164
|
...timestamps
|
|
166
165
|
},
|
|
167
166
|
(table) => [
|
|
@@ -169,7 +168,7 @@ var agentRelations = sqliteCore.sqliteTable(
|
|
|
169
168
|
sqliteCore.foreignKey({
|
|
170
169
|
columns: [table.tenantId, table.projectId, table.graphId],
|
|
171
170
|
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
172
|
-
name: "
|
|
171
|
+
name: "sub_agent_relations_graph_fk"
|
|
173
172
|
}).onDelete("cascade")
|
|
174
173
|
]
|
|
175
174
|
);
|
|
@@ -205,7 +204,7 @@ var externalAgents = sqliteCore.sqliteTable(
|
|
|
205
204
|
var tasks = sqliteCore.sqliteTable(
|
|
206
205
|
"tasks",
|
|
207
206
|
{
|
|
208
|
-
...
|
|
207
|
+
...subAgentScoped,
|
|
209
208
|
contextId: sqliteCore.text("context_id").notNull(),
|
|
210
209
|
status: sqliteCore.text("status").notNull(),
|
|
211
210
|
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
@@ -214,9 +213,9 @@ var tasks = sqliteCore.sqliteTable(
|
|
|
214
213
|
(table) => [
|
|
215
214
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
216
215
|
sqliteCore.foreignKey({
|
|
217
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
218
|
-
foreignColumns: [
|
|
219
|
-
name: "
|
|
216
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
217
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
218
|
+
name: "tasks_sub_agent_fk"
|
|
220
219
|
}).onDelete("cascade")
|
|
221
220
|
]
|
|
222
221
|
);
|
|
@@ -256,10 +255,10 @@ var dataComponents = sqliteCore.sqliteTable(
|
|
|
256
255
|
}).onDelete("cascade")
|
|
257
256
|
]
|
|
258
257
|
);
|
|
259
|
-
var
|
|
260
|
-
"
|
|
258
|
+
var subAgentDataComponents = sqliteCore.sqliteTable(
|
|
259
|
+
"sub_agent_data_components",
|
|
261
260
|
{
|
|
262
|
-
...
|
|
261
|
+
...subAgentScoped,
|
|
263
262
|
dataComponentId: sqliteCore.text("data_component_id").notNull(),
|
|
264
263
|
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
265
264
|
},
|
|
@@ -267,15 +266,15 @@ var agentDataComponents = sqliteCore.sqliteTable(
|
|
|
267
266
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
268
267
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
269
268
|
sqliteCore.foreignKey({
|
|
270
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
271
|
-
foreignColumns: [
|
|
272
|
-
name: "
|
|
269
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
270
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
271
|
+
name: "sub_agent_data_components_sub_agent_fk"
|
|
273
272
|
}).onDelete("cascade"),
|
|
274
273
|
// Foreign key constraint to data_components table
|
|
275
274
|
sqliteCore.foreignKey({
|
|
276
275
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
277
276
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
278
|
-
name: "
|
|
277
|
+
name: "sub_agent_data_components_data_component_fk"
|
|
279
278
|
}).onDelete("cascade")
|
|
280
279
|
]
|
|
281
280
|
);
|
|
@@ -296,22 +295,22 @@ var artifactComponents = sqliteCore.sqliteTable(
|
|
|
296
295
|
}).onDelete("cascade")
|
|
297
296
|
]
|
|
298
297
|
);
|
|
299
|
-
var
|
|
300
|
-
"
|
|
298
|
+
var subAgentArtifactComponents = sqliteCore.sqliteTable(
|
|
299
|
+
"sub_agent_artifact_components",
|
|
301
300
|
{
|
|
302
|
-
...
|
|
301
|
+
...subAgentScoped,
|
|
303
302
|
artifactComponentId: sqliteCore.text("artifact_component_id").notNull(),
|
|
304
303
|
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
305
304
|
},
|
|
306
305
|
(table) => [
|
|
307
306
|
sqliteCore.primaryKey({
|
|
308
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
307
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId, table.id]
|
|
309
308
|
}),
|
|
310
309
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
311
310
|
sqliteCore.foreignKey({
|
|
312
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
313
|
-
foreignColumns: [
|
|
314
|
-
name: "
|
|
311
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
312
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
313
|
+
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
315
314
|
}).onDelete("cascade"),
|
|
316
315
|
// Foreign key constraint to artifact_components table
|
|
317
316
|
sqliteCore.foreignKey({
|
|
@@ -321,7 +320,7 @@ var agentArtifactComponents = sqliteCore.sqliteTable(
|
|
|
321
320
|
artifactComponents.projectId,
|
|
322
321
|
artifactComponents.id
|
|
323
322
|
],
|
|
324
|
-
name: "
|
|
323
|
+
name: "sub_agent_artifact_components_artifact_component_fk"
|
|
325
324
|
}).onDelete("cascade")
|
|
326
325
|
]
|
|
327
326
|
);
|
|
@@ -331,10 +330,7 @@ var tools = sqliteCore.sqliteTable(
|
|
|
331
330
|
...projectScoped,
|
|
332
331
|
name: sqliteCore.text("name").notNull(),
|
|
333
332
|
description: sqliteCore.text("description"),
|
|
334
|
-
// Tool configuration - supports both MCP and function tools
|
|
335
333
|
config: sqliteCore.blob("config", { mode: "json" }).$type().notNull(),
|
|
336
|
-
// For function tools, reference the global functions table
|
|
337
|
-
functionId: sqliteCore.text("function_id"),
|
|
338
334
|
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
339
335
|
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
340
336
|
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
@@ -350,12 +346,30 @@ var tools = sqliteCore.sqliteTable(
|
|
|
350
346
|
columns: [table.tenantId, table.projectId],
|
|
351
347
|
foreignColumns: [projects.tenantId, projects.id],
|
|
352
348
|
name: "tools_project_fk"
|
|
349
|
+
}).onDelete("cascade")
|
|
350
|
+
]
|
|
351
|
+
);
|
|
352
|
+
var functionTools = sqliteCore.sqliteTable(
|
|
353
|
+
"function_tools",
|
|
354
|
+
{
|
|
355
|
+
...graphScoped,
|
|
356
|
+
name: sqliteCore.text("name").notNull(),
|
|
357
|
+
description: sqliteCore.text("description"),
|
|
358
|
+
functionId: sqliteCore.text("function_id").notNull(),
|
|
359
|
+
...timestamps
|
|
360
|
+
},
|
|
361
|
+
(table) => [
|
|
362
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
363
|
+
sqliteCore.foreignKey({
|
|
364
|
+
columns: [table.tenantId, table.projectId, table.graphId],
|
|
365
|
+
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
366
|
+
name: "function_tools_graph_fk"
|
|
353
367
|
}).onDelete("cascade"),
|
|
354
|
-
// Foreign key constraint to functions table
|
|
368
|
+
// Foreign key constraint to functions table
|
|
355
369
|
sqliteCore.foreignKey({
|
|
356
370
|
columns: [table.tenantId, table.projectId, table.functionId],
|
|
357
371
|
foreignColumns: [functions.tenantId, functions.projectId, functions.id],
|
|
358
|
-
name: "
|
|
372
|
+
name: "function_tools_function_fk"
|
|
359
373
|
}).onDelete("cascade")
|
|
360
374
|
]
|
|
361
375
|
);
|
|
@@ -377,10 +391,10 @@ var functions = sqliteCore.sqliteTable(
|
|
|
377
391
|
}).onDelete("cascade")
|
|
378
392
|
]
|
|
379
393
|
);
|
|
380
|
-
var
|
|
381
|
-
"
|
|
394
|
+
var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
395
|
+
"sub_agent_tool_relations",
|
|
382
396
|
{
|
|
383
|
-
...
|
|
397
|
+
...subAgentScoped,
|
|
384
398
|
toolId: sqliteCore.text("tool_id").notNull(),
|
|
385
399
|
selectedTools: sqliteCore.blob("selected_tools", { mode: "json" }).$type(),
|
|
386
400
|
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
@@ -390,15 +404,43 @@ var agentToolRelations = sqliteCore.sqliteTable(
|
|
|
390
404
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
391
405
|
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
392
406
|
sqliteCore.foreignKey({
|
|
393
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
394
|
-
foreignColumns: [
|
|
395
|
-
name: "
|
|
407
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
408
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
409
|
+
name: "sub_agent_tool_relations_agent_fk"
|
|
396
410
|
}).onDelete("cascade"),
|
|
397
|
-
// Foreign key constraint to tools table
|
|
411
|
+
// Foreign key constraint to tools table (MCP tools)
|
|
398
412
|
sqliteCore.foreignKey({
|
|
399
413
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
400
414
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
401
|
-
name: "
|
|
415
|
+
name: "sub_agent_tool_relations_tool_fk"
|
|
416
|
+
}).onDelete("cascade")
|
|
417
|
+
]
|
|
418
|
+
);
|
|
419
|
+
var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
420
|
+
"agent_function_tool_relations",
|
|
421
|
+
{
|
|
422
|
+
...subAgentScoped,
|
|
423
|
+
functionToolId: sqliteCore.text("function_tool_id").notNull(),
|
|
424
|
+
...timestamps
|
|
425
|
+
},
|
|
426
|
+
(table) => [
|
|
427
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
428
|
+
// Foreign key constraint to agents table
|
|
429
|
+
sqliteCore.foreignKey({
|
|
430
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
431
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
432
|
+
name: "agent_function_tool_relations_agent_fk"
|
|
433
|
+
}).onDelete("cascade"),
|
|
434
|
+
// Foreign key constraint to functionTools table
|
|
435
|
+
sqliteCore.foreignKey({
|
|
436
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.functionToolId],
|
|
437
|
+
foreignColumns: [
|
|
438
|
+
functionTools.tenantId,
|
|
439
|
+
functionTools.projectId,
|
|
440
|
+
functionTools.graphId,
|
|
441
|
+
functionTools.id
|
|
442
|
+
],
|
|
443
|
+
name: "agent_function_tool_relations_function_tool_fk"
|
|
402
444
|
}).onDelete("cascade")
|
|
403
445
|
]
|
|
404
446
|
);
|
|
@@ -407,7 +449,7 @@ var conversations = sqliteCore.sqliteTable(
|
|
|
407
449
|
{
|
|
408
450
|
...projectScoped,
|
|
409
451
|
userId: sqliteCore.text("user_id"),
|
|
410
|
-
|
|
452
|
+
activeSubAgentId: sqliteCore.text("active_sub_agent_id").notNull(),
|
|
411
453
|
title: sqliteCore.text("title"),
|
|
412
454
|
lastContextResolution: sqliteCore.text("last_context_resolution"),
|
|
413
455
|
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
@@ -431,15 +473,15 @@ var messages = sqliteCore.sqliteTable(
|
|
|
431
473
|
role: sqliteCore.text("role").notNull(),
|
|
432
474
|
// 'user' | 'agent' | 'system'
|
|
433
475
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
434
|
-
|
|
476
|
+
fromSubAgentId: sqliteCore.text("from_sub_agent_id"),
|
|
435
477
|
// Populated when message is from an agent
|
|
436
|
-
|
|
478
|
+
toSubAgentId: sqliteCore.text("to_sub_agent_id"),
|
|
437
479
|
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
438
480
|
// External agent sender tracking
|
|
439
|
-
fromExternalAgentId: sqliteCore.text("
|
|
481
|
+
fromExternalAgentId: sqliteCore.text("from_external_sub_agent_id"),
|
|
440
482
|
// Populated when message is directed from an external agent
|
|
441
483
|
// External agent recipient tracking
|
|
442
|
-
toExternalAgentId: sqliteCore.text("
|
|
484
|
+
toExternalAgentId: sqliteCore.text("to_external_sub_agent_id"),
|
|
443
485
|
// Populated when message is directed to an external agent
|
|
444
486
|
// Message content stored as JSON to support both formats
|
|
445
487
|
content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
|
|
@@ -448,8 +490,6 @@ var messages = sqliteCore.sqliteTable(
|
|
|
448
490
|
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
449
491
|
messageType: sqliteCore.text("message_type").notNull().default("chat"),
|
|
450
492
|
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
451
|
-
// Legacy agent association (consider deprecating in favor of fromAgentId/toAgentId)
|
|
452
|
-
agentId: sqliteCore.text("agent_id"),
|
|
453
493
|
taskId: sqliteCore.text("task_id"),
|
|
454
494
|
parentMessageId: sqliteCore.text("parent_message_id"),
|
|
455
495
|
// Remove self-reference constraint here
|
|
@@ -576,10 +616,9 @@ var tasksRelations = drizzleOrm.relations(tasks, ({ one, many }) => ({
|
|
|
576
616
|
childRelations: many(taskRelations, {
|
|
577
617
|
relationName: "parentTask"
|
|
578
618
|
}),
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
references: [agents.id]
|
|
619
|
+
subAgent: one(subAgents, {
|
|
620
|
+
fields: [tasks.subAgentId],
|
|
621
|
+
references: [subAgents.id]
|
|
583
622
|
}),
|
|
584
623
|
// A task can have many messages associated with it
|
|
585
624
|
messages: many(messages),
|
|
@@ -587,9 +626,10 @@ var tasksRelations = drizzleOrm.relations(tasks, ({ one, many }) => ({
|
|
|
587
626
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
588
627
|
}));
|
|
589
628
|
var projectsRelations = drizzleOrm.relations(projects, ({ many }) => ({
|
|
590
|
-
|
|
629
|
+
subAgents: many(subAgents),
|
|
591
630
|
agentGraphs: many(agentGraph),
|
|
592
631
|
tools: many(tools),
|
|
632
|
+
functions: many(functions),
|
|
593
633
|
contextConfigs: many(contextConfigs),
|
|
594
634
|
externalAgents: many(externalAgents),
|
|
595
635
|
conversations: many(conversations),
|
|
@@ -625,17 +665,17 @@ var contextCacheRelations = drizzleOrm.relations(contextCache, ({ one }) => ({
|
|
|
625
665
|
references: [contextConfigs.id]
|
|
626
666
|
})
|
|
627
667
|
}));
|
|
628
|
-
var
|
|
668
|
+
var subAgentsRelations = drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
629
669
|
project: one(projects, {
|
|
630
|
-
fields: [
|
|
670
|
+
fields: [subAgents.tenantId, subAgents.projectId],
|
|
631
671
|
references: [projects.tenantId, projects.id]
|
|
632
672
|
}),
|
|
633
673
|
tasks: many(tasks),
|
|
634
674
|
defaultForGraphs: many(agentGraph),
|
|
635
|
-
sourceRelations: many(
|
|
675
|
+
sourceRelations: many(subAgentRelations, {
|
|
636
676
|
relationName: "sourceRelations"
|
|
637
677
|
}),
|
|
638
|
-
targetRelations: many(
|
|
678
|
+
targetRelations: many(subAgentRelations, {
|
|
639
679
|
relationName: "targetRelations"
|
|
640
680
|
}),
|
|
641
681
|
sentMessages: many(messages, {
|
|
@@ -647,30 +687,32 @@ var agentsRelations = drizzleOrm.relations(agents, ({ many, one }) => ({
|
|
|
647
687
|
associatedMessages: many(messages, {
|
|
648
688
|
relationName: "associatedAgent"
|
|
649
689
|
}),
|
|
650
|
-
toolRelations: many(
|
|
651
|
-
|
|
652
|
-
|
|
690
|
+
toolRelations: many(subAgentToolRelations),
|
|
691
|
+
functionToolRelations: many(agentFunctionToolRelations),
|
|
692
|
+
dataComponentRelations: many(subAgentDataComponents),
|
|
693
|
+
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
653
694
|
}));
|
|
654
|
-
var agentGraphRelations = drizzleOrm.relations(agentGraph, ({ one }) => ({
|
|
695
|
+
var agentGraphRelations = drizzleOrm.relations(agentGraph, ({ one, many }) => ({
|
|
655
696
|
project: one(projects, {
|
|
656
697
|
fields: [agentGraph.tenantId, agentGraph.projectId],
|
|
657
698
|
references: [projects.tenantId, projects.id]
|
|
658
699
|
}),
|
|
659
|
-
|
|
660
|
-
fields: [agentGraph.
|
|
661
|
-
references: [
|
|
700
|
+
defaultSubAgent: one(subAgents, {
|
|
701
|
+
fields: [agentGraph.defaultSubAgentId],
|
|
702
|
+
references: [subAgents.id]
|
|
662
703
|
}),
|
|
663
704
|
contextConfig: one(contextConfigs, {
|
|
664
705
|
fields: [agentGraph.contextConfigId],
|
|
665
706
|
references: [contextConfigs.id]
|
|
666
|
-
})
|
|
707
|
+
}),
|
|
708
|
+
functionTools: many(functionTools)
|
|
667
709
|
}));
|
|
668
710
|
var externalAgentsRelations = drizzleOrm.relations(externalAgents, ({ one, many }) => ({
|
|
669
711
|
project: one(projects, {
|
|
670
712
|
fields: [externalAgents.tenantId, externalAgents.projectId],
|
|
671
713
|
references: [projects.tenantId, projects.id]
|
|
672
714
|
}),
|
|
673
|
-
|
|
715
|
+
subAgentRelations: many(subAgentRelations),
|
|
674
716
|
credentialReference: one(credentialReferences, {
|
|
675
717
|
fields: [externalAgents.credentialReferenceId],
|
|
676
718
|
references: [credentialReferences.id]
|
|
@@ -686,13 +728,13 @@ var apiKeysRelations = drizzleOrm.relations(apiKeys, ({ one }) => ({
|
|
|
686
728
|
references: [agentGraph.id]
|
|
687
729
|
})
|
|
688
730
|
}));
|
|
689
|
-
var agentToolRelationsRelations = drizzleOrm.relations(
|
|
690
|
-
|
|
691
|
-
fields: [
|
|
692
|
-
references: [
|
|
731
|
+
var agentToolRelationsRelations = drizzleOrm.relations(subAgentToolRelations, ({ one }) => ({
|
|
732
|
+
subAgent: one(subAgents, {
|
|
733
|
+
fields: [subAgentToolRelations.subAgentId],
|
|
734
|
+
references: [subAgents.id]
|
|
693
735
|
}),
|
|
694
736
|
tool: one(tools, {
|
|
695
|
-
fields: [
|
|
737
|
+
fields: [subAgentToolRelations.toolId],
|
|
696
738
|
references: [tools.id]
|
|
697
739
|
})
|
|
698
740
|
}));
|
|
@@ -704,14 +746,10 @@ var toolsRelations = drizzleOrm.relations(tools, ({ one, many }) => ({
|
|
|
704
746
|
fields: [tools.tenantId, tools.projectId],
|
|
705
747
|
references: [projects.tenantId, projects.id]
|
|
706
748
|
}),
|
|
707
|
-
|
|
749
|
+
subAgentRelations: many(subAgentToolRelations),
|
|
708
750
|
credentialReference: one(credentialReferences, {
|
|
709
751
|
fields: [tools.credentialReferenceId],
|
|
710
752
|
references: [credentialReferences.id]
|
|
711
|
-
}),
|
|
712
|
-
function: one(functions, {
|
|
713
|
-
fields: [tools.functionId],
|
|
714
|
-
references: [functions.id]
|
|
715
753
|
})
|
|
716
754
|
}));
|
|
717
755
|
var conversationsRelations = drizzleOrm.relations(conversations, ({ one, many }) => ({
|
|
@@ -720,9 +758,9 @@ var conversationsRelations = drizzleOrm.relations(conversations, ({ one, many })
|
|
|
720
758
|
references: [projects.tenantId, projects.id]
|
|
721
759
|
}),
|
|
722
760
|
messages: many(messages),
|
|
723
|
-
|
|
724
|
-
fields: [conversations.
|
|
725
|
-
references: [
|
|
761
|
+
activeSubAgent: one(subAgents, {
|
|
762
|
+
fields: [conversations.activeSubAgentId],
|
|
763
|
+
references: [subAgents.id]
|
|
726
764
|
})
|
|
727
765
|
}));
|
|
728
766
|
var messagesRelations = drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
@@ -730,20 +768,14 @@ var messagesRelations = drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
|
730
768
|
fields: [messages.conversationId],
|
|
731
769
|
references: [conversations.id]
|
|
732
770
|
}),
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
references: [agents.id],
|
|
737
|
-
relationName: "associatedAgent"
|
|
738
|
-
}),
|
|
739
|
-
fromAgent: one(agents, {
|
|
740
|
-
fields: [messages.fromAgentId],
|
|
741
|
-
references: [agents.id],
|
|
771
|
+
fromSubAgent: one(subAgents, {
|
|
772
|
+
fields: [messages.fromSubAgentId],
|
|
773
|
+
references: [subAgents.id],
|
|
742
774
|
relationName: "sentMessages"
|
|
743
775
|
}),
|
|
744
|
-
|
|
745
|
-
fields: [messages.
|
|
746
|
-
references: [
|
|
776
|
+
toSubAgent: one(subAgents, {
|
|
777
|
+
fields: [messages.toSubAgentId],
|
|
778
|
+
references: [subAgents.id],
|
|
747
779
|
relationName: "receivedMessages"
|
|
748
780
|
}),
|
|
749
781
|
fromExternalAgent: one(externalAgents, {
|
|
@@ -769,33 +801,40 @@ var messagesRelations = drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
|
769
801
|
relationName: "parentChild"
|
|
770
802
|
})
|
|
771
803
|
}));
|
|
772
|
-
var artifactComponentsRelations = drizzleOrm.relations(artifactComponents, ({ many }) => ({
|
|
773
|
-
|
|
804
|
+
var artifactComponentsRelations = drizzleOrm.relations(artifactComponents, ({ many, one }) => ({
|
|
805
|
+
project: one(projects, {
|
|
806
|
+
fields: [artifactComponents.tenantId, artifactComponents.projectId],
|
|
807
|
+
references: [projects.tenantId, projects.id]
|
|
808
|
+
}),
|
|
809
|
+
subAgentRelations: many(subAgentArtifactComponents)
|
|
774
810
|
}));
|
|
775
|
-
var
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
811
|
+
var subAgentArtifactComponentsRelations = drizzleOrm.relations(
|
|
812
|
+
subAgentArtifactComponents,
|
|
813
|
+
({ one }) => ({
|
|
814
|
+
subAgent: one(subAgents, {
|
|
815
|
+
fields: [subAgentArtifactComponents.subAgentId],
|
|
816
|
+
references: [subAgents.id]
|
|
817
|
+
}),
|
|
818
|
+
artifactComponent: one(artifactComponents, {
|
|
819
|
+
fields: [subAgentArtifactComponents.artifactComponentId],
|
|
820
|
+
references: [artifactComponents.id]
|
|
821
|
+
})
|
|
783
822
|
})
|
|
784
|
-
|
|
823
|
+
);
|
|
785
824
|
var dataComponentsRelations = drizzleOrm.relations(dataComponents, ({ many, one }) => ({
|
|
786
825
|
project: one(projects, {
|
|
787
826
|
fields: [dataComponents.tenantId, dataComponents.projectId],
|
|
788
827
|
references: [projects.tenantId, projects.id]
|
|
789
828
|
}),
|
|
790
|
-
|
|
829
|
+
subAgentRelations: many(subAgentDataComponents)
|
|
791
830
|
}));
|
|
792
|
-
var
|
|
793
|
-
|
|
794
|
-
fields: [
|
|
795
|
-
references: [
|
|
831
|
+
var subAgentDataComponentsRelations = drizzleOrm.relations(subAgentDataComponents, ({ one }) => ({
|
|
832
|
+
subAgent: one(subAgents, {
|
|
833
|
+
fields: [subAgentDataComponents.subAgentId],
|
|
834
|
+
references: [subAgents.id]
|
|
796
835
|
}),
|
|
797
836
|
dataComponent: one(dataComponents, {
|
|
798
|
-
fields: [
|
|
837
|
+
fields: [subAgentDataComponents.dataComponentId],
|
|
799
838
|
references: [dataComponents.id]
|
|
800
839
|
})
|
|
801
840
|
}));
|
|
@@ -810,41 +849,62 @@ var ledgerArtifactsRelations = drizzleOrm.relations(ledgerArtifacts, ({ one }) =
|
|
|
810
849
|
})
|
|
811
850
|
}));
|
|
812
851
|
var functionsRelations = drizzleOrm.relations(functions, ({ many }) => ({
|
|
813
|
-
|
|
852
|
+
functionTools: many(functionTools)
|
|
814
853
|
}));
|
|
815
|
-
var
|
|
854
|
+
var subAgentRelationsRelations = drizzleOrm.relations(subAgentRelations, ({ one }) => ({
|
|
816
855
|
graph: one(agentGraph, {
|
|
817
|
-
fields: [
|
|
856
|
+
fields: [subAgentRelations.graphId],
|
|
818
857
|
references: [agentGraph.id]
|
|
819
858
|
}),
|
|
820
|
-
|
|
821
|
-
fields: [
|
|
822
|
-
references: [
|
|
859
|
+
sourceSubAgent: one(subAgents, {
|
|
860
|
+
fields: [subAgentRelations.sourceSubAgentId],
|
|
861
|
+
references: [subAgents.id],
|
|
823
862
|
relationName: "sourceRelations"
|
|
824
863
|
}),
|
|
825
|
-
|
|
826
|
-
fields: [
|
|
827
|
-
references: [
|
|
864
|
+
targetSubAgent: one(subAgents, {
|
|
865
|
+
fields: [subAgentRelations.targetSubAgentId],
|
|
866
|
+
references: [subAgents.id],
|
|
828
867
|
relationName: "targetRelations"
|
|
829
868
|
}),
|
|
830
869
|
externalAgent: one(externalAgents, {
|
|
831
|
-
fields: [
|
|
870
|
+
fields: [subAgentRelations.externalSubAgentId],
|
|
832
871
|
references: [externalAgents.id]
|
|
833
872
|
})
|
|
834
873
|
}));
|
|
874
|
+
var functionToolsRelations = drizzleOrm.relations(functionTools, ({ one, many }) => ({
|
|
875
|
+
project: one(projects, {
|
|
876
|
+
fields: [functionTools.tenantId, functionTools.projectId],
|
|
877
|
+
references: [projects.tenantId, projects.id]
|
|
878
|
+
}),
|
|
879
|
+
graph: one(agentGraph, {
|
|
880
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.graphId],
|
|
881
|
+
references: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id]
|
|
882
|
+
}),
|
|
883
|
+
function: one(functions, {
|
|
884
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
885
|
+
references: [functions.tenantId, functions.projectId, functions.id]
|
|
886
|
+
}),
|
|
887
|
+
agentRelations: many(agentFunctionToolRelations)
|
|
888
|
+
}));
|
|
889
|
+
var agentFunctionToolRelationsRelations = drizzleOrm.relations(
|
|
890
|
+
agentFunctionToolRelations,
|
|
891
|
+
({ one }) => ({
|
|
892
|
+
agent: one(subAgents, {
|
|
893
|
+
fields: [agentFunctionToolRelations.subAgentId],
|
|
894
|
+
references: [subAgents.id]
|
|
895
|
+
}),
|
|
896
|
+
functionTool: one(functionTools, {
|
|
897
|
+
fields: [agentFunctionToolRelations.functionToolId],
|
|
898
|
+
references: [functionTools.id]
|
|
899
|
+
})
|
|
900
|
+
})
|
|
901
|
+
);
|
|
835
902
|
|
|
836
|
-
exports.
|
|
837
|
-
exports.
|
|
838
|
-
exports.agentDataComponents = agentDataComponents;
|
|
839
|
-
exports.agentDataComponentsRelations = agentDataComponentsRelations;
|
|
903
|
+
exports.agentFunctionToolRelations = agentFunctionToolRelations;
|
|
904
|
+
exports.agentFunctionToolRelationsRelations = agentFunctionToolRelationsRelations;
|
|
840
905
|
exports.agentGraph = agentGraph;
|
|
841
906
|
exports.agentGraphRelations = agentGraphRelations;
|
|
842
|
-
exports.agentRelations = agentRelations;
|
|
843
|
-
exports.agentRelationsRelations = agentRelationsRelations;
|
|
844
|
-
exports.agentToolRelations = agentToolRelations;
|
|
845
907
|
exports.agentToolRelationsRelations = agentToolRelationsRelations;
|
|
846
|
-
exports.agents = agents;
|
|
847
|
-
exports.agentsRelations = agentsRelations;
|
|
848
908
|
exports.apiKeys = apiKeys;
|
|
849
909
|
exports.apiKeysRelations = apiKeysRelations;
|
|
850
910
|
exports.artifactComponents = artifactComponents;
|
|
@@ -861,6 +921,8 @@ exports.dataComponents = dataComponents;
|
|
|
861
921
|
exports.dataComponentsRelations = dataComponentsRelations;
|
|
862
922
|
exports.externalAgents = externalAgents;
|
|
863
923
|
exports.externalAgentsRelations = externalAgentsRelations;
|
|
924
|
+
exports.functionTools = functionTools;
|
|
925
|
+
exports.functionToolsRelations = functionToolsRelations;
|
|
864
926
|
exports.functions = functions;
|
|
865
927
|
exports.functionsRelations = functionsRelations;
|
|
866
928
|
exports.ledgerArtifacts = ledgerArtifacts;
|
|
@@ -869,6 +931,15 @@ exports.messages = messages;
|
|
|
869
931
|
exports.messagesRelations = messagesRelations;
|
|
870
932
|
exports.projects = projects;
|
|
871
933
|
exports.projectsRelations = projectsRelations;
|
|
934
|
+
exports.subAgentArtifactComponents = subAgentArtifactComponents;
|
|
935
|
+
exports.subAgentArtifactComponentsRelations = subAgentArtifactComponentsRelations;
|
|
936
|
+
exports.subAgentDataComponents = subAgentDataComponents;
|
|
937
|
+
exports.subAgentDataComponentsRelations = subAgentDataComponentsRelations;
|
|
938
|
+
exports.subAgentRelations = subAgentRelations;
|
|
939
|
+
exports.subAgentRelationsRelations = subAgentRelationsRelations;
|
|
940
|
+
exports.subAgentToolRelations = subAgentToolRelations;
|
|
941
|
+
exports.subAgents = subAgents;
|
|
942
|
+
exports.subAgentsRelations = subAgentsRelations;
|
|
872
943
|
exports.taskRelations = taskRelations;
|
|
873
944
|
exports.taskRelationsRelations = taskRelationsRelations;
|
|
874
945
|
exports.tasks = tasks;
|
package/dist/db/schema.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export {
|
|
3
|
+
import '../utility-Fxoh7s82.cjs';
|
|
4
|
+
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations, a as agentGraph, E as agentGraphRelations, H as agentToolRelationsRelations, w as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, b as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, r as conversations, K as conversationsRelations, x as credentialReferences, I as credentialReferencesRelations, h as dataComponents, O as dataComponentsRelations, f as externalAgents, F as externalAgentsRelations, m as functionTools, T as functionToolsRelations, n as functions, R as functionsRelations, v as ledgerArtifacts, Q as ledgerArtifactsRelations, u as messages, L as messagesRelations, p as projects, z as projectsRelations, k as subAgentArtifactComponents, N as subAgentArtifactComponentsRelations, i as subAgentDataComponents, P as subAgentDataComponentsRelations, e as subAgentRelations, S as subAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, D as subAgentsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-Bjy5TkFv.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
package/dist/db/schema.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export {
|
|
3
|
+
import '../utility-Fxoh7s82.js';
|
|
4
|
+
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations, a as agentGraph, E as agentGraphRelations, H as agentToolRelationsRelations, w as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, b as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, r as conversations, K as conversationsRelations, x as credentialReferences, I as credentialReferencesRelations, h as dataComponents, O as dataComponentsRelations, f as externalAgents, F as externalAgentsRelations, m as functionTools, T as functionToolsRelations, n as functions, R as functionsRelations, v as ledgerArtifacts, Q as ledgerArtifactsRelations, u as messages, L as messagesRelations, p as projects, z as projectsRelations, k as subAgentArtifactComponents, N as subAgentArtifactComponentsRelations, i as subAgentDataComponents, P as subAgentDataComponentsRelations, e as subAgentRelations, S as subAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, D as subAgentsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-CfWbqju2.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|