@inkeep/agents-core 0.36.1 → 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 (38) hide show
  1. package/dist/auth/auth-schema.js +1 -1
  2. package/dist/auth/auth-validation-schemas.js +1 -1
  3. package/dist/auth/auth.d.ts +3 -3
  4. package/dist/auth/auth.js +32 -5
  5. package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
  6. package/dist/chunk-CMNLBV2A.js +39 -0
  7. package/dist/{chunk-SG75RA63.js → chunk-I6IF7ZTL.js} +2 -2
  8. package/dist/{chunk-ZCEKN54E.js → chunk-K6GMXJPW.js} +6 -6
  9. package/dist/{chunk-4RVJB4KV.js → chunk-LL6F3EAR.js} +4 -1
  10. package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
  11. package/dist/{chunk-NFYCSHD3.js → chunk-PVRIMF6N.js} +2 -1
  12. package/dist/{chunk-4OISWRFK.js → chunk-ROXPFQAM.js} +357 -40
  13. package/dist/{chunk-OEHP46F7.js → chunk-W3QDM7WH.js} +1 -1
  14. package/dist/{chunk-KMLLKRUY.js → chunk-ZEZCCHV7.js} +1 -1
  15. package/dist/{client-HrEgt7wv.d.ts → client-B_3j-V4-.d.ts} +1 -1
  16. package/dist/client-exports.d.ts +6 -3
  17. package/dist/client-exports.js +3 -3
  18. package/dist/constants/schema-validation/index.js +1 -1
  19. package/dist/credential-stores/index.d.ts +3 -3
  20. package/dist/db/schema.d.ts +2 -2
  21. package/dist/db/schema.js +2 -2
  22. package/dist/db/test-client.d.ts +3 -3
  23. package/dist/db/test-client.js +1 -1
  24. package/dist/index.d.ts +143 -9
  25. package/dist/index.js +280 -67
  26. package/dist/{schema-CoC3tYFX.d.ts → schema-DKbG39on.d.ts} +24 -1
  27. package/dist/server-BXoUiBMg.d.ts +127 -0
  28. package/dist/types/index.d.ts +33 -113
  29. package/dist/types/index.js +1 -1
  30. package/dist/{utility-C4QAannk.d.ts → utility-Lo5NoRHK.d.ts} +146 -11
  31. package/dist/validation/index.d.ts +2 -2
  32. package/dist/validation/index.js +2 -2
  33. package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
  34. package/drizzle/meta/0001_snapshot.json +7 -1
  35. package/drizzle/meta/_journal.json +2 -2
  36. package/package.json +12 -6
  37. package/dist/chunk-H2F72PDA.js +0 -15
  38. /package/dist/{chunk-NOPEANIU.js → chunk-NFTJ5JBY.js} +0 -0
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
- export { cleanupTestDatabase, closeTestDatabase, createTestDatabaseClient, createTestOrganization, createTestProject } from './chunk-SG75RA63.js';
2
- import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-OEHP46F7.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-OEHP46F7.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-KMLLKRUY.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-ZCEKN54E.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-ZCEKN54E.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-4OISWRFK.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, validateApiKey, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken } from './chunk-4OISWRFK.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';
13
15
  import { convertZodToJsonSchema } from './chunk-7GZHUB4J.js';
14
16
  export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from './chunk-7GZHUB4J.js';
15
- import { loadEnvironmentFiles, env } from './chunk-4RVJB4KV.js';
16
- export { loadEnvironmentFiles } from './chunk-4RVJB4KV.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-FOK3JSQN.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';
26
+ import { organization, member, invitation, user } from './chunk-NFTJ5JBY.js';
27
+ export { account, invitation, member, organization, session, ssoProvider, user, verification } from './chunk-NFTJ5JBY.js';
28
28
  import { __commonJS, __require } from './chunk-SIAA4J6H.js';
29
29
  import { z } from 'zod';
30
30
  import jmespath from 'jmespath';
@@ -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,
@@ -214714,7 +214714,8 @@ var createAgentToolRelation = (db) => async (params) => {
214714
214714
  subAgentId: params.data.subAgentId,
214715
214715
  toolId: params.data.toolId,
214716
214716
  selectedTools: params.data.selectedTools,
214717
- headers: params.data.headers
214717
+ headers: params.data.headers,
214718
+ toolPolicies: params.data.toolPolicies
214718
214719
  }).returning();
214719
214720
  return relation[0];
214720
214721
  };
@@ -214860,6 +214861,7 @@ var getToolsForAgent = (db) => async (params) => {
214860
214861
  toolId: subAgentToolRelations.toolId,
214861
214862
  selectedTools: subAgentToolRelations.selectedTools,
214862
214863
  headers: subAgentToolRelations.headers,
214864
+ toolPolicies: subAgentToolRelations.toolPolicies,
214863
214865
  createdAt: subAgentToolRelations.createdAt,
214864
214866
  updatedAt: subAgentToolRelations.updatedAt,
214865
214867
  tool: {
@@ -214920,6 +214922,7 @@ var getAgentsForTool = (db) => async (params) => {
214920
214922
  toolId: subAgentToolRelations.toolId,
214921
214923
  selectedTools: subAgentToolRelations.selectedTools,
214922
214924
  headers: subAgentToolRelations.headers,
214925
+ toolPolicies: subAgentToolRelations.toolPolicies,
214923
214926
  createdAt: subAgentToolRelations.createdAt,
214924
214927
  updatedAt: subAgentToolRelations.updatedAt,
214925
214928
  subAgent: {
@@ -215071,7 +215074,28 @@ var upsertSubAgent = (db) => async (params) => {
215071
215074
  }
215072
215075
  return await createSubAgent(db)(params.data);
215073
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
+ };
215074
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
+ }
215075
215099
  await db.delete(subAgents).where(
215076
215100
  and(
215077
215101
  eq(subAgents.tenantId, params.scopes.tenantId),
@@ -215658,8 +215682,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215658
215682
  availableTools: [],
215659
215683
  capabilities: capabilities || void 0,
215660
215684
  credentialReferenceId: credentialReferenceId || void 0,
215661
- createdAt: new Date(normalizeDateString(createdAt)),
215662
- updatedAt: new Date(normalizeDateString(dbResult.updatedAt)),
215685
+ createdAt: toISODateString(createdAt),
215686
+ updatedAt: toISODateString(dbResult.updatedAt),
215663
215687
  lastError: null,
215664
215688
  headers: headers2 || void 0,
215665
215689
  imageUrl: imageUrl || void 0,
@@ -215688,12 +215712,12 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215688
215712
  if (credentialStore.type === CredentialStoreType.nango) {
215689
215713
  const nangoCredentialData = JSON.parse(credentialDataString);
215690
215714
  if (nangoCredentialData.expiresAt) {
215691
- expiresAt = nangoCredentialData.expiresAt;
215715
+ expiresAt = toISODateString(nangoCredentialData.expiresAt);
215692
215716
  }
215693
215717
  } else if (credentialStore.type === CredentialStoreType.keychain) {
215694
215718
  const oauthTokens = JSON.parse(credentialDataString);
215695
215719
  if (oauthTokens.expires_at) {
215696
- expiresAt = new Date(normalizeDateString(oauthTokens.expires_at));
215720
+ expiresAt = toISODateString(oauthTokens.expires_at);
215697
215721
  }
215698
215722
  }
215699
215723
  }
@@ -215743,8 +215767,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, rela
215743
215767
  availableTools,
215744
215768
  capabilities: capabilities || void 0,
215745
215769
  credentialReferenceId: credentialReferenceId || void 0,
215746
- createdAt: new Date(normalizeDateString(createdAt)),
215747
- updatedAt: new Date(now),
215770
+ createdAt: toISODateString(createdAt),
215771
+ updatedAt: toISODateString(now),
215748
215772
  expiresAt,
215749
215773
  lastError: lastErrorComputed,
215750
215774
  headers: headers2 || void 0,
@@ -215826,6 +215850,7 @@ var addToolToAgent = (db) => async (params) => {
215826
215850
  toolId: params.toolId,
215827
215851
  selectedTools: params.selectedTools,
215828
215852
  headers: params.headers,
215853
+ toolPolicies: params.toolPolicies,
215829
215854
  createdAt: now,
215830
215855
  updatedAt: now
215831
215856
  }).returning();
@@ -215852,7 +215877,8 @@ var upsertSubAgentToolRelation = (db) => async (params) => {
215852
215877
  subAgentId: params.subAgentId,
215853
215878
  toolId: params.toolId,
215854
215879
  selectedTools: params.selectedTools,
215855
- headers: params.headers
215880
+ headers: params.headers,
215881
+ toolPolicies: params.toolPolicies
215856
215882
  }
215857
215883
  });
215858
215884
  }
@@ -216106,6 +216132,7 @@ var getFullAgentDefinition = (db) => async ({
216106
216132
  imageUrl: tools.imageUrl,
216107
216133
  selectedTools: subAgentToolRelations.selectedTools,
216108
216134
  headers: subAgentToolRelations.headers,
216135
+ toolPolicies: subAgentToolRelations.toolPolicies,
216109
216136
  agentToolRelationId: subAgentToolRelations.id
216110
216137
  }).from(subAgentToolRelations).innerJoin(
216111
216138
  tools,
@@ -216169,15 +216196,18 @@ var getFullAgentDefinition = (db) => async ({
216169
216196
  agentToolRelationId: tool.agentToolRelationId,
216170
216197
  toolId: tool.id,
216171
216198
  toolSelection: tool.selectedTools || null,
216172
- headers: tool.headers || null
216199
+ headers: tool.headers || null,
216200
+ toolPolicies: tool.toolPolicies || null
216173
216201
  }));
216174
216202
  const functionToolCanUse = agentFunctionTools.map((tool) => ({
216175
216203
  agentToolRelationId: tool.agentToolRelationId,
216176
216204
  toolId: tool.id,
216177
216205
  toolSelection: null,
216178
216206
  // Function tools don't have tool selection
216179
- headers: null
216207
+ headers: null,
216180
216208
  // Function tools don't have headers
216209
+ toolPolicies: null
216210
+ // Function tools don't have tool policies (yet)
216181
216211
  }));
216182
216212
  const canUse = [...mcpToolCanUse, ...functionToolCanUse];
216183
216213
  return {
@@ -217253,7 +217283,7 @@ var createFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217253
217283
  agentToolPromises.push(
217254
217284
  (async () => {
217255
217285
  try {
217256
- const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
217286
+ const { toolId, toolSelection, headers: headers2, toolPolicies, agentToolRelationId } = canUseItem;
217257
217287
  const isFunctionTool = typed.functionTools && toolId in typed.functionTools;
217258
217288
  logger10.info(
217259
217289
  {
@@ -217285,6 +217315,7 @@ var createFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217285
217315
  toolId,
217286
217316
  selectedTools: toolSelection || void 0,
217287
217317
  headers: headers2 || void 0,
217318
+ toolPolicies: toolPolicies || void 0,
217288
217319
  relationId: agentToolRelationId
217289
217320
  });
217290
217321
  logger10.info(
@@ -217994,7 +218025,7 @@ var updateFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
217994
218025
  subAgentToolPromises.push(
217995
218026
  (async () => {
217996
218027
  try {
217997
- const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
218028
+ const { toolId, toolSelection, headers: headers2, toolPolicies, agentToolRelationId } = canUseItem;
217998
218029
  const isFunctionTool = typedAgentDefinition.functionTools && toolId in typedAgentDefinition.functionTools;
217999
218030
  if (isFunctionTool) {
218000
218031
  logger10.info(
@@ -218019,6 +218050,7 @@ var updateFullAgentServerSide = (db, logger10 = defaultLogger) => async (scopes,
218019
218050
  toolId,
218020
218051
  selectedTools: toolSelection || void 0,
218021
218052
  headers: headers2 || void 0,
218053
+ toolPolicies: toolPolicies || void 0,
218022
218054
  relationId: agentToolRelationId
218023
218055
  });
218024
218056
  logger10.info(
@@ -219255,12 +219287,7 @@ var getPendingInvitationsByEmail = (db) => async (email) => {
219255
219287
  status: invitation.status,
219256
219288
  expiresAt: invitation.expiresAt,
219257
219289
  inviterId: invitation.inviterId
219258
- }).from(invitation).leftJoin(organization, eq(invitation.organizationId, organization.id)).where(
219259
- and(
219260
- eq(invitation.email, email),
219261
- eq(invitation.status, "pending")
219262
- )
219263
- );
219290
+ }).from(invitation).leftJoin(organization, eq(invitation.organizationId, organization.id)).where(and(eq(invitation.email, email), eq(invitation.status, "pending")));
219264
219291
  return result.filter((inv) => new Date(inv.expiresAt) > now);
219265
219292
  };
219266
219293
  var addUserToOrganization = (db) => async (data) => {
@@ -220163,6 +220190,203 @@ var updateFullProjectServerSide = (db, logger10 = defaultLogger2) => async (scop
220163
220190
  "All project artifactComponents updated successfully"
220164
220191
  );
220165
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
+ }
220166
220390
  const incomingAgentIds = new Set(Object.keys(typed.agents || {}));
220167
220391
  const existingAgents = await listAgents(db)({
220168
220392
  scopes: { tenantId, projectId: typed.id }
@@ -220407,34 +220631,23 @@ var getFullProject = (db, logger10 = defaultLogger2) => async (params) => {
220407
220631
  }
220408
220632
  const projectFunctions = {};
220409
220633
  try {
220410
- const functionToolsWithFunctions = await db.select({
220411
- functionToolId: functionTools.id,
220412
- functionToolName: functionTools.name,
220413
- functionToolDescription: functionTools.description,
220414
- functionId: functions.id,
220415
- inputSchema: functions.inputSchema,
220416
- executeCode: functions.executeCode,
220417
- dependencies: functions.dependencies
220418
- }).from(functionTools).innerJoin(functions, eq(functionTools.functionId, functions.id)).where(and(eq(functionTools.tenantId, tenantId), eq(functionTools.projectId, projectId)));
220419
- for (const item of functionToolsWithFunctions) {
220420
- projectFunctions[item.functionToolId] = {
220421
- id: item.functionId,
220422
- name: item.functionToolName,
220423
- description: item.functionToolDescription,
220424
- inputSchema: item.inputSchema,
220425
- executeCode: item.executeCode,
220426
- 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
220427
220643
  };
220428
220644
  }
220429
220645
  logger10.info(
220430
220646
  { tenantId, projectId, functionCount: Object.keys(projectFunctions).length },
220431
- "Function tools with function data retrieved for project"
220647
+ "Functions retrieved for project"
220432
220648
  );
220433
220649
  } catch (error) {
220434
- logger10.warn(
220435
- { tenantId, projectId, error },
220436
- "Failed to retrieve function tools for project"
220437
- );
220650
+ logger10.warn({ tenantId, projectId, error }, "Failed to retrieve functions for project");
220438
220651
  }
220439
220652
  const agents2 = {};
220440
220653
  if (agentList.length > 0) {
@@ -222056,4 +222269,4 @@ typescript/lib/typescript.js:
222056
222269
  ***************************************************************************** *)
222057
222270
  */
222058
222271
 
222059
- 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 };