@inkeep/agents-core 0.37.0 → 0.37.1

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.
Files changed (44) hide show
  1. package/dist/auth/auth-schema.js +1 -1
  2. package/dist/auth/auth-validation-schemas.js +18 -18
  3. package/dist/auth/auth.d.ts +3 -3
  4. package/dist/auth/auth.js +5 -4
  5. package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
  6. package/dist/{chunk-SSRRHYU4.js → chunk-7GZHUB4J.js} +4 -5
  7. package/dist/chunk-CMNLBV2A.js +39 -0
  8. package/dist/{chunk-MB2ZIPZS.js → chunk-FOK3JSQN.js} +5 -5
  9. package/dist/{chunk-SG75RA63.js → chunk-I6IF7ZTL.js} +2 -2
  10. package/dist/{chunk-VQXQOGJU.js → chunk-K6GMXJPW.js} +313 -315
  11. package/dist/{chunk-Q5U2SVA6.js → chunk-LL6F3EAR.js} +11 -7
  12. package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
  13. package/dist/{chunk-NFYCSHD3.js → chunk-PVRIMF6N.js} +2 -1
  14. package/dist/{chunk-ICZLNCX7.js → chunk-ROXPFQAM.js} +367 -69
  15. package/dist/{chunk-32YRH2S7.js → chunk-W3QDM7WH.js} +63 -67
  16. package/dist/{chunk-SLQW43IV.js → chunk-ZEZCCHV7.js} +4 -5
  17. package/dist/{client-CnpNkGsH.d.ts → client-B_3j-V4-.d.ts} +1 -1
  18. package/dist/client-exports.d.ts +6 -3
  19. package/dist/client-exports.js +126 -127
  20. package/dist/constants/schema-validation/index.js +1 -1
  21. package/dist/credential-stores/index.d.ts +3 -3
  22. package/dist/credential-stores/index.js +1 -1
  23. package/dist/db/schema.d.ts +2 -2
  24. package/dist/db/schema.js +2 -2
  25. package/dist/db/test-client.d.ts +3 -3
  26. package/dist/db/test-client.js +1 -1
  27. package/dist/index.d.ts +126 -9
  28. package/dist/index.js +284 -73
  29. package/dist/{schema-Cgkp_geg.d.ts → schema-DKbG39on.d.ts} +24 -1
  30. package/dist/server-BXoUiBMg.d.ts +127 -0
  31. package/dist/types/index.d.ts +33 -113
  32. package/dist/types/index.js +1 -1
  33. package/dist/{utility-C_tTZ7-k.d.ts → utility-Lo5NoRHK.d.ts} +141 -11
  34. package/dist/utils/schema-conversion.js +1 -1
  35. package/dist/validation/index.d.ts +2 -2
  36. package/dist/validation/index.js +2 -2
  37. package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
  38. package/drizzle/meta/0001_snapshot.json +7 -1
  39. package/drizzle/meta/_journal.json +2 -2
  40. package/package.json +14 -4
  41. package/dist/chunk-CUM6BY2Y.js +0 -320
  42. package/dist/chunk-H2F72PDA.js +0 -15
  43. package/dist/chunk-OUXC23J7.js +0 -12534
  44. /package/dist/{chunk-NOPEANIU.js → chunk-NFTJ5JBY.js} +0 -0
package/dist/index.js CHANGED
@@ -1,32 +1,32 @@
1
- export { cleanupTestDatabase, closeTestDatabase, createTestDatabaseClient, createTestOrganization, createTestProject } from './chunk-SG75RA63.js';
2
- import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-32YRH2S7.js';
3
- export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-32YRH2S7.js';
4
- export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS } from './chunk-SLQW43IV.js';
5
- export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE } from './chunk-TGESM3JG.js';
6
- import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-VQXQOGJU.js';
7
- export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, validatePropsAsJsonSchema } from './chunk-VQXQOGJU.js';
8
- import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, subAgentTeamAgentRelations, agents, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-NFYCSHD3.js';
9
- export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-NFYCSHD3.js';
1
+ export { cleanupTestDatabase, closeTestDatabase, createTestDatabaseClient, createTestOrganization, createTestProject } from './chunk-I6IF7ZTL.js';
2
+ import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-W3QDM7WH.js';
3
+ export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-W3QDM7WH.js';
4
+ export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS } from './chunk-ZEZCCHV7.js';
5
+ export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE } from './chunk-MQMMFK2K.js';
6
+ import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-K6GMXJPW.js';
7
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectResponse, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentArrayResponse, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationListResponse, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentArrayResponse, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionResponse, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPCatalogListResponse, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolListResponse, McpToolResponse, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, PrebuiltMCPServerSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoListResponse, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationListResponse, SubAgentExternalAgentRelationResponse, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationListResponse, SubAgentTeamAgentRelationResponse, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ThirdPartyMCPServerResponse, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, validatePropsAsJsonSchema } from './chunk-K6GMXJPW.js';
8
+ import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, agents, subAgentTeamAgentRelations, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-PVRIMF6N.js';
9
+ export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-PVRIMF6N.js';
10
10
  export { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
11
- import { getTracer, getCredentialStoreLookupKeyFromRetrievalParams, generateId, normalizeDateString, isThirdPartyMCPServerAuthenticated, createApiError, generateApiKey, extractPublicId, validateApiKey, isApiKeyExpired, getConversationId, setSpanWithError, getRequestExecutionContext, McpClient } from './chunk-ICZLNCX7.js';
12
- export { CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ERROR_DOCS_BASE_URL, ErrorCode, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, createExecutionContext, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, extractComposioServerId, extractPublicId, fetchComposioServers, fetchSingleComposioServer, generateApiKey, generateId, generateServiceToken, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getRequestExecutionContext, getTracer, handleApiError, hashApiKey, isApiKeyExpired, isComposioMCPServerAuthenticated, isThirdPartyMCPServerAuthenticated, maskApiKey, normalizeDateString, problemDetailsSchema, setSpanWithError, signTempToken, validateApiKey, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken, verifyTempToken } from './chunk-ICZLNCX7.js';
13
- import { convertZodToJsonSchema } from './chunk-SSRRHYU4.js';
14
- export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from './chunk-SSRRHYU4.js';
15
- import { loadEnvironmentFiles, env } from './chunk-Q5U2SVA6.js';
16
- export { loadEnvironmentFiles } from './chunk-Q5U2SVA6.js';
11
+ export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-7CLFCY6J.js';
12
+ export { CredentialStoreRegistry, InMemoryCredentialStore, KeyChainStore, NangoCredentialStore, createDefaultCredentialStores, createKeyChainStore, createNangoCredentialStore } from './chunk-FOK3JSQN.js';
13
+ import { getTracer, getCredentialStoreLookupKeyFromRetrievalParams, generateId, toISODateString, isThirdPartyMCPServerAuthenticated, createApiError, generateApiKey, extractPublicId, validateApiKey, isApiKeyExpired, getConversationId, setSpanWithError, getRequestExecutionContext, McpClient } from './chunk-ROXPFQAM.js';
14
+ export { CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ERROR_DOCS_BASE_URL, ErrorCode, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, ModelFactory, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, createExecutionContext, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, extractComposioServerId, extractPublicId, fetchComposioServers, fetchSingleComposioServer, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateId, generateServiceToken, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getRequestExecutionContext, getTracer, handleApiError, hashApiKey, isApiKeyExpired, isComposioMCPServerAuthenticated, isThirdPartyMCPServerAuthenticated, maskApiKey, normalizeDateString, problemDetailsSchema, setSpanWithError, signTempToken, toISODateString, validateApiKey, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken, verifyTempToken } from './chunk-ROXPFQAM.js';
15
+ import { convertZodToJsonSchema } from './chunk-7GZHUB4J.js';
16
+ export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from './chunk-7GZHUB4J.js';
17
+ import { loadEnvironmentFiles, env } from './chunk-LL6F3EAR.js';
18
+ export { loadEnvironmentFiles } from './chunk-LL6F3EAR.js';
17
19
  import { detectAuthenticationRequired } from './chunk-4JZT4QEE.js';
18
20
  export { detectAuthenticationRequired, exchangeMcpAuthorizationCode, initiateMcpOAuthFlow } from './chunk-4JZT4QEE.js';
19
- import { organization, member, invitation, user } from './chunk-NOPEANIU.js';
20
- export { account, invitation, member, organization, session, ssoProvider, user, verification } from './chunk-NOPEANIU.js';
21
- export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-7CLFCY6J.js';
22
- export { CredentialStoreRegistry, InMemoryCredentialStore, KeyChainStore, NangoCredentialStore, createDefaultCredentialStores, createKeyChainStore, createNangoCredentialStore } from './chunk-MB2ZIPZS.js';
23
21
  import { getLogger } from './chunk-DN4B564Y.js';
24
22
  export { PinoLogger, getLogger, loggerFactory } from './chunk-DN4B564Y.js';
25
- export { TaskState } from './chunk-H2F72PDA.js';
23
+ export { TaskState, normalizeToolSelections } from './chunk-CMNLBV2A.js';
26
24
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
27
25
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-YFHT5M2R.js';
28
- import { external_exports } from './chunk-OUXC23J7.js';
26
+ import { organization, member, invitation, user } from './chunk-NFTJ5JBY.js';
27
+ export { account, invitation, member, organization, session, ssoProvider, user, verification } from './chunk-NFTJ5JBY.js';
29
28
  import { __commonJS, __require } from './chunk-SIAA4J6H.js';
29
+ import { z } from 'zod';
30
30
  import jmespath from 'jmespath';
31
31
  import { drizzle } from 'drizzle-orm/node-postgres';
32
32
  import { Pool } from 'pg';
@@ -2492,7 +2492,7 @@ var require_typescript = __commonJS({
2492
2492
  affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations,
2493
2493
  allKeysStartWithDot: () => allKeysStartWithDot,
2494
2494
  altDirectorySeparator: () => altDirectorySeparator,
2495
- and: () => and24,
2495
+ and: () => and23,
2496
2496
  append: () => append,
2497
2497
  appendIfUnique: () => appendIfUnique,
2498
2498
  arrayFrom: () => arrayFrom,
@@ -5943,7 +5943,7 @@ var require_typescript = __commonJS({
5943
5943
  function isPatternMatch({ prefix, suffix }, candidate) {
5944
5944
  return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix);
5945
5945
  }
5946
- function and24(f, g) {
5946
+ function and23(f, g) {
5947
5947
  return (arg) => f(arg) && g(arg);
5948
5948
  }
5949
5949
  function or(...fs) {
@@ -56938,7 +56938,7 @@ ${lanes.join("\n")}
56938
56938
  SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback";
56939
56939
  return SignatureCheckMode3;
56940
56940
  })(SignatureCheckMode || {});
56941
- var isNotOverloadAndNotAccessor = and24(isNotOverload, isNotAccessor);
56941
+ var isNotOverloadAndNotAccessor = and23(isNotOverload, isNotAccessor);
56942
56942
  var intrinsicTypeKinds = new Map(Object.entries({
56943
56943
  Uppercase: 0,
56944
56944
  Lowercase: 1,
@@ -99749,7 +99749,7 @@ ${lanes.join("\n")}
99749
99749
  if (flags & (1920 | 384)) {
99750
99750
  return;
99751
99751
  }
99752
- const exportedDeclarationsCount = countWhere(declarations, and24(isNotOverloadAndNotAccessor, not2(isInterfaceDeclaration)));
99752
+ const exportedDeclarationsCount = countWhere(declarations, and23(isNotOverloadAndNotAccessor, not2(isInterfaceDeclaration)));
99753
99753
  if (flags & 524288 && exportedDeclarationsCount <= 2) {
99754
99754
  return;
99755
99755
  }
@@ -170537,7 +170537,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
170537
170537
  const maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker);
170538
170538
  const implementedType = checker.getTypeAtLocation(implementedTypeNode);
170539
170539
  const implementedTypeSymbols = checker.getPropertiesOfType(implementedType);
170540
- const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and24(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName)));
170540
+ const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and23(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName)));
170541
170541
  const classType = checker.getTypeAtLocation(classDeclaration);
170542
170542
  const constructor = find(classDeclaration.members, (m) => isConstructorDeclaration(m));
170543
170543
  if (!classType.getNumberIndexType()) {
@@ -185194,8 +185194,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
185194
185194
  function isAmbientModuleDeclaration(node) {
185195
185195
  return node.kind === 268 && node.name.kind === 11;
185196
185196
  }
185197
- function isExternalModuleImportEquals(eq25) {
185198
- return eq25.moduleReference.kind === 284 && eq25.moduleReference.expression.kind === 11;
185197
+ function isExternalModuleImportEquals(eq24) {
185198
+ return eq24.moduleReference.kind === 284 && eq24.moduleReference.expression.kind === 11;
185199
185199
  }
185200
185200
  var DefinitionKind = /* @__PURE__ */ ((DefinitionKind2) => {
185201
185201
  DefinitionKind2[DefinitionKind2["Symbol"] = 0] = "Symbol";
@@ -197827,7 +197827,7 @@ ${options.prefix}` : "\n" : options.prefix
197827
197827
  affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations,
197828
197828
  allKeysStartWithDot: () => allKeysStartWithDot,
197829
197829
  altDirectorySeparator: () => altDirectorySeparator,
197830
- and: () => and24,
197830
+ and: () => and23,
197831
197831
  append: () => append,
197832
197832
  appendIfUnique: () => appendIfUnique,
197833
197833
  arrayFrom: () => arrayFrom,
@@ -212870,8 +212870,6 @@ async function apiFetch(url, options = {}) {
212870
212870
  headers: headers2
212871
212871
  });
212872
212872
  }
212873
-
212874
- // src/context/ContextConfig.ts
212875
212873
  var logger = getLogger("context-config");
212876
212874
  var HeadersSchemaBuilder = class {
212877
212875
  schema;
@@ -213026,7 +213024,7 @@ var ContextConfigBuilder = class {
213026
213024
  });
213027
213025
  return { valid: true, errors: [] };
213028
213026
  } catch (error) {
213029
- if (error instanceof external_exports.ZodError) {
213027
+ if (error instanceof z.ZodError) {
213030
213028
  return {
213031
213029
  valid: false,
213032
213030
  errors: error.issues.map((e) => `${e.path.join(".")}: ${e.message}`)
@@ -214716,7 +214714,8 @@ var createAgentToolRelation = (db) => async (params) => {
214716
214714
  subAgentId: params.data.subAgentId,
214717
214715
  toolId: params.data.toolId,
214718
214716
  selectedTools: params.data.selectedTools,
214719
- headers: params.data.headers
214717
+ headers: params.data.headers,
214718
+ toolPolicies: params.data.toolPolicies
214720
214719
  }).returning();
214721
214720
  return relation[0];
214722
214721
  };
@@ -214862,6 +214861,7 @@ var getToolsForAgent = (db) => async (params) => {
214862
214861
  toolId: subAgentToolRelations.toolId,
214863
214862
  selectedTools: subAgentToolRelations.selectedTools,
214864
214863
  headers: subAgentToolRelations.headers,
214864
+ toolPolicies: subAgentToolRelations.toolPolicies,
214865
214865
  createdAt: subAgentToolRelations.createdAt,
214866
214866
  updatedAt: subAgentToolRelations.updatedAt,
214867
214867
  tool: {
@@ -214922,6 +214922,7 @@ var getAgentsForTool = (db) => async (params) => {
214922
214922
  toolId: subAgentToolRelations.toolId,
214923
214923
  selectedTools: subAgentToolRelations.selectedTools,
214924
214924
  headers: subAgentToolRelations.headers,
214925
+ toolPolicies: subAgentToolRelations.toolPolicies,
214925
214926
  createdAt: subAgentToolRelations.createdAt,
214926
214927
  updatedAt: subAgentToolRelations.updatedAt,
214927
214928
  subAgent: {
@@ -215073,7 +215074,28 @@ var upsertSubAgent = (db) => async (params) => {
215073
215074
  }
215074
215075
  return await createSubAgent(db)(params.data);
215075
215076
  };
215077
+ var SubAgentIsDefaultError = class extends Error {
215078
+ constructor(subAgentId, agentId) {
215079
+ super(
215080
+ `Cannot delete sub-agent "${subAgentId}" because it is set as the default sub-agent for agent "${agentId}". Please change the default sub-agent before deleting.`
215081
+ );
215082
+ this.subAgentId = subAgentId;
215083
+ this.agentId = agentId;
215084
+ this.name = "SubAgentIsDefaultError";
215085
+ }
215086
+ };
215076
215087
  var deleteSubAgent = (db) => async (params) => {
215088
+ const agentUsingAsDefault = await db.select().from(agents).where(
215089
+ and(
215090
+ eq(agents.tenantId, params.scopes.tenantId),
215091
+ eq(agents.projectId, params.scopes.projectId),
215092
+ eq(agents.id, params.scopes.agentId),
215093
+ eq(agents.defaultSubAgentId, params.subAgentId)
215094
+ )
215095
+ ).limit(1);
215096
+ if (agentUsingAsDefault.length > 0) {
215097
+ throw new SubAgentIsDefaultError(params.subAgentId, params.scopes.agentId);
215098
+ }
215077
215099
  await db.delete(subAgents).where(
215078
215100
  and(
215079
215101
  eq(subAgents.tenantId, params.scopes.tenantId),
@@ -215660,8 +215682,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215660
215682
  availableTools: [],
215661
215683
  capabilities: capabilities || void 0,
215662
215684
  credentialReferenceId: credentialReferenceId || void 0,
215663
- createdAt: new Date(normalizeDateString(createdAt)),
215664
- updatedAt: new Date(normalizeDateString(dbResult.updatedAt)),
215685
+ createdAt: toISODateString(createdAt),
215686
+ updatedAt: toISODateString(dbResult.updatedAt),
215665
215687
  lastError: null,
215666
215688
  headers: headers2 || void 0,
215667
215689
  imageUrl: imageUrl || void 0,
@@ -215690,12 +215712,12 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215690
215712
  if (credentialStore.type === CredentialStoreType.nango) {
215691
215713
  const nangoCredentialData = JSON.parse(credentialDataString);
215692
215714
  if (nangoCredentialData.expiresAt) {
215693
- expiresAt = nangoCredentialData.expiresAt;
215715
+ expiresAt = toISODateString(nangoCredentialData.expiresAt);
215694
215716
  }
215695
215717
  } else if (credentialStore.type === CredentialStoreType.keychain) {
215696
215718
  const oauthTokens = JSON.parse(credentialDataString);
215697
215719
  if (oauthTokens.expires_at) {
215698
- expiresAt = new Date(normalizeDateString(oauthTokens.expires_at));
215720
+ expiresAt = toISODateString(oauthTokens.expires_at);
215699
215721
  }
215700
215722
  }
215701
215723
  }
@@ -215745,8 +215767,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215745
215767
  availableTools,
215746
215768
  capabilities: capabilities || void 0,
215747
215769
  credentialReferenceId: credentialReferenceId || void 0,
215748
- createdAt: new Date(normalizeDateString(createdAt)),
215749
- updatedAt: new Date(now),
215770
+ createdAt: toISODateString(createdAt),
215771
+ updatedAt: toISODateString(now),
215750
215772
  expiresAt,
215751
215773
  lastError: lastErrorComputed,
215752
215774
  headers: headers2 || void 0,
@@ -215828,6 +215850,7 @@ var addToolToAgent = (db) => async (params) => {
215828
215850
  toolId: params.toolId,
215829
215851
  selectedTools: params.selectedTools,
215830
215852
  headers: params.headers,
215853
+ toolPolicies: params.toolPolicies,
215831
215854
  createdAt: now,
215832
215855
  updatedAt: now
215833
215856
  }).returning();
@@ -215854,7 +215877,8 @@ var upsertSubAgentToolRelation = (db) => async (params) => {
215854
215877
  subAgentId: params.subAgentId,
215855
215878
  toolId: params.toolId,
215856
215879
  selectedTools: params.selectedTools,
215857
- headers: params.headers
215880
+ headers: params.headers,
215881
+ toolPolicies: params.toolPolicies
215858
215882
  }
215859
215883
  });
215860
215884
  }
@@ -216108,6 +216132,7 @@ var getFullAgentDefinition = (db) => async ({
216108
216132
  imageUrl: tools.imageUrl,
216109
216133
  selectedTools: subAgentToolRelations.selectedTools,
216110
216134
  headers: subAgentToolRelations.headers,
216135
+ toolPolicies: subAgentToolRelations.toolPolicies,
216111
216136
  agentToolRelationId: subAgentToolRelations.id
216112
216137
  }).from(subAgentToolRelations).innerJoin(
216113
216138
  tools,
@@ -216171,15 +216196,18 @@ var getFullAgentDefinition = (db) => async ({
216171
216196
  agentToolRelationId: tool.agentToolRelationId,
216172
216197
  toolId: tool.id,
216173
216198
  toolSelection: tool.selectedTools || null,
216174
- headers: tool.headers || null
216199
+ headers: tool.headers || null,
216200
+ toolPolicies: tool.toolPolicies || null
216175
216201
  }));
216176
216202
  const functionToolCanUse = agentFunctionTools.map((tool) => ({
216177
216203
  agentToolRelationId: tool.agentToolRelationId,
216178
216204
  toolId: tool.id,
216179
216205
  toolSelection: null,
216180
216206
  // Function tools don't have tool selection
216181
- headers: null
216207
+ headers: null,
216182
216208
  // Function tools don't have headers
216209
+ toolPolicies: null
216210
+ // Function tools don't have tool policies (yet)
216183
216211
  }));
216184
216212
  const canUse = [...mcpToolCanUse, ...functionToolCanUse];
216185
216213
  return {
@@ -217255,7 +217283,7 @@ var createFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217255
217283
  agentToolPromises.push(
217256
217284
  (async () => {
217257
217285
  try {
217258
- const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
217286
+ const { toolId, toolSelection, headers: headers2, toolPolicies, agentToolRelationId } = canUseItem;
217259
217287
  const isFunctionTool = typed.functionTools && toolId in typed.functionTools;
217260
217288
  logger10.info(
217261
217289
  {
@@ -217287,6 +217315,7 @@ var createFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217287
217315
  toolId,
217288
217316
  selectedTools: toolSelection || void 0,
217289
217317
  headers: headers2 || void 0,
217318
+ toolPolicies: toolPolicies || void 0,
217290
217319
  relationId: agentToolRelationId
217291
217320
  });
217292
217321
  logger10.info(
@@ -217996,7 +218025,7 @@ var updateFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217996
218025
  subAgentToolPromises.push(
217997
218026
  (async () => {
217998
218027
  try {
217999
- const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
218028
+ const { toolId, toolSelection, headers: headers2, toolPolicies, agentToolRelationId } = canUseItem;
218000
218029
  const isFunctionTool = typedAgentDefinition.functionTools && toolId in typedAgentDefinition.functionTools;
218001
218030
  if (isFunctionTool) {
218002
218031
  logger10.info(
@@ -218021,6 +218050,7 @@ var updateFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
218021
218050
  toolId,
218022
218051
  selectedTools: toolSelection || void 0,
218023
218052
  headers: headers2 || void 0,
218053
+ toolPolicies: toolPolicies || void 0,
218024
218054
  relationId: agentToolRelationId
218025
218055
  });
218026
218056
  logger10.info(
@@ -219257,12 +219287,7 @@ var getPendingInvitationsByEmail = (db) => async (email) => {
219257
219287
  status: invitation.status,
219258
219288
  expiresAt: invitation.expiresAt,
219259
219289
  inviterId: invitation.inviterId
219260
- }).from(invitation).leftJoin(organization, eq(invitation.organizationId, organization.id)).where(
219261
- and(
219262
- eq(invitation.email, email),
219263
- eq(invitation.status, "pending")
219264
- )
219265
- );
219290
+ }).from(invitation).leftJoin(organization, eq(invitation.organizationId, organization.id)).where(and(eq(invitation.email, email), eq(invitation.status, "pending")));
219266
219291
  return result.filter((inv) => new Date(inv.expiresAt) > now);
219267
219292
  };
219268
219293
  var addUserToOrganization = (db) => async (data) => {
@@ -220165,6 +220190,203 @@ var updateFullProjectServerSide = (db, logger10 = defaultLogger2) => async (scop
220165
220190
  "All project artifactComponents updated successfully"
220166
220191
  );
220167
220192
  }
220193
+ const incomingToolIds = new Set(Object.keys(typed.tools || {}));
220194
+ const existingToolsResult = await listTools(db)({
220195
+ scopes: { tenantId, projectId: typed.id },
220196
+ pagination: { page: 1, limit: 1e3 }
220197
+ });
220198
+ const existingTools = existingToolsResult.data;
220199
+ let deletedToolCount = 0;
220200
+ for (const tool of existingTools) {
220201
+ if (!incomingToolIds.has(tool.id)) {
220202
+ try {
220203
+ await deleteTool(db)({
220204
+ toolId: tool.id,
220205
+ scopes: { tenantId, projectId: typed.id }
220206
+ });
220207
+ deletedToolCount++;
220208
+ logger10.info({ toolId: tool.id }, "Deleted orphaned tool from project");
220209
+ } catch (error) {
220210
+ logger10.error({ toolId: tool.id, error }, "Failed to delete orphaned tool from project");
220211
+ }
220212
+ }
220213
+ }
220214
+ if (deletedToolCount > 0) {
220215
+ logger10.info(
220216
+ {
220217
+ deletedToolCount,
220218
+ projectId: typed.id
220219
+ },
220220
+ "Deleted orphaned tools from project"
220221
+ );
220222
+ }
220223
+ const incomingFunctionIds = new Set(Object.keys(typed.functions || {}));
220224
+ const existingFunctions = await listFunctions(db)({
220225
+ scopes: { tenantId, projectId: typed.id }
220226
+ });
220227
+ let deletedFunctionCount = 0;
220228
+ for (const func of existingFunctions) {
220229
+ if (!incomingFunctionIds.has(func.id)) {
220230
+ try {
220231
+ await deleteFunction(db)({
220232
+ functionId: func.id,
220233
+ scopes: { tenantId, projectId: typed.id }
220234
+ });
220235
+ deletedFunctionCount++;
220236
+ logger10.info({ functionId: func.id }, "Deleted orphaned function from project");
220237
+ } catch (error) {
220238
+ logger10.error(
220239
+ { functionId: func.id, error },
220240
+ "Failed to delete orphaned function from project"
220241
+ );
220242
+ }
220243
+ }
220244
+ }
220245
+ if (deletedFunctionCount > 0) {
220246
+ logger10.info(
220247
+ {
220248
+ deletedFunctionCount,
220249
+ projectId: typed.id
220250
+ },
220251
+ "Deleted orphaned functions from project"
220252
+ );
220253
+ }
220254
+ const incomingCredentialReferenceIds = new Set(Object.keys(typed.credentialReferences || {}));
220255
+ const existingCredentialReferences = await listCredentialReferences(db)({
220256
+ scopes: { tenantId, projectId: typed.id }
220257
+ });
220258
+ let deletedCredentialReferenceCount = 0;
220259
+ for (const credRef of existingCredentialReferences) {
220260
+ if (!incomingCredentialReferenceIds.has(credRef.id)) {
220261
+ try {
220262
+ await deleteCredentialReference(db)({
220263
+ id: credRef.id,
220264
+ scopes: { tenantId, projectId: typed.id }
220265
+ });
220266
+ deletedCredentialReferenceCount++;
220267
+ logger10.info(
220268
+ { credentialReferenceId: credRef.id },
220269
+ "Deleted orphaned credentialReference from project"
220270
+ );
220271
+ } catch (error) {
220272
+ logger10.error(
220273
+ { credentialReferenceId: credRef.id, error },
220274
+ "Failed to delete orphaned credentialReference from project"
220275
+ );
220276
+ }
220277
+ }
220278
+ }
220279
+ if (deletedCredentialReferenceCount > 0) {
220280
+ logger10.info(
220281
+ {
220282
+ deletedCredentialReferenceCount,
220283
+ projectId: typed.id
220284
+ },
220285
+ "Deleted orphaned credentialReferences from project"
220286
+ );
220287
+ }
220288
+ const incomingExternalAgentIds = new Set(Object.keys(typed.externalAgents || {}));
220289
+ const existingExternalAgents = await listExternalAgents(db)({
220290
+ scopes: { tenantId, projectId: typed.id }
220291
+ });
220292
+ let deletedExternalAgentCount = 0;
220293
+ for (const extAgent of existingExternalAgents) {
220294
+ if (!incomingExternalAgentIds.has(extAgent.id)) {
220295
+ try {
220296
+ await deleteExternalAgent(db)({
220297
+ externalAgentId: extAgent.id,
220298
+ scopes: { tenantId, projectId: typed.id }
220299
+ });
220300
+ deletedExternalAgentCount++;
220301
+ logger10.info(
220302
+ { externalAgentId: extAgent.id },
220303
+ "Deleted orphaned externalAgent from project"
220304
+ );
220305
+ } catch (error) {
220306
+ logger10.error(
220307
+ { externalAgentId: extAgent.id, error },
220308
+ "Failed to delete orphaned externalAgent from project"
220309
+ );
220310
+ }
220311
+ }
220312
+ }
220313
+ if (deletedExternalAgentCount > 0) {
220314
+ logger10.info(
220315
+ {
220316
+ deletedExternalAgentCount,
220317
+ projectId: typed.id
220318
+ },
220319
+ "Deleted orphaned externalAgents from project"
220320
+ );
220321
+ }
220322
+ const incomingDataComponentIds = new Set(Object.keys(typed.dataComponents || {}));
220323
+ const existingDataComponents = await listDataComponents(db)({
220324
+ scopes: { tenantId, projectId: typed.id }
220325
+ });
220326
+ let deletedDataComponentCount = 0;
220327
+ for (const dataComp of existingDataComponents) {
220328
+ if (!incomingDataComponentIds.has(dataComp.id)) {
220329
+ try {
220330
+ await deleteDataComponent(db)({
220331
+ dataComponentId: dataComp.id,
220332
+ scopes: { tenantId, projectId: typed.id }
220333
+ });
220334
+ deletedDataComponentCount++;
220335
+ logger10.info(
220336
+ { dataComponentId: dataComp.id },
220337
+ "Deleted orphaned dataComponent from project"
220338
+ );
220339
+ } catch (error) {
220340
+ logger10.error(
220341
+ { dataComponentId: dataComp.id, error },
220342
+ "Failed to delete orphaned dataComponent from project"
220343
+ );
220344
+ }
220345
+ }
220346
+ }
220347
+ if (deletedDataComponentCount > 0) {
220348
+ logger10.info(
220349
+ {
220350
+ deletedDataComponentCount,
220351
+ projectId: typed.id
220352
+ },
220353
+ "Deleted orphaned dataComponents from project"
220354
+ );
220355
+ }
220356
+ const incomingArtifactComponentIds = new Set(Object.keys(typed.artifactComponents || {}));
220357
+ const existingArtifactComponents = await listArtifactComponents(db)({
220358
+ scopes: { tenantId, projectId: typed.id }
220359
+ });
220360
+ let deletedArtifactComponentCount = 0;
220361
+ for (const artifactComp of existingArtifactComponents) {
220362
+ if (!incomingArtifactComponentIds.has(artifactComp.id)) {
220363
+ try {
220364
+ await deleteArtifactComponent(db)({
220365
+ id: artifactComp.id,
220366
+ scopes: { tenantId, projectId: typed.id }
220367
+ });
220368
+ deletedArtifactComponentCount++;
220369
+ logger10.info(
220370
+ { artifactComponentId: artifactComp.id },
220371
+ "Deleted orphaned artifactComponent from project"
220372
+ );
220373
+ } catch (error) {
220374
+ logger10.error(
220375
+ { artifactComponentId: artifactComp.id, error },
220376
+ "Failed to delete orphaned artifactComponent from project"
220377
+ );
220378
+ }
220379
+ }
220380
+ }
220381
+ if (deletedArtifactComponentCount > 0) {
220382
+ logger10.info(
220383
+ {
220384
+ deletedArtifactComponentCount,
220385
+ projectId: typed.id
220386
+ },
220387
+ "Deleted orphaned artifactComponents from project"
220388
+ );
220389
+ }
220168
220390
  const incomingAgentIds = new Set(Object.keys(typed.agents || {}));
220169
220391
  const existingAgents = await listAgents(db)({
220170
220392
  scopes: { tenantId, projectId: typed.id }
@@ -220409,34 +220631,23 @@ var getFullProject = (db, logger10 = defaultLogger2) => async (params) => {
220409
220631
  }
220410
220632
  const projectFunctions = {};
220411
220633
  try {
220412
- const functionToolsWithFunctions = await db.select({
220413
- functionToolId: functionTools.id,
220414
- functionToolName: functionTools.name,
220415
- functionToolDescription: functionTools.description,
220416
- functionId: functions.id,
220417
- inputSchema: functions.inputSchema,
220418
- executeCode: functions.executeCode,
220419
- dependencies: functions.dependencies
220420
- }).from(functionTools).innerJoin(functions, eq(functionTools.functionId, functions.id)).where(and(eq(functionTools.tenantId, tenantId), eq(functionTools.projectId, projectId)));
220421
- for (const item of functionToolsWithFunctions) {
220422
- projectFunctions[item.functionToolId] = {
220423
- id: item.functionId,
220424
- name: item.functionToolName,
220425
- description: item.functionToolDescription,
220426
- inputSchema: item.inputSchema,
220427
- executeCode: item.executeCode,
220428
- dependencies: item.dependencies
220634
+ const functionsList = await listFunctions(db)({
220635
+ scopes: { tenantId, projectId }
220636
+ });
220637
+ for (const func of functionsList) {
220638
+ projectFunctions[func.id] = {
220639
+ id: func.id,
220640
+ inputSchema: func.inputSchema,
220641
+ executeCode: func.executeCode,
220642
+ dependencies: func.dependencies
220429
220643
  };
220430
220644
  }
220431
220645
  logger10.info(
220432
220646
  { tenantId, projectId, functionCount: Object.keys(projectFunctions).length },
220433
- "Function tools with function data retrieved for project"
220647
+ "Functions retrieved for project"
220434
220648
  );
220435
220649
  } catch (error) {
220436
- logger10.warn(
220437
- { tenantId, projectId, error },
220438
- "Failed to retrieve function tools for project"
220439
- );
220650
+ logger10.warn({ tenantId, projectId, error }, "Failed to retrieve functions for project");
220440
220651
  }
220441
220652
  const agents2 = {};
220442
220653
  if (agentList.length > 0) {
@@ -222058,4 +222269,4 @@ typescript/lib/typescript.js:
222058
222269
  ***************************************************************************** *)
222059
222270
  */
222060
222271
 
222061
- export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStuffer, HTTP_REQUEST_PARTS, TemplateEngine, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, determineContextTrigger, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getUserByEmail, getUserById, getUserOrganizations, getVisibleMessages, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateHeaders, validateHttpRequestHeaders, validateProjectExists, validateSubAgent, validationHelper, withProjectValidation };
222272
+ export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStuffer, HTTP_REQUEST_PARTS, SubAgentIsDefaultError, TemplateEngine, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, addUserToOrganization, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createMessage, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, determineContextTrigger, externalAgentExists, externalAgentUrlExists, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getPendingInvitationsByEmail, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getUserByEmail, getUserById, getUserOrganizations, getVisibleMessages, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateHeaders, validateHttpRequestHeaders, validateProjectExists, validateSubAgent, validationHelper, withProjectValidation };