@inkeep/agents-core 0.18.0 → 0.19.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 +4 -4
- package/dist/{chunk-E4SFK6AI.js → chunk-3GZBRBXP.js} +84 -87
- package/dist/{chunk-JTHQYGCX.js → chunk-3XUV5Q4D.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-TCLX6C3C.js → chunk-SLL6V3AE.js} +25 -18
- package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
- package/dist/client-exports.cjs +201 -231
- 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 +213943 -1046
- package/dist/index.d.cts +209 -208
- package/dist/index.d.ts +209 -208
- package/dist/index.js +213657 -767
- package/dist/{schema-Bjy5TkFv.d.cts → schema-Dp-qgdBT.d.ts} +56 -54
- package/dist/{schema-CfWbqju2.d.ts → schema-DrDaCn6H.d.cts} +56 -54
- package/dist/{signoz-queries-CifqdbnO.d.ts → signoz-queries-CuWMQh1H.d.cts} +19 -14
- package/dist/{signoz-queries-CifqdbnO.d.cts → signoz-queries-CuWMQh1H.d.ts} +19 -14
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/dist/{utility-Fxoh7s82.d.cts → utility-BxbySenH.d.cts} +158 -307
- package/dist/{utility-Fxoh7s82.d.ts → utility-BxbySenH.d.ts} +158 -307
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.cjs +212 -249
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __export } from './chunk-
|
|
1
|
+
import { __export } from './chunk-E6R6PML7.js';
|
|
2
2
|
import { relations, sql } from 'drizzle-orm';
|
|
3
3
|
import { sqliteTable, text, primaryKey, foreignKey, blob, integer, index, unique } from 'drizzle-orm/sqlite-core';
|
|
4
4
|
|
|
@@ -7,9 +7,9 @@ var schema_exports = {};
|
|
|
7
7
|
__export(schema_exports, {
|
|
8
8
|
agentFunctionToolRelations: () => agentFunctionToolRelations,
|
|
9
9
|
agentFunctionToolRelationsRelations: () => agentFunctionToolRelationsRelations,
|
|
10
|
-
|
|
11
|
-
agentGraphRelations: () => agentGraphRelations,
|
|
10
|
+
agentRelations: () => agentRelations,
|
|
12
11
|
agentToolRelationsRelations: () => agentToolRelationsRelations,
|
|
12
|
+
agents: () => agents,
|
|
13
13
|
apiKeys: () => apiKeys,
|
|
14
14
|
apiKeysRelations: () => apiKeysRelations,
|
|
15
15
|
artifactComponents: () => artifactComponents,
|
|
@@ -60,12 +60,12 @@ var projectScoped = {
|
|
|
60
60
|
...tenantScoped,
|
|
61
61
|
projectId: text("project_id").notNull()
|
|
62
62
|
};
|
|
63
|
-
var
|
|
63
|
+
var agentScoped = {
|
|
64
64
|
...projectScoped,
|
|
65
|
-
|
|
65
|
+
agentId: text("agent_id").notNull()
|
|
66
66
|
};
|
|
67
67
|
var subAgentScoped = {
|
|
68
|
-
...
|
|
68
|
+
...agentScoped,
|
|
69
69
|
subAgentId: text("sub_agent_id").notNull()
|
|
70
70
|
};
|
|
71
71
|
var uiProperties = {
|
|
@@ -81,9 +81,9 @@ var projects = sqliteTable(
|
|
|
81
81
|
{
|
|
82
82
|
...tenantScoped,
|
|
83
83
|
...uiProperties,
|
|
84
|
-
// Project-level default model settings that can be inherited by
|
|
84
|
+
// Project-level default model settings that can be inherited by agents
|
|
85
85
|
models: text("models", { mode: "json" }).$type(),
|
|
86
|
-
// Project-level stopWhen configuration that can be inherited by
|
|
86
|
+
// Project-level stopWhen configuration that can be inherited by agents
|
|
87
87
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
88
88
|
// Project-level sandbox configuration for function execution
|
|
89
89
|
sandboxConfig: text("sandbox_config", { mode: "json" }).$type(),
|
|
@@ -91,23 +91,17 @@ var projects = sqliteTable(
|
|
|
91
91
|
},
|
|
92
92
|
(table) => [primaryKey({ columns: [table.tenantId, table.id] })]
|
|
93
93
|
);
|
|
94
|
-
var
|
|
95
|
-
"
|
|
94
|
+
var agents = sqliteTable(
|
|
95
|
+
"agent",
|
|
96
96
|
{
|
|
97
97
|
...projectScoped,
|
|
98
98
|
name: text("name").notNull(),
|
|
99
99
|
description: text("description"),
|
|
100
100
|
defaultSubAgentId: text("default_sub_agent_id"),
|
|
101
|
-
// Reference to shared context configuration for all agents in this graph
|
|
102
101
|
contextConfigId: text("context_config_id"),
|
|
103
|
-
// add fk relationship
|
|
104
|
-
// Graph-level model settingsuration that can be inherited by agents
|
|
105
102
|
models: text("models", { mode: "json" }).$type(),
|
|
106
|
-
// Status updates configuration for intelligent progress summaries
|
|
107
103
|
statusUpdates: text("status_updates", { mode: "json" }).$type(),
|
|
108
|
-
|
|
109
|
-
graphPrompt: text("graph_prompt"),
|
|
110
|
-
// Graph-level stopWhen configuration that can be inherited by agents
|
|
104
|
+
prompt: text("prompt"),
|
|
111
105
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
112
106
|
...timestamps
|
|
113
107
|
},
|
|
@@ -116,27 +110,26 @@ var agentGraph = sqliteTable(
|
|
|
116
110
|
foreignKey({
|
|
117
111
|
columns: [table.tenantId, table.projectId],
|
|
118
112
|
foreignColumns: [projects.tenantId, projects.id],
|
|
119
|
-
name: "
|
|
113
|
+
name: "agent_project_fk"
|
|
120
114
|
}).onDelete("cascade")
|
|
121
115
|
]
|
|
122
116
|
);
|
|
123
117
|
var contextConfigs = sqliteTable(
|
|
124
118
|
"context_configs",
|
|
125
119
|
{
|
|
126
|
-
...
|
|
120
|
+
...agentScoped,
|
|
127
121
|
// Developer-defined Zod schema for validating incoming request context
|
|
128
122
|
headersSchema: blob("headers_schema", { mode: "json" }).$type(),
|
|
129
|
-
// Stores serialized Zod schema
|
|
130
123
|
// Object mapping template keys to fetch definitions that use request context data
|
|
131
124
|
contextVariables: blob("context_variables", { mode: "json" }).$type(),
|
|
132
125
|
...timestamps
|
|
133
126
|
},
|
|
134
127
|
(table) => [
|
|
135
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
128
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
136
129
|
foreignKey({
|
|
137
|
-
columns: [table.tenantId, table.projectId, table.
|
|
138
|
-
foreignColumns: [
|
|
139
|
-
name: "
|
|
130
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
131
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
132
|
+
name: "context_configs_agent_fk"
|
|
140
133
|
}).onDelete("cascade")
|
|
141
134
|
]
|
|
142
135
|
);
|
|
@@ -149,16 +142,12 @@ var contextCache = sqliteTable(
|
|
|
149
142
|
// Reference to the context config and specific fetch definition
|
|
150
143
|
contextConfigId: text("context_config_id").notNull(),
|
|
151
144
|
contextVariableKey: text("context_variable_key").notNull(),
|
|
152
|
-
// Key from contextVariables object
|
|
153
|
-
// The actual cached context data
|
|
154
145
|
value: blob("value", { mode: "json" }).$type().notNull(),
|
|
155
146
|
// Request hash for cache invalidation based on context changes
|
|
156
147
|
requestHash: text("request_hash"),
|
|
157
|
-
// Hash of request context that triggered this cache
|
|
158
148
|
// Metadata for monitoring and debugging
|
|
159
149
|
fetchedAt: text("fetched_at").notNull(),
|
|
160
150
|
fetchSource: text("fetch_source"),
|
|
161
|
-
// URL or source identifier
|
|
162
151
|
fetchDurationMs: integer("fetch_duration_ms"),
|
|
163
152
|
...timestamps
|
|
164
153
|
},
|
|
@@ -179,30 +168,29 @@ var contextCache = sqliteTable(
|
|
|
179
168
|
var subAgents = sqliteTable(
|
|
180
169
|
"sub_agents",
|
|
181
170
|
{
|
|
182
|
-
...
|
|
171
|
+
...agentScoped,
|
|
183
172
|
...uiProperties,
|
|
184
173
|
prompt: text("prompt").notNull(),
|
|
185
174
|
conversationHistoryConfig: text("conversation_history_config", {
|
|
186
175
|
mode: "json"
|
|
187
176
|
}).$type(),
|
|
188
177
|
models: text("models", { mode: "json" }).$type(),
|
|
189
|
-
// Agent-level stopWhen configuration (inherited from project)
|
|
190
178
|
stopWhen: text("stop_when", { mode: "json" }).$type(),
|
|
191
179
|
...timestamps
|
|
192
180
|
},
|
|
193
181
|
(table) => [
|
|
194
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
182
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
195
183
|
foreignKey({
|
|
196
|
-
columns: [table.tenantId, table.projectId, table.
|
|
197
|
-
foreignColumns: [
|
|
198
|
-
name: "
|
|
184
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
185
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
186
|
+
name: "sub_agents_agents_fk"
|
|
199
187
|
}).onDelete("cascade")
|
|
200
188
|
]
|
|
201
189
|
);
|
|
202
190
|
var subAgentRelations = sqliteTable(
|
|
203
191
|
"sub_agent_relations",
|
|
204
192
|
{
|
|
205
|
-
...
|
|
193
|
+
...agentScoped,
|
|
206
194
|
sourceSubAgentId: text("source_sub_agent_id").notNull(),
|
|
207
195
|
// For internal relationships
|
|
208
196
|
targetSubAgentId: text("target_sub_agent_id"),
|
|
@@ -212,31 +200,30 @@ var subAgentRelations = sqliteTable(
|
|
|
212
200
|
...timestamps
|
|
213
201
|
},
|
|
214
202
|
(table) => [
|
|
215
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
203
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
216
204
|
foreignKey({
|
|
217
|
-
columns: [table.tenantId, table.projectId, table.
|
|
218
|
-
foreignColumns: [
|
|
219
|
-
name: "
|
|
205
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
206
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
207
|
+
name: "sub_agent_relations_agent_fk"
|
|
220
208
|
}).onDelete("cascade")
|
|
221
209
|
]
|
|
222
210
|
);
|
|
223
211
|
var externalAgents = sqliteTable(
|
|
224
212
|
"external_agents",
|
|
225
213
|
{
|
|
226
|
-
...
|
|
214
|
+
...agentScoped,
|
|
227
215
|
...uiProperties,
|
|
228
216
|
baseUrl: text("base_url").notNull(),
|
|
229
|
-
// A2A endpoint URL
|
|
230
217
|
credentialReferenceId: text("credential_reference_id"),
|
|
231
218
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
232
219
|
...timestamps
|
|
233
220
|
},
|
|
234
221
|
(table) => [
|
|
235
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
222
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
236
223
|
foreignKey({
|
|
237
|
-
columns: [table.tenantId, table.projectId, table.
|
|
238
|
-
foreignColumns: [
|
|
239
|
-
name: "
|
|
224
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
225
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
226
|
+
name: "external_agents_agent_fk"
|
|
240
227
|
}).onDelete("cascade"),
|
|
241
228
|
foreignKey({
|
|
242
229
|
columns: [table.tenantId, table.projectId, table.credentialReferenceId],
|
|
@@ -261,8 +248,8 @@ var tasks = sqliteTable(
|
|
|
261
248
|
(table) => [
|
|
262
249
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
263
250
|
foreignKey({
|
|
264
|
-
columns: [table.tenantId, table.projectId, table.
|
|
265
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
251
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
252
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
266
253
|
name: "tasks_sub_agent_fk"
|
|
267
254
|
}).onDelete("cascade")
|
|
268
255
|
]
|
|
@@ -274,7 +261,6 @@ var taskRelations = sqliteTable(
|
|
|
274
261
|
parentTaskId: text("parent_task_id").notNull(),
|
|
275
262
|
childTaskId: text("child_task_id").notNull(),
|
|
276
263
|
relationType: text("relation_type").default("parent_child"),
|
|
277
|
-
// Could be extended for other relation types
|
|
278
264
|
...timestamps
|
|
279
265
|
},
|
|
280
266
|
(table) => [
|
|
@@ -312,13 +298,11 @@ var subAgentDataComponents = sqliteTable(
|
|
|
312
298
|
},
|
|
313
299
|
(table) => [
|
|
314
300
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
315
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
316
301
|
foreignKey({
|
|
317
|
-
columns: [table.tenantId, table.projectId, table.
|
|
318
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
302
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
303
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
319
304
|
name: "sub_agent_data_components_sub_agent_fk"
|
|
320
305
|
}).onDelete("cascade"),
|
|
321
|
-
// Foreign key constraint to data_components table
|
|
322
306
|
foreignKey({
|
|
323
307
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
324
308
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
@@ -352,15 +336,13 @@ var subAgentArtifactComponents = sqliteTable(
|
|
|
352
336
|
},
|
|
353
337
|
(table) => [
|
|
354
338
|
primaryKey({
|
|
355
|
-
columns: [table.tenantId, table.projectId, table.
|
|
339
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId, table.id]
|
|
356
340
|
}),
|
|
357
|
-
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
358
341
|
foreignKey({
|
|
359
|
-
columns: [table.tenantId, table.projectId, table.
|
|
360
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
342
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
343
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
361
344
|
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
362
345
|
}).onDelete("cascade"),
|
|
363
|
-
// Foreign key constraint to artifact_components table
|
|
364
346
|
foreignKey({
|
|
365
347
|
columns: [table.tenantId, table.projectId, table.artifactComponentId],
|
|
366
348
|
foreignColumns: [
|
|
@@ -400,18 +382,18 @@ var tools = sqliteTable(
|
|
|
400
382
|
var functionTools = sqliteTable(
|
|
401
383
|
"function_tools",
|
|
402
384
|
{
|
|
403
|
-
...
|
|
385
|
+
...agentScoped,
|
|
404
386
|
name: text("name").notNull(),
|
|
405
387
|
description: text("description"),
|
|
406
388
|
functionId: text("function_id").notNull(),
|
|
407
389
|
...timestamps
|
|
408
390
|
},
|
|
409
391
|
(table) => [
|
|
410
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
392
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
411
393
|
foreignKey({
|
|
412
|
-
columns: [table.tenantId, table.projectId, table.
|
|
413
|
-
foreignColumns: [
|
|
414
|
-
name: "
|
|
394
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
395
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
396
|
+
name: "function_tools_agent_fk"
|
|
415
397
|
}).onDelete("cascade"),
|
|
416
398
|
// Foreign key constraint to functions table
|
|
417
399
|
foreignKey({
|
|
@@ -449,14 +431,12 @@ var subAgentToolRelations = sqliteTable(
|
|
|
449
431
|
...timestamps
|
|
450
432
|
},
|
|
451
433
|
(table) => [
|
|
452
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
453
|
-
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
434
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
454
435
|
foreignKey({
|
|
455
|
-
columns: [table.tenantId, table.projectId, table.
|
|
456
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
436
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
437
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
457
438
|
name: "sub_agent_tool_relations_agent_fk"
|
|
458
439
|
}).onDelete("cascade"),
|
|
459
|
-
// Foreign key constraint to tools table (MCP tools)
|
|
460
440
|
foreignKey({
|
|
461
441
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
462
442
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
@@ -472,20 +452,20 @@ var agentFunctionToolRelations = sqliteTable(
|
|
|
472
452
|
...timestamps
|
|
473
453
|
},
|
|
474
454
|
(table) => [
|
|
475
|
-
primaryKey({ columns: [table.tenantId, table.projectId, table.
|
|
455
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
|
|
476
456
|
// Foreign key constraint to agents table
|
|
477
457
|
foreignKey({
|
|
478
|
-
columns: [table.tenantId, table.projectId, table.
|
|
479
|
-
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.
|
|
458
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
|
|
459
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
|
|
480
460
|
name: "agent_function_tool_relations_agent_fk"
|
|
481
461
|
}).onDelete("cascade"),
|
|
482
462
|
// Foreign key constraint to functionTools table
|
|
483
463
|
foreignKey({
|
|
484
|
-
columns: [table.tenantId, table.projectId, table.
|
|
464
|
+
columns: [table.tenantId, table.projectId, table.agentId, table.functionToolId],
|
|
485
465
|
foreignColumns: [
|
|
486
466
|
functionTools.tenantId,
|
|
487
467
|
functionTools.projectId,
|
|
488
|
-
functionTools.
|
|
468
|
+
functionTools.agentId,
|
|
489
469
|
functionTools.id
|
|
490
470
|
],
|
|
491
471
|
name: "agent_function_tool_relations_function_tool_fk"
|
|
@@ -519,33 +499,23 @@ var messages = sqliteTable(
|
|
|
519
499
|
conversationId: text("conversation_id").notNull(),
|
|
520
500
|
// Role mapping: user, agent, system (unified for both formats)
|
|
521
501
|
role: text("role").notNull(),
|
|
522
|
-
// 'user' | 'agent' | 'system'
|
|
523
502
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
524
503
|
fromSubAgentId: text("from_sub_agent_id"),
|
|
525
|
-
// Populated when message is from an agent
|
|
526
504
|
toSubAgentId: text("to_sub_agent_id"),
|
|
527
|
-
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
528
505
|
// External agent sender tracking
|
|
529
506
|
fromExternalAgentId: text("from_external_sub_agent_id"),
|
|
530
|
-
// Populated when message is directed from an external agent
|
|
531
507
|
// External agent recipient tracking
|
|
532
508
|
toExternalAgentId: text("to_external_sub_agent_id"),
|
|
533
|
-
// Populated when message is directed to an external agent
|
|
534
509
|
// Message content stored as JSON to support both formats
|
|
535
510
|
content: blob("content", { mode: "json" }).$type().notNull(),
|
|
536
511
|
// Message classification and filtering
|
|
537
512
|
visibility: text("visibility").notNull().default("user-facing"),
|
|
538
|
-
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
539
513
|
messageType: text("message_type").notNull().default("chat"),
|
|
540
|
-
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
541
514
|
taskId: text("task_id"),
|
|
542
515
|
parentMessageId: text("parent_message_id"),
|
|
543
|
-
// Remove self-reference constraint here
|
|
544
516
|
// A2A specific fields
|
|
545
517
|
a2aTaskId: text("a2a_task_id"),
|
|
546
|
-
// Links to A2A task when relevant
|
|
547
518
|
a2aSessionId: text("a2a_session_id"),
|
|
548
|
-
// A2A session identifier
|
|
549
519
|
// Metadata for extensions
|
|
550
520
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
551
521
|
...timestamps
|
|
@@ -566,7 +536,6 @@ var ledgerArtifacts = sqliteTable(
|
|
|
566
536
|
// Links
|
|
567
537
|
taskId: text("task_id").notNull(),
|
|
568
538
|
toolCallId: text("tool_call_id"),
|
|
569
|
-
// Added for traceability to the specific tool execution
|
|
570
539
|
contextId: text("context_id").notNull(),
|
|
571
540
|
// Core Artifact fields
|
|
572
541
|
type: text("type").notNull().default("source"),
|
|
@@ -602,13 +571,10 @@ var ledgerArtifacts = sqliteTable(
|
|
|
602
571
|
var apiKeys = sqliteTable(
|
|
603
572
|
"api_keys",
|
|
604
573
|
{
|
|
605
|
-
...
|
|
574
|
+
...agentScoped,
|
|
606
575
|
publicId: text("public_id").notNull().unique(),
|
|
607
|
-
// Public ID for O(1) lookup (e.g., "abc123def456")
|
|
608
576
|
keyHash: text("key_hash").notNull(),
|
|
609
|
-
// Hashed API key (never store plaintext)
|
|
610
577
|
keyPrefix: text("key_prefix").notNull(),
|
|
611
|
-
// First 8 chars for identification (e.g., "sk_live_abc...")
|
|
612
578
|
name: text("name"),
|
|
613
579
|
lastUsedAt: text("last_used_at"),
|
|
614
580
|
expiresAt: text("expires_at"),
|
|
@@ -621,11 +587,11 @@ var apiKeys = sqliteTable(
|
|
|
621
587
|
name: "api_keys_project_fk"
|
|
622
588
|
}).onDelete("cascade"),
|
|
623
589
|
foreignKey({
|
|
624
|
-
columns: [t.tenantId, t.projectId, t.
|
|
625
|
-
foreignColumns: [
|
|
626
|
-
name: "
|
|
590
|
+
columns: [t.tenantId, t.projectId, t.agentId],
|
|
591
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
592
|
+
name: "api_keys_agent_fk"
|
|
627
593
|
}).onDelete("cascade"),
|
|
628
|
-
index("
|
|
594
|
+
index("api_keys_tenant_agent_idx").on(t.tenantId, t.agentId),
|
|
629
595
|
index("api_keys_prefix_idx").on(t.keyPrefix),
|
|
630
596
|
index("api_keys_public_id_idx").on(t.publicId)
|
|
631
597
|
]
|
|
@@ -635,9 +601,7 @@ var credentialReferences = sqliteTable(
|
|
|
635
601
|
{
|
|
636
602
|
...projectScoped,
|
|
637
603
|
type: text("type").notNull(),
|
|
638
|
-
// Implementation type: 'keychain', 'nango', 'memory', etc.
|
|
639
604
|
credentialStoreId: text("credential_store_id").notNull(),
|
|
640
|
-
// Maps to framework.getCredentialStore(id)
|
|
641
605
|
retrievalParams: blob("retrieval_params", { mode: "json" }).$type(),
|
|
642
606
|
...timestamps
|
|
643
607
|
},
|
|
@@ -651,7 +615,6 @@ var credentialReferences = sqliteTable(
|
|
|
651
615
|
]
|
|
652
616
|
);
|
|
653
617
|
var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
654
|
-
// A task belongs to one project
|
|
655
618
|
project: one(projects, {
|
|
656
619
|
fields: [tasks.tenantId, tasks.projectId],
|
|
657
620
|
references: [projects.tenantId, projects.id]
|
|
@@ -668,14 +631,12 @@ var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
|
668
631
|
fields: [tasks.subAgentId],
|
|
669
632
|
references: [subAgents.id]
|
|
670
633
|
}),
|
|
671
|
-
// A task can have many messages associated with it
|
|
672
634
|
messages: many(messages),
|
|
673
|
-
// A task can have many ledger artifacts
|
|
674
635
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
675
636
|
}));
|
|
676
637
|
var projectsRelations = relations(projects, ({ many }) => ({
|
|
677
638
|
subAgents: many(subAgents),
|
|
678
|
-
|
|
639
|
+
agents: many(agents),
|
|
679
640
|
tools: many(tools),
|
|
680
641
|
functions: many(functions),
|
|
681
642
|
contextConfigs: many(contextConfigs),
|
|
@@ -704,7 +665,7 @@ var contextConfigsRelations = relations(contextConfigs, ({ many, one }) => ({
|
|
|
704
665
|
fields: [contextConfigs.tenantId, contextConfigs.projectId],
|
|
705
666
|
references: [projects.tenantId, projects.id]
|
|
706
667
|
}),
|
|
707
|
-
|
|
668
|
+
agents: many(agents),
|
|
708
669
|
cache: many(contextCache)
|
|
709
670
|
}));
|
|
710
671
|
var contextCacheRelations = relations(contextCache, ({ one }) => ({
|
|
@@ -719,7 +680,7 @@ var subAgentsRelations = relations(subAgents, ({ many, one }) => ({
|
|
|
719
680
|
references: [projects.tenantId, projects.id]
|
|
720
681
|
}),
|
|
721
682
|
tasks: many(tasks),
|
|
722
|
-
|
|
683
|
+
defaultForAgents: many(agents),
|
|
723
684
|
sourceRelations: many(subAgentRelations, {
|
|
724
685
|
relationName: "sourceRelations"
|
|
725
686
|
}),
|
|
@@ -732,25 +693,22 @@ var subAgentsRelations = relations(subAgents, ({ many, one }) => ({
|
|
|
732
693
|
receivedMessages: many(messages, {
|
|
733
694
|
relationName: "receivedMessages"
|
|
734
695
|
}),
|
|
735
|
-
associatedMessages: many(messages, {
|
|
736
|
-
relationName: "associatedAgent"
|
|
737
|
-
}),
|
|
738
696
|
toolRelations: many(subAgentToolRelations),
|
|
739
697
|
functionToolRelations: many(agentFunctionToolRelations),
|
|
740
698
|
dataComponentRelations: many(subAgentDataComponents),
|
|
741
699
|
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
742
700
|
}));
|
|
743
|
-
var
|
|
701
|
+
var agentRelations = relations(agents, ({ one, many }) => ({
|
|
744
702
|
project: one(projects, {
|
|
745
|
-
fields: [
|
|
703
|
+
fields: [agents.tenantId, agents.projectId],
|
|
746
704
|
references: [projects.tenantId, projects.id]
|
|
747
705
|
}),
|
|
748
706
|
defaultSubAgent: one(subAgents, {
|
|
749
|
-
fields: [
|
|
707
|
+
fields: [agents.defaultSubAgentId],
|
|
750
708
|
references: [subAgents.id]
|
|
751
709
|
}),
|
|
752
710
|
contextConfig: one(contextConfigs, {
|
|
753
|
-
fields: [
|
|
711
|
+
fields: [agents.contextConfigId],
|
|
754
712
|
references: [contextConfigs.id]
|
|
755
713
|
}),
|
|
756
714
|
functionTools: many(functionTools)
|
|
@@ -771,9 +729,9 @@ var apiKeysRelations = relations(apiKeys, ({ one }) => ({
|
|
|
771
729
|
fields: [apiKeys.tenantId, apiKeys.projectId],
|
|
772
730
|
references: [projects.tenantId, projects.id]
|
|
773
731
|
}),
|
|
774
|
-
|
|
775
|
-
fields: [apiKeys.
|
|
776
|
-
references: [
|
|
732
|
+
agent: one(agents, {
|
|
733
|
+
fields: [apiKeys.agentId],
|
|
734
|
+
references: [agents.id]
|
|
777
735
|
})
|
|
778
736
|
}));
|
|
779
737
|
var agentToolRelationsRelations = relations(subAgentToolRelations, ({ one }) => ({
|
|
@@ -786,8 +744,13 @@ var agentToolRelationsRelations = relations(subAgentToolRelations, ({ one }) =>
|
|
|
786
744
|
references: [tools.id]
|
|
787
745
|
})
|
|
788
746
|
}));
|
|
789
|
-
var credentialReferencesRelations = relations(credentialReferences, ({ many }) => ({
|
|
790
|
-
|
|
747
|
+
var credentialReferencesRelations = relations(credentialReferences, ({ one, many }) => ({
|
|
748
|
+
project: one(projects, {
|
|
749
|
+
fields: [credentialReferences.tenantId, credentialReferences.projectId],
|
|
750
|
+
references: [projects.tenantId, projects.id]
|
|
751
|
+
}),
|
|
752
|
+
tools: many(tools),
|
|
753
|
+
externalAgents: many(externalAgents)
|
|
791
754
|
}));
|
|
792
755
|
var toolsRelations = relations(tools, ({ one, many }) => ({
|
|
793
756
|
project: one(projects, {
|
|
@@ -896,13 +859,17 @@ var ledgerArtifactsRelations = relations(ledgerArtifacts, ({ one }) => ({
|
|
|
896
859
|
references: [tasks.id]
|
|
897
860
|
})
|
|
898
861
|
}));
|
|
899
|
-
var functionsRelations = relations(functions, ({ many }) => ({
|
|
900
|
-
functionTools: many(functionTools)
|
|
862
|
+
var functionsRelations = relations(functions, ({ many, one }) => ({
|
|
863
|
+
functionTools: many(functionTools),
|
|
864
|
+
project: one(projects, {
|
|
865
|
+
fields: [functions.tenantId, functions.projectId],
|
|
866
|
+
references: [projects.tenantId, projects.id]
|
|
867
|
+
})
|
|
901
868
|
}));
|
|
902
869
|
var subAgentRelationsRelations = relations(subAgentRelations, ({ one }) => ({
|
|
903
|
-
|
|
904
|
-
fields: [subAgentRelations.
|
|
905
|
-
references: [
|
|
870
|
+
agent: one(agents, {
|
|
871
|
+
fields: [subAgentRelations.agentId],
|
|
872
|
+
references: [agents.id]
|
|
906
873
|
}),
|
|
907
874
|
sourceSubAgent: one(subAgents, {
|
|
908
875
|
fields: [subAgentRelations.sourceSubAgentId],
|
|
@@ -924,9 +891,9 @@ var functionToolsRelations = relations(functionTools, ({ one, many }) => ({
|
|
|
924
891
|
fields: [functionTools.tenantId, functionTools.projectId],
|
|
925
892
|
references: [projects.tenantId, projects.id]
|
|
926
893
|
}),
|
|
927
|
-
|
|
928
|
-
fields: [functionTools.tenantId, functionTools.projectId, functionTools.
|
|
929
|
-
references: [
|
|
894
|
+
agent: one(agents, {
|
|
895
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.agentId],
|
|
896
|
+
references: [agents.tenantId, agents.projectId, agents.id]
|
|
930
897
|
}),
|
|
931
898
|
function: one(functions, {
|
|
932
899
|
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
@@ -948,4 +915,4 @@ var agentFunctionToolRelationsRelations = relations(
|
|
|
948
915
|
})
|
|
949
916
|
);
|
|
950
917
|
|
|
951
|
-
export { agentFunctionToolRelations, agentFunctionToolRelationsRelations,
|
|
918
|
+
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, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
+
}) : x)(function(x) {
|
|
7
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
8
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
9
|
+
});
|
|
10
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
18
|
+
|
|
19
|
+
export { __commonJS, __export, __publicField, __require };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/constants/models.ts
|
|
2
|
+
var ANTHROPIC_MODELS = {
|
|
3
|
+
CLAUDE_OPUS_4_1: "anthropic/claude-opus-4-1-20250805",
|
|
4
|
+
CLAUDE_SONNET_4_5: "anthropic/claude-sonnet-4.5-20250531",
|
|
5
|
+
CLAUDE_SONNET_4: "anthropic/claude-sonnet-4-20250514",
|
|
6
|
+
CLAUDE_3_5_SONNET: "anthropic/claude-3-5-sonnet-20241022",
|
|
7
|
+
CLAUDE_3_5_HAIKU: "anthropic/claude-3-5-haiku-20241022"
|
|
8
|
+
};
|
|
9
|
+
var OPENAI_MODELS = {
|
|
10
|
+
GPT_5: "openai/gpt-5-2025-08-07",
|
|
11
|
+
GPT_5_MINI: "openai/gpt-5-mini-2025-08-07",
|
|
12
|
+
GPT_5_NANO: "openai/gpt-5-nano-2025-08-07",
|
|
13
|
+
GPT_4_1: "openai/gpt-4.1-2025-04-14",
|
|
14
|
+
GPT_4_1_MINI: "openai/gpt-4.1-mini-2025-04-14",
|
|
15
|
+
GPT_4_1_NANO: "openai/gpt-4.1-nano-2025-04-14",
|
|
16
|
+
GPT_4O: "gpt-4o",
|
|
17
|
+
GPT_4O_MINI: "gpt-4o-mini",
|
|
18
|
+
GPT_4_TURBO: "gpt-4-turbo",
|
|
19
|
+
GPT_3_5_TURBO: "gpt-3.5-turbo"
|
|
20
|
+
};
|
|
21
|
+
var GOOGLE_MODELS = {
|
|
22
|
+
GEMINI_2_5_PRO: "google/gemini-2.5-pro",
|
|
23
|
+
GEMINI_2_5_FLASH: "google/gemini-2.5-flash",
|
|
24
|
+
GEMINI_2_5_FLASH_LITE: "google/gemini-2.5-flash-lite"
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS };
|