@inkeep/agents-core 0.0.0-dev-20251219092754 → 0.0.0-dev-20251220003011

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.
@@ -14,6 +14,27 @@ const resourceIdSchema = z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).descri
14
14
  example: "resource_789"
15
15
  });
16
16
  resourceIdSchema.meta({ description: "Resource identifier" });
17
+ /**
18
+ * Creates a resource ID schema with custom description.
19
+ * Inherits all validation from resourceIdSchema (min, max, regex pattern).
20
+ * Use this to extend resourceIdSchema with entity-specific documentation.
21
+ *
22
+ * @example
23
+ * // For Agent.defaultSubAgentId
24
+ * createResourceIdSchema('ID of the default sub-agent. Workflow: ...', { example: 'my-subagent' })
25
+ *
26
+ * // For Tool.credentialReferenceId
27
+ * createResourceIdSchema('Reference to credential for authentication', { example: 'cred-123' })
28
+ */
29
+ function createResourceIdSchema(description, options) {
30
+ const example = options?.example ?? "resource_789";
31
+ const modified = z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe(description).regex(URL_SAFE_ID_PATTERN, { message: "ID must contain only letters, numbers, hyphens, underscores, and dots" }).openapi({
32
+ description,
33
+ example
34
+ });
35
+ modified.meta({ description });
36
+ return modified;
37
+ }
17
38
  const FIELD_MODIFIERS = {
18
39
  id: (schema) => {
19
40
  const modified = schema.min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, { message: "ID must contain only letters, numbers, hyphens, underscores, and dots" }).openapi({
@@ -263,9 +284,11 @@ const ExternalSubAgentRelationInsertSchema = createInsertSchema$1(subAgentRelati
263
284
  });
264
285
  const ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(ExternalSubAgentRelationInsertSchema);
265
286
  const AgentSelectSchema = createSelectSchema$1(agents);
266
- const AgentInsertSchema = createInsertSchema$1(agents).extend({
267
- id: resourceIdSchema,
268
- name: z.string().trim().nonempty()
287
+ const DEFAULT_SUB_AGENT_ID_DESCRIPTION = "ID of the default sub-agent that handles initial user messages. Required at runtime but nullable on creation to avoid circular FK dependency. Workflow: 1) POST Agent (without defaultSubAgentId), 2) POST SubAgent, 3) PATCH Agent with defaultSubAgentId.";
288
+ const AgentInsertSchema = createInsertSchema$1(agents, {
289
+ id: () => resourceIdSchema,
290
+ name: () => z.string().trim().nonempty().describe("Agent name").openapi({ description: "Agent name" }),
291
+ defaultSubAgentId: () => createResourceIdSchema(DEFAULT_SUB_AGENT_ID_DESCRIPTION, { example: "my-default-subagent" }).nullable().optional()
269
292
  });
270
293
  const AgentUpdateSchema = AgentInsertSchema.partial();
271
294
  const AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi("Agent");
@@ -1 +1 @@
1
- {"version":3,"file":"props-validation.js","names":["FIELD_MODIFIERS: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny>","drizzleCreateSelectSchema","modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny>","drizzleCreateInsertSchema","createSelectSchema","createInsertSchema","fieldMetadata: Record<string, { description: string }>","innerSchema: z.ZodTypeAny | null","createSelectSchema","createInsertSchema"],"sources":["../src/validation/drizzle-schema-helpers.ts","../src/validation/schemas.ts","../src/validation/props-validation.ts"],"sourcesContent":["import { z } from '@hono/zod-openapi';\nimport type { AnySQLiteTable } from 'drizzle-orm/sqlite-core';\nimport {\n createInsertSchema as drizzleCreateInsertSchema,\n createSelectSchema as drizzleCreateSelectSchema,\n} from 'drizzle-zod';\n\nexport const MIN_ID_LENGTH = 1;\nexport const MAX_ID_LENGTH = 255;\nexport const URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\\-_.]+$/;\n\nexport const resourceIdSchema = z\n .string()\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n example: 'resource_789',\n });\n\nresourceIdSchema.meta({\n description: 'Resource identifier',\n});\n\nconst FIELD_MODIFIERS: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {\n id: (schema) => {\n const modified = (schema as z.ZodString)\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n example: 'resource_789',\n });\n modified.meta({\n description: 'Resource identifier',\n });\n return modified;\n },\n name: (_schema) => {\n const modified = z.string().describe('Name');\n modified.meta({ description: 'Name' });\n return modified;\n },\n description: (_schema) => {\n const modified = z.string().describe('Description');\n modified.meta({ description: 'Description' });\n return modified;\n },\n tenantId: (schema) => {\n const modified = schema.describe('Tenant identifier');\n modified.meta({ description: 'Tenant identifier' });\n return modified;\n },\n projectId: (schema) => {\n const modified = schema.describe('Project identifier');\n modified.meta({ description: 'Project identifier' });\n return modified;\n },\n agentId: (schema) => {\n const modified = schema.describe('Agent identifier');\n modified.meta({ description: 'Agent identifier' });\n return modified;\n },\n subAgentId: (schema) => {\n const modified = schema.describe('Sub-agent identifier');\n modified.meta({ description: 'Sub-agent identifier' });\n return modified;\n },\n createdAt: (schema) => {\n const modified = schema.describe('Creation timestamp');\n modified.meta({ description: 'Creation timestamp' });\n return modified;\n },\n updatedAt: (schema) => {\n const modified = schema.describe('Last update timestamp');\n modified.meta({ description: 'Last update timestamp' });\n return modified;\n },\n};\n\nfunction createSelectSchemaWithModifiers<T extends AnySQLiteTable>(\n table: T,\n overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>\n) {\n const tableColumns = table._?.columns;\n if (!tableColumns) {\n return drizzleCreateSelectSchema(table, overrides as any);\n }\n\n const tableFieldNames = Object.keys(tableColumns) as Array<keyof typeof tableColumns>;\n\n const modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {};\n\n for (const fieldName of tableFieldNames) {\n const fieldNameStr = String(fieldName);\n if (fieldNameStr in FIELD_MODIFIERS) {\n modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];\n }\n }\n\n const mergedModifiers = { ...modifiers, ...overrides } as any;\n\n return drizzleCreateSelectSchema(table, mergedModifiers);\n}\n\nfunction createInsertSchemaWithModifiers<T extends AnySQLiteTable>(\n table: T,\n overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>\n) {\n const tableColumns = table._?.columns;\n if (!tableColumns) {\n return drizzleCreateInsertSchema(table, overrides as any);\n }\n\n const tableFieldNames = Object.keys(tableColumns) as Array<keyof typeof tableColumns>;\n\n const modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {};\n\n for (const fieldName of tableFieldNames) {\n const fieldNameStr = String(fieldName);\n if (fieldNameStr in FIELD_MODIFIERS) {\n modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];\n }\n }\n\n const mergedModifiers = { ...modifiers, ...overrides } as any;\n\n return drizzleCreateInsertSchema(table, mergedModifiers);\n}\n\nexport const createSelectSchema = createSelectSchemaWithModifiers;\nexport const createInsertSchema = createInsertSchemaWithModifiers;\n\n/**\n * Helper function to register a schema in the global registry using .meta() and return it.\n * This ensures metadata persists through transformations.\n */\nfunction registerSchema<T extends z.ZodTypeAny>(\n schema: T,\n metadata: {\n description?: string;\n id?: string;\n title?: string;\n deprecated?: boolean;\n [key: string]: unknown;\n }\n): T {\n (schema as any).meta(metadata);\n return schema;\n}\n\n/**\n * Registers all field schemas in an object schema that match known field names.\n * This ensures metadata persists through transformations like .partial() and .omit().\n * For the 'id' field, also applies full validation constraints via .openapi().\n *\n * This function registers each field schema instance in the global registry using .meta(),\n * and ensures OpenAPI metadata is set via .openapi() for proper documentation generation.\n *\n * Note: This modifies the schemas in place by registering them in the global registry.\n * The schema shape itself is not modified, but the field schemas are registered.\n */\nexport function registerFieldSchemas<T extends z.ZodObject<any>>(schema: T): T {\n if (!(schema instanceof z.ZodObject)) {\n return schema;\n }\n\n const shape = schema.shape;\n const fieldMetadata: Record<string, { description: string }> = {\n id: { description: 'Resource identifier' },\n name: { description: 'Name' },\n description: { description: 'Description' },\n tenantId: { description: 'Tenant identifier' },\n projectId: { description: 'Project identifier' },\n agentId: { description: 'Agent identifier' },\n subAgentId: { description: 'Sub-agent identifier' },\n createdAt: { description: 'Creation timestamp' },\n updatedAt: { description: 'Last update timestamp' },\n };\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (fieldName in fieldMetadata && fieldSchema) {\n let zodFieldSchema = fieldSchema as z.ZodTypeAny;\n let innerSchema: z.ZodTypeAny | null = null;\n\n // Unwrap ZodOptional to get the inner schema\n if (zodFieldSchema instanceof z.ZodOptional) {\n innerSchema = zodFieldSchema._def.innerType as z.ZodTypeAny;\n zodFieldSchema = innerSchema;\n }\n\n // Register in global registry using .meta()\n zodFieldSchema.meta(fieldMetadata[fieldName]);\n\n // Special handling for 'id' field - ensure it has full validation via .openapi()\n if (fieldName === 'id' && zodFieldSchema instanceof z.ZodString) {\n // Always ensure OpenAPI metadata is set for id field\n zodFieldSchema.openapi({\n description: 'Resource identifier',\n minLength: MIN_ID_LENGTH,\n maxLength: MAX_ID_LENGTH,\n pattern: URL_SAFE_ID_PATTERN.source,\n example: 'resource_789',\n });\n } else if (zodFieldSchema instanceof z.ZodString) {\n // For other string fields, ensure description is set via .openapi()\n zodFieldSchema.openapi({\n description: fieldMetadata[fieldName].description,\n });\n }\n\n // Also register the optional wrapper if it exists\n if (innerSchema && fieldSchema instanceof z.ZodOptional) {\n (fieldSchema as any).meta(fieldMetadata[fieldName]);\n }\n }\n }\n\n return schema;\n}\n\n/**\n * Wrapper for .partial() that registers the resulting schema and its fields in the global registry.\n * This function ensures that field schemas are properly registered and configured with OpenAPI metadata.\n */\nexport function partialWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const partialSchema = schema.partial() as T;\n\n // Register field schemas - this registers them in the global registry\n registerFieldSchemas(partialSchema);\n\n // Reconstruct schema shape with properly configured field schemas\n const shape = partialSchema.shape;\n const newShape: Record<string, z.ZodTypeAny> = {};\n\n const fieldMetadata: Record<string, { description: string }> = {\n id: { description: 'Resource identifier' },\n name: { description: 'Name' },\n description: { description: 'Description' },\n tenantId: { description: 'Tenant identifier' },\n projectId: { description: 'Project identifier' },\n agentId: { description: 'Agent identifier' },\n subAgentId: { description: 'Sub-agent identifier' },\n createdAt: { description: 'Creation timestamp' },\n updatedAt: { description: 'Last update timestamp' },\n };\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n let configuredSchema = fieldSchema as z.ZodTypeAny;\n\n if (fieldName in fieldMetadata) {\n let innerSchema: z.ZodTypeAny;\n const isOptional = configuredSchema instanceof z.ZodOptional;\n\n if (isOptional) {\n innerSchema = (configuredSchema as z.ZodOptional<any>)._def.innerType as z.ZodTypeAny;\n } else {\n innerSchema = configuredSchema;\n }\n\n // Handle id field specially - ensure it has full validation\n if (fieldName === 'id' && innerSchema instanceof z.ZodString) {\n const configuredId = innerSchema\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n minLength: MIN_ID_LENGTH,\n maxLength: MAX_ID_LENGTH,\n pattern: URL_SAFE_ID_PATTERN.source,\n example: 'resource_789',\n });\n\n configuredId.meta({ description: 'Resource identifier' });\n configuredSchema = isOptional ? configuredId.optional() : configuredId;\n } else if (innerSchema instanceof z.ZodString) {\n // For other string fields, ensure description is set\n const configuredField = innerSchema.describe(fieldMetadata[fieldName].description).openapi({\n description: fieldMetadata[fieldName].description,\n });\n\n configuredField.meta(fieldMetadata[fieldName]);\n configuredSchema = isOptional ? configuredField.optional() : configuredField;\n }\n }\n\n newShape[fieldName] = configuredSchema;\n }\n\n // Reconstruct schema with properly configured fields\n const reconstructedSchema = partialSchema.extend(newShape).partial() as T;\n registerFieldSchemas(reconstructedSchema);\n\n if (metadata) {\n registerSchema(reconstructedSchema, metadata);\n }\n\n return reconstructedSchema;\n}\n\n/**\n * Wrapper for .omit() that registers the resulting schema and its fields in the global registry\n */\nexport function omitWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n keys: z.ZodObject<any>['shape'],\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const omittedSchema = schema.omit(keys) as T;\n registerFieldSchemas(omittedSchema);\n if (metadata) {\n registerSchema(omittedSchema, metadata);\n }\n return omittedSchema;\n}\n\n/**\n * Wrapper for .extend() that registers the resulting schema and its fields in the global registry\n */\nexport function extendWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n shape: z.ZodRawShape,\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const extendedSchema = schema.extend(shape) as T;\n registerFieldSchemas(extendedSchema);\n if (metadata) {\n registerSchema(extendedSchema, metadata);\n }\n return extendedSchema;\n}\n","import { z } from '@hono/zod-openapi';\nimport { schemaValidationDefaults } from '../constants/schema-validation/defaults';\n\n// Destructure defaults for use in schemas\nconst {\n AGENT_EXECUTION_TRANSFER_COUNT_MAX,\n AGENT_EXECUTION_TRANSFER_COUNT_MIN,\n CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT,\n STATUS_UPDATE_MAX_INTERVAL_SECONDS,\n STATUS_UPDATE_MAX_NUM_EVENTS,\n SUB_AGENT_TURN_GENERATION_STEPS_MAX,\n SUB_AGENT_TURN_GENERATION_STEPS_MIN,\n VALIDATION_AGENT_PROMPT_MAX_CHARS,\n VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,\n} = schemaValidationDefaults;\n\nimport {\n agents,\n apiKeys,\n artifactComponents,\n contextCache,\n contextConfigs,\n conversations,\n credentialReferences,\n dataComponents,\n externalAgents,\n functions,\n functionTools,\n ledgerArtifacts,\n messages,\n projects,\n subAgentArtifactComponents,\n subAgentDataComponents,\n subAgentExternalAgentRelations,\n subAgentRelations,\n subAgents,\n subAgentTeamAgentRelations,\n subAgentToolRelations,\n taskRelations,\n tasks,\n tools,\n} from '../db/schema';\nimport {\n CredentialStoreType,\n MCPServerType,\n MCPTransportType,\n TOOL_STATUS_VALUES,\n VALID_RELATION_TYPES,\n} from '../types/utility';\nimport {\n createInsertSchema,\n createSelectSchema,\n MAX_ID_LENGTH,\n MIN_ID_LENGTH,\n registerFieldSchemas,\n resourceIdSchema,\n URL_SAFE_ID_PATTERN,\n} from './drizzle-schema-helpers';\n\nexport { MAX_ID_LENGTH, MIN_ID_LENGTH, resourceIdSchema, URL_SAFE_ID_PATTERN };\n\nexport const StopWhenSchema = z\n .object({\n transferCountIs: z\n .number()\n .min(AGENT_EXECUTION_TRANSFER_COUNT_MIN)\n .max(AGENT_EXECUTION_TRANSFER_COUNT_MAX)\n .optional()\n .describe('The maximum number of transfers to trigger the stop condition.'),\n stepCountIs: z\n .number()\n .min(SUB_AGENT_TURN_GENERATION_STEPS_MIN)\n .max(SUB_AGENT_TURN_GENERATION_STEPS_MAX)\n .optional()\n .describe('The maximum number of steps to trigger the stop condition.'),\n })\n .openapi('StopWhen');\n\nexport const AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(\n 'AgentStopWhen'\n);\n\nexport const SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(\n 'SubAgentStopWhen'\n);\n\nexport type StopWhen = z.infer<typeof StopWhenSchema>;\nexport type AgentStopWhen = z.infer<typeof AgentStopWhenSchema>;\nexport type SubAgentStopWhen = z.infer<typeof SubAgentStopWhenSchema>;\n\nconst pageNumber = z.coerce.number().min(1).default(1).openapi('PaginationPageQueryParam');\nconst limitNumber = z.coerce\n .number()\n .min(1)\n .max(100)\n .default(10)\n .openapi('PaginationLimitQueryParam');\n\nexport const ModelSettingsSchema = z\n .object({\n model: z.string().optional().describe('The model to use for the project.'),\n providerOptions: z\n .record(z.string(), z.any())\n .optional()\n .describe('The provider options to use for the project.'),\n })\n .openapi('ModelSettings');\n\nexport type ModelSettings = z.infer<typeof ModelSettingsSchema>;\n\nexport const ModelSchema = z\n .object({\n base: ModelSettingsSchema.optional(),\n structuredOutput: ModelSettingsSchema.optional(),\n summarizer: ModelSettingsSchema.optional(),\n })\n .openapi('Model');\n\nexport const ProjectModelSchema = z\n .object({\n base: ModelSettingsSchema,\n structuredOutput: ModelSettingsSchema.optional(),\n summarizer: ModelSettingsSchema.optional(),\n })\n .openapi('ProjectModel');\n\nexport const FunctionToolConfigSchema = z.object({\n name: z.string(),\n description: z.string(),\n inputSchema: z.record(z.string(), z.unknown()),\n dependencies: z.record(z.string(), z.string()).optional(),\n execute: z.union([z.function(), z.string()]),\n});\n\nexport type FunctionToolConfig = Omit<z.infer<typeof FunctionToolConfigSchema>, 'execute'> & {\n execute: ((params: any) => Promise<any>) | string;\n};\n\nconst createApiSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true });\n\nconst createApiInsertSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true });\n\nconst createApiUpdateSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true }).partial();\n\nconst createAgentScopedApiSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true });\n\nconst createAgentScopedApiInsertSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true });\n\nconst createAgentScopedApiUpdateSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();\n\nexport const SubAgentSelectSchema = createSelectSchema(subAgents);\n\nexport const SubAgentInsertSchema = createInsertSchema(subAgents).extend({\n id: resourceIdSchema,\n models: ModelSchema.optional(),\n});\n\nexport const SubAgentUpdateSchema = SubAgentInsertSchema.partial();\n\nexport const SubAgentApiSelectSchema =\n createAgentScopedApiSchema(SubAgentSelectSchema).openapi('SubAgent');\nexport const SubAgentApiInsertSchema =\n createAgentScopedApiInsertSchema(SubAgentInsertSchema).openapi('SubAgentCreate');\nexport const SubAgentApiUpdateSchema =\n createAgentScopedApiUpdateSchema(SubAgentUpdateSchema).openapi('SubAgentUpdate');\n\nexport const SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);\nexport const SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n sourceSubAgentId: resourceIdSchema,\n targetSubAgentId: resourceIdSchema.optional(),\n externalSubAgentId: resourceIdSchema.optional(),\n teamSubAgentId: resourceIdSchema.optional(),\n});\nexport const SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();\n\nexport const SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentRelationSelectSchema\n).openapi('SubAgentRelation');\nexport const SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentRelationInsertSchema\n)\n .extend({\n relationType: z.enum(VALID_RELATION_TYPES),\n })\n .refine(\n (data) => {\n const hasTarget = data.targetSubAgentId != null;\n const hasExternal = data.externalSubAgentId != null;\n const hasTeam = data.teamSubAgentId != null;\n const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;\n return count === 1; // Exactly one must be true\n },\n {\n message:\n 'Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId',\n path: ['targetSubAgentId', 'externalSubAgentId', 'teamSubAgentId'],\n }\n )\n .openapi('SubAgentRelationCreate');\n\nexport const SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentRelationUpdateSchema\n)\n .extend({\n relationType: z.enum(VALID_RELATION_TYPES).optional(),\n })\n .refine(\n (data) => {\n const hasTarget = data.targetSubAgentId != null;\n const hasExternal = data.externalSubAgentId != null;\n const hasTeam = data.teamSubAgentId != null;\n const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;\n\n if (count === 0) {\n return true; // No relationship specified - valid for updates\n }\n\n return count === 1; // Exactly one must be true\n },\n {\n message:\n 'Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId when updating sub-agent relationships',\n path: ['targetSubAgentId', 'externalSubAgentId', 'teamSubAgentId'],\n }\n )\n .openapi('SubAgentRelationUpdate');\n\nexport const SubAgentRelationQuerySchema = z.object({\n sourceSubAgentId: z.string().optional(),\n targetSubAgentId: z.string().optional(),\n externalSubAgentId: z.string().optional(),\n teamSubAgentId: z.string().optional(),\n});\n\nexport const ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n sourceSubAgentId: resourceIdSchema,\n externalSubAgentId: resourceIdSchema,\n});\n\nexport const ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(\n ExternalSubAgentRelationInsertSchema\n);\n\nexport const AgentSelectSchema = createSelectSchema(agents);\nexport const AgentInsertSchema = createInsertSchema(agents).extend({\n id: resourceIdSchema,\n name: z.string().trim().nonempty(),\n});\nexport const AgentUpdateSchema = AgentInsertSchema.partial();\n\nexport const AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi('Agent');\nexport const AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema)\n .extend({\n id: resourceIdSchema,\n })\n .openapi('AgentCreate');\nexport const AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi('AgentUpdate');\n\nexport const TaskSelectSchema = createSelectSchema(tasks);\nexport const TaskInsertSchema = createInsertSchema(tasks).extend({\n id: resourceIdSchema,\n conversationId: resourceIdSchema.optional(),\n});\nexport const TaskUpdateSchema = TaskInsertSchema.partial();\n\nexport const TaskApiSelectSchema = createApiSchema(TaskSelectSchema);\nexport const TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);\nexport const TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);\n\nexport const TaskRelationSelectSchema = createSelectSchema(taskRelations);\nexport const TaskRelationInsertSchema = createInsertSchema(taskRelations).extend({\n id: resourceIdSchema,\n parentTaskId: resourceIdSchema,\n childTaskId: resourceIdSchema,\n});\nexport const TaskRelationUpdateSchema = TaskRelationInsertSchema.partial();\n\nexport const TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);\nexport const TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);\nexport const TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);\n\nconst imageUrlSchema = z\n .string()\n .optional()\n .refine(\n (url) => {\n if (!url) return true; // Optional field\n if (url.startsWith('data:image/')) {\n const base64Part = url.split(',')[1];\n if (!base64Part) return false;\n return base64Part.length < 1400000; // ~1MB limit\n }\n try {\n const parsed = new URL(url);\n return parsed.protocol === 'http:' || parsed.protocol === 'https:';\n } catch {\n return false;\n }\n },\n {\n message: 'Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)',\n }\n );\n\nexport const McpTransportConfigSchema = z\n .object({\n type: z.enum(MCPTransportType),\n requestInit: z.record(z.string(), z.unknown()).optional(),\n eventSourceInit: z.record(z.string(), z.unknown()).optional(),\n reconnectionOptions: z.any().optional().openapi({\n type: 'object',\n description: 'Reconnection options for streamable HTTP transport',\n }),\n sessionId: z.string().optional(),\n })\n .openapi('McpTransportConfig');\n\nexport const ToolStatusSchema = z.enum(TOOL_STATUS_VALUES);\n\nexport const McpToolDefinitionSchema = z.object({\n name: z.string(),\n description: z.string().optional(),\n inputSchema: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const ToolSelectSchema = createSelectSchema(tools);\n\nexport const ToolInsertSchema = createInsertSchema(tools).extend({\n id: resourceIdSchema,\n imageUrl: imageUrlSchema,\n config: z.object({\n type: z.literal('mcp'),\n mcp: z.object({\n server: z.object({\n url: z.url(),\n }),\n transport: z\n .object({\n type: z.enum(MCPTransportType),\n requestInit: z.record(z.string(), z.unknown()).optional(),\n eventSourceInit: z.record(z.string(), z.unknown()).optional(),\n reconnectionOptions: z.any().optional().openapi({\n type: 'object',\n description: 'Reconnection options for streamable HTTP transport',\n }),\n sessionId: z.string().optional(),\n })\n .optional(),\n activeTools: z.array(z.string()).optional(),\n }),\n }),\n});\n\nexport const ConversationSelectSchema = createSelectSchema(conversations);\nexport const ConversationInsertSchema = createInsertSchema(conversations).extend({\n id: resourceIdSchema,\n contextConfigId: resourceIdSchema.optional(),\n});\nexport const ConversationUpdateSchema = ConversationInsertSchema.partial();\n\nexport const ConversationApiSelectSchema =\n createApiSchema(ConversationSelectSchema).openapi('Conversation');\nexport const ConversationApiInsertSchema =\n createApiInsertSchema(ConversationInsertSchema).openapi('ConversationCreate');\nexport const ConversationApiUpdateSchema =\n createApiUpdateSchema(ConversationUpdateSchema).openapi('ConversationUpdate');\n\nexport const MessageSelectSchema = createSelectSchema(messages);\nexport const MessageInsertSchema = createInsertSchema(messages).extend({\n id: resourceIdSchema,\n conversationId: resourceIdSchema,\n taskId: resourceIdSchema.optional(),\n});\nexport const MessageUpdateSchema = MessageInsertSchema.partial();\n\nexport const MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi('Message');\nexport const MessageApiInsertSchema =\n createApiInsertSchema(MessageInsertSchema).openapi('MessageCreate');\nexport const MessageApiUpdateSchema =\n createApiUpdateSchema(MessageUpdateSchema).openapi('MessageUpdate');\n\nexport const ContextCacheSelectSchema = createSelectSchema(contextCache);\nexport const ContextCacheInsertSchema = createInsertSchema(contextCache);\nexport const ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();\n\nexport const ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);\nexport const ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);\nexport const ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);\n\nexport const DataComponentSelectSchema = createSelectSchema(dataComponents);\nexport const DataComponentInsertSchema = createInsertSchema(dataComponents).extend({\n id: resourceIdSchema,\n});\nexport const DataComponentBaseSchema = DataComponentInsertSchema.omit({\n createdAt: true,\n updatedAt: true,\n});\n\nexport const DataComponentUpdateSchema = DataComponentInsertSchema.partial();\n\nexport const DataComponentApiSelectSchema =\n createApiSchema(DataComponentSelectSchema).openapi('DataComponent');\nexport const DataComponentApiInsertSchema =\n createApiInsertSchema(DataComponentInsertSchema).openapi('DataComponentCreate');\nexport const DataComponentApiUpdateSchema =\n createApiUpdateSchema(DataComponentUpdateSchema).openapi('DataComponentUpdate');\n\nexport const SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);\nexport const SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);\nexport const SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();\n\nexport const SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(\n SubAgentDataComponentSelectSchema\n);\nexport const SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true,\n createdAt: true,\n});\nexport const SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentDataComponentUpdateSchema\n);\n\nexport const ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);\nexport const ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({\n id: resourceIdSchema,\n});\nexport const ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();\n\nexport const ArtifactComponentApiSelectSchema = createApiSchema(\n ArtifactComponentSelectSchema\n).openapi('ArtifactComponent');\nexport const ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n createdAt: true,\n updatedAt: true,\n}).openapi('ArtifactComponentCreate');\nexport const ArtifactComponentApiUpdateSchema = createApiUpdateSchema(\n ArtifactComponentUpdateSchema\n).openapi('ArtifactComponentUpdate');\n\nexport const SubAgentArtifactComponentSelectSchema = createSelectSchema(subAgentArtifactComponents);\nexport const SubAgentArtifactComponentInsertSchema = createInsertSchema(\n subAgentArtifactComponents\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n artifactComponentId: resourceIdSchema,\n});\nexport const SubAgentArtifactComponentUpdateSchema =\n SubAgentArtifactComponentInsertSchema.partial();\n\nexport const SubAgentArtifactComponentApiSelectSchema = createAgentScopedApiSchema(\n SubAgentArtifactComponentSelectSchema\n);\nexport const SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true,\n createdAt: true,\n});\nexport const SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentArtifactComponentUpdateSchema\n);\n\nexport const ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({\n credentialReferenceId: z.string().nullable().optional(),\n});\nexport const ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({\n id: resourceIdSchema,\n});\nexport const ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();\n\nexport const ExternalAgentApiSelectSchema =\n createApiSchema(ExternalAgentSelectSchema).openapi('ExternalAgent');\nexport const ExternalAgentApiInsertSchema =\n createApiInsertSchema(ExternalAgentInsertSchema).openapi('ExternalAgentCreate');\nexport const ExternalAgentApiUpdateSchema =\n createApiUpdateSchema(ExternalAgentUpdateSchema).openapi('ExternalAgentUpdate');\n\nexport const AllAgentSchema = z.discriminatedUnion('type', [\n SubAgentApiSelectSchema.extend({ type: z.literal('internal') }),\n ExternalAgentApiSelectSchema.extend({ type: z.literal('external') }),\n]);\n\nexport const ApiKeySelectSchema = createSelectSchema(apiKeys);\n\nexport const ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n});\n\nexport const ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({\n tenantId: true,\n projectId: true,\n id: true,\n publicId: true,\n keyHash: true,\n keyPrefix: true,\n createdAt: true,\n});\n\nexport const ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({\n tenantId: true,\n projectId: true,\n keyHash: true, // Never expose the hash\n}).openapi('ApiKey');\n\nexport const ApiKeyApiCreationResponseSchema = z.object({\n data: z.object({\n apiKey: ApiKeyApiSelectSchema,\n key: z.string().describe('The full API key (shown only once)'),\n }),\n});\n\nexport const ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true, // Auto-generated\n publicId: true, // Auto-generated\n keyHash: true, // Auto-generated\n keyPrefix: true, // Auto-generated\n lastUsedAt: true, // Not set on creation\n}).openapi('ApiKeyCreate');\n\nexport const ApiKeyApiUpdateSchema = ApiKeyUpdateSchema.openapi('ApiKeyUpdate');\n\nexport const CredentialReferenceSelectSchema = createSelectSchema(credentialReferences);\n\nexport const CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({\n id: resourceIdSchema,\n type: z.string(),\n credentialStoreId: resourceIdSchema,\n retrievalParams: z.record(z.string(), z.unknown()).nullish(),\n});\n\nexport const CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();\n\nexport const CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema)\n .extend({\n type: z.enum(CredentialStoreType),\n tools: z.array(ToolSelectSchema).optional(),\n externalAgents: z.array(ExternalAgentSelectSchema).optional(),\n })\n .openapi('CredentialReference');\nexport const CredentialReferenceApiInsertSchema = createApiInsertSchema(\n CredentialReferenceInsertSchema\n)\n .extend({\n type: z.enum(CredentialStoreType),\n })\n .openapi('CredentialReferenceCreate');\nexport const CredentialReferenceApiUpdateSchema = createApiUpdateSchema(\n CredentialReferenceUpdateSchema\n)\n .extend({\n type: z.enum(CredentialStoreType).optional(),\n })\n .openapi('CredentialReferenceUpdate');\n\nexport const CredentialStoreSchema = z\n .object({\n id: z.string().describe('Unique identifier of the credential store'),\n type: z.enum(CredentialStoreType),\n available: z.boolean().describe('Whether the store is functional and ready to use'),\n reason: z.string().nullable().describe('Reason why store is not available, if applicable'),\n })\n .openapi('CredentialStore');\n\nexport const CredentialStoreListResponseSchema = z\n .object({\n data: z.array(CredentialStoreSchema).describe('List of credential stores'),\n })\n .openapi('CredentialStoreListResponse');\n\nexport const CreateCredentialInStoreRequestSchema = z\n .object({\n key: z.string().describe('The credential key'),\n value: z.string().describe('The credential value'),\n metadata: z\n .record(z.string(), z.string())\n .nullish()\n .describe('The metadata for the credential'),\n })\n .openapi('CreateCredentialInStoreRequest');\n\nexport const CreateCredentialInStoreResponseSchema = z\n .object({\n data: z.object({\n key: z.string().describe('The credential key'),\n storeId: z.string().describe('The store ID where credential was created'),\n createdAt: z.string().describe('ISO timestamp of creation'),\n }),\n })\n .openapi('CreateCredentialInStoreResponse');\n\nexport const RelatedAgentInfoSchema = z\n .object({\n id: z.string(),\n name: z.string(),\n description: z.string().nullable(),\n })\n .openapi('RelatedAgentInfo');\n\nexport const ComponentAssociationSchema = z\n .object({\n subAgentId: z.string(),\n createdAt: z.string(),\n })\n .openapi('ComponentAssociation');\n\nexport const OAuthLoginQuerySchema = z\n .object({\n tenantId: z.string().min(1, 'Tenant ID is required'),\n projectId: z.string().min(1, 'Project ID is required'),\n toolId: z.string().min(1, 'Tool ID is required'),\n })\n .openapi('OAuthLoginQuery');\n\nexport const OAuthCallbackQuerySchema = z\n .object({\n code: z.string().min(1, 'Authorization code is required'),\n state: z.string().min(1, 'State parameter is required'),\n error: z.string().optional(),\n error_description: z.string().optional(),\n })\n .openapi('OAuthCallbackQuery');\n\nexport const McpToolSchema = ToolInsertSchema.extend({\n imageUrl: imageUrlSchema,\n availableTools: z.array(McpToolDefinitionSchema).optional(),\n status: ToolStatusSchema.default('unknown'),\n version: z.string().optional(),\n expiresAt: z.string().optional(),\n createdBy: z.string().optional(),\n relationshipId: z.string().optional(),\n}).openapi('McpTool');\n\nexport const MCPToolConfigSchema = McpToolSchema.omit({\n config: true,\n tenantId: true,\n projectId: true,\n status: true,\n version: true,\n createdAt: true,\n updatedAt: true,\n credentialReferenceId: true,\n}).extend({\n tenantId: z.string().optional(),\n projectId: z.string().optional(),\n description: z.string().optional(),\n serverUrl: z.url(),\n activeTools: z.array(z.string()).optional(),\n mcpType: z.enum(MCPServerType).optional(),\n transport: McpTransportConfigSchema.optional(),\n credential: CredentialReferenceApiInsertSchema.optional(),\n});\n\nexport const ToolUpdateSchema = ToolInsertSchema.partial();\n\nexport const ToolApiSelectSchema = createApiSchema(ToolSelectSchema).openapi('Tool');\nexport const ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema).openapi('ToolCreate');\nexport const ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema).openapi('ToolUpdate');\n\nexport const FunctionToolSelectSchema = createSelectSchema(functionTools);\n\nexport const FunctionToolInsertSchema = createInsertSchema(functionTools).extend({\n id: resourceIdSchema,\n});\n\nexport const FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();\n\nexport const FunctionToolApiSelectSchema =\n createApiSchema(FunctionToolSelectSchema).openapi('FunctionTool');\nexport const FunctionToolApiInsertSchema =\n createAgentScopedApiInsertSchema(FunctionToolInsertSchema).openapi('FunctionToolCreate');\nexport const FunctionToolApiUpdateSchema =\n createApiUpdateSchema(FunctionToolUpdateSchema).openapi('FunctionToolUpdate');\n\nexport const FunctionSelectSchema = createSelectSchema(functions);\nexport const FunctionInsertSchema = createInsertSchema(functions).extend({\n id: resourceIdSchema,\n});\nexport const FunctionUpdateSchema = FunctionInsertSchema.partial();\n\nexport const FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi('Function');\nexport const FunctionApiInsertSchema =\n createApiInsertSchema(FunctionInsertSchema).openapi('FunctionCreate');\nexport const FunctionApiUpdateSchema =\n createApiUpdateSchema(FunctionUpdateSchema).openapi('FunctionUpdate');\n\n// Zod schemas for validation\nexport const FetchConfigSchema = z\n .object({\n url: z.string().min(1, 'URL is required'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).optional().default('GET'),\n headers: z.record(z.string(), z.string()).optional(),\n body: z.record(z.string(), z.unknown()).optional(),\n transform: z.string().optional(), // JSONPath or JS transform function\n requiredToFetch: z.array(z.string()).optional(), // Context variables that are required to run the fetch request. If the given variables cannot be resolved, the fetch request will be skipped.\n timeout: z\n .number()\n .min(0)\n .optional()\n .default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT)\n .optional(),\n })\n .openapi('FetchConfig');\n\nexport const FetchDefinitionSchema = z\n .object({\n id: z.string().min(1, 'Fetch definition ID is required'),\n name: z.string().optional(),\n trigger: z.enum(['initialization', 'invocation']),\n fetchConfig: FetchConfigSchema,\n responseSchema: z.any().optional(), // JSON Schema for validating HTTP response\n defaultValue: z.any().optional().openapi({\n description: 'Default value if fetch fails',\n }),\n credential: CredentialReferenceApiInsertSchema.optional(),\n })\n .openapi('FetchDefinition');\n\nexport const ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({\n headersSchema: z.any().optional().openapi({\n type: 'object',\n description: 'JSON Schema for validating request headers',\n }),\n});\nexport const ContextConfigInsertSchema = createInsertSchema(contextConfigs)\n .extend({\n id: resourceIdSchema.optional(),\n headersSchema: z.any().nullable().optional().openapi({\n type: 'object',\n description: 'JSON Schema for validating request headers',\n }),\n contextVariables: z.any().nullable().optional().openapi({\n type: 'object',\n description: 'Context variables configuration with fetch definitions',\n }),\n })\n .omit({\n createdAt: true,\n updatedAt: true,\n });\nexport const ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();\n\nexport const ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfig');\nexport const ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfigCreate');\nexport const ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfigUpdate');\n\nexport const SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);\nexport const SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n toolId: resourceIdSchema,\n selectedTools: z.array(z.string()).nullish(),\n headers: z.record(z.string(), z.string()).nullish(),\n toolPolicies: z.record(z.string(), z.object({ needsApproval: z.boolean().optional() })).nullish(),\n});\n\nexport const SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();\n\nexport const SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentToolRelationSelectSchema\n).openapi('SubAgentToolRelation');\nexport const SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentToolRelationInsertSchema\n).openapi('SubAgentToolRelationCreate');\nexport const SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentToolRelationUpdateSchema\n).openapi('SubAgentToolRelationUpdate');\n\n// Sub-Agent External Agent Relation Schemas\nexport const SubAgentExternalAgentRelationSelectSchema = createSelectSchema(\n subAgentExternalAgentRelations\n);\nexport const SubAgentExternalAgentRelationInsertSchema = createInsertSchema(\n subAgentExternalAgentRelations\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n externalAgentId: resourceIdSchema,\n headers: z.record(z.string(), z.string()).nullish(),\n});\n\nexport const SubAgentExternalAgentRelationUpdateSchema =\n SubAgentExternalAgentRelationInsertSchema.partial();\n\nexport const SubAgentExternalAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentExternalAgentRelationSelectSchema\n).openapi('SubAgentExternalAgentRelation');\nexport const SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentExternalAgentRelationInsertSchema\n)\n .omit({ id: true, subAgentId: true })\n .openapi('SubAgentExternalAgentRelationCreate');\nexport const SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentExternalAgentRelationUpdateSchema\n).openapi('SubAgentExternalAgentRelationUpdate');\n\n// Sub-Agent Team Agent Relation Schemas\nexport const SubAgentTeamAgentRelationSelectSchema = createSelectSchema(subAgentTeamAgentRelations);\nexport const SubAgentTeamAgentRelationInsertSchema = createInsertSchema(\n subAgentTeamAgentRelations\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n targetAgentId: resourceIdSchema,\n headers: z.record(z.string(), z.string()).nullish(),\n});\n\nexport const SubAgentTeamAgentRelationUpdateSchema =\n SubAgentTeamAgentRelationInsertSchema.partial();\n\nexport const SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentTeamAgentRelationSelectSchema\n).openapi('SubAgentTeamAgentRelation');\nexport const SubAgentTeamAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentTeamAgentRelationInsertSchema\n)\n .omit({ id: true, subAgentId: true })\n .openapi('SubAgentTeamAgentRelationCreate');\nexport const SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentTeamAgentRelationUpdateSchema\n).openapi('SubAgentTeamAgentRelationUpdate');\n\nexport const LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);\nexport const LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);\nexport const LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();\n\nexport const LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);\nexport const LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);\nexport const LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);\n\nexport const StatusComponentSchema = z\n .object({\n type: z.string(),\n description: z.string().optional(),\n detailsSchema: z\n .object({\n type: z.literal('object'),\n properties: z.record(z.string(), z.any()),\n required: z.array(z.string()).optional(),\n })\n .optional(),\n })\n .openapi('StatusComponent');\n\nexport const StatusUpdateSchema = z\n .object({\n enabled: z.boolean().optional(),\n numEvents: z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),\n timeInSeconds: z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),\n prompt: z\n .string()\n .max(\n VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,\n `Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS} characters`\n )\n .optional(),\n statusComponents: z.array(StatusComponentSchema).optional(),\n })\n .openapi('StatusUpdate');\n\nexport const CanUseItemSchema = z\n .object({\n agentToolRelationId: z.string().optional(),\n toolId: z.string(),\n toolSelection: z.array(z.string()).nullish(),\n headers: z.record(z.string(), z.string()).nullish(),\n toolPolicies: z\n .record(z.string(), z.object({ needsApproval: z.boolean().optional() }))\n .nullish(),\n })\n .openapi('CanUseItem');\n\nexport const canDelegateToExternalAgentSchema = z\n .object({\n externalAgentId: z.string(),\n subAgentExternalAgentRelationId: z.string().optional(),\n headers: z.record(z.string(), z.string()).nullish(),\n })\n .openapi('CanDelegateToExternalAgent');\n\nexport const canDelegateToTeamAgentSchema = z\n .object({\n agentId: z.string(),\n subAgentTeamAgentRelationId: z.string().optional(),\n headers: z.record(z.string(), z.string()).nullish(),\n })\n .openapi('CanDelegateToTeamAgent');\n\nexport const TeamAgentSchema = z\n .object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n })\n .openapi('TeamAgent');\n\nexport const FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({\n type: z.literal('internal'),\n canUse: z.array(CanUseItemSchema), // All tools (both MCP and function tools)\n dataComponents: z.array(z.string()).optional(),\n artifactComponents: z.array(z.string()).optional(),\n canTransferTo: z.array(z.string()).optional(),\n prompt: z.string().trim().optional(),\n canDelegateTo: z\n .array(\n z.union([\n z.string(), // Internal subAgent ID\n canDelegateToExternalAgentSchema, // External agent with headers\n canDelegateToTeamAgentSchema, // Team agent with headers\n ])\n )\n .optional(),\n}).openapi('FullAgentAgentInsert');\n\nexport const AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({\n subAgents: z.record(z.string(), FullAgentAgentInsertSchema), // Lookup maps for UI to resolve canUse items\n tools: z.record(z.string(), ToolApiInsertSchema).optional(), // MCP tools (project-scoped)\n externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(), // External agents (project-scoped)\n teamAgents: z.record(z.string(), TeamAgentSchema).optional(), // Team agents contain basic metadata for the agent to be delegated to\n functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(), // Function tools (agent-scoped)\n functions: z.record(z.string(), FunctionApiInsertSchema).optional(), // Get function code for function tools\n contextConfig: z.optional(ContextConfigApiInsertSchema),\n statusUpdates: z.optional(StatusUpdateSchema),\n models: ModelSchema.optional(),\n stopWhen: AgentStopWhenSchema.optional(),\n prompt: z\n .string()\n .max(\n VALIDATION_AGENT_PROMPT_MAX_CHARS,\n `Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS} characters`\n )\n .optional(),\n}).openapi('AgentWithinContextOfProject');\n\nexport const PaginationSchema = z\n .object({\n page: pageNumber,\n limit: limitNumber,\n total: z.number(),\n pages: z.number(),\n })\n .openapi('Pagination');\n\nexport const ListResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n pagination: PaginationSchema,\n });\n\nexport const SingleResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>\n z.object({\n data: itemSchema,\n });\n\nexport const ErrorResponseSchema = z\n .object({\n error: z.string(),\n message: z.string().optional(),\n details: z.any().optional().openapi({\n description: 'Additional error details',\n }),\n })\n .openapi('ErrorResponse');\n\nexport const ExistsResponseSchema = z\n .object({\n exists: z.boolean(),\n })\n .openapi('ExistsResponse');\n\nexport const RemovedResponseSchema = z\n .object({\n message: z.string(),\n removed: z.boolean(),\n })\n .openapi('RemovedResponse');\n\nexport const ProjectSelectSchema = registerFieldSchemas(\n createSelectSchema(projects).extend({\n models: ProjectModelSchema.nullable(),\n stopWhen: StopWhenSchema.nullable(),\n })\n);\nexport const ProjectInsertSchema = createInsertSchema(projects)\n .extend({\n models: ProjectModelSchema,\n stopWhen: StopWhenSchema.optional(),\n })\n .omit({\n createdAt: true,\n updatedAt: true,\n });\nexport const ProjectUpdateSchema = ProjectInsertSchema.partial().omit({\n id: true,\n tenantId: true,\n});\n\n// Projects API schemas - only omit tenantId since projects table doesn't have projectId\nexport const ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true }).openapi(\n 'Project'\n);\nexport const ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openapi(\n 'ProjectCreate'\n);\nexport const ProjectApiUpdateSchema = ProjectUpdateSchema.openapi('ProjectUpdate');\n\n// Full Project Definition Schema - extends Project with agents and other nested resources\nexport const FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({\n agents: z.record(z.string(), AgentWithinContextOfProjectSchema),\n tools: z.record(z.string(), ToolApiInsertSchema),\n functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),\n functions: z.record(z.string(), FunctionApiInsertSchema).optional(),\n dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),\n artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),\n externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(),\n statusUpdates: z.optional(StatusUpdateSchema),\n credentialReferences: z.record(z.string(), CredentialReferenceApiInsertSchema).optional(),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n}).openapi('FullProjectDefinition');\n\n// Single item response wrappers\nexport const ProjectResponse = z\n .object({ data: ProjectApiSelectSchema })\n .openapi('ProjectResponse');\nexport const SubAgentResponse = z\n .object({ data: SubAgentApiSelectSchema })\n .openapi('SubAgentResponse');\nexport const AgentResponse = z.object({ data: AgentApiSelectSchema }).openapi('AgentResponse');\nexport const ToolResponse = z.object({ data: ToolApiSelectSchema }).openapi('ToolResponse');\nexport const ExternalAgentResponse = z\n .object({ data: ExternalAgentApiSelectSchema })\n .openapi('ExternalAgentResponse');\nexport const ContextConfigResponse = z\n .object({ data: ContextConfigApiSelectSchema })\n .openapi('ContextConfigResponse');\nexport const ApiKeyResponse = z.object({ data: ApiKeyApiSelectSchema }).openapi('ApiKeyResponse');\nexport const CredentialReferenceResponse = z\n .object({ data: CredentialReferenceApiSelectSchema })\n .openapi('CredentialReferenceResponse');\nexport const FunctionResponse = z\n .object({ data: FunctionApiSelectSchema })\n .openapi('FunctionResponse');\nexport const FunctionToolResponse = z\n .object({ data: FunctionToolApiSelectSchema })\n .openapi('FunctionToolResponse');\nexport const DataComponentResponse = z\n .object({ data: DataComponentApiSelectSchema })\n .openapi('DataComponentResponse');\nexport const ArtifactComponentResponse = z\n .object({ data: ArtifactComponentApiSelectSchema })\n .openapi('ArtifactComponentResponse');\nexport const SubAgentRelationResponse = z\n .object({ data: SubAgentRelationApiSelectSchema })\n .openapi('SubAgentRelationResponse');\nexport const SubAgentToolRelationResponse = z\n .object({ data: SubAgentToolRelationApiSelectSchema })\n .openapi('SubAgentToolRelationResponse');\nexport const ConversationResponse = z\n .object({ data: ConversationApiSelectSchema })\n .openapi('ConversationResponse');\nexport const MessageResponse = z\n .object({ data: MessageApiSelectSchema })\n .openapi('MessageResponse');\n\nexport const ProjectListResponse = z\n .object({\n data: z.array(ProjectApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ProjectListResponse');\nexport const SubAgentListResponse = z\n .object({\n data: z.array(SubAgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentListResponse');\nexport const AgentListResponse = z\n .object({\n data: z.array(AgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('AgentListResponse');\nexport const ToolListResponse = z\n .object({\n data: z.array(ToolApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ToolListResponse');\nexport const ExternalAgentListResponse = z\n .object({\n data: z.array(ExternalAgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ExternalAgentListResponse');\nexport const ContextConfigListResponse = z\n .object({\n data: z.array(ContextConfigApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ContextConfigListResponse');\nexport const ApiKeyListResponse = z\n .object({\n data: z.array(ApiKeyApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ApiKeyListResponse');\nexport const CredentialReferenceListResponse = z\n .object({\n data: z.array(CredentialReferenceApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('CredentialReferenceListResponse');\nexport const FunctionListResponse = z\n .object({\n data: z.array(FunctionApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('FunctionListResponse');\nexport const FunctionToolListResponse = z\n .object({\n data: z.array(FunctionToolApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('FunctionToolListResponse');\nexport const DataComponentListResponse = z\n .object({\n data: z.array(DataComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('DataComponentListResponse');\nexport const ArtifactComponentListResponse = z\n .object({\n data: z.array(ArtifactComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ArtifactComponentListResponse');\nexport const SubAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentRelationListResponse');\nexport const SubAgentToolRelationListResponse = z\n .object({\n data: z.array(SubAgentToolRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentToolRelationListResponse');\nexport const ConversationListResponse = z\n .object({\n data: z.array(ConversationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ConversationListResponse');\nexport const MessageListResponse = z\n .object({\n data: z.array(MessageApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('MessageListResponse');\nexport const SubAgentDataComponentResponse = z\n .object({ data: SubAgentDataComponentApiSelectSchema })\n .openapi('SubAgentDataComponentResponse');\nexport const SubAgentArtifactComponentResponse = z\n .object({ data: SubAgentArtifactComponentApiSelectSchema })\n .openapi('SubAgentArtifactComponentResponse');\nexport const SubAgentDataComponentListResponse = z\n .object({\n data: z.array(SubAgentDataComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentDataComponentListResponse');\nexport const SubAgentArtifactComponentListResponse = z\n .object({\n data: z.array(SubAgentArtifactComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentArtifactComponentListResponse');\n\n// Missing response schemas for factory function replacement\nexport const FullProjectDefinitionResponse = z\n .object({ data: FullProjectDefinitionSchema })\n .openapi('FullProjectDefinitionResponse');\n\nexport const AgentWithinContextOfProjectResponse = z\n .object({ data: AgentWithinContextOfProjectSchema })\n .openapi('AgentWithinContextOfProjectResponse');\n\nexport const RelatedAgentInfoListResponse = z\n .object({\n data: z.array(RelatedAgentInfoSchema),\n pagination: PaginationSchema,\n })\n .openapi('RelatedAgentInfoListResponse');\n\nexport const ComponentAssociationListResponse = z\n .object({ data: z.array(ComponentAssociationSchema) })\n .openapi('ComponentAssociationListResponse');\n\nexport const McpToolResponse = z.object({ data: McpToolSchema }).openapi('McpToolResponse');\n\nexport const McpToolListResponse = z\n .object({\n data: z.array(McpToolSchema),\n pagination: PaginationSchema,\n })\n .openapi('McpToolListResponse');\n\nexport const SubAgentTeamAgentRelationResponse = z\n .object({ data: SubAgentTeamAgentRelationApiSelectSchema })\n .openapi('SubAgentTeamAgentRelationResponse');\n\nexport const SubAgentTeamAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentTeamAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentTeamAgentRelationListResponse');\n\nexport const SubAgentExternalAgentRelationResponse = z\n .object({ data: SubAgentExternalAgentRelationApiSelectSchema })\n .openapi('SubAgentExternalAgentRelationResponse');\n\nexport const SubAgentExternalAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentExternalAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentExternalAgentRelationListResponse');\n\n// Array response schemas (no pagination)\nexport const DataComponentArrayResponse = z\n .object({ data: z.array(DataComponentApiSelectSchema) })\n .openapi('DataComponentArrayResponse');\n\nexport const ArtifactComponentArrayResponse = z\n .object({ data: z.array(ArtifactComponentApiSelectSchema) })\n .openapi('ArtifactComponentArrayResponse');\n\nexport const HeadersScopeSchema = z.object({\n 'x-inkeep-tenant-id': z.string().optional().openapi({\n description: 'Tenant identifier',\n example: 'tenant_123',\n }),\n 'x-inkeep-project-id': z.string().optional().openapi({\n description: 'Project identifier',\n example: 'project_456',\n }),\n 'x-inkeep-agent-id': z.string().optional().openapi({\n description: 'Agent identifier',\n example: 'agent_789',\n }),\n});\n\nconst TenantId = z.string().openapi('TenantIdPathParam', {\n param: {\n name: 'tenantId',\n in: 'path',\n },\n description: 'Tenant identifier',\n example: 'tenant_123',\n});\n\nconst ProjectId = z.string().openapi('ProjectIdPathParam', {\n param: {\n name: 'projectId',\n in: 'path',\n },\n description: 'Project identifier',\n example: 'project_456',\n});\n\nconst AgentId = z.string().openapi('AgentIdPathParam', {\n param: {\n name: 'agentId',\n in: 'path',\n },\n description: 'Agent identifier',\n example: 'agent_789',\n});\n\nconst SubAgentId = z.string().openapi('SubAgentIdPathParam', {\n param: {\n name: 'subAgentId',\n in: 'path',\n },\n description: 'Sub-agent identifier',\n example: 'sub_agent_123',\n});\n\nexport const TenantParamsSchema = z.object({\n tenantId: TenantId,\n});\n\nexport const TenantIdParamsSchema = TenantParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectParamsSchema = TenantParamsSchema.extend({\n projectId: ProjectId,\n});\n\nexport const TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({\n agentId: AgentId,\n});\n\nexport const TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({\n subAgentId: SubAgentId,\n});\n\nexport const TenantProjectAgentSubAgentIdParamsSchema =\n TenantProjectAgentSubAgentParamsSchema.extend({\n id: resourceIdSchema,\n });\n\nexport const PaginationQueryParamsSchema = z\n .object({\n page: pageNumber,\n limit: limitNumber,\n })\n .openapi('PaginationQueryParams');\n\nexport const PrebuiltMCPServerSchema = z.object({\n id: z.string().describe('Unique identifier for the MCP server'),\n name: z.string().describe('Display name of the MCP server'),\n url: z.url().describe('URL endpoint for the MCP server'),\n transport: z.enum(MCPTransportType).describe('Transport protocol type'),\n imageUrl: z.url().optional().describe('Logo/icon URL for the MCP server'),\n isOpen: z\n .boolean()\n .optional()\n .describe(\"Whether the MCP server is open (doesn't require authentication)\"),\n category: z\n .string()\n .optional()\n .describe('Category of the MCP server (e.g., communication, project_management)'),\n description: z.string().optional().describe('Brief description of what the MCP server does'),\n thirdPartyConnectAccountUrl: z\n .url()\n .optional()\n .describe('URL to connect to the third party account'),\n});\n\nexport const MCPCatalogListResponse = z\n .object({\n data: z.array(PrebuiltMCPServerSchema),\n })\n .openapi('MCPCatalogListResponse');\n\nexport const ThirdPartyMCPServerResponse = z\n .object({\n data: PrebuiltMCPServerSchema.nullable(),\n })\n .openapi('ThirdPartyMCPServerResponse');\n","import Ajv from 'ajv';\n\nexport interface PropsValidationResult {\n isValid: boolean;\n errors: Array<{\n field: string;\n message: string;\n value?: any;\n }>;\n}\n\n/**\n * Validates that a props object is a valid JSON Schema\n * Uses AJV to validate the schema structure without resolving references\n */\nexport function validatePropsAsJsonSchema(props: any): PropsValidationResult {\n // If props is null, undefined, or empty, it's valid (optional for artifact components)\n if (!props || (typeof props === 'object' && Object.keys(props).length === 0)) {\n return {\n isValid: true,\n errors: [],\n };\n }\n\n // Basic JSON Schema structure validation\n if (typeof props !== 'object' || Array.isArray(props)) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props',\n message: 'Props must be a valid JSON Schema object',\n value: props,\n },\n ],\n };\n }\n\n // Check for required JSON Schema fields\n if (!props.type) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.type',\n message: 'JSON Schema must have a \"type\" field',\n },\n ],\n };\n }\n\n if (props.type !== 'object') {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.type',\n message: 'JSON Schema type must be \"object\" for component props',\n value: props.type,\n },\n ],\n };\n }\n\n if (!props.properties || typeof props.properties !== 'object') {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.properties',\n message: 'JSON Schema must have a \"properties\" object',\n },\n ],\n };\n }\n\n // Note: 'required' array is optional in JSON Schema\n // If present, it must be an array, but it's not mandatory\n if (props.required !== undefined && !Array.isArray(props.required)) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.required',\n message: 'If present, \"required\" must be an array',\n },\n ],\n };\n }\n\n // Use AJV to validate the schema structure (without resolving references)\n try {\n const schemaToValidate = { ...props };\n delete schemaToValidate.$schema;\n\n const schemaValidator = new Ajv({\n strict: false, // Allow unknown keywords like inPreview\n validateSchema: true, // Validate the schema itself\n addUsedSchema: false, // Don't add schemas to the instance\n });\n\n const isValid = schemaValidator.validateSchema(schemaToValidate);\n\n if (!isValid) {\n const errors = schemaValidator.errors || [];\n return {\n isValid: false,\n errors: errors.map((error: any) => ({\n field: `props${error.instancePath || ''}`,\n message: error.message || 'Invalid schema',\n })),\n };\n }\n\n return {\n isValid: true,\n errors: [],\n };\n } catch (error) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props',\n message: `Schema validation failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAAgB;AAC7B,MAAa,gBAAgB;AAC7B,MAAa,sBAAsB;AAEnC,MAAa,mBAAmB,EAC7B,QAAQ,CACR,IAAI,cAAc,CAClB,IAAI,cAAc,CAClB,SAAS,sBAAsB,CAC/B,MAAM,qBAAqB,EAC1B,SAAS,yEACV,CAAC,CACD,QAAQ;CACP,aAAa;CACb,SAAS;CACV,CAAC;AAEJ,iBAAiB,KAAK,EACpB,aAAa,uBACd,CAAC;AAEF,MAAMA,kBAA0E;CAC9E,KAAK,WAAW;EACd,MAAM,WAA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AAQ,CACN;GACE,OAAO;GACP,SAAS;GACV,CACF;EACF;AAIH,KAAI;EACF,MAAM,mBAAmB,EAAE,GAAG,OAAO;AACrC,SAAO,iBAAiB;EAExB,MAAM,kBAAkB,IAAI,IAAI;GAC9B,QAAQ;GACR,gBAAgB;GAChB,eAAe;GAChB,CAAC;AAIF,MAAI,CAFY,gBAAgB,eAAe,iBAAiB,CAI9D,QAAO;GACL,SAAS;GACT,SAHa,gBAAgB,UAAU,EAAE,EAG1B,KAAK,WAAgB;IAClC,OAAO,QAAQ,MAAM,gBAAgB;IACrC,SAAS,MAAM,WAAW;IAC3B,EAAE;GACJ;AAGH,SAAO;GACL,SAAS;GACT,QAAQ,EAAE;GACX;UACM,OAAO;AACd,SAAO;GACL,SAAS;GACT,QAAQ,CACN;IACE,OAAO;IACP,SAAS,6BAA6B,iBAAiB,QAAQ,MAAM,UAAU;IAChF,CACF;GACF"}
1
+ {"version":3,"file":"props-validation.js","names":["FIELD_MODIFIERS: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny>","drizzleCreateSelectSchema","modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny>","drizzleCreateInsertSchema","createSelectSchema","createInsertSchema","fieldMetadata: Record<string, { description: string }>","innerSchema: z.ZodTypeAny | null","createSelectSchema","createInsertSchema"],"sources":["../src/validation/drizzle-schema-helpers.ts","../src/validation/schemas.ts","../src/validation/props-validation.ts"],"sourcesContent":["import { z } from '@hono/zod-openapi';\nimport type { AnySQLiteTable } from 'drizzle-orm/sqlite-core';\nimport {\n createInsertSchema as drizzleCreateInsertSchema,\n createSelectSchema as drizzleCreateSelectSchema,\n} from 'drizzle-zod';\n\nexport const MIN_ID_LENGTH = 1;\nexport const MAX_ID_LENGTH = 255;\nexport const URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\\-_.]+$/;\n\nexport const resourceIdSchema = z\n .string()\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n example: 'resource_789',\n });\n\nresourceIdSchema.meta({\n description: 'Resource identifier',\n});\n\n/**\n * Creates a resource ID schema with custom description.\n * Inherits all validation from resourceIdSchema (min, max, regex pattern).\n * Use this to extend resourceIdSchema with entity-specific documentation.\n *\n * @example\n * // For Agent.defaultSubAgentId\n * createResourceIdSchema('ID of the default sub-agent. Workflow: ...', { example: 'my-subagent' })\n *\n * // For Tool.credentialReferenceId\n * createResourceIdSchema('Reference to credential for authentication', { example: 'cred-123' })\n */\nexport function createResourceIdSchema(\n description: string,\n options?: { example?: string }\n): z.ZodString {\n const example = options?.example ?? 'resource_789';\n const modified = z\n .string()\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe(description)\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description,\n example,\n });\n modified.meta({ description });\n return modified;\n}\n\nconst FIELD_MODIFIERS: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {\n id: (schema) => {\n const modified = (schema as z.ZodString)\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n example: 'resource_789',\n });\n modified.meta({\n description: 'Resource identifier',\n });\n return modified;\n },\n name: (_schema) => {\n const modified = z.string().describe('Name');\n modified.meta({ description: 'Name' });\n return modified;\n },\n description: (_schema) => {\n const modified = z.string().describe('Description');\n modified.meta({ description: 'Description' });\n return modified;\n },\n tenantId: (schema) => {\n const modified = schema.describe('Tenant identifier');\n modified.meta({ description: 'Tenant identifier' });\n return modified;\n },\n projectId: (schema) => {\n const modified = schema.describe('Project identifier');\n modified.meta({ description: 'Project identifier' });\n return modified;\n },\n agentId: (schema) => {\n const modified = schema.describe('Agent identifier');\n modified.meta({ description: 'Agent identifier' });\n return modified;\n },\n subAgentId: (schema) => {\n const modified = schema.describe('Sub-agent identifier');\n modified.meta({ description: 'Sub-agent identifier' });\n return modified;\n },\n createdAt: (schema) => {\n const modified = schema.describe('Creation timestamp');\n modified.meta({ description: 'Creation timestamp' });\n return modified;\n },\n updatedAt: (schema) => {\n const modified = schema.describe('Last update timestamp');\n modified.meta({ description: 'Last update timestamp' });\n return modified;\n },\n};\n\nfunction createSelectSchemaWithModifiers<T extends AnySQLiteTable>(\n table: T,\n overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>\n) {\n const tableColumns = table._?.columns;\n if (!tableColumns) {\n return drizzleCreateSelectSchema(table, overrides as any);\n }\n\n const tableFieldNames = Object.keys(tableColumns) as Array<keyof typeof tableColumns>;\n\n const modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {};\n\n for (const fieldName of tableFieldNames) {\n const fieldNameStr = String(fieldName);\n if (fieldNameStr in FIELD_MODIFIERS) {\n modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];\n }\n }\n\n const mergedModifiers = { ...modifiers, ...overrides } as any;\n\n return drizzleCreateSelectSchema(table, mergedModifiers);\n}\n\nfunction createInsertSchemaWithModifiers<T extends AnySQLiteTable>(\n table: T,\n overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>\n) {\n const tableColumns = table._?.columns;\n if (!tableColumns) {\n return drizzleCreateInsertSchema(table, overrides as any);\n }\n\n const tableFieldNames = Object.keys(tableColumns) as Array<keyof typeof tableColumns>;\n\n const modifiers: Record<string, (schema: z.ZodTypeAny) => z.ZodTypeAny> = {};\n\n for (const fieldName of tableFieldNames) {\n const fieldNameStr = String(fieldName);\n if (fieldNameStr in FIELD_MODIFIERS) {\n modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];\n }\n }\n\n const mergedModifiers = { ...modifiers, ...overrides } as any;\n\n return drizzleCreateInsertSchema(table, mergedModifiers);\n}\n\nexport const createSelectSchema = createSelectSchemaWithModifiers;\nexport const createInsertSchema = createInsertSchemaWithModifiers;\n\n/**\n * Helper function to register a schema in the global registry using .meta() and return it.\n * This ensures metadata persists through transformations.\n */\nfunction registerSchema<T extends z.ZodTypeAny>(\n schema: T,\n metadata: {\n description?: string;\n id?: string;\n title?: string;\n deprecated?: boolean;\n [key: string]: unknown;\n }\n): T {\n (schema as any).meta(metadata);\n return schema;\n}\n\n/**\n * Registers all field schemas in an object schema that match known field names.\n * This ensures metadata persists through transformations like .partial() and .omit().\n * For the 'id' field, also applies full validation constraints via .openapi().\n *\n * This function registers each field schema instance in the global registry using .meta(),\n * and ensures OpenAPI metadata is set via .openapi() for proper documentation generation.\n *\n * Note: This modifies the schemas in place by registering them in the global registry.\n * The schema shape itself is not modified, but the field schemas are registered.\n */\nexport function registerFieldSchemas<T extends z.ZodObject<any>>(schema: T): T {\n if (!(schema instanceof z.ZodObject)) {\n return schema;\n }\n\n const shape = schema.shape;\n const fieldMetadata: Record<string, { description: string }> = {\n id: { description: 'Resource identifier' },\n name: { description: 'Name' },\n description: { description: 'Description' },\n tenantId: { description: 'Tenant identifier' },\n projectId: { description: 'Project identifier' },\n agentId: { description: 'Agent identifier' },\n subAgentId: { description: 'Sub-agent identifier' },\n createdAt: { description: 'Creation timestamp' },\n updatedAt: { description: 'Last update timestamp' },\n };\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n if (fieldName in fieldMetadata && fieldSchema) {\n let zodFieldSchema = fieldSchema as z.ZodTypeAny;\n let innerSchema: z.ZodTypeAny | null = null;\n\n // Unwrap ZodOptional to get the inner schema\n if (zodFieldSchema instanceof z.ZodOptional) {\n innerSchema = zodFieldSchema._def.innerType as z.ZodTypeAny;\n zodFieldSchema = innerSchema;\n }\n\n // Register in global registry using .meta()\n zodFieldSchema.meta(fieldMetadata[fieldName]);\n\n // Special handling for 'id' field - ensure it has full validation via .openapi()\n if (fieldName === 'id' && zodFieldSchema instanceof z.ZodString) {\n // Always ensure OpenAPI metadata is set for id field\n zodFieldSchema.openapi({\n description: 'Resource identifier',\n minLength: MIN_ID_LENGTH,\n maxLength: MAX_ID_LENGTH,\n pattern: URL_SAFE_ID_PATTERN.source,\n example: 'resource_789',\n });\n } else if (zodFieldSchema instanceof z.ZodString) {\n // For other string fields, ensure description is set via .openapi()\n zodFieldSchema.openapi({\n description: fieldMetadata[fieldName].description,\n });\n }\n\n // Also register the optional wrapper if it exists\n if (innerSchema && fieldSchema instanceof z.ZodOptional) {\n (fieldSchema as any).meta(fieldMetadata[fieldName]);\n }\n }\n }\n\n return schema;\n}\n\n/**\n * Wrapper for .partial() that registers the resulting schema and its fields in the global registry.\n * This function ensures that field schemas are properly registered and configured with OpenAPI metadata.\n */\nexport function partialWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const partialSchema = schema.partial() as T;\n\n // Register field schemas - this registers them in the global registry\n registerFieldSchemas(partialSchema);\n\n // Reconstruct schema shape with properly configured field schemas\n const shape = partialSchema.shape;\n const newShape: Record<string, z.ZodTypeAny> = {};\n\n const fieldMetadata: Record<string, { description: string }> = {\n id: { description: 'Resource identifier' },\n name: { description: 'Name' },\n description: { description: 'Description' },\n tenantId: { description: 'Tenant identifier' },\n projectId: { description: 'Project identifier' },\n agentId: { description: 'Agent identifier' },\n subAgentId: { description: 'Sub-agent identifier' },\n createdAt: { description: 'Creation timestamp' },\n updatedAt: { description: 'Last update timestamp' },\n };\n\n for (const [fieldName, fieldSchema] of Object.entries(shape)) {\n let configuredSchema = fieldSchema as z.ZodTypeAny;\n\n if (fieldName in fieldMetadata) {\n let innerSchema: z.ZodTypeAny;\n const isOptional = configuredSchema instanceof z.ZodOptional;\n\n if (isOptional) {\n innerSchema = (configuredSchema as z.ZodOptional<any>)._def.innerType as z.ZodTypeAny;\n } else {\n innerSchema = configuredSchema;\n }\n\n // Handle id field specially - ensure it has full validation\n if (fieldName === 'id' && innerSchema instanceof z.ZodString) {\n const configuredId = innerSchema\n .min(MIN_ID_LENGTH)\n .max(MAX_ID_LENGTH)\n .describe('Resource identifier')\n .regex(URL_SAFE_ID_PATTERN, {\n message: 'ID must contain only letters, numbers, hyphens, underscores, and dots',\n })\n .openapi({\n description: 'Resource identifier',\n minLength: MIN_ID_LENGTH,\n maxLength: MAX_ID_LENGTH,\n pattern: URL_SAFE_ID_PATTERN.source,\n example: 'resource_789',\n });\n\n configuredId.meta({ description: 'Resource identifier' });\n configuredSchema = isOptional ? configuredId.optional() : configuredId;\n } else if (innerSchema instanceof z.ZodString) {\n // For other string fields, ensure description is set\n const configuredField = innerSchema.describe(fieldMetadata[fieldName].description).openapi({\n description: fieldMetadata[fieldName].description,\n });\n\n configuredField.meta(fieldMetadata[fieldName]);\n configuredSchema = isOptional ? configuredField.optional() : configuredField;\n }\n }\n\n newShape[fieldName] = configuredSchema;\n }\n\n // Reconstruct schema with properly configured fields\n const reconstructedSchema = partialSchema.extend(newShape).partial() as T;\n registerFieldSchemas(reconstructedSchema);\n\n if (metadata) {\n registerSchema(reconstructedSchema, metadata);\n }\n\n return reconstructedSchema;\n}\n\n/**\n * Wrapper for .omit() that registers the resulting schema and its fields in the global registry\n */\nexport function omitWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n keys: z.ZodObject<any>['shape'],\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const omittedSchema = schema.omit(keys) as T;\n registerFieldSchemas(omittedSchema);\n if (metadata) {\n registerSchema(omittedSchema, metadata);\n }\n return omittedSchema;\n}\n\n/**\n * Wrapper for .extend() that registers the resulting schema and its fields in the global registry\n */\nexport function extendWithRegistry<T extends z.ZodObject<any>>(\n schema: T,\n shape: z.ZodRawShape,\n metadata?: { description?: string; [key: string]: unknown }\n): T {\n const extendedSchema = schema.extend(shape) as T;\n registerFieldSchemas(extendedSchema);\n if (metadata) {\n registerSchema(extendedSchema, metadata);\n }\n return extendedSchema;\n}\n","import { z } from '@hono/zod-openapi';\nimport { schemaValidationDefaults } from '../constants/schema-validation/defaults';\n\n// Destructure defaults for use in schemas\nconst {\n AGENT_EXECUTION_TRANSFER_COUNT_MAX,\n AGENT_EXECUTION_TRANSFER_COUNT_MIN,\n CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT,\n STATUS_UPDATE_MAX_INTERVAL_SECONDS,\n STATUS_UPDATE_MAX_NUM_EVENTS,\n SUB_AGENT_TURN_GENERATION_STEPS_MAX,\n SUB_AGENT_TURN_GENERATION_STEPS_MIN,\n VALIDATION_AGENT_PROMPT_MAX_CHARS,\n VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,\n} = schemaValidationDefaults;\n\nimport {\n agents,\n apiKeys,\n artifactComponents,\n contextCache,\n contextConfigs,\n conversations,\n credentialReferences,\n dataComponents,\n externalAgents,\n functions,\n functionTools,\n ledgerArtifacts,\n messages,\n projects,\n subAgentArtifactComponents,\n subAgentDataComponents,\n subAgentExternalAgentRelations,\n subAgentRelations,\n subAgents,\n subAgentTeamAgentRelations,\n subAgentToolRelations,\n taskRelations,\n tasks,\n tools,\n} from '../db/schema';\nimport {\n CredentialStoreType,\n MCPServerType,\n MCPTransportType,\n TOOL_STATUS_VALUES,\n VALID_RELATION_TYPES,\n} from '../types/utility';\nimport {\n createInsertSchema,\n createResourceIdSchema,\n createSelectSchema,\n MAX_ID_LENGTH,\n MIN_ID_LENGTH,\n registerFieldSchemas,\n resourceIdSchema,\n URL_SAFE_ID_PATTERN,\n} from './drizzle-schema-helpers';\n\nexport { MAX_ID_LENGTH, MIN_ID_LENGTH, resourceIdSchema, URL_SAFE_ID_PATTERN };\n\nexport const StopWhenSchema = z\n .object({\n transferCountIs: z\n .number()\n .min(AGENT_EXECUTION_TRANSFER_COUNT_MIN)\n .max(AGENT_EXECUTION_TRANSFER_COUNT_MAX)\n .optional()\n .describe('The maximum number of transfers to trigger the stop condition.'),\n stepCountIs: z\n .number()\n .min(SUB_AGENT_TURN_GENERATION_STEPS_MIN)\n .max(SUB_AGENT_TURN_GENERATION_STEPS_MAX)\n .optional()\n .describe('The maximum number of steps to trigger the stop condition.'),\n })\n .openapi('StopWhen');\n\nexport const AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(\n 'AgentStopWhen'\n);\n\nexport const SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(\n 'SubAgentStopWhen'\n);\n\nexport type StopWhen = z.infer<typeof StopWhenSchema>;\nexport type AgentStopWhen = z.infer<typeof AgentStopWhenSchema>;\nexport type SubAgentStopWhen = z.infer<typeof SubAgentStopWhenSchema>;\n\nconst pageNumber = z.coerce.number().min(1).default(1).openapi('PaginationPageQueryParam');\nconst limitNumber = z.coerce\n .number()\n .min(1)\n .max(100)\n .default(10)\n .openapi('PaginationLimitQueryParam');\n\nexport const ModelSettingsSchema = z\n .object({\n model: z.string().optional().describe('The model to use for the project.'),\n providerOptions: z\n .record(z.string(), z.any())\n .optional()\n .describe('The provider options to use for the project.'),\n })\n .openapi('ModelSettings');\n\nexport type ModelSettings = z.infer<typeof ModelSettingsSchema>;\n\nexport const ModelSchema = z\n .object({\n base: ModelSettingsSchema.optional(),\n structuredOutput: ModelSettingsSchema.optional(),\n summarizer: ModelSettingsSchema.optional(),\n })\n .openapi('Model');\n\nexport const ProjectModelSchema = z\n .object({\n base: ModelSettingsSchema,\n structuredOutput: ModelSettingsSchema.optional(),\n summarizer: ModelSettingsSchema.optional(),\n })\n .openapi('ProjectModel');\n\nexport const FunctionToolConfigSchema = z.object({\n name: z.string(),\n description: z.string(),\n inputSchema: z.record(z.string(), z.unknown()),\n dependencies: z.record(z.string(), z.string()).optional(),\n execute: z.union([z.function(), z.string()]),\n});\n\nexport type FunctionToolConfig = Omit<z.infer<typeof FunctionToolConfigSchema>, 'execute'> & {\n execute: ((params: any) => Promise<any>) | string;\n};\n\nconst createApiSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true });\n\nconst createApiInsertSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true });\n\nconst createApiUpdateSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true }).partial();\n\nconst createAgentScopedApiSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true });\n\nconst createAgentScopedApiInsertSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true });\n\nconst createAgentScopedApiUpdateSchema = <T extends z.ZodRawShape>(schema: z.ZodObject<T>) =>\n schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();\n\nexport const SubAgentSelectSchema = createSelectSchema(subAgents);\n\nexport const SubAgentInsertSchema = createInsertSchema(subAgents).extend({\n id: resourceIdSchema,\n models: ModelSchema.optional(),\n});\n\nexport const SubAgentUpdateSchema = SubAgentInsertSchema.partial();\n\nexport const SubAgentApiSelectSchema =\n createAgentScopedApiSchema(SubAgentSelectSchema).openapi('SubAgent');\nexport const SubAgentApiInsertSchema =\n createAgentScopedApiInsertSchema(SubAgentInsertSchema).openapi('SubAgentCreate');\nexport const SubAgentApiUpdateSchema =\n createAgentScopedApiUpdateSchema(SubAgentUpdateSchema).openapi('SubAgentUpdate');\n\nexport const SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);\nexport const SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n sourceSubAgentId: resourceIdSchema,\n targetSubAgentId: resourceIdSchema.optional(),\n externalSubAgentId: resourceIdSchema.optional(),\n teamSubAgentId: resourceIdSchema.optional(),\n});\nexport const SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();\n\nexport const SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentRelationSelectSchema\n).openapi('SubAgentRelation');\nexport const SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentRelationInsertSchema\n)\n .extend({\n relationType: z.enum(VALID_RELATION_TYPES),\n })\n .refine(\n (data) => {\n const hasTarget = data.targetSubAgentId != null;\n const hasExternal = data.externalSubAgentId != null;\n const hasTeam = data.teamSubAgentId != null;\n const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;\n return count === 1; // Exactly one must be true\n },\n {\n message:\n 'Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId',\n path: ['targetSubAgentId', 'externalSubAgentId', 'teamSubAgentId'],\n }\n )\n .openapi('SubAgentRelationCreate');\n\nexport const SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentRelationUpdateSchema\n)\n .extend({\n relationType: z.enum(VALID_RELATION_TYPES).optional(),\n })\n .refine(\n (data) => {\n const hasTarget = data.targetSubAgentId != null;\n const hasExternal = data.externalSubAgentId != null;\n const hasTeam = data.teamSubAgentId != null;\n const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;\n\n if (count === 0) {\n return true; // No relationship specified - valid for updates\n }\n\n return count === 1; // Exactly one must be true\n },\n {\n message:\n 'Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId when updating sub-agent relationships',\n path: ['targetSubAgentId', 'externalSubAgentId', 'teamSubAgentId'],\n }\n )\n .openapi('SubAgentRelationUpdate');\n\nexport const SubAgentRelationQuerySchema = z.object({\n sourceSubAgentId: z.string().optional(),\n targetSubAgentId: z.string().optional(),\n externalSubAgentId: z.string().optional(),\n teamSubAgentId: z.string().optional(),\n});\n\nexport const ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n sourceSubAgentId: resourceIdSchema,\n externalSubAgentId: resourceIdSchema,\n});\n\nexport const ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(\n ExternalSubAgentRelationInsertSchema\n);\n\nexport const AgentSelectSchema = createSelectSchema(agents);\n\nconst DEFAULT_SUB_AGENT_ID_DESCRIPTION =\n 'ID of the default sub-agent that handles initial user messages. ' +\n 'Required at runtime but nullable on creation to avoid circular FK dependency. ' +\n 'Workflow: 1) POST Agent (without defaultSubAgentId), 2) POST SubAgent, 3) PATCH Agent with defaultSubAgentId.';\n\nexport const AgentInsertSchema = createInsertSchema(agents, {\n id: () => resourceIdSchema,\n name: () =>\n z.string().trim().nonempty().describe('Agent name').openapi({ description: 'Agent name' }),\n defaultSubAgentId: () =>\n createResourceIdSchema(DEFAULT_SUB_AGENT_ID_DESCRIPTION, { example: 'my-default-subagent' })\n .nullable()\n .optional(),\n});\nexport const AgentUpdateSchema = AgentInsertSchema.partial();\n\nexport const AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi('Agent');\nexport const AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema)\n .extend({\n id: resourceIdSchema,\n })\n .openapi('AgentCreate');\nexport const AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi('AgentUpdate');\n\nexport const TaskSelectSchema = createSelectSchema(tasks);\nexport const TaskInsertSchema = createInsertSchema(tasks).extend({\n id: resourceIdSchema,\n conversationId: resourceIdSchema.optional(),\n});\nexport const TaskUpdateSchema = TaskInsertSchema.partial();\n\nexport const TaskApiSelectSchema = createApiSchema(TaskSelectSchema);\nexport const TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);\nexport const TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);\n\nexport const TaskRelationSelectSchema = createSelectSchema(taskRelations);\nexport const TaskRelationInsertSchema = createInsertSchema(taskRelations).extend({\n id: resourceIdSchema,\n parentTaskId: resourceIdSchema,\n childTaskId: resourceIdSchema,\n});\nexport const TaskRelationUpdateSchema = TaskRelationInsertSchema.partial();\n\nexport const TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);\nexport const TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);\nexport const TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);\n\nconst imageUrlSchema = z\n .string()\n .optional()\n .refine(\n (url) => {\n if (!url) return true; // Optional field\n if (url.startsWith('data:image/')) {\n const base64Part = url.split(',')[1];\n if (!base64Part) return false;\n return base64Part.length < 1400000; // ~1MB limit\n }\n try {\n const parsed = new URL(url);\n return parsed.protocol === 'http:' || parsed.protocol === 'https:';\n } catch {\n return false;\n }\n },\n {\n message: 'Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)',\n }\n );\n\nexport const McpTransportConfigSchema = z\n .object({\n type: z.enum(MCPTransportType),\n requestInit: z.record(z.string(), z.unknown()).optional(),\n eventSourceInit: z.record(z.string(), z.unknown()).optional(),\n reconnectionOptions: z.any().optional().openapi({\n type: 'object',\n description: 'Reconnection options for streamable HTTP transport',\n }),\n sessionId: z.string().optional(),\n })\n .openapi('McpTransportConfig');\n\nexport const ToolStatusSchema = z.enum(TOOL_STATUS_VALUES);\n\nexport const McpToolDefinitionSchema = z.object({\n name: z.string(),\n description: z.string().optional(),\n inputSchema: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const ToolSelectSchema = createSelectSchema(tools);\n\nexport const ToolInsertSchema = createInsertSchema(tools).extend({\n id: resourceIdSchema,\n imageUrl: imageUrlSchema,\n config: z.object({\n type: z.literal('mcp'),\n mcp: z.object({\n server: z.object({\n url: z.url(),\n }),\n transport: z\n .object({\n type: z.enum(MCPTransportType),\n requestInit: z.record(z.string(), z.unknown()).optional(),\n eventSourceInit: z.record(z.string(), z.unknown()).optional(),\n reconnectionOptions: z.any().optional().openapi({\n type: 'object',\n description: 'Reconnection options for streamable HTTP transport',\n }),\n sessionId: z.string().optional(),\n })\n .optional(),\n activeTools: z.array(z.string()).optional(),\n }),\n }),\n});\n\nexport const ConversationSelectSchema = createSelectSchema(conversations);\nexport const ConversationInsertSchema = createInsertSchema(conversations).extend({\n id: resourceIdSchema,\n contextConfigId: resourceIdSchema.optional(),\n});\nexport const ConversationUpdateSchema = ConversationInsertSchema.partial();\n\nexport const ConversationApiSelectSchema =\n createApiSchema(ConversationSelectSchema).openapi('Conversation');\nexport const ConversationApiInsertSchema =\n createApiInsertSchema(ConversationInsertSchema).openapi('ConversationCreate');\nexport const ConversationApiUpdateSchema =\n createApiUpdateSchema(ConversationUpdateSchema).openapi('ConversationUpdate');\n\nexport const MessageSelectSchema = createSelectSchema(messages);\nexport const MessageInsertSchema = createInsertSchema(messages).extend({\n id: resourceIdSchema,\n conversationId: resourceIdSchema,\n taskId: resourceIdSchema.optional(),\n});\nexport const MessageUpdateSchema = MessageInsertSchema.partial();\n\nexport const MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi('Message');\nexport const MessageApiInsertSchema =\n createApiInsertSchema(MessageInsertSchema).openapi('MessageCreate');\nexport const MessageApiUpdateSchema =\n createApiUpdateSchema(MessageUpdateSchema).openapi('MessageUpdate');\n\nexport const ContextCacheSelectSchema = createSelectSchema(contextCache);\nexport const ContextCacheInsertSchema = createInsertSchema(contextCache);\nexport const ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();\n\nexport const ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);\nexport const ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);\nexport const ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);\n\nexport const DataComponentSelectSchema = createSelectSchema(dataComponents);\nexport const DataComponentInsertSchema = createInsertSchema(dataComponents).extend({\n id: resourceIdSchema,\n});\nexport const DataComponentBaseSchema = DataComponentInsertSchema.omit({\n createdAt: true,\n updatedAt: true,\n});\n\nexport const DataComponentUpdateSchema = DataComponentInsertSchema.partial();\n\nexport const DataComponentApiSelectSchema =\n createApiSchema(DataComponentSelectSchema).openapi('DataComponent');\nexport const DataComponentApiInsertSchema =\n createApiInsertSchema(DataComponentInsertSchema).openapi('DataComponentCreate');\nexport const DataComponentApiUpdateSchema =\n createApiUpdateSchema(DataComponentUpdateSchema).openapi('DataComponentUpdate');\n\nexport const SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);\nexport const SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);\nexport const SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();\n\nexport const SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(\n SubAgentDataComponentSelectSchema\n);\nexport const SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true,\n createdAt: true,\n});\nexport const SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentDataComponentUpdateSchema\n);\n\nexport const ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);\nexport const ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({\n id: resourceIdSchema,\n});\nexport const ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();\n\nexport const ArtifactComponentApiSelectSchema = createApiSchema(\n ArtifactComponentSelectSchema\n).openapi('ArtifactComponent');\nexport const ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n createdAt: true,\n updatedAt: true,\n}).openapi('ArtifactComponentCreate');\nexport const ArtifactComponentApiUpdateSchema = createApiUpdateSchema(\n ArtifactComponentUpdateSchema\n).openapi('ArtifactComponentUpdate');\n\nexport const SubAgentArtifactComponentSelectSchema = createSelectSchema(subAgentArtifactComponents);\nexport const SubAgentArtifactComponentInsertSchema = createInsertSchema(\n subAgentArtifactComponents\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n artifactComponentId: resourceIdSchema,\n});\nexport const SubAgentArtifactComponentUpdateSchema =\n SubAgentArtifactComponentInsertSchema.partial();\n\nexport const SubAgentArtifactComponentApiSelectSchema = createAgentScopedApiSchema(\n SubAgentArtifactComponentSelectSchema\n);\nexport const SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true,\n createdAt: true,\n});\nexport const SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentArtifactComponentUpdateSchema\n);\n\nexport const ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({\n credentialReferenceId: z.string().nullable().optional(),\n});\nexport const ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({\n id: resourceIdSchema,\n});\nexport const ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();\n\nexport const ExternalAgentApiSelectSchema =\n createApiSchema(ExternalAgentSelectSchema).openapi('ExternalAgent');\nexport const ExternalAgentApiInsertSchema =\n createApiInsertSchema(ExternalAgentInsertSchema).openapi('ExternalAgentCreate');\nexport const ExternalAgentApiUpdateSchema =\n createApiUpdateSchema(ExternalAgentUpdateSchema).openapi('ExternalAgentUpdate');\n\nexport const AllAgentSchema = z.discriminatedUnion('type', [\n SubAgentApiSelectSchema.extend({ type: z.literal('internal') }),\n ExternalAgentApiSelectSchema.extend({ type: z.literal('external') }),\n]);\n\nexport const ApiKeySelectSchema = createSelectSchema(apiKeys);\n\nexport const ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({\n id: resourceIdSchema,\n agentId: resourceIdSchema,\n});\n\nexport const ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({\n tenantId: true,\n projectId: true,\n id: true,\n publicId: true,\n keyHash: true,\n keyPrefix: true,\n createdAt: true,\n});\n\nexport const ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({\n tenantId: true,\n projectId: true,\n keyHash: true, // Never expose the hash\n}).openapi('ApiKey');\n\nexport const ApiKeyApiCreationResponseSchema = z.object({\n data: z.object({\n apiKey: ApiKeyApiSelectSchema,\n key: z.string().describe('The full API key (shown only once)'),\n }),\n});\n\nexport const ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({\n tenantId: true,\n projectId: true,\n id: true, // Auto-generated\n publicId: true, // Auto-generated\n keyHash: true, // Auto-generated\n keyPrefix: true, // Auto-generated\n lastUsedAt: true, // Not set on creation\n}).openapi('ApiKeyCreate');\n\nexport const ApiKeyApiUpdateSchema = ApiKeyUpdateSchema.openapi('ApiKeyUpdate');\n\nexport const CredentialReferenceSelectSchema = createSelectSchema(credentialReferences);\n\nexport const CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({\n id: resourceIdSchema,\n type: z.string(),\n credentialStoreId: resourceIdSchema,\n retrievalParams: z.record(z.string(), z.unknown()).nullish(),\n});\n\nexport const CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();\n\nexport const CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema)\n .extend({\n type: z.enum(CredentialStoreType),\n tools: z.array(ToolSelectSchema).optional(),\n externalAgents: z.array(ExternalAgentSelectSchema).optional(),\n })\n .openapi('CredentialReference');\nexport const CredentialReferenceApiInsertSchema = createApiInsertSchema(\n CredentialReferenceInsertSchema\n)\n .extend({\n type: z.enum(CredentialStoreType),\n })\n .openapi('CredentialReferenceCreate');\nexport const CredentialReferenceApiUpdateSchema = createApiUpdateSchema(\n CredentialReferenceUpdateSchema\n)\n .extend({\n type: z.enum(CredentialStoreType).optional(),\n })\n .openapi('CredentialReferenceUpdate');\n\nexport const CredentialStoreSchema = z\n .object({\n id: z.string().describe('Unique identifier of the credential store'),\n type: z.enum(CredentialStoreType),\n available: z.boolean().describe('Whether the store is functional and ready to use'),\n reason: z.string().nullable().describe('Reason why store is not available, if applicable'),\n })\n .openapi('CredentialStore');\n\nexport const CredentialStoreListResponseSchema = z\n .object({\n data: z.array(CredentialStoreSchema).describe('List of credential stores'),\n })\n .openapi('CredentialStoreListResponse');\n\nexport const CreateCredentialInStoreRequestSchema = z\n .object({\n key: z.string().describe('The credential key'),\n value: z.string().describe('The credential value'),\n metadata: z\n .record(z.string(), z.string())\n .nullish()\n .describe('The metadata for the credential'),\n })\n .openapi('CreateCredentialInStoreRequest');\n\nexport const CreateCredentialInStoreResponseSchema = z\n .object({\n data: z.object({\n key: z.string().describe('The credential key'),\n storeId: z.string().describe('The store ID where credential was created'),\n createdAt: z.string().describe('ISO timestamp of creation'),\n }),\n })\n .openapi('CreateCredentialInStoreResponse');\n\nexport const RelatedAgentInfoSchema = z\n .object({\n id: z.string(),\n name: z.string(),\n description: z.string().nullable(),\n })\n .openapi('RelatedAgentInfo');\n\nexport const ComponentAssociationSchema = z\n .object({\n subAgentId: z.string(),\n createdAt: z.string(),\n })\n .openapi('ComponentAssociation');\n\nexport const OAuthLoginQuerySchema = z\n .object({\n tenantId: z.string().min(1, 'Tenant ID is required'),\n projectId: z.string().min(1, 'Project ID is required'),\n toolId: z.string().min(1, 'Tool ID is required'),\n })\n .openapi('OAuthLoginQuery');\n\nexport const OAuthCallbackQuerySchema = z\n .object({\n code: z.string().min(1, 'Authorization code is required'),\n state: z.string().min(1, 'State parameter is required'),\n error: z.string().optional(),\n error_description: z.string().optional(),\n })\n .openapi('OAuthCallbackQuery');\n\nexport const McpToolSchema = ToolInsertSchema.extend({\n imageUrl: imageUrlSchema,\n availableTools: z.array(McpToolDefinitionSchema).optional(),\n status: ToolStatusSchema.default('unknown'),\n version: z.string().optional(),\n expiresAt: z.string().optional(),\n createdBy: z.string().optional(),\n relationshipId: z.string().optional(),\n}).openapi('McpTool');\n\nexport const MCPToolConfigSchema = McpToolSchema.omit({\n config: true,\n tenantId: true,\n projectId: true,\n status: true,\n version: true,\n createdAt: true,\n updatedAt: true,\n credentialReferenceId: true,\n}).extend({\n tenantId: z.string().optional(),\n projectId: z.string().optional(),\n description: z.string().optional(),\n serverUrl: z.url(),\n activeTools: z.array(z.string()).optional(),\n mcpType: z.enum(MCPServerType).optional(),\n transport: McpTransportConfigSchema.optional(),\n credential: CredentialReferenceApiInsertSchema.optional(),\n});\n\nexport const ToolUpdateSchema = ToolInsertSchema.partial();\n\nexport const ToolApiSelectSchema = createApiSchema(ToolSelectSchema).openapi('Tool');\nexport const ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema).openapi('ToolCreate');\nexport const ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema).openapi('ToolUpdate');\n\nexport const FunctionToolSelectSchema = createSelectSchema(functionTools);\n\nexport const FunctionToolInsertSchema = createInsertSchema(functionTools).extend({\n id: resourceIdSchema,\n});\n\nexport const FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();\n\nexport const FunctionToolApiSelectSchema =\n createApiSchema(FunctionToolSelectSchema).openapi('FunctionTool');\nexport const FunctionToolApiInsertSchema =\n createAgentScopedApiInsertSchema(FunctionToolInsertSchema).openapi('FunctionToolCreate');\nexport const FunctionToolApiUpdateSchema =\n createApiUpdateSchema(FunctionToolUpdateSchema).openapi('FunctionToolUpdate');\n\nexport const FunctionSelectSchema = createSelectSchema(functions);\nexport const FunctionInsertSchema = createInsertSchema(functions).extend({\n id: resourceIdSchema,\n});\nexport const FunctionUpdateSchema = FunctionInsertSchema.partial();\n\nexport const FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi('Function');\nexport const FunctionApiInsertSchema =\n createApiInsertSchema(FunctionInsertSchema).openapi('FunctionCreate');\nexport const FunctionApiUpdateSchema =\n createApiUpdateSchema(FunctionUpdateSchema).openapi('FunctionUpdate');\n\n// Zod schemas for validation\nexport const FetchConfigSchema = z\n .object({\n url: z.string().min(1, 'URL is required'),\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).optional().default('GET'),\n headers: z.record(z.string(), z.string()).optional(),\n body: z.record(z.string(), z.unknown()).optional(),\n transform: z.string().optional(), // JSONPath or JS transform function\n requiredToFetch: z.array(z.string()).optional(), // Context variables that are required to run the fetch request. If the given variables cannot be resolved, the fetch request will be skipped.\n timeout: z\n .number()\n .min(0)\n .optional()\n .default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT)\n .optional(),\n })\n .openapi('FetchConfig');\n\nexport const FetchDefinitionSchema = z\n .object({\n id: z.string().min(1, 'Fetch definition ID is required'),\n name: z.string().optional(),\n trigger: z.enum(['initialization', 'invocation']),\n fetchConfig: FetchConfigSchema,\n responseSchema: z.any().optional(), // JSON Schema for validating HTTP response\n defaultValue: z.any().optional().openapi({\n description: 'Default value if fetch fails',\n }),\n credential: CredentialReferenceApiInsertSchema.optional(),\n })\n .openapi('FetchDefinition');\n\nexport const ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({\n headersSchema: z.any().optional().openapi({\n type: 'object',\n description: 'JSON Schema for validating request headers',\n }),\n});\nexport const ContextConfigInsertSchema = createInsertSchema(contextConfigs)\n .extend({\n id: resourceIdSchema.optional(),\n headersSchema: z.any().nullable().optional().openapi({\n type: 'object',\n description: 'JSON Schema for validating request headers',\n }),\n contextVariables: z.any().nullable().optional().openapi({\n type: 'object',\n description: 'Context variables configuration with fetch definitions',\n }),\n })\n .omit({\n createdAt: true,\n updatedAt: true,\n });\nexport const ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();\n\nexport const ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfig');\nexport const ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfigCreate');\nexport const ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema)\n .omit({\n agentId: true,\n })\n .openapi('ContextConfigUpdate');\n\nexport const SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);\nexport const SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n toolId: resourceIdSchema,\n selectedTools: z.array(z.string()).nullish(),\n headers: z.record(z.string(), z.string()).nullish(),\n toolPolicies: z.record(z.string(), z.object({ needsApproval: z.boolean().optional() })).nullish(),\n});\n\nexport const SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();\n\nexport const SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentToolRelationSelectSchema\n).openapi('SubAgentToolRelation');\nexport const SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentToolRelationInsertSchema\n).openapi('SubAgentToolRelationCreate');\nexport const SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentToolRelationUpdateSchema\n).openapi('SubAgentToolRelationUpdate');\n\n// Sub-Agent External Agent Relation Schemas\nexport const SubAgentExternalAgentRelationSelectSchema = createSelectSchema(\n subAgentExternalAgentRelations\n);\nexport const SubAgentExternalAgentRelationInsertSchema = createInsertSchema(\n subAgentExternalAgentRelations\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n externalAgentId: resourceIdSchema,\n headers: z.record(z.string(), z.string()).nullish(),\n});\n\nexport const SubAgentExternalAgentRelationUpdateSchema =\n SubAgentExternalAgentRelationInsertSchema.partial();\n\nexport const SubAgentExternalAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentExternalAgentRelationSelectSchema\n).openapi('SubAgentExternalAgentRelation');\nexport const SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentExternalAgentRelationInsertSchema\n)\n .omit({ id: true, subAgentId: true })\n .openapi('SubAgentExternalAgentRelationCreate');\nexport const SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentExternalAgentRelationUpdateSchema\n).openapi('SubAgentExternalAgentRelationUpdate');\n\n// Sub-Agent Team Agent Relation Schemas\nexport const SubAgentTeamAgentRelationSelectSchema = createSelectSchema(subAgentTeamAgentRelations);\nexport const SubAgentTeamAgentRelationInsertSchema = createInsertSchema(\n subAgentTeamAgentRelations\n).extend({\n id: resourceIdSchema,\n subAgentId: resourceIdSchema,\n targetAgentId: resourceIdSchema,\n headers: z.record(z.string(), z.string()).nullish(),\n});\n\nexport const SubAgentTeamAgentRelationUpdateSchema =\n SubAgentTeamAgentRelationInsertSchema.partial();\n\nexport const SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(\n SubAgentTeamAgentRelationSelectSchema\n).openapi('SubAgentTeamAgentRelation');\nexport const SubAgentTeamAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(\n SubAgentTeamAgentRelationInsertSchema\n)\n .omit({ id: true, subAgentId: true })\n .openapi('SubAgentTeamAgentRelationCreate');\nexport const SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(\n SubAgentTeamAgentRelationUpdateSchema\n).openapi('SubAgentTeamAgentRelationUpdate');\n\nexport const LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);\nexport const LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);\nexport const LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();\n\nexport const LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);\nexport const LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);\nexport const LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);\n\nexport const StatusComponentSchema = z\n .object({\n type: z.string(),\n description: z.string().optional(),\n detailsSchema: z\n .object({\n type: z.literal('object'),\n properties: z.record(z.string(), z.any()),\n required: z.array(z.string()).optional(),\n })\n .optional(),\n })\n .openapi('StatusComponent');\n\nexport const StatusUpdateSchema = z\n .object({\n enabled: z.boolean().optional(),\n numEvents: z.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS).optional(),\n timeInSeconds: z.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS).optional(),\n prompt: z\n .string()\n .max(\n VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,\n `Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS} characters`\n )\n .optional(),\n statusComponents: z.array(StatusComponentSchema).optional(),\n })\n .openapi('StatusUpdate');\n\nexport const CanUseItemSchema = z\n .object({\n agentToolRelationId: z.string().optional(),\n toolId: z.string(),\n toolSelection: z.array(z.string()).nullish(),\n headers: z.record(z.string(), z.string()).nullish(),\n toolPolicies: z\n .record(z.string(), z.object({ needsApproval: z.boolean().optional() }))\n .nullish(),\n })\n .openapi('CanUseItem');\n\nexport const canDelegateToExternalAgentSchema = z\n .object({\n externalAgentId: z.string(),\n subAgentExternalAgentRelationId: z.string().optional(),\n headers: z.record(z.string(), z.string()).nullish(),\n })\n .openapi('CanDelegateToExternalAgent');\n\nexport const canDelegateToTeamAgentSchema = z\n .object({\n agentId: z.string(),\n subAgentTeamAgentRelationId: z.string().optional(),\n headers: z.record(z.string(), z.string()).nullish(),\n })\n .openapi('CanDelegateToTeamAgent');\n\nexport const TeamAgentSchema = z\n .object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n })\n .openapi('TeamAgent');\n\nexport const FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({\n type: z.literal('internal'),\n canUse: z.array(CanUseItemSchema), // All tools (both MCP and function tools)\n dataComponents: z.array(z.string()).optional(),\n artifactComponents: z.array(z.string()).optional(),\n canTransferTo: z.array(z.string()).optional(),\n prompt: z.string().trim().optional(),\n canDelegateTo: z\n .array(\n z.union([\n z.string(), // Internal subAgent ID\n canDelegateToExternalAgentSchema, // External agent with headers\n canDelegateToTeamAgentSchema, // Team agent with headers\n ])\n )\n .optional(),\n}).openapi('FullAgentAgentInsert');\n\nexport const AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({\n subAgents: z.record(z.string(), FullAgentAgentInsertSchema), // Lookup maps for UI to resolve canUse items\n tools: z.record(z.string(), ToolApiInsertSchema).optional(), // MCP tools (project-scoped)\n externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(), // External agents (project-scoped)\n teamAgents: z.record(z.string(), TeamAgentSchema).optional(), // Team agents contain basic metadata for the agent to be delegated to\n functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(), // Function tools (agent-scoped)\n functions: z.record(z.string(), FunctionApiInsertSchema).optional(), // Get function code for function tools\n contextConfig: z.optional(ContextConfigApiInsertSchema),\n statusUpdates: z.optional(StatusUpdateSchema),\n models: ModelSchema.optional(),\n stopWhen: AgentStopWhenSchema.optional(),\n prompt: z\n .string()\n .max(\n VALIDATION_AGENT_PROMPT_MAX_CHARS,\n `Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS} characters`\n )\n .optional(),\n}).openapi('AgentWithinContextOfProject');\n\nexport const PaginationSchema = z\n .object({\n page: pageNumber,\n limit: limitNumber,\n total: z.number(),\n pages: z.number(),\n })\n .openapi('Pagination');\n\nexport const ListResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>\n z.object({\n data: z.array(itemSchema),\n pagination: PaginationSchema,\n });\n\nexport const SingleResponseSchema = <T extends z.ZodTypeAny>(itemSchema: T) =>\n z.object({\n data: itemSchema,\n });\n\nexport const ErrorResponseSchema = z\n .object({\n error: z.string(),\n message: z.string().optional(),\n details: z.any().optional().openapi({\n description: 'Additional error details',\n }),\n })\n .openapi('ErrorResponse');\n\nexport const ExistsResponseSchema = z\n .object({\n exists: z.boolean(),\n })\n .openapi('ExistsResponse');\n\nexport const RemovedResponseSchema = z\n .object({\n message: z.string(),\n removed: z.boolean(),\n })\n .openapi('RemovedResponse');\n\nexport const ProjectSelectSchema = registerFieldSchemas(\n createSelectSchema(projects).extend({\n models: ProjectModelSchema.nullable(),\n stopWhen: StopWhenSchema.nullable(),\n })\n);\nexport const ProjectInsertSchema = createInsertSchema(projects)\n .extend({\n models: ProjectModelSchema,\n stopWhen: StopWhenSchema.optional(),\n })\n .omit({\n createdAt: true,\n updatedAt: true,\n });\nexport const ProjectUpdateSchema = ProjectInsertSchema.partial().omit({\n id: true,\n tenantId: true,\n});\n\n// Projects API schemas - only omit tenantId since projects table doesn't have projectId\nexport const ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true }).openapi(\n 'Project'\n);\nexport const ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openapi(\n 'ProjectCreate'\n);\nexport const ProjectApiUpdateSchema = ProjectUpdateSchema.openapi('ProjectUpdate');\n\n// Full Project Definition Schema - extends Project with agents and other nested resources\nexport const FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({\n agents: z.record(z.string(), AgentWithinContextOfProjectSchema),\n tools: z.record(z.string(), ToolApiInsertSchema),\n functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),\n functions: z.record(z.string(), FunctionApiInsertSchema).optional(),\n dataComponents: z.record(z.string(), DataComponentApiInsertSchema).optional(),\n artifactComponents: z.record(z.string(), ArtifactComponentApiInsertSchema).optional(),\n externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(),\n statusUpdates: z.optional(StatusUpdateSchema),\n credentialReferences: z.record(z.string(), CredentialReferenceApiInsertSchema).optional(),\n createdAt: z.string().optional(),\n updatedAt: z.string().optional(),\n}).openapi('FullProjectDefinition');\n\n// Single item response wrappers\nexport const ProjectResponse = z\n .object({ data: ProjectApiSelectSchema })\n .openapi('ProjectResponse');\nexport const SubAgentResponse = z\n .object({ data: SubAgentApiSelectSchema })\n .openapi('SubAgentResponse');\nexport const AgentResponse = z.object({ data: AgentApiSelectSchema }).openapi('AgentResponse');\nexport const ToolResponse = z.object({ data: ToolApiSelectSchema }).openapi('ToolResponse');\nexport const ExternalAgentResponse = z\n .object({ data: ExternalAgentApiSelectSchema })\n .openapi('ExternalAgentResponse');\nexport const ContextConfigResponse = z\n .object({ data: ContextConfigApiSelectSchema })\n .openapi('ContextConfigResponse');\nexport const ApiKeyResponse = z.object({ data: ApiKeyApiSelectSchema }).openapi('ApiKeyResponse');\nexport const CredentialReferenceResponse = z\n .object({ data: CredentialReferenceApiSelectSchema })\n .openapi('CredentialReferenceResponse');\nexport const FunctionResponse = z\n .object({ data: FunctionApiSelectSchema })\n .openapi('FunctionResponse');\nexport const FunctionToolResponse = z\n .object({ data: FunctionToolApiSelectSchema })\n .openapi('FunctionToolResponse');\nexport const DataComponentResponse = z\n .object({ data: DataComponentApiSelectSchema })\n .openapi('DataComponentResponse');\nexport const ArtifactComponentResponse = z\n .object({ data: ArtifactComponentApiSelectSchema })\n .openapi('ArtifactComponentResponse');\nexport const SubAgentRelationResponse = z\n .object({ data: SubAgentRelationApiSelectSchema })\n .openapi('SubAgentRelationResponse');\nexport const SubAgentToolRelationResponse = z\n .object({ data: SubAgentToolRelationApiSelectSchema })\n .openapi('SubAgentToolRelationResponse');\nexport const ConversationResponse = z\n .object({ data: ConversationApiSelectSchema })\n .openapi('ConversationResponse');\nexport const MessageResponse = z\n .object({ data: MessageApiSelectSchema })\n .openapi('MessageResponse');\n\nexport const ProjectListResponse = z\n .object({\n data: z.array(ProjectApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ProjectListResponse');\nexport const SubAgentListResponse = z\n .object({\n data: z.array(SubAgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentListResponse');\nexport const AgentListResponse = z\n .object({\n data: z.array(AgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('AgentListResponse');\nexport const ToolListResponse = z\n .object({\n data: z.array(ToolApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ToolListResponse');\nexport const ExternalAgentListResponse = z\n .object({\n data: z.array(ExternalAgentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ExternalAgentListResponse');\nexport const ContextConfigListResponse = z\n .object({\n data: z.array(ContextConfigApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ContextConfigListResponse');\nexport const ApiKeyListResponse = z\n .object({\n data: z.array(ApiKeyApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ApiKeyListResponse');\nexport const CredentialReferenceListResponse = z\n .object({\n data: z.array(CredentialReferenceApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('CredentialReferenceListResponse');\nexport const FunctionListResponse = z\n .object({\n data: z.array(FunctionApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('FunctionListResponse');\nexport const FunctionToolListResponse = z\n .object({\n data: z.array(FunctionToolApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('FunctionToolListResponse');\nexport const DataComponentListResponse = z\n .object({\n data: z.array(DataComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('DataComponentListResponse');\nexport const ArtifactComponentListResponse = z\n .object({\n data: z.array(ArtifactComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ArtifactComponentListResponse');\nexport const SubAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentRelationListResponse');\nexport const SubAgentToolRelationListResponse = z\n .object({\n data: z.array(SubAgentToolRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentToolRelationListResponse');\nexport const ConversationListResponse = z\n .object({\n data: z.array(ConversationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('ConversationListResponse');\nexport const MessageListResponse = z\n .object({\n data: z.array(MessageApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('MessageListResponse');\nexport const SubAgentDataComponentResponse = z\n .object({ data: SubAgentDataComponentApiSelectSchema })\n .openapi('SubAgentDataComponentResponse');\nexport const SubAgentArtifactComponentResponse = z\n .object({ data: SubAgentArtifactComponentApiSelectSchema })\n .openapi('SubAgentArtifactComponentResponse');\nexport const SubAgentDataComponentListResponse = z\n .object({\n data: z.array(SubAgentDataComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentDataComponentListResponse');\nexport const SubAgentArtifactComponentListResponse = z\n .object({\n data: z.array(SubAgentArtifactComponentApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentArtifactComponentListResponse');\n\n// Missing response schemas for factory function replacement\nexport const FullProjectDefinitionResponse = z\n .object({ data: FullProjectDefinitionSchema })\n .openapi('FullProjectDefinitionResponse');\n\nexport const AgentWithinContextOfProjectResponse = z\n .object({ data: AgentWithinContextOfProjectSchema })\n .openapi('AgentWithinContextOfProjectResponse');\n\nexport const RelatedAgentInfoListResponse = z\n .object({\n data: z.array(RelatedAgentInfoSchema),\n pagination: PaginationSchema,\n })\n .openapi('RelatedAgentInfoListResponse');\n\nexport const ComponentAssociationListResponse = z\n .object({ data: z.array(ComponentAssociationSchema) })\n .openapi('ComponentAssociationListResponse');\n\nexport const McpToolResponse = z.object({ data: McpToolSchema }).openapi('McpToolResponse');\n\nexport const McpToolListResponse = z\n .object({\n data: z.array(McpToolSchema),\n pagination: PaginationSchema,\n })\n .openapi('McpToolListResponse');\n\nexport const SubAgentTeamAgentRelationResponse = z\n .object({ data: SubAgentTeamAgentRelationApiSelectSchema })\n .openapi('SubAgentTeamAgentRelationResponse');\n\nexport const SubAgentTeamAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentTeamAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentTeamAgentRelationListResponse');\n\nexport const SubAgentExternalAgentRelationResponse = z\n .object({ data: SubAgentExternalAgentRelationApiSelectSchema })\n .openapi('SubAgentExternalAgentRelationResponse');\n\nexport const SubAgentExternalAgentRelationListResponse = z\n .object({\n data: z.array(SubAgentExternalAgentRelationApiSelectSchema),\n pagination: PaginationSchema,\n })\n .openapi('SubAgentExternalAgentRelationListResponse');\n\n// Array response schemas (no pagination)\nexport const DataComponentArrayResponse = z\n .object({ data: z.array(DataComponentApiSelectSchema) })\n .openapi('DataComponentArrayResponse');\n\nexport const ArtifactComponentArrayResponse = z\n .object({ data: z.array(ArtifactComponentApiSelectSchema) })\n .openapi('ArtifactComponentArrayResponse');\n\nexport const HeadersScopeSchema = z.object({\n 'x-inkeep-tenant-id': z.string().optional().openapi({\n description: 'Tenant identifier',\n example: 'tenant_123',\n }),\n 'x-inkeep-project-id': z.string().optional().openapi({\n description: 'Project identifier',\n example: 'project_456',\n }),\n 'x-inkeep-agent-id': z.string().optional().openapi({\n description: 'Agent identifier',\n example: 'agent_789',\n }),\n});\n\nconst TenantId = z.string().openapi('TenantIdPathParam', {\n param: {\n name: 'tenantId',\n in: 'path',\n },\n description: 'Tenant identifier',\n example: 'tenant_123',\n});\n\nconst ProjectId = z.string().openapi('ProjectIdPathParam', {\n param: {\n name: 'projectId',\n in: 'path',\n },\n description: 'Project identifier',\n example: 'project_456',\n});\n\nconst AgentId = z.string().openapi('AgentIdPathParam', {\n param: {\n name: 'agentId',\n in: 'path',\n },\n description: 'Agent identifier',\n example: 'agent_789',\n});\n\nconst SubAgentId = z.string().openapi('SubAgentIdPathParam', {\n param: {\n name: 'subAgentId',\n in: 'path',\n },\n description: 'Sub-agent identifier',\n example: 'sub_agent_123',\n});\n\nexport const TenantParamsSchema = z.object({\n tenantId: TenantId,\n});\n\nexport const TenantIdParamsSchema = TenantParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectParamsSchema = TenantParamsSchema.extend({\n projectId: ProjectId,\n});\n\nexport const TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({\n agentId: AgentId,\n});\n\nexport const TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({\n id: resourceIdSchema,\n});\n\nexport const TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({\n subAgentId: SubAgentId,\n});\n\nexport const TenantProjectAgentSubAgentIdParamsSchema =\n TenantProjectAgentSubAgentParamsSchema.extend({\n id: resourceIdSchema,\n });\n\nexport const PaginationQueryParamsSchema = z\n .object({\n page: pageNumber,\n limit: limitNumber,\n })\n .openapi('PaginationQueryParams');\n\nexport const PrebuiltMCPServerSchema = z.object({\n id: z.string().describe('Unique identifier for the MCP server'),\n name: z.string().describe('Display name of the MCP server'),\n url: z.url().describe('URL endpoint for the MCP server'),\n transport: z.enum(MCPTransportType).describe('Transport protocol type'),\n imageUrl: z.url().optional().describe('Logo/icon URL for the MCP server'),\n isOpen: z\n .boolean()\n .optional()\n .describe(\"Whether the MCP server is open (doesn't require authentication)\"),\n category: z\n .string()\n .optional()\n .describe('Category of the MCP server (e.g., communication, project_management)'),\n description: z.string().optional().describe('Brief description of what the MCP server does'),\n thirdPartyConnectAccountUrl: z\n .url()\n .optional()\n .describe('URL to connect to the third party account'),\n});\n\nexport const MCPCatalogListResponse = z\n .object({\n data: z.array(PrebuiltMCPServerSchema),\n })\n .openapi('MCPCatalogListResponse');\n\nexport const ThirdPartyMCPServerResponse = z\n .object({\n data: PrebuiltMCPServerSchema.nullable(),\n })\n .openapi('ThirdPartyMCPServerResponse');\n","import Ajv from 'ajv';\n\nexport interface PropsValidationResult {\n isValid: boolean;\n errors: Array<{\n field: string;\n message: string;\n value?: any;\n }>;\n}\n\n/**\n * Validates that a props object is a valid JSON Schema\n * Uses AJV to validate the schema structure without resolving references\n */\nexport function validatePropsAsJsonSchema(props: any): PropsValidationResult {\n // If props is null, undefined, or empty, it's valid (optional for artifact components)\n if (!props || (typeof props === 'object' && Object.keys(props).length === 0)) {\n return {\n isValid: true,\n errors: [],\n };\n }\n\n // Basic JSON Schema structure validation\n if (typeof props !== 'object' || Array.isArray(props)) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props',\n message: 'Props must be a valid JSON Schema object',\n value: props,\n },\n ],\n };\n }\n\n // Check for required JSON Schema fields\n if (!props.type) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.type',\n message: 'JSON Schema must have a \"type\" field',\n },\n ],\n };\n }\n\n if (props.type !== 'object') {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.type',\n message: 'JSON Schema type must be \"object\" for component props',\n value: props.type,\n },\n ],\n };\n }\n\n if (!props.properties || typeof props.properties !== 'object') {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.properties',\n message: 'JSON Schema must have a \"properties\" object',\n },\n ],\n };\n }\n\n // Note: 'required' array is optional in JSON Schema\n // If present, it must be an array, but it's not mandatory\n if (props.required !== undefined && !Array.isArray(props.required)) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props.required',\n message: 'If present, \"required\" must be an array',\n },\n ],\n };\n }\n\n // Use AJV to validate the schema structure (without resolving references)\n try {\n const schemaToValidate = { ...props };\n delete schemaToValidate.$schema;\n\n const schemaValidator = new Ajv({\n strict: false, // Allow unknown keywords like inPreview\n validateSchema: true, // Validate the schema itself\n addUsedSchema: false, // Don't add schemas to the instance\n });\n\n const isValid = schemaValidator.validateSchema(schemaToValidate);\n\n if (!isValid) {\n const errors = schemaValidator.errors || [];\n return {\n isValid: false,\n errors: errors.map((error: any) => ({\n field: `props${error.instancePath || ''}`,\n message: error.message || 'Invalid schema',\n })),\n };\n }\n\n return {\n isValid: true,\n errors: [],\n };\n } catch (error) {\n return {\n isValid: false,\n errors: [\n {\n field: 'props',\n message: `Schema validation failed: ${error instanceof Error ? error.message : 'Unknown error'}`,\n },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,gBAAgB;AAC7B,MAAa,gBAAgB;AAC7B,MAAa,sBAAsB;AAEnC,MAAa,mBAAmB,EAC7B,QAAQ,CACR,IAAI,cAAc,CAClB,IAAI,cAAc,CAClB,SAAS,sBAAsB,CAC/B,MAAM,qBAAqB,EAC1B,SAAS,yEACV,CAAC,CACD,QAAQ;CACP,aAAa;CACb,SAAS;CACV,CAAC;AAEJ,iBAAiB,KAAK,EACpB,aAAa,uBACd,CAAC;;;;;;;;;;;;;AAcF,SAAgB,uBACd,aACA,SACa;CACb,MAAM,UAAU,SAAS,WAAW;CACpC,MAAM,WAAW,EACd,QAAQ,CACR,IAAI,cAAc,CAClB,IAAI,cAAc,CAClB,SAAS,YAAY,CACrB,MAAM,qBAAqB,EAC1B,SAAS,yEACV,CAAC,CACD,QAAQ;EACP;EACA;EACD,CAAC;AACJ,UAAS,KAAK,EAAE,aAAa,CAAC;AAC9B,QAAO;;AAGT,MAAMA,kBAA0E;CAC9E,KAAK,WAAW;EACd,MAAM,WAAY,OACf,IAA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ACN;GACE,OAAO;GACP,SAAS;GACV,CACF;EACF;AAKH,KAAI,MAAM,aAAa,UAAa,CAAC,MAAM,QAAQ,MAAM,SAAS,CAChE,QAAO;EACL,SAAS;EACT,QAAQ,CACN;GACE,OAAO;GACP,SAAS;GACV,CACF;EACF;AAIH,KAAI;EACF,MAAM,mBAAmB,EAAE,GAAG,OAAO;AACrC,SAAO,iBAAiB;EAExB,MAAM,kBAAkB,IAAI,IAAI;GAC9B,QAAQ;GACR,gBAAgB;GAChB,eAAe;GAChB,CAAC;AAIF,MAAI,CAFY,gBAAgB,eAAe,iBAAiB,CAI9D,QAAO;GACL,SAAS;GACT,SAHa,gBAAgB,UAAU,EAAE,EAG1B,KAAK,WAAgB;IAClC,OAAO,QAAQ,MAAM,gBAAgB;IACrC,SAAS,MAAM,WAAW;IAC3B,EAAE;GACJ;AAGH,SAAO;GACL,SAAS;GACT,QAAQ,EAAE;GACX;UACM,OAAO;AACd,SAAO;GACL,SAAS;GACT,QAAQ,CACN;IACE,OAAO;IACP,SAAS,6BAA6B,iBAAiB,QAAQ,MAAM,UAAU;IAChF,CACF;GACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-core",
3
- "version": "0.0.0-dev-20251219092754",
3
+ "version": "0.0.0-dev-20251220003011",
4
4
  "description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",