@inkeep/agents-core 0.0.0-dev-20250911072451 → 0.0.0-dev-20250911192304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod/v4';
2
- import { R as RequestSchemaDefinition, i as RequestSchemaConfig, a as ContextFetchDefinition, j as ContextConfigSelect, F as FetchDefinition, M as MCPTransportType, k as MCPToolConfig, S as ScopeConfig, b as ConversationHistoryConfig, l as PaginationConfig, A as AgentGraphInsert, m as AgentGraphUpdate, n as FullGraphDefinition, o as AgentRelationInsert, E as ExternalAgentRelationInsert, p as AgentRelationUpdate, q as AgentToolRelationUpdate, c as ToolMcpConfig, d as ToolServerCapabilities, e as McpToolDefinition, r as AgentInsert, s as AgentUpdate, t as AgentSelect, u as ApiKeySelect, v as ApiKeyInsert, w as ApiKeyUpdate, x as CreateApiKeyParams, y as ApiKeyCreateResult, z as ArtifactComponentSelect, B as ArtifactComponentInsert, D as ArtifactComponentUpdate, G as ContextCacheSelect, H as ContextCacheInsert, I as ContextConfigInsert, J as ContextConfigUpdate, K as ConversationSelect, L as ConversationInsert, f as ConversationMetadata, N as ConversationUpdate, O as CredentialReferenceSelect, Q as ToolSelect, U as CredentialReferenceInsert, V as CredentialReferenceUpdate, W as DataComponentSelect, X as DataComponentInsert, Y as DataComponentUpdate, Z as ExternalAgentInsert, _ as ExternalAgentSelect, $ as ExternalAgentUpdate, a0 as Artifact, a1 as LedgerArtifactSelect, h as MessageMetadata, g as MessageContent, a2 as MessageVisibility, a3 as MessageInsert, a4 as MessageUpdate, a5 as ProjectInfo, a6 as ProjectSelect, a7 as PaginationResult, a8 as ProjectResourceCounts, a9 as ProjectInsert, aa as ProjectUpdate, ab as TaskInsert, T as TaskMetadataConfig, ac as TaskSelect, ad as McpTool, ae as McpToolStatus, af as ToolInsert, ag as ToolUpdate, C as CredentialStoreType, ah as ExecutionContext } from './entities-Cc3_mgG5.js';
3
- export { aV as A2AError, bp as A2ARequest, bq as A2AResponse, au as APIKeySecurityScheme, bu as AgentApiInsert, dj as AgentApiInsertSchema, bt as AgentApiSelect, di as AgentApiSelectSchema, bv as AgentApiUpdate, dk as AgentApiUpdateSchema, cm as AgentArtifactComponentApiInsert, ev as AgentArtifactComponentApiInsertSchema, cl as AgentArtifactComponentApiSelect, eu as AgentArtifactComponentApiSelectSchema, cn as AgentArtifactComponentApiUpdate, ew as AgentArtifactComponentApiUpdateSchema, cj as AgentArtifactComponentInsert, es as AgentArtifactComponentInsertSchema, ci as AgentArtifactComponentSelect, er as AgentArtifactComponentSelectSchema, ck as AgentArtifactComponentUpdate, et as AgentArtifactComponentUpdateSchema, aq as AgentCapabilities, aE as AgentCard, c_ as AgentConversationHistoryConfig, cd as AgentDataComponentApiInsert, ej as AgentDataComponentApiInsertSchema, cc as AgentDataComponentApiSelect, ei as AgentDataComponentApiSelectSchema, ce as AgentDataComponentApiUpdate, ek as AgentDataComponentApiUpdateSchema, ca as AgentDataComponentInsert, eg as AgentDataComponentInsertSchema, c9 as AgentDataComponentSelect, ef as AgentDataComponentSelectSchema, cb as AgentDataComponentUpdate, eh as AgentDataComponentUpdateSchema, cL as AgentDefinition, bE as AgentGraphApiInsert, dz as AgentGraphApiInsertSchema, bD as AgentGraphApiSelect, dy as AgentGraphApiSelectSchema, bF as AgentGraphApiUpdate, dA as AgentGraphApiUpdateSchema, dw as AgentGraphInsertSchema, bC as AgentGraphSelect, dv as AgentGraphSelectSchema, dx as AgentGraphUpdateSchema, dg as AgentInsertSchema, ar as AgentProvider, by as AgentRelationApiInsert, dq as AgentRelationApiInsertSchema, bx as AgentRelationApiSelect, dp as AgentRelationApiSelectSchema, bz as AgentRelationApiUpdate, dr as AgentRelationApiUpdateSchema, dm as AgentRelationInsertSchema, bA as AgentRelationQuery, ds as AgentRelationQuerySchema, bw as AgentRelationSelect, dl as AgentRelationSelectSchema, dn as AgentRelationUpdateSchema, df as AgentSelectSchema, as as AgentSkill, cC as AgentToolRelationApiInsert, f7 as AgentToolRelationApiInsertSchema, cB as AgentToolRelationApiSelect, f6 as AgentToolRelationApiSelectSchema, cD as AgentToolRelationApiUpdate, f8 as AgentToolRelationApiUpdateSchema, cA as AgentToolRelationInsert, f4 as AgentToolRelationInsertSchema, cz as AgentToolRelationSelect, f3 as AgentToolRelationSelectSchema, f5 as AgentToolRelationUpdateSchema, dh as AgentUpdateSchema, eD as AllAgentSchema, cr as AllAgentSelect, cv as ApiKeyApiCreationResponse, eI as ApiKeyApiCreationResponseSchema, ct as ApiKeyApiInsert, eJ as ApiKeyApiInsertSchema, cs as ApiKeyApiSelect, eH as ApiKeyApiSelectSchema, cu as ApiKeyApiUpdate, eK as ApiKeyApiUpdateSchema, eF as ApiKeyInsertSchema, eE as ApiKeySelectSchema, eG as ApiKeyUpdateSchema, cg as ArtifactComponentApiInsert, ep as ArtifactComponentApiInsertSchema, cf as ArtifactComponentApiSelect, eo as ArtifactComponentApiSelectSchema, ch as ArtifactComponentApiUpdate, eq as ArtifactComponentApiUpdateSchema, em as ArtifactComponentInsertSchema, el as ArtifactComponentSelectSchema, en as ArtifactComponentUpdateSchema, ax as AuthorizationCodeOAuthFlow, b9 as CancelTaskRequest, bk as CancelTaskResponse, bj as CancelTaskSuccessResponse, ay as ClientCredentialsOAuthFlow, aT as ContentTypeNotSupportedError, c4 as ContextCacheApiInsert, e6 as ContextCacheApiInsertSchema, c3 as ContextCacheApiSelect, e5 as ContextCacheApiSelectSchema, c5 as ContextCacheApiUpdate, e7 as ContextCacheApiUpdateSchema, c$ as ContextCacheEntry, e3 as ContextCacheInsertSchema, e2 as ContextCacheSelectSchema, c2 as ContextCacheUpdate, e4 as ContextCacheUpdateSchema, b$ as ContextConfigApiInsert, f1 as ContextConfigApiInsertSchema, b_ as ContextConfigApiSelect, f0 as ContextConfigApiSelectSchema, c0 as ContextConfigApiUpdate, f2 as ContextConfigApiUpdateSchema, e_ as ContextConfigInsertSchema, eZ as ContextConfigSelectSchema, e$ as ContextConfigUpdateSchema, bU as ConversationApiInsert, dW as ConversationApiInsertSchema, bT as ConversationApiSelect, dV as ConversationApiSelectSchema, bV as ConversationApiUpdate, dX as ConversationApiUpdateSchema, dT as ConversationInsertSchema, cZ as ConversationScopeOptions, dS as ConversationSelectSchema, dU as ConversationUpdateSchema, cx as CredentialReferenceApiInsert, eP as CredentialReferenceApiInsertSchema, cw as CredentialReferenceApiSelect, eO as CredentialReferenceApiSelectSchema, cy as CredentialReferenceApiUpdate, eQ as CredentialReferenceApiUpdateSchema, eM as CredentialReferenceInsertSchema, eL as CredentialReferenceSelectSchema, eN as CredentialReferenceUpdateSchema, c7 as DataComponentApiInsert, ed as DataComponentApiInsertSchema, c6 as DataComponentApiSelect, ec as DataComponentApiSelectSchema, c8 as DataComponentApiUpdate, ee as DataComponentApiUpdateSchema, ea as DataComponentBaseSchema, e9 as DataComponentInsertSchema, e8 as DataComponentSelectSchema, eb as DataComponentUpdateSchema, ao as DataPart, fm as ErrorResponseSchema, fn as ExistsResponseSchema, cp as ExternalAgentApiInsert, eB as ExternalAgentApiInsertSchema, co as ExternalAgentApiSelect, eA as ExternalAgentApiSelectSchema, cq as ExternalAgentApiUpdate, eC as ExternalAgentApiUpdateSchema, ey as ExternalAgentInsertSchema, bB as ExternalAgentRelationApiInsert, du as ExternalAgentRelationApiInsertSchema, dt as ExternalAgentRelationInsertSchema, ex as ExternalAgentSelectSchema, ez as ExternalAgentUpdateSchema, c1 as FetchConfig, eX as FetchConfigSchema, eY as FetchDefinitionSchema, ak as FileBase, an as FilePart, al as FileWithBytes, am as FileWithUri, cJ as FullGraphAgentInsert, fh as FullGraphAgentInsertSchema, fi as FullGraphDefinitionSchema, bb as GetTaskPushNotificationConfigRequest, bo as GetTaskPushNotificationConfigResponse, bn as GetTaskPushNotificationConfigSuccessResponse, b8 as GetTaskRequest, bi as GetTaskResponse, bh as GetTaskSuccessResponse, av as HTTPAuthSecurityScheme, fv as HeadersScopeSchema, fA as IdParamsSchema, az as ImplicitOAuthFlow, cK as InternalAgentDefinition, aO as InternalError, aU as InvalidAgentResponseError, aN as InvalidParamsError, aL as InvalidRequestError, aK as JSONParseError, b3 as JSONRPCError, b5 as JSONRPCErrorResponse, b1 as JSONRPCMessage, b2 as JSONRPCRequest, b4 as JSONRPCResult, cH as LedgerArtifactApiInsert, fd as LedgerArtifactApiInsertSchema, cG as LedgerArtifactApiSelect, fc as LedgerArtifactApiSelectSchema, cI as LedgerArtifactApiUpdate, fe as LedgerArtifactApiUpdateSchema, cE as LedgerArtifactInsert, fa as LedgerArtifactInsertSchema, f9 as LedgerArtifactSelectSchema, cF as LedgerArtifactUpdate, fb as LedgerArtifactUpdateSchema, fk as ListResponseSchema, d9 as MAX_ID_LENGTH, d7 as MCPServerType, eS as MCPToolConfigSchema, d8 as MIN_ID_LENGTH, d0 as McpAuthType, d1 as McpServerAuth, d3 as McpServerCapabilities, dP as McpToolDefinitionSchema, eR as McpToolSchema, d2 as McpTransportConfig, dN as McpTransportConfigSchema, aF as Message, bY as MessageApiInsert, e0 as MessageApiInsertSchema, bX as MessageApiSelect, d$ as MessageApiSelectSchema, bZ as MessageApiUpdate, e1 as MessageApiUpdateSchema, dZ as MessageInsertSchema, cT as MessageMode, br as MessagePart, cS as MessageRole, bW as MessageSelect, dY as MessageSelectSchema, a$ as MessageSendConfiguration, b0 as MessageSendParams, cR as MessageType, d_ as MessageUpdateSchema, aM as MethodNotFoundError, dd as ModelSchema, cW as ModelSettings, dc as ModelSettingsSchema, cU as Models, aB as OAuth2SecurityScheme, aw as OAuthFlows, aC as OpenIdConnectSecurityScheme, cQ as Pagination, fB as PaginationQueryParamsSchema, fj as PaginationSchema, P as Part, ai as PartBase, aA as PasswordOAuthFlow, cO as ProjectApiInsert, ft as ProjectApiInsertSchema, cN as ProjectApiSelect, fs as ProjectApiSelectSchema, cP as ProjectApiUpdate, fu as ProjectApiUpdateSchema, fq as ProjectInsertSchema, de as ProjectModelSchema, cV as ProjectModels, fp as ProjectSelectSchema, fr as ProjectUpdateSchema, aW as PushNotificationAuthenticationInfo, aX as PushNotificationConfig, aR as PushNotificationNotSupportedError, fo as RemovedResponseSchema, aD as SecurityScheme, at as SecuritySchemeBase, b6 as SendMessageRequest, be as SendMessageResponse, bd as SendMessageSuccessResponse, b7 as SendStreamingMessageRequest, bg as SendStreamingMessageResponse, bf as SendStreamingMessageSuccessResponse, ba as SetTaskPushNotificationConfigRequest, bm as SetTaskPushNotificationConfigResponse, bl as SetTaskPushNotificationConfigSuccessResponse, fl as SingleResponseSchema, cY as StatusComponent, ff as StatusComponentSchema, fg as StatusUpdateSchema, cX as StatusUpdateSettings, d5 as TOOL_STATUS_VALUES, aH as Task, bI as TaskApiInsert, dF as TaskApiInsertSchema, bH as TaskApiSelect, dE as TaskApiSelectSchema, bJ as TaskApiUpdate, dG as TaskApiUpdateSchema, bs as TaskArtifact, aJ as TaskArtifactUpdateEvent, aZ as TaskIdParams, dC as TaskInsertSchema, aQ as TaskNotCancelableError, aP as TaskNotFoundError, aY as TaskPushNotificationConfig, a_ as TaskQueryParams, bO as TaskRelationApiInsert, dL as TaskRelationApiInsertSchema, bN as TaskRelationApiSelect, dK as TaskRelationApiSelectSchema, bP as TaskRelationApiUpdate, dM as TaskRelationApiUpdateSchema, bL as TaskRelationInsert, dI as TaskRelationInsertSchema, bK as TaskRelationSelect, dH as TaskRelationSelectSchema, bM as TaskRelationUpdate, dJ as TaskRelationUpdateSchema, bc as TaskResubscriptionRequest, dB as TaskSelectSchema, ap as TaskState, aG as TaskStatus, aI as TaskStatusUpdateEvent, bG as TaskUpdate, dD as TaskUpdateSchema, fz as TenantIdParamsSchema, fw as TenantParamsSchema, fy as TenantProjectIdParamsSchema, fx as TenantProjectParamsSchema, aj as TextPart, bR as ToolApiInsert, eV as ToolApiInsertSchema, bQ as ToolApiSelect, eU as ToolApiSelectSchema, bS as ToolApiUpdate, eW as ToolApiUpdateSchema, cM as ToolDefinition, dR as ToolInsertSchema, dQ as ToolSelectSchema, dO as ToolStatusSchema, eT as ToolUpdateSchema, da as URL_SAFE_ID_PATTERN, aS as UnsupportedOperationError, d6 as VALID_RELATION_TYPES, db as resourceIdSchema, d4 as toolStatus } from './entities-Cc3_mgG5.js';
2
+ import { a as ContextFetchDefinition, i as ContextConfigSelect, F as FetchDefinition, M as MCPTransportType, j as MCPToolConfig, S as ScopeConfig, b as ConversationHistoryConfig, k as PaginationConfig, A as AgentGraphInsert, l as AgentGraphUpdate, m as FullGraphDefinition, n as AgentRelationInsert, E as ExternalAgentRelationInsert, o as AgentRelationUpdate, p as AgentToolRelationUpdate, c as ToolMcpConfig, d as ToolServerCapabilities, e as McpToolDefinition, q as AgentInsert, r as AgentUpdate, s as AgentSelect, t as ApiKeySelect, u as ApiKeyInsert, v as ApiKeyUpdate, w as CreateApiKeyParams, x as ApiKeyCreateResult, y as ArtifactComponentSelect, z as ArtifactComponentInsert, B as ArtifactComponentUpdate, D as ContextCacheSelect, G as ContextCacheInsert, H as ContextConfigInsert, I as ContextConfigUpdate, J as ConversationSelect, K as ConversationInsert, f as ConversationMetadata, L as ConversationUpdate, N as CredentialReferenceSelect, O as ToolSelect, Q as CredentialReferenceInsert, R as CredentialReferenceUpdate, U as DataComponentSelect, V as DataComponentInsert, W as DataComponentUpdate, X as ExternalAgentInsert, Y as ExternalAgentSelect, Z as ExternalAgentUpdate, _ as Artifact, $ as LedgerArtifactSelect, h as MessageMetadata, g as MessageContent, a0 as MessageVisibility, a1 as MessageInsert, a2 as MessageUpdate, a3 as ProjectInfo, a4 as ProjectSelect, a5 as PaginationResult, a6 as ProjectResourceCounts, a7 as ProjectInsert, a8 as ProjectUpdate, a9 as TaskInsert, T as TaskMetadataConfig, aa as TaskSelect, ab as McpTool, ac as McpToolStatus, ad as ToolInsert, ae as ToolUpdate, C as CredentialStoreType, af as ExecutionContext } from './entities-B59eRwT_.js';
3
+ export { aT as A2AError, bn as A2ARequest, bo as A2AResponse, as as APIKeySecurityScheme, bs as AgentApiInsert, dh as AgentApiInsertSchema, br as AgentApiSelect, dg as AgentApiSelectSchema, bt as AgentApiUpdate, di as AgentApiUpdateSchema, ck as AgentArtifactComponentApiInsert, et as AgentArtifactComponentApiInsertSchema, cj as AgentArtifactComponentApiSelect, es as AgentArtifactComponentApiSelectSchema, cl as AgentArtifactComponentApiUpdate, eu as AgentArtifactComponentApiUpdateSchema, ch as AgentArtifactComponentInsert, eq as AgentArtifactComponentInsertSchema, cg as AgentArtifactComponentSelect, ep as AgentArtifactComponentSelectSchema, ci as AgentArtifactComponentUpdate, er as AgentArtifactComponentUpdateSchema, ao as AgentCapabilities, aC as AgentCard, cY as AgentConversationHistoryConfig, cb as AgentDataComponentApiInsert, eh as AgentDataComponentApiInsertSchema, ca as AgentDataComponentApiSelect, eg as AgentDataComponentApiSelectSchema, cc as AgentDataComponentApiUpdate, ei as AgentDataComponentApiUpdateSchema, c8 as AgentDataComponentInsert, ee as AgentDataComponentInsertSchema, c7 as AgentDataComponentSelect, ed as AgentDataComponentSelectSchema, c9 as AgentDataComponentUpdate, ef as AgentDataComponentUpdateSchema, cJ as AgentDefinition, bC as AgentGraphApiInsert, dx as AgentGraphApiInsertSchema, bB as AgentGraphApiSelect, dw as AgentGraphApiSelectSchema, bD as AgentGraphApiUpdate, dy as AgentGraphApiUpdateSchema, du as AgentGraphInsertSchema, bA as AgentGraphSelect, dt as AgentGraphSelectSchema, dv as AgentGraphUpdateSchema, de as AgentInsertSchema, ap as AgentProvider, bw as AgentRelationApiInsert, dn as AgentRelationApiInsertSchema, bv as AgentRelationApiSelect, dm as AgentRelationApiSelectSchema, bx as AgentRelationApiUpdate, dp as AgentRelationApiUpdateSchema, dk as AgentRelationInsertSchema, by as AgentRelationQuery, dq as AgentRelationQuerySchema, bu as AgentRelationSelect, dj as AgentRelationSelectSchema, dl as AgentRelationUpdateSchema, dd as AgentSelectSchema, aq as AgentSkill, cA as AgentToolRelationApiInsert, f5 as AgentToolRelationApiInsertSchema, cz as AgentToolRelationApiSelect, f4 as AgentToolRelationApiSelectSchema, cB as AgentToolRelationApiUpdate, f6 as AgentToolRelationApiUpdateSchema, cy as AgentToolRelationInsert, f2 as AgentToolRelationInsertSchema, cx as AgentToolRelationSelect, f1 as AgentToolRelationSelectSchema, f3 as AgentToolRelationUpdateSchema, df as AgentUpdateSchema, eB as AllAgentSchema, cp as AllAgentSelect, ct as ApiKeyApiCreationResponse, eG as ApiKeyApiCreationResponseSchema, cr as ApiKeyApiInsert, eH as ApiKeyApiInsertSchema, cq as ApiKeyApiSelect, eF as ApiKeyApiSelectSchema, cs as ApiKeyApiUpdate, eI as ApiKeyApiUpdateSchema, eD as ApiKeyInsertSchema, eC as ApiKeySelectSchema, eE as ApiKeyUpdateSchema, ce as ArtifactComponentApiInsert, en as ArtifactComponentApiInsertSchema, cd as ArtifactComponentApiSelect, em as ArtifactComponentApiSelectSchema, cf as ArtifactComponentApiUpdate, eo as ArtifactComponentApiUpdateSchema, ek as ArtifactComponentInsertSchema, ej as ArtifactComponentSelectSchema, el as ArtifactComponentUpdateSchema, av as AuthorizationCodeOAuthFlow, b7 as CancelTaskRequest, bi as CancelTaskResponse, bh as CancelTaskSuccessResponse, aw as ClientCredentialsOAuthFlow, aR as ContentTypeNotSupportedError, c2 as ContextCacheApiInsert, e4 as ContextCacheApiInsertSchema, c1 as ContextCacheApiSelect, e3 as ContextCacheApiSelectSchema, c3 as ContextCacheApiUpdate, e5 as ContextCacheApiUpdateSchema, cZ as ContextCacheEntry, e1 as ContextCacheInsertSchema, e0 as ContextCacheSelectSchema, c0 as ContextCacheUpdate, e2 as ContextCacheUpdateSchema, bZ as ContextConfigApiInsert, e$ as ContextConfigApiInsertSchema, bY as ContextConfigApiSelect, e_ as ContextConfigApiSelectSchema, b_ as ContextConfigApiUpdate, f0 as ContextConfigApiUpdateSchema, eY as ContextConfigInsertSchema, eX as ContextConfigSelectSchema, eZ as ContextConfigUpdateSchema, bS as ConversationApiInsert, dU as ConversationApiInsertSchema, bR as ConversationApiSelect, dT as ConversationApiSelectSchema, bT as ConversationApiUpdate, dV as ConversationApiUpdateSchema, dR as ConversationInsertSchema, cX as ConversationScopeOptions, dQ as ConversationSelectSchema, dS as ConversationUpdateSchema, cv as CredentialReferenceApiInsert, eN as CredentialReferenceApiInsertSchema, cu as CredentialReferenceApiSelect, eM as CredentialReferenceApiSelectSchema, cw as CredentialReferenceApiUpdate, eO as CredentialReferenceApiUpdateSchema, eK as CredentialReferenceInsertSchema, eJ as CredentialReferenceSelectSchema, eL as CredentialReferenceUpdateSchema, c5 as DataComponentApiInsert, eb as DataComponentApiInsertSchema, c4 as DataComponentApiSelect, ea as DataComponentApiSelectSchema, c6 as DataComponentApiUpdate, ec as DataComponentApiUpdateSchema, e8 as DataComponentBaseSchema, e7 as DataComponentInsertSchema, e6 as DataComponentSelectSchema, e9 as DataComponentUpdateSchema, am as DataPart, fk as ErrorResponseSchema, fl as ExistsResponseSchema, cn as ExternalAgentApiInsert, ez as ExternalAgentApiInsertSchema, cm as ExternalAgentApiSelect, ey as ExternalAgentApiSelectSchema, co as ExternalAgentApiUpdate, eA as ExternalAgentApiUpdateSchema, ew as ExternalAgentInsertSchema, bz as ExternalAgentRelationApiInsert, ds as ExternalAgentRelationApiInsertSchema, dr as ExternalAgentRelationInsertSchema, ev as ExternalAgentSelectSchema, ex as ExternalAgentUpdateSchema, b$ as FetchConfig, eV as FetchConfigSchema, eW as FetchDefinitionSchema, ai as FileBase, al as FilePart, aj as FileWithBytes, ak as FileWithUri, cH as FullGraphAgentInsert, ff as FullGraphAgentInsertSchema, fg as FullGraphDefinitionSchema, b9 as GetTaskPushNotificationConfigRequest, bm as GetTaskPushNotificationConfigResponse, bl as GetTaskPushNotificationConfigSuccessResponse, b6 as GetTaskRequest, bg as GetTaskResponse, bf as GetTaskSuccessResponse, at as HTTPAuthSecurityScheme, ft as HeadersScopeSchema, fy as IdParamsSchema, ax as ImplicitOAuthFlow, cI as InternalAgentDefinition, aM as InternalError, aS as InvalidAgentResponseError, aL as InvalidParamsError, aJ as InvalidRequestError, aI as JSONParseError, b1 as JSONRPCError, b3 as JSONRPCErrorResponse, a$ as JSONRPCMessage, b0 as JSONRPCRequest, b2 as JSONRPCResult, cF as LedgerArtifactApiInsert, fb as LedgerArtifactApiInsertSchema, cE as LedgerArtifactApiSelect, fa as LedgerArtifactApiSelectSchema, cG as LedgerArtifactApiUpdate, fc as LedgerArtifactApiUpdateSchema, cC as LedgerArtifactInsert, f8 as LedgerArtifactInsertSchema, f7 as LedgerArtifactSelectSchema, cD as LedgerArtifactUpdate, f9 as LedgerArtifactUpdateSchema, fi as ListResponseSchema, d7 as MAX_ID_LENGTH, d5 as MCPServerType, eQ as MCPToolConfigSchema, d6 as MIN_ID_LENGTH, c_ as McpAuthType, c$ as McpServerAuth, d1 as McpServerCapabilities, dN as McpToolDefinitionSchema, eP as McpToolSchema, d0 as McpTransportConfig, dL as McpTransportConfigSchema, aD as Message, bW as MessageApiInsert, d_ as MessageApiInsertSchema, bV as MessageApiSelect, dZ as MessageApiSelectSchema, bX as MessageApiUpdate, d$ as MessageApiUpdateSchema, dX as MessageInsertSchema, cR as MessageMode, bp as MessagePart, cQ as MessageRole, bU as MessageSelect, dW as MessageSelectSchema, aZ as MessageSendConfiguration, a_ as MessageSendParams, cP as MessageType, dY as MessageUpdateSchema, aK as MethodNotFoundError, db as ModelSchema, cU as ModelSettings, da as ModelSettingsSchema, cS as Models, az as OAuth2SecurityScheme, au as OAuthFlows, aA as OpenIdConnectSecurityScheme, cO as Pagination, fz as PaginationQueryParamsSchema, fh as PaginationSchema, P as Part, ag as PartBase, ay as PasswordOAuthFlow, cM as ProjectApiInsert, fr as ProjectApiInsertSchema, cL as ProjectApiSelect, fq as ProjectApiSelectSchema, cN as ProjectApiUpdate, fs as ProjectApiUpdateSchema, fo as ProjectInsertSchema, dc as ProjectModelSchema, cT as ProjectModels, fn as ProjectSelectSchema, fp as ProjectUpdateSchema, aU as PushNotificationAuthenticationInfo, aV as PushNotificationConfig, aP as PushNotificationNotSupportedError, fm as RemovedResponseSchema, aB as SecurityScheme, ar as SecuritySchemeBase, b4 as SendMessageRequest, bc as SendMessageResponse, bb as SendMessageSuccessResponse, b5 as SendStreamingMessageRequest, be as SendStreamingMessageResponse, bd as SendStreamingMessageSuccessResponse, b8 as SetTaskPushNotificationConfigRequest, bk as SetTaskPushNotificationConfigResponse, bj as SetTaskPushNotificationConfigSuccessResponse, fj as SingleResponseSchema, cW as StatusComponent, fd as StatusComponentSchema, fe as StatusUpdateSchema, cV as StatusUpdateSettings, d3 as TOOL_STATUS_VALUES, aF as Task, bG as TaskApiInsert, dD as TaskApiInsertSchema, bF as TaskApiSelect, dC as TaskApiSelectSchema, bH as TaskApiUpdate, dE as TaskApiUpdateSchema, bq as TaskArtifact, aH as TaskArtifactUpdateEvent, aX as TaskIdParams, dA as TaskInsertSchema, aO as TaskNotCancelableError, aN as TaskNotFoundError, aW as TaskPushNotificationConfig, aY as TaskQueryParams, bM as TaskRelationApiInsert, dJ as TaskRelationApiInsertSchema, bL as TaskRelationApiSelect, dI as TaskRelationApiSelectSchema, bN as TaskRelationApiUpdate, dK as TaskRelationApiUpdateSchema, bJ as TaskRelationInsert, dG as TaskRelationInsertSchema, bI as TaskRelationSelect, dF as TaskRelationSelectSchema, bK as TaskRelationUpdate, dH as TaskRelationUpdateSchema, ba as TaskResubscriptionRequest, dz as TaskSelectSchema, an as TaskState, aE as TaskStatus, aG as TaskStatusUpdateEvent, bE as TaskUpdate, dB as TaskUpdateSchema, fx as TenantIdParamsSchema, fu as TenantParamsSchema, fw as TenantProjectIdParamsSchema, fv as TenantProjectParamsSchema, ah as TextPart, bP as ToolApiInsert, eT as ToolApiInsertSchema, bO as ToolApiSelect, eS as ToolApiSelectSchema, bQ as ToolApiUpdate, eU as ToolApiUpdateSchema, cK as ToolDefinition, dP as ToolInsertSchema, dO as ToolSelectSchema, dM as ToolStatusSchema, eR as ToolUpdateSchema, d8 as URL_SAFE_ID_PATTERN, aQ as UnsupportedOperationError, d4 as VALID_RELATION_TYPES, d9 as resourceIdSchema, d2 as toolStatus } from './entities-B59eRwT_.js';
4
4
  import { CredentialStore } from './types/index.js';
5
5
  export { CorsConfig, ServerConfig, ServerOptions } from './types/index.js';
6
6
  import { LibSQLDatabase } from 'drizzle-orm/libsql';
7
- import { s as schema } from './schema-xZJcE9v-.js';
8
- export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from './schema-xZJcE9v-.js';
7
+ import { s as schema } from './schema-B3zZJ85n.js';
8
+ export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from './schema-B3zZJ85n.js';
9
9
  import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
10
10
  import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
11
11
  import { ClientCapabilities } from '@modelcontextprotocol/sdk/types.js';
@@ -21,23 +21,11 @@ import 'drizzle-zod';
21
21
  import 'drizzle-orm/sqlite-core';
22
22
  import 'drizzle-orm';
23
23
 
24
- declare function createRequestSchema(schemas: RequestSchemaDefinition, config?: {
25
- optional?: ('body' | 'headers' | 'query' | 'params')[];
26
- }): {
27
- schemas: RequestSchemaDefinition;
28
- config: RequestSchemaConfig;
29
- toJsonSchema: () => {
30
- schemas: Record<string, any>;
31
- optional: ("query" | "body" | "headers" | "params")[] | undefined;
32
- };
33
- getZodSchemas: () => RequestSchemaDefinition;
34
- getConfig: () => RequestSchemaConfig;
35
- };
36
24
  interface ContextConfigBuilderOptions {
37
25
  id: string;
38
26
  name: string;
39
27
  description?: string;
40
- requestContextSchema?: z.ZodSchema<any> | ReturnType<typeof createRequestSchema>;
28
+ requestContextSchema?: z.ZodSchema<any>;
41
29
  contextVariables?: Record<string, ContextFetchDefinition>;
42
30
  tenantId?: string;
43
31
  projectId?: string;
@@ -2718,8 +2706,8 @@ declare const getMessageById: (db: DatabaseClient) => (params: {
2718
2706
  createdAt: string;
2719
2707
  updatedAt: string;
2720
2708
  metadata: MessageMetadata | null;
2721
- role: string;
2722
2709
  content: MessageContent;
2710
+ role: string;
2723
2711
  conversationId: string;
2724
2712
  agentId: string | null;
2725
2713
  fromAgentId: string | null;
@@ -2844,8 +2832,8 @@ declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) =>
2844
2832
  createdAt: string;
2845
2833
  updatedAt: string;
2846
2834
  metadata: MessageMetadata | null;
2847
- role: string;
2848
2835
  content: MessageContent;
2836
+ role: string;
2849
2837
  conversationId: string;
2850
2838
  agentId: string | null;
2851
2839
  fromAgentId: string | null;
@@ -2870,8 +2858,8 @@ declare const updateMessage: (db: DatabaseClient) => (params: {
2870
2858
  createdAt: string;
2871
2859
  updatedAt: string;
2872
2860
  metadata: MessageMetadata | null;
2873
- role: string;
2874
2861
  content: MessageContent;
2862
+ role: string;
2875
2863
  conversationId: string;
2876
2864
  agentId: string | null;
2877
2865
  fromAgentId: string | null;
@@ -2895,8 +2883,8 @@ declare const deleteMessage: (db: DatabaseClient) => (params: {
2895
2883
  createdAt: string;
2896
2884
  updatedAt: string;
2897
2885
  metadata: MessageMetadata | null;
2898
- role: string;
2899
2886
  content: MessageContent;
2887
+ role: string;
2900
2888
  conversationId: string;
2901
2889
  agentId: string | null;
2902
2890
  fromAgentId: string | null;
@@ -3305,7 +3293,7 @@ declare const withProjectValidation: <T extends (...args: any[]) => Promise<any>
3305
3293
  */
3306
3294
  declare const createValidatedDataAccess: <T extends Record<string, any>>(db: DatabaseClient, dataAccessFunctions: T) => T;
3307
3295
 
3308
- declare const HTTP_REQUEST_PARTS: readonly ["body", "headers", "query", "params"];
3296
+ declare const HTTP_REQUEST_PARTS: readonly ["headers"];
3309
3297
  type HttpRequestPart = (typeof HTTP_REQUEST_PARTS)[number];
3310
3298
  interface ContextValidationError {
3311
3299
  field: string;
@@ -3318,23 +3306,16 @@ interface ContextValidationResult {
3318
3306
  validatedContext?: Record<string, unknown> | ParsedHttpRequest;
3319
3307
  }
3320
3308
  interface ParsedHttpRequest {
3321
- body?: any;
3322
3309
  headers?: Record<string, string>;
3323
- query?: Record<string, string>;
3324
- params?: Record<string, string>;
3325
3310
  }
3326
3311
  declare function isValidHttpRequest(obj: any): obj is ParsedHttpRequest;
3327
3312
  declare function getCachedValidator(schema: Record<string, unknown>): ValidateFunction;
3328
3313
  declare function validationHelper(jsonSchema: Record<string, unknown>): ValidateFunction<unknown>;
3329
3314
  declare function validateAgainstJsonSchema(jsonSchema: Record<string, unknown>, context: unknown): boolean;
3330
3315
  /**
3331
- * Checks if the schema is in the new comprehensive request format
3316
+ * Validates HTTP request headers against schema
3332
3317
  */
3333
- declare function isComprehensiveRequestSchema(schema: any): boolean;
3334
- /**
3335
- * Validates HTTP request parts against comprehensive schema
3336
- */
3337
- declare function validateHttpRequestParts(comprehensiveSchema: any, httpRequest: ParsedHttpRequest): Promise<ContextValidationResult>;
3318
+ declare function validateHttpRequestHeaders(headersSchema: any, httpRequest: ParsedHttpRequest): Promise<ContextValidationResult>;
3338
3319
  /**
3339
3320
  * Validates request context against the JSON Schema stored in context configuration
3340
3321
  * Supports both legacy simple schemas and new comprehensive HTTP request schemas
@@ -3345,6 +3326,11 @@ declare function validateRequestContext(tenantId: string, projectId: string, gra
3345
3326
  */
3346
3327
  declare function contextValidationMiddleware(dbClient: DatabaseClient): (c: Context, next: Next) => Promise<void | (Response & hono.TypedResponse<{
3347
3328
  error: string;
3329
+ details: {
3330
+ field: string;
3331
+ message: string;
3332
+ value?: undefined;
3333
+ }[];
3348
3334
  }, 400, "json">) | (Response & hono.TypedResponse<{
3349
3335
  error: string;
3350
3336
  message: string;
@@ -3989,4 +3975,4 @@ declare function getGlobalTracer(): Tracer;
3989
3975
  */
3990
3976
  declare function forceFlushTracer(): Promise<void>;
3991
3977
 
3992
- export { AgentGraphInsert, AgentGraphUpdate, AgentInsert, AgentRelationInsert, AgentRelationUpdate, AgentSelect, AgentToolRelationUpdate, AgentUpdate, ApiKeyCreateResult, type ApiKeyGenerationResult, ApiKeyInsert, ApiKeySelect, ApiKeyUpdate, Artifact, ArtifactComponentInsert, ArtifactComponentSelect, ArtifactComponentUpdate, BASE, type CommonCreateErrorResponses, type CommonDeleteErrorResponses, type CommonGetErrorResponses, type CommonUpdateErrorResponses, ConsoleLogger, ContextCache, ContextCacheInsert, ContextCacheSelect, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextConfigInsert, ContextConfigSelect, ContextConfigUpdate, ContextFetchDefinition, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type ContextResolverInterface, type ContextValidationError, type ContextValidationResult, ConversationHistoryConfig, ConversationInsert, ConversationMetadata, ConversationSelect, ConversationUpdate, CreateApiKeyParams, type CredentialContext, type CredentialData, CredentialReferenceInsert, CredentialReferenceSelect, CredentialReferenceUpdate, type CredentialReferenceWithTools, type CredentialResolverInput, CredentialStore, type CredentialStoreReference, CredentialStoreRegistry, CredentialStoreType, CredentialStuffer, DataComponentInsert, DataComponentSelect, DataComponentUpdate, type DatabaseClient, type DatabaseConfig, ERROR_DOCS_BASE_URL, ErrorCode, type ErrorCodes, type ErrorResponse, ExecutionContext, ExternalAgentInsert, ExternalAgentRelationInsert, ExternalAgentSelect, ExternalAgentUpdate, FetchDefinition, type FetchResult, FullGraphDefinition, type GraphLogger, HTTP_REQUEST_PARTS, type HttpRequestPart, InMemoryCredentialStore, KeyChainStore, LedgerArtifactSelect, type Logger$1 as Logger, type LoggerFactoryConfig, MCPToolConfig, MCPTransportType, McpClient, type McpClientOptions, type McpSSEConfig, type McpServerConfig, type McpStreamableHttpConfig, McpTool, McpToolDefinition, McpToolStatus, MessageContent, MessageInsert, MessageMetadata, MessageUpdate, MessageVisibility, NangoCredentialStore, NoOpLogger, type OAuthConfig, PaginationConfig, PaginationResult, type ParsedHttpRequest, type ProblemDetails, ProjectInfo, ProjectInsert, ProjectResourceCounts, ProjectSelect, ProjectUpdate, RequestSchemaConfig, RequestSchemaDefinition, type ResolvedContext, SERVICE_NAME, SERVICE_VERSION, ScopeConfig, TaskInsert, TaskMetadataConfig, TaskSelect, type TemplateContext, TemplateEngine, type TemplateRenderOptions, ToolInsert, ToolMcpConfig, ToolSelect, ToolServerCapabilities, ToolUpdate, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createRequestSchema, createSpanName, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, forceFlushTracer, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraph, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentInGraphContext, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getGlobalTracer, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, handleSpanError, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isComprehensiveRequestSchema, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgentToolRelationsByAgent, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestParts, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
3978
+ export { AgentGraphInsert, AgentGraphUpdate, AgentInsert, AgentRelationInsert, AgentRelationUpdate, AgentSelect, AgentToolRelationUpdate, AgentUpdate, ApiKeyCreateResult, type ApiKeyGenerationResult, ApiKeyInsert, ApiKeySelect, ApiKeyUpdate, Artifact, ArtifactComponentInsert, ArtifactComponentSelect, ArtifactComponentUpdate, BASE, type CommonCreateErrorResponses, type CommonDeleteErrorResponses, type CommonGetErrorResponses, type CommonUpdateErrorResponses, ConsoleLogger, ContextCache, ContextCacheInsert, ContextCacheSelect, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextConfigInsert, ContextConfigSelect, ContextConfigUpdate, ContextFetchDefinition, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type ContextResolverInterface, type ContextValidationError, type ContextValidationResult, ConversationHistoryConfig, ConversationInsert, ConversationMetadata, ConversationSelect, ConversationUpdate, CreateApiKeyParams, type CredentialContext, type CredentialData, CredentialReferenceInsert, CredentialReferenceSelect, CredentialReferenceUpdate, type CredentialReferenceWithTools, type CredentialResolverInput, CredentialStore, type CredentialStoreReference, CredentialStoreRegistry, CredentialStoreType, CredentialStuffer, DataComponentInsert, DataComponentSelect, DataComponentUpdate, type DatabaseClient, type DatabaseConfig, ERROR_DOCS_BASE_URL, ErrorCode, type ErrorCodes, type ErrorResponse, ExecutionContext, ExternalAgentInsert, ExternalAgentRelationInsert, ExternalAgentSelect, ExternalAgentUpdate, FetchDefinition, type FetchResult, FullGraphDefinition, type GraphLogger, HTTP_REQUEST_PARTS, type HttpRequestPart, InMemoryCredentialStore, KeyChainStore, LedgerArtifactSelect, type Logger$1 as Logger, type LoggerFactoryConfig, MCPToolConfig, MCPTransportType, McpClient, type McpClientOptions, type McpSSEConfig, type McpServerConfig, type McpStreamableHttpConfig, McpTool, McpToolDefinition, McpToolStatus, MessageContent, MessageInsert, MessageMetadata, MessageUpdate, MessageVisibility, NangoCredentialStore, NoOpLogger, type OAuthConfig, PaginationConfig, PaginationResult, type ParsedHttpRequest, type ProblemDetails, ProjectInfo, ProjectInsert, ProjectResourceCounts, ProjectSelect, ProjectUpdate, type ResolvedContext, SERVICE_NAME, SERVICE_VERSION, ScopeConfig, TaskInsert, TaskMetadataConfig, TaskSelect, type TemplateContext, TemplateEngine, type TemplateRenderOptions, ToolInsert, ToolMcpConfig, ToolSelect, ToolServerCapabilities, ToolUpdate, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSpanName, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, forceFlushTracer, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraph, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentInGraphContext, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getGlobalTracer, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, handleSpanError, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgentToolRelationsByAgent, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
+ export { TaskState } from './chunk-H2F72PDA.js';
1
2
  import { ContextConfigApiUpdateSchema, validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-DIBIH44H.js';
2
3
  export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-DIBIH44H.js';
3
4
  import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, credentialReferences, ledgerArtifacts, tasks, taskRelations } from './chunk-355CYJ6K.js';
4
5
  export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-355CYJ6K.js';
5
- export { TaskState } from './chunk-H2F72PDA.js';
6
6
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-SVGQSPW4.js';
7
7
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-SVGQSPW4.js';
8
8
  import { __publicField } from './chunk-MKBO26DX.js';
@@ -108,40 +108,6 @@ function configureLogging(config2) {
108
108
 
109
109
  // src/context/ContextConfig.ts
110
110
  var logger = getLogger("context-config");
111
- function createRequestSchema(schemas, config2) {
112
- const schemaConfig = {
113
- schemas,
114
- optional: config2?.optional
115
- };
116
- return {
117
- schemas,
118
- config: schemaConfig,
119
- // Convert all schemas to JSON Schema for storage
120
- toJsonSchema: () => {
121
- const jsonSchemas = {};
122
- if (schemas.body) {
123
- jsonSchemas.body = convertZodToJsonSchema(schemas.body);
124
- }
125
- if (schemas.headers) {
126
- jsonSchemas.headers = convertZodToJsonSchema(schemas.headers);
127
- }
128
- if (schemas.query) {
129
- jsonSchemas.query = convertZodToJsonSchema(schemas.query);
130
- }
131
- if (schemas.params) {
132
- jsonSchemas.params = convertZodToJsonSchema(schemas.params);
133
- }
134
- return {
135
- schemas: jsonSchemas,
136
- optional: schemaConfig.optional
137
- };
138
- },
139
- // Get the Zod schemas for runtime validation
140
- getZodSchemas: () => schemas,
141
- // Get the configuration including optional flags
142
- getConfig: () => schemaConfig
143
- };
144
- }
145
111
  function convertZodToJsonSchema(zodSchema) {
146
112
  try {
147
113
  return z$2.toJSONSchema(zodSchema, { target: "draft-7" });
@@ -170,13 +136,17 @@ var ContextConfigBuilder = class {
170
136
  {
171
137
  requestContextSchema: options.requestContextSchema
172
138
  },
173
- "Converting request schema to JSON Schema for database storage"
139
+ "Converting request headers schema to JSON Schema for database storage"
174
140
  );
175
- if (typeof options.requestContextSchema === "object" && "toJsonSchema" in options.requestContextSchema) {
176
- requestContextSchema = options.requestContextSchema.toJsonSchema();
177
- } else {
178
- requestContextSchema = convertZodToJsonSchema(options.requestContextSchema);
141
+ let schema = options.requestContextSchema;
142
+ if (schema instanceof z$2.ZodObject) {
143
+ schema = schema.loose();
144
+ logger.debug(
145
+ { schemaType: "ZodObject" },
146
+ "Applied .loose() to ZodObject requestContextSchema for more permissive validation"
147
+ );
179
148
  }
149
+ requestContextSchema = convertZodToJsonSchema(schema);
180
150
  }
181
151
  this.config = {
182
152
  id: options.id,
@@ -6265,10 +6235,10 @@ var ContextResolver = class {
6265
6235
  // src/middleware/contextValidation.ts
6266
6236
  var logger7 = getLogger("context-validation");
6267
6237
  var ajv = new Ajv({ allErrors: true, strict: false });
6268
- var HTTP_REQUEST_PARTS = ["body", "headers", "query", "params"];
6238
+ var HTTP_REQUEST_PARTS = ["headers"];
6269
6239
  var schemaCache = /* @__PURE__ */ new Map();
6270
6240
  function isValidHttpRequest(obj) {
6271
- return obj != null && typeof obj === "object" && !Array.isArray(obj) && HTTP_REQUEST_PARTS.some((key) => key in obj);
6241
+ return obj != null && typeof obj === "object" && !Array.isArray(obj) && "headers" in obj;
6272
6242
  }
6273
6243
  function getCachedValidator(schema) {
6274
6244
  const key = JSON.stringify(schema);
@@ -6315,84 +6285,60 @@ function filterByJsonSchema(data, schema) {
6315
6285
  }
6316
6286
  return data;
6317
6287
  }
6318
- function filterContextToSchemaKeys(validatedContext, schemas) {
6319
- const filteredContext = {};
6320
- for (const part of HTTP_REQUEST_PARTS) {
6321
- if (validatedContext[part] && schemas[part]) {
6322
- const schema = schemas[part];
6323
- const partData = validatedContext[part];
6324
- const filteredPart = filterByJsonSchema(partData, schema);
6325
- if (filteredPart !== null && filteredPart !== void 0) {
6326
- if (typeof filteredPart === "object" && Object.keys(filteredPart).length > 0) {
6327
- filteredContext[part] = filteredPart;
6328
- } else if (typeof filteredPart !== "object") {
6329
- filteredContext[part] = filteredPart;
6330
- }
6331
- }
6332
- } else if (validatedContext[part]) {
6333
- filteredContext[part] = validatedContext[part];
6288
+ function filterContextToSchemaKeys(validatedContext, headersSchema) {
6289
+ if (!headersSchema || !validatedContext) {
6290
+ return validatedContext;
6291
+ }
6292
+ const filteredHeaders = filterByJsonSchema(validatedContext, headersSchema);
6293
+ if (filteredHeaders !== null && filteredHeaders !== void 0) {
6294
+ if (typeof filteredHeaders === "object" && Object.keys(filteredHeaders).length > 0) {
6295
+ return filteredHeaders;
6296
+ } else if (typeof filteredHeaders !== "object") {
6297
+ return filteredHeaders;
6334
6298
  }
6335
6299
  }
6336
- return filteredContext;
6300
+ return {};
6337
6301
  }
6338
- function filterLegacyContextToSchemaKeys(validatedContext, jsonSchema) {
6339
- return filterByJsonSchema(validatedContext, jsonSchema);
6340
- }
6341
- function isComprehensiveRequestSchema(schema) {
6342
- return schema && typeof schema === "object" && "schemas" in schema && typeof schema.schemas === "object";
6343
- }
6344
- async function validateHttpRequestParts(comprehensiveSchema, httpRequest) {
6302
+ async function validateHttpRequestHeaders(headersSchema, httpRequest) {
6345
6303
  const errors = [];
6346
- const validatedParts = {};
6304
+ let validatedContext = {};
6347
6305
  if (!isValidHttpRequest(httpRequest)) {
6348
6306
  return {
6349
6307
  valid: false,
6350
6308
  errors: [
6351
6309
  {
6352
6310
  field: "httpRequest",
6353
- message: "Invalid HTTP request format - must contain at least one of: body, headers, query, params"
6311
+ message: "Invalid HTTP request format - must contain headers"
6354
6312
  }
6355
6313
  ]
6356
6314
  };
6357
6315
  }
6358
6316
  try {
6359
- const { schemas, optional = [] } = comprehensiveSchema;
6360
- for (const part of HTTP_REQUEST_PARTS) {
6361
- if (schemas[part] && httpRequest[part] !== void 0) {
6362
- try {
6363
- const partSchema = schemas[part];
6364
- const validate = validationHelper(partSchema);
6365
- const isValid = validate(httpRequest[part]);
6366
- if (isValid) {
6367
- validatedParts[part] = httpRequest[part];
6368
- } else {
6369
- if (validate.errors) {
6370
- for (const error of validate.errors) {
6371
- errors.push({
6372
- field: `${part}.${error.instancePath || "root"}`,
6373
- message: `${part} ${error.message}`,
6374
- value: error.data
6375
- });
6376
- }
6317
+ if (headersSchema && httpRequest.headers !== void 0) {
6318
+ try {
6319
+ const validate = validationHelper(headersSchema);
6320
+ const isValid = validate(httpRequest.headers);
6321
+ if (isValid) {
6322
+ validatedContext = httpRequest.headers;
6323
+ } else {
6324
+ if (validate.errors) {
6325
+ for (const error of validate.errors) {
6326
+ errors.push({
6327
+ field: `headers.${error.instancePath || "root"}`,
6328
+ message: `headers ${error.message}`,
6329
+ value: error.data
6330
+ });
6377
6331
  }
6378
6332
  }
6379
- } catch (validationError) {
6380
- errors.push({
6381
- field: part,
6382
- message: `Failed to validate ${part}: ${validationError instanceof Error ? validationError.message : "Unknown error"}`
6383
- });
6384
- }
6385
- } else if (schemas[part] && httpRequest[part] === void 0) {
6386
- const isPartOptional = optional.includes(part);
6387
- if (!isPartOptional) {
6388
- errors.push({
6389
- field: part,
6390
- message: `Required ${part} is missing`
6391
- });
6392
6333
  }
6334
+ } catch (validationError) {
6335
+ errors.push({
6336
+ field: "headers",
6337
+ message: `Failed to validate headers: ${validationError instanceof Error ? validationError.message : "Unknown error"}`
6338
+ });
6393
6339
  }
6394
6340
  }
6395
- const filteredContext = errors.length === 0 ? filterContextToSchemaKeys(validatedParts, schemas) : void 0;
6341
+ const filteredContext = errors.length === 0 ? filterContextToSchemaKeys(validatedContext, headersSchema) : void 0;
6396
6342
  return {
6397
6343
  valid: errors.length === 0,
6398
6344
  errors,
@@ -6401,14 +6347,14 @@ async function validateHttpRequestParts(comprehensiveSchema, httpRequest) {
6401
6347
  } catch (error) {
6402
6348
  logger7.error(
6403
6349
  { error: error instanceof Error ? error.message : "Unknown error" },
6404
- "Failed to validate comprehensive request schema"
6350
+ "Failed to validate headers schema"
6405
6351
  );
6406
6352
  return {
6407
6353
  valid: false,
6408
6354
  errors: [
6409
6355
  {
6410
6356
  field: "schema",
6411
- message: "Failed to validate comprehensive request schema"
6357
+ message: "Failed to validate headers schema"
6412
6358
  }
6413
6359
  ]
6414
6360
  };
@@ -6481,92 +6427,30 @@ async function validateRequestContext(tenantId, projectId, graphId, conversation
6481
6427
  }
6482
6428
  try {
6483
6429
  const schema = contextConfig2.requestContextSchema;
6484
- if (isComprehensiveRequestSchema(schema)) {
6485
- logger7.debug(
6486
- { contextConfigId: contextConfig2.id },
6487
- "Using comprehensive HTTP request schema validation"
6488
- );
6489
- const httpRequest = parsedRequest;
6490
- const validationResult = await validateHttpRequestParts(schema, httpRequest);
6491
- if (validationResult.valid) {
6492
- return validationResult;
6493
- }
6494
- try {
6495
- return await fetchExistingRequestContext({
6496
- tenantId,
6497
- projectId,
6498
- contextConfig: contextConfig2,
6499
- conversationId,
6500
- dbClient,
6501
- credentialStores
6502
- });
6503
- } catch (_error) {
6504
- validationResult.errors.push({
6505
- field: "requestContext",
6506
- message: "Failed to fetch request context from cache"
6507
- });
6508
- return validationResult;
6509
- }
6510
- } else {
6511
- logger7.debug({ contextConfigId: contextConfig2.id }, "Using legacy JSON schema validation");
6512
- const jsonSchema = schema;
6513
- const validate = validationHelper(jsonSchema);
6514
- const isValid = validate(legacyRequestContext);
6515
- if (isValid) {
6516
- logger7.debug(
6517
- {
6518
- contextConfigId: contextConfig2.id,
6519
- requestContextKeys: Object.keys(legacyRequestContext)
6520
- },
6521
- "Request context validation successful"
6522
- );
6523
- const filteredContext = filterLegacyContextToSchemaKeys(
6524
- legacyRequestContext,
6525
- jsonSchema
6526
- );
6527
- return {
6528
- valid: true,
6529
- errors: [],
6530
- validatedContext: filteredContext
6531
- };
6532
- }
6533
- const errors = [];
6534
- if (validate.errors) {
6535
- for (const error of validate.errors) {
6536
- errors.push({
6537
- field: error.instancePath || error.schemaPath || "root",
6538
- message: `${error.instancePath || "root"} ${error.message}`,
6539
- value: error.data
6540
- });
6541
- }
6542
- }
6543
- logger7.warn(
6544
- {
6545
- contextConfigId: contextConfig2.id,
6546
- legacyRequestContext,
6547
- errors
6548
- },
6549
- "Legacy request context validation failed, trying cache fallback"
6550
- );
6551
- try {
6552
- return await fetchExistingRequestContext({
6553
- tenantId,
6554
- projectId,
6555
- contextConfig: contextConfig2,
6556
- conversationId,
6557
- dbClient,
6558
- credentialStores
6559
- });
6560
- } catch (_error) {
6561
- errors.push({
6562
- field: "requestContext",
6563
- message: "Failed to fetch request context from cache"
6564
- });
6565
- return {
6566
- valid: false,
6567
- errors
6568
- };
6569
- }
6430
+ logger7.debug(
6431
+ { contextConfigId: contextConfig2.id },
6432
+ "Using headers schema validation"
6433
+ );
6434
+ const httpRequest = parsedRequest;
6435
+ const validationResult = await validateHttpRequestHeaders(schema, httpRequest);
6436
+ if (validationResult.valid) {
6437
+ return validationResult;
6438
+ }
6439
+ try {
6440
+ return await fetchExistingRequestContext({
6441
+ tenantId,
6442
+ projectId,
6443
+ contextConfig: contextConfig2,
6444
+ conversationId,
6445
+ dbClient,
6446
+ credentialStores
6447
+ });
6448
+ } catch (_error) {
6449
+ validationResult.errors.push({
6450
+ field: "requestContext",
6451
+ message: "Failed to fetch request context from cache"
6452
+ });
6453
+ return validationResult;
6570
6454
  }
6571
6455
  } catch (error) {
6572
6456
  logger7.error(
@@ -6621,30 +6505,13 @@ function contextValidationMiddleware(dbClient) {
6621
6505
  }
6622
6506
  const body = await c.req.json();
6623
6507
  const conversationId = body.conversationId || "";
6624
- let url;
6625
- try {
6626
- url = new URL(c.req.url);
6627
- } catch (error) {
6628
- logger7.warn(
6629
- { error: error instanceof Error ? error.message : "Unknown error" },
6630
- `Invalid URL: ${c.req.url}`
6631
- );
6632
- return c.json({ error: "Invalid request URL" }, 400);
6633
- }
6634
- const query = {};
6635
- for (const [key, value] of url.searchParams) {
6636
- query[key] = value;
6637
- }
6638
6508
  const headers = {};
6639
6509
  c.req.raw.headers.forEach((value, key) => {
6640
6510
  headers[key.toLowerCase()] = value;
6641
6511
  });
6642
6512
  const credentialStores = c.get("credentialStores");
6643
6513
  const parsedRequest = {
6644
- body: body || {},
6645
- headers,
6646
- query,
6647
- params: c.req.param() || {}
6514
+ headers
6648
6515
  };
6649
6516
  const validationResult = await validateRequestContext(
6650
6517
  tenantId,
@@ -6653,9 +6520,7 @@ function contextValidationMiddleware(dbClient) {
6653
6520
  conversationId,
6654
6521
  parsedRequest,
6655
6522
  dbClient,
6656
- credentialStores,
6657
- body.requestContext
6658
- );
6523
+ credentialStores);
6659
6524
  if (!validationResult.valid) {
6660
6525
  logger7.warn(
6661
6526
  {
@@ -7805,4 +7670,4 @@ function createDefaultCredentialStores() {
7805
7670
  return stores;
7806
7671
  }
7807
7672
 
7808
- export { BASE, ConsoleLogger, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, NoOpLogger, SERVICE_NAME, SERVICE_VERSION, TemplateEngine, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createRequestSchema, createSpanName, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, forceFlushTracer, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraph, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentInGraphContext, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getGlobalTracer, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, handleSpanError, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isComprehensiveRequestSchema, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgentToolRelationsByAgent, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestParts, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
7673
+ export { BASE, ConsoleLogger, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, NoOpLogger, SERVICE_NAME, SERVICE_VERSION, TemplateEngine, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSpanName, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, forceFlushTracer, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraph, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentInGraphContext, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getGlobalTracer, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, handleSpanError, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgentToolRelationsByAgent, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };