@inkeep/agents-core 0.1.3 → 0.1.6
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/SUPPLEMENTAL_TERMS.md +40 -0
- package/dist/chunk-H2F72PDA.js +15 -0
- package/dist/chunk-M4JXMAG7.js +822 -0
- package/dist/chunk-MKBO26DX.js +9 -0
- package/dist/chunk-RZPLS4MU.js +676 -0
- package/dist/chunk-SVGQSPW4.js +24 -0
- package/dist/client-exports.cjs +246 -0
- package/dist/client-exports.d.cts +315 -0
- package/dist/client-exports.d.ts +64 -49
- package/dist/client-exports.js +201 -246
- package/dist/db/schema.cjs +819 -0
- package/dist/db/schema.d.cts +8 -0
- package/dist/db/schema.d.ts +8 -4337
- package/dist/db/schema.js +1 -696
- package/dist/entities-CNJaf-rG.d.cts +7849 -0
- package/dist/entities-CNJaf-rG.d.ts +7849 -0
- package/dist/index.cjs +9647 -0
- package/dist/index.d.cts +3991 -0
- package/dist/index.d.ts +3991 -12
- package/dist/index.js +7646 -13
- package/dist/schema-DFDqtBpV.d.ts +4401 -0
- package/dist/schema-Dbc3UMpd.d.cts +4401 -0
- package/dist/types/index.cjs +45 -0
- package/dist/types/index.d.cts +125 -0
- package/dist/types/index.d.ts +125 -5
- package/dist/types/index.js +2 -6
- package/dist/validation/index.cjs +1642 -0
- package/dist/validation/index.d.cts +64 -0
- package/dist/validation/index.d.ts +64 -4
- package/dist/validation/index.js +1 -5
- package/package.json +6 -4
- package/dist/__tests__/integration/helpers.d.ts +0 -5
- package/dist/__tests__/integration/helpers.d.ts.map +0 -1
- package/dist/__tests__/integration/helpers.js +0 -37
- package/dist/__tests__/integration/helpers.js.map +0 -1
- package/dist/__tests__/setup.d.ts +0 -3
- package/dist/__tests__/setup.d.ts.map +0 -1
- package/dist/__tests__/setup.js +0 -29
- package/dist/__tests__/setup.js.map +0 -1
- package/dist/client-exports.d.ts.map +0 -1
- package/dist/client-exports.js.map +0 -1
- package/dist/context/ContextConfig.d.ts +0 -54
- package/dist/context/ContextConfig.d.ts.map +0 -1
- package/dist/context/ContextConfig.js +0 -302
- package/dist/context/ContextConfig.js.map +0 -1
- package/dist/context/ContextFetcher.d.ts +0 -64
- package/dist/context/ContextFetcher.d.ts.map +0 -1
- package/dist/context/ContextFetcher.js +0 -325
- package/dist/context/ContextFetcher.js.map +0 -1
- package/dist/context/ContextResolver.d.ts +0 -52
- package/dist/context/ContextResolver.d.ts.map +0 -1
- package/dist/context/ContextResolver.js +0 -298
- package/dist/context/ContextResolver.js.map +0 -1
- package/dist/context/TemplateEngine.d.ts +0 -46
- package/dist/context/TemplateEngine.d.ts.map +0 -1
- package/dist/context/TemplateEngine.js +0 -175
- package/dist/context/TemplateEngine.js.map +0 -1
- package/dist/context/context.d.ts +0 -8
- package/dist/context/context.d.ts.map +0 -1
- package/dist/context/context.js +0 -157
- package/dist/context/context.js.map +0 -1
- package/dist/context/contextCache.d.ts +0 -50
- package/dist/context/contextCache.d.ts.map +0 -1
- package/dist/context/contextCache.js +0 -175
- package/dist/context/contextCache.js.map +0 -1
- package/dist/context/index.d.ts +0 -11
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -8
- package/dist/context/index.js.map +0 -1
- package/dist/credential-stores/CredentialStoreRegistry.d.ts +0 -39
- package/dist/credential-stores/CredentialStoreRegistry.d.ts.map +0 -1
- package/dist/credential-stores/CredentialStoreRegistry.js +0 -65
- package/dist/credential-stores/CredentialStoreRegistry.js.map +0 -1
- package/dist/credential-stores/defaults.d.ts +0 -6
- package/dist/credential-stores/defaults.d.ts.map +0 -1
- package/dist/credential-stores/defaults.js +0 -22
- package/dist/credential-stores/defaults.js.map +0 -1
- package/dist/credential-stores/index.d.ts +0 -6
- package/dist/credential-stores/index.d.ts.map +0 -1
- package/dist/credential-stores/index.js +0 -6
- package/dist/credential-stores/index.js.map +0 -1
- package/dist/credential-stores/keychain-store.d.ts +0 -100
- package/dist/credential-stores/keychain-store.d.ts.map +0 -1
- package/dist/credential-stores/keychain-store.js +0 -225
- package/dist/credential-stores/keychain-store.js.map +0 -1
- package/dist/credential-stores/memory-store.d.ts +0 -39
- package/dist/credential-stores/memory-store.d.ts.map +0 -1
- package/dist/credential-stores/memory-store.js +0 -58
- package/dist/credential-stores/memory-store.js.map +0 -1
- package/dist/credential-stores/nango-store.d.ts +0 -59
- package/dist/credential-stores/nango-store.d.ts.map +0 -1
- package/dist/credential-stores/nango-store.js +0 -264
- package/dist/credential-stores/nango-store.js.map +0 -1
- package/dist/credential-stuffer/CredentialStuffer.d.ts +0 -80
- package/dist/credential-stuffer/CredentialStuffer.d.ts.map +0 -1
- package/dist/credential-stuffer/CredentialStuffer.js +0 -186
- package/dist/credential-stuffer/CredentialStuffer.js.map +0 -1
- package/dist/credential-stuffer/index.d.ts +0 -2
- package/dist/credential-stuffer/index.d.ts.map +0 -1
- package/dist/credential-stuffer/index.js +0 -2
- package/dist/credential-stuffer/index.js.map +0 -1
- package/dist/data-access/agentDataComponents.d.ts +0 -1
- package/dist/data-access/agentDataComponents.d.ts.map +0 -1
- package/dist/data-access/agentDataComponents.js +0 -2
- package/dist/data-access/agentDataComponents.js.map +0 -1
- package/dist/data-access/agentGraphs.d.ts +0 -406
- package/dist/data-access/agentGraphs.d.ts.map +0 -1
- package/dist/data-access/agentGraphs.js +0 -551
- package/dist/data-access/agentGraphs.js.map +0 -1
- package/dist/data-access/agentRelations.d.ts +0 -456
- package/dist/data-access/agentRelations.d.ts.map +0 -1
- package/dist/data-access/agentRelations.js +0 -471
- package/dist/data-access/agentRelations.js.map +0 -1
- package/dist/data-access/agents.d.ts +0 -218
- package/dist/data-access/agents.d.ts.map +0 -1
- package/dist/data-access/agents.js +0 -130
- package/dist/data-access/agents.js.map +0 -1
- package/dist/data-access/apiKeys.d.ts +0 -114
- package/dist/data-access/apiKeys.d.ts.map +0 -1
- package/dist/data-access/apiKeys.js +0 -185
- package/dist/data-access/apiKeys.js.map +0 -1
- package/dist/data-access/artifactComponents.d.ts +0 -152
- package/dist/data-access/artifactComponents.d.ts.map +0 -1
- package/dist/data-access/artifactComponents.js +0 -214
- package/dist/data-access/artifactComponents.js.map +0 -1
- package/dist/data-access/contextCache.d.ts +0 -68
- package/dist/data-access/contextCache.d.ts.map +0 -1
- package/dist/data-access/contextCache.js +0 -160
- package/dist/data-access/contextCache.js.map +0 -1
- package/dist/data-access/contextConfigs.d.ts +0 -110
- package/dist/data-access/contextConfigs.d.ts.map +0 -1
- package/dist/data-access/contextConfigs.js +0 -156
- package/dist/data-access/contextConfigs.js.map +0 -1
- package/dist/data-access/conversations.d.ts +0 -125
- package/dist/data-access/conversations.d.ts.map +0 -1
- package/dist/data-access/conversations.js +0 -244
- package/dist/data-access/conversations.js.map +0 -1
- package/dist/data-access/credentialReferences.d.ts +0 -86
- package/dist/data-access/credentialReferences.d.ts.map +0 -1
- package/dist/data-access/credentialReferences.js +0 -175
- package/dist/data-access/credentialReferences.js.map +0 -1
- package/dist/data-access/dataComponents.d.ts +0 -129
- package/dist/data-access/dataComponents.d.ts.map +0 -1
- package/dist/data-access/dataComponents.js +0 -213
- package/dist/data-access/dataComponents.js.map +0 -1
- package/dist/data-access/externalAgents.d.ts +0 -83
- package/dist/data-access/externalAgents.d.ts.map +0 -1
- package/dist/data-access/externalAgents.js +0 -163
- package/dist/data-access/externalAgents.js.map +0 -1
- package/dist/data-access/graphFull.d.ts +0 -32
- package/dist/data-access/graphFull.d.ts.map +0 -1
- package/dist/data-access/graphFull.js +0 -996
- package/dist/data-access/graphFull.js.map +0 -1
- package/dist/data-access/index.d.ts +0 -21
- package/dist/data-access/index.d.ts.map +0 -1
- package/dist/data-access/index.js +0 -22
- package/dist/data-access/index.js.map +0 -1
- package/dist/data-access/ledgerArtifacts.d.ts +0 -49
- package/dist/data-access/ledgerArtifacts.d.ts.map +0 -1
- package/dist/data-access/ledgerArtifacts.js +0 -112
- package/dist/data-access/ledgerArtifacts.js.map +0 -1
- package/dist/data-access/messages.d.ts +0 -209
- package/dist/data-access/messages.d.ts.map +0 -1
- package/dist/data-access/messages.js +0 -100
- package/dist/data-access/messages.js.map +0 -1
- package/dist/data-access/projects.d.ts +0 -67
- package/dist/data-access/projects.d.ts.map +0 -1
- package/dist/data-access/projects.js +0 -337
- package/dist/data-access/projects.js.map +0 -1
- package/dist/data-access/tasks.d.ts +0 -37
- package/dist/data-access/tasks.d.ts.map +0 -1
- package/dist/data-access/tasks.js +0 -40
- package/dist/data-access/tasks.js.map +0 -1
- package/dist/data-access/tools.d.ts +0 -277
- package/dist/data-access/tools.d.ts.map +0 -1
- package/dist/data-access/tools.js +0 -183
- package/dist/data-access/tools.js.map +0 -1
- package/dist/data-access/validation.d.ts +0 -17
- package/dist/data-access/validation.d.ts.map +0 -1
- package/dist/data-access/validation.js +0 -52
- package/dist/data-access/validation.js.map +0 -1
- package/dist/db/clean.d.ts +0 -6
- package/dist/db/clean.d.ts.map +0 -1
- package/dist/db/clean.js +0 -81
- package/dist/db/clean.js.map +0 -1
- package/dist/db/client.d.ts +0 -19
- package/dist/db/client.d.ts.map +0 -1
- package/dist/db/client.js +0 -24
- package/dist/db/client.js.map +0 -1
- package/dist/db/schema.d.ts.map +0 -1
- package/dist/db/schema.js.map +0 -1
- package/dist/db/test-client.d.ts +0 -25
- package/dist/db/test-client.d.ts.map +0 -1
- package/dist/db/test-client.js +0 -136
- package/dist/db/test-client.js.map +0 -1
- package/dist/env.d.ts +0 -19
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -49
- package/dist/env.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/middleware/contextValidation.d.ts +0 -49
- package/dist/middleware/contextValidation.d.ts.map +0 -1
- package/dist/middleware/contextValidation.js +0 -473
- package/dist/middleware/contextValidation.js.map +0 -1
- package/dist/middleware/index.d.ts +0 -2
- package/dist/middleware/index.d.ts.map +0 -1
- package/dist/middleware/index.js +0 -2
- package/dist/middleware/index.js.map +0 -1
- package/dist/server/BaseServer.d.ts +0 -83
- package/dist/server/BaseServer.d.ts.map +0 -1
- package/dist/server/BaseServer.js +0 -218
- package/dist/server/BaseServer.js.map +0 -1
- package/dist/types/a2a.d.ts +0 -373
- package/dist/types/a2a.d.ts.map +0 -1
- package/dist/types/a2a.js +0 -14
- package/dist/types/a2a.js.map +0 -1
- package/dist/types/entities.d.ts +0 -147
- package/dist/types/entities.d.ts.map +0 -1
- package/dist/types/entities.js +0 -2
- package/dist/types/entities.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/server.d.ts +0 -116
- package/dist/types/server.d.ts.map +0 -1
- package/dist/types/server.js +0 -2
- package/dist/types/server.js.map +0 -1
- package/dist/types/utility.d.ts +0 -213
- package/dist/types/utility.d.ts.map +0 -1
- package/dist/types/utility.js +0 -9
- package/dist/types/utility.js.map +0 -1
- package/dist/utils/apiKeys.d.ts +0 -32
- package/dist/utils/apiKeys.d.ts.map +0 -1
- package/dist/utils/apiKeys.js +0 -117
- package/dist/utils/apiKeys.js.map +0 -1
- package/dist/utils/auth-detection.d.ts +0 -23
- package/dist/utils/auth-detection.d.ts.map +0 -1
- package/dist/utils/auth-detection.js +0 -148
- package/dist/utils/auth-detection.js.map +0 -1
- package/dist/utils/credential-store-utils.d.ts +0 -11
- package/dist/utils/credential-store-utils.d.ts.map +0 -1
- package/dist/utils/credential-store-utils.js +0 -19
- package/dist/utils/credential-store-utils.js.map +0 -1
- package/dist/utils/error.d.ts +0 -526
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/error.js +0 -282
- package/dist/utils/error.js.map +0 -1
- package/dist/utils/execution.d.ts +0 -18
- package/dist/utils/execution.d.ts.map +0 -1
- package/dist/utils/execution.js +0 -25
- package/dist/utils/execution.js.map +0 -1
- package/dist/utils/index.d.ts +0 -9
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -9
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -79
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -102
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/logging.d.ts +0 -11
- package/dist/utils/logging.d.ts.map +0 -1
- package/dist/utils/logging.js +0 -6
- package/dist/utils/logging.js.map +0 -1
- package/dist/utils/mcp-client.d.ts +0 -48
- package/dist/utils/mcp-client.d.ts.map +0 -1
- package/dist/utils/mcp-client.js +0 -171
- package/dist/utils/mcp-client.js.map +0 -1
- package/dist/utils/tracer.d.ts +0 -24
- package/dist/utils/tracer.d.ts.map +0 -1
- package/dist/utils/tracer.js +0 -110
- package/dist/utils/tracer.js.map +0 -1
- package/dist/validation/graphFull.d.ts +0 -36
- package/dist/validation/graphFull.d.ts.map +0 -1
- package/dist/validation/graphFull.js +0 -128
- package/dist/validation/graphFull.js.map +0 -1
- package/dist/validation/id-validation.d.ts +0 -38
- package/dist/validation/id-validation.d.ts.map +0 -1
- package/dist/validation/id-validation.js +0 -60
- package/dist/validation/id-validation.js.map +0 -1
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/schemas.d.ts +0 -7238
- package/dist/validation/schemas.d.ts.map +0 -1
- package/dist/validation/schemas.js +0 -575
- package/dist/validation/schemas.js.map +0 -1
|
@@ -0,0 +1,1642 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var zodOpenapi = require('@hono/zod-openapi');
|
|
4
|
+
var drizzleZod = require('drizzle-zod');
|
|
5
|
+
var drizzleOrm = require('drizzle-orm');
|
|
6
|
+
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
7
|
+
|
|
8
|
+
// src/validation/schemas.ts
|
|
9
|
+
var projects = sqliteCore.sqliteTable(
|
|
10
|
+
"projects",
|
|
11
|
+
{
|
|
12
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
13
|
+
id: sqliteCore.text("id").notNull(),
|
|
14
|
+
// This IS the project ID
|
|
15
|
+
name: sqliteCore.text("name").notNull(),
|
|
16
|
+
description: sqliteCore.text("description").notNull(),
|
|
17
|
+
// Project-level default model settingsuration that can be inherited by graphs and agents
|
|
18
|
+
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
19
|
+
// Project-level stopWhen configuration that can be inherited by graphs and agents
|
|
20
|
+
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
21
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
22
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
23
|
+
},
|
|
24
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
|
|
25
|
+
);
|
|
26
|
+
var contextConfigs = sqliteCore.sqliteTable(
|
|
27
|
+
"context_configs",
|
|
28
|
+
{
|
|
29
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
30
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
31
|
+
id: sqliteCore.text("id").notNull(),
|
|
32
|
+
name: sqliteCore.text("name").notNull(),
|
|
33
|
+
description: sqliteCore.text("description").notNull(),
|
|
34
|
+
// Developer-defined Zod schema for validating incoming request context
|
|
35
|
+
requestContextSchema: sqliteCore.blob("request_context_schema", { mode: "json" }).$type(),
|
|
36
|
+
// Stores serialized Zod schema
|
|
37
|
+
// Object mapping template keys to fetch definitions that use request context data
|
|
38
|
+
contextVariables: sqliteCore.blob("context_variables", { mode: "json" }).$type(),
|
|
39
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
40
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
41
|
+
},
|
|
42
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
43
|
+
);
|
|
44
|
+
var contextCache = sqliteCore.sqliteTable(
|
|
45
|
+
"context_cache",
|
|
46
|
+
{
|
|
47
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
48
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
49
|
+
id: sqliteCore.text("id").notNull(),
|
|
50
|
+
// Always scoped to conversation for complete data isolation
|
|
51
|
+
conversationId: sqliteCore.text("conversation_id").notNull(),
|
|
52
|
+
// Reference to the context config and specific fetch definition
|
|
53
|
+
contextConfigId: sqliteCore.text("context_config_id").notNull(),
|
|
54
|
+
contextVariableKey: sqliteCore.text("context_variable_key").notNull(),
|
|
55
|
+
// Key from contextVariables object
|
|
56
|
+
// The actual cached context data
|
|
57
|
+
value: sqliteCore.blob("value", { mode: "json" }).$type().notNull(),
|
|
58
|
+
// Request hash for cache invalidation based on context changes
|
|
59
|
+
requestHash: sqliteCore.text("request_hash"),
|
|
60
|
+
// Hash of request context that triggered this cache
|
|
61
|
+
// Metadata for monitoring and debugging
|
|
62
|
+
fetchedAt: sqliteCore.text("fetched_at").notNull(),
|
|
63
|
+
fetchSource: sqliteCore.text("fetch_source"),
|
|
64
|
+
// URL or source identifier
|
|
65
|
+
fetchDurationMs: sqliteCore.integer("fetch_duration_ms"),
|
|
66
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
67
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
68
|
+
},
|
|
69
|
+
(table) => [
|
|
70
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
71
|
+
sqliteCore.index("context_cache_lookup_idx").on(
|
|
72
|
+
table.conversationId,
|
|
73
|
+
table.contextConfigId,
|
|
74
|
+
table.contextVariableKey
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
);
|
|
78
|
+
var agents = sqliteCore.sqliteTable(
|
|
79
|
+
"agents",
|
|
80
|
+
{
|
|
81
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
82
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
83
|
+
id: sqliteCore.text("id").notNull(),
|
|
84
|
+
name: sqliteCore.text("name").notNull(),
|
|
85
|
+
description: sqliteCore.text("description").notNull(),
|
|
86
|
+
prompt: sqliteCore.text("prompt").notNull(),
|
|
87
|
+
conversationHistoryConfig: sqliteCore.text("conversation_history_config", {
|
|
88
|
+
mode: "json"
|
|
89
|
+
}).$type(),
|
|
90
|
+
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
91
|
+
// Agent-level stopWhen configuration (inherited from project)
|
|
92
|
+
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
93
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
94
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
95
|
+
},
|
|
96
|
+
(table) => [
|
|
97
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
98
|
+
sqliteCore.foreignKey({
|
|
99
|
+
columns: [table.tenantId, table.projectId],
|
|
100
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
101
|
+
name: "agents_project_fk"
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
);
|
|
105
|
+
var agentRelations = sqliteCore.sqliteTable(
|
|
106
|
+
"agent_relations",
|
|
107
|
+
{
|
|
108
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
109
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
110
|
+
id: sqliteCore.text("id").notNull(),
|
|
111
|
+
graphId: sqliteCore.text("graph_id").notNull(),
|
|
112
|
+
sourceAgentId: sqliteCore.text("source_agent_id").notNull(),
|
|
113
|
+
// For internal relationships
|
|
114
|
+
targetAgentId: sqliteCore.text("target_agent_id"),
|
|
115
|
+
// For external relationships
|
|
116
|
+
externalAgentId: sqliteCore.text("external_agent_id"),
|
|
117
|
+
relationType: sqliteCore.text("relation_type"),
|
|
118
|
+
// 'transfer' | 'delegate'
|
|
119
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
120
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
121
|
+
},
|
|
122
|
+
(table) => [
|
|
123
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
124
|
+
sqliteCore.foreignKey({
|
|
125
|
+
columns: [table.tenantId, table.projectId],
|
|
126
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
127
|
+
name: "agent_relations_project_fk"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
);
|
|
131
|
+
var externalAgents = sqliteCore.sqliteTable(
|
|
132
|
+
"external_agents",
|
|
133
|
+
{
|
|
134
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
135
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
136
|
+
id: sqliteCore.text("id").notNull(),
|
|
137
|
+
name: sqliteCore.text("name").notNull(),
|
|
138
|
+
description: sqliteCore.text("description").notNull(),
|
|
139
|
+
baseUrl: sqliteCore.text("base_url").notNull(),
|
|
140
|
+
// A2A endpoint URL
|
|
141
|
+
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
142
|
+
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
143
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
144
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
145
|
+
},
|
|
146
|
+
(table) => [
|
|
147
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
148
|
+
sqliteCore.foreignKey({
|
|
149
|
+
columns: [table.tenantId, table.projectId, table.credentialReferenceId],
|
|
150
|
+
foreignColumns: [
|
|
151
|
+
credentialReferences.tenantId,
|
|
152
|
+
credentialReferences.projectId,
|
|
153
|
+
credentialReferences.id
|
|
154
|
+
],
|
|
155
|
+
name: "external_agents_credential_reference_fk"
|
|
156
|
+
}).onDelete("set null")
|
|
157
|
+
]
|
|
158
|
+
);
|
|
159
|
+
var agentGraph = sqliteCore.sqliteTable(
|
|
160
|
+
"agent_graph",
|
|
161
|
+
{
|
|
162
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
163
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
164
|
+
id: sqliteCore.text("id").notNull(),
|
|
165
|
+
name: sqliteCore.text("name").notNull(),
|
|
166
|
+
description: sqliteCore.text("description"),
|
|
167
|
+
defaultAgentId: sqliteCore.text("default_agent_id").notNull(),
|
|
168
|
+
// Reference to shared context configuration for all agents in this graph
|
|
169
|
+
contextConfigId: sqliteCore.text("context_config_id"),
|
|
170
|
+
// Graph-level model settingsuration that can be inherited by agents
|
|
171
|
+
models: sqliteCore.text("models", { mode: "json" }).$type(),
|
|
172
|
+
// Status updates configuration for intelligent progress summaries
|
|
173
|
+
statusUpdates: sqliteCore.text("status_updates", { mode: "json" }).$type(),
|
|
174
|
+
// Graph-level prompt that can be used as additional context for agents
|
|
175
|
+
graphPrompt: sqliteCore.text("graph_prompt"),
|
|
176
|
+
// Graph-level stopWhen configuration that can be inherited by agents
|
|
177
|
+
stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
|
|
178
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
179
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
180
|
+
},
|
|
181
|
+
(table) => [
|
|
182
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
183
|
+
sqliteCore.foreignKey({
|
|
184
|
+
columns: [table.tenantId, table.projectId],
|
|
185
|
+
foreignColumns: [projects.tenantId, projects.id],
|
|
186
|
+
name: "agent_graph_project_fk"
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
);
|
|
190
|
+
var tasks = sqliteCore.sqliteTable(
|
|
191
|
+
"tasks",
|
|
192
|
+
{
|
|
193
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
194
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
195
|
+
id: sqliteCore.text("id").notNull(),
|
|
196
|
+
contextId: sqliteCore.text("context_id").notNull(),
|
|
197
|
+
status: sqliteCore.text("status").notNull(),
|
|
198
|
+
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
199
|
+
agentId: sqliteCore.text("agent_id").notNull(),
|
|
200
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
201
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
202
|
+
},
|
|
203
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
204
|
+
);
|
|
205
|
+
var taskRelations = sqliteCore.sqliteTable(
|
|
206
|
+
"task_relations",
|
|
207
|
+
{
|
|
208
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
209
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
210
|
+
id: sqliteCore.text("id").notNull(),
|
|
211
|
+
parentTaskId: sqliteCore.text("parent_task_id").notNull(),
|
|
212
|
+
childTaskId: sqliteCore.text("child_task_id").notNull(),
|
|
213
|
+
relationType: sqliteCore.text("relation_type").default("parent_child"),
|
|
214
|
+
// Could be extended for other relation types
|
|
215
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
216
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
217
|
+
},
|
|
218
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
219
|
+
);
|
|
220
|
+
var dataComponents = sqliteCore.sqliteTable(
|
|
221
|
+
"data_components",
|
|
222
|
+
{
|
|
223
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
224
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
225
|
+
id: sqliteCore.text("id").notNull(),
|
|
226
|
+
name: sqliteCore.text("name").notNull(),
|
|
227
|
+
description: sqliteCore.text("description").notNull(),
|
|
228
|
+
props: sqliteCore.blob("props", { mode: "json" }).$type(),
|
|
229
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
230
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
231
|
+
},
|
|
232
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
233
|
+
);
|
|
234
|
+
var agentDataComponents = sqliteCore.sqliteTable(
|
|
235
|
+
"agent_data_components",
|
|
236
|
+
{
|
|
237
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
238
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
239
|
+
id: sqliteCore.text("id").notNull(),
|
|
240
|
+
agentId: sqliteCore.text("agent_id").notNull(),
|
|
241
|
+
dataComponentId: sqliteCore.text("data_component_id").notNull(),
|
|
242
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
243
|
+
},
|
|
244
|
+
(table) => [
|
|
245
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
246
|
+
// Foreign key constraint to agents table
|
|
247
|
+
sqliteCore.foreignKey({
|
|
248
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
249
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
250
|
+
name: "agent_data_components_agent_fk"
|
|
251
|
+
}).onDelete("cascade"),
|
|
252
|
+
// Foreign key constraint to data_components table
|
|
253
|
+
sqliteCore.foreignKey({
|
|
254
|
+
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
255
|
+
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
256
|
+
name: "agent_data_components_data_component_fk"
|
|
257
|
+
}).onDelete("cascade")
|
|
258
|
+
]
|
|
259
|
+
);
|
|
260
|
+
var artifactComponents = sqliteCore.sqliteTable(
|
|
261
|
+
"artifact_components",
|
|
262
|
+
{
|
|
263
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
264
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
265
|
+
id: sqliteCore.text("id").notNull(),
|
|
266
|
+
name: sqliteCore.text("name").notNull(),
|
|
267
|
+
description: sqliteCore.text("description").notNull(),
|
|
268
|
+
summaryProps: sqliteCore.blob("summary_props", { mode: "json" }).$type(),
|
|
269
|
+
fullProps: sqliteCore.blob("full_props", { mode: "json" }).$type(),
|
|
270
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
271
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
272
|
+
},
|
|
273
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
274
|
+
);
|
|
275
|
+
var agentArtifactComponents = sqliteCore.sqliteTable(
|
|
276
|
+
"agent_artifact_components",
|
|
277
|
+
{
|
|
278
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
279
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
280
|
+
id: sqliteCore.text("id").notNull(),
|
|
281
|
+
agentId: sqliteCore.text("agent_id").notNull(),
|
|
282
|
+
artifactComponentId: sqliteCore.text("artifact_component_id").notNull(),
|
|
283
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
284
|
+
},
|
|
285
|
+
(table) => [
|
|
286
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
287
|
+
// Foreign key constraint to agents table
|
|
288
|
+
sqliteCore.foreignKey({
|
|
289
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
290
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
291
|
+
name: "agent_artifact_components_agent_fk"
|
|
292
|
+
}).onDelete("cascade"),
|
|
293
|
+
// Foreign key constraint to artifact_components table
|
|
294
|
+
sqliteCore.foreignKey({
|
|
295
|
+
columns: [table.tenantId, table.projectId, table.artifactComponentId],
|
|
296
|
+
foreignColumns: [
|
|
297
|
+
artifactComponents.tenantId,
|
|
298
|
+
artifactComponents.projectId,
|
|
299
|
+
artifactComponents.id
|
|
300
|
+
],
|
|
301
|
+
name: "agent_artifact_components_artifact_component_fk"
|
|
302
|
+
}).onDelete("cascade")
|
|
303
|
+
]
|
|
304
|
+
);
|
|
305
|
+
var tools = sqliteCore.sqliteTable(
|
|
306
|
+
"tools",
|
|
307
|
+
{
|
|
308
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
309
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
310
|
+
id: sqliteCore.text("id").notNull(),
|
|
311
|
+
name: sqliteCore.text("name").notNull(),
|
|
312
|
+
// Enhanced MCP configuration
|
|
313
|
+
config: sqliteCore.blob("config", { mode: "json" }).$type().notNull(),
|
|
314
|
+
credentialReferenceId: sqliteCore.text("credential_reference_id"),
|
|
315
|
+
headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
|
|
316
|
+
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
317
|
+
imageUrl: sqliteCore.text("image_url"),
|
|
318
|
+
// Server capabilities and status
|
|
319
|
+
capabilities: sqliteCore.blob("capabilities", { mode: "json" }).$type(),
|
|
320
|
+
// Connection health and monitoring
|
|
321
|
+
status: sqliteCore.text("status").notNull().default("unknown"),
|
|
322
|
+
lastHealthCheck: sqliteCore.text("last_health_check"),
|
|
323
|
+
lastError: sqliteCore.text("last_error"),
|
|
324
|
+
// Tool discovery cache
|
|
325
|
+
availableTools: sqliteCore.blob("available_tools", { mode: "json" }).$type(),
|
|
326
|
+
lastToolsSync: sqliteCore.text("last_tools_sync"),
|
|
327
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
328
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
329
|
+
},
|
|
330
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
331
|
+
);
|
|
332
|
+
var agentToolRelations = sqliteCore.sqliteTable(
|
|
333
|
+
"agent_tool_relations",
|
|
334
|
+
{
|
|
335
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
336
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
337
|
+
id: sqliteCore.text("id").notNull(),
|
|
338
|
+
agentId: sqliteCore.text("agent_id").notNull(),
|
|
339
|
+
toolId: sqliteCore.text("tool_id").notNull(),
|
|
340
|
+
selectedTools: sqliteCore.blob("selected_tools", { mode: "json" }).$type(),
|
|
341
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
342
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
343
|
+
},
|
|
344
|
+
(table) => [
|
|
345
|
+
sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
346
|
+
// Foreign key constraint to agents table
|
|
347
|
+
sqliteCore.foreignKey({
|
|
348
|
+
columns: [table.tenantId, table.projectId, table.agentId],
|
|
349
|
+
foreignColumns: [agents.tenantId, agents.projectId, agents.id],
|
|
350
|
+
name: "agent_tool_relations_agent_fk"
|
|
351
|
+
}).onDelete("cascade"),
|
|
352
|
+
// Foreign key constraint to tools table
|
|
353
|
+
sqliteCore.foreignKey({
|
|
354
|
+
columns: [table.tenantId, table.projectId, table.toolId],
|
|
355
|
+
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
356
|
+
name: "agent_tool_relations_tool_fk"
|
|
357
|
+
}).onDelete("cascade")
|
|
358
|
+
]
|
|
359
|
+
);
|
|
360
|
+
var conversations = sqliteCore.sqliteTable(
|
|
361
|
+
"conversations",
|
|
362
|
+
{
|
|
363
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
364
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
365
|
+
id: sqliteCore.text("id").notNull(),
|
|
366
|
+
userId: sqliteCore.text("user_id"),
|
|
367
|
+
activeAgentId: sqliteCore.text("active_agent_id").notNull(),
|
|
368
|
+
title: sqliteCore.text("title"),
|
|
369
|
+
lastContextResolution: sqliteCore.text("last_context_resolution"),
|
|
370
|
+
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
371
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
372
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
373
|
+
},
|
|
374
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
375
|
+
);
|
|
376
|
+
var messages = sqliteCore.sqliteTable(
|
|
377
|
+
"messages",
|
|
378
|
+
{
|
|
379
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
380
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
381
|
+
id: sqliteCore.text("id").notNull(),
|
|
382
|
+
conversationId: sqliteCore.text("conversation_id").notNull(),
|
|
383
|
+
// Role mapping: user, agent, system (unified for both formats)
|
|
384
|
+
role: sqliteCore.text("role").notNull(),
|
|
385
|
+
// 'user' | 'agent' | 'system'
|
|
386
|
+
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
387
|
+
fromAgentId: sqliteCore.text("from_agent_id"),
|
|
388
|
+
// Populated when message is from an agent
|
|
389
|
+
toAgentId: sqliteCore.text("to_agent_id"),
|
|
390
|
+
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
391
|
+
// External agent sender tracking
|
|
392
|
+
fromExternalAgentId: sqliteCore.text("from_external_agent_id"),
|
|
393
|
+
// Populated when message is directed from an external agent
|
|
394
|
+
// External agent recipient tracking
|
|
395
|
+
toExternalAgentId: sqliteCore.text("to_external_agent_id"),
|
|
396
|
+
// Populated when message is directed to an external agent
|
|
397
|
+
// Message content stored as JSON to support both formats
|
|
398
|
+
content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
|
|
399
|
+
// Message classification and filtering
|
|
400
|
+
visibility: sqliteCore.text("visibility").notNull().default("user-facing"),
|
|
401
|
+
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
402
|
+
messageType: sqliteCore.text("message_type").notNull().default("chat"),
|
|
403
|
+
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
404
|
+
// Legacy agent association (consider deprecating in favor of fromAgentId/toAgentId)
|
|
405
|
+
agentId: sqliteCore.text("agent_id"),
|
|
406
|
+
taskId: sqliteCore.text("task_id"),
|
|
407
|
+
parentMessageId: sqliteCore.text("parent_message_id"),
|
|
408
|
+
// Remove self-reference constraint here
|
|
409
|
+
// A2A specific fields
|
|
410
|
+
a2aTaskId: sqliteCore.text("a2a_task_id"),
|
|
411
|
+
// Links to A2A task when relevant
|
|
412
|
+
a2aSessionId: sqliteCore.text("a2a_session_id"),
|
|
413
|
+
// A2A session identifier
|
|
414
|
+
// Metadata for extensions
|
|
415
|
+
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
416
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
417
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
418
|
+
},
|
|
419
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
420
|
+
);
|
|
421
|
+
var ledgerArtifacts = sqliteCore.sqliteTable(
|
|
422
|
+
"ledger_artifacts",
|
|
423
|
+
{
|
|
424
|
+
// Primary identifier (maps to `artifactId`)
|
|
425
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
426
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
427
|
+
id: sqliteCore.text("id").notNull(),
|
|
428
|
+
// Links
|
|
429
|
+
taskId: sqliteCore.text("task_id"),
|
|
430
|
+
contextId: sqliteCore.text("context_id").notNull(),
|
|
431
|
+
// Core Artifact fields
|
|
432
|
+
type: sqliteCore.text("type").notNull().default("source"),
|
|
433
|
+
name: sqliteCore.text("name"),
|
|
434
|
+
description: sqliteCore.text("description"),
|
|
435
|
+
parts: sqliteCore.blob("parts", { mode: "json" }).$type(),
|
|
436
|
+
metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
|
|
437
|
+
// Extra ledger information (not part of the Artifact spec – kept optional)
|
|
438
|
+
summary: sqliteCore.text("summary"),
|
|
439
|
+
mime: sqliteCore.blob("mime", { mode: "json" }).$type(),
|
|
440
|
+
visibility: sqliteCore.text("visibility").default("context"),
|
|
441
|
+
allowedAgents: sqliteCore.blob("allowed_agents", { mode: "json" }).$type(),
|
|
442
|
+
derivedFrom: sqliteCore.text("derived_from"),
|
|
443
|
+
// Timestamps
|
|
444
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
445
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
446
|
+
},
|
|
447
|
+
(table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] })]
|
|
448
|
+
);
|
|
449
|
+
var apiKeys = sqliteCore.sqliteTable(
|
|
450
|
+
"api_keys",
|
|
451
|
+
{
|
|
452
|
+
id: sqliteCore.text("id").primaryKey(),
|
|
453
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
454
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
455
|
+
graphId: sqliteCore.text("graph_id").notNull(),
|
|
456
|
+
publicId: sqliteCore.text("public_id").notNull().unique(),
|
|
457
|
+
// Public ID for O(1) lookup (e.g., "abc123def456")
|
|
458
|
+
keyHash: sqliteCore.text("key_hash").notNull(),
|
|
459
|
+
// Hashed API key (never store plaintext)
|
|
460
|
+
keyPrefix: sqliteCore.text("key_prefix").notNull(),
|
|
461
|
+
// First 8 chars for identification (e.g., "sk_live_abc...")
|
|
462
|
+
lastUsedAt: sqliteCore.text("last_used_at"),
|
|
463
|
+
expiresAt: sqliteCore.text("expires_at"),
|
|
464
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
465
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
466
|
+
},
|
|
467
|
+
(t) => [
|
|
468
|
+
sqliteCore.foreignKey({
|
|
469
|
+
columns: [t.tenantId, t.projectId, t.graphId],
|
|
470
|
+
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
471
|
+
name: "api_keys_graph_fk"
|
|
472
|
+
}).onDelete("cascade"),
|
|
473
|
+
sqliteCore.index("api_keys_tenant_graph_idx").on(t.tenantId, t.graphId),
|
|
474
|
+
sqliteCore.index("api_keys_prefix_idx").on(t.keyPrefix),
|
|
475
|
+
sqliteCore.index("api_keys_public_id_idx").on(t.publicId)
|
|
476
|
+
]
|
|
477
|
+
);
|
|
478
|
+
var credentialReferences = sqliteCore.sqliteTable(
|
|
479
|
+
"credential_references",
|
|
480
|
+
{
|
|
481
|
+
tenantId: sqliteCore.text("tenant_id").notNull(),
|
|
482
|
+
projectId: sqliteCore.text("project_id").notNull(),
|
|
483
|
+
id: sqliteCore.text("id").notNull(),
|
|
484
|
+
type: sqliteCore.text("type").notNull(),
|
|
485
|
+
// Implementation type: 'keychain', 'nango', 'memory', etc.
|
|
486
|
+
credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
|
|
487
|
+
// Maps to framework.getCredentialStore(id)
|
|
488
|
+
retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
|
|
489
|
+
createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
|
|
490
|
+
updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
|
|
491
|
+
},
|
|
492
|
+
(t) => [sqliteCore.primaryKey({ columns: [t.tenantId, t.projectId, t.id] })]
|
|
493
|
+
);
|
|
494
|
+
sqliteCore.index("ledger_artifacts_task_id_idx").on(
|
|
495
|
+
ledgerArtifacts.taskId
|
|
496
|
+
);
|
|
497
|
+
sqliteCore.index("ledger_artifacts_context_id_idx").on(
|
|
498
|
+
ledgerArtifacts.contextId
|
|
499
|
+
);
|
|
500
|
+
sqliteCore.unique(
|
|
501
|
+
"ledger_artifacts_task_context_name_unique"
|
|
502
|
+
).on(ledgerArtifacts.taskId, ledgerArtifacts.contextId, ledgerArtifacts.name);
|
|
503
|
+
drizzleOrm.relations(tasks, ({ one, many }) => ({
|
|
504
|
+
// A task belongs to one project
|
|
505
|
+
project: one(projects, {
|
|
506
|
+
fields: [tasks.tenantId, tasks.projectId],
|
|
507
|
+
references: [projects.tenantId, projects.id]
|
|
508
|
+
}),
|
|
509
|
+
// A task can have many parent relationships (where it's the child)
|
|
510
|
+
parentRelations: many(taskRelations, {
|
|
511
|
+
relationName: "childTask"
|
|
512
|
+
}),
|
|
513
|
+
// A task can have many child relationships (where it's the parent)
|
|
514
|
+
childRelations: many(taskRelations, {
|
|
515
|
+
relationName: "parentTask"
|
|
516
|
+
}),
|
|
517
|
+
// A task belongs to one agent
|
|
518
|
+
agent: one(agents, {
|
|
519
|
+
fields: [tasks.agentId],
|
|
520
|
+
references: [agents.id]
|
|
521
|
+
}),
|
|
522
|
+
// A task can have many messages associated with it
|
|
523
|
+
messages: many(messages)
|
|
524
|
+
}));
|
|
525
|
+
drizzleOrm.relations(projects, ({ many }) => ({
|
|
526
|
+
// A project can have many agents
|
|
527
|
+
agents: many(agents),
|
|
528
|
+
// A project can have many agent graphs
|
|
529
|
+
agentGraphs: many(agentGraph),
|
|
530
|
+
// A project can have many tools
|
|
531
|
+
tools: many(tools),
|
|
532
|
+
// A project can have many context configs
|
|
533
|
+
contextConfigs: many(contextConfigs),
|
|
534
|
+
// A project can have many external agents
|
|
535
|
+
externalAgents: many(externalAgents),
|
|
536
|
+
// A project can have many conversations
|
|
537
|
+
conversations: many(conversations),
|
|
538
|
+
// A project can have many tasks
|
|
539
|
+
tasks: many(tasks)
|
|
540
|
+
}));
|
|
541
|
+
drizzleOrm.relations(taskRelations, ({ one }) => ({
|
|
542
|
+
// Each relation has one parent task
|
|
543
|
+
parentTask: one(tasks, {
|
|
544
|
+
fields: [taskRelations.parentTaskId],
|
|
545
|
+
references: [tasks.id],
|
|
546
|
+
relationName: "parentTask"
|
|
547
|
+
}),
|
|
548
|
+
// Each relation has one child task
|
|
549
|
+
childTask: one(tasks, {
|
|
550
|
+
fields: [taskRelations.childTaskId],
|
|
551
|
+
references: [tasks.id],
|
|
552
|
+
relationName: "childTask"
|
|
553
|
+
})
|
|
554
|
+
}));
|
|
555
|
+
drizzleOrm.relations(contextConfigs, ({ many, one }) => ({
|
|
556
|
+
// A context config belongs to one project
|
|
557
|
+
project: one(projects, {
|
|
558
|
+
fields: [contextConfigs.tenantId, contextConfigs.projectId],
|
|
559
|
+
references: [projects.tenantId, projects.id]
|
|
560
|
+
}),
|
|
561
|
+
// A context config can be used by many agent graphs
|
|
562
|
+
graphs: many(agentGraph),
|
|
563
|
+
// A context config can have many cached entries
|
|
564
|
+
cache: many(contextCache)
|
|
565
|
+
}));
|
|
566
|
+
drizzleOrm.relations(contextCache, ({ one }) => ({
|
|
567
|
+
// Each cache entry belongs to one context config
|
|
568
|
+
contextConfig: one(contextConfigs, {
|
|
569
|
+
fields: [contextCache.contextConfigId],
|
|
570
|
+
references: [contextConfigs.id]
|
|
571
|
+
})
|
|
572
|
+
}));
|
|
573
|
+
drizzleOrm.relations(agents, ({ many, one }) => ({
|
|
574
|
+
// A context config belongs to one project
|
|
575
|
+
project: one(projects, {
|
|
576
|
+
fields: [agents.tenantId, agents.projectId],
|
|
577
|
+
references: [projects.tenantId, projects.id]
|
|
578
|
+
}),
|
|
579
|
+
// An agent can have many tasks
|
|
580
|
+
tasks: many(tasks),
|
|
581
|
+
// An agent can be the default agent for many graphs
|
|
582
|
+
defaultForGraphs: many(agentGraph),
|
|
583
|
+
// Agent relation tracking
|
|
584
|
+
sourceRelations: many(agentRelations, {
|
|
585
|
+
relationName: "sourceRelations"
|
|
586
|
+
}),
|
|
587
|
+
targetRelations: many(agentRelations, {
|
|
588
|
+
relationName: "targetRelations"
|
|
589
|
+
}),
|
|
590
|
+
// Message tracking relations
|
|
591
|
+
sentMessages: many(messages, {
|
|
592
|
+
relationName: "sentMessages"
|
|
593
|
+
}),
|
|
594
|
+
receivedMessages: many(messages, {
|
|
595
|
+
relationName: "receivedMessages"
|
|
596
|
+
}),
|
|
597
|
+
// Legacy message association (consider deprecating)
|
|
598
|
+
associatedMessages: many(messages, {
|
|
599
|
+
relationName: "associatedAgent"
|
|
600
|
+
}),
|
|
601
|
+
toolRelations: many(agentToolRelations)
|
|
602
|
+
}));
|
|
603
|
+
drizzleOrm.relations(agentGraph, ({ one }) => ({
|
|
604
|
+
// An agent graph belongs to one project
|
|
605
|
+
project: one(projects, {
|
|
606
|
+
fields: [agentGraph.tenantId, agentGraph.projectId],
|
|
607
|
+
references: [projects.tenantId, projects.id]
|
|
608
|
+
}),
|
|
609
|
+
// An agent graph belongs to one default agent
|
|
610
|
+
defaultAgent: one(agents, {
|
|
611
|
+
fields: [agentGraph.defaultAgentId],
|
|
612
|
+
references: [agents.id]
|
|
613
|
+
}),
|
|
614
|
+
// An agent graph can reference one context config
|
|
615
|
+
contextConfig: one(contextConfigs, {
|
|
616
|
+
fields: [agentGraph.contextConfigId],
|
|
617
|
+
references: [contextConfigs.id]
|
|
618
|
+
})
|
|
619
|
+
}));
|
|
620
|
+
drizzleOrm.relations(externalAgents, ({ one, many }) => ({
|
|
621
|
+
// An external agent belongs to one project
|
|
622
|
+
project: one(projects, {
|
|
623
|
+
fields: [externalAgents.tenantId, externalAgents.projectId],
|
|
624
|
+
references: [projects.tenantId, projects.id]
|
|
625
|
+
}),
|
|
626
|
+
// An external agent can be referenced by many agent relations
|
|
627
|
+
agentRelations: many(agentRelations),
|
|
628
|
+
// An external agent may have one credential reference
|
|
629
|
+
credentialReference: one(credentialReferences, {
|
|
630
|
+
fields: [externalAgents.credentialReferenceId],
|
|
631
|
+
references: [credentialReferences.id]
|
|
632
|
+
})
|
|
633
|
+
}));
|
|
634
|
+
drizzleOrm.relations(apiKeys, ({ one }) => ({
|
|
635
|
+
// An API key belongs to one project
|
|
636
|
+
project: one(projects, {
|
|
637
|
+
fields: [apiKeys.tenantId, apiKeys.projectId],
|
|
638
|
+
references: [projects.tenantId, projects.id]
|
|
639
|
+
}),
|
|
640
|
+
// An API key belongs to one tenant and graph
|
|
641
|
+
graph: one(agentGraph, {
|
|
642
|
+
fields: [apiKeys.graphId],
|
|
643
|
+
references: [agentGraph.id]
|
|
644
|
+
})
|
|
645
|
+
}));
|
|
646
|
+
drizzleOrm.relations(agentToolRelations, ({ one }) => ({
|
|
647
|
+
// An agent-tool relation belongs to one agent
|
|
648
|
+
agent: one(agents, {
|
|
649
|
+
fields: [agentToolRelations.agentId],
|
|
650
|
+
references: [agents.id]
|
|
651
|
+
}),
|
|
652
|
+
// An agent-tool relation belongs to one tool
|
|
653
|
+
tool: one(tools, {
|
|
654
|
+
fields: [agentToolRelations.toolId],
|
|
655
|
+
references: [tools.id]
|
|
656
|
+
})
|
|
657
|
+
}));
|
|
658
|
+
drizzleOrm.relations(credentialReferences, ({ many }) => ({
|
|
659
|
+
tools: many(tools)
|
|
660
|
+
}));
|
|
661
|
+
drizzleOrm.relations(tools, ({ one, many }) => ({
|
|
662
|
+
// A tool belongs to one project
|
|
663
|
+
project: one(projects, {
|
|
664
|
+
fields: [tools.tenantId, tools.projectId],
|
|
665
|
+
references: [projects.tenantId, projects.id]
|
|
666
|
+
}),
|
|
667
|
+
// A tool can be used by many agents through agent-tool relations
|
|
668
|
+
agentRelations: many(agentToolRelations),
|
|
669
|
+
// A tool may have one credential reference
|
|
670
|
+
credentialReference: one(credentialReferences, {
|
|
671
|
+
fields: [tools.credentialReferenceId],
|
|
672
|
+
references: [credentialReferences.id]
|
|
673
|
+
})
|
|
674
|
+
}));
|
|
675
|
+
drizzleOrm.relations(conversations, ({ one, many }) => ({
|
|
676
|
+
// A conversation belongs to one project
|
|
677
|
+
project: one(projects, {
|
|
678
|
+
fields: [conversations.tenantId, conversations.projectId],
|
|
679
|
+
references: [projects.tenantId, projects.id]
|
|
680
|
+
}),
|
|
681
|
+
// A conversation has many messages
|
|
682
|
+
messages: many(messages),
|
|
683
|
+
// A conversation has one active agent
|
|
684
|
+
activeAgent: one(agents, {
|
|
685
|
+
fields: [conversations.activeAgentId],
|
|
686
|
+
references: [agents.id]
|
|
687
|
+
})
|
|
688
|
+
}));
|
|
689
|
+
drizzleOrm.relations(messages, ({ one, many }) => ({
|
|
690
|
+
// A message belongs to one conversation
|
|
691
|
+
conversation: one(conversations, {
|
|
692
|
+
fields: [messages.conversationId],
|
|
693
|
+
references: [conversations.id]
|
|
694
|
+
}),
|
|
695
|
+
// Legacy agent association (consider deprecating)
|
|
696
|
+
agent: one(agents, {
|
|
697
|
+
fields: [messages.agentId],
|
|
698
|
+
references: [agents.id],
|
|
699
|
+
relationName: "associatedAgent"
|
|
700
|
+
}),
|
|
701
|
+
// Sender tracking relations
|
|
702
|
+
fromAgent: one(agents, {
|
|
703
|
+
fields: [messages.fromAgentId],
|
|
704
|
+
references: [agents.id],
|
|
705
|
+
relationName: "sentMessages"
|
|
706
|
+
}),
|
|
707
|
+
// Recipient tracking relations
|
|
708
|
+
toAgent: one(agents, {
|
|
709
|
+
fields: [messages.toAgentId],
|
|
710
|
+
references: [agents.id],
|
|
711
|
+
relationName: "receivedMessages"
|
|
712
|
+
}),
|
|
713
|
+
// External agent sender tracking relations
|
|
714
|
+
fromExternalAgent: one(externalAgents, {
|
|
715
|
+
fields: [messages.fromExternalAgentId],
|
|
716
|
+
references: [externalAgents.id],
|
|
717
|
+
relationName: "receivedExternalMessages"
|
|
718
|
+
}),
|
|
719
|
+
// External agent recipient tracking relations
|
|
720
|
+
toExternalAgent: one(externalAgents, {
|
|
721
|
+
fields: [messages.toExternalAgentId],
|
|
722
|
+
references: [externalAgents.id],
|
|
723
|
+
relationName: "sentExternalMessages"
|
|
724
|
+
}),
|
|
725
|
+
// A message may be associated with a task
|
|
726
|
+
task: one(tasks, {
|
|
727
|
+
fields: [messages.taskId],
|
|
728
|
+
references: [tasks.id]
|
|
729
|
+
}),
|
|
730
|
+
// A message may have a parent message (for threading)
|
|
731
|
+
parentMessage: one(messages, {
|
|
732
|
+
fields: [messages.parentMessageId],
|
|
733
|
+
references: [messages.id],
|
|
734
|
+
relationName: "parentChild"
|
|
735
|
+
}),
|
|
736
|
+
// A message may have child messages
|
|
737
|
+
childMessages: many(messages, {
|
|
738
|
+
relationName: "parentChild"
|
|
739
|
+
})
|
|
740
|
+
}));
|
|
741
|
+
drizzleOrm.relations(artifactComponents, ({ many }) => ({
|
|
742
|
+
// An artifact component can be associated with many agents
|
|
743
|
+
agentRelations: many(agentArtifactComponents)
|
|
744
|
+
}));
|
|
745
|
+
drizzleOrm.relations(agentArtifactComponents, ({ one }) => ({
|
|
746
|
+
// An agent-artifact component relation belongs to one agent
|
|
747
|
+
agent: one(agents, {
|
|
748
|
+
fields: [agentArtifactComponents.agentId],
|
|
749
|
+
references: [agents.id]
|
|
750
|
+
}),
|
|
751
|
+
// An agent-artifact component relation belongs to one artifact component
|
|
752
|
+
artifactComponent: one(artifactComponents, {
|
|
753
|
+
fields: [agentArtifactComponents.artifactComponentId],
|
|
754
|
+
references: [artifactComponents.id]
|
|
755
|
+
})
|
|
756
|
+
}));
|
|
757
|
+
drizzleOrm.relations(agentRelations, ({ one }) => ({
|
|
758
|
+
// An agent relation belongs to one graph
|
|
759
|
+
graph: one(agentGraph, {
|
|
760
|
+
fields: [agentRelations.graphId],
|
|
761
|
+
references: [agentGraph.id]
|
|
762
|
+
}),
|
|
763
|
+
// An agent relation has one source agent
|
|
764
|
+
sourceAgent: one(agents, {
|
|
765
|
+
fields: [agentRelations.sourceAgentId],
|
|
766
|
+
references: [agents.id],
|
|
767
|
+
relationName: "sourceRelations"
|
|
768
|
+
}),
|
|
769
|
+
// An agent relation may have one target agent (for internal relations)
|
|
770
|
+
targetAgent: one(agents, {
|
|
771
|
+
fields: [agentRelations.targetAgentId],
|
|
772
|
+
references: [agents.id],
|
|
773
|
+
relationName: "targetRelations"
|
|
774
|
+
}),
|
|
775
|
+
// An agent relation may have one external agent (for external relations)
|
|
776
|
+
externalAgent: one(externalAgents, {
|
|
777
|
+
fields: [agentRelations.externalAgentId],
|
|
778
|
+
references: [externalAgents.id]
|
|
779
|
+
})
|
|
780
|
+
}));
|
|
781
|
+
|
|
782
|
+
// src/types/utility.ts
|
|
783
|
+
var TOOL_STATUS_VALUES = [
|
|
784
|
+
"healthy",
|
|
785
|
+
"unhealthy",
|
|
786
|
+
"unknown",
|
|
787
|
+
"disabled",
|
|
788
|
+
"needs_auth"
|
|
789
|
+
];
|
|
790
|
+
var VALID_RELATION_TYPES = ["transfer", "delegate"];
|
|
791
|
+
var MCPTransportType = {
|
|
792
|
+
streamableHttp: "streamable_http",
|
|
793
|
+
sse: "sse"
|
|
794
|
+
};
|
|
795
|
+
var MCPServerType = {
|
|
796
|
+
nango: "nango",
|
|
797
|
+
generic: "generic"
|
|
798
|
+
};
|
|
799
|
+
var CredentialStoreType = {
|
|
800
|
+
memory: "memory",
|
|
801
|
+
keychain: "keychain",
|
|
802
|
+
nango: "nango"
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
// src/validation/schemas.ts
|
|
806
|
+
var MIN_ID_LENGTH = 1;
|
|
807
|
+
var MAX_ID_LENGTH = 255;
|
|
808
|
+
var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
809
|
+
var resourceIdSchema = zodOpenapi.z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).regex(URL_SAFE_ID_PATTERN, {
|
|
810
|
+
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
811
|
+
}).openapi({
|
|
812
|
+
description: "Resource identifier",
|
|
813
|
+
example: "resource_789"
|
|
814
|
+
});
|
|
815
|
+
var ModelSettingsSchema = zodOpenapi.z.object({
|
|
816
|
+
model: zodOpenapi.z.string().optional(),
|
|
817
|
+
providerOptions: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional()
|
|
818
|
+
});
|
|
819
|
+
var ModelSchema = zodOpenapi.z.object({
|
|
820
|
+
base: ModelSettingsSchema.optional(),
|
|
821
|
+
structuredOutput: ModelSettingsSchema.optional(),
|
|
822
|
+
summarizer: ModelSettingsSchema.optional()
|
|
823
|
+
});
|
|
824
|
+
var ProjectModelSchema = zodOpenapi.z.object({
|
|
825
|
+
base: ModelSettingsSchema,
|
|
826
|
+
structuredOutput: ModelSettingsSchema.optional(),
|
|
827
|
+
summarizer: ModelSettingsSchema.optional()
|
|
828
|
+
});
|
|
829
|
+
var createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
830
|
+
var createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
831
|
+
var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
|
|
832
|
+
var AgentSelectSchema = drizzleZod.createSelectSchema(agents);
|
|
833
|
+
var AgentInsertSchema = drizzleZod.createInsertSchema(agents).extend({
|
|
834
|
+
id: resourceIdSchema,
|
|
835
|
+
models: ModelSchema.optional()
|
|
836
|
+
});
|
|
837
|
+
var AgentUpdateSchema = AgentInsertSchema.partial();
|
|
838
|
+
var AgentApiSelectSchema = createApiSchema(AgentSelectSchema);
|
|
839
|
+
var AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema);
|
|
840
|
+
var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema);
|
|
841
|
+
var AgentRelationSelectSchema = drizzleZod.createSelectSchema(agentRelations);
|
|
842
|
+
var AgentRelationInsertSchema = drizzleZod.createInsertSchema(agentRelations).extend({
|
|
843
|
+
id: resourceIdSchema,
|
|
844
|
+
graphId: resourceIdSchema,
|
|
845
|
+
sourceAgentId: resourceIdSchema,
|
|
846
|
+
targetAgentId: resourceIdSchema.optional(),
|
|
847
|
+
externalAgentId: resourceIdSchema.optional()
|
|
848
|
+
});
|
|
849
|
+
var AgentRelationUpdateSchema = AgentRelationInsertSchema.partial();
|
|
850
|
+
var AgentRelationApiSelectSchema = createApiSchema(AgentRelationSelectSchema);
|
|
851
|
+
var AgentRelationApiInsertSchema = createApiInsertSchema(AgentRelationInsertSchema).extend({
|
|
852
|
+
relationType: zodOpenapi.z.enum(VALID_RELATION_TYPES)
|
|
853
|
+
}).refine(
|
|
854
|
+
(data) => {
|
|
855
|
+
const hasTarget = data.targetAgentId != null;
|
|
856
|
+
const hasExternal = data.externalAgentId != null;
|
|
857
|
+
return hasTarget !== hasExternal;
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
message: "Must specify exactly one of targetAgentId or externalAgentId",
|
|
861
|
+
path: ["targetAgentId", "externalAgentId"]
|
|
862
|
+
}
|
|
863
|
+
);
|
|
864
|
+
var AgentRelationApiUpdateSchema = createApiUpdateSchema(AgentRelationUpdateSchema).extend({
|
|
865
|
+
relationType: zodOpenapi.z.enum(VALID_RELATION_TYPES).optional()
|
|
866
|
+
}).refine(
|
|
867
|
+
(data) => {
|
|
868
|
+
const hasTarget = data.targetAgentId != null;
|
|
869
|
+
const hasExternal = data.externalAgentId != null;
|
|
870
|
+
if (!hasTarget && !hasExternal) {
|
|
871
|
+
return true;
|
|
872
|
+
}
|
|
873
|
+
return hasTarget !== hasExternal;
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
message: "Must specify exactly one of targetAgentId or externalAgentId when updating agent relationships",
|
|
877
|
+
path: ["targetAgentId", "externalAgentId"]
|
|
878
|
+
}
|
|
879
|
+
);
|
|
880
|
+
var AgentRelationQuerySchema = zodOpenapi.z.object({
|
|
881
|
+
sourceAgentId: zodOpenapi.z.string().optional(),
|
|
882
|
+
targetAgentId: zodOpenapi.z.string().optional(),
|
|
883
|
+
externalAgentId: zodOpenapi.z.string().optional()
|
|
884
|
+
});
|
|
885
|
+
var ExternalAgentRelationInsertSchema = drizzleZod.createInsertSchema(agentRelations).extend({
|
|
886
|
+
id: resourceIdSchema,
|
|
887
|
+
graphId: resourceIdSchema,
|
|
888
|
+
sourceAgentId: resourceIdSchema,
|
|
889
|
+
externalAgentId: resourceIdSchema
|
|
890
|
+
});
|
|
891
|
+
var ExternalAgentRelationApiInsertSchema = createApiInsertSchema(
|
|
892
|
+
ExternalAgentRelationInsertSchema
|
|
893
|
+
);
|
|
894
|
+
var AgentGraphSelectSchema = drizzleZod.createSelectSchema(agentGraph);
|
|
895
|
+
var AgentGraphInsertSchema = drizzleZod.createInsertSchema(agentGraph).extend({
|
|
896
|
+
id: resourceIdSchema
|
|
897
|
+
});
|
|
898
|
+
var AgentGraphUpdateSchema = AgentGraphInsertSchema.partial();
|
|
899
|
+
var AgentGraphApiSelectSchema = createApiSchema(AgentGraphSelectSchema);
|
|
900
|
+
var AgentGraphApiInsertSchema = createApiInsertSchema(AgentGraphInsertSchema).extend({
|
|
901
|
+
id: resourceIdSchema.optional()
|
|
902
|
+
});
|
|
903
|
+
var AgentGraphApiUpdateSchema = createApiUpdateSchema(AgentGraphUpdateSchema);
|
|
904
|
+
var TaskSelectSchema = drizzleZod.createSelectSchema(tasks);
|
|
905
|
+
var TaskInsertSchema = drizzleZod.createInsertSchema(tasks).extend({
|
|
906
|
+
id: resourceIdSchema,
|
|
907
|
+
conversationId: resourceIdSchema.optional()
|
|
908
|
+
});
|
|
909
|
+
var TaskUpdateSchema = TaskInsertSchema.partial();
|
|
910
|
+
var TaskApiSelectSchema = createApiSchema(TaskSelectSchema);
|
|
911
|
+
var TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);
|
|
912
|
+
var TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);
|
|
913
|
+
var TaskRelationSelectSchema = drizzleZod.createSelectSchema(taskRelations);
|
|
914
|
+
var TaskRelationInsertSchema = drizzleZod.createInsertSchema(taskRelations).extend({
|
|
915
|
+
id: resourceIdSchema,
|
|
916
|
+
parentTaskId: resourceIdSchema,
|
|
917
|
+
childTaskId: resourceIdSchema
|
|
918
|
+
});
|
|
919
|
+
var TaskRelationUpdateSchema = TaskRelationInsertSchema.partial();
|
|
920
|
+
var TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);
|
|
921
|
+
var TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);
|
|
922
|
+
var TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);
|
|
923
|
+
var imageUrlSchema = zodOpenapi.z.string().optional().refine(
|
|
924
|
+
(url) => {
|
|
925
|
+
if (!url) return true;
|
|
926
|
+
if (url.startsWith("data:image/")) {
|
|
927
|
+
const base64Part = url.split(",")[1];
|
|
928
|
+
if (!base64Part) return false;
|
|
929
|
+
return base64Part.length < 14e5;
|
|
930
|
+
}
|
|
931
|
+
try {
|
|
932
|
+
const parsed = new URL(url);
|
|
933
|
+
return parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
934
|
+
} catch {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
message: "Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
var McpTransportConfigSchema = zodOpenapi.z.object({
|
|
943
|
+
type: zodOpenapi.z.enum(MCPTransportType),
|
|
944
|
+
requestInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
945
|
+
eventSourceInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
946
|
+
reconnectionOptions: zodOpenapi.z.custom().optional(),
|
|
947
|
+
sessionId: zodOpenapi.z.string().optional()
|
|
948
|
+
});
|
|
949
|
+
var ToolStatusSchema = zodOpenapi.z.enum(TOOL_STATUS_VALUES);
|
|
950
|
+
var McpToolDefinitionSchema = zodOpenapi.z.object({
|
|
951
|
+
name: zodOpenapi.z.string(),
|
|
952
|
+
description: zodOpenapi.z.string().optional(),
|
|
953
|
+
inputSchema: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional()
|
|
954
|
+
});
|
|
955
|
+
var ToolSelectSchema = drizzleZod.createSelectSchema(tools);
|
|
956
|
+
var ToolInsertSchema = drizzleZod.createInsertSchema(tools).extend({
|
|
957
|
+
id: resourceIdSchema,
|
|
958
|
+
imageUrl: imageUrlSchema
|
|
959
|
+
});
|
|
960
|
+
var ConversationSelectSchema = drizzleZod.createSelectSchema(conversations);
|
|
961
|
+
var ConversationInsertSchema = drizzleZod.createInsertSchema(conversations).extend({
|
|
962
|
+
id: resourceIdSchema,
|
|
963
|
+
contextConfigId: resourceIdSchema.optional()
|
|
964
|
+
});
|
|
965
|
+
var ConversationUpdateSchema = ConversationInsertSchema.partial();
|
|
966
|
+
var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema);
|
|
967
|
+
var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema);
|
|
968
|
+
var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema);
|
|
969
|
+
var MessageSelectSchema = drizzleZod.createSelectSchema(messages);
|
|
970
|
+
var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
|
|
971
|
+
id: resourceIdSchema,
|
|
972
|
+
conversationId: resourceIdSchema,
|
|
973
|
+
taskId: resourceIdSchema.optional()
|
|
974
|
+
});
|
|
975
|
+
var MessageUpdateSchema = MessageInsertSchema.partial();
|
|
976
|
+
var MessageApiSelectSchema = createApiSchema(MessageSelectSchema);
|
|
977
|
+
var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema);
|
|
978
|
+
var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema);
|
|
979
|
+
var ContextCacheSelectSchema = drizzleZod.createSelectSchema(contextCache);
|
|
980
|
+
var ContextCacheInsertSchema = drizzleZod.createInsertSchema(contextCache);
|
|
981
|
+
var ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
|
|
982
|
+
var ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);
|
|
983
|
+
var ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);
|
|
984
|
+
var ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);
|
|
985
|
+
var DataComponentSelectSchema = drizzleZod.createSelectSchema(dataComponents);
|
|
986
|
+
var DataComponentInsertSchema = drizzleZod.createInsertSchema(dataComponents).extend({
|
|
987
|
+
id: resourceIdSchema
|
|
988
|
+
});
|
|
989
|
+
var DataComponentBaseSchema = DataComponentInsertSchema.omit({
|
|
990
|
+
createdAt: true,
|
|
991
|
+
updatedAt: true
|
|
992
|
+
});
|
|
993
|
+
var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
|
|
994
|
+
var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema);
|
|
995
|
+
var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema);
|
|
996
|
+
var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema);
|
|
997
|
+
var AgentDataComponentSelectSchema = drizzleZod.createSelectSchema(agentDataComponents);
|
|
998
|
+
var AgentDataComponentInsertSchema = drizzleZod.createInsertSchema(agentDataComponents);
|
|
999
|
+
var AgentDataComponentUpdateSchema = AgentDataComponentInsertSchema.partial();
|
|
1000
|
+
var AgentDataComponentApiSelectSchema = createApiSchema(AgentDataComponentSelectSchema);
|
|
1001
|
+
var AgentDataComponentApiInsertSchema = createApiInsertSchema(
|
|
1002
|
+
AgentDataComponentInsertSchema
|
|
1003
|
+
);
|
|
1004
|
+
var AgentDataComponentApiUpdateSchema = createApiUpdateSchema(
|
|
1005
|
+
AgentDataComponentUpdateSchema
|
|
1006
|
+
);
|
|
1007
|
+
var ArtifactComponentSelectSchema = drizzleZod.createSelectSchema(artifactComponents);
|
|
1008
|
+
var ArtifactComponentInsertSchema = drizzleZod.createInsertSchema(artifactComponents).extend({
|
|
1009
|
+
id: resourceIdSchema
|
|
1010
|
+
});
|
|
1011
|
+
var ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();
|
|
1012
|
+
var ArtifactComponentApiSelectSchema = createApiSchema(ArtifactComponentSelectSchema);
|
|
1013
|
+
var ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({
|
|
1014
|
+
tenantId: true,
|
|
1015
|
+
projectId: true,
|
|
1016
|
+
createdAt: true,
|
|
1017
|
+
updatedAt: true
|
|
1018
|
+
}).extend({
|
|
1019
|
+
id: resourceIdSchema.optional()
|
|
1020
|
+
});
|
|
1021
|
+
var ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
|
|
1022
|
+
ArtifactComponentUpdateSchema
|
|
1023
|
+
);
|
|
1024
|
+
var AgentArtifactComponentSelectSchema = drizzleZod.createSelectSchema(agentArtifactComponents);
|
|
1025
|
+
var AgentArtifactComponentInsertSchema = drizzleZod.createInsertSchema(
|
|
1026
|
+
agentArtifactComponents
|
|
1027
|
+
).extend({
|
|
1028
|
+
id: resourceIdSchema,
|
|
1029
|
+
agentId: resourceIdSchema,
|
|
1030
|
+
artifactComponentId: resourceIdSchema
|
|
1031
|
+
});
|
|
1032
|
+
var AgentArtifactComponentUpdateSchema = AgentArtifactComponentInsertSchema.partial();
|
|
1033
|
+
var AgentArtifactComponentApiSelectSchema = createApiSchema(
|
|
1034
|
+
AgentArtifactComponentSelectSchema
|
|
1035
|
+
);
|
|
1036
|
+
var AgentArtifactComponentApiInsertSchema = AgentArtifactComponentInsertSchema.omit({
|
|
1037
|
+
tenantId: true,
|
|
1038
|
+
projectId: true,
|
|
1039
|
+
id: true,
|
|
1040
|
+
createdAt: true
|
|
1041
|
+
});
|
|
1042
|
+
var AgentArtifactComponentApiUpdateSchema = createApiUpdateSchema(
|
|
1043
|
+
AgentArtifactComponentUpdateSchema
|
|
1044
|
+
);
|
|
1045
|
+
var ExternalAgentSelectSchema = drizzleZod.createSelectSchema(externalAgents).extend({
|
|
1046
|
+
credentialReferenceId: zodOpenapi.z.string().nullable().optional(),
|
|
1047
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullable().optional()
|
|
1048
|
+
});
|
|
1049
|
+
var ExternalAgentInsertSchema = drizzleZod.createInsertSchema(externalAgents).extend({
|
|
1050
|
+
id: resourceIdSchema
|
|
1051
|
+
});
|
|
1052
|
+
var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
|
|
1053
|
+
var ExternalAgentApiSelectSchema = createApiSchema(ExternalAgentSelectSchema);
|
|
1054
|
+
var ExternalAgentApiInsertSchema = createApiInsertSchema(ExternalAgentInsertSchema);
|
|
1055
|
+
var ExternalAgentApiUpdateSchema = createApiUpdateSchema(ExternalAgentUpdateSchema);
|
|
1056
|
+
var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
|
|
1057
|
+
AgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("internal") }),
|
|
1058
|
+
ExternalAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("external") })
|
|
1059
|
+
]);
|
|
1060
|
+
var ApiKeySelectSchema = drizzleZod.createSelectSchema(apiKeys);
|
|
1061
|
+
var ApiKeyInsertSchema = drizzleZod.createInsertSchema(apiKeys).extend({
|
|
1062
|
+
id: resourceIdSchema,
|
|
1063
|
+
graphId: resourceIdSchema
|
|
1064
|
+
});
|
|
1065
|
+
var ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({
|
|
1066
|
+
tenantId: true,
|
|
1067
|
+
projectId: true,
|
|
1068
|
+
id: true,
|
|
1069
|
+
publicId: true,
|
|
1070
|
+
keyHash: true,
|
|
1071
|
+
keyPrefix: true,
|
|
1072
|
+
createdAt: true
|
|
1073
|
+
});
|
|
1074
|
+
var ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({
|
|
1075
|
+
tenantId: true,
|
|
1076
|
+
projectId: true,
|
|
1077
|
+
keyHash: true
|
|
1078
|
+
// Never expose the hash
|
|
1079
|
+
});
|
|
1080
|
+
var ApiKeyApiCreationResponseSchema = zodOpenapi.z.object({
|
|
1081
|
+
data: zodOpenapi.z.object({
|
|
1082
|
+
apiKey: ApiKeyApiSelectSchema,
|
|
1083
|
+
key: zodOpenapi.z.string().describe("The full API key (shown only once)")
|
|
1084
|
+
})
|
|
1085
|
+
});
|
|
1086
|
+
var ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
1087
|
+
tenantId: true,
|
|
1088
|
+
projectId: true,
|
|
1089
|
+
id: true,
|
|
1090
|
+
// Auto-generated
|
|
1091
|
+
publicId: true,
|
|
1092
|
+
// Auto-generated
|
|
1093
|
+
keyHash: true,
|
|
1094
|
+
// Auto-generated
|
|
1095
|
+
keyPrefix: true,
|
|
1096
|
+
// Auto-generated
|
|
1097
|
+
lastUsedAt: true
|
|
1098
|
+
// Not set on creation
|
|
1099
|
+
});
|
|
1100
|
+
var ApiKeyApiUpdateSchema = ApiKeyUpdateSchema;
|
|
1101
|
+
var CredentialReferenceSelectSchema = zodOpenapi.z.object({
|
|
1102
|
+
id: zodOpenapi.z.string(),
|
|
1103
|
+
tenantId: zodOpenapi.z.string(),
|
|
1104
|
+
projectId: zodOpenapi.z.string(),
|
|
1105
|
+
type: zodOpenapi.z.string(),
|
|
1106
|
+
credentialStoreId: zodOpenapi.z.string(),
|
|
1107
|
+
retrievalParams: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).nullish(),
|
|
1108
|
+
createdAt: zodOpenapi.z.string(),
|
|
1109
|
+
updatedAt: zodOpenapi.z.string()
|
|
1110
|
+
});
|
|
1111
|
+
var CredentialReferenceInsertSchema = zodOpenapi.z.object({
|
|
1112
|
+
id: resourceIdSchema,
|
|
1113
|
+
tenantId: zodOpenapi.z.string(),
|
|
1114
|
+
projectId: zodOpenapi.z.string(),
|
|
1115
|
+
type: zodOpenapi.z.string(),
|
|
1116
|
+
credentialStoreId: resourceIdSchema,
|
|
1117
|
+
retrievalParams: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).nullish()
|
|
1118
|
+
});
|
|
1119
|
+
var CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
1120
|
+
var CredentialReferenceApiSelectSchema = createApiSchema(
|
|
1121
|
+
CredentialReferenceSelectSchema
|
|
1122
|
+
).extend({
|
|
1123
|
+
type: zodOpenapi.z.enum(CredentialStoreType)
|
|
1124
|
+
});
|
|
1125
|
+
var CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
1126
|
+
CredentialReferenceInsertSchema
|
|
1127
|
+
).extend({
|
|
1128
|
+
type: zodOpenapi.z.enum(CredentialStoreType)
|
|
1129
|
+
});
|
|
1130
|
+
var CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
|
|
1131
|
+
CredentialReferenceUpdateSchema
|
|
1132
|
+
).extend({
|
|
1133
|
+
type: zodOpenapi.z.enum(CredentialStoreType).optional()
|
|
1134
|
+
});
|
|
1135
|
+
var McpToolSchema = ToolInsertSchema.extend({
|
|
1136
|
+
imageUrl: imageUrlSchema,
|
|
1137
|
+
status: ToolStatusSchema.default("unknown"),
|
|
1138
|
+
lastHealthCheck: zodOpenapi.z.date().optional(),
|
|
1139
|
+
lastToolsSync: zodOpenapi.z.date().optional(),
|
|
1140
|
+
version: zodOpenapi.z.string().optional(),
|
|
1141
|
+
createdAt: zodOpenapi.z.date(),
|
|
1142
|
+
updatedAt: zodOpenapi.z.date()
|
|
1143
|
+
});
|
|
1144
|
+
var MCPToolConfigSchema = McpToolSchema.omit({
|
|
1145
|
+
config: true,
|
|
1146
|
+
tenantId: true,
|
|
1147
|
+
projectId: true,
|
|
1148
|
+
status: true,
|
|
1149
|
+
lastHealthCheck: true,
|
|
1150
|
+
lastToolsSync: true,
|
|
1151
|
+
version: true,
|
|
1152
|
+
createdAt: true,
|
|
1153
|
+
updatedAt: true,
|
|
1154
|
+
credentialReferenceId: true
|
|
1155
|
+
}).extend({
|
|
1156
|
+
tenantId: zodOpenapi.z.string().optional(),
|
|
1157
|
+
projectId: zodOpenapi.z.string().optional(),
|
|
1158
|
+
description: zodOpenapi.z.string().optional(),
|
|
1159
|
+
serverUrl: zodOpenapi.z.url(),
|
|
1160
|
+
activeTools: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1161
|
+
mcpType: zodOpenapi.z.enum(MCPServerType).optional(),
|
|
1162
|
+
transport: McpTransportConfigSchema.optional(),
|
|
1163
|
+
credential: CredentialReferenceApiInsertSchema.optional()
|
|
1164
|
+
});
|
|
1165
|
+
var ToolUpdateSchema = ToolInsertSchema.partial();
|
|
1166
|
+
var ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
|
|
1167
|
+
var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
|
|
1168
|
+
var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
|
|
1169
|
+
var FetchConfigSchema = zodOpenapi.z.object({
|
|
1170
|
+
url: zodOpenapi.z.string().min(1, "URL is required"),
|
|
1171
|
+
method: zodOpenapi.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
1172
|
+
headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).optional(),
|
|
1173
|
+
body: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
|
|
1174
|
+
transform: zodOpenapi.z.string().optional(),
|
|
1175
|
+
// JSONPath or JS transform function
|
|
1176
|
+
timeout: zodOpenapi.z.number().min(0).optional().default(1e4).optional()
|
|
1177
|
+
});
|
|
1178
|
+
var FetchDefinitionSchema = zodOpenapi.z.object({
|
|
1179
|
+
id: zodOpenapi.z.string().min(1, "Fetch definition ID is required"),
|
|
1180
|
+
name: zodOpenapi.z.string().optional(),
|
|
1181
|
+
trigger: zodOpenapi.z.enum(["initialization", "invocation"]),
|
|
1182
|
+
fetchConfig: FetchConfigSchema,
|
|
1183
|
+
responseSchema: zodOpenapi.z.any().optional(),
|
|
1184
|
+
// JSON Schema for validating HTTP response
|
|
1185
|
+
defaultValue: zodOpenapi.z.unknown().optional(),
|
|
1186
|
+
credential: CredentialReferenceApiInsertSchema.optional()
|
|
1187
|
+
});
|
|
1188
|
+
var ContextConfigSelectSchema = drizzleZod.createSelectSchema(contextConfigs).extend({
|
|
1189
|
+
requestContextSchema: zodOpenapi.z.unknown().optional()
|
|
1190
|
+
});
|
|
1191
|
+
var ContextConfigInsertSchema = drizzleZod.createInsertSchema(contextConfigs).extend({
|
|
1192
|
+
id: resourceIdSchema,
|
|
1193
|
+
requestContextSchema: zodOpenapi.z.unknown().optional()
|
|
1194
|
+
}).omit({
|
|
1195
|
+
createdAt: true,
|
|
1196
|
+
updatedAt: true
|
|
1197
|
+
});
|
|
1198
|
+
var ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();
|
|
1199
|
+
var ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema);
|
|
1200
|
+
var ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema);
|
|
1201
|
+
var ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema);
|
|
1202
|
+
var AgentToolRelationSelectSchema = drizzleZod.createSelectSchema(agentToolRelations);
|
|
1203
|
+
var AgentToolRelationInsertSchema = drizzleZod.createInsertSchema(agentToolRelations).extend({
|
|
1204
|
+
id: resourceIdSchema,
|
|
1205
|
+
agentId: resourceIdSchema,
|
|
1206
|
+
toolId: resourceIdSchema,
|
|
1207
|
+
selectedTools: zodOpenapi.z.array(zodOpenapi.z.string()).nullish()
|
|
1208
|
+
});
|
|
1209
|
+
var AgentToolRelationUpdateSchema = AgentToolRelationInsertSchema.partial();
|
|
1210
|
+
var AgentToolRelationApiSelectSchema = createApiSchema(AgentToolRelationSelectSchema);
|
|
1211
|
+
var AgentToolRelationApiInsertSchema = createApiInsertSchema(
|
|
1212
|
+
AgentToolRelationInsertSchema
|
|
1213
|
+
);
|
|
1214
|
+
var AgentToolRelationApiUpdateSchema = createApiUpdateSchema(
|
|
1215
|
+
AgentToolRelationUpdateSchema
|
|
1216
|
+
);
|
|
1217
|
+
var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
|
|
1218
|
+
var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
|
|
1219
|
+
var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
|
|
1220
|
+
var LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
|
|
1221
|
+
var LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
|
|
1222
|
+
var LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);
|
|
1223
|
+
var StatusComponentSchema = zodOpenapi.z.object({
|
|
1224
|
+
type: zodOpenapi.z.string(),
|
|
1225
|
+
description: zodOpenapi.z.string().optional(),
|
|
1226
|
+
detailsSchema: zodOpenapi.z.object({
|
|
1227
|
+
type: zodOpenapi.z.literal("object"),
|
|
1228
|
+
properties: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any()),
|
|
1229
|
+
required: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
|
|
1230
|
+
}).optional()
|
|
1231
|
+
});
|
|
1232
|
+
var StatusUpdateSchema = zodOpenapi.z.object({
|
|
1233
|
+
enabled: zodOpenapi.z.boolean().optional(),
|
|
1234
|
+
numEvents: zodOpenapi.z.number().min(1).max(100).optional(),
|
|
1235
|
+
timeInSeconds: zodOpenapi.z.number().min(1).max(600).optional(),
|
|
1236
|
+
prompt: zodOpenapi.z.string().max(2e3, "Custom prompt cannot exceed 2000 characters").optional(),
|
|
1237
|
+
statusComponents: zodOpenapi.z.array(StatusComponentSchema).optional()
|
|
1238
|
+
});
|
|
1239
|
+
var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
1240
|
+
tools: zodOpenapi.z.array(zodOpenapi.z.string()),
|
|
1241
|
+
selectedTools: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.array(zodOpenapi.z.string())).optional(),
|
|
1242
|
+
dataComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1243
|
+
artifactComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1244
|
+
canTransferTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
|
|
1245
|
+
canDelegateTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
|
|
1246
|
+
});
|
|
1247
|
+
var FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
|
|
1248
|
+
agents: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])),
|
|
1249
|
+
tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema),
|
|
1250
|
+
credentialReferences: zodOpenapi.z.array(CredentialReferenceApiInsertSchema).optional(),
|
|
1251
|
+
dataComponents: zodOpenapi.z.record(zodOpenapi.z.string(), DataComponentApiInsertSchema).optional(),
|
|
1252
|
+
artifactComponents: zodOpenapi.z.record(zodOpenapi.z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
1253
|
+
contextConfig: zodOpenapi.z.optional(ContextConfigApiInsertSchema),
|
|
1254
|
+
statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
|
|
1255
|
+
models: ModelSchema.optional(),
|
|
1256
|
+
stopWhen: zodOpenapi.z.object({
|
|
1257
|
+
transferCountIs: zodOpenapi.z.number().min(1).max(100).optional()
|
|
1258
|
+
}).optional(),
|
|
1259
|
+
graphPrompt: zodOpenapi.z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
1260
|
+
});
|
|
1261
|
+
var PaginationSchema = zodOpenapi.z.object({
|
|
1262
|
+
page: zodOpenapi.z.coerce.number().min(1).default(1),
|
|
1263
|
+
limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10),
|
|
1264
|
+
total: zodOpenapi.z.number(),
|
|
1265
|
+
pages: zodOpenapi.z.number()
|
|
1266
|
+
});
|
|
1267
|
+
var ListResponseSchema = (itemSchema) => zodOpenapi.z.object({
|
|
1268
|
+
data: zodOpenapi.z.array(itemSchema),
|
|
1269
|
+
pagination: PaginationSchema
|
|
1270
|
+
});
|
|
1271
|
+
var SingleResponseSchema = (itemSchema) => zodOpenapi.z.object({
|
|
1272
|
+
data: itemSchema
|
|
1273
|
+
});
|
|
1274
|
+
var ErrorResponseSchema = zodOpenapi.z.object({
|
|
1275
|
+
error: zodOpenapi.z.string(),
|
|
1276
|
+
message: zodOpenapi.z.string().optional(),
|
|
1277
|
+
details: zodOpenapi.z.unknown().optional()
|
|
1278
|
+
});
|
|
1279
|
+
var ExistsResponseSchema = zodOpenapi.z.object({
|
|
1280
|
+
exists: zodOpenapi.z.boolean()
|
|
1281
|
+
});
|
|
1282
|
+
var RemovedResponseSchema = zodOpenapi.z.object({
|
|
1283
|
+
message: zodOpenapi.z.string(),
|
|
1284
|
+
removed: zodOpenapi.z.boolean()
|
|
1285
|
+
});
|
|
1286
|
+
var ProjectSelectSchema = drizzleZod.createSelectSchema(projects);
|
|
1287
|
+
var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
|
|
1288
|
+
models: ProjectModelSchema.optional()
|
|
1289
|
+
}).omit({
|
|
1290
|
+
createdAt: true,
|
|
1291
|
+
updatedAt: true
|
|
1292
|
+
});
|
|
1293
|
+
var ProjectUpdateSchema = ProjectInsertSchema.partial();
|
|
1294
|
+
var ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true });
|
|
1295
|
+
var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true });
|
|
1296
|
+
var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
|
|
1297
|
+
var HeadersScopeSchema = zodOpenapi.z.object({
|
|
1298
|
+
"x-inkeep-tenant-id": zodOpenapi.z.string().optional().openapi({
|
|
1299
|
+
description: "Tenant identifier",
|
|
1300
|
+
example: "tenant_123"
|
|
1301
|
+
}),
|
|
1302
|
+
"x-inkeep-project-id": zodOpenapi.z.string().optional().openapi({
|
|
1303
|
+
description: "Project identifier",
|
|
1304
|
+
example: "project_456"
|
|
1305
|
+
}),
|
|
1306
|
+
"x-inkeep-graph-id": zodOpenapi.z.string().optional().openapi({
|
|
1307
|
+
description: "Graph identifier",
|
|
1308
|
+
example: "graph_789"
|
|
1309
|
+
})
|
|
1310
|
+
});
|
|
1311
|
+
var TenantParamsSchema = zodOpenapi.z.object({
|
|
1312
|
+
tenantId: zodOpenapi.z.string().openapi({
|
|
1313
|
+
description: "Tenant identifier",
|
|
1314
|
+
example: "tenant_123"
|
|
1315
|
+
})
|
|
1316
|
+
}).openapi("TenantParams");
|
|
1317
|
+
var TenantProjectParamsSchema = zodOpenapi.z.object({
|
|
1318
|
+
tenantId: zodOpenapi.z.string().openapi({
|
|
1319
|
+
description: "Tenant identifier",
|
|
1320
|
+
example: "tenant_123"
|
|
1321
|
+
}),
|
|
1322
|
+
projectId: zodOpenapi.z.string().openapi({
|
|
1323
|
+
description: "Project identifier",
|
|
1324
|
+
example: "project_456"
|
|
1325
|
+
})
|
|
1326
|
+
}).openapi("TenantProjectParams");
|
|
1327
|
+
var TenantProjectIdParamsSchema = zodOpenapi.z.object({
|
|
1328
|
+
tenantId: zodOpenapi.z.string().openapi({
|
|
1329
|
+
description: "Tenant identifier",
|
|
1330
|
+
example: "tenant_123"
|
|
1331
|
+
}),
|
|
1332
|
+
projectId: zodOpenapi.z.string().openapi({
|
|
1333
|
+
description: "Project identifier",
|
|
1334
|
+
example: "project_456"
|
|
1335
|
+
}),
|
|
1336
|
+
id: resourceIdSchema
|
|
1337
|
+
}).openapi("TenantProjectIdParams");
|
|
1338
|
+
var TenantIdParamsSchema = zodOpenapi.z.object({
|
|
1339
|
+
tenantId: zodOpenapi.z.string().openapi({
|
|
1340
|
+
description: "Tenant identifier",
|
|
1341
|
+
example: "tenant_123"
|
|
1342
|
+
}),
|
|
1343
|
+
id: resourceIdSchema
|
|
1344
|
+
}).openapi("TenantIdParams");
|
|
1345
|
+
var IdParamsSchema = zodOpenapi.z.object({
|
|
1346
|
+
id: resourceIdSchema
|
|
1347
|
+
}).openapi("IdParams");
|
|
1348
|
+
var PaginationQueryParamsSchema = zodOpenapi.z.object({
|
|
1349
|
+
page: zodOpenapi.z.coerce.number().min(1).default(1),
|
|
1350
|
+
limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10)
|
|
1351
|
+
});
|
|
1352
|
+
|
|
1353
|
+
// src/validation/graphFull.ts
|
|
1354
|
+
function isInternalAgent(agent) {
|
|
1355
|
+
return "prompt" in agent;
|
|
1356
|
+
}
|
|
1357
|
+
function isExternalAgent(agent) {
|
|
1358
|
+
return "baseUrl" in agent;
|
|
1359
|
+
}
|
|
1360
|
+
function validateAndTypeGraphData(data) {
|
|
1361
|
+
return FullGraphDefinitionSchema.parse(data);
|
|
1362
|
+
}
|
|
1363
|
+
function validateToolReferences(graphData) {
|
|
1364
|
+
const errors = [];
|
|
1365
|
+
const availableToolIds = new Set(Object.keys(graphData.tools));
|
|
1366
|
+
for (const [agentId, agentData] of Object.entries(graphData.agents)) {
|
|
1367
|
+
if (isInternalAgent(agentData) && agentData.tools && Array.isArray(agentData.tools)) {
|
|
1368
|
+
for (const toolId of agentData.tools) {
|
|
1369
|
+
if (!availableToolIds.has(toolId)) {
|
|
1370
|
+
errors.push(`Agent '${agentId}' references non-existent tool '${toolId}'`);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
if (errors.length > 0) {
|
|
1376
|
+
throw new Error(`Tool reference validation failed:
|
|
1377
|
+
${errors.join("\n")}`);
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
function validateDataComponentReferences(graphData) {
|
|
1381
|
+
const errors = [];
|
|
1382
|
+
const availableDataComponentIds = new Set(Object.keys(graphData.dataComponents || {}));
|
|
1383
|
+
for (const [agentId, agentData] of Object.entries(graphData.agents)) {
|
|
1384
|
+
if (isInternalAgent(agentData) && agentData.dataComponents) {
|
|
1385
|
+
for (const dataComponentId of agentData.dataComponents) {
|
|
1386
|
+
if (!availableDataComponentIds.has(dataComponentId)) {
|
|
1387
|
+
errors.push(
|
|
1388
|
+
`Agent '${agentId}' references non-existent dataComponent '${dataComponentId}'`
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
if (errors.length > 0) {
|
|
1395
|
+
throw new Error(`DataComponent reference validation failed:
|
|
1396
|
+
${errors.join("\n")}`);
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function validateArtifactComponentReferences(graphData) {
|
|
1400
|
+
const errors = [];
|
|
1401
|
+
const availableArtifactComponentIds = new Set(Object.keys(graphData.artifactComponents || {}));
|
|
1402
|
+
for (const [agentId, agentData] of Object.entries(graphData.agents)) {
|
|
1403
|
+
if (isInternalAgent(agentData) && agentData.artifactComponents) {
|
|
1404
|
+
for (const artifactComponentId of agentData.artifactComponents) {
|
|
1405
|
+
if (!availableArtifactComponentIds.has(artifactComponentId)) {
|
|
1406
|
+
errors.push(
|
|
1407
|
+
`Agent '${agentId}' references non-existent artifactComponent '${artifactComponentId}'`
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
if (errors.length > 0) {
|
|
1414
|
+
throw new Error(`ArtifactComponent reference validation failed:
|
|
1415
|
+
${errors.join("\n")}`);
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
function validateAgentRelationships(graphData) {
|
|
1419
|
+
const errors = [];
|
|
1420
|
+
const availableAgentIds = new Set(Object.keys(graphData.agents));
|
|
1421
|
+
for (const [agentId, agentData] of Object.entries(graphData.agents)) {
|
|
1422
|
+
if (isInternalAgent(agentData)) {
|
|
1423
|
+
if (agentData.canTransferTo && Array.isArray(agentData.canTransferTo)) {
|
|
1424
|
+
for (const targetId of agentData.canTransferTo) {
|
|
1425
|
+
if (!availableAgentIds.has(targetId)) {
|
|
1426
|
+
errors.push(
|
|
1427
|
+
`Agent '${agentId}' has transfer target '${targetId}' that doesn't exist in graph`
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
if (agentData.canDelegateTo && Array.isArray(agentData.canDelegateTo)) {
|
|
1433
|
+
for (const targetId of agentData.canDelegateTo) {
|
|
1434
|
+
if (!availableAgentIds.has(targetId)) {
|
|
1435
|
+
errors.push(
|
|
1436
|
+
`Agent '${agentId}' has delegation target '${targetId}' that doesn't exist in graph`
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
if (errors.length > 0) {
|
|
1444
|
+
throw new Error(`Agent relationship validation failed:
|
|
1445
|
+
${errors.join("\n")}`);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
function validateGraphStructure(graphData) {
|
|
1449
|
+
if (!graphData.agents[graphData.defaultAgentId]) {
|
|
1450
|
+
throw new Error(`Default agent '${graphData.defaultAgentId}' does not exist in agents`);
|
|
1451
|
+
}
|
|
1452
|
+
validateToolReferences(graphData);
|
|
1453
|
+
validateDataComponentReferences(graphData);
|
|
1454
|
+
validateArtifactComponentReferences(graphData);
|
|
1455
|
+
validateAgentRelationships(graphData);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// src/validation/id-validation.ts
|
|
1459
|
+
function isValidResourceId(id) {
|
|
1460
|
+
const result = resourceIdSchema.safeParse(id);
|
|
1461
|
+
return result.success;
|
|
1462
|
+
}
|
|
1463
|
+
function generateIdFromName(name) {
|
|
1464
|
+
const id = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
|
|
1465
|
+
if (!id) {
|
|
1466
|
+
throw new Error("Cannot generate valid ID from provided name");
|
|
1467
|
+
}
|
|
1468
|
+
const truncatedId = id.substring(0, MAX_ID_LENGTH);
|
|
1469
|
+
const result = resourceIdSchema.safeParse(truncatedId);
|
|
1470
|
+
if (!result.success) {
|
|
1471
|
+
throw new Error(`Generated ID "${truncatedId}" is not valid: ${result.error.message}`);
|
|
1472
|
+
}
|
|
1473
|
+
return truncatedId;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
exports.AgentApiInsertSchema = AgentApiInsertSchema;
|
|
1477
|
+
exports.AgentApiSelectSchema = AgentApiSelectSchema;
|
|
1478
|
+
exports.AgentApiUpdateSchema = AgentApiUpdateSchema;
|
|
1479
|
+
exports.AgentArtifactComponentApiInsertSchema = AgentArtifactComponentApiInsertSchema;
|
|
1480
|
+
exports.AgentArtifactComponentApiSelectSchema = AgentArtifactComponentApiSelectSchema;
|
|
1481
|
+
exports.AgentArtifactComponentApiUpdateSchema = AgentArtifactComponentApiUpdateSchema;
|
|
1482
|
+
exports.AgentArtifactComponentInsertSchema = AgentArtifactComponentInsertSchema;
|
|
1483
|
+
exports.AgentArtifactComponentSelectSchema = AgentArtifactComponentSelectSchema;
|
|
1484
|
+
exports.AgentArtifactComponentUpdateSchema = AgentArtifactComponentUpdateSchema;
|
|
1485
|
+
exports.AgentDataComponentApiInsertSchema = AgentDataComponentApiInsertSchema;
|
|
1486
|
+
exports.AgentDataComponentApiSelectSchema = AgentDataComponentApiSelectSchema;
|
|
1487
|
+
exports.AgentDataComponentApiUpdateSchema = AgentDataComponentApiUpdateSchema;
|
|
1488
|
+
exports.AgentDataComponentInsertSchema = AgentDataComponentInsertSchema;
|
|
1489
|
+
exports.AgentDataComponentSelectSchema = AgentDataComponentSelectSchema;
|
|
1490
|
+
exports.AgentDataComponentUpdateSchema = AgentDataComponentUpdateSchema;
|
|
1491
|
+
exports.AgentGraphApiInsertSchema = AgentGraphApiInsertSchema;
|
|
1492
|
+
exports.AgentGraphApiSelectSchema = AgentGraphApiSelectSchema;
|
|
1493
|
+
exports.AgentGraphApiUpdateSchema = AgentGraphApiUpdateSchema;
|
|
1494
|
+
exports.AgentGraphInsertSchema = AgentGraphInsertSchema;
|
|
1495
|
+
exports.AgentGraphSelectSchema = AgentGraphSelectSchema;
|
|
1496
|
+
exports.AgentGraphUpdateSchema = AgentGraphUpdateSchema;
|
|
1497
|
+
exports.AgentInsertSchema = AgentInsertSchema;
|
|
1498
|
+
exports.AgentRelationApiInsertSchema = AgentRelationApiInsertSchema;
|
|
1499
|
+
exports.AgentRelationApiSelectSchema = AgentRelationApiSelectSchema;
|
|
1500
|
+
exports.AgentRelationApiUpdateSchema = AgentRelationApiUpdateSchema;
|
|
1501
|
+
exports.AgentRelationInsertSchema = AgentRelationInsertSchema;
|
|
1502
|
+
exports.AgentRelationQuerySchema = AgentRelationQuerySchema;
|
|
1503
|
+
exports.AgentRelationSelectSchema = AgentRelationSelectSchema;
|
|
1504
|
+
exports.AgentRelationUpdateSchema = AgentRelationUpdateSchema;
|
|
1505
|
+
exports.AgentSelectSchema = AgentSelectSchema;
|
|
1506
|
+
exports.AgentToolRelationApiInsertSchema = AgentToolRelationApiInsertSchema;
|
|
1507
|
+
exports.AgentToolRelationApiSelectSchema = AgentToolRelationApiSelectSchema;
|
|
1508
|
+
exports.AgentToolRelationApiUpdateSchema = AgentToolRelationApiUpdateSchema;
|
|
1509
|
+
exports.AgentToolRelationInsertSchema = AgentToolRelationInsertSchema;
|
|
1510
|
+
exports.AgentToolRelationSelectSchema = AgentToolRelationSelectSchema;
|
|
1511
|
+
exports.AgentToolRelationUpdateSchema = AgentToolRelationUpdateSchema;
|
|
1512
|
+
exports.AgentUpdateSchema = AgentUpdateSchema;
|
|
1513
|
+
exports.AllAgentSchema = AllAgentSchema;
|
|
1514
|
+
exports.ApiKeyApiCreationResponseSchema = ApiKeyApiCreationResponseSchema;
|
|
1515
|
+
exports.ApiKeyApiInsertSchema = ApiKeyApiInsertSchema;
|
|
1516
|
+
exports.ApiKeyApiSelectSchema = ApiKeyApiSelectSchema;
|
|
1517
|
+
exports.ApiKeyApiUpdateSchema = ApiKeyApiUpdateSchema;
|
|
1518
|
+
exports.ApiKeyInsertSchema = ApiKeyInsertSchema;
|
|
1519
|
+
exports.ApiKeySelectSchema = ApiKeySelectSchema;
|
|
1520
|
+
exports.ApiKeyUpdateSchema = ApiKeyUpdateSchema;
|
|
1521
|
+
exports.ArtifactComponentApiInsertSchema = ArtifactComponentApiInsertSchema;
|
|
1522
|
+
exports.ArtifactComponentApiSelectSchema = ArtifactComponentApiSelectSchema;
|
|
1523
|
+
exports.ArtifactComponentApiUpdateSchema = ArtifactComponentApiUpdateSchema;
|
|
1524
|
+
exports.ArtifactComponentInsertSchema = ArtifactComponentInsertSchema;
|
|
1525
|
+
exports.ArtifactComponentSelectSchema = ArtifactComponentSelectSchema;
|
|
1526
|
+
exports.ArtifactComponentUpdateSchema = ArtifactComponentUpdateSchema;
|
|
1527
|
+
exports.ContextCacheApiInsertSchema = ContextCacheApiInsertSchema;
|
|
1528
|
+
exports.ContextCacheApiSelectSchema = ContextCacheApiSelectSchema;
|
|
1529
|
+
exports.ContextCacheApiUpdateSchema = ContextCacheApiUpdateSchema;
|
|
1530
|
+
exports.ContextCacheInsertSchema = ContextCacheInsertSchema;
|
|
1531
|
+
exports.ContextCacheSelectSchema = ContextCacheSelectSchema;
|
|
1532
|
+
exports.ContextCacheUpdateSchema = ContextCacheUpdateSchema;
|
|
1533
|
+
exports.ContextConfigApiInsertSchema = ContextConfigApiInsertSchema;
|
|
1534
|
+
exports.ContextConfigApiSelectSchema = ContextConfigApiSelectSchema;
|
|
1535
|
+
exports.ContextConfigApiUpdateSchema = ContextConfigApiUpdateSchema;
|
|
1536
|
+
exports.ContextConfigInsertSchema = ContextConfigInsertSchema;
|
|
1537
|
+
exports.ContextConfigSelectSchema = ContextConfigSelectSchema;
|
|
1538
|
+
exports.ContextConfigUpdateSchema = ContextConfigUpdateSchema;
|
|
1539
|
+
exports.ConversationApiInsertSchema = ConversationApiInsertSchema;
|
|
1540
|
+
exports.ConversationApiSelectSchema = ConversationApiSelectSchema;
|
|
1541
|
+
exports.ConversationApiUpdateSchema = ConversationApiUpdateSchema;
|
|
1542
|
+
exports.ConversationInsertSchema = ConversationInsertSchema;
|
|
1543
|
+
exports.ConversationSelectSchema = ConversationSelectSchema;
|
|
1544
|
+
exports.ConversationUpdateSchema = ConversationUpdateSchema;
|
|
1545
|
+
exports.CredentialReferenceApiInsertSchema = CredentialReferenceApiInsertSchema;
|
|
1546
|
+
exports.CredentialReferenceApiSelectSchema = CredentialReferenceApiSelectSchema;
|
|
1547
|
+
exports.CredentialReferenceApiUpdateSchema = CredentialReferenceApiUpdateSchema;
|
|
1548
|
+
exports.CredentialReferenceInsertSchema = CredentialReferenceInsertSchema;
|
|
1549
|
+
exports.CredentialReferenceSelectSchema = CredentialReferenceSelectSchema;
|
|
1550
|
+
exports.CredentialReferenceUpdateSchema = CredentialReferenceUpdateSchema;
|
|
1551
|
+
exports.DataComponentApiInsertSchema = DataComponentApiInsertSchema;
|
|
1552
|
+
exports.DataComponentApiSelectSchema = DataComponentApiSelectSchema;
|
|
1553
|
+
exports.DataComponentApiUpdateSchema = DataComponentApiUpdateSchema;
|
|
1554
|
+
exports.DataComponentBaseSchema = DataComponentBaseSchema;
|
|
1555
|
+
exports.DataComponentInsertSchema = DataComponentInsertSchema;
|
|
1556
|
+
exports.DataComponentSelectSchema = DataComponentSelectSchema;
|
|
1557
|
+
exports.DataComponentUpdateSchema = DataComponentUpdateSchema;
|
|
1558
|
+
exports.ErrorResponseSchema = ErrorResponseSchema;
|
|
1559
|
+
exports.ExistsResponseSchema = ExistsResponseSchema;
|
|
1560
|
+
exports.ExternalAgentApiInsertSchema = ExternalAgentApiInsertSchema;
|
|
1561
|
+
exports.ExternalAgentApiSelectSchema = ExternalAgentApiSelectSchema;
|
|
1562
|
+
exports.ExternalAgentApiUpdateSchema = ExternalAgentApiUpdateSchema;
|
|
1563
|
+
exports.ExternalAgentInsertSchema = ExternalAgentInsertSchema;
|
|
1564
|
+
exports.ExternalAgentRelationApiInsertSchema = ExternalAgentRelationApiInsertSchema;
|
|
1565
|
+
exports.ExternalAgentRelationInsertSchema = ExternalAgentRelationInsertSchema;
|
|
1566
|
+
exports.ExternalAgentSelectSchema = ExternalAgentSelectSchema;
|
|
1567
|
+
exports.ExternalAgentUpdateSchema = ExternalAgentUpdateSchema;
|
|
1568
|
+
exports.FetchConfigSchema = FetchConfigSchema;
|
|
1569
|
+
exports.FetchDefinitionSchema = FetchDefinitionSchema;
|
|
1570
|
+
exports.FullGraphAgentInsertSchema = FullGraphAgentInsertSchema;
|
|
1571
|
+
exports.FullGraphDefinitionSchema = FullGraphDefinitionSchema;
|
|
1572
|
+
exports.HeadersScopeSchema = HeadersScopeSchema;
|
|
1573
|
+
exports.IdParamsSchema = IdParamsSchema;
|
|
1574
|
+
exports.LedgerArtifactApiInsertSchema = LedgerArtifactApiInsertSchema;
|
|
1575
|
+
exports.LedgerArtifactApiSelectSchema = LedgerArtifactApiSelectSchema;
|
|
1576
|
+
exports.LedgerArtifactApiUpdateSchema = LedgerArtifactApiUpdateSchema;
|
|
1577
|
+
exports.LedgerArtifactInsertSchema = LedgerArtifactInsertSchema;
|
|
1578
|
+
exports.LedgerArtifactSelectSchema = LedgerArtifactSelectSchema;
|
|
1579
|
+
exports.LedgerArtifactUpdateSchema = LedgerArtifactUpdateSchema;
|
|
1580
|
+
exports.ListResponseSchema = ListResponseSchema;
|
|
1581
|
+
exports.MAX_ID_LENGTH = MAX_ID_LENGTH;
|
|
1582
|
+
exports.MCPToolConfigSchema = MCPToolConfigSchema;
|
|
1583
|
+
exports.MIN_ID_LENGTH = MIN_ID_LENGTH;
|
|
1584
|
+
exports.McpToolDefinitionSchema = McpToolDefinitionSchema;
|
|
1585
|
+
exports.McpToolSchema = McpToolSchema;
|
|
1586
|
+
exports.McpTransportConfigSchema = McpTransportConfigSchema;
|
|
1587
|
+
exports.MessageApiInsertSchema = MessageApiInsertSchema;
|
|
1588
|
+
exports.MessageApiSelectSchema = MessageApiSelectSchema;
|
|
1589
|
+
exports.MessageApiUpdateSchema = MessageApiUpdateSchema;
|
|
1590
|
+
exports.MessageInsertSchema = MessageInsertSchema;
|
|
1591
|
+
exports.MessageSelectSchema = MessageSelectSchema;
|
|
1592
|
+
exports.MessageUpdateSchema = MessageUpdateSchema;
|
|
1593
|
+
exports.ModelSchema = ModelSchema;
|
|
1594
|
+
exports.ModelSettingsSchema = ModelSettingsSchema;
|
|
1595
|
+
exports.PaginationQueryParamsSchema = PaginationQueryParamsSchema;
|
|
1596
|
+
exports.PaginationSchema = PaginationSchema;
|
|
1597
|
+
exports.ProjectApiInsertSchema = ProjectApiInsertSchema;
|
|
1598
|
+
exports.ProjectApiSelectSchema = ProjectApiSelectSchema;
|
|
1599
|
+
exports.ProjectApiUpdateSchema = ProjectApiUpdateSchema;
|
|
1600
|
+
exports.ProjectInsertSchema = ProjectInsertSchema;
|
|
1601
|
+
exports.ProjectModelSchema = ProjectModelSchema;
|
|
1602
|
+
exports.ProjectSelectSchema = ProjectSelectSchema;
|
|
1603
|
+
exports.ProjectUpdateSchema = ProjectUpdateSchema;
|
|
1604
|
+
exports.RemovedResponseSchema = RemovedResponseSchema;
|
|
1605
|
+
exports.SingleResponseSchema = SingleResponseSchema;
|
|
1606
|
+
exports.StatusComponentSchema = StatusComponentSchema;
|
|
1607
|
+
exports.StatusUpdateSchema = StatusUpdateSchema;
|
|
1608
|
+
exports.TaskApiInsertSchema = TaskApiInsertSchema;
|
|
1609
|
+
exports.TaskApiSelectSchema = TaskApiSelectSchema;
|
|
1610
|
+
exports.TaskApiUpdateSchema = TaskApiUpdateSchema;
|
|
1611
|
+
exports.TaskInsertSchema = TaskInsertSchema;
|
|
1612
|
+
exports.TaskRelationApiInsertSchema = TaskRelationApiInsertSchema;
|
|
1613
|
+
exports.TaskRelationApiSelectSchema = TaskRelationApiSelectSchema;
|
|
1614
|
+
exports.TaskRelationApiUpdateSchema = TaskRelationApiUpdateSchema;
|
|
1615
|
+
exports.TaskRelationInsertSchema = TaskRelationInsertSchema;
|
|
1616
|
+
exports.TaskRelationSelectSchema = TaskRelationSelectSchema;
|
|
1617
|
+
exports.TaskRelationUpdateSchema = TaskRelationUpdateSchema;
|
|
1618
|
+
exports.TaskSelectSchema = TaskSelectSchema;
|
|
1619
|
+
exports.TaskUpdateSchema = TaskUpdateSchema;
|
|
1620
|
+
exports.TenantIdParamsSchema = TenantIdParamsSchema;
|
|
1621
|
+
exports.TenantParamsSchema = TenantParamsSchema;
|
|
1622
|
+
exports.TenantProjectIdParamsSchema = TenantProjectIdParamsSchema;
|
|
1623
|
+
exports.TenantProjectParamsSchema = TenantProjectParamsSchema;
|
|
1624
|
+
exports.ToolApiInsertSchema = ToolApiInsertSchema;
|
|
1625
|
+
exports.ToolApiSelectSchema = ToolApiSelectSchema;
|
|
1626
|
+
exports.ToolApiUpdateSchema = ToolApiUpdateSchema;
|
|
1627
|
+
exports.ToolInsertSchema = ToolInsertSchema;
|
|
1628
|
+
exports.ToolSelectSchema = ToolSelectSchema;
|
|
1629
|
+
exports.ToolStatusSchema = ToolStatusSchema;
|
|
1630
|
+
exports.ToolUpdateSchema = ToolUpdateSchema;
|
|
1631
|
+
exports.URL_SAFE_ID_PATTERN = URL_SAFE_ID_PATTERN;
|
|
1632
|
+
exports.generateIdFromName = generateIdFromName;
|
|
1633
|
+
exports.isExternalAgent = isExternalAgent;
|
|
1634
|
+
exports.isInternalAgent = isInternalAgent;
|
|
1635
|
+
exports.isValidResourceId = isValidResourceId;
|
|
1636
|
+
exports.resourceIdSchema = resourceIdSchema;
|
|
1637
|
+
exports.validateAgentRelationships = validateAgentRelationships;
|
|
1638
|
+
exports.validateAndTypeGraphData = validateAndTypeGraphData;
|
|
1639
|
+
exports.validateArtifactComponentReferences = validateArtifactComponentReferences;
|
|
1640
|
+
exports.validateDataComponentReferences = validateDataComponentReferences;
|
|
1641
|
+
exports.validateGraphStructure = validateGraphStructure;
|
|
1642
|
+
exports.validateToolReferences = validateToolReferences;
|