@inkeep/agents-core 0.37.0 → 0.37.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-schema.d.ts +47 -1
- package/dist/auth/auth-schema.js +1 -1
- package/dist/auth/auth-validation-schemas.d.ts +35 -1
- package/dist/auth/auth-validation-schemas.js +18 -18
- package/dist/auth/auth.d.ts +23 -23
- package/dist/auth/auth.js +13 -5
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/auth/permissions.js +1 -1
- package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
- package/dist/{chunk-ICZLNCX7.js → chunk-3HACEHXF.js} +370 -71
- package/dist/{chunk-32YRH2S7.js → chunk-5QZSNATS.js} +63 -67
- package/dist/{chunk-SSRRHYU4.js → chunk-6CYQZ5KX.js} +4 -5
- package/dist/{chunk-SLQW43IV.js → chunk-BJLC7EI4.js} +4 -5
- package/dist/chunk-CMNLBV2A.js +39 -0
- package/dist/{chunk-NFYCSHD3.js → chunk-DEYPSEXR.js} +2 -1
- package/dist/chunk-GENLXHZ4.js +159 -0
- package/dist/{chunk-VMSYBWFH.js → chunk-JNBVHWXX.js} +7 -4
- package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
- package/dist/{chunk-Q5U2SVA6.js → chunk-RUTYLJB7.js} +11 -7
- package/dist/{chunk-VQXQOGJU.js → chunk-XHODTX4H.js} +313 -315
- package/dist/{chunk-MB2ZIPZS.js → chunk-YSFXXC6K.js} +5 -5
- package/dist/{chunk-SG75RA63.js → chunk-ZSYMSL55.js} +2 -2
- package/dist/{client-CnpNkGsH.d.ts → client-B3nwdklT.d.ts} +1 -1
- package/dist/client-exports.d.ts +10 -8
- package/dist/client-exports.js +126 -127
- package/dist/constants/schema-validation/index.js +1 -1
- package/dist/credential-stores/index.d.ts +4 -5
- package/dist/credential-stores/index.js +1 -1
- package/dist/db/schema.d.ts +3 -4
- package/dist/db/schema.js +2 -2
- package/dist/db/test-client.d.ts +4 -5
- package/dist/db/test-client.js +1 -1
- package/dist/index.d.ts +675 -558
- package/dist/index.js +297 -76
- package/dist/{schema-Cgkp_geg.d.ts → schema-BhYTubhP.d.ts} +24 -1
- package/dist/server-CHLmv-Jb.d.ts +127 -0
- package/dist/types/index.d.ts +34 -115
- package/dist/types/index.js +1 -1
- package/dist/{utility-C_tTZ7-k.d.ts → utility-5USfJ5Xd.d.ts} +588 -459
- package/dist/utils/schema-conversion.d.ts +1 -1
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.d.ts +131 -132
- package/dist/validation/index.js +2 -2
- package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
- package/drizzle/0002_puzzling_goblin_queen.sql +8 -0
- package/drizzle/0003_sweet_human_robot.sql +8 -0
- package/drizzle/meta/0001_snapshot.json +7 -1
- package/drizzle/meta/0002_snapshot.json +3637 -0
- package/drizzle/meta/0003_snapshot.json +3643 -0
- package/drizzle/meta/_journal.json +16 -2
- package/package.json +11 -3
- package/dist/chunk-CUM6BY2Y.js +0 -320
- package/dist/chunk-H2F72PDA.js +0 -15
- package/dist/chunk-NOPEANIU.js +0 -82
- package/dist/chunk-OUXC23J7.js +0 -12534
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { subAgents, subAgentRelations, agents, tasks, taskRelations, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, tools, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-
|
|
1
|
+
import { subAgents, subAgentRelations, agents, tasks, taskRelations, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, tools, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-DEYPSEXR.js';
|
|
2
2
|
import { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
|
|
3
3
|
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
|
|
4
|
-
import {
|
|
4
|
+
import { z } from '@hono/zod-openapi';
|
|
5
5
|
import { createSelectSchema as createSelectSchema$1, createInsertSchema as createInsertSchema$1 } from 'drizzle-zod';
|
|
6
6
|
import Ajv from 'ajv';
|
|
7
7
|
|
|
8
8
|
var MIN_ID_LENGTH = 1;
|
|
9
9
|
var MAX_ID_LENGTH = 255;
|
|
10
10
|
var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
11
|
-
var resourceIdSchema =
|
|
11
|
+
var resourceIdSchema = z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
|
|
12
12
|
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
13
13
|
}).openapi({
|
|
14
14
|
description: "Resource identifier",
|
|
@@ -31,12 +31,12 @@ var FIELD_MODIFIERS = {
|
|
|
31
31
|
return modified;
|
|
32
32
|
},
|
|
33
33
|
name: (_schema) => {
|
|
34
|
-
const modified =
|
|
34
|
+
const modified = z.string().describe("Name");
|
|
35
35
|
modified.meta({ description: "Name" });
|
|
36
36
|
return modified;
|
|
37
37
|
},
|
|
38
38
|
description: (_schema) => {
|
|
39
|
-
const modified =
|
|
39
|
+
const modified = z.string().describe("Description");
|
|
40
40
|
modified.meta({ description: "Description" });
|
|
41
41
|
return modified;
|
|
42
42
|
},
|
|
@@ -106,7 +106,7 @@ function createInsertSchemaWithModifiers(table, overrides) {
|
|
|
106
106
|
var createSelectSchema = createSelectSchemaWithModifiers;
|
|
107
107
|
var createInsertSchema = createInsertSchemaWithModifiers;
|
|
108
108
|
function registerFieldSchemas(schema) {
|
|
109
|
-
if (!(schema instanceof
|
|
109
|
+
if (!(schema instanceof z.ZodObject)) {
|
|
110
110
|
return schema;
|
|
111
111
|
}
|
|
112
112
|
const shape = schema.shape;
|
|
@@ -125,12 +125,12 @@ function registerFieldSchemas(schema) {
|
|
|
125
125
|
if (fieldName in fieldMetadata && fieldSchema) {
|
|
126
126
|
let zodFieldSchema = fieldSchema;
|
|
127
127
|
let innerSchema = null;
|
|
128
|
-
if (zodFieldSchema instanceof
|
|
128
|
+
if (zodFieldSchema instanceof z.ZodOptional) {
|
|
129
129
|
innerSchema = zodFieldSchema._def.innerType;
|
|
130
130
|
zodFieldSchema = innerSchema;
|
|
131
131
|
}
|
|
132
132
|
zodFieldSchema.meta(fieldMetadata[fieldName]);
|
|
133
|
-
if (fieldName === "id" && zodFieldSchema instanceof
|
|
133
|
+
if (fieldName === "id" && zodFieldSchema instanceof z.ZodString) {
|
|
134
134
|
zodFieldSchema.openapi({
|
|
135
135
|
description: "Resource identifier",
|
|
136
136
|
minLength: MIN_ID_LENGTH,
|
|
@@ -138,20 +138,18 @@ function registerFieldSchemas(schema) {
|
|
|
138
138
|
pattern: URL_SAFE_ID_PATTERN.source,
|
|
139
139
|
example: "resource_789"
|
|
140
140
|
});
|
|
141
|
-
} else if (zodFieldSchema instanceof
|
|
141
|
+
} else if (zodFieldSchema instanceof z.ZodString) {
|
|
142
142
|
zodFieldSchema.openapi({
|
|
143
143
|
description: fieldMetadata[fieldName].description
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
if (innerSchema && fieldSchema instanceof
|
|
146
|
+
if (innerSchema && fieldSchema instanceof z.ZodOptional) {
|
|
147
147
|
fieldSchema.meta(fieldMetadata[fieldName]);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
return schema;
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
// src/validation/schemas.ts
|
|
155
153
|
var {
|
|
156
154
|
AGENT_EXECUTION_TRANSFER_COUNT_MAX,
|
|
157
155
|
AGENT_EXECUTION_TRANSFER_COUNT_MIN,
|
|
@@ -163,9 +161,9 @@ var {
|
|
|
163
161
|
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
164
162
|
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS
|
|
165
163
|
} = schemaValidationDefaults;
|
|
166
|
-
var StopWhenSchema =
|
|
167
|
-
transferCountIs:
|
|
168
|
-
stepCountIs:
|
|
164
|
+
var StopWhenSchema = z.object({
|
|
165
|
+
transferCountIs: z.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX).optional().describe("The maximum number of transfers to trigger the stop condition."),
|
|
166
|
+
stepCountIs: z.number().min(SUB_AGENT_TURN_GENERATION_STEPS_MIN).max(SUB_AGENT_TURN_GENERATION_STEPS_MAX).optional().describe("The maximum number of steps to trigger the stop condition.")
|
|
169
167
|
}).openapi("StopWhen");
|
|
170
168
|
var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(
|
|
171
169
|
"AgentStopWhen"
|
|
@@ -173,28 +171,28 @@ var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi
|
|
|
173
171
|
var SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(
|
|
174
172
|
"SubAgentStopWhen"
|
|
175
173
|
);
|
|
176
|
-
var pageNumber =
|
|
177
|
-
var limitNumber =
|
|
178
|
-
var ModelSettingsSchema =
|
|
179
|
-
model:
|
|
180
|
-
providerOptions:
|
|
174
|
+
var pageNumber = z.coerce.number().min(1).default(1).openapi("PaginationPageQueryParam");
|
|
175
|
+
var limitNumber = z.coerce.number().min(1).max(100).default(10).openapi("PaginationLimitQueryParam");
|
|
176
|
+
var ModelSettingsSchema = z.object({
|
|
177
|
+
model: z.string().optional().describe("The model to use for the project."),
|
|
178
|
+
providerOptions: z.record(z.string(), z.any()).optional().describe("The provider options to use for the project.")
|
|
181
179
|
}).openapi("ModelSettings");
|
|
182
|
-
var ModelSchema =
|
|
180
|
+
var ModelSchema = z.object({
|
|
183
181
|
base: ModelSettingsSchema.optional(),
|
|
184
182
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
185
183
|
summarizer: ModelSettingsSchema.optional()
|
|
186
184
|
}).openapi("Model");
|
|
187
|
-
var ProjectModelSchema =
|
|
185
|
+
var ProjectModelSchema = z.object({
|
|
188
186
|
base: ModelSettingsSchema,
|
|
189
187
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
190
188
|
summarizer: ModelSettingsSchema.optional()
|
|
191
189
|
}).openapi("ProjectModel");
|
|
192
|
-
var FunctionToolConfigSchema =
|
|
193
|
-
name:
|
|
194
|
-
description:
|
|
195
|
-
inputSchema:
|
|
196
|
-
dependencies:
|
|
197
|
-
execute:
|
|
190
|
+
var FunctionToolConfigSchema = z.object({
|
|
191
|
+
name: z.string(),
|
|
192
|
+
description: z.string(),
|
|
193
|
+
inputSchema: z.record(z.string(), z.unknown()),
|
|
194
|
+
dependencies: z.record(z.string(), z.string()).optional(),
|
|
195
|
+
execute: z.union([z.function(), z.string()])
|
|
198
196
|
});
|
|
199
197
|
var createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
200
198
|
var createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
@@ -227,7 +225,7 @@ var SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
|
227
225
|
var SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
228
226
|
SubAgentRelationInsertSchema
|
|
229
227
|
).extend({
|
|
230
|
-
relationType:
|
|
228
|
+
relationType: z.enum(VALID_RELATION_TYPES)
|
|
231
229
|
}).refine(
|
|
232
230
|
(data) => {
|
|
233
231
|
const hasTarget = data.targetSubAgentId != null;
|
|
@@ -244,7 +242,7 @@ var SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
|
244
242
|
var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
245
243
|
SubAgentRelationUpdateSchema
|
|
246
244
|
).extend({
|
|
247
|
-
relationType:
|
|
245
|
+
relationType: z.enum(VALID_RELATION_TYPES).optional()
|
|
248
246
|
}).refine(
|
|
249
247
|
(data) => {
|
|
250
248
|
const hasTarget = data.targetSubAgentId != null;
|
|
@@ -261,11 +259,11 @@ var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
|
261
259
|
path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
|
|
262
260
|
}
|
|
263
261
|
).openapi("SubAgentRelationUpdate");
|
|
264
|
-
var SubAgentRelationQuerySchema =
|
|
265
|
-
sourceSubAgentId:
|
|
266
|
-
targetSubAgentId:
|
|
267
|
-
externalSubAgentId:
|
|
268
|
-
teamSubAgentId:
|
|
262
|
+
var SubAgentRelationQuerySchema = z.object({
|
|
263
|
+
sourceSubAgentId: z.string().optional(),
|
|
264
|
+
targetSubAgentId: z.string().optional(),
|
|
265
|
+
externalSubAgentId: z.string().optional(),
|
|
266
|
+
teamSubAgentId: z.string().optional()
|
|
269
267
|
});
|
|
270
268
|
var ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
271
269
|
id: resourceIdSchema,
|
|
@@ -279,7 +277,7 @@ var ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
|
|
|
279
277
|
var AgentSelectSchema = createSelectSchema(agents);
|
|
280
278
|
var AgentInsertSchema = createInsertSchema(agents).extend({
|
|
281
279
|
id: resourceIdSchema,
|
|
282
|
-
name:
|
|
280
|
+
name: z.string().trim().nonempty()
|
|
283
281
|
});
|
|
284
282
|
var AgentUpdateSchema = AgentInsertSchema.partial();
|
|
285
283
|
var AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi("Agent");
|
|
@@ -306,7 +304,7 @@ var TaskRelationUpdateSchema = TaskRelationInsertSchema.partial();
|
|
|
306
304
|
var TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);
|
|
307
305
|
var TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);
|
|
308
306
|
var TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);
|
|
309
|
-
var imageUrlSchema =
|
|
307
|
+
var imageUrlSchema = z.string().optional().refine(
|
|
310
308
|
(url) => {
|
|
311
309
|
if (!url) return true;
|
|
312
310
|
if (url.startsWith("data:image/")) {
|
|
@@ -325,43 +323,43 @@ var imageUrlSchema = external_exports.string().optional().refine(
|
|
|
325
323
|
message: "Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"
|
|
326
324
|
}
|
|
327
325
|
);
|
|
328
|
-
var McpTransportConfigSchema =
|
|
329
|
-
type:
|
|
330
|
-
requestInit:
|
|
331
|
-
eventSourceInit:
|
|
332
|
-
reconnectionOptions:
|
|
326
|
+
var McpTransportConfigSchema = z.object({
|
|
327
|
+
type: z.enum(MCPTransportType),
|
|
328
|
+
requestInit: z.record(z.string(), z.unknown()).optional(),
|
|
329
|
+
eventSourceInit: z.record(z.string(), z.unknown()).optional(),
|
|
330
|
+
reconnectionOptions: z.any().optional().openapi({
|
|
333
331
|
type: "object",
|
|
334
332
|
description: "Reconnection options for streamable HTTP transport"
|
|
335
333
|
}),
|
|
336
|
-
sessionId:
|
|
334
|
+
sessionId: z.string().optional()
|
|
337
335
|
}).openapi("McpTransportConfig");
|
|
338
|
-
var ToolStatusSchema =
|
|
339
|
-
var McpToolDefinitionSchema =
|
|
340
|
-
name:
|
|
341
|
-
description:
|
|
342
|
-
inputSchema:
|
|
336
|
+
var ToolStatusSchema = z.enum(TOOL_STATUS_VALUES);
|
|
337
|
+
var McpToolDefinitionSchema = z.object({
|
|
338
|
+
name: z.string(),
|
|
339
|
+
description: z.string().optional(),
|
|
340
|
+
inputSchema: z.record(z.string(), z.unknown()).optional()
|
|
343
341
|
});
|
|
344
342
|
var ToolSelectSchema = createSelectSchema(tools);
|
|
345
343
|
var ToolInsertSchema = createInsertSchema(tools).extend({
|
|
346
344
|
id: resourceIdSchema,
|
|
347
345
|
imageUrl: imageUrlSchema,
|
|
348
|
-
config:
|
|
349
|
-
type:
|
|
350
|
-
mcp:
|
|
351
|
-
server:
|
|
352
|
-
url:
|
|
346
|
+
config: z.object({
|
|
347
|
+
type: z.literal("mcp"),
|
|
348
|
+
mcp: z.object({
|
|
349
|
+
server: z.object({
|
|
350
|
+
url: z.url()
|
|
353
351
|
}),
|
|
354
|
-
transport:
|
|
355
|
-
type:
|
|
356
|
-
requestInit:
|
|
357
|
-
eventSourceInit:
|
|
358
|
-
reconnectionOptions:
|
|
352
|
+
transport: z.object({
|
|
353
|
+
type: z.enum(MCPTransportType),
|
|
354
|
+
requestInit: z.record(z.string(), z.unknown()).optional(),
|
|
355
|
+
eventSourceInit: z.record(z.string(), z.unknown()).optional(),
|
|
356
|
+
reconnectionOptions: z.any().optional().openapi({
|
|
359
357
|
type: "object",
|
|
360
358
|
description: "Reconnection options for streamable HTTP transport"
|
|
361
359
|
}),
|
|
362
|
-
sessionId:
|
|
360
|
+
sessionId: z.string().optional()
|
|
363
361
|
}).optional(),
|
|
364
|
-
activeTools:
|
|
362
|
+
activeTools: z.array(z.string()).optional()
|
|
365
363
|
})
|
|
366
364
|
})
|
|
367
365
|
});
|
|
@@ -456,7 +454,7 @@ var SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
|
456
454
|
SubAgentArtifactComponentUpdateSchema
|
|
457
455
|
);
|
|
458
456
|
var ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
459
|
-
credentialReferenceId:
|
|
457
|
+
credentialReferenceId: z.string().nullable().optional()
|
|
460
458
|
});
|
|
461
459
|
var ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
|
|
462
460
|
id: resourceIdSchema
|
|
@@ -465,9 +463,9 @@ var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
|
|
|
465
463
|
var ExternalAgentApiSelectSchema = createApiSchema(ExternalAgentSelectSchema).openapi("ExternalAgent");
|
|
466
464
|
var ExternalAgentApiInsertSchema = createApiInsertSchema(ExternalAgentInsertSchema).openapi("ExternalAgentCreate");
|
|
467
465
|
var ExternalAgentApiUpdateSchema = createApiUpdateSchema(ExternalAgentUpdateSchema).openapi("ExternalAgentUpdate");
|
|
468
|
-
var AllAgentSchema =
|
|
469
|
-
SubAgentApiSelectSchema.extend({ type:
|
|
470
|
-
ExternalAgentApiSelectSchema.extend({ type:
|
|
466
|
+
var AllAgentSchema = z.discriminatedUnion("type", [
|
|
467
|
+
SubAgentApiSelectSchema.extend({ type: z.literal("internal") }),
|
|
468
|
+
ExternalAgentApiSelectSchema.extend({ type: z.literal("external") })
|
|
471
469
|
]);
|
|
472
470
|
var ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
473
471
|
var ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
|
|
@@ -489,10 +487,10 @@ var ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({
|
|
|
489
487
|
keyHash: true
|
|
490
488
|
// Never expose the hash
|
|
491
489
|
}).openapi("ApiKey");
|
|
492
|
-
var ApiKeyApiCreationResponseSchema =
|
|
493
|
-
data:
|
|
490
|
+
var ApiKeyApiCreationResponseSchema = z.object({
|
|
491
|
+
data: z.object({
|
|
494
492
|
apiKey: ApiKeyApiSelectSchema,
|
|
495
|
-
key:
|
|
493
|
+
key: z.string().describe("The full API key (shown only once)")
|
|
496
494
|
})
|
|
497
495
|
});
|
|
498
496
|
var ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
@@ -510,89 +508,87 @@ var ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
|
510
508
|
// Not set on creation
|
|
511
509
|
}).openapi("ApiKeyCreate");
|
|
512
510
|
var ApiKeyApiUpdateSchema = ApiKeyUpdateSchema.openapi("ApiKeyUpdate");
|
|
513
|
-
var CredentialReferenceSelectSchema =
|
|
514
|
-
id:
|
|
515
|
-
tenantId:
|
|
516
|
-
projectId:
|
|
517
|
-
name:
|
|
518
|
-
type:
|
|
519
|
-
credentialStoreId:
|
|
520
|
-
retrievalParams:
|
|
521
|
-
createdAt:
|
|
522
|
-
updatedAt:
|
|
511
|
+
var CredentialReferenceSelectSchema = z.object({
|
|
512
|
+
id: z.string(),
|
|
513
|
+
tenantId: z.string(),
|
|
514
|
+
projectId: z.string(),
|
|
515
|
+
name: z.string(),
|
|
516
|
+
type: z.string(),
|
|
517
|
+
credentialStoreId: z.string(),
|
|
518
|
+
retrievalParams: z.record(z.string(), z.unknown()).nullish(),
|
|
519
|
+
createdAt: z.string(),
|
|
520
|
+
updatedAt: z.string()
|
|
523
521
|
});
|
|
524
522
|
var CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({
|
|
525
523
|
id: resourceIdSchema,
|
|
526
|
-
type:
|
|
524
|
+
type: z.string(),
|
|
527
525
|
credentialStoreId: resourceIdSchema,
|
|
528
|
-
retrievalParams:
|
|
526
|
+
retrievalParams: z.record(z.string(), z.unknown()).nullish()
|
|
529
527
|
});
|
|
530
528
|
var CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
531
529
|
var CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema).extend({
|
|
532
|
-
type:
|
|
533
|
-
tools:
|
|
534
|
-
externalAgents:
|
|
530
|
+
type: z.enum(CredentialStoreType),
|
|
531
|
+
tools: z.array(ToolSelectSchema).optional(),
|
|
532
|
+
externalAgents: z.array(ExternalAgentSelectSchema).optional()
|
|
535
533
|
}).openapi("CredentialReference");
|
|
536
534
|
var CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
537
535
|
CredentialReferenceInsertSchema
|
|
538
536
|
).extend({
|
|
539
|
-
type:
|
|
537
|
+
type: z.enum(CredentialStoreType)
|
|
540
538
|
}).openapi("CredentialReferenceCreate");
|
|
541
539
|
var CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
|
|
542
540
|
CredentialReferenceUpdateSchema
|
|
543
541
|
).extend({
|
|
544
|
-
type:
|
|
542
|
+
type: z.enum(CredentialStoreType).optional()
|
|
545
543
|
}).openapi("CredentialReferenceUpdate");
|
|
546
|
-
var CredentialStoreSchema =
|
|
547
|
-
id:
|
|
548
|
-
type:
|
|
549
|
-
available:
|
|
550
|
-
reason:
|
|
544
|
+
var CredentialStoreSchema = z.object({
|
|
545
|
+
id: z.string().describe("Unique identifier of the credential store"),
|
|
546
|
+
type: z.enum(CredentialStoreType),
|
|
547
|
+
available: z.boolean().describe("Whether the store is functional and ready to use"),
|
|
548
|
+
reason: z.string().nullable().describe("Reason why store is not available, if applicable")
|
|
551
549
|
}).openapi("CredentialStore");
|
|
552
|
-
var CredentialStoreListResponseSchema =
|
|
553
|
-
data:
|
|
550
|
+
var CredentialStoreListResponseSchema = z.object({
|
|
551
|
+
data: z.array(CredentialStoreSchema).describe("List of credential stores")
|
|
554
552
|
}).openapi("CredentialStoreListResponse");
|
|
555
|
-
var CreateCredentialInStoreRequestSchema =
|
|
556
|
-
key:
|
|
557
|
-
value:
|
|
558
|
-
metadata:
|
|
553
|
+
var CreateCredentialInStoreRequestSchema = z.object({
|
|
554
|
+
key: z.string().describe("The credential key"),
|
|
555
|
+
value: z.string().describe("The credential value"),
|
|
556
|
+
metadata: z.record(z.string(), z.string()).nullish().describe("The metadata for the credential")
|
|
559
557
|
}).openapi("CreateCredentialInStoreRequest");
|
|
560
|
-
var CreateCredentialInStoreResponseSchema =
|
|
561
|
-
data:
|
|
562
|
-
key:
|
|
563
|
-
storeId:
|
|
564
|
-
createdAt:
|
|
558
|
+
var CreateCredentialInStoreResponseSchema = z.object({
|
|
559
|
+
data: z.object({
|
|
560
|
+
key: z.string().describe("The credential key"),
|
|
561
|
+
storeId: z.string().describe("The store ID where credential was created"),
|
|
562
|
+
createdAt: z.string().describe("ISO timestamp of creation")
|
|
565
563
|
})
|
|
566
564
|
}).openapi("CreateCredentialInStoreResponse");
|
|
567
|
-
var RelatedAgentInfoSchema =
|
|
568
|
-
id:
|
|
569
|
-
name:
|
|
570
|
-
description:
|
|
565
|
+
var RelatedAgentInfoSchema = z.object({
|
|
566
|
+
id: z.string(),
|
|
567
|
+
name: z.string(),
|
|
568
|
+
description: z.string()
|
|
571
569
|
}).openapi("RelatedAgentInfo");
|
|
572
|
-
var ComponentAssociationSchema =
|
|
573
|
-
subAgentId:
|
|
574
|
-
createdAt:
|
|
570
|
+
var ComponentAssociationSchema = z.object({
|
|
571
|
+
subAgentId: z.string(),
|
|
572
|
+
createdAt: z.string()
|
|
575
573
|
}).openapi("ComponentAssociation");
|
|
576
|
-
var OAuthLoginQuerySchema =
|
|
577
|
-
tenantId:
|
|
578
|
-
projectId:
|
|
579
|
-
toolId:
|
|
574
|
+
var OAuthLoginQuerySchema = z.object({
|
|
575
|
+
tenantId: z.string().min(1, "Tenant ID is required"),
|
|
576
|
+
projectId: z.string().min(1, "Project ID is required"),
|
|
577
|
+
toolId: z.string().min(1, "Tool ID is required")
|
|
580
578
|
}).openapi("OAuthLoginQuery");
|
|
581
|
-
var OAuthCallbackQuerySchema =
|
|
582
|
-
code:
|
|
583
|
-
state:
|
|
584
|
-
error:
|
|
585
|
-
error_description:
|
|
579
|
+
var OAuthCallbackQuerySchema = z.object({
|
|
580
|
+
code: z.string().min(1, "Authorization code is required"),
|
|
581
|
+
state: z.string().min(1, "State parameter is required"),
|
|
582
|
+
error: z.string().optional(),
|
|
583
|
+
error_description: z.string().optional()
|
|
586
584
|
}).openapi("OAuthCallbackQuery");
|
|
587
585
|
var McpToolSchema = ToolInsertSchema.extend({
|
|
588
586
|
imageUrl: imageUrlSchema,
|
|
589
|
-
availableTools:
|
|
587
|
+
availableTools: z.array(McpToolDefinitionSchema).optional(),
|
|
590
588
|
status: ToolStatusSchema.default("unknown"),
|
|
591
|
-
version:
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
expiresAt: external_exports.date().optional(),
|
|
595
|
-
relationshipId: external_exports.string().optional()
|
|
589
|
+
version: z.string().optional(),
|
|
590
|
+
expiresAt: z.string().optional(),
|
|
591
|
+
relationshipId: z.string().optional()
|
|
596
592
|
}).openapi("McpTool");
|
|
597
593
|
var MCPToolConfigSchema = McpToolSchema.omit({
|
|
598
594
|
config: true,
|
|
@@ -604,12 +600,12 @@ var MCPToolConfigSchema = McpToolSchema.omit({
|
|
|
604
600
|
updatedAt: true,
|
|
605
601
|
credentialReferenceId: true
|
|
606
602
|
}).extend({
|
|
607
|
-
tenantId:
|
|
608
|
-
projectId:
|
|
609
|
-
description:
|
|
610
|
-
serverUrl:
|
|
611
|
-
activeTools:
|
|
612
|
-
mcpType:
|
|
603
|
+
tenantId: z.string().optional(),
|
|
604
|
+
projectId: z.string().optional(),
|
|
605
|
+
description: z.string().optional(),
|
|
606
|
+
serverUrl: z.url(),
|
|
607
|
+
activeTools: z.array(z.string()).optional(),
|
|
608
|
+
mcpType: z.enum(MCPServerType).optional(),
|
|
613
609
|
transport: McpTransportConfigSchema.optional(),
|
|
614
610
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
615
611
|
});
|
|
@@ -633,40 +629,40 @@ var FunctionUpdateSchema = FunctionInsertSchema.partial();
|
|
|
633
629
|
var FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi("Function");
|
|
634
630
|
var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema).openapi("FunctionCreate");
|
|
635
631
|
var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema).openapi("FunctionUpdate");
|
|
636
|
-
var FetchConfigSchema =
|
|
637
|
-
url:
|
|
638
|
-
method:
|
|
639
|
-
headers:
|
|
640
|
-
body:
|
|
641
|
-
transform:
|
|
632
|
+
var FetchConfigSchema = z.object({
|
|
633
|
+
url: z.string().min(1, "URL is required"),
|
|
634
|
+
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
635
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
636
|
+
body: z.record(z.string(), z.unknown()).optional(),
|
|
637
|
+
transform: z.string().optional(),
|
|
642
638
|
// JSONPath or JS transform function
|
|
643
|
-
timeout:
|
|
639
|
+
timeout: z.number().min(0).optional().default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT).optional()
|
|
644
640
|
}).openapi("FetchConfig");
|
|
645
|
-
var FetchDefinitionSchema =
|
|
646
|
-
id:
|
|
647
|
-
name:
|
|
648
|
-
trigger:
|
|
641
|
+
var FetchDefinitionSchema = z.object({
|
|
642
|
+
id: z.string().min(1, "Fetch definition ID is required"),
|
|
643
|
+
name: z.string().optional(),
|
|
644
|
+
trigger: z.enum(["initialization", "invocation"]),
|
|
649
645
|
fetchConfig: FetchConfigSchema,
|
|
650
|
-
responseSchema:
|
|
646
|
+
responseSchema: z.any().optional(),
|
|
651
647
|
// JSON Schema for validating HTTP response
|
|
652
|
-
defaultValue:
|
|
648
|
+
defaultValue: z.any().optional().openapi({
|
|
653
649
|
description: "Default value if fetch fails"
|
|
654
650
|
}),
|
|
655
651
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
656
652
|
}).openapi("FetchDefinition");
|
|
657
653
|
var ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
|
|
658
|
-
headersSchema:
|
|
654
|
+
headersSchema: z.any().optional().openapi({
|
|
659
655
|
type: "object",
|
|
660
656
|
description: "JSON Schema for validating request headers"
|
|
661
657
|
})
|
|
662
658
|
});
|
|
663
659
|
var ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
|
|
664
660
|
id: resourceIdSchema.optional(),
|
|
665
|
-
headersSchema:
|
|
661
|
+
headersSchema: z.any().nullable().optional().openapi({
|
|
666
662
|
type: "object",
|
|
667
663
|
description: "JSON Schema for validating request headers"
|
|
668
664
|
}),
|
|
669
|
-
contextVariables:
|
|
665
|
+
contextVariables: z.any().nullable().optional().openapi({
|
|
670
666
|
type: "object",
|
|
671
667
|
description: "Context variables configuration with fetch definitions"
|
|
672
668
|
})
|
|
@@ -689,8 +685,9 @@ var SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations)
|
|
|
689
685
|
id: resourceIdSchema,
|
|
690
686
|
subAgentId: resourceIdSchema,
|
|
691
687
|
toolId: resourceIdSchema,
|
|
692
|
-
selectedTools:
|
|
693
|
-
headers:
|
|
688
|
+
selectedTools: z.array(z.string()).nullish(),
|
|
689
|
+
headers: z.record(z.string(), z.string()).nullish(),
|
|
690
|
+
toolPolicies: z.record(z.string(), z.object({ needsApproval: z.boolean().optional() })).nullish()
|
|
694
691
|
});
|
|
695
692
|
var SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();
|
|
696
693
|
var SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -711,7 +708,7 @@ var SubAgentExternalAgentRelationInsertSchema = createInsertSchema(
|
|
|
711
708
|
id: resourceIdSchema,
|
|
712
709
|
subAgentId: resourceIdSchema,
|
|
713
710
|
externalAgentId: resourceIdSchema,
|
|
714
|
-
headers:
|
|
711
|
+
headers: z.record(z.string(), z.string()).nullish()
|
|
715
712
|
});
|
|
716
713
|
var SubAgentExternalAgentRelationUpdateSchema = SubAgentExternalAgentRelationInsertSchema.partial();
|
|
717
714
|
var SubAgentExternalAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -730,7 +727,7 @@ var SubAgentTeamAgentRelationInsertSchema = createInsertSchema(
|
|
|
730
727
|
id: resourceIdSchema,
|
|
731
728
|
subAgentId: resourceIdSchema,
|
|
732
729
|
targetAgentId: resourceIdSchema,
|
|
733
|
-
headers:
|
|
730
|
+
headers: z.record(z.string(), z.string()).nullish()
|
|
734
731
|
});
|
|
735
732
|
var SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationInsertSchema.partial();
|
|
736
733
|
var SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -748,57 +745,58 @@ var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
|
|
|
748
745
|
var LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
|
|
749
746
|
var LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
|
|
750
747
|
var LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);
|
|
751
|
-
var StatusComponentSchema =
|
|
752
|
-
type:
|
|
753
|
-
description:
|
|
754
|
-
detailsSchema:
|
|
755
|
-
type:
|
|
756
|
-
properties:
|
|
757
|
-
required:
|
|
748
|
+
var StatusComponentSchema = z.object({
|
|
749
|
+
type: z.string(),
|
|
750
|
+
description: z.string().optional(),
|
|
751
|
+
detailsSchema: z.object({
|
|
752
|
+
type: z.literal("object"),
|
|
753
|
+
properties: z.record(z.string(), z.any()),
|
|
754
|
+
required: z.array(z.string()).optional()
|
|
758
755
|
}).optional()
|
|
759
756
|
}).openapi("StatusComponent");
|
|
760
|
-
var StatusUpdateSchema =
|
|
761
|
-
enabled:
|
|
762
|
-
numEvents:
|
|
763
|
-
timeInSeconds:
|
|
764
|
-
prompt:
|
|
757
|
+
var StatusUpdateSchema = z.object({
|
|
758
|
+
enabled: z.boolean().optional(),
|
|
759
|
+
numEvents: z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),
|
|
760
|
+
timeInSeconds: z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),
|
|
761
|
+
prompt: z.string().max(
|
|
765
762
|
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,
|
|
766
763
|
`Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS} characters`
|
|
767
764
|
).optional(),
|
|
768
|
-
statusComponents:
|
|
765
|
+
statusComponents: z.array(StatusComponentSchema).optional()
|
|
769
766
|
}).openapi("StatusUpdate");
|
|
770
|
-
var CanUseItemSchema =
|
|
771
|
-
agentToolRelationId:
|
|
772
|
-
toolId:
|
|
773
|
-
toolSelection:
|
|
774
|
-
headers:
|
|
767
|
+
var CanUseItemSchema = z.object({
|
|
768
|
+
agentToolRelationId: z.string().optional(),
|
|
769
|
+
toolId: z.string(),
|
|
770
|
+
toolSelection: z.array(z.string()).nullish(),
|
|
771
|
+
headers: z.record(z.string(), z.string()).nullish(),
|
|
772
|
+
toolPolicies: z.record(z.string(), z.object({ needsApproval: z.boolean().optional() })).nullish()
|
|
775
773
|
}).openapi("CanUseItem");
|
|
776
|
-
var canDelegateToExternalAgentSchema =
|
|
777
|
-
externalAgentId:
|
|
778
|
-
subAgentExternalAgentRelationId:
|
|
779
|
-
headers:
|
|
774
|
+
var canDelegateToExternalAgentSchema = z.object({
|
|
775
|
+
externalAgentId: z.string(),
|
|
776
|
+
subAgentExternalAgentRelationId: z.string().optional(),
|
|
777
|
+
headers: z.record(z.string(), z.string()).nullish()
|
|
780
778
|
}).openapi("CanDelegateToExternalAgent");
|
|
781
|
-
var canDelegateToTeamAgentSchema =
|
|
782
|
-
agentId:
|
|
783
|
-
subAgentTeamAgentRelationId:
|
|
784
|
-
headers:
|
|
779
|
+
var canDelegateToTeamAgentSchema = z.object({
|
|
780
|
+
agentId: z.string(),
|
|
781
|
+
subAgentTeamAgentRelationId: z.string().optional(),
|
|
782
|
+
headers: z.record(z.string(), z.string()).nullish()
|
|
785
783
|
}).openapi("CanDelegateToTeamAgent");
|
|
786
|
-
var TeamAgentSchema =
|
|
787
|
-
id:
|
|
788
|
-
name:
|
|
789
|
-
description:
|
|
784
|
+
var TeamAgentSchema = z.object({
|
|
785
|
+
id: z.string(),
|
|
786
|
+
name: z.string(),
|
|
787
|
+
description: z.string()
|
|
790
788
|
}).openapi("TeamAgent");
|
|
791
789
|
var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
792
|
-
type:
|
|
793
|
-
canUse:
|
|
790
|
+
type: z.literal("internal"),
|
|
791
|
+
canUse: z.array(CanUseItemSchema),
|
|
794
792
|
// All tools (both MCP and function tools)
|
|
795
|
-
dataComponents:
|
|
796
|
-
artifactComponents:
|
|
797
|
-
canTransferTo:
|
|
798
|
-
prompt:
|
|
799
|
-
canDelegateTo:
|
|
800
|
-
|
|
801
|
-
|
|
793
|
+
dataComponents: z.array(z.string()).optional(),
|
|
794
|
+
artifactComponents: z.array(z.string()).optional(),
|
|
795
|
+
canTransferTo: z.array(z.string()).optional(),
|
|
796
|
+
prompt: z.string().trim().nonempty(),
|
|
797
|
+
canDelegateTo: z.array(
|
|
798
|
+
z.union([
|
|
799
|
+
z.string(),
|
|
802
800
|
// Internal subAgent ID
|
|
803
801
|
canDelegateToExternalAgentSchema,
|
|
804
802
|
// External agent with headers
|
|
@@ -808,53 +806,53 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
|
808
806
|
).optional()
|
|
809
807
|
}).openapi("FullAgentAgentInsert");
|
|
810
808
|
var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
811
|
-
subAgents:
|
|
809
|
+
subAgents: z.record(z.string(), FullAgentAgentInsertSchema),
|
|
812
810
|
// Lookup maps for UI to resolve canUse items
|
|
813
|
-
tools:
|
|
811
|
+
tools: z.record(z.string(), ToolApiInsertSchema).optional(),
|
|
814
812
|
// MCP tools (project-scoped)
|
|
815
|
-
externalAgents:
|
|
813
|
+
externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(),
|
|
816
814
|
// External agents (project-scoped)
|
|
817
|
-
teamAgents:
|
|
815
|
+
teamAgents: z.record(z.string(), TeamAgentSchema).optional(),
|
|
818
816
|
// Team agents contain basic metadata for the agent to be delegated to
|
|
819
|
-
functionTools:
|
|
817
|
+
functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),
|
|
820
818
|
// Function tools (agent-scoped)
|
|
821
|
-
functions:
|
|
819
|
+
functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
|
|
822
820
|
// Get function code for function tools
|
|
823
|
-
contextConfig:
|
|
824
|
-
statusUpdates:
|
|
821
|
+
contextConfig: z.optional(ContextConfigApiInsertSchema),
|
|
822
|
+
statusUpdates: z.optional(StatusUpdateSchema),
|
|
825
823
|
models: ModelSchema.optional(),
|
|
826
824
|
stopWhen: AgentStopWhenSchema.optional(),
|
|
827
|
-
prompt:
|
|
825
|
+
prompt: z.string().max(
|
|
828
826
|
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
829
827
|
`Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS} characters`
|
|
830
828
|
).optional()
|
|
831
829
|
}).openapi("AgentWithinContextOfProject");
|
|
832
|
-
var PaginationSchema =
|
|
830
|
+
var PaginationSchema = z.object({
|
|
833
831
|
page: pageNumber,
|
|
834
832
|
limit: limitNumber,
|
|
835
|
-
total:
|
|
836
|
-
pages:
|
|
833
|
+
total: z.number(),
|
|
834
|
+
pages: z.number()
|
|
837
835
|
}).openapi("Pagination");
|
|
838
|
-
var ListResponseSchema = (itemSchema) =>
|
|
839
|
-
data:
|
|
836
|
+
var ListResponseSchema = (itemSchema) => z.object({
|
|
837
|
+
data: z.array(itemSchema),
|
|
840
838
|
pagination: PaginationSchema
|
|
841
839
|
});
|
|
842
|
-
var SingleResponseSchema = (itemSchema) =>
|
|
840
|
+
var SingleResponseSchema = (itemSchema) => z.object({
|
|
843
841
|
data: itemSchema
|
|
844
842
|
});
|
|
845
|
-
var ErrorResponseSchema =
|
|
846
|
-
error:
|
|
847
|
-
message:
|
|
848
|
-
details:
|
|
843
|
+
var ErrorResponseSchema = z.object({
|
|
844
|
+
error: z.string(),
|
|
845
|
+
message: z.string().optional(),
|
|
846
|
+
details: z.any().optional().openapi({
|
|
849
847
|
description: "Additional error details"
|
|
850
848
|
})
|
|
851
849
|
}).openapi("ErrorResponse");
|
|
852
|
-
var ExistsResponseSchema =
|
|
853
|
-
exists:
|
|
850
|
+
var ExistsResponseSchema = z.object({
|
|
851
|
+
exists: z.boolean()
|
|
854
852
|
}).openapi("ExistsResponse");
|
|
855
|
-
var RemovedResponseSchema =
|
|
856
|
-
message:
|
|
857
|
-
removed:
|
|
853
|
+
var RemovedResponseSchema = z.object({
|
|
854
|
+
message: z.string(),
|
|
855
|
+
removed: z.boolean()
|
|
858
856
|
}).openapi("RemovedResponse");
|
|
859
857
|
var ProjectSelectSchema = registerFieldSchemas(
|
|
860
858
|
createSelectSchema(projects).extend({
|
|
@@ -881,147 +879,147 @@ var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openap
|
|
|
881
879
|
);
|
|
882
880
|
var ProjectApiUpdateSchema = ProjectUpdateSchema.openapi("ProjectUpdate");
|
|
883
881
|
var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
884
|
-
agents:
|
|
885
|
-
tools:
|
|
886
|
-
functionTools:
|
|
887
|
-
functions:
|
|
888
|
-
dataComponents:
|
|
889
|
-
artifactComponents:
|
|
890
|
-
externalAgents:
|
|
891
|
-
statusUpdates:
|
|
892
|
-
credentialReferences:
|
|
893
|
-
createdAt:
|
|
894
|
-
updatedAt:
|
|
882
|
+
agents: z.record(z.string(), AgentWithinContextOfProjectSchema),
|
|
883
|
+
tools: z.record(z.string(), ToolApiInsertSchema),
|
|
884
|
+
functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),
|
|
885
|
+
functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
|
|
886
|
+
dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),
|
|
887
|
+
artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
888
|
+
externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(),
|
|
889
|
+
statusUpdates: z.optional(StatusUpdateSchema),
|
|
890
|
+
credentialReferences: z.record(z.string(), CredentialReferenceApiInsertSchema).optional(),
|
|
891
|
+
createdAt: z.string().optional(),
|
|
892
|
+
updatedAt: z.string().optional()
|
|
895
893
|
}).openapi("FullProjectDefinition");
|
|
896
|
-
var ProjectResponse =
|
|
897
|
-
var SubAgentResponse =
|
|
898
|
-
var AgentResponse =
|
|
899
|
-
var ToolResponse =
|
|
900
|
-
var ExternalAgentResponse =
|
|
901
|
-
var ContextConfigResponse =
|
|
902
|
-
var ApiKeyResponse =
|
|
903
|
-
var CredentialReferenceResponse =
|
|
904
|
-
var FunctionResponse =
|
|
905
|
-
var FunctionToolResponse =
|
|
906
|
-
var DataComponentResponse =
|
|
907
|
-
var ArtifactComponentResponse =
|
|
908
|
-
var SubAgentRelationResponse =
|
|
909
|
-
var SubAgentToolRelationResponse =
|
|
910
|
-
var ConversationResponse =
|
|
911
|
-
var MessageResponse =
|
|
912
|
-
var ProjectListResponse =
|
|
913
|
-
data:
|
|
894
|
+
var ProjectResponse = z.object({ data: ProjectApiSelectSchema }).openapi("ProjectResponse");
|
|
895
|
+
var SubAgentResponse = z.object({ data: SubAgentApiSelectSchema }).openapi("SubAgentResponse");
|
|
896
|
+
var AgentResponse = z.object({ data: AgentApiSelectSchema }).openapi("AgentResponse");
|
|
897
|
+
var ToolResponse = z.object({ data: ToolApiSelectSchema }).openapi("ToolResponse");
|
|
898
|
+
var ExternalAgentResponse = z.object({ data: ExternalAgentApiSelectSchema }).openapi("ExternalAgentResponse");
|
|
899
|
+
var ContextConfigResponse = z.object({ data: ContextConfigApiSelectSchema }).openapi("ContextConfigResponse");
|
|
900
|
+
var ApiKeyResponse = z.object({ data: ApiKeyApiSelectSchema }).openapi("ApiKeyResponse");
|
|
901
|
+
var CredentialReferenceResponse = z.object({ data: CredentialReferenceApiSelectSchema }).openapi("CredentialReferenceResponse");
|
|
902
|
+
var FunctionResponse = z.object({ data: FunctionApiSelectSchema }).openapi("FunctionResponse");
|
|
903
|
+
var FunctionToolResponse = z.object({ data: FunctionToolApiSelectSchema }).openapi("FunctionToolResponse");
|
|
904
|
+
var DataComponentResponse = z.object({ data: DataComponentApiSelectSchema }).openapi("DataComponentResponse");
|
|
905
|
+
var ArtifactComponentResponse = z.object({ data: ArtifactComponentApiSelectSchema }).openapi("ArtifactComponentResponse");
|
|
906
|
+
var SubAgentRelationResponse = z.object({ data: SubAgentRelationApiSelectSchema }).openapi("SubAgentRelationResponse");
|
|
907
|
+
var SubAgentToolRelationResponse = z.object({ data: SubAgentToolRelationApiSelectSchema }).openapi("SubAgentToolRelationResponse");
|
|
908
|
+
var ConversationResponse = z.object({ data: ConversationApiSelectSchema }).openapi("ConversationResponse");
|
|
909
|
+
var MessageResponse = z.object({ data: MessageApiSelectSchema }).openapi("MessageResponse");
|
|
910
|
+
var ProjectListResponse = z.object({
|
|
911
|
+
data: z.array(ProjectApiSelectSchema),
|
|
914
912
|
pagination: PaginationSchema
|
|
915
913
|
}).openapi("ProjectListResponse");
|
|
916
|
-
var SubAgentListResponse =
|
|
917
|
-
data:
|
|
914
|
+
var SubAgentListResponse = z.object({
|
|
915
|
+
data: z.array(SubAgentApiSelectSchema),
|
|
918
916
|
pagination: PaginationSchema
|
|
919
917
|
}).openapi("SubAgentListResponse");
|
|
920
|
-
var AgentListResponse =
|
|
921
|
-
data:
|
|
918
|
+
var AgentListResponse = z.object({
|
|
919
|
+
data: z.array(AgentApiSelectSchema),
|
|
922
920
|
pagination: PaginationSchema
|
|
923
921
|
}).openapi("AgentListResponse");
|
|
924
|
-
var ToolListResponse =
|
|
925
|
-
data:
|
|
922
|
+
var ToolListResponse = z.object({
|
|
923
|
+
data: z.array(ToolApiSelectSchema),
|
|
926
924
|
pagination: PaginationSchema
|
|
927
925
|
}).openapi("ToolListResponse");
|
|
928
|
-
var ExternalAgentListResponse =
|
|
929
|
-
data:
|
|
926
|
+
var ExternalAgentListResponse = z.object({
|
|
927
|
+
data: z.array(ExternalAgentApiSelectSchema),
|
|
930
928
|
pagination: PaginationSchema
|
|
931
929
|
}).openapi("ExternalAgentListResponse");
|
|
932
|
-
var ContextConfigListResponse =
|
|
933
|
-
data:
|
|
930
|
+
var ContextConfigListResponse = z.object({
|
|
931
|
+
data: z.array(ContextConfigApiSelectSchema),
|
|
934
932
|
pagination: PaginationSchema
|
|
935
933
|
}).openapi("ContextConfigListResponse");
|
|
936
|
-
var ApiKeyListResponse =
|
|
937
|
-
data:
|
|
934
|
+
var ApiKeyListResponse = z.object({
|
|
935
|
+
data: z.array(ApiKeyApiSelectSchema),
|
|
938
936
|
pagination: PaginationSchema
|
|
939
937
|
}).openapi("ApiKeyListResponse");
|
|
940
|
-
var CredentialReferenceListResponse =
|
|
941
|
-
data:
|
|
938
|
+
var CredentialReferenceListResponse = z.object({
|
|
939
|
+
data: z.array(CredentialReferenceApiSelectSchema),
|
|
942
940
|
pagination: PaginationSchema
|
|
943
941
|
}).openapi("CredentialReferenceListResponse");
|
|
944
|
-
var FunctionListResponse =
|
|
945
|
-
data:
|
|
942
|
+
var FunctionListResponse = z.object({
|
|
943
|
+
data: z.array(FunctionApiSelectSchema),
|
|
946
944
|
pagination: PaginationSchema
|
|
947
945
|
}).openapi("FunctionListResponse");
|
|
948
|
-
var FunctionToolListResponse =
|
|
949
|
-
data:
|
|
946
|
+
var FunctionToolListResponse = z.object({
|
|
947
|
+
data: z.array(FunctionToolApiSelectSchema),
|
|
950
948
|
pagination: PaginationSchema
|
|
951
949
|
}).openapi("FunctionToolListResponse");
|
|
952
|
-
var DataComponentListResponse =
|
|
953
|
-
data:
|
|
950
|
+
var DataComponentListResponse = z.object({
|
|
951
|
+
data: z.array(DataComponentApiSelectSchema),
|
|
954
952
|
pagination: PaginationSchema
|
|
955
953
|
}).openapi("DataComponentListResponse");
|
|
956
|
-
var ArtifactComponentListResponse =
|
|
957
|
-
data:
|
|
954
|
+
var ArtifactComponentListResponse = z.object({
|
|
955
|
+
data: z.array(ArtifactComponentApiSelectSchema),
|
|
958
956
|
pagination: PaginationSchema
|
|
959
957
|
}).openapi("ArtifactComponentListResponse");
|
|
960
|
-
var SubAgentRelationListResponse =
|
|
961
|
-
data:
|
|
958
|
+
var SubAgentRelationListResponse = z.object({
|
|
959
|
+
data: z.array(SubAgentRelationApiSelectSchema),
|
|
962
960
|
pagination: PaginationSchema
|
|
963
961
|
}).openapi("SubAgentRelationListResponse");
|
|
964
|
-
var SubAgentToolRelationListResponse =
|
|
965
|
-
data:
|
|
962
|
+
var SubAgentToolRelationListResponse = z.object({
|
|
963
|
+
data: z.array(SubAgentToolRelationApiSelectSchema),
|
|
966
964
|
pagination: PaginationSchema
|
|
967
965
|
}).openapi("SubAgentToolRelationListResponse");
|
|
968
|
-
var ConversationListResponse =
|
|
969
|
-
data:
|
|
966
|
+
var ConversationListResponse = z.object({
|
|
967
|
+
data: z.array(ConversationApiSelectSchema),
|
|
970
968
|
pagination: PaginationSchema
|
|
971
969
|
}).openapi("ConversationListResponse");
|
|
972
|
-
var MessageListResponse =
|
|
973
|
-
data:
|
|
970
|
+
var MessageListResponse = z.object({
|
|
971
|
+
data: z.array(MessageApiSelectSchema),
|
|
974
972
|
pagination: PaginationSchema
|
|
975
973
|
}).openapi("MessageListResponse");
|
|
976
|
-
var SubAgentDataComponentResponse =
|
|
977
|
-
var SubAgentArtifactComponentResponse =
|
|
978
|
-
var SubAgentDataComponentListResponse =
|
|
979
|
-
data:
|
|
974
|
+
var SubAgentDataComponentResponse = z.object({ data: SubAgentDataComponentApiSelectSchema }).openapi("SubAgentDataComponentResponse");
|
|
975
|
+
var SubAgentArtifactComponentResponse = z.object({ data: SubAgentArtifactComponentApiSelectSchema }).openapi("SubAgentArtifactComponentResponse");
|
|
976
|
+
var SubAgentDataComponentListResponse = z.object({
|
|
977
|
+
data: z.array(SubAgentDataComponentApiSelectSchema),
|
|
980
978
|
pagination: PaginationSchema
|
|
981
979
|
}).openapi("SubAgentDataComponentListResponse");
|
|
982
|
-
var SubAgentArtifactComponentListResponse =
|
|
983
|
-
data:
|
|
980
|
+
var SubAgentArtifactComponentListResponse = z.object({
|
|
981
|
+
data: z.array(SubAgentArtifactComponentApiSelectSchema),
|
|
984
982
|
pagination: PaginationSchema
|
|
985
983
|
}).openapi("SubAgentArtifactComponentListResponse");
|
|
986
|
-
var FullProjectDefinitionResponse =
|
|
987
|
-
var AgentWithinContextOfProjectResponse =
|
|
988
|
-
var RelatedAgentInfoListResponse =
|
|
989
|
-
data:
|
|
984
|
+
var FullProjectDefinitionResponse = z.object({ data: FullProjectDefinitionSchema }).openapi("FullProjectDefinitionResponse");
|
|
985
|
+
var AgentWithinContextOfProjectResponse = z.object({ data: AgentWithinContextOfProjectSchema }).openapi("AgentWithinContextOfProjectResponse");
|
|
986
|
+
var RelatedAgentInfoListResponse = z.object({
|
|
987
|
+
data: z.array(RelatedAgentInfoSchema),
|
|
990
988
|
pagination: PaginationSchema
|
|
991
989
|
}).openapi("RelatedAgentInfoListResponse");
|
|
992
|
-
var ComponentAssociationListResponse =
|
|
993
|
-
var McpToolResponse =
|
|
994
|
-
var McpToolListResponse =
|
|
995
|
-
data:
|
|
990
|
+
var ComponentAssociationListResponse = z.object({ data: z.array(ComponentAssociationSchema) }).openapi("ComponentAssociationListResponse");
|
|
991
|
+
var McpToolResponse = z.object({ data: McpToolSchema }).openapi("McpToolResponse");
|
|
992
|
+
var McpToolListResponse = z.object({
|
|
993
|
+
data: z.array(McpToolSchema),
|
|
996
994
|
pagination: PaginationSchema
|
|
997
995
|
}).openapi("McpToolListResponse");
|
|
998
|
-
var SubAgentTeamAgentRelationResponse =
|
|
999
|
-
var SubAgentTeamAgentRelationListResponse =
|
|
1000
|
-
data:
|
|
996
|
+
var SubAgentTeamAgentRelationResponse = z.object({ data: SubAgentTeamAgentRelationApiSelectSchema }).openapi("SubAgentTeamAgentRelationResponse");
|
|
997
|
+
var SubAgentTeamAgentRelationListResponse = z.object({
|
|
998
|
+
data: z.array(SubAgentTeamAgentRelationApiSelectSchema),
|
|
1001
999
|
pagination: PaginationSchema
|
|
1002
1000
|
}).openapi("SubAgentTeamAgentRelationListResponse");
|
|
1003
|
-
var SubAgentExternalAgentRelationResponse =
|
|
1004
|
-
var SubAgentExternalAgentRelationListResponse =
|
|
1005
|
-
data:
|
|
1001
|
+
var SubAgentExternalAgentRelationResponse = z.object({ data: SubAgentExternalAgentRelationApiSelectSchema }).openapi("SubAgentExternalAgentRelationResponse");
|
|
1002
|
+
var SubAgentExternalAgentRelationListResponse = z.object({
|
|
1003
|
+
data: z.array(SubAgentExternalAgentRelationApiSelectSchema),
|
|
1006
1004
|
pagination: PaginationSchema
|
|
1007
1005
|
}).openapi("SubAgentExternalAgentRelationListResponse");
|
|
1008
|
-
var DataComponentArrayResponse =
|
|
1009
|
-
var ArtifactComponentArrayResponse =
|
|
1010
|
-
var HeadersScopeSchema =
|
|
1011
|
-
"x-inkeep-tenant-id":
|
|
1006
|
+
var DataComponentArrayResponse = z.object({ data: z.array(DataComponentApiSelectSchema) }).openapi("DataComponentArrayResponse");
|
|
1007
|
+
var ArtifactComponentArrayResponse = z.object({ data: z.array(ArtifactComponentApiSelectSchema) }).openapi("ArtifactComponentArrayResponse");
|
|
1008
|
+
var HeadersScopeSchema = z.object({
|
|
1009
|
+
"x-inkeep-tenant-id": z.string().optional().openapi({
|
|
1012
1010
|
description: "Tenant identifier",
|
|
1013
1011
|
example: "tenant_123"
|
|
1014
1012
|
}),
|
|
1015
|
-
"x-inkeep-project-id":
|
|
1013
|
+
"x-inkeep-project-id": z.string().optional().openapi({
|
|
1016
1014
|
description: "Project identifier",
|
|
1017
1015
|
example: "project_456"
|
|
1018
1016
|
}),
|
|
1019
|
-
"x-inkeep-agent-id":
|
|
1017
|
+
"x-inkeep-agent-id": z.string().optional().openapi({
|
|
1020
1018
|
description: "Agent identifier",
|
|
1021
1019
|
example: "agent_789"
|
|
1022
1020
|
})
|
|
1023
1021
|
});
|
|
1024
|
-
var TenantId =
|
|
1022
|
+
var TenantId = z.string().openapi("TenantIdPathParam", {
|
|
1025
1023
|
param: {
|
|
1026
1024
|
name: "tenantId",
|
|
1027
1025
|
in: "path"
|
|
@@ -1029,7 +1027,7 @@ var TenantId = external_exports.string().openapi("TenantIdPathParam", {
|
|
|
1029
1027
|
description: "Tenant identifier",
|
|
1030
1028
|
example: "tenant_123"
|
|
1031
1029
|
});
|
|
1032
|
-
var ProjectId =
|
|
1030
|
+
var ProjectId = z.string().openapi("ProjectIdPathParam", {
|
|
1033
1031
|
param: {
|
|
1034
1032
|
name: "projectId",
|
|
1035
1033
|
in: "path"
|
|
@@ -1037,7 +1035,7 @@ var ProjectId = external_exports.string().openapi("ProjectIdPathParam", {
|
|
|
1037
1035
|
description: "Project identifier",
|
|
1038
1036
|
example: "project_456"
|
|
1039
1037
|
});
|
|
1040
|
-
var AgentId =
|
|
1038
|
+
var AgentId = z.string().openapi("AgentIdPathParam", {
|
|
1041
1039
|
param: {
|
|
1042
1040
|
name: "agentId",
|
|
1043
1041
|
in: "path"
|
|
@@ -1045,7 +1043,7 @@ var AgentId = external_exports.string().openapi("AgentIdPathParam", {
|
|
|
1045
1043
|
description: "Agent identifier",
|
|
1046
1044
|
example: "agent_789"
|
|
1047
1045
|
});
|
|
1048
|
-
var SubAgentId =
|
|
1046
|
+
var SubAgentId = z.string().openapi("SubAgentIdPathParam", {
|
|
1049
1047
|
param: {
|
|
1050
1048
|
name: "subAgentId",
|
|
1051
1049
|
in: "path"
|
|
@@ -1053,7 +1051,7 @@ var SubAgentId = external_exports.string().openapi("SubAgentIdPathParam", {
|
|
|
1053
1051
|
description: "Sub-agent identifier",
|
|
1054
1052
|
example: "sub_agent_123"
|
|
1055
1053
|
});
|
|
1056
|
-
var TenantParamsSchema =
|
|
1054
|
+
var TenantParamsSchema = z.object({
|
|
1057
1055
|
tenantId: TenantId
|
|
1058
1056
|
});
|
|
1059
1057
|
var TenantIdParamsSchema = TenantParamsSchema.extend({
|
|
@@ -1077,25 +1075,25 @@ var TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.exte
|
|
|
1077
1075
|
var TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
|
|
1078
1076
|
id: resourceIdSchema
|
|
1079
1077
|
});
|
|
1080
|
-
var PaginationQueryParamsSchema =
|
|
1078
|
+
var PaginationQueryParamsSchema = z.object({
|
|
1081
1079
|
page: pageNumber,
|
|
1082
1080
|
limit: limitNumber
|
|
1083
1081
|
}).openapi("PaginationQueryParams");
|
|
1084
|
-
var PrebuiltMCPServerSchema =
|
|
1085
|
-
id:
|
|
1086
|
-
name:
|
|
1087
|
-
url:
|
|
1088
|
-
transport:
|
|
1089
|
-
imageUrl:
|
|
1090
|
-
isOpen:
|
|
1091
|
-
category:
|
|
1092
|
-
description:
|
|
1093
|
-
thirdPartyConnectAccountUrl:
|
|
1082
|
+
var PrebuiltMCPServerSchema = z.object({
|
|
1083
|
+
id: z.string().describe("Unique identifier for the MCP server"),
|
|
1084
|
+
name: z.string().describe("Display name of the MCP server"),
|
|
1085
|
+
url: z.url().describe("URL endpoint for the MCP server"),
|
|
1086
|
+
transport: z.enum(MCPTransportType).describe("Transport protocol type"),
|
|
1087
|
+
imageUrl: z.url().optional().describe("Logo/icon URL for the MCP server"),
|
|
1088
|
+
isOpen: z.boolean().optional().describe("Whether the MCP server is open (doesn't require authentication)"),
|
|
1089
|
+
category: z.string().optional().describe("Category of the MCP server (e.g., communication, project_management)"),
|
|
1090
|
+
description: z.string().optional().describe("Brief description of what the MCP server does"),
|
|
1091
|
+
thirdPartyConnectAccountUrl: z.url().optional().describe("URL to connect to the third party account")
|
|
1094
1092
|
});
|
|
1095
|
-
var MCPCatalogListResponse =
|
|
1096
|
-
data:
|
|
1093
|
+
var MCPCatalogListResponse = z.object({
|
|
1094
|
+
data: z.array(PrebuiltMCPServerSchema)
|
|
1097
1095
|
}).openapi("MCPCatalogListResponse");
|
|
1098
|
-
var ThirdPartyMCPServerResponse =
|
|
1096
|
+
var ThirdPartyMCPServerResponse = z.object({
|
|
1099
1097
|
data: PrebuiltMCPServerSchema.nullable()
|
|
1100
1098
|
}).openapi("ThirdPartyMCPServerResponse");
|
|
1101
1099
|
function validatePropsAsJsonSchema(props) {
|