@inkeep/agents-core 0.20.0 → 0.21.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-B6F3RF4T.js → chunk-7GKB2SDR.js} +15 -15
- package/dist/{chunk-VICWT3WO.js → chunk-RCE4G7BW.js} +1 -1
- package/dist/{chunk-4FMDWUE4.js → chunk-VTNB6CCI.js} +1 -1
- package/dist/client-exports.cjs +11 -11
- package/dist/client-exports.js +2 -2
- package/dist/db/schema.cjs +14 -14
- package/dist/db/schema.d.cts +1 -1
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +71 -45
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +61 -35
- package/dist/{schema-CcSN2XcZ.d.cts → schema-BjQKqtdC.d.cts} +18 -18
- package/dist/{schema-D8h85qdU.d.ts → schema-DylNIx0j.d.ts} +18 -18
- package/dist/validation/index.cjs +11 -11
- package/dist/validation/index.js +2 -2
- package/drizzle/0008_mysterious_crusher_hogan.sql +20 -0
- package/drizzle/meta/0008_snapshot.json +2753 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -5,8 +5,6 @@ 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
|
-
agentFunctionToolRelations: () => agentFunctionToolRelations,
|
|
9
|
-
agentFunctionToolRelationsRelations: () => agentFunctionToolRelationsRelations,
|
|
10
8
|
agentRelations: () => agentRelations,
|
|
11
9
|
agentToolRelationsRelations: () => agentToolRelationsRelations,
|
|
12
10
|
agents: () => agents,
|
|
@@ -40,6 +38,8 @@ __export(schema_exports, {
|
|
|
40
38
|
subAgentArtifactComponentsRelations: () => subAgentArtifactComponentsRelations,
|
|
41
39
|
subAgentDataComponents: () => subAgentDataComponents,
|
|
42
40
|
subAgentDataComponentsRelations: () => subAgentDataComponentsRelations,
|
|
41
|
+
subAgentFunctionToolRelations: () => subAgentFunctionToolRelations,
|
|
42
|
+
subAgentFunctionToolRelationsRelations: () => subAgentFunctionToolRelationsRelations,
|
|
43
43
|
subAgentRelations: () => subAgentRelations,
|
|
44
44
|
subAgentRelationsRelations: () => subAgentRelationsRelations,
|
|
45
45
|
subAgentToolRelations: () => subAgentToolRelations,
|
|
@@ -444,8 +444,8 @@ var subAgentToolRelations = sqliteTable(
|
|
|
444
444
|
}).onDelete("cascade")
|
|
445
445
|
]
|
|
446
446
|
);
|
|
447
|
-
var
|
|
448
|
-
"
|
|
447
|
+
var subAgentFunctionToolRelations = sqliteTable(
|
|
448
|
+
"sub_agent_function_tool_relations",
|
|
449
449
|
{
|
|
450
450
|
...subAgentScoped,
|
|
451
451
|
functionToolId: text("function_tool_id").notNull(),
|
|
@@ -453,11 +453,11 @@ var agentFunctionToolRelations = sqliteTable(
|
|
|
453
453
|
},
|
|
454
454
|
(table) => [
|
|
455
455
|
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
456
|
-
// Foreign key constraint to
|
|
456
|
+
// Foreign key constraint to sub_agents table
|
|
457
457
|
foreignKey({
|
|
458
458
|
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
459
459
|
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
460
|
-
name: "
|
|
460
|
+
name: "sub_agent_function_tool_relations_sub_agent_fk"
|
|
461
461
|
}).onDelete("cascade"),
|
|
462
462
|
// Foreign key constraint to functionTools table
|
|
463
463
|
foreignKey({
|
|
@@ -468,7 +468,7 @@ var agentFunctionToolRelations = sqliteTable(
|
|
|
468
468
|
functionTools.agentId,
|
|
469
469
|
functionTools.id
|
|
470
470
|
],
|
|
471
|
-
name: "
|
|
471
|
+
name: "sub_agent_function_tool_relations_function_tool_fk"
|
|
472
472
|
}).onDelete("cascade")
|
|
473
473
|
]
|
|
474
474
|
);
|
|
@@ -694,7 +694,7 @@ var subAgentsRelations = relations(subAgents, ({ many, one }) => ({
|
|
|
694
694
|
relationName: "receivedMessages"
|
|
695
695
|
}),
|
|
696
696
|
toolRelations: many(subAgentToolRelations),
|
|
697
|
-
functionToolRelations: many(
|
|
697
|
+
functionToolRelations: many(subAgentFunctionToolRelations),
|
|
698
698
|
dataComponentRelations: many(subAgentDataComponents),
|
|
699
699
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
700
700
|
}));
|
|
@@ -899,20 +899,20 @@ var functionToolsRelations = relations(functionTools, ({ one, many }) => ({
|
|
|
899
899
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
900
900
|
references: [functions.tenantId, functions.projectId, functions.id]
|
|
901
901
|
}),
|
|
902
|
-
|
|
902
|
+
subAgentRelations: many(subAgentFunctionToolRelations)
|
|
903
903
|
}));
|
|
904
|
-
var
|
|
905
|
-
|
|
904
|
+
var subAgentFunctionToolRelationsRelations = relations(
|
|
905
|
+
subAgentFunctionToolRelations,
|
|
906
906
|
({ one }) => ({
|
|
907
|
-
|
|
908
|
-
fields: [
|
|
907
|
+
subAgent: one(subAgents, {
|
|
908
|
+
fields: [subAgentFunctionToolRelations.subAgentId],
|
|
909
909
|
references: [subAgents.id]
|
|
910
910
|
}),
|
|
911
911
|
functionTool: one(functionTools, {
|
|
912
|
-
fields: [
|
|
912
|
+
fields: [subAgentFunctionToolRelations.functionToolId],
|
|
913
913
|
references: [functionTools.id]
|
|
914
914
|
})
|
|
915
915
|
})
|
|
916
916
|
);
|
|
917
917
|
|
|
918
|
-
export {
|
|
918
|
+
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, ledgerArtifacts, projects } from './chunk-
|
|
1
|
+
import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, ledgerArtifacts, projects } from './chunk-7GKB2SDR.js';
|
|
2
2
|
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
|
|
3
3
|
import { z } from '@hono/zod-openapi';
|
|
4
4
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-
|
|
1
|
+
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-RCE4G7BW.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
var TransferDataSchema = z.object({
|
package/dist/client-exports.cjs
CHANGED
|
@@ -421,8 +421,8 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
|
421
421
|
}).onDelete("cascade")
|
|
422
422
|
]
|
|
423
423
|
);
|
|
424
|
-
var
|
|
425
|
-
"
|
|
424
|
+
var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
425
|
+
"sub_agent_function_tool_relations",
|
|
426
426
|
{
|
|
427
427
|
...subAgentScoped,
|
|
428
428
|
functionToolId: sqliteCore.text("function_tool_id").notNull(),
|
|
@@ -430,11 +430,11 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
430
430
|
},
|
|
431
431
|
(table) => [
|
|
432
432
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
433
|
-
// Foreign key constraint to
|
|
433
|
+
// Foreign key constraint to sub_agents table
|
|
434
434
|
sqliteCore.foreignKey({
|
|
435
435
|
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
436
436
|
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
437
|
-
name: "
|
|
437
|
+
name: "sub_agent_function_tool_relations_sub_agent_fk"
|
|
438
438
|
}).onDelete("cascade"),
|
|
439
439
|
// Foreign key constraint to functionTools table
|
|
440
440
|
sqliteCore.foreignKey({
|
|
@@ -445,7 +445,7 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
445
445
|
functionTools.agentId,
|
|
446
446
|
functionTools.id
|
|
447
447
|
],
|
|
448
|
-
name: "
|
|
448
|
+
name: "sub_agent_function_tool_relations_function_tool_fk"
|
|
449
449
|
}).onDelete("cascade")
|
|
450
450
|
]
|
|
451
451
|
);
|
|
@@ -671,7 +671,7 @@ drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
|
671
671
|
relationName: "receivedMessages"
|
|
672
672
|
}),
|
|
673
673
|
toolRelations: many(subAgentToolRelations),
|
|
674
|
-
functionToolRelations: many(
|
|
674
|
+
functionToolRelations: many(subAgentFunctionToolRelations),
|
|
675
675
|
dataComponentRelations: many(subAgentDataComponents),
|
|
676
676
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
677
677
|
}));
|
|
@@ -876,17 +876,17 @@ drizzleOrm.relations(functionTools, ({ one, many }) => ({
|
|
|
876
876
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
877
877
|
references: [functions.tenantId, functions.projectId, functions.id]
|
|
878
878
|
}),
|
|
879
|
-
|
|
879
|
+
subAgentRelations: many(subAgentFunctionToolRelations)
|
|
880
880
|
}));
|
|
881
881
|
drizzleOrm.relations(
|
|
882
|
-
|
|
882
|
+
subAgentFunctionToolRelations,
|
|
883
883
|
({ one }) => ({
|
|
884
|
-
|
|
885
|
-
fields: [
|
|
884
|
+
subAgent: one(subAgents, {
|
|
885
|
+
fields: [subAgentFunctionToolRelations.subAgentId],
|
|
886
886
|
references: [subAgents.id]
|
|
887
887
|
}),
|
|
888
888
|
functionTool: one(functionTools, {
|
|
889
|
-
fields: [
|
|
889
|
+
fields: [subAgentFunctionToolRelations.functionToolId],
|
|
890
890
|
references: [functionTools.id]
|
|
891
891
|
})
|
|
892
892
|
})
|
package/dist/client-exports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE } from './chunk-QFIITHNT.js';
|
|
2
|
-
import { ModelSettingsSchema, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-
|
|
3
|
-
export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, SandboxConfigSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-
|
|
2
|
+
import { ModelSettingsSchema, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-RCE4G7BW.js';
|
|
3
|
+
export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, SandboxConfigSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-RCE4G7BW.js';
|
|
4
4
|
import { CredentialStoreType } from './chunk-YFHT5M2R.js';
|
|
5
5
|
export { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
6
6
|
import { z } from 'zod';
|
package/dist/db/schema.cjs
CHANGED
|
@@ -396,8 +396,8 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
|
396
396
|
}).onDelete("cascade")
|
|
397
397
|
]
|
|
398
398
|
);
|
|
399
|
-
var
|
|
400
|
-
"
|
|
399
|
+
var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
400
|
+
"sub_agent_function_tool_relations",
|
|
401
401
|
{
|
|
402
402
|
...subAgentScoped,
|
|
403
403
|
functionToolId: sqliteCore.text("function_tool_id").notNull(),
|
|
@@ -405,11 +405,11 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
405
405
|
},
|
|
406
406
|
(table) => [
|
|
407
407
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
408
|
-
// Foreign key constraint to
|
|
408
|
+
// Foreign key constraint to sub_agents table
|
|
409
409
|
sqliteCore.foreignKey({
|
|
410
410
|
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
411
411
|
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
412
|
-
name: "
|
|
412
|
+
name: "sub_agent_function_tool_relations_sub_agent_fk"
|
|
413
413
|
}).onDelete("cascade"),
|
|
414
414
|
// Foreign key constraint to functionTools table
|
|
415
415
|
sqliteCore.foreignKey({
|
|
@@ -420,7 +420,7 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
420
420
|
functionTools.agentId,
|
|
421
421
|
functionTools.id
|
|
422
422
|
],
|
|
423
|
-
name: "
|
|
423
|
+
name: "sub_agent_function_tool_relations_function_tool_fk"
|
|
424
424
|
}).onDelete("cascade")
|
|
425
425
|
]
|
|
426
426
|
);
|
|
@@ -646,7 +646,7 @@ var subAgentsRelations = drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
|
646
646
|
relationName: "receivedMessages"
|
|
647
647
|
}),
|
|
648
648
|
toolRelations: many(subAgentToolRelations),
|
|
649
|
-
functionToolRelations: many(
|
|
649
|
+
functionToolRelations: many(subAgentFunctionToolRelations),
|
|
650
650
|
dataComponentRelations: many(subAgentDataComponents),
|
|
651
651
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
652
652
|
}));
|
|
@@ -851,24 +851,22 @@ var functionToolsRelations = drizzleOrm.relations(functionTools, ({ one, many })
|
|
|
851
851
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
852
852
|
references: [functions.tenantId, functions.projectId, functions.id]
|
|
853
853
|
}),
|
|
854
|
-
|
|
854
|
+
subAgentRelations: many(subAgentFunctionToolRelations)
|
|
855
855
|
}));
|
|
856
|
-
var
|
|
857
|
-
|
|
856
|
+
var subAgentFunctionToolRelationsRelations = drizzleOrm.relations(
|
|
857
|
+
subAgentFunctionToolRelations,
|
|
858
858
|
({ one }) => ({
|
|
859
|
-
|
|
860
|
-
fields: [
|
|
859
|
+
subAgent: one(subAgents, {
|
|
860
|
+
fields: [subAgentFunctionToolRelations.subAgentId],
|
|
861
861
|
references: [subAgents.id]
|
|
862
862
|
}),
|
|
863
863
|
functionTool: one(functionTools, {
|
|
864
|
-
fields: [
|
|
864
|
+
fields: [subAgentFunctionToolRelations.functionToolId],
|
|
865
865
|
references: [functionTools.id]
|
|
866
866
|
})
|
|
867
867
|
})
|
|
868
868
|
);
|
|
869
869
|
|
|
870
|
-
exports.agentFunctionToolRelations = agentFunctionToolRelations;
|
|
871
|
-
exports.agentFunctionToolRelationsRelations = agentFunctionToolRelationsRelations;
|
|
872
870
|
exports.agentRelations = agentRelations;
|
|
873
871
|
exports.agentToolRelationsRelations = agentToolRelationsRelations;
|
|
874
872
|
exports.agents = agents;
|
|
@@ -902,6 +900,8 @@ exports.subAgentArtifactComponents = subAgentArtifactComponents;
|
|
|
902
900
|
exports.subAgentArtifactComponentsRelations = subAgentArtifactComponentsRelations;
|
|
903
901
|
exports.subAgentDataComponents = subAgentDataComponents;
|
|
904
902
|
exports.subAgentDataComponentsRelations = subAgentDataComponentsRelations;
|
|
903
|
+
exports.subAgentFunctionToolRelations = subAgentFunctionToolRelations;
|
|
904
|
+
exports.subAgentFunctionToolRelationsRelations = subAgentFunctionToolRelationsRelations;
|
|
905
905
|
exports.subAgentRelations = subAgentRelations;
|
|
906
906
|
exports.subAgentRelationsRelations = subAgentRelationsRelations;
|
|
907
907
|
exports.subAgentToolRelations = subAgentToolRelations;
|
package/dist/db/schema.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
3
|
import '../utility-HqRMF7sM.cjs';
|
|
4
|
-
export {
|
|
4
|
+
export { E as agentRelations, H as agentToolRelationsRelations, a as agents, 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, q as subAgentFunctionToolRelations, U as subAgentFunctionToolRelationsRelations, 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-BjQKqtdC.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
3
|
import '../utility-HqRMF7sM.js';
|
|
4
|
-
export {
|
|
4
|
+
export { E as agentRelations, H as agentToolRelationsRelations, a as agents, 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, q as subAgentFunctionToolRelations, U as subAgentFunctionToolRelationsRelations, 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-DylNIx0j.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
package/dist/db/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from '../chunk-7GKB2SDR.js';
|
package/dist/index.cjs
CHANGED
|
@@ -213422,8 +213422,6 @@ function extractPreviewFields(schema) {
|
|
|
213422
213422
|
// src/db/schema.ts
|
|
213423
213423
|
var schema_exports = {};
|
|
213424
213424
|
__export(schema_exports, {
|
|
213425
|
-
agentFunctionToolRelations: () => agentFunctionToolRelations,
|
|
213426
|
-
agentFunctionToolRelationsRelations: () => agentFunctionToolRelationsRelations,
|
|
213427
213425
|
agentRelations: () => agentRelations,
|
|
213428
213426
|
agentToolRelationsRelations: () => agentToolRelationsRelations,
|
|
213429
213427
|
agents: () => agents,
|
|
@@ -213457,6 +213455,8 @@ __export(schema_exports, {
|
|
|
213457
213455
|
subAgentArtifactComponentsRelations: () => subAgentArtifactComponentsRelations,
|
|
213458
213456
|
subAgentDataComponents: () => subAgentDataComponents,
|
|
213459
213457
|
subAgentDataComponentsRelations: () => subAgentDataComponentsRelations,
|
|
213458
|
+
subAgentFunctionToolRelations: () => subAgentFunctionToolRelations,
|
|
213459
|
+
subAgentFunctionToolRelationsRelations: () => subAgentFunctionToolRelationsRelations,
|
|
213460
213460
|
subAgentRelations: () => subAgentRelations,
|
|
213461
213461
|
subAgentRelationsRelations: () => subAgentRelationsRelations,
|
|
213462
213462
|
subAgentToolRelations: () => subAgentToolRelations,
|
|
@@ -213861,8 +213861,8 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
|
213861
213861
|
}).onDelete("cascade")
|
|
213862
213862
|
]
|
|
213863
213863
|
);
|
|
213864
|
-
var
|
|
213865
|
-
"
|
|
213864
|
+
var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
213865
|
+
"sub_agent_function_tool_relations",
|
|
213866
213866
|
{
|
|
213867
213867
|
...subAgentScoped,
|
|
213868
213868
|
functionToolId: sqliteCore.text("function_tool_id").notNull(),
|
|
@@ -213870,11 +213870,11 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
213870
213870
|
},
|
|
213871
213871
|
(table) => [
|
|
213872
213872
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
213873
|
-
// Foreign key constraint to
|
|
213873
|
+
// Foreign key constraint to sub_agents table
|
|
213874
213874
|
sqliteCore.foreignKey({
|
|
213875
213875
|
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
213876
213876
|
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
213877
|
-
name: "
|
|
213877
|
+
name: "sub_agent_function_tool_relations_sub_agent_fk"
|
|
213878
213878
|
}).onDelete("cascade"),
|
|
213879
213879
|
// Foreign key constraint to functionTools table
|
|
213880
213880
|
sqliteCore.foreignKey({
|
|
@@ -213885,7 +213885,7 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
213885
213885
|
functionTools.agentId,
|
|
213886
213886
|
functionTools.id
|
|
213887
213887
|
],
|
|
213888
|
-
name: "
|
|
213888
|
+
name: "sub_agent_function_tool_relations_function_tool_fk"
|
|
213889
213889
|
}).onDelete("cascade")
|
|
213890
213890
|
]
|
|
213891
213891
|
);
|
|
@@ -214111,7 +214111,7 @@ var subAgentsRelations = drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
|
214111
214111
|
relationName: "receivedMessages"
|
|
214112
214112
|
}),
|
|
214113
214113
|
toolRelations: many(subAgentToolRelations),
|
|
214114
|
-
functionToolRelations: many(
|
|
214114
|
+
functionToolRelations: many(subAgentFunctionToolRelations),
|
|
214115
214115
|
dataComponentRelations: many(subAgentDataComponents),
|
|
214116
214116
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
214117
214117
|
}));
|
|
@@ -214316,17 +214316,17 @@ var functionToolsRelations = drizzleOrm.relations(functionTools, ({ one, many })
|
|
|
214316
214316
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
214317
214317
|
references: [functions.tenantId, functions.projectId, functions.id]
|
|
214318
214318
|
}),
|
|
214319
|
-
|
|
214319
|
+
subAgentRelations: many(subAgentFunctionToolRelations)
|
|
214320
214320
|
}));
|
|
214321
|
-
var
|
|
214322
|
-
|
|
214321
|
+
var subAgentFunctionToolRelationsRelations = drizzleOrm.relations(
|
|
214322
|
+
subAgentFunctionToolRelations,
|
|
214323
214323
|
({ one }) => ({
|
|
214324
|
-
|
|
214325
|
-
fields: [
|
|
214324
|
+
subAgent: one(subAgents, {
|
|
214325
|
+
fields: [subAgentFunctionToolRelations.subAgentId],
|
|
214326
214326
|
references: [subAgents.id]
|
|
214327
214327
|
}),
|
|
214328
214328
|
functionTool: one(functionTools, {
|
|
214329
|
-
fields: [
|
|
214329
|
+
fields: [subAgentFunctionToolRelations.functionToolId],
|
|
214330
214330
|
references: [functionTools.id]
|
|
214331
214331
|
})
|
|
214332
214332
|
})
|
|
@@ -216403,12 +216403,12 @@ var getFunctionToolsForSubAgent = (db) => {
|
|
|
216403
216403
|
scopes: { tenantId, projectId, agentId },
|
|
216404
216404
|
pagination: { page: 1, limit: 1e3 }
|
|
216405
216405
|
});
|
|
216406
|
-
const relations2 = await db.select().from(
|
|
216406
|
+
const relations2 = await db.select().from(subAgentFunctionToolRelations).where(
|
|
216407
216407
|
drizzleOrm.and(
|
|
216408
|
-
drizzleOrm.eq(
|
|
216409
|
-
drizzleOrm.eq(
|
|
216410
|
-
drizzleOrm.eq(
|
|
216411
|
-
drizzleOrm.eq(
|
|
216408
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
216409
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
216410
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
216411
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.subAgentId, subAgentId)
|
|
216412
216412
|
)
|
|
216413
216413
|
);
|
|
216414
216414
|
const relatedFunctionToolIds = new Set(relations2.map((r) => r.functionToolId));
|
|
@@ -216429,17 +216429,43 @@ var getFunctionToolsForSubAgent = (db) => {
|
|
|
216429
216429
|
};
|
|
216430
216430
|
};
|
|
216431
216431
|
var upsertSubAgentFunctionToolRelation = (db) => async (params) => {
|
|
216432
|
-
|
|
216432
|
+
const { scopes, subAgentId, functionToolId, relationId } = params;
|
|
216433
|
+
const { tenantId, projectId, agentId } = scopes;
|
|
216434
|
+
if (relationId) {
|
|
216433
216435
|
return await updateSubAgentFunctionToolRelation(db)({
|
|
216434
|
-
scopes
|
|
216435
|
-
relationId
|
|
216436
|
+
scopes,
|
|
216437
|
+
relationId,
|
|
216436
216438
|
data: {
|
|
216437
|
-
subAgentId
|
|
216438
|
-
functionToolId
|
|
216439
|
+
subAgentId,
|
|
216440
|
+
functionToolId
|
|
216439
216441
|
}
|
|
216440
216442
|
});
|
|
216441
216443
|
}
|
|
216442
|
-
|
|
216444
|
+
try {
|
|
216445
|
+
const existingRelations = await db.select().from(subAgentFunctionToolRelations).where(
|
|
216446
|
+
drizzleOrm.and(
|
|
216447
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
216448
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
216449
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
216450
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.subAgentId, subAgentId),
|
|
216451
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.functionToolId, functionToolId)
|
|
216452
|
+
)
|
|
216453
|
+
).limit(1);
|
|
216454
|
+
if (existingRelations.length > 0) {
|
|
216455
|
+
logger4.info(
|
|
216456
|
+
{ tenantId, projectId, agentId, subAgentId, functionToolId, relationId: existingRelations[0].id },
|
|
216457
|
+
"Sub_agent-function tool relation already exists, returning existing relation"
|
|
216458
|
+
);
|
|
216459
|
+
return { id: existingRelations[0].id };
|
|
216460
|
+
}
|
|
216461
|
+
return await addFunctionToolToSubAgent(db)(params);
|
|
216462
|
+
} catch (error) {
|
|
216463
|
+
logger4.error(
|
|
216464
|
+
{ tenantId, projectId, agentId, subAgentId, functionToolId, error },
|
|
216465
|
+
"Failed to upsert sub_agent-function tool relation"
|
|
216466
|
+
);
|
|
216467
|
+
throw error;
|
|
216468
|
+
}
|
|
216443
216469
|
};
|
|
216444
216470
|
var addFunctionToolToSubAgent = (db) => {
|
|
216445
216471
|
return async (params) => {
|
|
@@ -216447,7 +216473,7 @@ var addFunctionToolToSubAgent = (db) => {
|
|
|
216447
216473
|
const { tenantId, projectId, agentId } = scopes;
|
|
216448
216474
|
try {
|
|
216449
216475
|
const relationId = nanoid.nanoid();
|
|
216450
|
-
await db.insert(
|
|
216476
|
+
await db.insert(subAgentFunctionToolRelations).values({
|
|
216451
216477
|
id: relationId,
|
|
216452
216478
|
tenantId,
|
|
216453
216479
|
projectId,
|
|
@@ -216457,7 +216483,7 @@ var addFunctionToolToSubAgent = (db) => {
|
|
|
216457
216483
|
});
|
|
216458
216484
|
logger4.info(
|
|
216459
216485
|
{ tenantId, projectId, agentId, subAgentId, functionToolId, relationId },
|
|
216460
|
-
"Function tool added to
|
|
216486
|
+
"Function tool added to sub_agent"
|
|
216461
216487
|
);
|
|
216462
216488
|
return { id: relationId };
|
|
216463
216489
|
} catch (error) {
|
|
@@ -216474,20 +216500,20 @@ var updateSubAgentFunctionToolRelation = (db) => {
|
|
|
216474
216500
|
const { scopes, relationId, data } = params;
|
|
216475
216501
|
const { tenantId, projectId, agentId } = scopes;
|
|
216476
216502
|
try {
|
|
216477
|
-
await db.update(
|
|
216503
|
+
await db.update(subAgentFunctionToolRelations).set({
|
|
216478
216504
|
subAgentId: data.subAgentId,
|
|
216479
216505
|
functionToolId: data.functionToolId
|
|
216480
216506
|
}).where(
|
|
216481
216507
|
drizzleOrm.and(
|
|
216482
|
-
drizzleOrm.eq(
|
|
216483
|
-
drizzleOrm.eq(
|
|
216484
|
-
drizzleOrm.eq(
|
|
216485
|
-
drizzleOrm.eq(
|
|
216508
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.id, relationId),
|
|
216509
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
216510
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
216511
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.agentId, agentId)
|
|
216486
216512
|
)
|
|
216487
216513
|
);
|
|
216488
216514
|
logger4.info(
|
|
216489
216515
|
{ tenantId, projectId, agentId, relationId, data },
|
|
216490
|
-
"
|
|
216516
|
+
"SubAgent-function tool relation updated"
|
|
216491
216517
|
);
|
|
216492
216518
|
return { id: relationId };
|
|
216493
216519
|
} catch (error) {
|
|
@@ -218531,21 +218557,21 @@ var getFullAgentDefinition = (db) => async ({
|
|
|
218531
218557
|
tenantId: functionTools.tenantId,
|
|
218532
218558
|
projectId: functionTools.projectId,
|
|
218533
218559
|
agentId: functionTools.agentId,
|
|
218534
|
-
agentToolRelationId:
|
|
218535
|
-
}).from(
|
|
218560
|
+
agentToolRelationId: subAgentFunctionToolRelations.id
|
|
218561
|
+
}).from(subAgentFunctionToolRelations).innerJoin(
|
|
218536
218562
|
functionTools,
|
|
218537
218563
|
drizzleOrm.and(
|
|
218538
|
-
drizzleOrm.eq(
|
|
218539
|
-
drizzleOrm.eq(
|
|
218540
|
-
drizzleOrm.eq(
|
|
218541
|
-
drizzleOrm.eq(
|
|
218564
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.functionToolId, functionTools.id),
|
|
218565
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.tenantId, functionTools.tenantId),
|
|
218566
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.projectId, functionTools.projectId),
|
|
218567
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.agentId, functionTools.agentId)
|
|
218542
218568
|
)
|
|
218543
218569
|
).where(
|
|
218544
218570
|
drizzleOrm.and(
|
|
218545
|
-
drizzleOrm.eq(
|
|
218546
|
-
drizzleOrm.eq(
|
|
218547
|
-
drizzleOrm.eq(
|
|
218548
|
-
drizzleOrm.eq(
|
|
218571
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.tenantId, tenantId),
|
|
218572
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.projectId, projectId),
|
|
218573
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.agentId, agentId),
|
|
218574
|
+
drizzleOrm.eq(subAgentFunctionToolRelations.subAgentId, agent2.id)
|
|
218549
218575
|
)
|
|
218550
218576
|
);
|
|
218551
218577
|
const agentDataComponentRelations = await db.query.subAgentDataComponents.findMany({
|
|
@@ -225390,8 +225416,6 @@ exports.VALID_RELATION_TYPES = VALID_RELATION_TYPES;
|
|
|
225390
225416
|
exports.addFunctionToolToSubAgent = addFunctionToolToSubAgent;
|
|
225391
225417
|
exports.addLedgerArtifacts = addLedgerArtifacts;
|
|
225392
225418
|
exports.addToolToAgent = addToolToAgent;
|
|
225393
|
-
exports.agentFunctionToolRelations = agentFunctionToolRelations;
|
|
225394
|
-
exports.agentFunctionToolRelationsRelations = agentFunctionToolRelationsRelations;
|
|
225395
225419
|
exports.agentHasArtifactComponents = agentHasArtifactComponents;
|
|
225396
225420
|
exports.agentRelations = agentRelations;
|
|
225397
225421
|
exports.agentToolRelationsRelations = agentToolRelationsRelations;
|
|
@@ -225638,6 +225662,8 @@ exports.subAgentArtifactComponents = subAgentArtifactComponents;
|
|
|
225638
225662
|
exports.subAgentArtifactComponentsRelations = subAgentArtifactComponentsRelations;
|
|
225639
225663
|
exports.subAgentDataComponents = subAgentDataComponents;
|
|
225640
225664
|
exports.subAgentDataComponentsRelations = subAgentDataComponentsRelations;
|
|
225665
|
+
exports.subAgentFunctionToolRelations = subAgentFunctionToolRelations;
|
|
225666
|
+
exports.subAgentFunctionToolRelationsRelations = subAgentFunctionToolRelationsRelations;
|
|
225641
225667
|
exports.subAgentRelations = subAgentRelations;
|
|
225642
225668
|
exports.subAgentRelationsRelations = subAgentRelationsRelations;
|
|
225643
225669
|
exports.subAgentToolRelations = subAgentToolRelations;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,8 +6,8 @@ export { ba as A2AError, bG as A2ARequest, bH as A2AResponse, aL as APIKeySecuri
|
|
|
6
6
|
import { CredentialStore } from './types/index.cjs';
|
|
7
7
|
export { CorsConfig, ServerConfig, ServerOptions } from './types/index.cjs';
|
|
8
8
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
9
|
-
import { s as schema } from './schema-
|
|
10
|
-
export {
|
|
9
|
+
import { s as schema } from './schema-BjQKqtdC.cjs';
|
|
10
|
+
export { E as agentRelations, H as agentToolRelationsRelations, a as agents, 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, q as subAgentFunctionToolRelations, U as subAgentFunctionToolRelationsRelations, 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-BjQKqtdC.cjs';
|
|
11
11
|
import { LoggerOptions, TransportSingleOptions, Logger } from 'pino';
|
|
12
12
|
import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
13
13
|
import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
@@ -2153,7 +2153,7 @@ declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}>;
|
|
2155
2155
|
/**
|
|
2156
|
-
* Upsert
|
|
2156
|
+
* Upsert a sub_agent-function tool relation (create if it doesn't exist, update if it does)
|
|
2157
2157
|
*/
|
|
2158
2158
|
declare const upsertSubAgentFunctionToolRelation: (db: DatabaseClient) => (params: {
|
|
2159
2159
|
scopes: AgentScopeConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export { ba as A2AError, bG as A2ARequest, bH as A2AResponse, aL as APIKeySecuri
|
|
|
6
6
|
import { CredentialStore } from './types/index.js';
|
|
7
7
|
export { CorsConfig, ServerConfig, ServerOptions } from './types/index.js';
|
|
8
8
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
9
|
-
import { s as schema } from './schema-
|
|
10
|
-
export {
|
|
9
|
+
import { s as schema } from './schema-DylNIx0j.js';
|
|
10
|
+
export { E as agentRelations, H as agentToolRelationsRelations, a as agents, 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, q as subAgentFunctionToolRelations, U as subAgentFunctionToolRelationsRelations, 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-DylNIx0j.js';
|
|
11
11
|
import { LoggerOptions, TransportSingleOptions, Logger } from 'pino';
|
|
12
12
|
import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
13
13
|
import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
@@ -2153,7 +2153,7 @@ declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}>;
|
|
2155
2155
|
/**
|
|
2156
|
-
* Upsert
|
|
2156
|
+
* Upsert a sub_agent-function tool relation (create if it doesn't exist, update if it does)
|
|
2157
2157
|
*/
|
|
2158
2158
|
declare const upsertSubAgentFunctionToolRelation: (db: DatabaseClient) => (params: {
|
|
2159
2159
|
scopes: AgentScopeConfig;
|