@inkeep/agents-core 0.1.4 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/SUPPLEMENTAL_TERMS.md +40 -0
- package/dist/chunk-BMKWVKI2.js +126 -0
- package/dist/chunk-H2F72PDA.js +15 -0
- package/dist/chunk-MKBO26DX.js +9 -0
- package/dist/chunk-MXQKLGQK.js +925 -0
- package/dist/chunk-R3VVJXX7.js +575 -0
- package/dist/chunk-SVGQSPW4.js +24 -0
- package/dist/client-exports.cjs +1702 -0
- package/dist/client-exports.js +202 -246
- package/dist/db/schema.cjs +922 -0
- package/dist/db/schema.js +1 -696
- package/dist/index.cjs +10122 -0
- package/dist/index.js +7989 -13
- package/dist/types/index.cjs +45 -0
- package/dist/types/index.js +2 -6
- package/dist/validation/index.cjs +1772 -0
- package/dist/validation/index.js +2 -5
- package/package.json +11 -6
- 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 +0 -300
- 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 +0 -4337
- 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 +0 -12
- 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 +0 -5
- 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 -174
- 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 +0 -4
- 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,575 @@
|
|
|
1
|
+
import { agents, agentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, externalAgents, apiKeys, contextConfigs, agentToolRelations, ledgerArtifacts, projects } from './chunk-MXQKLGQK.js';
|
|
2
|
+
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-SVGQSPW4.js';
|
|
3
|
+
import { z } from '@hono/zod-openapi';
|
|
4
|
+
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
5
|
+
|
|
6
|
+
var StopWhenSchema = z.object({
|
|
7
|
+
transferCountIs: z.number().min(1).max(100).optional(),
|
|
8
|
+
stepCountIs: z.number().min(1).max(1e3).optional()
|
|
9
|
+
});
|
|
10
|
+
var GraphStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true });
|
|
11
|
+
var AgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true });
|
|
12
|
+
var MIN_ID_LENGTH = 1;
|
|
13
|
+
var MAX_ID_LENGTH = 255;
|
|
14
|
+
var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
15
|
+
var resourceIdSchema = z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).regex(URL_SAFE_ID_PATTERN, {
|
|
16
|
+
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
17
|
+
}).openapi({
|
|
18
|
+
description: "Resource identifier",
|
|
19
|
+
example: "resource_789"
|
|
20
|
+
});
|
|
21
|
+
var ModelSettingsSchema = z.object({
|
|
22
|
+
model: z.string().optional(),
|
|
23
|
+
providerOptions: z.record(z.string(), z.unknown()).optional()
|
|
24
|
+
});
|
|
25
|
+
var ModelSchema = z.object({
|
|
26
|
+
base: ModelSettingsSchema.optional(),
|
|
27
|
+
structuredOutput: ModelSettingsSchema.optional(),
|
|
28
|
+
summarizer: ModelSettingsSchema.optional()
|
|
29
|
+
});
|
|
30
|
+
var ProjectModelSchema = z.object({
|
|
31
|
+
base: ModelSettingsSchema,
|
|
32
|
+
structuredOutput: ModelSettingsSchema.optional(),
|
|
33
|
+
summarizer: ModelSettingsSchema.optional()
|
|
34
|
+
});
|
|
35
|
+
var createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
36
|
+
var createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
37
|
+
var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
|
|
38
|
+
var AgentSelectSchema = createSelectSchema(agents);
|
|
39
|
+
var AgentInsertSchema = createInsertSchema(agents).extend({
|
|
40
|
+
id: resourceIdSchema,
|
|
41
|
+
models: ModelSchema.optional()
|
|
42
|
+
});
|
|
43
|
+
var AgentUpdateSchema = AgentInsertSchema.partial();
|
|
44
|
+
var AgentApiSelectSchema = createApiSchema(AgentSelectSchema);
|
|
45
|
+
var AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema);
|
|
46
|
+
var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema);
|
|
47
|
+
var AgentRelationSelectSchema = createSelectSchema(agentRelations);
|
|
48
|
+
var AgentRelationInsertSchema = createInsertSchema(agentRelations).extend({
|
|
49
|
+
id: resourceIdSchema,
|
|
50
|
+
graphId: resourceIdSchema,
|
|
51
|
+
sourceAgentId: resourceIdSchema,
|
|
52
|
+
targetAgentId: resourceIdSchema.optional(),
|
|
53
|
+
externalAgentId: resourceIdSchema.optional()
|
|
54
|
+
});
|
|
55
|
+
var AgentRelationUpdateSchema = AgentRelationInsertSchema.partial();
|
|
56
|
+
var AgentRelationApiSelectSchema = createApiSchema(AgentRelationSelectSchema);
|
|
57
|
+
var AgentRelationApiInsertSchema = createApiInsertSchema(AgentRelationInsertSchema).extend({
|
|
58
|
+
relationType: z.enum(VALID_RELATION_TYPES)
|
|
59
|
+
}).refine(
|
|
60
|
+
(data) => {
|
|
61
|
+
const hasTarget = data.targetAgentId != null;
|
|
62
|
+
const hasExternal = data.externalAgentId != null;
|
|
63
|
+
return hasTarget !== hasExternal;
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
message: "Must specify exactly one of targetAgentId or externalAgentId",
|
|
67
|
+
path: ["targetAgentId", "externalAgentId"]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
var AgentRelationApiUpdateSchema = createApiUpdateSchema(AgentRelationUpdateSchema).extend({
|
|
71
|
+
relationType: z.enum(VALID_RELATION_TYPES).optional()
|
|
72
|
+
}).refine(
|
|
73
|
+
(data) => {
|
|
74
|
+
const hasTarget = data.targetAgentId != null;
|
|
75
|
+
const hasExternal = data.externalAgentId != null;
|
|
76
|
+
if (!hasTarget && !hasExternal) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
return hasTarget !== hasExternal;
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
message: "Must specify exactly one of targetAgentId or externalAgentId when updating agent relationships",
|
|
83
|
+
path: ["targetAgentId", "externalAgentId"]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
var AgentRelationQuerySchema = z.object({
|
|
87
|
+
sourceAgentId: z.string().optional(),
|
|
88
|
+
targetAgentId: z.string().optional(),
|
|
89
|
+
externalAgentId: z.string().optional()
|
|
90
|
+
});
|
|
91
|
+
var ExternalAgentRelationInsertSchema = createInsertSchema(agentRelations).extend({
|
|
92
|
+
id: resourceIdSchema,
|
|
93
|
+
graphId: resourceIdSchema,
|
|
94
|
+
sourceAgentId: resourceIdSchema,
|
|
95
|
+
externalAgentId: resourceIdSchema
|
|
96
|
+
});
|
|
97
|
+
var ExternalAgentRelationApiInsertSchema = createApiInsertSchema(
|
|
98
|
+
ExternalAgentRelationInsertSchema
|
|
99
|
+
);
|
|
100
|
+
var AgentGraphSelectSchema = createSelectSchema(agentGraph);
|
|
101
|
+
var AgentGraphInsertSchema = createInsertSchema(agentGraph).extend({
|
|
102
|
+
id: resourceIdSchema
|
|
103
|
+
});
|
|
104
|
+
var AgentGraphUpdateSchema = AgentGraphInsertSchema.partial();
|
|
105
|
+
var AgentGraphApiSelectSchema = createApiSchema(AgentGraphSelectSchema);
|
|
106
|
+
var AgentGraphApiInsertSchema = createApiInsertSchema(AgentGraphInsertSchema).extend({
|
|
107
|
+
id: resourceIdSchema.optional()
|
|
108
|
+
});
|
|
109
|
+
var AgentGraphApiUpdateSchema = createApiUpdateSchema(AgentGraphUpdateSchema);
|
|
110
|
+
var TaskSelectSchema = createSelectSchema(tasks);
|
|
111
|
+
var TaskInsertSchema = createInsertSchema(tasks).extend({
|
|
112
|
+
id: resourceIdSchema,
|
|
113
|
+
conversationId: resourceIdSchema.optional()
|
|
114
|
+
});
|
|
115
|
+
var TaskUpdateSchema = TaskInsertSchema.partial();
|
|
116
|
+
var TaskApiSelectSchema = createApiSchema(TaskSelectSchema);
|
|
117
|
+
var TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);
|
|
118
|
+
var TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);
|
|
119
|
+
var TaskRelationSelectSchema = createSelectSchema(taskRelations);
|
|
120
|
+
var TaskRelationInsertSchema = createInsertSchema(taskRelations).extend({
|
|
121
|
+
id: resourceIdSchema,
|
|
122
|
+
parentTaskId: resourceIdSchema,
|
|
123
|
+
childTaskId: resourceIdSchema
|
|
124
|
+
});
|
|
125
|
+
var TaskRelationUpdateSchema = TaskRelationInsertSchema.partial();
|
|
126
|
+
var TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);
|
|
127
|
+
var TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);
|
|
128
|
+
var TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);
|
|
129
|
+
var imageUrlSchema = z.string().optional().refine(
|
|
130
|
+
(url) => {
|
|
131
|
+
if (!url) return true;
|
|
132
|
+
if (url.startsWith("data:image/")) {
|
|
133
|
+
const base64Part = url.split(",")[1];
|
|
134
|
+
if (!base64Part) return false;
|
|
135
|
+
return base64Part.length < 14e5;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
const parsed = new URL(url);
|
|
139
|
+
return parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
140
|
+
} catch {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
message: "Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
var McpTransportConfigSchema = z.object({
|
|
149
|
+
type: z.enum(MCPTransportType),
|
|
150
|
+
requestInit: z.record(z.string(), z.unknown()).optional(),
|
|
151
|
+
eventSourceInit: z.record(z.string(), z.unknown()).optional(),
|
|
152
|
+
reconnectionOptions: z.custom().optional(),
|
|
153
|
+
sessionId: z.string().optional()
|
|
154
|
+
});
|
|
155
|
+
var ToolStatusSchema = z.enum(TOOL_STATUS_VALUES);
|
|
156
|
+
var McpToolDefinitionSchema = z.object({
|
|
157
|
+
name: z.string(),
|
|
158
|
+
description: z.string().optional(),
|
|
159
|
+
inputSchema: z.record(z.string(), z.unknown()).optional()
|
|
160
|
+
});
|
|
161
|
+
var ToolSelectSchema = createSelectSchema(tools);
|
|
162
|
+
var ToolInsertSchema = createInsertSchema(tools).extend({
|
|
163
|
+
id: resourceIdSchema,
|
|
164
|
+
imageUrl: imageUrlSchema
|
|
165
|
+
});
|
|
166
|
+
var ConversationSelectSchema = createSelectSchema(conversations);
|
|
167
|
+
var ConversationInsertSchema = createInsertSchema(conversations).extend({
|
|
168
|
+
id: resourceIdSchema,
|
|
169
|
+
contextConfigId: resourceIdSchema.optional()
|
|
170
|
+
});
|
|
171
|
+
var ConversationUpdateSchema = ConversationInsertSchema.partial();
|
|
172
|
+
var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema);
|
|
173
|
+
var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema);
|
|
174
|
+
var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema);
|
|
175
|
+
var MessageSelectSchema = createSelectSchema(messages);
|
|
176
|
+
var MessageInsertSchema = createInsertSchema(messages).extend({
|
|
177
|
+
id: resourceIdSchema,
|
|
178
|
+
conversationId: resourceIdSchema,
|
|
179
|
+
taskId: resourceIdSchema.optional()
|
|
180
|
+
});
|
|
181
|
+
var MessageUpdateSchema = MessageInsertSchema.partial();
|
|
182
|
+
var MessageApiSelectSchema = createApiSchema(MessageSelectSchema);
|
|
183
|
+
var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema);
|
|
184
|
+
var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema);
|
|
185
|
+
var ContextCacheSelectSchema = createSelectSchema(contextCache);
|
|
186
|
+
var ContextCacheInsertSchema = createInsertSchema(contextCache);
|
|
187
|
+
var ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
|
|
188
|
+
var ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);
|
|
189
|
+
var ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);
|
|
190
|
+
var ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);
|
|
191
|
+
var DataComponentSelectSchema = createSelectSchema(dataComponents);
|
|
192
|
+
var DataComponentInsertSchema = createInsertSchema(dataComponents).extend({
|
|
193
|
+
id: resourceIdSchema
|
|
194
|
+
});
|
|
195
|
+
var DataComponentBaseSchema = DataComponentInsertSchema.omit({
|
|
196
|
+
createdAt: true,
|
|
197
|
+
updatedAt: true
|
|
198
|
+
});
|
|
199
|
+
var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
|
|
200
|
+
var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema);
|
|
201
|
+
var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema);
|
|
202
|
+
var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema);
|
|
203
|
+
var AgentDataComponentSelectSchema = createSelectSchema(agentDataComponents);
|
|
204
|
+
var AgentDataComponentInsertSchema = createInsertSchema(agentDataComponents);
|
|
205
|
+
var AgentDataComponentUpdateSchema = AgentDataComponentInsertSchema.partial();
|
|
206
|
+
var AgentDataComponentApiSelectSchema = createApiSchema(AgentDataComponentSelectSchema);
|
|
207
|
+
var AgentDataComponentApiInsertSchema = createApiInsertSchema(
|
|
208
|
+
AgentDataComponentInsertSchema
|
|
209
|
+
);
|
|
210
|
+
var AgentDataComponentApiUpdateSchema = createApiUpdateSchema(
|
|
211
|
+
AgentDataComponentUpdateSchema
|
|
212
|
+
);
|
|
213
|
+
var ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);
|
|
214
|
+
var ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({
|
|
215
|
+
id: resourceIdSchema
|
|
216
|
+
});
|
|
217
|
+
var ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();
|
|
218
|
+
var ArtifactComponentApiSelectSchema = createApiSchema(ArtifactComponentSelectSchema);
|
|
219
|
+
var ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({
|
|
220
|
+
tenantId: true,
|
|
221
|
+
projectId: true,
|
|
222
|
+
createdAt: true,
|
|
223
|
+
updatedAt: true
|
|
224
|
+
}).extend({
|
|
225
|
+
id: resourceIdSchema.optional()
|
|
226
|
+
});
|
|
227
|
+
var ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
|
|
228
|
+
ArtifactComponentUpdateSchema
|
|
229
|
+
);
|
|
230
|
+
var AgentArtifactComponentSelectSchema = createSelectSchema(agentArtifactComponents);
|
|
231
|
+
var AgentArtifactComponentInsertSchema = createInsertSchema(
|
|
232
|
+
agentArtifactComponents
|
|
233
|
+
).extend({
|
|
234
|
+
id: resourceIdSchema,
|
|
235
|
+
agentId: resourceIdSchema,
|
|
236
|
+
artifactComponentId: resourceIdSchema
|
|
237
|
+
});
|
|
238
|
+
var AgentArtifactComponentUpdateSchema = AgentArtifactComponentInsertSchema.partial();
|
|
239
|
+
var AgentArtifactComponentApiSelectSchema = createApiSchema(
|
|
240
|
+
AgentArtifactComponentSelectSchema
|
|
241
|
+
);
|
|
242
|
+
var AgentArtifactComponentApiInsertSchema = AgentArtifactComponentInsertSchema.omit({
|
|
243
|
+
tenantId: true,
|
|
244
|
+
projectId: true,
|
|
245
|
+
id: true,
|
|
246
|
+
createdAt: true
|
|
247
|
+
});
|
|
248
|
+
var AgentArtifactComponentApiUpdateSchema = createApiUpdateSchema(
|
|
249
|
+
AgentArtifactComponentUpdateSchema
|
|
250
|
+
);
|
|
251
|
+
var ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
252
|
+
credentialReferenceId: z.string().nullable().optional(),
|
|
253
|
+
headers: z.record(z.string(), z.string()).nullable().optional()
|
|
254
|
+
});
|
|
255
|
+
var ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
|
|
256
|
+
id: resourceIdSchema
|
|
257
|
+
});
|
|
258
|
+
var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
|
|
259
|
+
var ExternalAgentApiSelectSchema = createApiSchema(ExternalAgentSelectSchema);
|
|
260
|
+
var ExternalAgentApiInsertSchema = createApiInsertSchema(ExternalAgentInsertSchema);
|
|
261
|
+
var ExternalAgentApiUpdateSchema = createApiUpdateSchema(ExternalAgentUpdateSchema);
|
|
262
|
+
var AllAgentSchema = z.discriminatedUnion("type", [
|
|
263
|
+
AgentApiSelectSchema.extend({ type: z.literal("internal") }),
|
|
264
|
+
ExternalAgentApiSelectSchema.extend({ type: z.literal("external") })
|
|
265
|
+
]);
|
|
266
|
+
var ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
267
|
+
var ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
|
|
268
|
+
id: resourceIdSchema,
|
|
269
|
+
graphId: resourceIdSchema
|
|
270
|
+
});
|
|
271
|
+
var ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({
|
|
272
|
+
tenantId: true,
|
|
273
|
+
projectId: true,
|
|
274
|
+
id: true,
|
|
275
|
+
publicId: true,
|
|
276
|
+
keyHash: true,
|
|
277
|
+
keyPrefix: true,
|
|
278
|
+
createdAt: true
|
|
279
|
+
});
|
|
280
|
+
var ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({
|
|
281
|
+
tenantId: true,
|
|
282
|
+
projectId: true,
|
|
283
|
+
keyHash: true
|
|
284
|
+
// Never expose the hash
|
|
285
|
+
});
|
|
286
|
+
var ApiKeyApiCreationResponseSchema = z.object({
|
|
287
|
+
data: z.object({
|
|
288
|
+
apiKey: ApiKeyApiSelectSchema,
|
|
289
|
+
key: z.string().describe("The full API key (shown only once)")
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
var ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
293
|
+
tenantId: true,
|
|
294
|
+
projectId: true,
|
|
295
|
+
id: true,
|
|
296
|
+
// Auto-generated
|
|
297
|
+
publicId: true,
|
|
298
|
+
// Auto-generated
|
|
299
|
+
keyHash: true,
|
|
300
|
+
// Auto-generated
|
|
301
|
+
keyPrefix: true,
|
|
302
|
+
// Auto-generated
|
|
303
|
+
lastUsedAt: true
|
|
304
|
+
// Not set on creation
|
|
305
|
+
});
|
|
306
|
+
var ApiKeyApiUpdateSchema = ApiKeyUpdateSchema;
|
|
307
|
+
var CredentialReferenceSelectSchema = z.object({
|
|
308
|
+
id: z.string(),
|
|
309
|
+
tenantId: z.string(),
|
|
310
|
+
projectId: z.string(),
|
|
311
|
+
type: z.string(),
|
|
312
|
+
credentialStoreId: z.string(),
|
|
313
|
+
retrievalParams: z.record(z.string(), z.unknown()).nullish(),
|
|
314
|
+
createdAt: z.string(),
|
|
315
|
+
updatedAt: z.string()
|
|
316
|
+
});
|
|
317
|
+
var CredentialReferenceInsertSchema = z.object({
|
|
318
|
+
id: resourceIdSchema,
|
|
319
|
+
tenantId: z.string(),
|
|
320
|
+
projectId: z.string(),
|
|
321
|
+
type: z.string(),
|
|
322
|
+
credentialStoreId: resourceIdSchema,
|
|
323
|
+
retrievalParams: z.record(z.string(), z.unknown()).nullish()
|
|
324
|
+
});
|
|
325
|
+
var CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
326
|
+
var CredentialReferenceApiSelectSchema = createApiSchema(
|
|
327
|
+
CredentialReferenceSelectSchema
|
|
328
|
+
).extend({
|
|
329
|
+
type: z.enum(CredentialStoreType)
|
|
330
|
+
});
|
|
331
|
+
var CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
332
|
+
CredentialReferenceInsertSchema
|
|
333
|
+
).extend({
|
|
334
|
+
type: z.enum(CredentialStoreType)
|
|
335
|
+
});
|
|
336
|
+
var CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
|
|
337
|
+
CredentialReferenceUpdateSchema
|
|
338
|
+
).extend({
|
|
339
|
+
type: z.enum(CredentialStoreType).optional()
|
|
340
|
+
});
|
|
341
|
+
var McpToolSchema = ToolInsertSchema.extend({
|
|
342
|
+
imageUrl: imageUrlSchema,
|
|
343
|
+
status: ToolStatusSchema.default("unknown"),
|
|
344
|
+
lastHealthCheck: z.date().optional(),
|
|
345
|
+
lastToolsSync: z.date().optional(),
|
|
346
|
+
version: z.string().optional(),
|
|
347
|
+
createdAt: z.date(),
|
|
348
|
+
updatedAt: z.date()
|
|
349
|
+
});
|
|
350
|
+
var MCPToolConfigSchema = McpToolSchema.omit({
|
|
351
|
+
config: true,
|
|
352
|
+
tenantId: true,
|
|
353
|
+
projectId: true,
|
|
354
|
+
status: true,
|
|
355
|
+
lastHealthCheck: true,
|
|
356
|
+
lastToolsSync: true,
|
|
357
|
+
version: true,
|
|
358
|
+
createdAt: true,
|
|
359
|
+
updatedAt: true,
|
|
360
|
+
credentialReferenceId: true
|
|
361
|
+
}).extend({
|
|
362
|
+
tenantId: z.string().optional(),
|
|
363
|
+
projectId: z.string().optional(),
|
|
364
|
+
description: z.string().optional(),
|
|
365
|
+
serverUrl: z.url(),
|
|
366
|
+
activeTools: z.array(z.string()).optional(),
|
|
367
|
+
mcpType: z.enum(MCPServerType).optional(),
|
|
368
|
+
transport: McpTransportConfigSchema.optional(),
|
|
369
|
+
credential: CredentialReferenceApiInsertSchema.optional()
|
|
370
|
+
});
|
|
371
|
+
var ToolUpdateSchema = ToolInsertSchema.partial();
|
|
372
|
+
var ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
|
|
373
|
+
var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
|
|
374
|
+
var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
|
|
375
|
+
var FetchConfigSchema = z.object({
|
|
376
|
+
url: z.string().min(1, "URL is required"),
|
|
377
|
+
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
378
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
379
|
+
body: z.record(z.string(), z.unknown()).optional(),
|
|
380
|
+
transform: z.string().optional(),
|
|
381
|
+
// JSONPath or JS transform function
|
|
382
|
+
timeout: z.number().min(0).optional().default(1e4).optional()
|
|
383
|
+
});
|
|
384
|
+
var FetchDefinitionSchema = z.object({
|
|
385
|
+
id: z.string().min(1, "Fetch definition ID is required"),
|
|
386
|
+
name: z.string().optional(),
|
|
387
|
+
trigger: z.enum(["initialization", "invocation"]),
|
|
388
|
+
fetchConfig: FetchConfigSchema,
|
|
389
|
+
responseSchema: z.any().optional(),
|
|
390
|
+
// JSON Schema for validating HTTP response
|
|
391
|
+
defaultValue: z.unknown().optional(),
|
|
392
|
+
credential: CredentialReferenceApiInsertSchema.optional()
|
|
393
|
+
});
|
|
394
|
+
var ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
|
|
395
|
+
requestContextSchema: z.unknown().optional()
|
|
396
|
+
});
|
|
397
|
+
var ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
|
|
398
|
+
id: resourceIdSchema,
|
|
399
|
+
requestContextSchema: z.unknown().optional()
|
|
400
|
+
}).omit({
|
|
401
|
+
createdAt: true,
|
|
402
|
+
updatedAt: true
|
|
403
|
+
});
|
|
404
|
+
var ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();
|
|
405
|
+
var ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema);
|
|
406
|
+
var ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema);
|
|
407
|
+
var ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema);
|
|
408
|
+
var AgentToolRelationSelectSchema = createSelectSchema(agentToolRelations);
|
|
409
|
+
var AgentToolRelationInsertSchema = createInsertSchema(agentToolRelations).extend({
|
|
410
|
+
id: resourceIdSchema,
|
|
411
|
+
agentId: resourceIdSchema,
|
|
412
|
+
toolId: resourceIdSchema,
|
|
413
|
+
selectedTools: z.array(z.string()).nullish()
|
|
414
|
+
});
|
|
415
|
+
var AgentToolRelationUpdateSchema = AgentToolRelationInsertSchema.partial();
|
|
416
|
+
var AgentToolRelationApiSelectSchema = createApiSchema(AgentToolRelationSelectSchema);
|
|
417
|
+
var AgentToolRelationApiInsertSchema = createApiInsertSchema(
|
|
418
|
+
AgentToolRelationInsertSchema
|
|
419
|
+
);
|
|
420
|
+
var AgentToolRelationApiUpdateSchema = createApiUpdateSchema(
|
|
421
|
+
AgentToolRelationUpdateSchema
|
|
422
|
+
);
|
|
423
|
+
var LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
|
|
424
|
+
var LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);
|
|
425
|
+
var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
|
|
426
|
+
var LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
|
|
427
|
+
var LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
|
|
428
|
+
var LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);
|
|
429
|
+
var StatusComponentSchema = z.object({
|
|
430
|
+
type: z.string(),
|
|
431
|
+
description: z.string().optional(),
|
|
432
|
+
detailsSchema: z.object({
|
|
433
|
+
type: z.literal("object"),
|
|
434
|
+
properties: z.record(z.string(), z.any()),
|
|
435
|
+
required: z.array(z.string()).optional()
|
|
436
|
+
}).optional()
|
|
437
|
+
});
|
|
438
|
+
var StatusUpdateSchema = z.object({
|
|
439
|
+
enabled: z.boolean().optional(),
|
|
440
|
+
numEvents: z.number().min(1).max(100).optional(),
|
|
441
|
+
timeInSeconds: z.number().min(1).max(600).optional(),
|
|
442
|
+
prompt: z.string().max(2e3, "Custom prompt cannot exceed 2000 characters").optional(),
|
|
443
|
+
statusComponents: z.array(StatusComponentSchema).optional()
|
|
444
|
+
});
|
|
445
|
+
var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
|
|
446
|
+
tools: z.array(z.string()),
|
|
447
|
+
selectedTools: z.record(z.string(), z.array(z.string())).optional(),
|
|
448
|
+
dataComponents: z.array(z.string()).optional(),
|
|
449
|
+
artifactComponents: z.array(z.string()).optional(),
|
|
450
|
+
canTransferTo: z.array(z.string()).optional(),
|
|
451
|
+
canDelegateTo: z.array(z.string()).optional()
|
|
452
|
+
});
|
|
453
|
+
var FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
|
|
454
|
+
agents: z.record(z.string(), z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])),
|
|
455
|
+
tools: z.record(z.string(), ToolApiInsertSchema).optional(),
|
|
456
|
+
credentialReferences: z.array(CredentialReferenceApiInsertSchema).optional(),
|
|
457
|
+
dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),
|
|
458
|
+
artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
459
|
+
contextConfig: z.optional(ContextConfigApiInsertSchema),
|
|
460
|
+
statusUpdates: z.optional(StatusUpdateSchema),
|
|
461
|
+
models: ModelSchema.optional(),
|
|
462
|
+
stopWhen: GraphStopWhenSchema.optional(),
|
|
463
|
+
graphPrompt: z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
464
|
+
});
|
|
465
|
+
var GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
|
|
466
|
+
agents: z.record(z.string(), z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])),
|
|
467
|
+
models: ModelSchema.optional(),
|
|
468
|
+
stopWhen: GraphStopWhenSchema.optional(),
|
|
469
|
+
graphPrompt: z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
|
|
470
|
+
});
|
|
471
|
+
var PaginationSchema = z.object({
|
|
472
|
+
page: z.coerce.number().min(1).default(1),
|
|
473
|
+
limit: z.coerce.number().min(1).max(100).default(10),
|
|
474
|
+
total: z.number(),
|
|
475
|
+
pages: z.number()
|
|
476
|
+
});
|
|
477
|
+
var ListResponseSchema = (itemSchema) => z.object({
|
|
478
|
+
data: z.array(itemSchema),
|
|
479
|
+
pagination: PaginationSchema
|
|
480
|
+
});
|
|
481
|
+
var SingleResponseSchema = (itemSchema) => z.object({
|
|
482
|
+
data: itemSchema
|
|
483
|
+
});
|
|
484
|
+
var ErrorResponseSchema = z.object({
|
|
485
|
+
error: z.string(),
|
|
486
|
+
message: z.string().optional(),
|
|
487
|
+
details: z.unknown().optional()
|
|
488
|
+
});
|
|
489
|
+
var ExistsResponseSchema = z.object({
|
|
490
|
+
exists: z.boolean()
|
|
491
|
+
});
|
|
492
|
+
var RemovedResponseSchema = z.object({
|
|
493
|
+
message: z.string(),
|
|
494
|
+
removed: z.boolean()
|
|
495
|
+
});
|
|
496
|
+
var ProjectSelectSchema = createSelectSchema(projects);
|
|
497
|
+
var ProjectInsertSchema = createInsertSchema(projects).extend({
|
|
498
|
+
models: ProjectModelSchema.optional(),
|
|
499
|
+
stopWhen: StopWhenSchema.optional()
|
|
500
|
+
}).omit({
|
|
501
|
+
createdAt: true,
|
|
502
|
+
updatedAt: true
|
|
503
|
+
});
|
|
504
|
+
var ProjectUpdateSchema = ProjectInsertSchema.partial();
|
|
505
|
+
var ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true });
|
|
506
|
+
var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true });
|
|
507
|
+
var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
|
|
508
|
+
var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
509
|
+
graphs: z.record(z.string(), GraphWithinContextOfProjectSchema),
|
|
510
|
+
tools: z.record(z.string(), ToolApiInsertSchema),
|
|
511
|
+
dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),
|
|
512
|
+
artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
513
|
+
contextConfig: z.record(z.string(), ContextConfigApiInsertSchema).optional(),
|
|
514
|
+
statusUpdates: z.optional(StatusUpdateSchema),
|
|
515
|
+
credentialReferences: z.array(CredentialReferenceApiInsertSchema).optional(),
|
|
516
|
+
createdAt: z.string().optional(),
|
|
517
|
+
updatedAt: z.string().optional()
|
|
518
|
+
});
|
|
519
|
+
var HeadersScopeSchema = z.object({
|
|
520
|
+
"x-inkeep-tenant-id": z.string().optional().openapi({
|
|
521
|
+
description: "Tenant identifier",
|
|
522
|
+
example: "tenant_123"
|
|
523
|
+
}),
|
|
524
|
+
"x-inkeep-project-id": z.string().optional().openapi({
|
|
525
|
+
description: "Project identifier",
|
|
526
|
+
example: "project_456"
|
|
527
|
+
}),
|
|
528
|
+
"x-inkeep-graph-id": z.string().optional().openapi({
|
|
529
|
+
description: "Graph identifier",
|
|
530
|
+
example: "graph_789"
|
|
531
|
+
})
|
|
532
|
+
});
|
|
533
|
+
var TenantParamsSchema = z.object({
|
|
534
|
+
tenantId: z.string().openapi({
|
|
535
|
+
description: "Tenant identifier",
|
|
536
|
+
example: "tenant_123"
|
|
537
|
+
})
|
|
538
|
+
}).openapi("TenantParams");
|
|
539
|
+
var TenantProjectParamsSchema = z.object({
|
|
540
|
+
tenantId: z.string().openapi({
|
|
541
|
+
description: "Tenant identifier",
|
|
542
|
+
example: "tenant_123"
|
|
543
|
+
}),
|
|
544
|
+
projectId: z.string().openapi({
|
|
545
|
+
description: "Project identifier",
|
|
546
|
+
example: "project_456"
|
|
547
|
+
})
|
|
548
|
+
}).openapi("TenantProjectParams");
|
|
549
|
+
var TenantProjectIdParamsSchema = z.object({
|
|
550
|
+
tenantId: z.string().openapi({
|
|
551
|
+
description: "Tenant identifier",
|
|
552
|
+
example: "tenant_123"
|
|
553
|
+
}),
|
|
554
|
+
projectId: z.string().openapi({
|
|
555
|
+
description: "Project identifier",
|
|
556
|
+
example: "project_456"
|
|
557
|
+
}),
|
|
558
|
+
id: resourceIdSchema
|
|
559
|
+
}).openapi("TenantProjectIdParams");
|
|
560
|
+
var TenantIdParamsSchema = z.object({
|
|
561
|
+
tenantId: z.string().openapi({
|
|
562
|
+
description: "Tenant identifier",
|
|
563
|
+
example: "tenant_123"
|
|
564
|
+
}),
|
|
565
|
+
id: resourceIdSchema
|
|
566
|
+
}).openapi("TenantIdParams");
|
|
567
|
+
var IdParamsSchema = z.object({
|
|
568
|
+
id: resourceIdSchema
|
|
569
|
+
}).openapi("IdParams");
|
|
570
|
+
var PaginationQueryParamsSchema = z.object({
|
|
571
|
+
page: z.coerce.number().min(1).default(1),
|
|
572
|
+
limit: z.coerce.number().min(1).max(100).default(10)
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentStopWhenSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/types/utility.ts
|
|
2
|
+
var TOOL_STATUS_VALUES = [
|
|
3
|
+
"healthy",
|
|
4
|
+
"unhealthy",
|
|
5
|
+
"unknown",
|
|
6
|
+
"disabled",
|
|
7
|
+
"needs_auth"
|
|
8
|
+
];
|
|
9
|
+
var VALID_RELATION_TYPES = ["transfer", "delegate"];
|
|
10
|
+
var MCPTransportType = {
|
|
11
|
+
streamableHttp: "streamable_http",
|
|
12
|
+
sse: "sse"
|
|
13
|
+
};
|
|
14
|
+
var MCPServerType = {
|
|
15
|
+
nango: "nango",
|
|
16
|
+
generic: "generic"
|
|
17
|
+
};
|
|
18
|
+
var CredentialStoreType = {
|
|
19
|
+
memory: "memory",
|
|
20
|
+
keychain: "keychain",
|
|
21
|
+
nango: "nango"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES };
|