@inkeep/agents-core 0.18.1 → 0.19.1
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 +4 -4
- package/dist/{chunk-JTHQYGCX.js → chunk-4FMDWUE4.js} +34 -34
- package/dist/{chunk-ID4CFGVF.js → chunk-B6F3RF4T.js} +87 -120
- package/dist/chunk-E6R6PML7.js +19 -0
- package/dist/chunk-HYS7HUYJ.js +27 -0
- package/dist/{chunk-H6PMWHNV.js → chunk-SLL6V3AE.js} +12 -12
- package/dist/{chunk-E4SFK6AI.js → chunk-VICWT3WO.js} +281 -142
- package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
- package/dist/client-exports.cjs +390 -283
- package/dist/client-exports.d.cts +13 -14
- package/dist/client-exports.d.ts +13 -14
- package/dist/client-exports.js +10 -10
- package/dist/constants/models.cjs +31 -0
- package/dist/constants/models.d.cts +33 -0
- package/dist/constants/models.d.ts +33 -0
- package/dist/constants/models.js +1 -0
- package/dist/db/schema.cjs +85 -118
- package/dist/db/schema.d.cts +2 -3
- package/dist/db/schema.d.ts +2 -3
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +214164 -1095
- package/dist/index.d.cts +215 -214
- package/dist/index.d.ts +215 -214
- package/dist/index.js +213657 -767
- package/dist/{schema-ULFEZCOL.d.cts → schema-CcSN2XcZ.d.cts} +54 -52
- package/dist/{schema-wbZXiVWb.d.ts → schema-D8h85qdU.d.ts} +54 -52
- package/dist/{signoz-queries-BuiipZTk.d.cts → signoz-queries-CuWMQh1H.d.cts} +10 -10
- package/dist/{signoz-queries-BuiipZTk.d.ts → signoz-queries-CuWMQh1H.d.ts} +10 -10
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/dist/{utility-CyPQ1tC_.d.cts → utility-HqRMF7sM.d.cts} +1775 -320
- package/dist/{utility-CyPQ1tC_.d.ts → utility-HqRMF7sM.d.ts} +1775 -320
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.cjs +445 -304
- package/dist/validation/index.d.cts +12 -13
- package/dist/validation/index.d.ts +12 -13
- package/dist/validation/index.js +2 -2
- package/drizzle/0007_mighty_typhoid_mary.sql +227 -0
- package/drizzle/meta/0007_snapshot.json +2766 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +6 -1
- package/dist/chunk-MKBO26DX.js +0 -9
package/dist/db/schema.cjs
CHANGED
|
@@ -12,12 +12,12 @@ var projectScoped = {
|
|
|
12
12
|
...tenantScoped,
|
|
13
13
|
projectId: sqliteCore.text("project_id").notNull()
|
|
14
14
|
};
|
|
15
|
-
var
|
|
15
|
+
var agentScoped = {
|
|
16
16
|
...projectScoped,
|
|
17
|
-
|
|
17
|
+
agentId: sqliteCore.text("agent_id").notNull()
|
|
18
18
|
};
|
|
19
19
|
var subAgentScoped = {
|
|
20
|
-
...
|
|
20
|
+
...agentScoped,
|
|
21
21
|
subAgentId: sqliteCore.text("sub_agent_id").notNull()
|
|
22
22
|
};
|
|
23
23
|
var uiProperties = {
|
|
@@ -33,9 +33,9 @@ var projects = sqliteCore.sqliteTable(
|
|
|
33
33
|
{
|
|
34
34
|
...tenantScoped,
|
|
35
35
|
...uiProperties,
|
|
36
|
-
// Project-level default model settings that can be inherited by
|
|
36
|
+
// Project-level default model settings that can be inherited by agents
|
|
37
37
|
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
38
|
-
// Project-level stopWhen configuration that can be inherited by
|
|
38
|
+
// Project-level stopWhen configuration that can be inherited by agents
|
|
39
39
|
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
40
40
|
// Project-level sandbox configuration for function execution
|
|
41
41
|
sandboxConfig: sqliteCore.text("sandbox_config", { mode: "json" }).$type(),
|
|
@@ -43,23 +43,17 @@ var projects = sqliteCore.sqliteTable(
|
|
|
43
43
|
},
|
|
44
44
|
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
|
|
45
45
|
);
|
|
46
|
-
var
|
|
47
|
-
"
|
|
46
|
+
var agents = sqliteCore.sqliteTable(
|
|
47
|
+
"agent",
|
|
48
48
|
{
|
|
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
|
-
// Reference to shared context configuration for all agents in this graph
|
|
54
53
|
contextConfigId: sqliteCore.text("context_config_id"),
|
|
55
|
-
// add fk relationship
|
|
56
|
-
// Graph-level model settingsuration that can be inherited by agents
|
|
57
54
|
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
58
|
-
// Status updates configuration for intelligent progress summaries
|
|
59
55
|
statusUpdates: sqliteCore.text("status_updates", { mode: "json" }).$type(),
|
|
60
|
-
|
|
61
|
-
graphPrompt: sqliteCore.text("graph_prompt"),
|
|
62
|
-
// Graph-level stopWhen configuration that can be inherited by agents
|
|
56
|
+
prompt: sqliteCore.text("prompt"),
|
|
63
57
|
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
64
58
|
...timestamps
|
|
65
59
|
},
|
|
@@ -68,27 +62,26 @@ var agentGraph = sqliteCore.sqliteTable(
|
|
|
68
62
|
sqliteCore.foreignKey({
|
|
69
63
|
columns: [table.tenantId, table.projectId],
|
|
70
64
|
foreignColumns: [projects.tenantId, projects.id],
|
|
71
|
-
name: "
|
|
65
|
+
name: "agent_project_fk"
|
|
72
66
|
}).onDelete("cascade")
|
|
73
67
|
]
|
|
74
68
|
);
|
|
75
69
|
var contextConfigs = sqliteCore.sqliteTable(
|
|
76
70
|
"context_configs",
|
|
77
71
|
{
|
|
78
|
-
...
|
|
72
|
+
...agentScoped,
|
|
79
73
|
// Developer-defined Zod schema for validating incoming request context
|
|
80
74
|
headersSchema: sqliteCore.blob("headers_schema", { mode: "json" }).$type(),
|
|
81
|
-
// Stores serialized Zod schema
|
|
82
75
|
// Object mapping template keys to fetch definitions that use request context data
|
|
83
76
|
contextVariables: sqliteCore.blob("context_variables", { mode: "json" }).$type(),
|
|
84
77
|
...timestamps
|
|
85
78
|
},
|
|
86
79
|
(table) => [
|
|
87
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
80
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
88
81
|
sqliteCore.foreignKey({
|
|
89
|
-
columns: [table.tenantId, table.projectId, table.
|
|
90
|
-
foreignColumns: [
|
|
91
|
-
name: "
|
|
82
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
83
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
84
|
+
name: "context_configs_agent_fk"
|
|
92
85
|
}).onDelete("cascade")
|
|
93
86
|
]
|
|
94
87
|
);
|
|
@@ -101,16 +94,12 @@ var contextCache = sqliteCore.sqliteTable(
|
|
|
101
94
|
// Reference to the context config and specific fetch definition
|
|
102
95
|
contextConfigId: sqliteCore.text("context_config_id").notNull(),
|
|
103
96
|
contextVariableKey: sqliteCore.text("context_variable_key").notNull(),
|
|
104
|
-
// Key from contextVariables object
|
|
105
|
-
// The actual cached context data
|
|
106
97
|
value: sqliteCore.blob("value", { mode: "json" }).$type().notNull(),
|
|
107
98
|
// Request hash for cache invalidation based on context changes
|
|
108
99
|
requestHash: sqliteCore.text("request_hash"),
|
|
109
|
-
// Hash of request context that triggered this cache
|
|
110
100
|
// Metadata for monitoring and debugging
|
|
111
101
|
fetchedAt: sqliteCore.text("fetched_at").notNull(),
|
|
112
102
|
fetchSource: sqliteCore.text("fetch_source"),
|
|
113
|
-
// URL or source identifier
|
|
114
103
|
fetchDurationMs: sqliteCore.integer("fetch_duration_ms"),
|
|
115
104
|
...timestamps
|
|
116
105
|
},
|
|
@@ -131,30 +120,29 @@ var contextCache = sqliteCore.sqliteTable(
|
|
|
131
120
|
var subAgents = sqliteCore.sqliteTable(
|
|
132
121
|
"sub_agents",
|
|
133
122
|
{
|
|
134
|
-
...
|
|
123
|
+
...agentScoped,
|
|
135
124
|
...uiProperties,
|
|
136
125
|
prompt: sqliteCore.text("prompt").notNull(),
|
|
137
126
|
conversationHistoryConfig: sqliteCore.text("conversation_history_config", {
|
|
138
127
|
mode: "json"
|
|
139
128
|
}).$type(),
|
|
140
129
|
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
141
|
-
// Agent-level stopWhen configuration (inherited from project)
|
|
142
130
|
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
143
131
|
...timestamps
|
|
144
132
|
},
|
|
145
133
|
(table) => [
|
|
146
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
134
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
147
135
|
sqliteCore.foreignKey({
|
|
148
|
-
columns: [table.tenantId, table.projectId, table.
|
|
149
|
-
foreignColumns: [
|
|
150
|
-
name: "
|
|
136
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
137
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
138
|
+
name: "sub_agents_agents_fk"
|
|
151
139
|
}).onDelete("cascade")
|
|
152
140
|
]
|
|
153
141
|
);
|
|
154
142
|
var subAgentRelations = sqliteCore.sqliteTable(
|
|
155
143
|
"sub_agent_relations",
|
|
156
144
|
{
|
|
157
|
-
...
|
|
145
|
+
...agentScoped,
|
|
158
146
|
sourceSubAgentId: sqliteCore.text("source_sub_agent_id").notNull(),
|
|
159
147
|
// For internal relationships
|
|
160
148
|
targetSubAgentId: sqliteCore.text("target_sub_agent_id"),
|
|
@@ -164,31 +152,30 @@ var subAgentRelations = sqliteCore.sqliteTable(
|
|
|
164
152
|
...timestamps
|
|
165
153
|
},
|
|
166
154
|
(table) => [
|
|
167
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
155
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
168
156
|
sqliteCore.foreignKey({
|
|
169
|
-
columns: [table.tenantId, table.projectId, table.
|
|
170
|
-
foreignColumns: [
|
|
171
|
-
name: "
|
|
157
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
158
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
159
|
+
name: "sub_agent_relations_agent_fk"
|
|
172
160
|
}).onDelete("cascade")
|
|
173
161
|
]
|
|
174
162
|
);
|
|
175
163
|
var externalAgents = sqliteCore.sqliteTable(
|
|
176
164
|
"external_agents",
|
|
177
165
|
{
|
|
178
|
-
...
|
|
166
|
+
...agentScoped,
|
|
179
167
|
...uiProperties,
|
|
180
168
|
baseUrl: sqliteCore.text("base_url").notNull(),
|
|
181
|
-
// A2A endpoint URL
|
|
182
169
|
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
183
170
|
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
184
171
|
...timestamps
|
|
185
172
|
},
|
|
186
173
|
(table) => [
|
|
187
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
174
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
188
175
|
sqliteCore.foreignKey({
|
|
189
|
-
columns: [table.tenantId, table.projectId, table.
|
|
190
|
-
foreignColumns: [
|
|
191
|
-
name: "
|
|
176
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
177
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
178
|
+
name: "external_agents_agent_fk"
|
|
192
179
|
}).onDelete("cascade"),
|
|
193
180
|
sqliteCore.foreignKey({
|
|
194
181
|
columns: [table.tenantId, table.projectId, table.credentialReferenceId],
|
|
@@ -213,8 +200,8 @@ var tasks = sqliteCore.sqliteTable(
|
|
|
213
200
|
(table) => [
|
|
214
201
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
215
202
|
sqliteCore.foreignKey({
|
|
216
|
-
columns: [table.tenantId, table.projectId, table.
|
|
217
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
203
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
204
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
218
205
|
name: "tasks_sub_agent_fk"
|
|
219
206
|
}).onDelete("cascade")
|
|
220
207
|
]
|
|
@@ -226,7 +213,6 @@ var taskRelations = sqliteCore.sqliteTable(
|
|
|
226
213
|
parentTaskId: sqliteCore.text("parent_task_id").notNull(),
|
|
227
214
|
childTaskId: sqliteCore.text("child_task_id").notNull(),
|
|
228
215
|
relationType: sqliteCore.text("relation_type").default("parent_child"),
|
|
229
|
-
// Could be extended for other relation types
|
|
230
216
|
...timestamps
|
|
231
217
|
},
|
|
232
218
|
(table) => [
|
|
@@ -264,13 +250,11 @@ var subAgentDataComponents = sqliteCore.sqliteTable(
|
|
|
264
250
|
},
|
|
265
251
|
(table) => [
|
|
266
252
|
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
267
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
268
253
|
sqliteCore.foreignKey({
|
|
269
|
-
columns: [table.tenantId, table.projectId, table.
|
|
270
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
254
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
255
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
271
256
|
name: "sub_agent_data_components_sub_agent_fk"
|
|
272
257
|
}).onDelete("cascade"),
|
|
273
|
-
// Foreign key constraint to data_components table
|
|
274
258
|
sqliteCore.foreignKey({
|
|
275
259
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
276
260
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
@@ -304,15 +288,13 @@ var subAgentArtifactComponents = sqliteCore.sqliteTable(
|
|
|
304
288
|
},
|
|
305
289
|
(table) => [
|
|
306
290
|
sqliteCore.primaryKey({
|
|
307
|
-
columns: [table.tenantId, table.projectId, table.
|
|
291
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId, table.id]
|
|
308
292
|
}),
|
|
309
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
310
293
|
sqliteCore.foreignKey({
|
|
311
|
-
columns: [table.tenantId, table.projectId, table.
|
|
312
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
294
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
295
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
313
296
|
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
314
297
|
}).onDelete("cascade"),
|
|
315
|
-
// Foreign key constraint to artifact_components table
|
|
316
298
|
sqliteCore.foreignKey({
|
|
317
299
|
columns: [table.tenantId, table.projectId, table.artifactComponentId],
|
|
318
300
|
foreignColumns: [
|
|
@@ -352,18 +334,18 @@ var tools = sqliteCore.sqliteTable(
|
|
|
352
334
|
var functionTools = sqliteCore.sqliteTable(
|
|
353
335
|
"function_tools",
|
|
354
336
|
{
|
|
355
|
-
...
|
|
337
|
+
...agentScoped,
|
|
356
338
|
name: sqliteCore.text("name").notNull(),
|
|
357
339
|
description: sqliteCore.text("description"),
|
|
358
340
|
functionId: sqliteCore.text("function_id").notNull(),
|
|
359
341
|
...timestamps
|
|
360
342
|
},
|
|
361
343
|
(table) => [
|
|
362
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
344
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
363
345
|
sqliteCore.foreignKey({
|
|
364
|
-
columns: [table.tenantId, table.projectId, table.
|
|
365
|
-
foreignColumns: [
|
|
366
|
-
name: "
|
|
346
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
347
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
348
|
+
name: "function_tools_agent_fk"
|
|
367
349
|
}).onDelete("cascade"),
|
|
368
350
|
// Foreign key constraint to functions table
|
|
369
351
|
sqliteCore.foreignKey({
|
|
@@ -401,14 +383,12 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
|
|
|
401
383
|
...timestamps
|
|
402
384
|
},
|
|
403
385
|
(table) => [
|
|
404
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
405
|
-
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
386
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
406
387
|
sqliteCore.foreignKey({
|
|
407
|
-
columns: [table.tenantId, table.projectId, table.
|
|
408
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
388
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
389
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
409
390
|
name: "sub_agent_tool_relations_agent_fk"
|
|
410
391
|
}).onDelete("cascade"),
|
|
411
|
-
// Foreign key constraint to tools table (MCP tools)
|
|
412
392
|
sqliteCore.foreignKey({
|
|
413
393
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
414
394
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
@@ -424,20 +404,20 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
|
|
|
424
404
|
...timestamps
|
|
425
405
|
},
|
|
426
406
|
(table) => [
|
|
427
|
-
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
407
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
428
408
|
// Foreign key constraint to agents table
|
|
429
409
|
sqliteCore.foreignKey({
|
|
430
|
-
columns: [table.tenantId, table.projectId, table.
|
|
431
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
410
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
411
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
432
412
|
name: "agent_function_tool_relations_agent_fk"
|
|
433
413
|
}).onDelete("cascade"),
|
|
434
414
|
// Foreign key constraint to functionTools table
|
|
435
415
|
sqliteCore.foreignKey({
|
|
436
|
-
columns: [table.tenantId, table.projectId, table.
|
|
416
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.functionToolId],
|
|
437
417
|
foreignColumns: [
|
|
438
418
|
functionTools.tenantId,
|
|
439
419
|
functionTools.projectId,
|
|
440
|
-
functionTools.
|
|
420
|
+
functionTools.agentId,
|
|
441
421
|
functionTools.id
|
|
442
422
|
],
|
|
443
423
|
name: "agent_function_tool_relations_function_tool_fk"
|
|
@@ -471,33 +451,23 @@ var messages = sqliteCore.sqliteTable(
|
|
|
471
451
|
conversationId: sqliteCore.text("conversation_id").notNull(),
|
|
472
452
|
// Role mapping: user, agent, system (unified for both formats)
|
|
473
453
|
role: sqliteCore.text("role").notNull(),
|
|
474
|
-
// 'user' | 'agent' | 'system'
|
|
475
454
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
476
455
|
fromSubAgentId: sqliteCore.text("from_sub_agent_id"),
|
|
477
|
-
// Populated when message is from an agent
|
|
478
456
|
toSubAgentId: sqliteCore.text("to_sub_agent_id"),
|
|
479
|
-
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
480
457
|
// External agent sender tracking
|
|
481
458
|
fromExternalAgentId: sqliteCore.text("from_external_sub_agent_id"),
|
|
482
|
-
// Populated when message is directed from an external agent
|
|
483
459
|
// External agent recipient tracking
|
|
484
460
|
toExternalAgentId: sqliteCore.text("to_external_sub_agent_id"),
|
|
485
|
-
// Populated when message is directed to an external agent
|
|
486
461
|
// Message content stored as JSON to support both formats
|
|
487
462
|
content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
|
|
488
463
|
// Message classification and filtering
|
|
489
464
|
visibility: sqliteCore.text("visibility").notNull().default("user-facing"),
|
|
490
|
-
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
491
465
|
messageType: sqliteCore.text("message_type").notNull().default("chat"),
|
|
492
|
-
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
493
466
|
taskId: sqliteCore.text("task_id"),
|
|
494
467
|
parentMessageId: sqliteCore.text("parent_message_id"),
|
|
495
|
-
// Remove self-reference constraint here
|
|
496
468
|
// A2A specific fields
|
|
497
469
|
a2aTaskId: sqliteCore.text("a2a_task_id"),
|
|
498
|
-
// Links to A2A task when relevant
|
|
499
470
|
a2aSessionId: sqliteCore.text("a2a_session_id"),
|
|
500
|
-
// A2A session identifier
|
|
501
471
|
// Metadata for extensions
|
|
502
472
|
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
503
473
|
...timestamps
|
|
@@ -518,7 +488,6 @@ var ledgerArtifacts = sqliteCore.sqliteTable(
|
|
|
518
488
|
// Links
|
|
519
489
|
taskId: sqliteCore.text("task_id").notNull(),
|
|
520
490
|
toolCallId: sqliteCore.text("tool_call_id"),
|
|
521
|
-
// Added for traceability to the specific tool execution
|
|
522
491
|
contextId: sqliteCore.text("context_id").notNull(),
|
|
523
492
|
// Core Artifact fields
|
|
524
493
|
type: sqliteCore.text("type").notNull().default("source"),
|
|
@@ -554,13 +523,10 @@ var ledgerArtifacts = sqliteCore.sqliteTable(
|
|
|
554
523
|
var apiKeys = sqliteCore.sqliteTable(
|
|
555
524
|
"api_keys",
|
|
556
525
|
{
|
|
557
|
-
...
|
|
526
|
+
...agentScoped,
|
|
558
527
|
publicId: sqliteCore.text("public_id").notNull().unique(),
|
|
559
|
-
// Public ID for O(1) lookup (e.g., "abc123def456")
|
|
560
528
|
keyHash: sqliteCore.text("key_hash").notNull(),
|
|
561
|
-
// Hashed API key (never store plaintext)
|
|
562
529
|
keyPrefix: sqliteCore.text("key_prefix").notNull(),
|
|
563
|
-
// First 8 chars for identification (e.g., "sk_live_abc...")
|
|
564
530
|
name: sqliteCore.text("name"),
|
|
565
531
|
lastUsedAt: sqliteCore.text("last_used_at"),
|
|
566
532
|
expiresAt: sqliteCore.text("expires_at"),
|
|
@@ -573,11 +539,11 @@ var apiKeys = sqliteCore.sqliteTable(
|
|
|
573
539
|
name: "api_keys_project_fk"
|
|
574
540
|
}).onDelete("cascade"),
|
|
575
541
|
sqliteCore.foreignKey({
|
|
576
|
-
columns: [t.tenantId, t.projectId, t.
|
|
577
|
-
foreignColumns: [
|
|
578
|
-
name: "
|
|
542
|
+
columns: [t.tenantId, t.projectId, t.agentId],
|
|
543
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
544
|
+
name: "api_keys_agent_fk"
|
|
579
545
|
}).onDelete("cascade"),
|
|
580
|
-
sqliteCore.index("
|
|
546
|
+
sqliteCore.index("api_keys_tenant_agent_idx").on(t.tenantId, t.agentId),
|
|
581
547
|
sqliteCore.index("api_keys_prefix_idx").on(t.keyPrefix),
|
|
582
548
|
sqliteCore.index("api_keys_public_id_idx").on(t.publicId)
|
|
583
549
|
]
|
|
@@ -587,9 +553,7 @@ var credentialReferences = sqliteCore.sqliteTable(
|
|
|
587
553
|
{
|
|
588
554
|
...projectScoped,
|
|
589
555
|
type: sqliteCore.text("type").notNull(),
|
|
590
|
-
// Implementation type: 'keychain', 'nango', 'memory', etc.
|
|
591
556
|
credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
|
|
592
|
-
// Maps to framework.getCredentialStore(id)
|
|
593
557
|
retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
|
|
594
558
|
...timestamps
|
|
595
559
|
},
|
|
@@ -603,7 +567,6 @@ var credentialReferences = sqliteCore.sqliteTable(
|
|
|
603
567
|
]
|
|
604
568
|
);
|
|
605
569
|
var tasksRelations = drizzleOrm.relations(tasks, ({ one, many }) => ({
|
|
606
|
-
// A task belongs to one project
|
|
607
570
|
project: one(projects, {
|
|
608
571
|
fields: [tasks.tenantId, tasks.projectId],
|
|
609
572
|
references: [projects.tenantId, projects.id]
|
|
@@ -620,14 +583,12 @@ var tasksRelations = drizzleOrm.relations(tasks, ({ one, many }) => ({
|
|
|
620
583
|
fields: [tasks.subAgentId],
|
|
621
584
|
references: [subAgents.id]
|
|
622
585
|
}),
|
|
623
|
-
// A task can have many messages associated with it
|
|
624
586
|
messages: many(messages),
|
|
625
|
-
// A task can have many ledger artifacts
|
|
626
587
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
627
588
|
}));
|
|
628
589
|
var projectsRelations = drizzleOrm.relations(projects, ({ many }) => ({
|
|
629
590
|
subAgents: many(subAgents),
|
|
630
|
-
|
|
591
|
+
agents: many(agents),
|
|
631
592
|
tools: many(tools),
|
|
632
593
|
functions: many(functions),
|
|
633
594
|
contextConfigs: many(contextConfigs),
|
|
@@ -656,7 +617,7 @@ var contextConfigsRelations = drizzleOrm.relations(contextConfigs, ({ many, one
|
|
|
656
617
|
fields: [contextConfigs.tenantId, contextConfigs.projectId],
|
|
657
618
|
references: [projects.tenantId, projects.id]
|
|
658
619
|
}),
|
|
659
|
-
|
|
620
|
+
agents: many(agents),
|
|
660
621
|
cache: many(contextCache)
|
|
661
622
|
}));
|
|
662
623
|
var contextCacheRelations = drizzleOrm.relations(contextCache, ({ one }) => ({
|
|
@@ -671,7 +632,7 @@ var subAgentsRelations = drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
|
671
632
|
references: [projects.tenantId, projects.id]
|
|
672
633
|
}),
|
|
673
634
|
tasks: many(tasks),
|
|
674
|
-
|
|
635
|
+
defaultForAgents: many(agents),
|
|
675
636
|
sourceRelations: many(subAgentRelations, {
|
|
676
637
|
relationName: "sourceRelations"
|
|
677
638
|
}),
|
|
@@ -684,25 +645,22 @@ var subAgentsRelations = drizzleOrm.relations(subAgents, ({ many, one }) => ({
|
|
|
684
645
|
receivedMessages: many(messages, {
|
|
685
646
|
relationName: "receivedMessages"
|
|
686
647
|
}),
|
|
687
|
-
associatedMessages: many(messages, {
|
|
688
|
-
relationName: "associatedAgent"
|
|
689
|
-
}),
|
|
690
648
|
toolRelations: many(subAgentToolRelations),
|
|
691
649
|
functionToolRelations: many(agentFunctionToolRelations),
|
|
692
650
|
dataComponentRelations: many(subAgentDataComponents),
|
|
693
651
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
694
652
|
}));
|
|
695
|
-
var
|
|
653
|
+
var agentRelations = drizzleOrm.relations(agents, ({ one, many }) => ({
|
|
696
654
|
project: one(projects, {
|
|
697
|
-
fields: [
|
|
655
|
+
fields: [agents.tenantId, agents.projectId],
|
|
698
656
|
references: [projects.tenantId, projects.id]
|
|
699
657
|
}),
|
|
700
658
|
defaultSubAgent: one(subAgents, {
|
|
701
|
-
fields: [
|
|
659
|
+
fields: [agents.defaultSubAgentId],
|
|
702
660
|
references: [subAgents.id]
|
|
703
661
|
}),
|
|
704
662
|
contextConfig: one(contextConfigs, {
|
|
705
|
-
fields: [
|
|
663
|
+
fields: [agents.contextConfigId],
|
|
706
664
|
references: [contextConfigs.id]
|
|
707
665
|
}),
|
|
708
666
|
functionTools: many(functionTools)
|
|
@@ -723,9 +681,9 @@ var apiKeysRelations = drizzleOrm.relations(apiKeys, ({ one }) => ({
|
|
|
723
681
|
fields: [apiKeys.tenantId, apiKeys.projectId],
|
|
724
682
|
references: [projects.tenantId, projects.id]
|
|
725
683
|
}),
|
|
726
|
-
|
|
727
|
-
fields: [apiKeys.
|
|
728
|
-
references: [
|
|
684
|
+
agent: one(agents, {
|
|
685
|
+
fields: [apiKeys.agentId],
|
|
686
|
+
references: [agents.id]
|
|
729
687
|
})
|
|
730
688
|
}));
|
|
731
689
|
var agentToolRelationsRelations = drizzleOrm.relations(subAgentToolRelations, ({ one }) => ({
|
|
@@ -738,8 +696,13 @@ var agentToolRelationsRelations = drizzleOrm.relations(subAgentToolRelations, ({
|
|
|
738
696
|
references: [tools.id]
|
|
739
697
|
})
|
|
740
698
|
}));
|
|
741
|
-
var credentialReferencesRelations = drizzleOrm.relations(credentialReferences, ({ many }) => ({
|
|
742
|
-
|
|
699
|
+
var credentialReferencesRelations = drizzleOrm.relations(credentialReferences, ({ one, many }) => ({
|
|
700
|
+
project: one(projects, {
|
|
701
|
+
fields: [credentialReferences.tenantId, credentialReferences.projectId],
|
|
702
|
+
references: [projects.tenantId, projects.id]
|
|
703
|
+
}),
|
|
704
|
+
tools: many(tools),
|
|
705
|
+
externalAgents: many(externalAgents)
|
|
743
706
|
}));
|
|
744
707
|
var toolsRelations = drizzleOrm.relations(tools, ({ one, many }) => ({
|
|
745
708
|
project: one(projects, {
|
|
@@ -848,13 +811,17 @@ var ledgerArtifactsRelations = drizzleOrm.relations(ledgerArtifacts, ({ one }) =
|
|
|
848
811
|
references: [tasks.id]
|
|
849
812
|
})
|
|
850
813
|
}));
|
|
851
|
-
var functionsRelations = drizzleOrm.relations(functions, ({ many }) => ({
|
|
852
|
-
functionTools: many(functionTools)
|
|
814
|
+
var functionsRelations = drizzleOrm.relations(functions, ({ many, one }) => ({
|
|
815
|
+
functionTools: many(functionTools),
|
|
816
|
+
project: one(projects, {
|
|
817
|
+
fields: [functions.tenantId, functions.projectId],
|
|
818
|
+
references: [projects.tenantId, projects.id]
|
|
819
|
+
})
|
|
853
820
|
}));
|
|
854
821
|
var subAgentRelationsRelations = drizzleOrm.relations(subAgentRelations, ({ one }) => ({
|
|
855
|
-
|
|
856
|
-
fields: [subAgentRelations.
|
|
857
|
-
references: [
|
|
822
|
+
agent: one(agents, {
|
|
823
|
+
fields: [subAgentRelations.agentId],
|
|
824
|
+
references: [agents.id]
|
|
858
825
|
}),
|
|
859
826
|
sourceSubAgent: one(subAgents, {
|
|
860
827
|
fields: [subAgentRelations.sourceSubAgentId],
|
|
@@ -876,9 +843,9 @@ var functionToolsRelations = drizzleOrm.relations(functionTools, ({ one, many })
|
|
|
876
843
|
fields: [functionTools.tenantId, functionTools.projectId],
|
|
877
844
|
references: [projects.tenantId, projects.id]
|
|
878
845
|
}),
|
|
879
|
-
|
|
880
|
-
fields: [functionTools.tenantId, functionTools.projectId, functionTools.
|
|
881
|
-
references: [
|
|
846
|
+
agent: one(agents, {
|
|
847
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.agentId],
|
|
848
|
+
references: [agents.tenantId, agents.projectId, agents.id]
|
|
882
849
|
}),
|
|
883
850
|
function: one(functions, {
|
|
884
851
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
@@ -902,9 +869,9 @@ var agentFunctionToolRelationsRelations = drizzleOrm.relations(
|
|
|
902
869
|
|
|
903
870
|
exports.agentFunctionToolRelations = agentFunctionToolRelations;
|
|
904
871
|
exports.agentFunctionToolRelationsRelations = agentFunctionToolRelationsRelations;
|
|
905
|
-
exports.
|
|
906
|
-
exports.agentGraphRelations = agentGraphRelations;
|
|
872
|
+
exports.agentRelations = agentRelations;
|
|
907
873
|
exports.agentToolRelationsRelations = agentToolRelationsRelations;
|
|
874
|
+
exports.agents = agents;
|
|
908
875
|
exports.apiKeys = apiKeys;
|
|
909
876
|
exports.apiKeysRelations = apiKeysRelations;
|
|
910
877
|
exports.artifactComponents = artifactComponents;
|
package/dist/db/schema.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations,
|
|
3
|
+
import '../utility-HqRMF7sM.cjs';
|
|
4
|
+
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations, 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, 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-CcSN2XcZ.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
|
8
|
-
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
package/dist/db/schema.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import 'drizzle-orm';
|
|
2
2
|
import 'drizzle-orm/sqlite-core';
|
|
3
|
-
import '../utility-
|
|
4
|
-
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations,
|
|
3
|
+
import '../utility-HqRMF7sM.js';
|
|
4
|
+
export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations, 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, 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-D8h85qdU.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'drizzle-zod';
|
|
7
7
|
import '@hono/zod-openapi';
|
|
8
|
-
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
package/dist/db/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { agentFunctionToolRelations, agentFunctionToolRelationsRelations,
|
|
1
|
+
export { agentFunctionToolRelations, agentFunctionToolRelationsRelations, 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, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from '../chunk-B6F3RF4T.js';
|