@inkeep/agents-core 0.17.0 → 0.18.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 (36) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-TO2HNKGP.js → chunk-E4SFK6AI.js} +143 -157
  3. package/dist/chunk-H6PMWHNV.js +278 -0
  4. package/dist/{chunk-VPJ6Z5QZ.js → chunk-ID4CFGVF.js} +202 -131
  5. package/dist/chunk-JTHQYGCX.js +173 -0
  6. package/dist/client-exports.cjs +628 -272
  7. package/dist/client-exports.d.cts +6 -5
  8. package/dist/client-exports.d.ts +6 -5
  9. package/dist/client-exports.js +5 -4
  10. package/dist/db/schema.cjs +201 -130
  11. package/dist/db/schema.d.cts +2 -2
  12. package/dist/db/schema.d.ts +2 -2
  13. package/dist/db/schema.js +1 -1
  14. package/dist/index.cjs +2740 -1831
  15. package/dist/index.d.cts +1664 -1544
  16. package/dist/index.d.ts +1664 -1544
  17. package/dist/index.js +1953 -1467
  18. package/dist/{schema-Ct2NlO81.d.cts → schema-ULFEZCOL.d.cts} +475 -174
  19. package/dist/{schema-BQk_FMBV.d.ts → schema-wbZXiVWb.d.ts} +475 -174
  20. package/dist/signoz-queries-BuiipZTk.d.cts +274 -0
  21. package/dist/signoz-queries-BuiipZTk.d.ts +274 -0
  22. package/dist/types/index.d.cts +2 -2
  23. package/dist/types/index.d.ts +2 -2
  24. package/dist/{utility-s9c5CVOe.d.cts → utility-CyPQ1tC_.d.cts} +591 -390
  25. package/dist/{utility-s9c5CVOe.d.ts → utility-CyPQ1tC_.d.ts} +591 -390
  26. package/dist/validation/index.cjs +429 -325
  27. package/dist/validation/index.d.cts +76 -4
  28. package/dist/validation/index.d.ts +76 -4
  29. package/dist/validation/index.js +2 -2
  30. package/drizzle/0005_wide_shriek.sql +127 -0
  31. package/drizzle/0006_damp_lenny_balinger.sql +52 -0
  32. package/drizzle/meta/0005_snapshot.json +2558 -0
  33. package/drizzle/meta/0006_snapshot.json +2751 -0
  34. package/drizzle/meta/_journal.json +14 -0
  35. package/package.json +1 -1
  36. package/dist/chunk-L53XWAYG.js +0 -134
package/dist/index.d.cts CHANGED
@@ -1,11 +1,12 @@
1
+ export { h as ACTIVITY_NAMES, f as ACTIVITY_STATUS, e as ACTIVITY_TYPES, g as AGENT_IDS, o as AGGREGATE_OPERATORS, A as AI_OPERATIONS, i as AI_TOOL_TYPES, n as DATA_SOURCES, j as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, l as ORDER_DIRECTIONS, P as PANEL_TYPES, p as QUERY_DEFAULTS, k as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, m as QUERY_TYPES, R as REDUCE_OPERATIONS, d as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE } from './signoz-queries-BuiipZTk.cjs';
1
2
  import { z } from 'zod';
2
- import { r as CredentialReferenceApiInsert, s as ContextConfigSelect, l as ContextFetchDefinition, h as MCPTransportType, t as MCPToolConfig, u as GraphScopeConfig, C as ConversationHistoryConfig, v as ProjectScopeConfig, w as PaginationConfig, x as AgentGraphInsert, y as AgentGraphUpdate, z as FullGraphDefinition, B as AgentScopeConfig, D as AgentRelationInsert, E as ExternalAgentRelationInsert, H as AgentRelationUpdate, I as AgentToolRelationUpdate, m as ToolMcpConfig, n as ToolServerCapabilities, J as AgentInsert, K as AgentUpdate, L as AgentSelect, N as ApiKeySelect, O as ApiKeyInsert, Q as ApiKeyUpdate, R as CreateApiKeyParams, U as ApiKeyCreateResult, V as ArtifactComponentSelect, W as ArtifactComponentInsert, X as ArtifactComponentUpdate, Y as ContextCacheSelect, Z as ContextCacheInsert, _ as ContextConfigInsert, $ as ContextConfigUpdate, a0 as ConversationSelect, a1 as ConversationInsert, o as ConversationMetadata, a2 as ConversationUpdate, a3 as CredentialReferenceSelect, a4 as ToolSelect, a5 as CredentialReferenceInsert, a6 as CredentialReferenceUpdate, a7 as DataComponentSelect, a8 as DataComponentInsert, a9 as DataComponentUpdate, aa as ExternalAgentInsert, ab as ExternalAgentSelect, ac as ExternalAgentUpdate, ad as FunctionApiInsert, ae as Artifact, af as LedgerArtifactSelect, q as MessageMetadata, p as MessageContent, ag as MessageVisibility, ah as MessageInsert, ai as MessageUpdate, aj as FullProjectDefinition, ak as ProjectInfo, al as ProjectSelect, am as PaginationResult, an as ProjectResourceCounts, ao as ProjectInsert, ap as ProjectUpdate, aq as TaskInsert, T as TaskMetadataConfig, ar as TaskSelect, as as McpTool, at as ToolInsert, au as ToolUpdate, g as CredentialStoreType, av as ExecutionContext } from './utility-s9c5CVOe.cjs';
3
- export { b7 as A2AError, bD as A2ARequest, bE as A2AResponse, aI as APIKeySecurityScheme, bI as AgentApiInsert, dG as AgentApiInsertSchema, bH as AgentApiSelect, dF as AgentApiSelectSchema, bJ as AgentApiUpdate, dH as AgentApiUpdateSchema, cG as AgentArtifactComponentApiInsert, eR as AgentArtifactComponentApiInsertSchema, cF as AgentArtifactComponentApiSelect, eQ as AgentArtifactComponentApiSelectSchema, cH as AgentArtifactComponentApiUpdate, eS as AgentArtifactComponentApiUpdateSchema, cD as AgentArtifactComponentInsert, eO as AgentArtifactComponentInsertSchema, cC as AgentArtifactComponentSelect, eN as AgentArtifactComponentSelectSchema, cE as AgentArtifactComponentUpdate, eP as AgentArtifactComponentUpdateSchema, aE as AgentCapabilities, aS as AgentCard, di as AgentConversationHistoryConfig, cx as AgentDataComponentApiInsert, eF as AgentDataComponentApiInsertSchema, cw as AgentDataComponentApiSelect, eE as AgentDataComponentApiSelectSchema, cy as AgentDataComponentApiUpdate, eG as AgentDataComponentApiUpdateSchema, cu as AgentDataComponentInsert, eC as AgentDataComponentInsertSchema, ct as AgentDataComponentSelect, eB as AgentDataComponentSelectSchema, cv as AgentDataComponentUpdate, eD as AgentDataComponentUpdateSchema, d3 as AgentDefinition, bS as AgentGraphApiInsert, dV as AgentGraphApiInsertSchema, bR as AgentGraphApiSelect, dU as AgentGraphApiSelectSchema, bT as AgentGraphApiUpdate, dW as AgentGraphApiUpdateSchema, dS as AgentGraphInsertSchema, bQ as AgentGraphSelect, dR as AgentGraphSelectSchema, dT as AgentGraphUpdateSchema, dD as AgentInsertSchema, aF as AgentProvider, bM as AgentRelationApiInsert, dM as AgentRelationApiInsertSchema, bL as AgentRelationApiSelect, dL as AgentRelationApiSelectSchema, bN as AgentRelationApiUpdate, dN as AgentRelationApiUpdateSchema, dJ as AgentRelationInsertSchema, bO as AgentRelationQuery, dO as AgentRelationQuerySchema, bK as AgentRelationSelect, dI as AgentRelationSelectSchema, dK as AgentRelationUpdateSchema, dC as AgentSelectSchema, aG as AgentSkill, e as AgentStopWhen, b as AgentStopWhenSchema, cV as AgentToolRelationApiInsert, fv as AgentToolRelationApiInsertSchema, cU as AgentToolRelationApiSelect, fu as AgentToolRelationApiSelectSchema, cW as AgentToolRelationApiUpdate, fw as AgentToolRelationApiUpdateSchema, cT as AgentToolRelationInsert, fs as AgentToolRelationInsertSchema, cS as AgentToolRelationSelect, fr as AgentToolRelationSelectSchema, ft as AgentToolRelationUpdateSchema, dE as AgentUpdateSchema, eZ as AllAgentSchema, cL as AllAgentSelect, cP as ApiKeyApiCreationResponse, f2 as ApiKeyApiCreationResponseSchema, cN as ApiKeyApiInsert, f3 as ApiKeyApiInsertSchema, cM as ApiKeyApiSelect, f1 as ApiKeyApiSelectSchema, cO as ApiKeyApiUpdate, A as ApiKeyApiUpdateSchema, e$ as ApiKeyInsertSchema, e_ as ApiKeySelectSchema, f0 as ApiKeyUpdateSchema, cA as ArtifactComponentApiInsert, eL as ArtifactComponentApiInsertSchema, cz as ArtifactComponentApiSelect, eK as ArtifactComponentApiSelectSchema, cB as ArtifactComponentApiUpdate, eM as ArtifactComponentApiUpdateSchema, eI as ArtifactComponentInsertSchema, eH as ArtifactComponentSelectSchema, eJ as ArtifactComponentUpdateSchema, aL as AuthorizationCodeOAuthFlow, d1 as CanUseItem, fF as CanUseItemSchema, bn as CancelTaskRequest, by as CancelTaskResponse, bx as CancelTaskSuccessResponse, aM as ClientCredentialsOAuthFlow, b5 as ContentTypeNotSupportedError, co as ContextCacheApiInsert, es as ContextCacheApiInsertSchema, cn as ContextCacheApiSelect, er as ContextCacheApiSelectSchema, cp as ContextCacheApiUpdate, et as ContextCacheApiUpdateSchema, dj as ContextCacheEntry, ep as ContextCacheInsertSchema, eo as ContextCacheSelectSchema, cm as ContextCacheUpdate, eq as ContextCacheUpdateSchema, ci as ContextConfigApiInsert, fp as ContextConfigApiInsertSchema, ch as ContextConfigApiSelect, fo as ContextConfigApiSelectSchema, cj as ContextConfigApiUpdate, fq as ContextConfigApiUpdateSchema, fm as ContextConfigInsertSchema, fl as ContextConfigSelectSchema, fn as ContextConfigUpdateSchema, cb as ConversationApiInsert, eg as ConversationApiInsertSchema, ca as ConversationApiSelect, ef as ConversationApiSelectSchema, cc as ConversationApiUpdate, eh as ConversationApiUpdateSchema, ed as ConversationInsertSchema, dh as ConversationScopeOptions, ec as ConversationSelectSchema, ee as ConversationUpdateSchema, f8 as CredentialReferenceApiInsertSchema, cQ as CredentialReferenceApiSelect, f7 as CredentialReferenceApiSelectSchema, cR as CredentialReferenceApiUpdate, f9 as CredentialReferenceApiUpdateSchema, f5 as CredentialReferenceInsertSchema, f4 as CredentialReferenceSelectSchema, f6 as CredentialReferenceUpdateSchema, cr as DataComponentApiInsert, ez as DataComponentApiInsertSchema, cq as DataComponentApiSelect, ey as DataComponentApiSelectSchema, cs as DataComponentApiUpdate, eA as DataComponentApiUpdateSchema, ew as DataComponentBaseSchema, ev as DataComponentInsertSchema, eu as DataComponentSelectSchema, ex as DataComponentUpdateSchema, aC as DataPart, fL as ErrorResponseSchema, fM as ExistsResponseSchema, cJ as ExternalAgentApiInsert, eX as ExternalAgentApiInsertSchema, cI as ExternalAgentApiSelect, eW as ExternalAgentApiSelectSchema, cK as ExternalAgentApiUpdate, eY as ExternalAgentApiUpdateSchema, eU as ExternalAgentInsertSchema, bP as ExternalAgentRelationApiInsert, dQ as ExternalAgentRelationApiInsertSchema, dP as ExternalAgentRelationInsertSchema, eT as ExternalAgentSelectSchema, eV as ExternalAgentUpdateSchema, cl as FetchConfig, fj as FetchConfigSchema, ck as FetchDefinition, fk as FetchDefinitionSchema, ay as FileBase, aB as FilePart, az as FileWithBytes, aA as FileWithUri, d0 as FullGraphAgentInsert, a as FullGraphAgentInsertSchema, fG as FullGraphDefinitionSchema, fU as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, c8 as FunctionApiSelect, i as FunctionApiSelectSchema, c9 as FunctionApiUpdate, j as FunctionApiUpdateSchema, c6 as FunctionInsert, fh as FunctionInsertSchema, c5 as FunctionSelect, fg as FunctionSelectSchema, dB as FunctionToolConfig, dA as FunctionToolConfigSchema, c7 as FunctionUpdate, fi as FunctionUpdateSchema, bp as GetTaskPushNotificationConfigRequest, bC as GetTaskPushNotificationConfigResponse, bB as GetTaskPushNotificationConfigSuccessResponse, bm as GetTaskRequest, bw as GetTaskResponse, bv as GetTaskSuccessResponse, d as GraphStopWhen, G as GraphStopWhenSchema, fH as GraphWithinContextOfProjectSchema, aJ as HTTPAuthSecurityScheme, fV as HeadersScopeSchema, g0 as IdParamsSchema, aN as ImplicitOAuthFlow, d2 as InternalAgentDefinition, b0 as InternalError, b6 as InvalidAgentResponseError, a$ as InvalidParamsError, aZ as InvalidRequestError, aY as JSONParseError, bh as JSONRPCError, bj as JSONRPCErrorResponse, bf as JSONRPCMessage, bg as JSONRPCRequest, bi as JSONRPCResult, c_ as LedgerArtifactApiInsert, fB as LedgerArtifactApiInsertSchema, cZ as LedgerArtifactApiSelect, fA as LedgerArtifactApiSelectSchema, c$ as LedgerArtifactApiUpdate, fC as LedgerArtifactApiUpdateSchema, cX as LedgerArtifactInsert, fy as LedgerArtifactInsertSchema, fx as LedgerArtifactSelectSchema, cY as LedgerArtifactUpdate, fz as LedgerArtifactUpdateSchema, fJ as ListResponseSchema, du as MAX_ID_LENGTH, ds as MCPServerType, fb as MCPToolConfigSchema, dt as MIN_ID_LENGTH, dk as McpAuthType, dl as McpServerAuth, dn as McpServerCapabilities, dp as McpToolDefinition, e9 as McpToolDefinitionSchema, fa as McpToolSchema, dm as McpTransportConfig, e7 as McpTransportConfigSchema, aT as Message, cf as MessageApiInsert, em as MessageApiInsertSchema, ce as MessageApiSelect, el as MessageApiSelectSchema, cg as MessageApiUpdate, en as MessageApiUpdateSchema, ej as MessageInsertSchema, dc as MessageMode, bF as MessagePart, db as MessageRole, cd as MessageSelect, ei as MessageSelectSchema, bd as MessageSendConfiguration, be as MessageSendParams, da as MessageType, ek as MessageUpdateSchema, a_ as MethodNotFoundError, dx as ModelSchema, f as ModelSettings, M as ModelSettingsSchema, dd as Models, aP as OAuth2SecurityScheme, aK as OAuthFlows, aQ as OpenIdConnectSecurityScheme, d8 as Pagination, g1 as PaginationQueryParamsSchema, fI as PaginationSchema, P as Part, aw as PartBase, aO as PasswordOAuthFlow, d6 as ProjectApiInsert, fS as ProjectApiInsertSchema, d5 as ProjectApiSelect, fR as ProjectApiSelectSchema, d7 as ProjectApiUpdate, fT as ProjectApiUpdateSchema, fP as ProjectInsertSchema, dy as ProjectModelSchema, de as ProjectModels, fO as ProjectSelectSchema, fQ as ProjectUpdateSchema, b8 as PushNotificationAuthenticationInfo, b9 as PushNotificationConfig, b3 as PushNotificationNotSupportedError, fN as RemovedResponseSchema, dz as SandboxConfig, k as SandboxConfigSchema, aR as SecurityScheme, aH as SecuritySchemeBase, bk as SendMessageRequest, bs as SendMessageResponse, br as SendMessageSuccessResponse, bl as SendStreamingMessageRequest, bu as SendStreamingMessageResponse, bt as SendStreamingMessageSuccessResponse, bo as SetTaskPushNotificationConfigRequest, bA as SetTaskPushNotificationConfigResponse, bz as SetTaskPushNotificationConfigSuccessResponse, fK as SingleResponseSchema, dg as StatusComponent, fD as StatusComponentSchema, fE as StatusUpdateSchema, df as StatusUpdateSettings, c as StopWhen, S as StopWhenSchema, d9 as SummaryEvent, dq as TOOL_STATUS_VALUES, aV as Task, bW as TaskApiInsert, d$ as TaskApiInsertSchema, bV as TaskApiSelect, d_ as TaskApiSelectSchema, bX as TaskApiUpdate, e0 as TaskApiUpdateSchema, bG as TaskArtifact, aX as TaskArtifactUpdateEvent, bb as TaskIdParams, dY as TaskInsertSchema, b2 as TaskNotCancelableError, b1 as TaskNotFoundError, ba as TaskPushNotificationConfig, bc as TaskQueryParams, c0 as TaskRelationApiInsert, e5 as TaskRelationApiInsertSchema, b$ as TaskRelationApiSelect, e4 as TaskRelationApiSelectSchema, c1 as TaskRelationApiUpdate, e6 as TaskRelationApiUpdateSchema, bZ as TaskRelationInsert, e2 as TaskRelationInsertSchema, bY as TaskRelationSelect, e1 as TaskRelationSelectSchema, b_ as TaskRelationUpdate, e3 as TaskRelationUpdateSchema, bq as TaskResubscriptionRequest, dX as TaskSelectSchema, aD as TaskState, aU as TaskStatus, aW as TaskStatusUpdateEvent, bU as TaskUpdate, dZ as TaskUpdateSchema, f$ as TenantIdParamsSchema, fW as TenantParamsSchema, fZ as TenantProjectGraphIdParamsSchema, fY as TenantProjectGraphParamsSchema, f_ as TenantProjectIdParamsSchema, fX as TenantProjectParamsSchema, ax as TextPart, c3 as ToolApiInsert, fe as ToolApiInsertSchema, c2 as ToolApiSelect, fd as ToolApiSelectSchema, c4 as ToolApiUpdate, ff as ToolApiUpdateSchema, d4 as ToolDefinition, eb as ToolInsertSchema, ea as ToolSelectSchema, e8 as ToolStatusSchema, fc as ToolUpdateSchema, dv as URL_SAFE_ID_PATTERN, b4 as UnsupportedOperationError, dr as VALID_RELATION_TYPES, dw as resourceIdSchema } from './utility-s9c5CVOe.cjs';
3
+ import { r as CredentialReferenceApiInsert, s as ContextConfigSelect, l as ContextFetchDefinition, h as MCPTransportType, t as MCPToolConfig, u as GraphScopeConfig, C as ConversationHistoryConfig, v as ProjectScopeConfig, w as PaginationConfig, x as AgentGraphInsert, y as AgentGraphUpdate, z as FullGraphDefinition, B as ApiKeySelect, D as ApiKeyInsert, E as ApiKeyUpdate, H as CreateApiKeyParams, I as ApiKeyCreateResult, J as ArtifactComponentSelect, K as ArtifactComponentInsert, L as ArtifactComponentUpdate, N as AgentScopeConfig, O as ContextCacheSelect, Q as ContextCacheInsert, R as ContextConfigInsert, U as ContextConfigUpdate, V as ConversationSelect, W as ConversationInsert, o as ConversationMetadata, X as ConversationUpdate, Y as CredentialReferenceSelect, Z as ToolSelect, _ as CredentialReferenceInsert, $ as CredentialReferenceUpdate, a0 as DataComponentSelect, a1 as DataComponentInsert, a2 as DataComponentUpdate, a3 as ExternalAgentInsert, a4 as ExternalAgentSelect, a5 as ExternalAgentUpdate, a6 as FunctionApiInsert, a7 as FunctionToolApiInsert, a8 as FunctionToolApiUpdate, a9 as Artifact, aa as LedgerArtifactSelect, q as MessageMetadata, p as MessageContent, ab as MessageVisibility, ac as MessageInsert, ad as MessageUpdate, ae as FullProjectDefinition, af as ProjectInfo, ag as ProjectSelect, ah as PaginationResult, ai as ProjectResourceCounts, aj as ProjectInsert, ak as ProjectUpdate, al as SubAgentRelationInsert, am as ExternalSubAgentRelationInsert, an as SubAgentRelationUpdate, ao as SubAgentToolRelationUpdate, m as ToolMcpConfig, n as ToolServerCapabilities, ap as SubAgentInsert, aq as SubAgentUpdate, ar as SubAgentSelect, as as TaskInsert, T as TaskMetadataConfig, at as TaskSelect, au as McpTool, av as ToolInsert, aw as ToolUpdate, g as CredentialStoreType, ax as ExecutionContext } from './utility-CyPQ1tC_.cjs';
4
+ export { b9 as A2AError, bF as A2ARequest, bG as A2AResponse, aK as APIKeySecurityScheme, aG as AgentCapabilities, aU as AgentCard, dl as AgentConversationHistoryConfig, d6 as AgentDefinition, bU as AgentGraphApiInsert, dY as AgentGraphApiInsertSchema, bT as AgentGraphApiSelect, dX as AgentGraphApiSelectSchema, bV as AgentGraphApiUpdate, dZ as AgentGraphApiUpdateSchema, dV as AgentGraphInsertSchema, bS as AgentGraphSelect, dU as AgentGraphSelectSchema, dW as AgentGraphUpdateSchema, aH as AgentProvider, aI as AgentSkill, f0 as AllAgentSchema, cO as AllAgentSelect, cS as ApiKeyApiCreationResponse, f5 as ApiKeyApiCreationResponseSchema, cQ as ApiKeyApiInsert, f6 as ApiKeyApiInsertSchema, cP as ApiKeyApiSelect, f4 as ApiKeyApiSelectSchema, cR as ApiKeyApiUpdate, A as ApiKeyApiUpdateSchema, f2 as ApiKeyInsertSchema, f1 as ApiKeySelectSchema, f3 as ApiKeyUpdateSchema, cD as ArtifactComponentApiInsert, eO as ArtifactComponentApiInsertSchema, cC as ArtifactComponentApiSelect, eN as ArtifactComponentApiSelectSchema, cE as ArtifactComponentApiUpdate, eP as ArtifactComponentApiUpdateSchema, eL as ArtifactComponentInsertSchema, eK as ArtifactComponentSelectSchema, eM as ArtifactComponentUpdateSchema, aN as AuthorizationCodeOAuthFlow, d4 as CanUseItem, fO as CanUseItemSchema, bp as CancelTaskRequest, bA as CancelTaskResponse, bz as CancelTaskSuccessResponse, aO as ClientCredentialsOAuthFlow, b7 as ContentTypeNotSupportedError, cr as ContextCacheApiInsert, ev as ContextCacheApiInsertSchema, cq as ContextCacheApiSelect, eu as ContextCacheApiSelectSchema, cs as ContextCacheApiUpdate, ew as ContextCacheApiUpdateSchema, dm as ContextCacheEntry, es as ContextCacheInsertSchema, er as ContextCacheSelectSchema, cp as ContextCacheUpdate, et as ContextCacheUpdateSchema, cl as ContextConfigApiInsert, fy as ContextConfigApiInsertSchema, ck as ContextConfigApiSelect, fx as ContextConfigApiSelectSchema, cm as ContextConfigApiUpdate, fz as ContextConfigApiUpdateSchema, fv as ContextConfigInsertSchema, fu as ContextConfigSelectSchema, fw as ContextConfigUpdateSchema, ce as ConversationApiInsert, ej as ConversationApiInsertSchema, cd as ConversationApiSelect, ei as ConversationApiSelectSchema, cf as ConversationApiUpdate, ek as ConversationApiUpdateSchema, eg as ConversationInsertSchema, dk as ConversationScopeOptions, ef as ConversationSelectSchema, eh as ConversationUpdateSchema, fb as CredentialReferenceApiInsertSchema, cT as CredentialReferenceApiSelect, fa as CredentialReferenceApiSelectSchema, cU as CredentialReferenceApiUpdate, fc as CredentialReferenceApiUpdateSchema, f8 as CredentialReferenceInsertSchema, f7 as CredentialReferenceSelectSchema, f9 as CredentialReferenceUpdateSchema, cu as DataComponentApiInsert, eC as DataComponentApiInsertSchema, ct as DataComponentApiSelect, eB as DataComponentApiSelectSchema, cv as DataComponentApiUpdate, eD as DataComponentApiUpdateSchema, ez as DataComponentBaseSchema, ey as DataComponentInsertSchema, ex as DataComponentSelectSchema, eA as DataComponentUpdateSchema, aE as DataPart, fU as ErrorResponseSchema, fV as ExistsResponseSchema, cM as ExternalAgentApiInsert, e_ as ExternalAgentApiInsertSchema, cL as ExternalAgentApiSelect, eZ as ExternalAgentApiSelectSchema, cN as ExternalAgentApiUpdate, e$ as ExternalAgentApiUpdateSchema, eX as ExternalAgentInsertSchema, eW as ExternalAgentSelectSchema, eY as ExternalAgentUpdateSchema, bR as ExternalSubAgentRelationApiInsert, dT as ExternalSubAgentRelationApiInsertSchema, dS as ExternalSubAgentRelationInsertSchema, co as FetchConfig, fs as FetchConfigSchema, cn as FetchDefinition, ft as FetchDefinitionSchema, aA as FileBase, aD as FilePart, aB as FileWithBytes, aC as FileWithUri, d3 as FullGraphAgentInsert, a as FullGraphAgentInsertSchema, fP as FullGraphDefinitionSchema, g1 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, ca as FunctionApiSelect, i as FunctionApiSelectSchema, cb as FunctionApiUpdate, j as FunctionApiUpdateSchema, c8 as FunctionInsert, fq as FunctionInsertSchema, c7 as FunctionSelect, fp as FunctionSelectSchema, fn as FunctionToolApiInsertSchema, cc as FunctionToolApiSelect, fm as FunctionToolApiSelectSchema, fo as FunctionToolApiUpdateSchema, dE as FunctionToolConfig, dD as FunctionToolConfigSchema, fk as FunctionToolInsertSchema, fj as FunctionToolSelectSchema, fl as FunctionToolUpdateSchema, c9 as FunctionUpdate, fr as FunctionUpdateSchema, br as GetTaskPushNotificationConfigRequest, bE as GetTaskPushNotificationConfigResponse, bD as GetTaskPushNotificationConfigSuccessResponse, bo as GetTaskRequest, by as GetTaskResponse, bx as GetTaskSuccessResponse, d as GraphStopWhen, G as GraphStopWhenSchema, fQ as GraphWithinContextOfProjectSchema, aL as HTTPAuthSecurityScheme, g2 as HeadersScopeSchema, aP as ImplicitOAuthFlow, d5 as InternalAgentDefinition, b2 as InternalError, b8 as InvalidAgentResponseError, b1 as InvalidParamsError, a$ as InvalidRequestError, a_ as JSONParseError, bj as JSONRPCError, bl as JSONRPCErrorResponse, bh as JSONRPCMessage, bi as JSONRPCRequest, bk as JSONRPCResult, d1 as LedgerArtifactApiInsert, fK as LedgerArtifactApiInsertSchema, d0 as LedgerArtifactApiSelect, fJ as LedgerArtifactApiSelectSchema, d2 as LedgerArtifactApiUpdate, fL as LedgerArtifactApiUpdateSchema, c_ as LedgerArtifactInsert, fH as LedgerArtifactInsertSchema, fG as LedgerArtifactSelectSchema, c$ as LedgerArtifactUpdate, fI as LedgerArtifactUpdateSchema, fS as ListResponseSchema, dx as MAX_ID_LENGTH, dv as MCPServerType, fe as MCPToolConfigSchema, dw as MIN_ID_LENGTH, dn as McpAuthType, dp as McpServerAuth, dr as McpServerCapabilities, ds as McpToolDefinition, ec as McpToolDefinitionSchema, fd as McpToolSchema, dq as McpTransportConfig, ea as McpTransportConfigSchema, aV as Message, ci as MessageApiInsert, ep as MessageApiInsertSchema, ch as MessageApiSelect, eo as MessageApiSelectSchema, cj as MessageApiUpdate, eq as MessageApiUpdateSchema, em as MessageInsertSchema, df as MessageMode, bH as MessagePart, de as MessageRole, cg as MessageSelect, el as MessageSelectSchema, bf as MessageSendConfiguration, bg as MessageSendParams, dd as MessageType, en as MessageUpdateSchema, b0 as MethodNotFoundError, dA as ModelSchema, f as ModelSettings, M as ModelSettingsSchema, dg as Models, aR as OAuth2SecurityScheme, aM as OAuthFlows, aS as OpenIdConnectSecurityScheme, db as Pagination, gb as PaginationQueryParamsSchema, fR as PaginationSchema, P as Part, ay as PartBase, aQ as PasswordOAuthFlow, d9 as ProjectApiInsert, f$ as ProjectApiInsertSchema, d8 as ProjectApiSelect, f_ as ProjectApiSelectSchema, da as ProjectApiUpdate, g0 as ProjectApiUpdateSchema, fY as ProjectInsertSchema, dB as ProjectModelSchema, dh as ProjectModels, fX as ProjectSelectSchema, fZ as ProjectUpdateSchema, ba as PushNotificationAuthenticationInfo, bb as PushNotificationConfig, b5 as PushNotificationNotSupportedError, fW as RemovedResponseSchema, dC as SandboxConfig, k as SandboxConfigSchema, aT as SecurityScheme, aJ as SecuritySchemeBase, bm as SendMessageRequest, bu as SendMessageResponse, bt as SendMessageSuccessResponse, bn as SendStreamingMessageRequest, bw as SendStreamingMessageResponse, bv as SendStreamingMessageSuccessResponse, bq as SetTaskPushNotificationConfigRequest, bC as SetTaskPushNotificationConfigResponse, bB as SetTaskPushNotificationConfigSuccessResponse, fT as SingleResponseSchema, dj as StatusComponent, fM as StatusComponentSchema, fN as StatusUpdateSchema, di as StatusUpdateSettings, c as StopWhen, S as StopWhenSchema, bK as SubAgentApiInsert, dJ as SubAgentApiInsertSchema, bJ as SubAgentApiSelect, dI as SubAgentApiSelectSchema, bL as SubAgentApiUpdate, dK as SubAgentApiUpdateSchema, cJ as SubAgentArtifactComponentApiInsert, eU as SubAgentArtifactComponentApiInsertSchema, cI as SubAgentArtifactComponentApiSelect, eT as SubAgentArtifactComponentApiSelectSchema, cK as SubAgentArtifactComponentApiUpdate, eV as SubAgentArtifactComponentApiUpdateSchema, cG as SubAgentArtifactComponentInsert, eR as SubAgentArtifactComponentInsertSchema, cF as SubAgentArtifactComponentSelect, eQ as SubAgentArtifactComponentSelectSchema, cH as SubAgentArtifactComponentUpdate, eS as SubAgentArtifactComponentUpdateSchema, cA as SubAgentDataComponentApiInsert, eI as SubAgentDataComponentApiInsertSchema, cz as SubAgentDataComponentApiSelect, eH as SubAgentDataComponentApiSelectSchema, cB as SubAgentDataComponentApiUpdate, eJ as SubAgentDataComponentApiUpdateSchema, cx as SubAgentDataComponentInsert, eF as SubAgentDataComponentInsertSchema, cw as SubAgentDataComponentSelect, eE as SubAgentDataComponentSelectSchema, cy as SubAgentDataComponentUpdate, eG as SubAgentDataComponentUpdateSchema, dG as SubAgentInsertSchema, bO as SubAgentRelationApiInsert, dP as SubAgentRelationApiInsertSchema, bN as SubAgentRelationApiSelect, dO as SubAgentRelationApiSelectSchema, bP as SubAgentRelationApiUpdate, dQ as SubAgentRelationApiUpdateSchema, dM as SubAgentRelationInsertSchema, bQ as SubAgentRelationQuery, dR as SubAgentRelationQuerySchema, bM as SubAgentRelationSelect, dL as SubAgentRelationSelectSchema, dN as SubAgentRelationUpdateSchema, dF as SubAgentSelectSchema, e as SubAgentStopWhen, b as SubAgentStopWhenSchema, cY as SubAgentToolRelationApiInsert, fE as SubAgentToolRelationApiInsertSchema, cX as SubAgentToolRelationApiSelect, fD as SubAgentToolRelationApiSelectSchema, cZ as SubAgentToolRelationApiUpdate, fF as SubAgentToolRelationApiUpdateSchema, cW as SubAgentToolRelationInsert, fB as SubAgentToolRelationInsertSchema, cV as SubAgentToolRelationSelect, fA as SubAgentToolRelationSelectSchema, fC as SubAgentToolRelationUpdateSchema, dH as SubAgentUpdateSchema, dc as SummaryEvent, dt as TOOL_STATUS_VALUES, aX as Task, bY as TaskApiInsert, e2 as TaskApiInsertSchema, bX as TaskApiSelect, e1 as TaskApiSelectSchema, bZ as TaskApiUpdate, e3 as TaskApiUpdateSchema, bI as TaskArtifact, aZ as TaskArtifactUpdateEvent, bd as TaskIdParams, d$ as TaskInsertSchema, b4 as TaskNotCancelableError, b3 as TaskNotFoundError, bc as TaskPushNotificationConfig, be as TaskQueryParams, c2 as TaskRelationApiInsert, e8 as TaskRelationApiInsertSchema, c1 as TaskRelationApiSelect, e7 as TaskRelationApiSelectSchema, c3 as TaskRelationApiUpdate, e9 as TaskRelationApiUpdateSchema, b$ as TaskRelationInsert, e5 as TaskRelationInsertSchema, b_ as TaskRelationSelect, e4 as TaskRelationSelectSchema, c0 as TaskRelationUpdate, e6 as TaskRelationUpdateSchema, bs as TaskResubscriptionRequest, d_ as TaskSelectSchema, aF as TaskState, aW as TaskStatus, aY as TaskStatusUpdateEvent, bW as TaskUpdate, e0 as TaskUpdateSchema, g4 as TenantIdParamsSchema, g3 as TenantParamsSchema, g8 as TenantProjectGraphIdParamsSchema, g7 as TenantProjectGraphParamsSchema, ga as TenantProjectGraphSubAgentIdParamsSchema, g9 as TenantProjectGraphSubAgentParamsSchema, g6 as TenantProjectIdParamsSchema, g5 as TenantProjectParamsSchema, az as TextPart, c5 as ToolApiInsert, fh as ToolApiInsertSchema, c4 as ToolApiSelect, fg as ToolApiSelectSchema, c6 as ToolApiUpdate, fi as ToolApiUpdateSchema, d7 as ToolDefinition, ee as ToolInsertSchema, ed as ToolSelectSchema, eb as ToolStatusSchema, ff as ToolUpdateSchema, dy as URL_SAFE_ID_PATTERN, b6 as UnsupportedOperationError, du as VALID_RELATION_TYPES, dz as resourceIdSchema } from './utility-CyPQ1tC_.cjs';
4
5
  import { CredentialStore } from './types/index.cjs';
5
6
  export { CorsConfig, ServerConfig, ServerOptions } from './types/index.cjs';
6
7
  import { LibSQLDatabase } from 'drizzle-orm/libsql';
7
- import { s as schema } from './schema-Ct2NlO81.cjs';
8
- export { k as agentArtifactComponents, L as agentArtifactComponentsRelations, i as agentDataComponents, N as agentDataComponentsRelations, a as agentGraph, C as agentGraphRelations, e as agentRelations, Q as agentRelationsRelations, n as agentToolRelations, F as agentToolRelationsRelations, d as agents, B as agentsRelations, u as apiKeys, E as apiKeysRelations, j as artifactComponents, K as artifactComponentsRelations, b as contextCache, A as contextCacheRelations, c as contextConfigs, z as contextConfigsRelations, o as conversations, I as conversationsRelations, v as credentialReferences, G as credentialReferencesRelations, h as dataComponents, M as dataComponentsRelations, f as externalAgents, D as externalAgentsRelations, m as functions, P as functionsRelations, r as ledgerArtifacts, O as ledgerArtifactsRelations, q as messages, J as messagesRelations, p as projects, x as projectsRelations, g as taskRelations, y as taskRelationsRelations, t as tasks, w as tasksRelations, l as tools, H as toolsRelations } from './schema-Ct2NlO81.cjs';
8
+ import { s as schema } from './schema-ULFEZCOL.cjs';
9
+ export { q as agentFunctionToolRelations, U as agentFunctionToolRelationsRelations, a as agentGraph, E as agentGraphRelations, H as agentToolRelationsRelations, w as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, b as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, r as conversations, K as conversationsRelations, x as credentialReferences, I as credentialReferencesRelations, h as dataComponents, O as dataComponentsRelations, f as externalAgents, F as externalAgentsRelations, m as functionTools, T as functionToolsRelations, n as functions, R as functionsRelations, v as ledgerArtifacts, Q as ledgerArtifactsRelations, u as messages, L as messagesRelations, p as projects, z as projectsRelations, k as subAgentArtifactComponents, N as subAgentArtifactComponentsRelations, i as subAgentDataComponents, P as subAgentDataComponentsRelations, e as subAgentRelations, S as subAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, D as subAgentsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from './schema-ULFEZCOL.cjs';
9
10
  import { LoggerOptions, TransportSingleOptions, Logger } from 'pino';
10
11
  import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
11
12
  import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
@@ -16,7 +17,7 @@ import { z as z$1 } from '@hono/zod-openapi';
16
17
  import { HTTPException } from 'hono/http-exception';
17
18
  export { convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, isZodSchema, preview } from './utils/schema-conversion.cjs';
18
19
  import { Span, Tracer } from '@opentelemetry/api';
19
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './validation/index.cjs';
20
+ export { A2AMessageMetadata, A2AMessageMetadataSchema, DataOperationDetails, DataOperationDetailsSchema, DataOperationEvent, DataOperationEventSchema, DelegationReturnedData, DelegationReturnedDataSchema, DelegationSentData, DelegationSentDataSchema, TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './validation/index.cjs';
20
21
  export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.cjs';
21
22
  import 'drizzle-zod';
22
23
  import 'drizzle-orm/sqlite-core';
@@ -845,7 +846,7 @@ declare const getAgentGraphById: (db: DatabaseClient) => (params: {
845
846
  stopWhen: {
846
847
  transferCountIs?: number | undefined;
847
848
  } | null;
848
- defaultAgentId: string | null;
849
+ defaultSubAgentId: string | null;
849
850
  contextConfigId: string | null;
850
851
  statusUpdates: {
851
852
  enabled?: boolean | undefined;
@@ -864,7 +865,7 @@ declare const getAgentGraphById: (db: DatabaseClient) => (params: {
864
865
  } | null;
865
866
  graphPrompt: string | null;
866
867
  } | null>;
867
- declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
868
+ declare const getAgentGraphWithDefaultSubAgent: (db: DatabaseClient) => (params: {
868
869
  scopes: GraphScopeConfig;
869
870
  }) => Promise<{
870
871
  tenantId: string;
@@ -891,7 +892,7 @@ declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
891
892
  stopWhen: {
892
893
  transferCountIs?: number | undefined;
893
894
  } | null;
894
- defaultAgentId: string | null;
895
+ defaultSubAgentId: string | null;
895
896
  contextConfigId: string | null;
896
897
  statusUpdates: {
897
898
  enabled?: boolean | undefined;
@@ -909,7 +910,7 @@ declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
909
910
  }[] | undefined;
910
911
  } | null;
911
912
  graphPrompt: string | null;
912
- defaultAgent: {
913
+ defaultSubAgent: {
913
914
  tenantId: string;
914
915
  projectId: string;
915
916
  id: string;
@@ -966,7 +967,7 @@ declare const listAgentGraphs: (db: DatabaseClient) => (params: {
966
967
  stopWhen: {
967
968
  transferCountIs?: number | undefined;
968
969
  } | null;
969
- defaultAgentId: string | null;
970
+ defaultSubAgentId: string | null;
970
971
  contextConfigId: string | null;
971
972
  statusUpdates: {
972
973
  enabled?: boolean | undefined;
@@ -994,7 +995,7 @@ declare const listAgentGraphsPaginated: (db: DatabaseClient) => (params: {
994
995
  updatedAt: string;
995
996
  name: string;
996
997
  description: string | null;
997
- defaultAgentId: string | null;
998
+ defaultSubAgentId: string | null;
998
999
  contextConfigId: string | null;
999
1000
  models: {
1000
1001
  base?: {
@@ -1065,7 +1066,7 @@ declare const createAgentGraph: (db: DatabaseClient) => (data: AgentGraphInsert)
1065
1066
  stopWhen: {
1066
1067
  transferCountIs?: number | undefined;
1067
1068
  } | null;
1068
- defaultAgentId: string | null;
1069
+ defaultSubAgentId: string | null;
1069
1070
  contextConfigId: string | null;
1070
1071
  statusUpdates: {
1071
1072
  enabled?: boolean | undefined;
@@ -1112,7 +1113,7 @@ declare const updateAgentGraph: (db: DatabaseClient) => (params: {
1112
1113
  stopWhen: {
1113
1114
  transferCountIs?: number | undefined;
1114
1115
  } | null;
1115
- defaultAgentId: string | null;
1116
+ defaultSubAgentId: string | null;
1116
1117
  contextConfigId: string | null;
1117
1118
  statusUpdates: {
1118
1119
  enabled?: boolean | undefined;
@@ -1137,17 +1138,18 @@ declare const deleteAgentGraph: (db: DatabaseClient) => (params: {
1137
1138
  /**
1138
1139
  * Helper function to fetch component relationships using efficient joins
1139
1140
  */
1140
- declare const fetchComponentRelationships: (db: DatabaseClient) => <T extends Record<string, any>>(scopes: ProjectScopeConfig, agentIds: string[], config: {
1141
+ declare const fetchComponentRelationships: (db: DatabaseClient) => <T extends Record<string, any>>(scopes: ProjectScopeConfig, subAgentIds: string[], config: {
1141
1142
  relationTable: any;
1142
1143
  componentTable: any;
1143
1144
  relationIdField: any;
1144
1145
  componentIdField: any;
1146
+ subAgentIdField: any;
1145
1147
  selectFields: Record<string, any>;
1146
1148
  }) => Promise<Record<string, T>>;
1147
- declare const getGraphAgentInfos: (db: DatabaseClient) => ({ scopes, graphId, agentId, }: {
1149
+ declare const getGraphAgentInfos: (db: DatabaseClient) => ({ scopes, graphId, subAgentId, }: {
1148
1150
  scopes: ProjectScopeConfig;
1149
1151
  graphId: string;
1150
- agentId: string;
1152
+ subAgentId: string;
1151
1153
  }) => Promise<{
1152
1154
  id: string;
1153
1155
  name: string;
@@ -1163,137 +1165,60 @@ declare const upsertAgentGraph: (db: DatabaseClient) => (params: {
1163
1165
  data: AgentGraphInsert;
1164
1166
  }) => Promise<any>;
1165
1167
 
1166
- declare const getAgentRelationById: (db: DatabaseClient) => (params: {
1167
- scopes: GraphScopeConfig;
1168
- relationId: string;
1168
+ declare const getApiKeyById: (db: DatabaseClient) => (params: {
1169
+ scopes: ProjectScopeConfig;
1170
+ id: string;
1169
1171
  }) => Promise<{
1170
1172
  tenantId: string;
1171
1173
  projectId: string;
1172
1174
  id: string;
1175
+ name: string | null;
1173
1176
  graphId: string;
1177
+ publicId: string;
1178
+ keyHash: string;
1179
+ keyPrefix: string;
1180
+ lastUsedAt: string | null;
1181
+ expiresAt: string | null;
1174
1182
  createdAt: string;
1175
1183
  updatedAt: string;
1176
- sourceAgentId: string;
1177
- targetAgentId: string | null;
1178
- externalAgentId: string | null;
1179
- relationType: string | null;
1180
1184
  } | undefined>;
1181
- declare const listAgentRelations: (db: DatabaseClient) => (params: {
1182
- scopes: GraphScopeConfig;
1183
- pagination?: PaginationConfig;
1184
- }) => Promise<{
1185
- data: {
1186
- createdAt: string;
1187
- updatedAt: string;
1188
- sourceAgentId: string;
1189
- targetAgentId: string | null;
1190
- externalAgentId: string | null;
1191
- relationType: string | null;
1192
- graphId: string;
1193
- projectId: string;
1194
- tenantId: string;
1195
- id: string;
1196
- }[];
1197
- pagination: {
1198
- page: number;
1199
- limit: number;
1200
- total: number;
1201
- pages: number;
1202
- };
1203
- }>;
1204
- declare const getAgentRelations: (db: DatabaseClient) => (params: {
1205
- scopes: AgentScopeConfig;
1206
- }) => Promise<{
1185
+ declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) => Promise<{
1207
1186
  tenantId: string;
1208
1187
  projectId: string;
1209
1188
  id: string;
1189
+ name: string | null;
1210
1190
  graphId: string;
1191
+ publicId: string;
1192
+ keyHash: string;
1193
+ keyPrefix: string;
1194
+ lastUsedAt: string | null;
1195
+ expiresAt: string | null;
1211
1196
  createdAt: string;
1212
1197
  updatedAt: string;
1213
- sourceAgentId: string;
1214
- targetAgentId: string | null;
1215
- externalAgentId: string | null;
1216
- relationType: string | null;
1217
- }[]>;
1218
- declare const getAgentRelationsByGraph: (db: DatabaseClient) => (params: {
1219
- scopes: GraphScopeConfig;
1198
+ } | undefined>;
1199
+ declare const listApiKeys: (db: DatabaseClient) => (params: {
1200
+ scopes: ProjectScopeConfig;
1201
+ graphId?: string;
1220
1202
  }) => Promise<{
1221
1203
  tenantId: string;
1222
1204
  projectId: string;
1223
1205
  id: string;
1206
+ name: string | null;
1224
1207
  graphId: string;
1208
+ publicId: string;
1209
+ keyHash: string;
1210
+ keyPrefix: string;
1211
+ lastUsedAt: string | null;
1212
+ expiresAt: string | null;
1225
1213
  createdAt: string;
1226
1214
  updatedAt: string;
1227
- sourceAgentId: string;
1228
- targetAgentId: string | null;
1229
- externalAgentId: string | null;
1230
- relationType: string | null;
1231
1215
  }[]>;
1232
- declare const getAgentRelationsBySource: (db: DatabaseClient) => (params: {
1233
- scopes: GraphScopeConfig;
1234
- sourceAgentId: string;
1235
- pagination?: PaginationConfig;
1236
- }) => Promise<{
1237
- data: {
1238
- createdAt: string;
1239
- updatedAt: string;
1240
- sourceAgentId: string;
1241
- targetAgentId: string | null;
1242
- externalAgentId: string | null;
1243
- relationType: string | null;
1244
- graphId: string;
1245
- projectId: string;
1246
- tenantId: string;
1247
- id: string;
1248
- }[];
1249
- pagination: {
1250
- page: number;
1251
- limit: number;
1252
- total: number;
1253
- pages: number;
1254
- };
1255
- }>;
1256
- declare const getAgentRelationsByTarget: (db: DatabaseClient) => (params: {
1257
- scopes: GraphScopeConfig;
1258
- targetAgentId: string;
1259
- pagination?: PaginationConfig;
1260
- }) => Promise<{
1261
- data: {
1262
- createdAt: string;
1263
- updatedAt: string;
1264
- sourceAgentId: string;
1265
- targetAgentId: string | null;
1266
- externalAgentId: string | null;
1267
- relationType: string | null;
1268
- graphId: string;
1269
- projectId: string;
1270
- tenantId: string;
1271
- id: string;
1272
- }[];
1273
- pagination: {
1274
- page: number;
1275
- limit: number;
1276
- total: number;
1277
- pages: number;
1278
- };
1279
- }>;
1280
- declare const getExternalAgentRelations: (db: DatabaseClient) => (params: {
1281
- scopes: GraphScopeConfig;
1282
- externalAgentId: string;
1216
+ declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
1217
+ scopes: ProjectScopeConfig;
1283
1218
  pagination?: PaginationConfig;
1219
+ graphId?: string;
1284
1220
  }) => Promise<{
1285
- data: {
1286
- createdAt: string;
1287
- updatedAt: string;
1288
- sourceAgentId: string;
1289
- targetAgentId: string | null;
1290
- externalAgentId: string | null;
1291
- relationType: string | null;
1292
- graphId: string;
1293
- projectId: string;
1294
- tenantId: string;
1295
- id: string;
1296
- }[];
1221
+ data: ApiKeySelect[];
1297
1222
  pagination: {
1298
1223
  page: number;
1299
1224
  limit: number;
@@ -1301,157 +1226,268 @@ declare const getExternalAgentRelations: (db: DatabaseClient) => (params: {
1301
1226
  pages: number;
1302
1227
  };
1303
1228
  }>;
1304
- declare const getRelatedAgentsForGraph: (db: DatabaseClient) => (params: {
1305
- scopes: GraphScopeConfig;
1306
- agentId: string;
1307
- }) => Promise<{
1308
- internalRelations: {
1309
- id: string;
1310
- name: string;
1311
- description: string;
1312
- relationType: string | null;
1313
- }[];
1314
- externalRelations: {
1315
- id: string;
1316
- relationType: string | null;
1317
- externalAgent: {
1318
- id: string;
1319
- name: string;
1320
- description: string;
1321
- baseUrl: string;
1322
- };
1323
- }[];
1324
- }>;
1325
- declare const createAgentRelation: (db: DatabaseClient) => (params: AgentRelationInsert) => Promise<{
1229
+ declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Promise<{
1326
1230
  tenantId: string;
1327
1231
  projectId: string;
1328
1232
  id: string;
1233
+ name: string | null;
1329
1234
  graphId: string;
1235
+ publicId: string;
1236
+ keyHash: string;
1237
+ keyPrefix: string;
1238
+ lastUsedAt: string | null;
1239
+ expiresAt: string | null;
1330
1240
  createdAt: string;
1331
1241
  updatedAt: string;
1332
- sourceAgentId: string;
1333
- targetAgentId: string | null;
1334
- externalAgentId: string | null;
1335
- relationType: string | null;
1336
1242
  }>;
1337
- /**
1338
- * Check if agent relation exists by graph, source, target, and relation type
1339
- */
1340
- declare const getAgentRelationByParams: (db: DatabaseClient) => (params: {
1341
- scopes: GraphScopeConfig;
1342
- sourceAgentId: string;
1343
- targetAgentId?: string;
1344
- externalAgentId?: string;
1345
- relationType: string;
1243
+ declare const updateApiKey: (db: DatabaseClient) => (params: {
1244
+ scopes: ProjectScopeConfig;
1245
+ id: string;
1246
+ data: ApiKeyUpdate;
1346
1247
  }) => Promise<{
1347
1248
  tenantId: string;
1348
1249
  projectId: string;
1349
1250
  id: string;
1251
+ name: string | null;
1350
1252
  graphId: string;
1253
+ publicId: string;
1254
+ keyHash: string;
1255
+ keyPrefix: string;
1256
+ lastUsedAt: string | null;
1257
+ expiresAt: string | null;
1351
1258
  createdAt: string;
1352
1259
  updatedAt: string;
1353
- sourceAgentId: string;
1354
- targetAgentId: string | null;
1355
- externalAgentId: string | null;
1356
- relationType: string | null;
1357
- } | undefined>;
1260
+ }>;
1261
+ declare const deleteApiKey: (db: DatabaseClient) => (params: {
1262
+ scopes: ProjectScopeConfig;
1263
+ id: string;
1264
+ }) => Promise<boolean>;
1265
+ declare const hasApiKey: (db: DatabaseClient) => (params: {
1266
+ scopes: ProjectScopeConfig;
1267
+ id: string;
1268
+ }) => Promise<boolean>;
1269
+ declare const updateApiKeyLastUsed: (db: DatabaseClient) => (id: string) => Promise<void>;
1270
+ declare const countApiKeys: (db: DatabaseClient) => (params: {
1271
+ scopes: ProjectScopeConfig;
1272
+ graphId?: string;
1273
+ }) => Promise<number>;
1358
1274
  /**
1359
- * Upsert agent relation (create if it doesn't exist, no-op if it does)
1275
+ * Create a new API key
1276
+ * Returns both the API key record and the full key (which should be shown to the user only once)
1360
1277
  */
1361
- declare const upsertAgentRelation: (db: DatabaseClient) => (params: AgentRelationInsert) => Promise<{
1278
+ declare const generateAndCreateApiKey: (params: CreateApiKeyParams, db: DatabaseClient) => Promise<ApiKeyCreateResult>;
1279
+ /**
1280
+ * Validate an API key and return the associated record if valid
1281
+ */
1282
+ declare const validateAndGetApiKey: (key: string, db: DatabaseClient) => Promise<ApiKeySelect | null>;
1283
+
1284
+ declare const getArtifactComponentById: (db: DatabaseClient) => (params: {
1285
+ scopes: ProjectScopeConfig;
1286
+ id: string;
1287
+ }) => Promise<{
1362
1288
  tenantId: string;
1363
1289
  projectId: string;
1364
1290
  id: string;
1365
- graphId: string;
1291
+ name: string;
1292
+ description: string;
1366
1293
  createdAt: string;
1367
1294
  updatedAt: string;
1368
- sourceAgentId: string;
1369
- targetAgentId: string | null;
1370
- externalAgentId: string | null;
1371
- relationType: string | null;
1295
+ props: Record<string, unknown> | null;
1296
+ } | undefined>;
1297
+ declare const listArtifactComponents: (db: DatabaseClient) => (params: {
1298
+ scopes: ProjectScopeConfig;
1299
+ }) => Promise<{
1300
+ createdAt: string;
1301
+ updatedAt: string;
1302
+ props: Record<string, unknown> | null;
1303
+ name: string;
1304
+ description: string;
1305
+ projectId: string;
1306
+ tenantId: string;
1307
+ id: string;
1308
+ }[]>;
1309
+ declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params: {
1310
+ scopes: ProjectScopeConfig;
1311
+ pagination?: PaginationConfig;
1312
+ }) => Promise<{
1313
+ data: ArtifactComponentSelect[];
1314
+ pagination: {
1315
+ page: number;
1316
+ limit: number;
1317
+ total: number;
1318
+ pages: number;
1319
+ };
1372
1320
  }>;
1373
- declare const createExternalAgentRelation: (db: DatabaseClient) => (params: ExternalAgentRelationInsert) => Promise<{
1321
+ declare const createArtifactComponent: (db: DatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
1374
1322
  tenantId: string;
1375
1323
  projectId: string;
1376
1324
  id: string;
1377
- graphId: string;
1325
+ name: string;
1326
+ description: string;
1378
1327
  createdAt: string;
1379
1328
  updatedAt: string;
1380
- sourceAgentId: string;
1381
- targetAgentId: string | null;
1382
- externalAgentId: string | null;
1383
- relationType: string | null;
1329
+ props: Record<string, unknown> | null;
1384
1330
  }>;
1385
- declare const updateAgentRelation: (db: DatabaseClient) => (params: {
1386
- scopes: GraphScopeConfig;
1387
- relationId: string;
1388
- data: AgentRelationUpdate;
1331
+ declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
1332
+ scopes: ProjectScopeConfig;
1333
+ id: string;
1334
+ data: ArtifactComponentUpdate;
1389
1335
  }) => Promise<{
1390
1336
  tenantId: string;
1391
1337
  projectId: string;
1392
1338
  id: string;
1393
- graphId: string;
1339
+ name: string;
1340
+ description: string;
1394
1341
  createdAt: string;
1395
1342
  updatedAt: string;
1396
- sourceAgentId: string;
1397
- targetAgentId: string | null;
1398
- externalAgentId: string | null;
1399
- relationType: string | null;
1343
+ props: Record<string, unknown> | null;
1400
1344
  }>;
1401
- declare const deleteAgentRelation: (db: DatabaseClient) => (params: {
1402
- scopes: GraphScopeConfig;
1403
- relationId: string;
1404
- }) => Promise<boolean>;
1405
- declare const deleteAgentRelationsByGraph: (db: DatabaseClient) => (params: {
1406
- scopes: GraphScopeConfig;
1345
+ declare const deleteArtifactComponent: (db: DatabaseClient) => (params: {
1346
+ scopes: ProjectScopeConfig;
1347
+ id: string;
1407
1348
  }) => Promise<boolean>;
1408
- declare const createAgentToolRelation: (db: DatabaseClient) => (params: {
1409
- scopes: GraphScopeConfig;
1410
- relationId?: string;
1411
- data: {
1412
- agentId: string;
1413
- toolId: string;
1414
- selectedTools?: string[] | null;
1415
- headers?: Record<string, string> | null;
1416
- };
1349
+ declare const getArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
1350
+ scopes: AgentScopeConfig;
1417
1351
  }) => Promise<{
1352
+ id: string;
1418
1353
  tenantId: string;
1419
1354
  projectId: string;
1420
- id: string;
1421
- graphId: string;
1422
- createdAt: string;
1423
- updatedAt: string;
1424
- headers: Record<string, string> | null;
1425
- toolId: string;
1426
- selectedTools: string[] | null;
1427
- agentId: string;
1428
- }>;
1429
- declare const updateAgentToolRelation: (db: DatabaseClient) => (params: {
1430
- scopes: GraphScopeConfig;
1431
- relationId: string;
1432
- data: AgentToolRelationUpdate;
1355
+ name: string;
1356
+ description: string;
1357
+ props: Record<string, unknown> | null;
1358
+ createdAt: string;
1359
+ updatedAt: string;
1360
+ }[]>;
1361
+ declare const associateArtifactComponentWithAgent: (db: DatabaseClient) => (params: {
1362
+ scopes: AgentScopeConfig;
1363
+ artifactComponentId: string;
1433
1364
  }) => Promise<{
1434
1365
  tenantId: string;
1435
1366
  projectId: string;
1436
1367
  id: string;
1437
1368
  graphId: string;
1438
1369
  createdAt: string;
1439
- updatedAt: string;
1440
- headers: Record<string, string> | null;
1441
- toolId: string;
1442
- selectedTools: string[] | null;
1443
- agentId: string;
1370
+ subAgentId: string;
1371
+ artifactComponentId: string;
1444
1372
  }>;
1445
- declare const deleteAgentToolRelation: (db: DatabaseClient) => (params: {
1446
- scopes: GraphScopeConfig;
1447
- relationId: string;
1373
+ declare const removeArtifactComponentFromAgent: (db: DatabaseClient) => (params: {
1374
+ scopes: AgentScopeConfig;
1375
+ artifactComponentId: string;
1448
1376
  }) => Promise<boolean>;
1449
- declare const deleteAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
1377
+ declare const deleteAgentArtifactComponentRelationByAgent: (db: DatabaseClient) => (params: {
1450
1378
  scopes: AgentScopeConfig;
1451
1379
  }) => Promise<boolean>;
1452
- declare const getAgentToolRelationById: (db: DatabaseClient) => (params: {
1380
+ declare const getAgentsUsingArtifactComponent: (db: DatabaseClient) => (params: {
1381
+ scopes: ProjectScopeConfig;
1382
+ artifactComponentId: string;
1383
+ }) => Promise<{
1384
+ graphId: string;
1385
+ subAgentId: string;
1386
+ createdAt: string;
1387
+ }[]>;
1388
+ declare const isArtifactComponentAssociatedWithAgent: (db: DatabaseClient) => (params: {
1453
1389
  scopes: AgentScopeConfig;
1454
- relationId: string;
1390
+ artifactComponentId: string;
1391
+ }) => Promise<boolean>;
1392
+ declare const graphHasArtifactComponents: (db: DatabaseClient) => (params: {
1393
+ scopes: GraphScopeConfig;
1394
+ }) => Promise<boolean>;
1395
+ declare const countArtifactComponents: (db: DatabaseClient) => (params: {
1396
+ scopes: ProjectScopeConfig;
1397
+ }) => Promise<number>;
1398
+ declare const countArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
1399
+ scopes: AgentScopeConfig;
1400
+ }) => Promise<number>;
1401
+ /**
1402
+ * Upsert agent-artifact component relation (create if it doesn't exist, no-op if it does)
1403
+ */
1404
+ declare const upsertAgentArtifactComponentRelation: (db: DatabaseClient) => (params: {
1405
+ scopes: AgentScopeConfig;
1406
+ artifactComponentId: string;
1407
+ }) => Promise<{
1408
+ tenantId: string;
1409
+ projectId: string;
1410
+ id: string;
1411
+ graphId: string;
1412
+ createdAt: string;
1413
+ subAgentId: string;
1414
+ artifactComponentId: string;
1415
+ } | null>;
1416
+ /**
1417
+ * Upsert an artifact component (create if it doesn't exist, update if it does)
1418
+ */
1419
+ declare const upsertArtifactComponent: (db: DatabaseClient) => (params: {
1420
+ data: ArtifactComponentInsert;
1421
+ }) => Promise<ArtifactComponentSelect>;
1422
+
1423
+ /**
1424
+ * Get cached context data for a conversation with optional request hash validation
1425
+ */
1426
+ declare const getCacheEntry: (db: DatabaseClient) => (params: {
1427
+ conversationId: string;
1428
+ contextConfigId: string;
1429
+ contextVariableKey: string;
1430
+ requestHash?: string;
1431
+ }) => Promise<ContextCacheSelect | null>;
1432
+ /**
1433
+ * Set cached context data for a conversation
1434
+ */
1435
+ declare const setCacheEntry: (db: DatabaseClient) => (entry: ContextCacheInsert) => Promise<ContextCacheSelect | null>;
1436
+ /**
1437
+ * Clear cache entries for a specific conversation
1438
+ */
1439
+ declare const clearConversationCache: (db: DatabaseClient) => (params: {
1440
+ scopes: ProjectScopeConfig;
1441
+ conversationId: string;
1442
+ }) => Promise<number>;
1443
+ /**
1444
+ * Clear all cache entries for a specific context configuration
1445
+ */
1446
+ declare const clearContextConfigCache: (db: DatabaseClient) => (params: {
1447
+ scopes: ProjectScopeConfig;
1448
+ contextConfigId: string;
1449
+ }) => Promise<number>;
1450
+ /**
1451
+ * Clean up all cache entries for a tenant
1452
+ */
1453
+ declare const cleanupTenantCache: (db: DatabaseClient) => (params: {
1454
+ scopes: ProjectScopeConfig;
1455
+ }) => Promise<number>;
1456
+ /**
1457
+ * Invalidate the headers cache for a conversation
1458
+ */
1459
+ declare const invalidateHeadersCache: (db: DatabaseClient) => (params: {
1460
+ scopes: ProjectScopeConfig;
1461
+ conversationId: string;
1462
+ contextConfigId: string;
1463
+ }) => Promise<number>;
1464
+ /**
1465
+ * Invalidate specific cache entries for invocation-trigger definitions
1466
+ */
1467
+ declare const invalidateInvocationDefinitionsCache: (db: DatabaseClient) => (params: {
1468
+ scopes: ProjectScopeConfig;
1469
+ conversationId: string;
1470
+ contextConfigId: string;
1471
+ invocationDefinitionIds: string[];
1472
+ }) => Promise<number>;
1473
+ /**
1474
+ * Get all cache entries for a conversation
1475
+ */
1476
+ declare const getConversationCacheEntries: (db: DatabaseClient) => (params: {
1477
+ scopes: ProjectScopeConfig;
1478
+ conversationId: string;
1479
+ }) => Promise<ContextCacheSelect[]>;
1480
+ /**
1481
+ * Get all cache entries for a context configuration
1482
+ */
1483
+ declare const getContextConfigCacheEntries: (db: DatabaseClient) => (params: {
1484
+ scopes: ProjectScopeConfig;
1485
+ contextConfigId: string;
1486
+ }) => Promise<ContextCacheSelect[]>;
1487
+
1488
+ declare const getContextConfigById: (db: DatabaseClient) => (params: {
1489
+ scopes: GraphScopeConfig;
1490
+ id: string;
1455
1491
  }) => Promise<{
1456
1492
  tenantId: string;
1457
1493
  projectId: string;
@@ -1459,51 +1495,26 @@ declare const getAgentToolRelationById: (db: DatabaseClient) => (params: {
1459
1495
  graphId: string;
1460
1496
  createdAt: string;
1461
1497
  updatedAt: string;
1462
- headers: Record<string, string> | null;
1463
- toolId: string;
1464
- selectedTools: string[] | null;
1465
- agentId: string;
1498
+ headersSchema: unknown;
1499
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1466
1500
  } | undefined>;
1467
- declare const getAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
1468
- scopes: AgentScopeConfig;
1469
- pagination?: PaginationConfig;
1501
+ declare const listContextConfigs: (db: DatabaseClient) => (params: {
1502
+ scopes: GraphScopeConfig;
1470
1503
  }) => Promise<{
1471
- data: {
1472
- createdAt: string;
1473
- updatedAt: string;
1474
- toolId: string;
1475
- selectedTools: string[] | null;
1476
- headers: Record<string, string> | null;
1477
- agentId: string;
1478
- graphId: string;
1479
- projectId: string;
1480
- tenantId: string;
1481
- id: string;
1482
- }[];
1483
- pagination: {
1484
- page: number;
1485
- limit: number;
1486
- total: number;
1487
- pages: number;
1488
- };
1489
- }>;
1490
- declare const getAgentToolRelationByTool: (db: DatabaseClient) => (params: {
1504
+ tenantId: string;
1505
+ projectId: string;
1506
+ id: string;
1507
+ graphId: string;
1508
+ createdAt: string;
1509
+ updatedAt: string;
1510
+ headersSchema: unknown;
1511
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1512
+ }[]>;
1513
+ declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
1491
1514
  scopes: GraphScopeConfig;
1492
- toolId: string;
1493
1515
  pagination?: PaginationConfig;
1494
1516
  }) => Promise<{
1495
- data: {
1496
- createdAt: string;
1497
- updatedAt: string;
1498
- toolId: string;
1499
- selectedTools: string[] | null;
1500
- headers: Record<string, string> | null;
1501
- agentId: string;
1502
- graphId: string;
1503
- projectId: string;
1504
- tenantId: string;
1505
- id: string;
1506
- }[];
1517
+ data: any[];
1507
1518
  pagination: {
1508
1519
  page: number;
1509
1520
  limit: number;
@@ -1511,393 +1522,223 @@ declare const getAgentToolRelationByTool: (db: DatabaseClient) => (params: {
1511
1522
  pages: number;
1512
1523
  };
1513
1524
  }>;
1514
- declare const listAgentToolRelations: (db: DatabaseClient) => (params: {
1525
+ declare const createContextConfig: (db: DatabaseClient) => (params: ContextConfigInsert) => Promise<{
1526
+ tenantId: string;
1527
+ projectId: string;
1528
+ id: string;
1529
+ graphId: string;
1530
+ createdAt: string;
1531
+ updatedAt: string;
1532
+ headersSchema: unknown;
1533
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1534
+ }>;
1535
+ declare const updateContextConfig: (db: DatabaseClient) => (params: {
1515
1536
  scopes: GraphScopeConfig;
1516
- pagination?: PaginationConfig;
1537
+ id: string;
1538
+ data: Partial<ContextConfigUpdate>;
1517
1539
  }) => Promise<{
1518
- data: {
1519
- createdAt: string;
1520
- updatedAt: string;
1521
- toolId: string;
1522
- selectedTools: string[] | null;
1523
- headers: Record<string, string> | null;
1524
- agentId: string;
1525
- graphId: string;
1526
- projectId: string;
1527
- tenantId: string;
1528
- id: string;
1529
- }[];
1530
- pagination: {
1531
- page: number;
1532
- limit: number;
1533
- total: number;
1534
- pages: number;
1535
- };
1540
+ tenantId: string;
1541
+ projectId: string;
1542
+ id: string;
1543
+ graphId: string;
1544
+ createdAt: string;
1545
+ updatedAt: string;
1546
+ headersSchema: unknown;
1547
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1536
1548
  }>;
1537
- declare const getToolsForAgent: (db: DatabaseClient) => (params: {
1538
- scopes: AgentScopeConfig;
1539
- pagination?: PaginationConfig;
1549
+ declare const deleteContextConfig: (db: DatabaseClient) => (params: {
1550
+ scopes: GraphScopeConfig;
1551
+ id: string;
1552
+ }) => Promise<boolean>;
1553
+ declare const hasContextConfig: (db: DatabaseClient) => (params: {
1554
+ scopes: GraphScopeConfig;
1555
+ id: string;
1556
+ }) => Promise<boolean>;
1557
+ declare const countContextConfigs: (db: DatabaseClient) => (params: {
1558
+ scopes: GraphScopeConfig;
1559
+ }) => Promise<number>;
1560
+ /**
1561
+ * Upsert a context config (create if it doesn't exist, update if it does)
1562
+ */
1563
+ declare const upsertContextConfig: (db: DatabaseClient) => (params: {
1564
+ data: ContextConfigInsert;
1540
1565
  }) => Promise<{
1541
- data: {
1542
- id: string;
1543
- tenantId: string;
1544
- agentId: string;
1545
- toolId: string;
1546
- selectedTools: string[] | null;
1547
- headers: Record<string, string> | null;
1548
- createdAt: string;
1549
- updatedAt: string;
1550
- tool: {
1551
- id: string;
1552
- name: string;
1553
- description: string | null;
1554
- config: {
1555
- type: "mcp";
1556
- mcp: ToolMcpConfig;
1557
- } | {
1558
- type: "function";
1559
- function?: {
1560
- inputSchema: Record<string, unknown>;
1561
- executeCode: string;
1562
- dependencies: Record<string, unknown>;
1563
- };
1564
- };
1565
- functionId: string | null;
1566
- createdAt: string;
1567
- updatedAt: string;
1568
- capabilities: ToolServerCapabilities | null;
1569
- lastError: string | null;
1570
- credentialReferenceId: string | null;
1571
- tenantId: string;
1572
- projectId: string;
1573
- headers: Record<string, string> | null;
1574
- imageUrl: string | null;
1575
- };
1576
- }[];
1577
- pagination: {
1578
- page: number;
1579
- limit: number;
1580
- total: number;
1581
- pages: number;
1582
- };
1566
+ tenantId: string;
1567
+ projectId: string;
1568
+ id: string;
1569
+ graphId: string;
1570
+ createdAt: string;
1571
+ updatedAt: string;
1572
+ headersSchema: unknown;
1573
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1583
1574
  }>;
1584
- declare const getAgentsForTool: (db: DatabaseClient) => (params: {
1585
- scopes: GraphScopeConfig;
1586
- toolId: string;
1575
+
1576
+ declare const listConversations: (db: DatabaseClient) => (params: {
1577
+ scopes: ProjectScopeConfig;
1578
+ userId?: string;
1587
1579
  pagination?: PaginationConfig;
1588
1580
  }) => Promise<{
1589
- data: {
1590
- id: string;
1591
- tenantId: string;
1592
- agentId: string;
1593
- toolId: string;
1594
- selectedTools: string[] | null;
1595
- headers: Record<string, string> | null;
1596
- createdAt: string;
1597
- updatedAt: string;
1598
- agent: {
1599
- id: string;
1600
- name: string;
1601
- description: string;
1602
- prompt: string;
1603
- conversationHistoryConfig: ConversationHistoryConfig | null;
1604
- models: {
1605
- base?: {
1606
- model?: string | undefined;
1607
- providerOptions?: Record<string, any> | undefined;
1608
- } | undefined;
1609
- structuredOutput?: {
1610
- model?: string | undefined;
1611
- providerOptions?: Record<string, any> | undefined;
1612
- } | undefined;
1613
- summarizer?: {
1614
- model?: string | undefined;
1615
- providerOptions?: Record<string, any> | undefined;
1616
- } | undefined;
1617
- } | null;
1618
- stopWhen: {
1619
- stepCountIs?: number | undefined;
1620
- } | null;
1621
- createdAt: string;
1622
- updatedAt: string;
1623
- };
1624
- }[];
1625
- pagination: {
1626
- page: number;
1627
- limit: number;
1628
- total: number;
1629
- pages: number;
1630
- };
1581
+ conversations: ConversationSelect[];
1582
+ total: number;
1631
1583
  }>;
1632
- declare const validateInternalAgent: (db: DatabaseClient) => (params: {
1633
- scopes: AgentScopeConfig;
1634
- }) => Promise<boolean>;
1635
- declare const validateExternalAgent: (db: DatabaseClient) => (params: {
1636
- scopes: AgentScopeConfig;
1637
- }) => Promise<boolean>;
1638
-
1639
- declare const getAgentById: (db: DatabaseClient) => (params: {
1640
- scopes: GraphScopeConfig;
1641
- agentId: string;
1642
- }) => Promise<{
1584
+ declare const createConversation: (db: DatabaseClient) => (params: ConversationInsert) => Promise<{
1643
1585
  tenantId: string;
1644
1586
  projectId: string;
1645
1587
  id: string;
1646
- name: string;
1647
- description: string;
1648
- prompt: string;
1649
- graphId: string;
1650
1588
  createdAt: string;
1651
1589
  updatedAt: string;
1652
- models: {
1653
- base?: {
1654
- model?: string | undefined;
1655
- providerOptions?: Record<string, any> | undefined;
1656
- } | undefined;
1657
- structuredOutput?: {
1658
- model?: string | undefined;
1659
- providerOptions?: Record<string, any> | undefined;
1660
- } | undefined;
1661
- summarizer?: {
1662
- model?: string | undefined;
1663
- providerOptions?: Record<string, any> | undefined;
1664
- } | undefined;
1665
- } | null;
1666
- stopWhen: {
1667
- stepCountIs?: number | undefined;
1668
- } | null;
1669
- conversationHistoryConfig: ConversationHistoryConfig | null;
1670
- } | undefined>;
1671
- declare const listAgents: (db: DatabaseClient) => (params: {
1672
- scopes: GraphScopeConfig;
1590
+ title: string | null;
1591
+ metadata: ConversationMetadata | null;
1592
+ userId: string | null;
1593
+ activeSubAgentId: string;
1594
+ lastContextResolution: string | null;
1595
+ }>;
1596
+ declare const updateConversation: (db: DatabaseClient) => (params: {
1597
+ scopes: ProjectScopeConfig;
1598
+ conversationId: string;
1599
+ data: ConversationUpdate;
1673
1600
  }) => Promise<{
1674
1601
  tenantId: string;
1675
1602
  projectId: string;
1676
1603
  id: string;
1677
- name: string;
1678
- description: string;
1679
- prompt: string;
1680
- graphId: string;
1681
1604
  createdAt: string;
1682
1605
  updatedAt: string;
1683
- models: {
1684
- base?: {
1685
- model?: string | undefined;
1686
- providerOptions?: Record<string, any> | undefined;
1687
- } | undefined;
1688
- structuredOutput?: {
1689
- model?: string | undefined;
1690
- providerOptions?: Record<string, any> | undefined;
1691
- } | undefined;
1692
- summarizer?: {
1693
- model?: string | undefined;
1694
- providerOptions?: Record<string, any> | undefined;
1695
- } | undefined;
1696
- } | null;
1697
- stopWhen: {
1698
- stepCountIs?: number | undefined;
1699
- } | null;
1700
- conversationHistoryConfig: ConversationHistoryConfig | null;
1701
- }[]>;
1702
- declare const listAgentsPaginated: (db: DatabaseClient) => (params: {
1703
- scopes: GraphScopeConfig;
1704
- pagination?: PaginationConfig;
1705
- }) => Promise<{
1706
- data: {
1707
- createdAt: string;
1708
- updatedAt: string;
1709
- prompt: string;
1710
- conversationHistoryConfig: ConversationHistoryConfig | null;
1711
- models: {
1712
- base?: {
1713
- model?: string | undefined;
1714
- providerOptions?: Record<string, any> | undefined;
1715
- } | undefined;
1716
- structuredOutput?: {
1717
- model?: string | undefined;
1718
- providerOptions?: Record<string, any> | undefined;
1719
- } | undefined;
1720
- summarizer?: {
1721
- model?: string | undefined;
1722
- providerOptions?: Record<string, any> | undefined;
1723
- } | undefined;
1724
- } | null;
1725
- stopWhen: {
1726
- stepCountIs?: number | undefined;
1727
- } | null;
1728
- name: string;
1729
- description: string;
1730
- graphId: string;
1731
- projectId: string;
1732
- tenantId: string;
1733
- id: string;
1734
- }[];
1735
- pagination: {
1736
- page: number;
1737
- limit: number;
1738
- total: number;
1739
- pages: number;
1740
- };
1606
+ title: string | null;
1607
+ metadata: ConversationMetadata | null;
1608
+ userId: string | null;
1609
+ activeSubAgentId: string;
1610
+ lastContextResolution: string | null;
1741
1611
  }>;
1742
- declare const createAgent: (db: DatabaseClient) => (params: AgentInsert) => Promise<{
1612
+ declare const deleteConversation: (db: DatabaseClient) => (params: {
1613
+ scopes: ProjectScopeConfig;
1614
+ conversationId: string;
1615
+ }) => Promise<boolean>;
1616
+ declare const updateConversationActiveAgent: (db: DatabaseClient) => (params: {
1617
+ scopes: ProjectScopeConfig;
1618
+ conversationId: string;
1619
+ activeSubAgentId: string;
1620
+ }) => Promise<{
1743
1621
  tenantId: string;
1744
1622
  projectId: string;
1745
1623
  id: string;
1746
- name: string;
1747
- description: string;
1748
- prompt: string;
1749
- graphId: string;
1750
1624
  createdAt: string;
1751
1625
  updatedAt: string;
1752
- models: {
1753
- base?: {
1754
- model?: string | undefined;
1755
- providerOptions?: Record<string, any> | undefined;
1756
- } | undefined;
1757
- structuredOutput?: {
1758
- model?: string | undefined;
1759
- providerOptions?: Record<string, any> | undefined;
1760
- } | undefined;
1761
- summarizer?: {
1762
- model?: string | undefined;
1763
- providerOptions?: Record<string, any> | undefined;
1764
- } | undefined;
1765
- } | null;
1766
- stopWhen: {
1767
- stepCountIs?: number | undefined;
1768
- } | null;
1769
- conversationHistoryConfig: ConversationHistoryConfig | null;
1626
+ title: string | null;
1627
+ metadata: ConversationMetadata | null;
1628
+ userId: string | null;
1629
+ activeSubAgentId: string;
1630
+ lastContextResolution: string | null;
1770
1631
  }>;
1771
- declare const updateAgent: (db: DatabaseClient) => (params: {
1772
- scopes: GraphScopeConfig;
1773
- agentId: string;
1774
- data: AgentUpdate;
1632
+ declare const getConversation: (db: DatabaseClient) => (params: {
1633
+ scopes: ProjectScopeConfig;
1634
+ conversationId: string;
1775
1635
  }) => Promise<{
1776
1636
  tenantId: string;
1777
1637
  projectId: string;
1778
1638
  id: string;
1779
- name: string;
1780
- description: string;
1781
- prompt: string;
1782
- graphId: string;
1783
1639
  createdAt: string;
1784
1640
  updatedAt: string;
1785
- models: {
1786
- base?: {
1787
- model?: string | undefined;
1788
- providerOptions?: Record<string, any> | undefined;
1789
- } | undefined;
1790
- structuredOutput?: {
1791
- model?: string | undefined;
1792
- providerOptions?: Record<string, any> | undefined;
1793
- } | undefined;
1794
- summarizer?: {
1795
- model?: string | undefined;
1796
- providerOptions?: Record<string, any> | undefined;
1797
- } | undefined;
1798
- } | null;
1799
- stopWhen: {
1800
- stepCountIs?: number | undefined;
1801
- } | null;
1802
- conversationHistoryConfig: ConversationHistoryConfig | null;
1803
- }>;
1804
- /**
1805
- * Upsert agent (create if it doesn't exist, update if it does)
1806
- */
1807
- declare const upsertAgent: (db: DatabaseClient) => (params: {
1808
- data: AgentInsert;
1809
- }) => Promise<AgentSelect>;
1810
- declare const deleteAgent: (db: DatabaseClient) => (params: {
1811
- scopes: GraphScopeConfig;
1812
- agentId: string;
1813
- }) => Promise<boolean>;
1814
- declare const getAgentsByIds: (db: DatabaseClient) => (params: {
1815
- scopes: GraphScopeConfig;
1816
- agentIds: string[];
1817
- }) => Promise<{
1818
- createdAt: string;
1819
- updatedAt: string;
1820
- prompt: string;
1821
- conversationHistoryConfig: ConversationHistoryConfig | null;
1822
- models: {
1823
- base?: {
1824
- model?: string | undefined;
1825
- providerOptions?: Record<string, any> | undefined;
1826
- } | undefined;
1827
- structuredOutput?: {
1828
- model?: string | undefined;
1829
- providerOptions?: Record<string, any> | undefined;
1830
- } | undefined;
1831
- summarizer?: {
1832
- model?: string | undefined;
1833
- providerOptions?: Record<string, any> | undefined;
1834
- } | undefined;
1835
- } | null;
1836
- stopWhen: {
1837
- stepCountIs?: number | undefined;
1838
- } | null;
1839
- name: string;
1840
- description: string;
1841
- graphId: string;
1641
+ title: string | null;
1642
+ metadata: ConversationMetadata | null;
1643
+ userId: string | null;
1644
+ activeSubAgentId: string;
1645
+ lastContextResolution: string | null;
1646
+ } | undefined>;
1647
+ declare const createOrGetConversation: (db: DatabaseClient) => (input: ConversationInsert) => Promise<{
1648
+ activeSubAgentId: string;
1842
1649
  projectId: string;
1843
1650
  tenantId: string;
1844
1651
  id: string;
1845
- }[]>;
1846
-
1847
- declare const getApiKeyById: (db: DatabaseClient) => (params: {
1848
- scopes: ProjectScopeConfig;
1849
- id: string;
1850
- }) => Promise<{
1652
+ createdAt?: string | undefined;
1653
+ updatedAt?: string | undefined;
1654
+ userId?: string | null | undefined;
1655
+ title?: string | null | undefined;
1656
+ lastContextResolution?: string | null | undefined;
1657
+ metadata?: ConversationMetadata | null | undefined;
1658
+ contextConfigId?: string | undefined;
1659
+ } | {
1851
1660
  tenantId: string;
1852
1661
  projectId: string;
1853
1662
  id: string;
1854
- name: string | null;
1855
- graphId: string;
1856
- publicId: string;
1857
- keyHash: string;
1858
- keyPrefix: string;
1859
- lastUsedAt: string | null;
1860
- expiresAt: string | null;
1861
1663
  createdAt: string;
1862
1664
  updatedAt: string;
1863
- } | undefined>;
1864
- declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) => Promise<{
1665
+ title: string | null;
1666
+ metadata: ConversationMetadata | null;
1667
+ userId: string | null;
1668
+ activeSubAgentId: string;
1669
+ lastContextResolution: string | null;
1670
+ }>;
1671
+ /**
1672
+ * Get conversation history with filtering and context management
1673
+ */
1674
+ declare const getConversationHistory: (db: DatabaseClient) => (params: {
1675
+ scopes: ProjectScopeConfig;
1676
+ conversationId: string;
1677
+ options?: ConversationHistoryConfig;
1678
+ }) => Promise<any[]>;
1679
+ /**
1680
+ * Get active agent for a conversation
1681
+ */
1682
+ declare const getActiveAgentForConversation: (db: DatabaseClient) => (params: {
1683
+ scopes: ProjectScopeConfig;
1684
+ conversationId: string;
1685
+ }) => Promise<{
1865
1686
  tenantId: string;
1866
1687
  projectId: string;
1867
1688
  id: string;
1868
- name: string | null;
1869
- graphId: string;
1870
- publicId: string;
1871
- keyHash: string;
1872
- keyPrefix: string;
1873
- lastUsedAt: string | null;
1874
- expiresAt: string | null;
1875
1689
  createdAt: string;
1876
1690
  updatedAt: string;
1691
+ title: string | null;
1692
+ metadata: ConversationMetadata | null;
1693
+ userId: string | null;
1694
+ activeSubAgentId: string;
1695
+ lastContextResolution: string | null;
1877
1696
  } | undefined>;
1878
- declare const listApiKeys: (db: DatabaseClient) => (params: {
1697
+ /**
1698
+ * Set active agent for a conversation (upsert operation)
1699
+ */
1700
+ declare const setActiveAgentForConversation: (db: DatabaseClient) => (params: {
1701
+ scopes: ProjectScopeConfig;
1702
+ conversationId: string;
1703
+ subAgentId: string;
1704
+ }) => Promise<void>;
1705
+ declare const setActiveAgentForThread: (db: DatabaseClient) => ({ scopes, threadId, subAgentId, }: {
1706
+ scopes: ProjectScopeConfig;
1707
+ threadId: string;
1708
+ subAgentId: string;
1709
+ }) => Promise<void>;
1710
+
1711
+ type CredentialReferenceWithTools = CredentialReferenceSelect & {
1712
+ tools: ToolSelect[];
1713
+ };
1714
+ /**
1715
+ * Get a credential reference by ID
1716
+ */
1717
+ declare const getCredentialReference: (db: DatabaseClient) => (params: {
1879
1718
  scopes: ProjectScopeConfig;
1880
- graphId?: string;
1881
- }) => Promise<{
1882
- tenantId: string;
1883
- projectId: string;
1884
1719
  id: string;
1885
- name: string | null;
1886
- graphId: string;
1887
- publicId: string;
1888
- keyHash: string;
1889
- keyPrefix: string;
1890
- lastUsedAt: string | null;
1891
- expiresAt: string | null;
1892
- createdAt: string;
1893
- updatedAt: string;
1894
- }[]>;
1895
- declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
1720
+ }) => Promise<CredentialReferenceSelect | undefined>;
1721
+ /**
1722
+ * Get a credential reference by ID with its related tools
1723
+ */
1724
+ declare const getCredentialReferenceWithTools: (db: DatabaseClient) => (params: {
1725
+ scopes: ProjectScopeConfig;
1726
+ id: string;
1727
+ }) => Promise<CredentialReferenceWithTools | undefined>;
1728
+ /**
1729
+ * List all credential references for a tenant/project
1730
+ */
1731
+ declare const listCredentialReferences: (db: DatabaseClient) => (params: {
1732
+ scopes: ProjectScopeConfig;
1733
+ }) => Promise<CredentialReferenceSelect[]>;
1734
+ /**
1735
+ * List credential references with pagination
1736
+ */
1737
+ declare const listCredentialReferencesPaginated: (db: DatabaseClient) => (params: {
1896
1738
  scopes: ProjectScopeConfig;
1897
1739
  pagination?: PaginationConfig;
1898
- graphId?: string;
1899
1740
  }) => Promise<{
1900
- data: ApiKeySelect[];
1741
+ data: CredentialReferenceSelect[];
1901
1742
  pagination: {
1902
1743
  page: number;
1903
1744
  limit: number;
@@ -1905,91 +1746,73 @@ declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
1905
1746
  pages: number;
1906
1747
  };
1907
1748
  }>;
1908
- declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Promise<{
1909
- tenantId: string;
1910
- projectId: string;
1911
- id: string;
1912
- name: string | null;
1913
- graphId: string;
1914
- publicId: string;
1915
- keyHash: string;
1916
- keyPrefix: string;
1917
- lastUsedAt: string | null;
1918
- expiresAt: string | null;
1919
- createdAt: string;
1920
- updatedAt: string;
1921
- }>;
1922
- declare const updateApiKey: (db: DatabaseClient) => (params: {
1749
+ /**
1750
+ * Create a new credential reference
1751
+ */
1752
+ declare const createCredentialReference: (db: DatabaseClient) => (params: CredentialReferenceInsert) => Promise<CredentialReferenceSelect>;
1753
+ /**
1754
+ * Update a credential reference
1755
+ */
1756
+ declare const updateCredentialReference: (db: DatabaseClient) => (params: {
1923
1757
  scopes: ProjectScopeConfig;
1924
1758
  id: string;
1925
- data: ApiKeyUpdate;
1926
- }) => Promise<{
1927
- tenantId: string;
1928
- projectId: string;
1929
- id: string;
1930
- name: string | null;
1931
- graphId: string;
1932
- publicId: string;
1933
- keyHash: string;
1934
- keyPrefix: string;
1935
- lastUsedAt: string | null;
1936
- expiresAt: string | null;
1937
- createdAt: string;
1938
- updatedAt: string;
1939
- }>;
1940
- declare const deleteApiKey: (db: DatabaseClient) => (params: {
1759
+ data: Partial<CredentialReferenceUpdate>;
1760
+ }) => Promise<CredentialReferenceWithTools | undefined>;
1761
+ /**
1762
+ * Delete a credential reference
1763
+ */
1764
+ declare const deleteCredentialReference: (db: DatabaseClient) => (params: {
1941
1765
  scopes: ProjectScopeConfig;
1942
1766
  id: string;
1943
1767
  }) => Promise<boolean>;
1944
- declare const hasApiKey: (db: DatabaseClient) => (params: {
1768
+ /**
1769
+ * Check if a credential reference exists
1770
+ */
1771
+ declare const hasCredentialReference: (db: DatabaseClient) => (params: {
1945
1772
  scopes: ProjectScopeConfig;
1946
1773
  id: string;
1947
1774
  }) => Promise<boolean>;
1948
- declare const updateApiKeyLastUsed: (db: DatabaseClient) => (id: string) => Promise<void>;
1949
- declare const countApiKeys: (db: DatabaseClient) => (params: {
1775
+ /**
1776
+ * Get credential reference by ID (simple version without tools)
1777
+ */
1778
+ declare const getCredentialReferenceById: (db: DatabaseClient) => (params: {
1950
1779
  scopes: ProjectScopeConfig;
1951
- graphId?: string;
1952
- }) => Promise<number>;
1780
+ id: string;
1781
+ }) => Promise<CredentialReferenceSelect | null>;
1953
1782
  /**
1954
- * Create a new API key
1955
- * Returns both the API key record and the full key (which should be shown to the user only once)
1783
+ * Count credential references for a tenant/project
1956
1784
  */
1957
- declare const generateAndCreateApiKey: (params: CreateApiKeyParams, db: DatabaseClient) => Promise<ApiKeyCreateResult>;
1785
+ declare const countCredentialReferences: (db: DatabaseClient) => (params: {
1786
+ scopes: ProjectScopeConfig;
1787
+ }) => Promise<number>;
1958
1788
  /**
1959
- * Validate an API key and return the associated record if valid
1789
+ * Upsert a credential reference (create if it doesn't exist, update if it does)
1960
1790
  */
1961
- declare const validateAndGetApiKey: (key: string, db: DatabaseClient) => Promise<ApiKeySelect | null>;
1791
+ declare const upsertCredentialReference: (db: DatabaseClient) => (params: {
1792
+ data: CredentialReferenceInsert;
1793
+ }) => Promise<CredentialReferenceSelect>;
1962
1794
 
1963
- declare const getArtifactComponentById: (db: DatabaseClient) => (params: {
1795
+ /**
1796
+ * Get a data component by ID
1797
+ */
1798
+ declare const getDataComponent: (db: DatabaseClient) => (params: {
1964
1799
  scopes: ProjectScopeConfig;
1965
- id: string;
1966
- }) => Promise<{
1967
- tenantId: string;
1968
- projectId: string;
1969
- id: string;
1970
- name: string;
1971
- description: string;
1972
- createdAt: string;
1973
- updatedAt: string;
1974
- props: Record<string, unknown> | null;
1975
- } | undefined>;
1976
- declare const listArtifactComponents: (db: DatabaseClient) => (params: {
1800
+ dataComponentId: string;
1801
+ }) => Promise<DataComponentSelect | null>;
1802
+ /**
1803
+ * List all data components for a tenant/project
1804
+ */
1805
+ declare const listDataComponents: (db: DatabaseClient) => (params: {
1977
1806
  scopes: ProjectScopeConfig;
1978
- }) => Promise<{
1979
- createdAt: string;
1980
- updatedAt: string;
1981
- props: Record<string, unknown> | null;
1982
- name: string;
1983
- description: string;
1984
- projectId: string;
1985
- tenantId: string;
1986
- id: string;
1987
- }[]>;
1988
- declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params: {
1807
+ }) => Promise<DataComponentSelect[]>;
1808
+ /**
1809
+ * List data components with pagination
1810
+ */
1811
+ declare const listDataComponentsPaginated: (db: DatabaseClient) => (params: {
1989
1812
  scopes: ProjectScopeConfig;
1990
1813
  pagination?: PaginationConfig;
1991
1814
  }) => Promise<{
1992
- data: ArtifactComponentSelect[];
1815
+ data: DataComponentSelect[];
1993
1816
  pagination: {
1994
1817
  page: number;
1995
1818
  limit: number;
@@ -1997,203 +1820,245 @@ declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params:
1997
1820
  pages: number;
1998
1821
  };
1999
1822
  }>;
2000
- declare const createArtifactComponent: (db: DatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
2001
- tenantId: string;
2002
- projectId: string;
2003
- id: string;
2004
- name: string;
2005
- description: string;
2006
- createdAt: string;
2007
- updatedAt: string;
2008
- props: Record<string, unknown> | null;
2009
- }>;
2010
- declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
1823
+ /**
1824
+ * Create a new data component
1825
+ */
1826
+ declare const createDataComponent: (db: DatabaseClient) => (params: DataComponentInsert) => Promise<DataComponentSelect>;
1827
+ /**
1828
+ * Update a data component
1829
+ */
1830
+ declare const updateDataComponent: (db: DatabaseClient) => (params: {
2011
1831
  scopes: ProjectScopeConfig;
2012
- id: string;
2013
- data: ArtifactComponentUpdate;
2014
- }) => Promise<{
2015
- tenantId: string;
2016
- projectId: string;
2017
- id: string;
2018
- name: string;
2019
- description: string;
2020
- createdAt: string;
2021
- updatedAt: string;
2022
- props: Record<string, unknown> | null;
2023
- }>;
2024
- declare const deleteArtifactComponent: (db: DatabaseClient) => (params: {
1832
+ dataComponentId: string;
1833
+ data: DataComponentUpdate;
1834
+ }) => Promise<DataComponentSelect | null>;
1835
+ /**
1836
+ * Delete a data component
1837
+ */
1838
+ declare const deleteDataComponent: (db: DatabaseClient) => (params: {
2025
1839
  scopes: ProjectScopeConfig;
2026
- id: string;
1840
+ dataComponentId: string;
2027
1841
  }) => Promise<boolean>;
2028
- declare const getArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
1842
+ /**
1843
+ * Get data components for a specific agent
1844
+ */
1845
+ declare const getDataComponentsForAgent: (db: DatabaseClient) => (params: {
2029
1846
  scopes: AgentScopeConfig;
2030
- }) => Promise<{
2031
- id: string;
2032
- tenantId: string;
2033
- projectId: string;
2034
- name: string;
2035
- description: string;
2036
- props: Record<string, unknown> | null;
2037
- createdAt: string;
2038
- updatedAt: string;
2039
- }[]>;
2040
- declare const associateArtifactComponentWithAgent: (db: DatabaseClient) => (params: {
1847
+ }) => Promise<DataComponentSelect[]>;
1848
+ /**
1849
+ * Associate a data component with an agent
1850
+ */
1851
+ declare const associateDataComponentWithAgent: (db: DatabaseClient) => (params: {
2041
1852
  scopes: AgentScopeConfig;
2042
- artifactComponentId: string;
1853
+ dataComponentId: string;
2043
1854
  }) => Promise<{
2044
1855
  tenantId: string;
2045
1856
  projectId: string;
2046
1857
  id: string;
2047
1858
  graphId: string;
2048
1859
  createdAt: string;
2049
- agentId: string;
2050
- artifactComponentId: string;
1860
+ subAgentId: string;
1861
+ dataComponentId: string;
2051
1862
  }>;
2052
- declare const removeArtifactComponentFromAgent: (db: DatabaseClient) => (params: {
1863
+ /**
1864
+ * Remove association between data component and agent
1865
+ */
1866
+ declare const removeDataComponentFromAgent: (db: DatabaseClient) => (params: {
2053
1867
  scopes: AgentScopeConfig;
2054
- artifactComponentId: string;
1868
+ dataComponentId: string;
2055
1869
  }) => Promise<boolean>;
2056
- declare const deleteAgentArtifactComponentRelationByAgent: (db: DatabaseClient) => (params: {
1870
+ declare const deleteAgentDataComponentRelationByAgent: (db: DatabaseClient) => (params: {
2057
1871
  scopes: AgentScopeConfig;
2058
1872
  }) => Promise<boolean>;
2059
- declare const getAgentsUsingArtifactComponent: (db: DatabaseClient) => (params: {
1873
+ /**
1874
+ * Get all agents that use a specific data component
1875
+ */
1876
+ declare const getAgentsUsingDataComponent: (db: DatabaseClient) => (params: {
2060
1877
  scopes: ProjectScopeConfig;
2061
- artifactComponentId: string;
1878
+ dataComponentId: string;
2062
1879
  }) => Promise<{
2063
- graphId: string;
2064
- agentId: string;
1880
+ subAgentId: string;
2065
1881
  createdAt: string;
2066
1882
  }[]>;
2067
- declare const isArtifactComponentAssociatedWithAgent: (db: DatabaseClient) => (params: {
1883
+ /**
1884
+ * Check if a data component is associated with an agent
1885
+ */
1886
+ declare const isDataComponentAssociatedWithAgent: (db: DatabaseClient) => (params: {
2068
1887
  scopes: AgentScopeConfig;
2069
- artifactComponentId: string;
2070
- }) => Promise<boolean>;
2071
- declare const graphHasArtifactComponents: (db: DatabaseClient) => (params: {
2072
- scopes: GraphScopeConfig;
1888
+ dataComponentId: string;
2073
1889
  }) => Promise<boolean>;
2074
- declare const countArtifactComponents: (db: DatabaseClient) => (params: {
2075
- scopes: ProjectScopeConfig;
2076
- }) => Promise<number>;
2077
- declare const countArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
2078
- scopes: AgentScopeConfig;
2079
- }) => Promise<number>;
2080
1890
  /**
2081
- * Upsert agent-artifact component relation (create if it doesn't exist, no-op if it does)
1891
+ * Upsert agent-data component relation (create if it doesn't exist, no-op if it does)
2082
1892
  */
2083
- declare const upsertAgentArtifactComponentRelation: (db: DatabaseClient) => (params: {
1893
+ declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params: {
2084
1894
  scopes: AgentScopeConfig;
2085
- artifactComponentId: string;
1895
+ dataComponentId: string;
2086
1896
  }) => Promise<{
2087
1897
  tenantId: string;
2088
1898
  projectId: string;
2089
1899
  id: string;
2090
1900
  graphId: string;
2091
1901
  createdAt: string;
2092
- agentId: string;
2093
- artifactComponentId: string;
1902
+ subAgentId: string;
1903
+ dataComponentId: string;
2094
1904
  } | null>;
2095
1905
  /**
2096
- * Upsert an artifact component (create if it doesn't exist, update if it does)
1906
+ * Count data components for a tenant/project
2097
1907
  */
2098
- declare const upsertArtifactComponent: (db: DatabaseClient) => (params: {
2099
- data: ArtifactComponentInsert;
2100
- }) => Promise<ArtifactComponentSelect>;
1908
+ declare const countDataComponents: (db: DatabaseClient) => (params: {
1909
+ scopes: ProjectScopeConfig;
1910
+ }) => Promise<number>;
1911
+ /**
1912
+ * Upsert a data component (create if it doesn't exist, update if it does)
1913
+ */
1914
+ declare const upsertDataComponent: (db: DatabaseClient) => (params: {
1915
+ data: DataComponentInsert;
1916
+ }) => Promise<DataComponentSelect | null>;
2101
1917
 
2102
1918
  /**
2103
- * Get cached context data for a conversation with optional request hash validation
1919
+ * Create a new external agent
2104
1920
  */
2105
- declare const getCacheEntry: (db: DatabaseClient) => (params: {
2106
- conversationId: string;
2107
- contextConfigId: string;
2108
- contextVariableKey: string;
2109
- requestHash?: string;
2110
- }) => Promise<ContextCacheSelect | null>;
1921
+ declare const createExternalAgent: (db: DatabaseClient) => (params: ExternalAgentInsert) => Promise<ExternalAgentSelect>;
2111
1922
  /**
2112
- * Set cached context data for a conversation
1923
+ * Get external agent by ID
2113
1924
  */
2114
- declare const setCacheEntry: (db: DatabaseClient) => (entry: ContextCacheInsert) => Promise<ContextCacheSelect | null>;
1925
+ declare const getExternalAgent: (db: DatabaseClient) => (params: {
1926
+ scopes: GraphScopeConfig;
1927
+ subAgentId: string;
1928
+ }) => Promise<ExternalAgentSelect | null>;
2115
1929
  /**
2116
- * Clear cache entries for a specific conversation
1930
+ * Get external agent by base URL
2117
1931
  */
2118
- declare const clearConversationCache: (db: DatabaseClient) => (params: {
2119
- scopes: ProjectScopeConfig;
2120
- conversationId: string;
2121
- }) => Promise<number>;
1932
+ declare const getExternalAgentByUrl: (db: DatabaseClient) => (params: {
1933
+ scopes: GraphScopeConfig;
1934
+ baseUrl: string;
1935
+ }) => Promise<ExternalAgentSelect | null>;
2122
1936
  /**
2123
- * Clear all cache entries for a specific context configuration
1937
+ * List external agents for a tenant
2124
1938
  */
2125
- declare const clearContextConfigCache: (db: DatabaseClient) => (params: {
2126
- scopes: ProjectScopeConfig;
2127
- contextConfigId: string;
2128
- }) => Promise<number>;
1939
+ declare const listExternalAgents: (db: DatabaseClient) => (params: {
1940
+ scopes: GraphScopeConfig;
1941
+ }) => Promise<ExternalAgentSelect[]>;
2129
1942
  /**
2130
- * Clean up all cache entries for a tenant
1943
+ * List external agents with pagination
2131
1944
  */
2132
- declare const cleanupTenantCache: (db: DatabaseClient) => (params: {
2133
- scopes: ProjectScopeConfig;
1945
+ declare const listExternalAgentsPaginated: (db: DatabaseClient) => (params: {
1946
+ scopes: GraphScopeConfig;
1947
+ pagination?: PaginationConfig;
1948
+ }) => Promise<{
1949
+ data: ExternalAgentSelect[];
1950
+ pagination: {
1951
+ page: number;
1952
+ limit: number;
1953
+ total: number;
1954
+ pages: number;
1955
+ };
1956
+ }>;
1957
+ /**
1958
+ * Update an existing external agent
1959
+ */
1960
+ declare const updateExternalAgent: (db: DatabaseClient) => (params: {
1961
+ scopes: GraphScopeConfig;
1962
+ subAgentId: string;
1963
+ data: Partial<ExternalAgentUpdate>;
1964
+ }) => Promise<ExternalAgentSelect | null>;
1965
+ /**
1966
+ * Upsert external agent (create if it doesn't exist, update if it does)
1967
+ */
1968
+ declare const upsertExternalAgent: (db: DatabaseClient) => (params: {
1969
+ data: ExternalAgentInsert;
1970
+ }) => Promise<ExternalAgentSelect>;
1971
+ /**
1972
+ * Delete an external agent
1973
+ */
1974
+ declare const deleteExternalAgent: (db: DatabaseClient) => (params: {
1975
+ scopes: GraphScopeConfig;
1976
+ subAgentId: string;
1977
+ }) => Promise<boolean>;
1978
+ /**
1979
+ * Check if an external agent exists
1980
+ */
1981
+ declare const externalAgentExists: (db: DatabaseClient) => (params: {
1982
+ scopes: GraphScopeConfig;
1983
+ subAgentId: string;
1984
+ }) => Promise<boolean>;
1985
+ /**
1986
+ * Check if an external agent exists by URL
1987
+ */
1988
+ declare const externalAgentUrlExists: (db: DatabaseClient) => (params: {
1989
+ scopes: GraphScopeConfig;
1990
+ baseUrl: string;
1991
+ }) => Promise<boolean>;
1992
+ /**
1993
+ * Count external agents for a tenant
1994
+ */
1995
+ declare const countExternalAgents: (db: DatabaseClient) => (params: {
1996
+ scopes: GraphScopeConfig;
2134
1997
  }) => Promise<number>;
1998
+
2135
1999
  /**
2136
- * Invalidate the headers cache for a conversation
2000
+ * Create or update a function (project-scoped)
2137
2001
  */
2138
- declare const invalidateHeadersCache: (db: DatabaseClient) => (params: {
2002
+ declare const upsertFunction: (db: DatabaseClient) => (params: {
2003
+ data: FunctionApiInsert;
2139
2004
  scopes: ProjectScopeConfig;
2140
- conversationId: string;
2141
- contextConfigId: string;
2142
- }) => Promise<number>;
2005
+ }) => Promise<void>;
2143
2006
  /**
2144
- * Invalidate specific cache entries for invocation-trigger definitions
2007
+ * Get a function by ID (project-scoped)
2145
2008
  */
2146
- declare const invalidateInvocationDefinitionsCache: (db: DatabaseClient) => (params: {
2009
+ declare const getFunction: (db: DatabaseClient) => (params: {
2010
+ functionId: string;
2147
2011
  scopes: ProjectScopeConfig;
2148
- conversationId: string;
2149
- contextConfigId: string;
2150
- invocationDefinitionIds: string[];
2151
- }) => Promise<number>;
2012
+ }) => Promise<FunctionApiInsert | null>;
2152
2013
  /**
2153
- * Get all cache entries for a conversation
2014
+ * List all functions for a project
2154
2015
  */
2155
- declare const getConversationCacheEntries: (db: DatabaseClient) => (params: {
2016
+ declare const listFunctions: (db: DatabaseClient) => (params: {
2156
2017
  scopes: ProjectScopeConfig;
2157
- conversationId: string;
2158
- }) => Promise<ContextCacheSelect[]>;
2018
+ }) => Promise<FunctionApiInsert[]>;
2159
2019
  /**
2160
- * Get all cache entries for a context configuration
2020
+ * Delete a function (project-scoped)
2161
2021
  */
2162
- declare const getContextConfigCacheEntries: (db: DatabaseClient) => (params: {
2022
+ declare const deleteFunction: (db: DatabaseClient) => (params: {
2023
+ functionId: string;
2163
2024
  scopes: ProjectScopeConfig;
2164
- contextConfigId: string;
2165
- }) => Promise<ContextCacheSelect[]>;
2025
+ }) => Promise<void>;
2166
2026
 
2167
- declare const getContextConfigById: (db: DatabaseClient) => (params: {
2027
+ /**
2028
+ * Get a function tool by ID (graph-scoped)
2029
+ */
2030
+ declare const getFunctionToolById: (db: DatabaseClient) => (params: {
2168
2031
  scopes: GraphScopeConfig;
2169
- id: string;
2032
+ functionToolId: string;
2170
2033
  }) => Promise<{
2171
- tenantId: string;
2172
- projectId: string;
2173
- id: string;
2174
- graphId: string;
2175
2034
  createdAt: string;
2176
2035
  updatedAt: string;
2177
- headersSchema: unknown;
2178
- contextVariables: Record<string, ContextFetchDefinition> | null;
2179
- } | undefined>;
2180
- declare const listContextConfigs: (db: DatabaseClient) => (params: {
2181
- scopes: GraphScopeConfig;
2182
- }) => Promise<{
2183
- tenantId: string;
2036
+ name: string;
2037
+ description: string | null;
2038
+ functionId: string;
2039
+ graphId: string;
2184
2040
  projectId: string;
2041
+ tenantId: string;
2185
2042
  id: string;
2186
- graphId: string;
2187
- createdAt: string;
2188
- updatedAt: string;
2189
- headersSchema: unknown;
2190
- contextVariables: Record<string, ContextFetchDefinition> | null;
2191
- }[]>;
2192
- declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
2043
+ }>;
2044
+ /**
2045
+ * List function tools (graph-scoped)
2046
+ */
2047
+ declare const listFunctionTools: (db: DatabaseClient) => (params: {
2193
2048
  scopes: GraphScopeConfig;
2194
2049
  pagination?: PaginationConfig;
2195
2050
  }) => Promise<{
2196
- data: any[];
2051
+ data: {
2052
+ createdAt: string;
2053
+ updatedAt: string;
2054
+ name: string;
2055
+ description: string | null;
2056
+ functionId: string;
2057
+ graphId: string;
2058
+ projectId: string;
2059
+ tenantId: string;
2060
+ id: string;
2061
+ }[];
2197
2062
  pagination: {
2198
2063
  page: number;
2199
2064
  limit: number;
@@ -2201,419 +2066,539 @@ declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
2201
2066
  pages: number;
2202
2067
  };
2203
2068
  }>;
2204
- declare const createContextConfig: (db: DatabaseClient) => (params: ContextConfigInsert) => Promise<{
2069
+ /**
2070
+ * Create a function tool (graph-scoped)
2071
+ */
2072
+ declare const createFunctionTool: (db: DatabaseClient) => (params: {
2073
+ data: FunctionToolApiInsert;
2074
+ scopes: GraphScopeConfig;
2075
+ }) => Promise<{
2205
2076
  tenantId: string;
2206
2077
  projectId: string;
2207
2078
  id: string;
2079
+ name: string;
2080
+ description: string | null;
2208
2081
  graphId: string;
2209
2082
  createdAt: string;
2210
2083
  updatedAt: string;
2211
- headersSchema: unknown;
2212
- contextVariables: Record<string, ContextFetchDefinition> | null;
2084
+ functionId: string;
2213
2085
  }>;
2214
- declare const updateContextConfig: (db: DatabaseClient) => (params: {
2086
+ /**
2087
+ * Update a function tool (graph-scoped)
2088
+ */
2089
+ declare const updateFunctionTool: (db: DatabaseClient) => (params: {
2215
2090
  scopes: GraphScopeConfig;
2216
- id: string;
2217
- data: Partial<ContextConfigUpdate>;
2091
+ functionToolId: string;
2092
+ data: FunctionToolApiUpdate;
2218
2093
  }) => Promise<{
2219
2094
  tenantId: string;
2220
2095
  projectId: string;
2221
2096
  id: string;
2097
+ name: string;
2098
+ description: string | null;
2222
2099
  graphId: string;
2223
2100
  createdAt: string;
2224
2101
  updatedAt: string;
2225
- headersSchema: unknown;
2226
- contextVariables: Record<string, ContextFetchDefinition> | null;
2102
+ functionId: string;
2227
2103
  }>;
2228
- declare const deleteContextConfig: (db: DatabaseClient) => (params: {
2229
- scopes: GraphScopeConfig;
2230
- id: string;
2231
- }) => Promise<boolean>;
2232
- declare const hasContextConfig: (db: DatabaseClient) => (params: {
2104
+ /**
2105
+ * Delete a function tool (graph-scoped)
2106
+ */
2107
+ declare const deleteFunctionTool: (db: DatabaseClient) => (params: {
2233
2108
  scopes: GraphScopeConfig;
2234
- id: string;
2109
+ functionToolId: string;
2235
2110
  }) => Promise<boolean>;
2236
- declare const countContextConfigs: (db: DatabaseClient) => (params: {
2237
- scopes: GraphScopeConfig;
2238
- }) => Promise<number>;
2239
2111
  /**
2240
- * Upsert a context config (create if it doesn't exist, update if it does)
2112
+ * Upsert a function tool (create if it doesn't exist, update if it does)
2241
2113
  */
2242
- declare const upsertContextConfig: (db: DatabaseClient) => (params: {
2243
- data: ContextConfigInsert;
2114
+ declare const upsertFunctionTool: (db: DatabaseClient) => (params: {
2115
+ data: FunctionToolApiInsert;
2116
+ scopes: GraphScopeConfig;
2244
2117
  }) => Promise<{
2245
2118
  tenantId: string;
2246
2119
  projectId: string;
2247
2120
  id: string;
2121
+ name: string;
2122
+ description: string | null;
2248
2123
  graphId: string;
2249
2124
  createdAt: string;
2250
2125
  updatedAt: string;
2251
- headersSchema: unknown;
2252
- contextVariables: Record<string, ContextFetchDefinition> | null;
2126
+ functionId: string;
2253
2127
  }>;
2254
-
2255
- declare const listConversations: (db: DatabaseClient) => (params: {
2256
- scopes: ProjectScopeConfig;
2257
- userId?: string;
2258
- pagination?: PaginationConfig;
2128
+ declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
2129
+ scopes: {
2130
+ tenantId: string;
2131
+ projectId: string;
2132
+ graphId: string;
2133
+ };
2134
+ subAgentId: string;
2259
2135
  }) => Promise<{
2260
- conversations: ConversationSelect[];
2261
- total: number;
2262
- }>;
2263
- declare const createConversation: (db: DatabaseClient) => (params: ConversationInsert) => Promise<{
2264
- tenantId: string;
2265
- projectId: string;
2266
- id: string;
2267
- createdAt: string;
2268
- updatedAt: string;
2269
- title: string | null;
2270
- metadata: ConversationMetadata | null;
2271
- userId: string | null;
2272
- activeAgentId: string;
2273
- lastContextResolution: string | null;
2136
+ data: {
2137
+ createdAt: string;
2138
+ updatedAt: string;
2139
+ name: string;
2140
+ description: string | null;
2141
+ functionId: string;
2142
+ graphId: string;
2143
+ projectId: string;
2144
+ tenantId: string;
2145
+ id: string;
2146
+ }[];
2147
+ pagination: {
2148
+ page: number;
2149
+ limit: number;
2150
+ total: number;
2151
+ pages: number;
2152
+ };
2274
2153
  }>;
2275
- declare const updateConversation: (db: DatabaseClient) => (params: {
2276
- scopes: ProjectScopeConfig;
2277
- conversationId: string;
2278
- data: ConversationUpdate;
2154
+ /**
2155
+ * Upsert an agent-function tool relation (create if it doesn't exist, update if it does)
2156
+ */
2157
+ declare const upsertSubAgentFunctionToolRelation: (db: DatabaseClient) => (params: {
2158
+ scopes: GraphScopeConfig;
2159
+ subAgentId: string;
2160
+ functionToolId: string;
2161
+ relationId?: string;
2279
2162
  }) => Promise<{
2280
- tenantId: string;
2281
- projectId: string;
2282
2163
  id: string;
2283
- createdAt: string;
2284
- updatedAt: string;
2285
- title: string | null;
2286
- metadata: ConversationMetadata | null;
2287
- userId: string | null;
2288
- activeAgentId: string;
2289
- lastContextResolution: string | null;
2290
2164
  }>;
2291
- declare const deleteConversation: (db: DatabaseClient) => (params: {
2292
- scopes: ProjectScopeConfig;
2293
- conversationId: string;
2294
- }) => Promise<boolean>;
2295
- declare const updateConversationActiveAgent: (db: DatabaseClient) => (params: {
2296
- scopes: ProjectScopeConfig;
2297
- conversationId: string;
2298
- activeAgentId: string;
2165
+ /**
2166
+ * Add a function tool to an agent
2167
+ */
2168
+ declare const addFunctionToolToSubAgent: (db: DatabaseClient) => (params: {
2169
+ scopes: GraphScopeConfig;
2170
+ subAgentId: string;
2171
+ functionToolId: string;
2299
2172
  }) => Promise<{
2300
- tenantId: string;
2301
- projectId: string;
2302
2173
  id: string;
2303
- createdAt: string;
2304
- updatedAt: string;
2305
- title: string | null;
2306
- metadata: ConversationMetadata | null;
2307
- userId: string | null;
2308
- activeAgentId: string;
2309
- lastContextResolution: string | null;
2310
2174
  }>;
2311
- declare const getConversation: (db: DatabaseClient) => (params: {
2312
- scopes: ProjectScopeConfig;
2313
- conversationId: string;
2175
+ /**
2176
+ * Update an agent-function tool relation
2177
+ */
2178
+ declare const updateSubAgentFunctionToolRelation: (db: DatabaseClient) => (params: {
2179
+ scopes: GraphScopeConfig;
2180
+ relationId: string;
2181
+ data: {
2182
+ subAgentId: string;
2183
+ functionToolId: string;
2184
+ };
2314
2185
  }) => Promise<{
2315
- tenantId: string;
2316
- projectId: string;
2317
- id: string;
2318
- createdAt: string;
2319
- updatedAt: string;
2320
- title: string | null;
2321
- metadata: ConversationMetadata | null;
2322
- userId: string | null;
2323
- activeAgentId: string;
2324
- lastContextResolution: string | null;
2325
- } | undefined>;
2326
- declare const createOrGetConversation: (db: DatabaseClient) => (input: ConversationInsert) => Promise<{
2327
2186
  id: string;
2328
- tenantId: string;
2329
- projectId: string;
2330
- userId: string | null | undefined;
2331
- activeAgentId: string;
2332
- title: string | null | undefined;
2333
- lastContextResolution: string | null | undefined;
2334
- metadata: ConversationMetadata | null | undefined;
2335
- createdAt: string;
2336
- updatedAt: string;
2337
2187
  }>;
2188
+
2189
+ interface GraphLogger {
2190
+ info(obj: Record<string, any>, msg?: string): void;
2191
+ error(obj: Record<string, any>, msg?: string): void;
2192
+ }
2338
2193
  /**
2339
- * Get conversation history with filtering and context management
2194
+ * Server-side implementation of createFullGraph that performs actual database operations.
2195
+ * This function creates a complete graph with all agents, tools, and relationships.
2340
2196
  */
2341
- declare const getConversationHistory: (db: DatabaseClient) => (params: {
2342
- scopes: ProjectScopeConfig;
2343
- conversationId: string;
2344
- options?: ConversationHistoryConfig;
2345
- }) => Promise<any[]>;
2197
+ declare const createFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2346
2198
  /**
2347
- * Get active agent for a conversation
2199
+ * Server-side implementation of updateFullGraph that performs actual database operations.
2200
+ * This function updates a complete graph with all agents, tools, and relationships.
2348
2201
  */
2349
- declare const getActiveAgentForConversation: (db: DatabaseClient) => (params: {
2202
+ declare const updateFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2203
+ /**
2204
+ * Get a complete graph definition by ID
2205
+ */
2206
+ declare const getFullGraph: (db: DatabaseClient, logger?: GraphLogger) => (params: {
2207
+ scopes: GraphScopeConfig;
2208
+ }) => Promise<FullGraphDefinition | null>;
2209
+ /**
2210
+ * Delete a complete graph and cascade to all related entities
2211
+ */
2212
+ declare const deleteFullGraph: (db: DatabaseClient, logger?: GraphLogger) => (params: {
2213
+ scopes: GraphScopeConfig;
2214
+ }) => Promise<boolean>;
2215
+
2216
+ /**
2217
+ * Atomic upsert operation for a single artifact - prevents race conditions
2218
+ */
2219
+ declare const upsertLedgerArtifact: (db: DatabaseClient) => (params: {
2350
2220
  scopes: ProjectScopeConfig;
2351
- conversationId: string;
2221
+ contextId: string;
2222
+ taskId: string;
2223
+ toolCallId?: string | null;
2224
+ artifact: Artifact;
2352
2225
  }) => Promise<{
2353
- tenantId: string;
2354
- projectId: string;
2355
- id: string;
2356
- createdAt: string;
2357
- updatedAt: string;
2358
- title: string | null;
2359
- metadata: ConversationMetadata | null;
2360
- userId: string | null;
2361
- activeAgentId: string;
2362
- lastContextResolution: string | null;
2363
- } | undefined>;
2226
+ created: boolean;
2227
+ existing?: any;
2228
+ }>;
2364
2229
  /**
2365
- * Set active agent for a conversation (upsert operation)
2230
+ * Save one or more artifacts to the ledger
2366
2231
  */
2367
- declare const setActiveAgentForConversation: (db: DatabaseClient) => (params: {
2368
- scopes: ProjectScopeConfig;
2369
- conversationId: string;
2370
- agentId: string;
2371
- }) => Promise<void>;
2372
- declare const setActiveAgentForThread: (db: DatabaseClient) => ({ scopes, threadId, agentId, }: {
2232
+ declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
2373
2233
  scopes: ProjectScopeConfig;
2374
- threadId: string;
2375
- agentId: string;
2234
+ contextId: string;
2235
+ taskId?: string | null;
2236
+ toolCallId?: string | null;
2237
+ artifacts: Artifact[];
2376
2238
  }) => Promise<void>;
2377
-
2378
- type CredentialReferenceWithTools = CredentialReferenceSelect & {
2379
- tools: ToolSelect[];
2380
- };
2381
2239
  /**
2382
- * Get a credential reference by ID
2240
+ * Retrieve artifacts by taskId, toolCallId, and/or artifactId.
2241
+ * At least one of taskId, toolCallId, or artifactId must be provided.
2383
2242
  */
2384
- declare const getCredentialReference: (db: DatabaseClient) => (params: {
2243
+ declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
2385
2244
  scopes: ProjectScopeConfig;
2386
- id: string;
2387
- }) => Promise<CredentialReferenceSelect | undefined>;
2245
+ taskId?: string;
2246
+ toolCallId?: string;
2247
+ artifactId?: string;
2248
+ }) => Promise<Artifact[]>;
2388
2249
  /**
2389
- * Get a credential reference by ID with its related tools
2250
+ * Get ledger artifacts by context ID
2390
2251
  */
2391
- declare const getCredentialReferenceWithTools: (db: DatabaseClient) => (params: {
2252
+ declare const getLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2392
2253
  scopes: ProjectScopeConfig;
2393
- id: string;
2394
- }) => Promise<CredentialReferenceWithTools | undefined>;
2254
+ contextId: string;
2255
+ }) => Promise<LedgerArtifactSelect[]>;
2395
2256
  /**
2396
- * List all credential references for a tenant/project
2257
+ * Delete ledger artifacts by task ID
2397
2258
  */
2398
- declare const listCredentialReferences: (db: DatabaseClient) => (params: {
2259
+ declare const deleteLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2399
2260
  scopes: ProjectScopeConfig;
2400
- }) => Promise<CredentialReferenceSelect[]>;
2261
+ taskId: string;
2262
+ }) => Promise<boolean>;
2401
2263
  /**
2402
- * List credential references with pagination
2264
+ * Delete ledger artifacts by context ID
2403
2265
  */
2404
- declare const listCredentialReferencesPaginated: (db: DatabaseClient) => (params: {
2266
+ declare const deleteLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2405
2267
  scopes: ProjectScopeConfig;
2406
- pagination?: PaginationConfig;
2407
- }) => Promise<{
2408
- data: CredentialReferenceSelect[];
2409
- pagination: {
2410
- page: number;
2411
- limit: number;
2412
- total: number;
2413
- pages: number;
2414
- };
2415
- }>;
2416
- /**
2417
- * Create a new credential reference
2418
- */
2419
- declare const createCredentialReference: (db: DatabaseClient) => (params: CredentialReferenceInsert) => Promise<CredentialReferenceSelect>;
2268
+ contextId: string;
2269
+ }) => Promise<boolean>;
2420
2270
  /**
2421
- * Update a credential reference
2271
+ * Count ledger artifacts by task ID
2422
2272
  */
2423
- declare const updateCredentialReference: (db: DatabaseClient) => (params: {
2273
+ declare const countLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2274
+ scopes: ProjectScopeConfig;
2275
+ taskId: string;
2276
+ }) => Promise<number>;
2277
+
2278
+ declare const getMessageById: (db: DatabaseClient) => (params: {
2424
2279
  scopes: ProjectScopeConfig;
2280
+ messageId: string;
2281
+ }) => Promise<{
2282
+ tenantId: string;
2283
+ projectId: string;
2425
2284
  id: string;
2426
- data: Partial<CredentialReferenceUpdate>;
2427
- }) => Promise<CredentialReferenceWithTools | undefined>;
2428
- /**
2429
- * Delete a credential reference
2430
- */
2431
- declare const deleteCredentialReference: (db: DatabaseClient) => (params: {
2285
+ createdAt: string;
2286
+ updatedAt: string;
2287
+ metadata: MessageMetadata | null;
2288
+ content: MessageContent;
2289
+ conversationId: string;
2290
+ role: string;
2291
+ fromSubAgentId: string | null;
2292
+ toSubAgentId: string | null;
2293
+ fromExternalAgentId: string | null;
2294
+ toExternalAgentId: string | null;
2295
+ visibility: string;
2296
+ messageType: string;
2297
+ taskId: string | null;
2298
+ parentMessageId: string | null;
2299
+ a2aTaskId: string | null;
2300
+ a2aSessionId: string | null;
2301
+ } | undefined>;
2302
+ declare const listMessages: (db: DatabaseClient) => (params: {
2432
2303
  scopes: ProjectScopeConfig;
2304
+ pagination: PaginationConfig;
2305
+ }) => Promise<{
2306
+ createdAt: string;
2307
+ updatedAt: string;
2308
+ conversationId: string;
2309
+ role: string;
2310
+ fromSubAgentId: string | null;
2311
+ toSubAgentId: string | null;
2312
+ fromExternalAgentId: string | null;
2313
+ toExternalAgentId: string | null;
2314
+ content: MessageContent;
2315
+ visibility: string;
2316
+ messageType: string;
2317
+ taskId: string | null;
2318
+ parentMessageId: string | null;
2319
+ a2aTaskId: string | null;
2320
+ a2aSessionId: string | null;
2321
+ metadata: MessageMetadata | null;
2322
+ projectId: string;
2323
+ tenantId: string;
2433
2324
  id: string;
2434
- }) => Promise<boolean>;
2435
- /**
2436
- * Check if a credential reference exists
2437
- */
2438
- declare const hasCredentialReference: (db: DatabaseClient) => (params: {
2325
+ }[]>;
2326
+ declare const getMessagesByConversation: (db: DatabaseClient) => (params: {
2439
2327
  scopes: ProjectScopeConfig;
2328
+ conversationId: string;
2329
+ pagination: PaginationConfig;
2330
+ }) => Promise<{
2331
+ createdAt: string;
2332
+ updatedAt: string;
2333
+ conversationId: string;
2334
+ role: string;
2335
+ fromSubAgentId: string | null;
2336
+ toSubAgentId: string | null;
2337
+ fromExternalAgentId: string | null;
2338
+ toExternalAgentId: string | null;
2339
+ content: MessageContent;
2340
+ visibility: string;
2341
+ messageType: string;
2342
+ taskId: string | null;
2343
+ parentMessageId: string | null;
2344
+ a2aTaskId: string | null;
2345
+ a2aSessionId: string | null;
2346
+ metadata: MessageMetadata | null;
2347
+ projectId: string;
2348
+ tenantId: string;
2440
2349
  id: string;
2441
- }) => Promise<boolean>;
2442
- /**
2443
- * Get credential reference by ID (simple version without tools)
2444
- */
2445
- declare const getCredentialReferenceById: (db: DatabaseClient) => (params: {
2350
+ }[]>;
2351
+ declare const getMessagesByTask: (db: DatabaseClient) => (params: {
2446
2352
  scopes: ProjectScopeConfig;
2353
+ taskId: string;
2354
+ pagination: PaginationConfig;
2355
+ }) => Promise<{
2356
+ createdAt: string;
2357
+ updatedAt: string;
2358
+ conversationId: string;
2359
+ role: string;
2360
+ fromSubAgentId: string | null;
2361
+ toSubAgentId: string | null;
2362
+ fromExternalAgentId: string | null;
2363
+ toExternalAgentId: string | null;
2364
+ content: MessageContent;
2365
+ visibility: string;
2366
+ messageType: string;
2367
+ taskId: string | null;
2368
+ parentMessageId: string | null;
2369
+ a2aTaskId: string | null;
2370
+ a2aSessionId: string | null;
2371
+ metadata: MessageMetadata | null;
2372
+ projectId: string;
2373
+ tenantId: string;
2447
2374
  id: string;
2448
- }) => Promise<CredentialReferenceSelect | null>;
2449
- /**
2450
- * Count credential references for a tenant/project
2451
- */
2452
- declare const countCredentialReferences: (db: DatabaseClient) => (params: {
2375
+ }[]>;
2376
+ declare const getVisibleMessages: (db: DatabaseClient) => (params: {
2453
2377
  scopes: ProjectScopeConfig;
2378
+ conversationId: string;
2379
+ visibility?: MessageVisibility[];
2380
+ pagination: PaginationConfig;
2381
+ }) => Promise<{
2382
+ createdAt: string;
2383
+ updatedAt: string;
2384
+ conversationId: string;
2385
+ role: string;
2386
+ fromSubAgentId: string | null;
2387
+ toSubAgentId: string | null;
2388
+ fromExternalAgentId: string | null;
2389
+ toExternalAgentId: string | null;
2390
+ content: MessageContent;
2391
+ visibility: string;
2392
+ messageType: string;
2393
+ taskId: string | null;
2394
+ parentMessageId: string | null;
2395
+ a2aTaskId: string | null;
2396
+ a2aSessionId: string | null;
2397
+ metadata: MessageMetadata | null;
2398
+ projectId: string;
2399
+ tenantId: string;
2400
+ id: string;
2401
+ }[]>;
2402
+ declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) => Promise<{
2403
+ tenantId: string;
2404
+ projectId: string;
2405
+ id: string;
2406
+ createdAt: string;
2407
+ updatedAt: string;
2408
+ metadata: MessageMetadata | null;
2409
+ content: MessageContent;
2410
+ conversationId: string;
2411
+ role: string;
2412
+ fromSubAgentId: string | null;
2413
+ toSubAgentId: string | null;
2414
+ fromExternalAgentId: string | null;
2415
+ toExternalAgentId: string | null;
2416
+ visibility: string;
2417
+ messageType: string;
2418
+ taskId: string | null;
2419
+ parentMessageId: string | null;
2420
+ a2aTaskId: string | null;
2421
+ a2aSessionId: string | null;
2422
+ }>;
2423
+ declare const updateMessage: (db: DatabaseClient) => (params: {
2424
+ scopes: ProjectScopeConfig;
2425
+ messageId: string;
2426
+ data: MessageUpdate;
2427
+ }) => Promise<{
2428
+ tenantId: string;
2429
+ projectId: string;
2430
+ id: string;
2431
+ createdAt: string;
2432
+ updatedAt: string;
2433
+ metadata: MessageMetadata | null;
2434
+ content: MessageContent;
2435
+ conversationId: string;
2436
+ role: string;
2437
+ fromSubAgentId: string | null;
2438
+ toSubAgentId: string | null;
2439
+ fromExternalAgentId: string | null;
2440
+ toExternalAgentId: string | null;
2441
+ visibility: string;
2442
+ messageType: string;
2443
+ taskId: string | null;
2444
+ parentMessageId: string | null;
2445
+ a2aTaskId: string | null;
2446
+ a2aSessionId: string | null;
2447
+ }>;
2448
+ declare const deleteMessage: (db: DatabaseClient) => (params: {
2449
+ scopes: ProjectScopeConfig;
2450
+ messageId: string;
2451
+ }) => Promise<{
2452
+ tenantId: string;
2453
+ projectId: string;
2454
+ id: string;
2455
+ createdAt: string;
2456
+ updatedAt: string;
2457
+ metadata: MessageMetadata | null;
2458
+ content: MessageContent;
2459
+ conversationId: string;
2460
+ role: string;
2461
+ fromSubAgentId: string | null;
2462
+ toSubAgentId: string | null;
2463
+ fromExternalAgentId: string | null;
2464
+ toExternalAgentId: string | null;
2465
+ visibility: string;
2466
+ messageType: string;
2467
+ taskId: string | null;
2468
+ parentMessageId: string | null;
2469
+ a2aTaskId: string | null;
2470
+ a2aSessionId: string | null;
2471
+ }>;
2472
+ declare const countMessagesByConversation: (db: DatabaseClient) => (params: {
2473
+ scopes: ProjectScopeConfig;
2474
+ conversationId: string;
2454
2475
  }) => Promise<number>;
2476
+
2455
2477
  /**
2456
- * Upsert a credential reference (create if it doesn't exist, update if it does)
2478
+ * Server-side data access layer for Full Project operations.
2479
+ * This module provides functions for creating, retrieving, updating, and deleting
2480
+ * complete project definitions with all nested resources (graphs, agents, tools, etc.).
2457
2481
  */
2458
- declare const upsertCredentialReference: (db: DatabaseClient) => (params: {
2459
- data: CredentialReferenceInsert;
2460
- }) => Promise<CredentialReferenceSelect>;
2461
2482
 
2483
+ type ProjectLogger = ReturnType<typeof getLogger>;
2462
2484
  /**
2463
- * Get a data component by ID
2485
+ * Server-side implementation of createFullProject that performs actual database operations.
2486
+ * This function creates a complete project with all graphs and their nested resources.
2464
2487
  */
2465
- declare const getDataComponent: (db: DatabaseClient) => (params: {
2466
- scopes: ProjectScopeConfig;
2467
- dataComponentId: string;
2468
- }) => Promise<DataComponentSelect | null>;
2488
+ declare const createFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
2469
2489
  /**
2470
- * List all data components for a tenant/project
2490
+ * Server-side implementation of updateFullProject that performs actual database operations.
2491
+ * This function updates a complete project with all graphs and their nested resources.
2471
2492
  */
2472
- declare const listDataComponents: (db: DatabaseClient) => (params: {
2473
- scopes: ProjectScopeConfig;
2474
- }) => Promise<DataComponentSelect[]>;
2493
+ declare const updateFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
2475
2494
  /**
2476
- * List data components with pagination
2495
+ * Get a complete project definition with all nested resources
2477
2496
  */
2478
- declare const listDataComponentsPaginated: (db: DatabaseClient) => (params: {
2497
+ declare const getFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
2479
2498
  scopes: ProjectScopeConfig;
2480
- pagination?: PaginationConfig;
2481
- }) => Promise<{
2482
- data: DataComponentSelect[];
2483
- pagination: {
2484
- page: number;
2485
- limit: number;
2486
- total: number;
2487
- pages: number;
2488
- };
2489
- }>;
2499
+ }) => Promise<FullProjectDefinition | null>;
2490
2500
  /**
2491
- * Create a new data component
2492
- */
2493
- declare const createDataComponent: (db: DatabaseClient) => (params: DataComponentInsert) => Promise<DataComponentSelect>;
2494
- /**
2495
- * Update a data component
2496
- */
2497
- declare const updateDataComponent: (db: DatabaseClient) => (params: {
2498
- scopes: ProjectScopeConfig;
2499
- dataComponentId: string;
2500
- data: DataComponentUpdate;
2501
- }) => Promise<DataComponentSelect | null>;
2502
- /**
2503
- * Delete a data component
2501
+ * Delete a complete project and cascade to all related entities
2504
2502
  */
2505
- declare const deleteDataComponent: (db: DatabaseClient) => (params: {
2503
+ declare const deleteFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
2506
2504
  scopes: ProjectScopeConfig;
2507
- dataComponentId: string;
2508
2505
  }) => Promise<boolean>;
2506
+
2509
2507
  /**
2510
- * Get data components for a specific agent
2508
+ * List all unique project IDs within a tenant by scanning all resource tables
2511
2509
  */
2512
- declare const getDataComponentsForAgent: (db: DatabaseClient) => (params: {
2513
- scopes: AgentScopeConfig;
2514
- }) => Promise<DataComponentSelect[]>;
2510
+ declare const listProjects: (db: DatabaseClient) => (params: {
2511
+ tenantId: string;
2512
+ }) => Promise<ProjectInfo[]>;
2515
2513
  /**
2516
- * Associate a data component with an agent
2514
+ * List all unique project IDs within a tenant with pagination
2517
2515
  */
2518
- declare const associateDataComponentWithAgent: (db: DatabaseClient) => (params: {
2519
- scopes: AgentScopeConfig;
2520
- dataComponentId: string;
2521
- }) => Promise<{
2516
+ declare const listProjectsPaginated: (db: DatabaseClient) => (params: {
2522
2517
  tenantId: string;
2523
- projectId: string;
2524
- id: string;
2525
- graphId: string;
2526
- createdAt: string;
2527
- agentId: string;
2528
- dataComponentId: string;
2518
+ pagination?: PaginationConfig;
2519
+ }) => Promise<{
2520
+ data: ProjectSelect[];
2521
+ pagination: PaginationResult;
2529
2522
  }>;
2530
2523
  /**
2531
- * Remove association between data component and agent
2532
- */
2533
- declare const removeDataComponentFromAgent: (db: DatabaseClient) => (params: {
2534
- scopes: AgentScopeConfig;
2535
- dataComponentId: string;
2536
- }) => Promise<boolean>;
2537
- declare const deleteAgentDataComponentRelationByAgent: (db: DatabaseClient) => (params: {
2538
- scopes: AgentScopeConfig;
2539
- }) => Promise<boolean>;
2540
- /**
2541
- * Get all agents that use a specific data component
2524
+ * Get resource counts for a specific project
2542
2525
  */
2543
- declare const getAgentsUsingDataComponent: (db: DatabaseClient) => (params: {
2544
- scopes: ProjectScopeConfig;
2545
- dataComponentId: string;
2546
- }) => Promise<{
2547
- agentId: string;
2548
- createdAt: string;
2549
- }[]>;
2526
+ declare const getProjectResourceCounts: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<ProjectResourceCounts>;
2550
2527
  /**
2551
- * Check if a data component is associated with an agent
2528
+ * Check if a project exists (has any resources)
2552
2529
  */
2553
- declare const isDataComponentAssociatedWithAgent: (db: DatabaseClient) => (params: {
2554
- scopes: AgentScopeConfig;
2555
- dataComponentId: string;
2556
- }) => Promise<boolean>;
2530
+ declare const projectExists: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
2557
2531
  /**
2558
- * Upsert agent-data component relation (create if it doesn't exist, no-op if it does)
2532
+ * Count total projects for a tenant
2559
2533
  */
2560
- declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params: {
2561
- scopes: AgentScopeConfig;
2562
- dataComponentId: string;
2563
- }) => Promise<{
2534
+ declare const countProjects: (db: DatabaseClient) => (params: {
2564
2535
  tenantId: string;
2565
- projectId: string;
2566
- id: string;
2567
- graphId: string;
2568
- createdAt: string;
2569
- agentId: string;
2570
- dataComponentId: string;
2571
- } | null>;
2536
+ }) => Promise<number>;
2572
2537
  /**
2573
- * Count data components for a tenant/project
2538
+ * Get a single project by ID
2574
2539
  */
2575
- declare const countDataComponents: (db: DatabaseClient) => (params: {
2540
+ declare const getProject: (db: DatabaseClient) => (params: {
2576
2541
  scopes: ProjectScopeConfig;
2577
- }) => Promise<number>;
2542
+ }) => Promise<ProjectSelect | null>;
2578
2543
  /**
2579
- * Upsert a data component (create if it doesn't exist, update if it does)
2544
+ * Create a new project
2580
2545
  */
2581
- declare const upsertDataComponent: (db: DatabaseClient) => (params: {
2582
- data: DataComponentInsert;
2583
- }) => Promise<DataComponentSelect | null>;
2584
-
2546
+ declare const createProject: (db: DatabaseClient) => (params: ProjectInsert) => Promise<ProjectSelect>;
2585
2547
  /**
2586
- * Create a new external agent
2548
+ * Update an existing project
2587
2549
  */
2588
- declare const createExternalAgent: (db: DatabaseClient) => (params: ExternalAgentInsert) => Promise<ExternalAgentSelect>;
2550
+ declare const updateProject: (db: DatabaseClient) => (params: {
2551
+ scopes: ProjectScopeConfig;
2552
+ data: ProjectUpdate;
2553
+ }) => Promise<ProjectSelect | null>;
2589
2554
  /**
2590
- * Get external agent by ID
2555
+ * Check if a project exists in the projects table
2591
2556
  */
2592
- declare const getExternalAgent: (db: DatabaseClient) => (params: {
2593
- scopes: GraphScopeConfig;
2594
- agentId: string;
2595
- }) => Promise<ExternalAgentSelect | null>;
2557
+ declare const projectExistsInTable: (db: DatabaseClient) => (params: {
2558
+ scopes: ProjectScopeConfig;
2559
+ }) => Promise<boolean>;
2596
2560
  /**
2597
- * Get external agent by base URL
2561
+ * Check if a project has any resources (used before deletion)
2598
2562
  */
2599
- declare const getExternalAgentByUrl: (db: DatabaseClient) => (params: {
2600
- scopes: GraphScopeConfig;
2601
- baseUrl: string;
2602
- }) => Promise<ExternalAgentSelect | null>;
2563
+ declare const projectHasResources: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
2603
2564
  /**
2604
- * List external agents for a tenant
2565
+ * Delete a project (with validation for existing resources)
2605
2566
  */
2606
- declare const listExternalAgents: (db: DatabaseClient) => (params: {
2567
+ declare const deleteProject: (db: DatabaseClient) => (params: {
2568
+ scopes: ProjectScopeConfig;
2569
+ }) => Promise<boolean>;
2570
+
2571
+ declare const getAgentRelationById: (db: DatabaseClient) => (params: {
2607
2572
  scopes: GraphScopeConfig;
2608
- }) => Promise<ExternalAgentSelect[]>;
2609
- /**
2610
- * List external agents with pagination
2611
- */
2612
- declare const listExternalAgentsPaginated: (db: DatabaseClient) => (params: {
2573
+ relationId: string;
2574
+ }) => Promise<{
2575
+ tenantId: string;
2576
+ projectId: string;
2577
+ id: string;
2578
+ graphId: string;
2579
+ createdAt: string;
2580
+ updatedAt: string;
2581
+ sourceSubAgentId: string;
2582
+ targetSubAgentId: string | null;
2583
+ externalSubAgentId: string | null;
2584
+ relationType: string | null;
2585
+ } | undefined>;
2586
+ declare const listAgentRelations: (db: DatabaseClient) => (params: {
2613
2587
  scopes: GraphScopeConfig;
2614
2588
  pagination?: PaginationConfig;
2615
2589
  }) => Promise<{
2616
- data: ExternalAgentSelect[];
2590
+ data: {
2591
+ createdAt: string;
2592
+ updatedAt: string;
2593
+ sourceSubAgentId: string;
2594
+ targetSubAgentId: string | null;
2595
+ externalSubAgentId: string | null;
2596
+ relationType: string | null;
2597
+ graphId: string;
2598
+ projectId: string;
2599
+ tenantId: string;
2600
+ id: string;
2601
+ }[];
2617
2602
  pagination: {
2618
2603
  page: number;
2619
2604
  limit: number;
@@ -2621,465 +2606,640 @@ declare const listExternalAgentsPaginated: (db: DatabaseClient) => (params: {
2621
2606
  pages: number;
2622
2607
  };
2623
2608
  }>;
2624
- /**
2625
- * Update an existing external agent
2626
- */
2627
- declare const updateExternalAgent: (db: DatabaseClient) => (params: {
2628
- scopes: GraphScopeConfig;
2629
- agentId: string;
2630
- data: Partial<ExternalAgentUpdate>;
2631
- }) => Promise<ExternalAgentSelect | null>;
2632
- /**
2633
- * Upsert external agent (create if it doesn't exist, update if it does)
2634
- */
2635
- declare const upsertExternalAgent: (db: DatabaseClient) => (params: {
2636
- data: ExternalAgentInsert;
2637
- }) => Promise<ExternalAgentSelect>;
2638
- /**
2639
- * Delete an external agent
2640
- */
2641
- declare const deleteExternalAgent: (db: DatabaseClient) => (params: {
2609
+ declare const getAgentRelations: (db: DatabaseClient) => (params: {
2610
+ scopes: AgentScopeConfig;
2611
+ }) => Promise<{
2612
+ tenantId: string;
2613
+ projectId: string;
2614
+ id: string;
2615
+ graphId: string;
2616
+ createdAt: string;
2617
+ updatedAt: string;
2618
+ sourceSubAgentId: string;
2619
+ targetSubAgentId: string | null;
2620
+ externalSubAgentId: string | null;
2621
+ relationType: string | null;
2622
+ }[]>;
2623
+ declare const getAgentRelationsByGraph: (db: DatabaseClient) => (params: {
2642
2624
  scopes: GraphScopeConfig;
2643
- agentId: string;
2644
- }) => Promise<boolean>;
2645
- /**
2646
- * Check if an external agent exists
2647
- */
2648
- declare const externalAgentExists: (db: DatabaseClient) => (params: {
2625
+ }) => Promise<{
2626
+ tenantId: string;
2627
+ projectId: string;
2628
+ id: string;
2629
+ graphId: string;
2630
+ createdAt: string;
2631
+ updatedAt: string;
2632
+ sourceSubAgentId: string;
2633
+ targetSubAgentId: string | null;
2634
+ externalSubAgentId: string | null;
2635
+ relationType: string | null;
2636
+ }[]>;
2637
+ declare const getAgentRelationsBySource: (db: DatabaseClient) => (params: {
2649
2638
  scopes: GraphScopeConfig;
2650
- agentId: string;
2651
- }) => Promise<boolean>;
2652
- /**
2653
- * Check if an external agent exists by URL
2654
- */
2655
- declare const externalAgentUrlExists: (db: DatabaseClient) => (params: {
2639
+ sourceSubAgentId: string;
2640
+ pagination?: PaginationConfig;
2641
+ }) => Promise<{
2642
+ data: {
2643
+ createdAt: string;
2644
+ updatedAt: string;
2645
+ sourceSubAgentId: string;
2646
+ targetSubAgentId: string | null;
2647
+ externalSubAgentId: string | null;
2648
+ relationType: string | null;
2649
+ graphId: string;
2650
+ projectId: string;
2651
+ tenantId: string;
2652
+ id: string;
2653
+ }[];
2654
+ pagination: {
2655
+ page: number;
2656
+ limit: number;
2657
+ total: number;
2658
+ pages: number;
2659
+ };
2660
+ }>;
2661
+ declare const getAgentRelationsByTarget: (db: DatabaseClient) => (params: {
2656
2662
  scopes: GraphScopeConfig;
2657
- baseUrl: string;
2658
- }) => Promise<boolean>;
2659
- /**
2660
- * Count external agents for a tenant
2661
- */
2662
- declare const countExternalAgents: (db: DatabaseClient) => (params: {
2663
+ targetSubAgentId: string;
2664
+ pagination?: PaginationConfig;
2665
+ }) => Promise<{
2666
+ data: {
2667
+ createdAt: string;
2668
+ updatedAt: string;
2669
+ sourceSubAgentId: string;
2670
+ targetSubAgentId: string | null;
2671
+ externalSubAgentId: string | null;
2672
+ relationType: string | null;
2673
+ graphId: string;
2674
+ projectId: string;
2675
+ tenantId: string;
2676
+ id: string;
2677
+ }[];
2678
+ pagination: {
2679
+ page: number;
2680
+ limit: number;
2681
+ total: number;
2682
+ pages: number;
2683
+ };
2684
+ }>;
2685
+ declare const getExternalAgentRelations: (db: DatabaseClient) => (params: {
2663
2686
  scopes: GraphScopeConfig;
2664
- }) => Promise<number>;
2665
-
2666
- /**
2667
- * Create or update a function (project-scoped)
2668
- */
2669
- declare const upsertFunction: (db: DatabaseClient) => (params: {
2670
- data: FunctionApiInsert;
2671
- scopes: ProjectScopeConfig;
2672
- }) => Promise<void>;
2673
- /**
2674
- * Get a function by ID (project-scoped)
2675
- */
2676
- declare const getFunction: (db: DatabaseClient) => (params: {
2677
- functionId: string;
2678
- scopes: ProjectScopeConfig;
2679
- }) => Promise<FunctionApiInsert | null>;
2680
- /**
2681
- * List all functions for a project
2682
- */
2683
- declare const listFunctions: (db: DatabaseClient) => (params: {
2684
- scopes: ProjectScopeConfig;
2685
- }) => Promise<FunctionApiInsert[]>;
2686
- /**
2687
- * Delete a function (project-scoped)
2688
- */
2689
- declare const deleteFunction: (db: DatabaseClient) => (params: {
2690
- functionId: string;
2691
- scopes: ProjectScopeConfig;
2692
- }) => Promise<void>;
2693
-
2694
- interface GraphLogger {
2695
- info(obj: Record<string, any>, msg?: string): void;
2696
- error(obj: Record<string, any>, msg?: string): void;
2697
- }
2698
- /**
2699
- * Server-side implementation of createFullGraph that performs actual database operations.
2700
- * This function creates a complete graph with all agents, tools, and relationships.
2701
- */
2702
- declare const createFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2703
- /**
2704
- * Server-side implementation of updateFullGraph that performs actual database operations.
2705
- * This function updates a complete graph with all agents, tools, and relationships.
2706
- */
2707
- declare const updateFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2708
- /**
2709
- * Get a complete graph definition by ID
2710
- */
2711
- declare const getFullGraph: (db: DatabaseClient, logger?: GraphLogger) => (params: {
2712
- scopes: GraphScopeConfig;
2713
- }) => Promise<FullGraphDefinition | null>;
2714
- /**
2715
- * Delete a complete graph and cascade to all related entities
2716
- */
2717
- declare const deleteFullGraph: (db: DatabaseClient, logger?: GraphLogger) => (params: {
2687
+ externalSubAgentId: string;
2688
+ pagination?: PaginationConfig;
2689
+ }) => Promise<{
2690
+ data: {
2691
+ createdAt: string;
2692
+ updatedAt: string;
2693
+ sourceSubAgentId: string;
2694
+ targetSubAgentId: string | null;
2695
+ externalSubAgentId: string | null;
2696
+ relationType: string | null;
2697
+ graphId: string;
2698
+ projectId: string;
2699
+ tenantId: string;
2700
+ id: string;
2701
+ }[];
2702
+ pagination: {
2703
+ page: number;
2704
+ limit: number;
2705
+ total: number;
2706
+ pages: number;
2707
+ };
2708
+ }>;
2709
+ declare const getRelatedAgentsForGraph: (db: DatabaseClient) => (params: {
2718
2710
  scopes: GraphScopeConfig;
2719
- }) => Promise<boolean>;
2720
-
2721
- /**
2722
- * Atomic upsert operation for a single artifact - prevents race conditions
2723
- */
2724
- declare const upsertLedgerArtifact: (db: DatabaseClient) => (params: {
2725
- scopes: ProjectScopeConfig;
2726
- contextId: string;
2727
- taskId: string;
2728
- toolCallId?: string | null;
2729
- artifact: Artifact;
2711
+ subAgentId: string;
2730
2712
  }) => Promise<{
2731
- created: boolean;
2732
- existing?: any;
2713
+ internalRelations: {
2714
+ id: string;
2715
+ name: string;
2716
+ description: string;
2717
+ relationType: string | null;
2718
+ }[];
2719
+ externalRelations: {
2720
+ id: string;
2721
+ relationType: string | null;
2722
+ externalAgent: {
2723
+ id: string;
2724
+ name: string;
2725
+ description: string;
2726
+ baseUrl: string;
2727
+ };
2728
+ }[];
2729
+ }>;
2730
+ declare const createSubAgentRelation: (db: DatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
2731
+ tenantId: string;
2732
+ projectId: string;
2733
+ id: string;
2734
+ graphId: string;
2735
+ createdAt: string;
2736
+ updatedAt: string;
2737
+ sourceSubAgentId: string;
2738
+ targetSubAgentId: string | null;
2739
+ externalSubAgentId: string | null;
2740
+ relationType: string | null;
2733
2741
  }>;
2734
2742
  /**
2735
- * Save one or more artifacts to the ledger
2736
- */
2737
- declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
2738
- scopes: ProjectScopeConfig;
2739
- contextId: string;
2740
- taskId?: string | null;
2741
- toolCallId?: string | null;
2742
- artifacts: Artifact[];
2743
- }) => Promise<void>;
2744
- /**
2745
- * Retrieve artifacts by taskId, toolCallId, and/or artifactId.
2746
- * At least one of taskId, toolCallId, or artifactId must be provided.
2747
- */
2748
- declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
2749
- scopes: ProjectScopeConfig;
2750
- taskId?: string;
2751
- toolCallId?: string;
2752
- artifactId?: string;
2753
- }) => Promise<Artifact[]>;
2754
- /**
2755
- * Get ledger artifacts by context ID
2756
- */
2757
- declare const getLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2758
- scopes: ProjectScopeConfig;
2759
- contextId: string;
2760
- }) => Promise<LedgerArtifactSelect[]>;
2761
- /**
2762
- * Delete ledger artifacts by task ID
2763
- */
2764
- declare const deleteLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2765
- scopes: ProjectScopeConfig;
2766
- taskId: string;
2767
- }) => Promise<boolean>;
2768
- /**
2769
- * Delete ledger artifacts by context ID
2770
- */
2771
- declare const deleteLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2772
- scopes: ProjectScopeConfig;
2773
- contextId: string;
2774
- }) => Promise<boolean>;
2775
- /**
2776
- * Count ledger artifacts by task ID
2743
+ * Check if agent relation exists by graph, source, target, and relation type
2777
2744
  */
2778
- declare const countLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2779
- scopes: ProjectScopeConfig;
2780
- taskId: string;
2781
- }) => Promise<number>;
2782
-
2783
- declare const getMessageById: (db: DatabaseClient) => (params: {
2784
- scopes: ProjectScopeConfig;
2785
- messageId: string;
2745
+ declare const getAgentRelationByParams: (db: DatabaseClient) => (params: {
2746
+ scopes: GraphScopeConfig;
2747
+ sourceSubAgentId: string;
2748
+ targetSubAgentId?: string;
2749
+ externalSubAgentId?: string;
2750
+ relationType: string;
2786
2751
  }) => Promise<{
2787
2752
  tenantId: string;
2788
2753
  projectId: string;
2789
2754
  id: string;
2755
+ graphId: string;
2790
2756
  createdAt: string;
2791
2757
  updatedAt: string;
2792
- metadata: MessageMetadata | null;
2793
- content: MessageContent;
2794
- conversationId: string;
2795
- agentId: string | null;
2796
- role: string;
2797
- fromAgentId: string | null;
2798
- toAgentId: string | null;
2799
- fromExternalAgentId: string | null;
2800
- toExternalAgentId: string | null;
2801
- visibility: string;
2802
- messageType: string;
2803
- taskId: string | null;
2804
- parentMessageId: string | null;
2805
- a2aTaskId: string | null;
2806
- a2aSessionId: string | null;
2758
+ sourceSubAgentId: string;
2759
+ targetSubAgentId: string | null;
2760
+ externalSubAgentId: string | null;
2761
+ relationType: string | null;
2807
2762
  } | undefined>;
2808
- declare const listMessages: (db: DatabaseClient) => (params: {
2809
- scopes: ProjectScopeConfig;
2810
- pagination: PaginationConfig;
2811
- }) => Promise<{
2812
- createdAt: string;
2813
- updatedAt: string;
2814
- conversationId: string;
2815
- role: string;
2816
- fromAgentId: string | null;
2817
- toAgentId: string | null;
2818
- fromExternalAgentId: string | null;
2819
- toExternalAgentId: string | null;
2820
- content: MessageContent;
2821
- visibility: string;
2822
- messageType: string;
2823
- agentId: string | null;
2824
- taskId: string | null;
2825
- parentMessageId: string | null;
2826
- a2aTaskId: string | null;
2827
- a2aSessionId: string | null;
2828
- metadata: MessageMetadata | null;
2829
- projectId: string;
2763
+ /**
2764
+ * Upsert agent relation (create if it doesn't exist, no-op if it does)
2765
+ */
2766
+ declare const upsertAgentRelation: (db: DatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
2830
2767
  tenantId: string;
2768
+ projectId: string;
2831
2769
  id: string;
2832
- }[]>;
2833
- declare const getMessagesByConversation: (db: DatabaseClient) => (params: {
2834
- scopes: ProjectScopeConfig;
2835
- conversationId: string;
2836
- pagination: PaginationConfig;
2837
- }) => Promise<{
2770
+ graphId: string;
2838
2771
  createdAt: string;
2839
2772
  updatedAt: string;
2840
- conversationId: string;
2841
- role: string;
2842
- fromAgentId: string | null;
2843
- toAgentId: string | null;
2844
- fromExternalAgentId: string | null;
2845
- toExternalAgentId: string | null;
2846
- content: MessageContent;
2847
- visibility: string;
2848
- messageType: string;
2849
- agentId: string | null;
2850
- taskId: string | null;
2851
- parentMessageId: string | null;
2852
- a2aTaskId: string | null;
2853
- a2aSessionId: string | null;
2854
- metadata: MessageMetadata | null;
2855
- projectId: string;
2773
+ sourceSubAgentId: string;
2774
+ targetSubAgentId: string | null;
2775
+ externalSubAgentId: string | null;
2776
+ relationType: string | null;
2777
+ }>;
2778
+ declare const createExternalAgentRelation: (db: DatabaseClient) => (params: ExternalSubAgentRelationInsert) => Promise<{
2856
2779
  tenantId: string;
2780
+ projectId: string;
2857
2781
  id: string;
2858
- }[]>;
2859
- declare const getMessagesByTask: (db: DatabaseClient) => (params: {
2860
- scopes: ProjectScopeConfig;
2861
- taskId: string;
2862
- pagination: PaginationConfig;
2863
- }) => Promise<{
2782
+ graphId: string;
2864
2783
  createdAt: string;
2865
2784
  updatedAt: string;
2866
- conversationId: string;
2867
- role: string;
2868
- fromAgentId: string | null;
2869
- toAgentId: string | null;
2870
- fromExternalAgentId: string | null;
2871
- toExternalAgentId: string | null;
2872
- content: MessageContent;
2873
- visibility: string;
2874
- messageType: string;
2875
- agentId: string | null;
2876
- taskId: string | null;
2877
- parentMessageId: string | null;
2878
- a2aTaskId: string | null;
2879
- a2aSessionId: string | null;
2880
- metadata: MessageMetadata | null;
2881
- projectId: string;
2785
+ sourceSubAgentId: string;
2786
+ targetSubAgentId: string | null;
2787
+ externalSubAgentId: string | null;
2788
+ relationType: string | null;
2789
+ }>;
2790
+ declare const updateAgentRelation: (db: DatabaseClient) => (params: {
2791
+ scopes: GraphScopeConfig;
2792
+ relationId: string;
2793
+ data: SubAgentRelationUpdate;
2794
+ }) => Promise<{
2882
2795
  tenantId: string;
2796
+ projectId: string;
2883
2797
  id: string;
2884
- }[]>;
2885
- declare const getVisibleMessages: (db: DatabaseClient) => (params: {
2886
- scopes: ProjectScopeConfig;
2887
- conversationId: string;
2888
- visibility?: MessageVisibility[];
2889
- pagination: PaginationConfig;
2890
- }) => Promise<{
2798
+ graphId: string;
2891
2799
  createdAt: string;
2892
2800
  updatedAt: string;
2893
- conversationId: string;
2894
- role: string;
2895
- fromAgentId: string | null;
2896
- toAgentId: string | null;
2897
- fromExternalAgentId: string | null;
2898
- toExternalAgentId: string | null;
2899
- content: MessageContent;
2900
- visibility: string;
2901
- messageType: string;
2902
- agentId: string | null;
2903
- taskId: string | null;
2904
- parentMessageId: string | null;
2905
- a2aTaskId: string | null;
2906
- a2aSessionId: string | null;
2907
- metadata: MessageMetadata | null;
2801
+ sourceSubAgentId: string;
2802
+ targetSubAgentId: string | null;
2803
+ externalSubAgentId: string | null;
2804
+ relationType: string | null;
2805
+ }>;
2806
+ declare const deleteSubAgentRelation: (db: DatabaseClient) => (params: {
2807
+ scopes: GraphScopeConfig;
2808
+ relationId: string;
2809
+ }) => Promise<boolean>;
2810
+ declare const deleteAgentRelationsByGraph: (db: DatabaseClient) => (params: {
2811
+ scopes: GraphScopeConfig;
2812
+ }) => Promise<boolean>;
2813
+ declare const createAgentToolRelation: (db: DatabaseClient) => (params: {
2814
+ scopes: GraphScopeConfig;
2815
+ relationId?: string;
2816
+ data: {
2817
+ subAgentId: string;
2818
+ toolId: string;
2819
+ selectedTools?: string[] | null;
2820
+ headers?: Record<string, string> | null;
2821
+ };
2822
+ }) => Promise<{
2823
+ tenantId: string;
2908
2824
  projectId: string;
2825
+ id: string;
2826
+ graphId: string;
2827
+ createdAt: string;
2828
+ updatedAt: string;
2829
+ headers: Record<string, string> | null;
2830
+ toolId: string;
2831
+ selectedTools: string[] | null;
2832
+ subAgentId: string;
2833
+ }>;
2834
+ declare const updateAgentToolRelation: (db: DatabaseClient) => (params: {
2835
+ scopes: GraphScopeConfig;
2836
+ relationId: string;
2837
+ data: SubAgentToolRelationUpdate;
2838
+ }) => Promise<{
2909
2839
  tenantId: string;
2840
+ projectId: string;
2910
2841
  id: string;
2911
- }[]>;
2912
- declare const createMessage: (db: DatabaseClient) => (params: MessageInsert) => Promise<{
2842
+ graphId: string;
2843
+ createdAt: string;
2844
+ updatedAt: string;
2845
+ headers: Record<string, string> | null;
2846
+ toolId: string;
2847
+ selectedTools: string[] | null;
2848
+ subAgentId: string;
2849
+ }>;
2850
+ declare const deleteAgentToolRelation: (db: DatabaseClient) => (params: {
2851
+ scopes: GraphScopeConfig;
2852
+ relationId: string;
2853
+ }) => Promise<boolean>;
2854
+ declare const deleteAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
2855
+ scopes: AgentScopeConfig;
2856
+ }) => Promise<boolean>;
2857
+ declare const getAgentToolRelationById: (db: DatabaseClient) => (params: {
2858
+ scopes: AgentScopeConfig;
2859
+ relationId: string;
2860
+ }) => Promise<{
2913
2861
  tenantId: string;
2914
2862
  projectId: string;
2915
2863
  id: string;
2864
+ graphId: string;
2916
2865
  createdAt: string;
2917
2866
  updatedAt: string;
2918
- metadata: MessageMetadata | null;
2919
- content: MessageContent;
2920
- conversationId: string;
2921
- agentId: string | null;
2922
- role: string;
2923
- fromAgentId: string | null;
2924
- toAgentId: string | null;
2925
- fromExternalAgentId: string | null;
2926
- toExternalAgentId: string | null;
2927
- visibility: string;
2928
- messageType: string;
2929
- taskId: string | null;
2930
- parentMessageId: string | null;
2931
- a2aTaskId: string | null;
2932
- a2aSessionId: string | null;
2867
+ headers: Record<string, string> | null;
2868
+ toolId: string;
2869
+ selectedTools: string[] | null;
2870
+ subAgentId: string;
2871
+ } | undefined>;
2872
+ declare const getAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
2873
+ scopes: AgentScopeConfig;
2874
+ pagination?: PaginationConfig;
2875
+ }) => Promise<{
2876
+ data: {
2877
+ createdAt: string;
2878
+ updatedAt: string;
2879
+ toolId: string;
2880
+ selectedTools: string[] | null;
2881
+ headers: Record<string, string> | null;
2882
+ subAgentId: string;
2883
+ graphId: string;
2884
+ projectId: string;
2885
+ tenantId: string;
2886
+ id: string;
2887
+ }[];
2888
+ pagination: {
2889
+ page: number;
2890
+ limit: number;
2891
+ total: number;
2892
+ pages: number;
2893
+ };
2933
2894
  }>;
2934
- declare const updateMessage: (db: DatabaseClient) => (params: {
2935
- scopes: ProjectScopeConfig;
2936
- messageId: string;
2937
- data: MessageUpdate;
2895
+ declare const getAgentToolRelationByTool: (db: DatabaseClient) => (params: {
2896
+ scopes: GraphScopeConfig;
2897
+ toolId: string;
2898
+ pagination?: PaginationConfig;
2899
+ }) => Promise<{
2900
+ data: {
2901
+ createdAt: string;
2902
+ updatedAt: string;
2903
+ toolId: string;
2904
+ selectedTools: string[] | null;
2905
+ headers: Record<string, string> | null;
2906
+ subAgentId: string;
2907
+ graphId: string;
2908
+ projectId: string;
2909
+ tenantId: string;
2910
+ id: string;
2911
+ }[];
2912
+ pagination: {
2913
+ page: number;
2914
+ limit: number;
2915
+ total: number;
2916
+ pages: number;
2917
+ };
2918
+ }>;
2919
+ declare const listAgentToolRelations: (db: DatabaseClient) => (params: {
2920
+ scopes: GraphScopeConfig;
2921
+ pagination?: PaginationConfig;
2922
+ }) => Promise<{
2923
+ data: {
2924
+ createdAt: string;
2925
+ updatedAt: string;
2926
+ toolId: string;
2927
+ selectedTools: string[] | null;
2928
+ headers: Record<string, string> | null;
2929
+ subAgentId: string;
2930
+ graphId: string;
2931
+ projectId: string;
2932
+ tenantId: string;
2933
+ id: string;
2934
+ }[];
2935
+ pagination: {
2936
+ page: number;
2937
+ limit: number;
2938
+ total: number;
2939
+ pages: number;
2940
+ };
2941
+ }>;
2942
+ declare const getToolsForAgent: (db: DatabaseClient) => (params: {
2943
+ scopes: AgentScopeConfig;
2944
+ pagination?: PaginationConfig;
2945
+ }) => Promise<{
2946
+ data: {
2947
+ id: string;
2948
+ tenantId: string;
2949
+ subAgentId: string;
2950
+ toolId: string;
2951
+ selectedTools: string[] | null;
2952
+ headers: Record<string, string> | null;
2953
+ createdAt: string;
2954
+ updatedAt: string;
2955
+ tool: {
2956
+ id: string;
2957
+ name: string;
2958
+ description: string | null;
2959
+ config: {
2960
+ type: "mcp";
2961
+ mcp: ToolMcpConfig;
2962
+ };
2963
+ createdAt: string;
2964
+ updatedAt: string;
2965
+ capabilities: ToolServerCapabilities | null;
2966
+ lastError: string | null;
2967
+ credentialReferenceId: string | null;
2968
+ tenantId: string;
2969
+ projectId: string;
2970
+ headers: Record<string, string> | null;
2971
+ imageUrl: string | null;
2972
+ };
2973
+ }[];
2974
+ pagination: {
2975
+ page: number;
2976
+ limit: number;
2977
+ total: number;
2978
+ pages: number;
2979
+ };
2980
+ }>;
2981
+ declare const getAgentsForTool: (db: DatabaseClient) => (params: {
2982
+ scopes: GraphScopeConfig;
2983
+ toolId: string;
2984
+ pagination?: PaginationConfig;
2985
+ }) => Promise<{
2986
+ data: {
2987
+ id: string;
2988
+ tenantId: string;
2989
+ subAgentId: string;
2990
+ toolId: string;
2991
+ selectedTools: string[] | null;
2992
+ headers: Record<string, string> | null;
2993
+ createdAt: string;
2994
+ updatedAt: string;
2995
+ subAgent: {
2996
+ id: string;
2997
+ name: string;
2998
+ description: string;
2999
+ prompt: string;
3000
+ conversationHistoryConfig: ConversationHistoryConfig | null;
3001
+ models: {
3002
+ base?: {
3003
+ model?: string | undefined;
3004
+ providerOptions?: Record<string, any> | undefined;
3005
+ } | undefined;
3006
+ structuredOutput?: {
3007
+ model?: string | undefined;
3008
+ providerOptions?: Record<string, any> | undefined;
3009
+ } | undefined;
3010
+ summarizer?: {
3011
+ model?: string | undefined;
3012
+ providerOptions?: Record<string, any> | undefined;
3013
+ } | undefined;
3014
+ } | null;
3015
+ stopWhen: {
3016
+ stepCountIs?: number | undefined;
3017
+ } | null;
3018
+ createdAt: string;
3019
+ updatedAt: string;
3020
+ };
3021
+ }[];
3022
+ pagination: {
3023
+ page: number;
3024
+ limit: number;
3025
+ total: number;
3026
+ pages: number;
3027
+ };
3028
+ }>;
3029
+ declare const validateInternalSubAgent: (db: DatabaseClient) => (params: {
3030
+ scopes: AgentScopeConfig;
3031
+ }) => Promise<boolean>;
3032
+ declare const validateExternalAgent: (db: DatabaseClient) => (params: {
3033
+ scopes: AgentScopeConfig;
3034
+ }) => Promise<boolean>;
3035
+
3036
+ declare const getSubAgentById: (db: DatabaseClient) => (params: {
3037
+ scopes: GraphScopeConfig;
3038
+ subAgentId: string;
3039
+ }) => Promise<{
3040
+ tenantId: string;
3041
+ projectId: string;
3042
+ id: string;
3043
+ name: string;
3044
+ description: string;
3045
+ prompt: string;
3046
+ graphId: string;
3047
+ createdAt: string;
3048
+ updatedAt: string;
3049
+ models: {
3050
+ base?: {
3051
+ model?: string | undefined;
3052
+ providerOptions?: Record<string, any> | undefined;
3053
+ } | undefined;
3054
+ structuredOutput?: {
3055
+ model?: string | undefined;
3056
+ providerOptions?: Record<string, any> | undefined;
3057
+ } | undefined;
3058
+ summarizer?: {
3059
+ model?: string | undefined;
3060
+ providerOptions?: Record<string, any> | undefined;
3061
+ } | undefined;
3062
+ } | null;
3063
+ stopWhen: {
3064
+ stepCountIs?: number | undefined;
3065
+ } | null;
3066
+ conversationHistoryConfig: ConversationHistoryConfig | null;
3067
+ } | undefined>;
3068
+ declare const listSubAgents: (db: DatabaseClient) => (params: {
3069
+ scopes: GraphScopeConfig;
3070
+ }) => Promise<{
3071
+ tenantId: string;
3072
+ projectId: string;
3073
+ id: string;
3074
+ name: string;
3075
+ description: string;
3076
+ prompt: string;
3077
+ graphId: string;
3078
+ createdAt: string;
3079
+ updatedAt: string;
3080
+ models: {
3081
+ base?: {
3082
+ model?: string | undefined;
3083
+ providerOptions?: Record<string, any> | undefined;
3084
+ } | undefined;
3085
+ structuredOutput?: {
3086
+ model?: string | undefined;
3087
+ providerOptions?: Record<string, any> | undefined;
3088
+ } | undefined;
3089
+ summarizer?: {
3090
+ model?: string | undefined;
3091
+ providerOptions?: Record<string, any> | undefined;
3092
+ } | undefined;
3093
+ } | null;
3094
+ stopWhen: {
3095
+ stepCountIs?: number | undefined;
3096
+ } | null;
3097
+ conversationHistoryConfig: ConversationHistoryConfig | null;
3098
+ }[]>;
3099
+ declare const listSubAgentsPaginated: (db: DatabaseClient) => (params: {
3100
+ scopes: GraphScopeConfig;
3101
+ pagination?: PaginationConfig;
2938
3102
  }) => Promise<{
3103
+ data: {
3104
+ createdAt: string;
3105
+ updatedAt: string;
3106
+ prompt: string;
3107
+ conversationHistoryConfig: ConversationHistoryConfig | null;
3108
+ models: {
3109
+ base?: {
3110
+ model?: string | undefined;
3111
+ providerOptions?: Record<string, any> | undefined;
3112
+ } | undefined;
3113
+ structuredOutput?: {
3114
+ model?: string | undefined;
3115
+ providerOptions?: Record<string, any> | undefined;
3116
+ } | undefined;
3117
+ summarizer?: {
3118
+ model?: string | undefined;
3119
+ providerOptions?: Record<string, any> | undefined;
3120
+ } | undefined;
3121
+ } | null;
3122
+ stopWhen: {
3123
+ stepCountIs?: number | undefined;
3124
+ } | null;
3125
+ name: string;
3126
+ description: string;
3127
+ graphId: string;
3128
+ projectId: string;
3129
+ tenantId: string;
3130
+ id: string;
3131
+ }[];
3132
+ pagination: {
3133
+ page: number;
3134
+ limit: number;
3135
+ total: number;
3136
+ pages: number;
3137
+ };
3138
+ }>;
3139
+ declare const createSubAgent: (db: DatabaseClient) => (params: SubAgentInsert) => Promise<{
2939
3140
  tenantId: string;
2940
3141
  projectId: string;
2941
3142
  id: string;
3143
+ name: string;
3144
+ description: string;
3145
+ prompt: string;
3146
+ graphId: string;
2942
3147
  createdAt: string;
2943
3148
  updatedAt: string;
2944
- metadata: MessageMetadata | null;
2945
- content: MessageContent;
2946
- conversationId: string;
2947
- agentId: string | null;
2948
- role: string;
2949
- fromAgentId: string | null;
2950
- toAgentId: string | null;
2951
- fromExternalAgentId: string | null;
2952
- toExternalAgentId: string | null;
2953
- visibility: string;
2954
- messageType: string;
2955
- taskId: string | null;
2956
- parentMessageId: string | null;
2957
- a2aTaskId: string | null;
2958
- a2aSessionId: string | null;
3149
+ models: {
3150
+ base?: {
3151
+ model?: string | undefined;
3152
+ providerOptions?: Record<string, any> | undefined;
3153
+ } | undefined;
3154
+ structuredOutput?: {
3155
+ model?: string | undefined;
3156
+ providerOptions?: Record<string, any> | undefined;
3157
+ } | undefined;
3158
+ summarizer?: {
3159
+ model?: string | undefined;
3160
+ providerOptions?: Record<string, any> | undefined;
3161
+ } | undefined;
3162
+ } | null;
3163
+ stopWhen: {
3164
+ stepCountIs?: number | undefined;
3165
+ } | null;
3166
+ conversationHistoryConfig: ConversationHistoryConfig | null;
2959
3167
  }>;
2960
- declare const deleteMessage: (db: DatabaseClient) => (params: {
2961
- scopes: ProjectScopeConfig;
2962
- messageId: string;
3168
+ declare const updateSubAgent: (db: DatabaseClient) => (params: {
3169
+ scopes: GraphScopeConfig;
3170
+ subAgentId: string;
3171
+ data: SubAgentUpdate;
2963
3172
  }) => Promise<{
2964
3173
  tenantId: string;
2965
3174
  projectId: string;
2966
3175
  id: string;
3176
+ name: string;
3177
+ description: string;
3178
+ prompt: string;
3179
+ graphId: string;
2967
3180
  createdAt: string;
2968
3181
  updatedAt: string;
2969
- metadata: MessageMetadata | null;
2970
- content: MessageContent;
2971
- conversationId: string;
2972
- agentId: string | null;
2973
- role: string;
2974
- fromAgentId: string | null;
2975
- toAgentId: string | null;
2976
- fromExternalAgentId: string | null;
2977
- toExternalAgentId: string | null;
2978
- visibility: string;
2979
- messageType: string;
2980
- taskId: string | null;
2981
- parentMessageId: string | null;
2982
- a2aTaskId: string | null;
2983
- a2aSessionId: string | null;
3182
+ models: {
3183
+ base?: {
3184
+ model?: string | undefined;
3185
+ providerOptions?: Record<string, any> | undefined;
3186
+ } | undefined;
3187
+ structuredOutput?: {
3188
+ model?: string | undefined;
3189
+ providerOptions?: Record<string, any> | undefined;
3190
+ } | undefined;
3191
+ summarizer?: {
3192
+ model?: string | undefined;
3193
+ providerOptions?: Record<string, any> | undefined;
3194
+ } | undefined;
3195
+ } | null;
3196
+ stopWhen: {
3197
+ stepCountIs?: number | undefined;
3198
+ } | null;
3199
+ conversationHistoryConfig: ConversationHistoryConfig | null;
2984
3200
  }>;
2985
- declare const countMessagesByConversation: (db: DatabaseClient) => (params: {
2986
- scopes: ProjectScopeConfig;
2987
- conversationId: string;
2988
- }) => Promise<number>;
2989
-
2990
- /**
2991
- * Server-side data access layer for Full Project operations.
2992
- * This module provides functions for creating, retrieving, updating, and deleting
2993
- * complete project definitions with all nested resources (graphs, agents, tools, etc.).
2994
- */
2995
-
2996
- type ProjectLogger = ReturnType<typeof getLogger>;
2997
- /**
2998
- * Server-side implementation of createFullProject that performs actual database operations.
2999
- * This function creates a complete project with all graphs and their nested resources.
3000
- */
3001
- declare const createFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
3002
- /**
3003
- * Server-side implementation of updateFullProject that performs actual database operations.
3004
- * This function updates a complete project with all graphs and their nested resources.
3005
- */
3006
- declare const updateFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
3007
- /**
3008
- * Get a complete project definition with all nested resources
3009
- */
3010
- declare const getFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
3011
- scopes: ProjectScopeConfig;
3012
- }) => Promise<FullProjectDefinition | null>;
3013
3201
  /**
3014
- * Delete a complete project and cascade to all related entities
3202
+ * Upsert agent (create if it doesn't exist, update if it does)
3015
3203
  */
3016
- declare const deleteFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
3017
- scopes: ProjectScopeConfig;
3204
+ declare const upsertSubAgent: (db: DatabaseClient) => (params: {
3205
+ data: SubAgentInsert;
3206
+ }) => Promise<SubAgentSelect>;
3207
+ declare const deleteSubAgent: (db: DatabaseClient) => (params: {
3208
+ scopes: GraphScopeConfig;
3209
+ subAgentId: string;
3018
3210
  }) => Promise<boolean>;
3019
-
3020
- /**
3021
- * List all unique project IDs within a tenant by scanning all resource tables
3022
- */
3023
- declare const listProjects: (db: DatabaseClient) => (params: {
3024
- tenantId: string;
3025
- }) => Promise<ProjectInfo[]>;
3026
- /**
3027
- * List all unique project IDs within a tenant with pagination
3028
- */
3029
- declare const listProjectsPaginated: (db: DatabaseClient) => (params: {
3030
- tenantId: string;
3031
- pagination?: PaginationConfig;
3211
+ declare const getSubAgentsByIds: (db: DatabaseClient) => (params: {
3212
+ scopes: GraphScopeConfig;
3213
+ subAgentIds: string[];
3032
3214
  }) => Promise<{
3033
- data: ProjectSelect[];
3034
- pagination: PaginationResult;
3035
- }>;
3036
- /**
3037
- * Get resource counts for a specific project
3038
- */
3039
- declare const getProjectResourceCounts: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<ProjectResourceCounts>;
3040
- /**
3041
- * Check if a project exists (has any resources)
3042
- */
3043
- declare const projectExists: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
3044
- /**
3045
- * Count total projects for a tenant
3046
- */
3047
- declare const countProjects: (db: DatabaseClient) => (params: {
3215
+ createdAt: string;
3216
+ updatedAt: string;
3217
+ prompt: string;
3218
+ conversationHistoryConfig: ConversationHistoryConfig | null;
3219
+ models: {
3220
+ base?: {
3221
+ model?: string | undefined;
3222
+ providerOptions?: Record<string, any> | undefined;
3223
+ } | undefined;
3224
+ structuredOutput?: {
3225
+ model?: string | undefined;
3226
+ providerOptions?: Record<string, any> | undefined;
3227
+ } | undefined;
3228
+ summarizer?: {
3229
+ model?: string | undefined;
3230
+ providerOptions?: Record<string, any> | undefined;
3231
+ } | undefined;
3232
+ } | null;
3233
+ stopWhen: {
3234
+ stepCountIs?: number | undefined;
3235
+ } | null;
3236
+ name: string;
3237
+ description: string;
3238
+ graphId: string;
3239
+ projectId: string;
3048
3240
  tenantId: string;
3049
- }) => Promise<number>;
3050
- /**
3051
- * Get a single project by ID
3052
- */
3053
- declare const getProject: (db: DatabaseClient) => (params: {
3054
- scopes: ProjectScopeConfig;
3055
- }) => Promise<ProjectSelect | null>;
3056
- /**
3057
- * Create a new project
3058
- */
3059
- declare const createProject: (db: DatabaseClient) => (params: ProjectInsert) => Promise<ProjectSelect>;
3060
- /**
3061
- * Update an existing project
3062
- */
3063
- declare const updateProject: (db: DatabaseClient) => (params: {
3064
- scopes: ProjectScopeConfig;
3065
- data: ProjectUpdate;
3066
- }) => Promise<ProjectSelect | null>;
3067
- /**
3068
- * Check if a project exists in the projects table
3069
- */
3070
- declare const projectExistsInTable: (db: DatabaseClient) => (params: {
3071
- scopes: ProjectScopeConfig;
3072
- }) => Promise<boolean>;
3073
- /**
3074
- * Check if a project has any resources (used before deletion)
3075
- */
3076
- declare const projectHasResources: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
3077
- /**
3078
- * Delete a project (with validation for existing resources)
3079
- */
3080
- declare const deleteProject: (db: DatabaseClient) => (params: {
3081
- scopes: ProjectScopeConfig;
3082
- }) => Promise<boolean>;
3241
+ id: string;
3242
+ }[]>;
3083
3243
 
3084
3244
  declare const createTask: (db: DatabaseClient) => (params: TaskInsert) => Promise<{
3085
3245
  tenantId: string;
@@ -3091,7 +3251,7 @@ declare const createTask: (db: DatabaseClient) => (params: TaskInsert) => Promis
3091
3251
  status: string;
3092
3252
  metadata: TaskMetadataConfig | null;
3093
3253
  contextId: string;
3094
- agentId: string;
3254
+ subAgentId: string;
3095
3255
  }>;
3096
3256
  declare const getTask: (db: DatabaseClient) => (params: {
3097
3257
  id: string;
@@ -3112,7 +3272,7 @@ declare const updateTask: (db: DatabaseClient) => (params: {
3112
3272
  status: string;
3113
3273
  metadata: TaskMetadataConfig | null;
3114
3274
  contextId: string;
3115
- agentId: string;
3275
+ subAgentId: string;
3116
3276
  }>;
3117
3277
  declare const listTaskIdsByContextId: (db: DatabaseClient) => (params: {
3118
3278
  contextId: string;
@@ -3131,20 +3291,12 @@ declare const getToolById: (db: DatabaseClient) => (params: {
3131
3291
  config: {
3132
3292
  type: "mcp";
3133
3293
  mcp: ToolMcpConfig;
3134
- } | {
3135
- type: "function";
3136
- function?: {
3137
- inputSchema: Record<string, unknown>;
3138
- executeCode: string;
3139
- dependencies: Record<string, unknown>;
3140
- };
3141
3294
  };
3142
3295
  credentialReferenceId: string | null;
3143
3296
  createdAt: string;
3144
3297
  updatedAt: string;
3145
3298
  headers: Record<string, string> | null;
3146
3299
  capabilities: ToolServerCapabilities | null;
3147
- functionId: string | null;
3148
3300
  imageUrl: string | null;
3149
3301
  lastError: string | null;
3150
3302
  } | null>;
@@ -3160,15 +3312,7 @@ declare const listTools: (db: DatabaseClient) => (params: {
3160
3312
  config: {
3161
3313
  type: "mcp";
3162
3314
  mcp: ToolMcpConfig;
3163
- } | {
3164
- type: "function";
3165
- function?: {
3166
- inputSchema: Record<string, unknown>;
3167
- executeCode: string;
3168
- dependencies: Record<string, unknown>;
3169
- };
3170
3315
  };
3171
- functionId: string | null;
3172
3316
  credentialReferenceId: string | null;
3173
3317
  headers: Record<string, string> | null;
3174
3318
  imageUrl: string | null;
@@ -3194,20 +3338,12 @@ declare const createTool: (db: DatabaseClient) => (params: ToolInsert) => Promis
3194
3338
  config: {
3195
3339
  type: "mcp";
3196
3340
  mcp: ToolMcpConfig;
3197
- } | {
3198
- type: "function";
3199
- function?: {
3200
- inputSchema: Record<string, unknown>;
3201
- executeCode: string;
3202
- dependencies: Record<string, unknown>;
3203
- };
3204
3341
  };
3205
3342
  credentialReferenceId: string | null;
3206
3343
  createdAt: string;
3207
3344
  updatedAt: string;
3208
3345
  headers: Record<string, string> | null;
3209
3346
  capabilities: ToolServerCapabilities | null;
3210
- functionId: string | null;
3211
3347
  imageUrl: string | null;
3212
3348
  lastError: string | null;
3213
3349
  }>;
@@ -3224,20 +3360,12 @@ declare const updateTool: (db: DatabaseClient) => (params: {
3224
3360
  config: {
3225
3361
  type: "mcp";
3226
3362
  mcp: ToolMcpConfig;
3227
- } | {
3228
- type: "function";
3229
- function?: {
3230
- inputSchema: Record<string, unknown>;
3231
- executeCode: string;
3232
- dependencies: Record<string, unknown>;
3233
- };
3234
3363
  };
3235
3364
  credentialReferenceId: string | null;
3236
3365
  createdAt: string;
3237
3366
  updatedAt: string;
3238
3367
  headers: Record<string, string> | null;
3239
3368
  capabilities: ToolServerCapabilities | null;
3240
- functionId: string | null;
3241
3369
  imageUrl: string | null;
3242
3370
  lastError: string | null;
3243
3371
  }>;
@@ -3247,7 +3375,7 @@ declare const deleteTool: (db: DatabaseClient) => (params: {
3247
3375
  }) => Promise<boolean>;
3248
3376
  declare const addToolToAgent: (db: DatabaseClient) => (params: {
3249
3377
  scopes: GraphScopeConfig;
3250
- agentId: string;
3378
+ subAgentId: string;
3251
3379
  toolId: string;
3252
3380
  selectedTools?: string[] | null;
3253
3381
  headers?: Record<string, string> | null;
@@ -3261,11 +3389,11 @@ declare const addToolToAgent: (db: DatabaseClient) => (params: {
3261
3389
  headers: Record<string, string> | null;
3262
3390
  toolId: string;
3263
3391
  selectedTools: string[] | null;
3264
- agentId: string;
3392
+ subAgentId: string;
3265
3393
  }>;
3266
3394
  declare const removeToolFromAgent: (db: DatabaseClient) => (params: {
3267
3395
  scopes: GraphScopeConfig;
3268
- agentId: string;
3396
+ subAgentId: string;
3269
3397
  toolId: string;
3270
3398
  }) => Promise<{
3271
3399
  tenantId: string;
@@ -3277,14 +3405,14 @@ declare const removeToolFromAgent: (db: DatabaseClient) => (params: {
3277
3405
  headers: Record<string, string> | null;
3278
3406
  toolId: string;
3279
3407
  selectedTools: string[] | null;
3280
- agentId: string;
3408
+ subAgentId: string;
3281
3409
  }>;
3282
3410
  /**
3283
3411
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
3284
3412
  */
3285
- declare const upsertAgentToolRelation: (db: DatabaseClient) => (params: {
3413
+ declare const upsertSubAgentToolRelation: (db: DatabaseClient) => (params: {
3286
3414
  scopes: GraphScopeConfig;
3287
- agentId: string;
3415
+ subAgentId: string;
3288
3416
  toolId: string;
3289
3417
  selectedTools?: string[] | null;
3290
3418
  headers?: Record<string, string> | null;
@@ -3299,7 +3427,7 @@ declare const upsertAgentToolRelation: (db: DatabaseClient) => (params: {
3299
3427
  headers: Record<string, string> | null;
3300
3428
  toolId: string;
3301
3429
  selectedTools: string[] | null;
3302
- agentId: string;
3430
+ subAgentId: string;
3303
3431
  }>;
3304
3432
  /**
3305
3433
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -3315,20 +3443,12 @@ declare const upsertTool: (db: DatabaseClient) => (params: {
3315
3443
  config: {
3316
3444
  type: "mcp";
3317
3445
  mcp: ToolMcpConfig;
3318
- } | {
3319
- type: "function";
3320
- function?: {
3321
- inputSchema: Record<string, unknown>;
3322
- executeCode: string;
3323
- dependencies: Record<string, unknown>;
3324
- };
3325
3446
  };
3326
3447
  credentialReferenceId: string | null;
3327
3448
  createdAt: string;
3328
3449
  updatedAt: string;
3329
3450
  headers: Record<string, string> | null;
3330
3451
  capabilities: ToolServerCapabilities | null;
3331
- functionId: string | null;
3332
3452
  imageUrl: string | null;
3333
3453
  lastError: string | null;
3334
3454
  }>;
@@ -4032,4 +4152,4 @@ declare function setSpanWithError(span: Span, error: Error, logger?: {
4032
4152
  */
4033
4153
  declare function getTracer(serviceName: string, serviceVersion?: string): Tracer;
4034
4154
 
4035
- export { AgentGraphInsert, AgentGraphUpdate, AgentInsert, AgentRelationInsert, AgentRelationUpdate, AgentScopeConfig, AgentSelect, AgentToolRelationUpdate, AgentUpdate, ApiKeyCreateResult, type ApiKeyGenerationResult, ApiKeyInsert, ApiKeySelect, ApiKeyUpdate, Artifact, ArtifactComponentInsert, ArtifactComponentSelect, ArtifactComponentUpdate, type CommonCreateErrorResponses, type CommonDeleteErrorResponses, type CommonGetErrorResponses, type CommonUpdateErrorResponses, ContextCache, ContextCacheInsert, ContextCacheSelect, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextConfigInsert, ContextConfigSelect, ContextConfigUpdate, ContextFetchDefinition, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type ContextResolverInterface, type ContextValidationError, type ContextValidationResult, ConversationHistoryConfig, ConversationInsert, ConversationMetadata, ConversationSelect, ConversationUpdate, CreateApiKeyParams, type CredentialContext, type CredentialData, CredentialReferenceApiInsert, CredentialReferenceInsert, CredentialReferenceSelect, CredentialReferenceUpdate, type CredentialReferenceWithTools, type CredentialResolverInput, CredentialStore, type CredentialStoreReference, CredentialStoreRegistry, CredentialStoreType, CredentialStuffer, DataComponentInsert, DataComponentSelect, DataComponentUpdate, type DatabaseClient, type DatabaseConfig, type DotPaths, ERROR_DOCS_BASE_URL, ErrorCode, type ErrorCodes, type ErrorResponse, ExecutionContext, ExternalAgentInsert, ExternalAgentRelationInsert, ExternalAgentSelect, ExternalAgentUpdate, type FetchResult, FullGraphDefinition, FullProjectDefinition, FunctionApiInsert, type GraphLogger, GraphScopeConfig, HTTP_REQUEST_PARTS, type HttpRequestPart, InMemoryCredentialStore, KeyChainStore, LedgerArtifactSelect, type LoggerFactoryConfig, MCPToolConfig, MCPTransportType, McpClient, type McpClientOptions, type McpSSEConfig, type McpServerConfig, type McpStreamableHttpConfig, McpTool, MessageContent, MessageInsert, MessageMetadata, MessageUpdate, MessageVisibility, NangoCredentialStore, type OAuthConfig, PaginationConfig, PaginationResult, type ParsedHttpRequest, PinoLogger, type PinoLoggerConfig, type ProblemDetails, ProjectInfo, ProjectInsert, type ProjectLogger, ProjectResourceCounts, ProjectScopeConfig, ProjectSelect, ProjectUpdate, type ResolvedContext, TaskInsert, TaskMetadataConfig, TaskSelect, type TemplateContext, TemplateEngine, type TemplateRenderOptions, ToolInsert, ToolMcpConfig, ToolSelect, ToolServerCapabilities, ToolUpdate, addLedgerArtifacts, addToolToAgent, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createFullProjectServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteFullProject, deleteFunction, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, getActiveAgentForConversation, getAgentById, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getFunction, getGraphAgentInfos, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctions, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateFullProjectServerSide, updateMessage, updateProject, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertLedgerArtifact, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHeaders, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validationHelper, withProjectValidation };
4155
+ export { AgentGraphInsert, AgentGraphUpdate, AgentScopeConfig, ApiKeyCreateResult, type ApiKeyGenerationResult, ApiKeyInsert, ApiKeySelect, ApiKeyUpdate, Artifact, ArtifactComponentInsert, ArtifactComponentSelect, ArtifactComponentUpdate, type CommonCreateErrorResponses, type CommonDeleteErrorResponses, type CommonGetErrorResponses, type CommonUpdateErrorResponses, ContextCache, ContextCacheInsert, ContextCacheSelect, ContextConfigBuilder, type ContextConfigBuilderOptions, ContextConfigInsert, ContextConfigSelect, ContextConfigUpdate, ContextFetchDefinition, ContextFetcher, type ContextResolutionOptions, type ContextResolutionResult, ContextResolver, type ContextResolverInterface, type ContextValidationError, type ContextValidationResult, ConversationHistoryConfig, ConversationInsert, ConversationMetadata, ConversationSelect, ConversationUpdate, CreateApiKeyParams, type CredentialContext, type CredentialData, CredentialReferenceApiInsert, CredentialReferenceInsert, CredentialReferenceSelect, CredentialReferenceUpdate, type CredentialReferenceWithTools, type CredentialResolverInput, CredentialStore, type CredentialStoreReference, CredentialStoreRegistry, CredentialStoreType, CredentialStuffer, DataComponentInsert, DataComponentSelect, DataComponentUpdate, type DatabaseClient, type DatabaseConfig, type DotPaths, ERROR_DOCS_BASE_URL, ErrorCode, type ErrorCodes, type ErrorResponse, ExecutionContext, ExternalAgentInsert, ExternalAgentSelect, ExternalAgentUpdate, ExternalSubAgentRelationInsert, type FetchResult, FullGraphDefinition, FullProjectDefinition, FunctionApiInsert, FunctionToolApiInsert, FunctionToolApiUpdate, type GraphLogger, GraphScopeConfig, HTTP_REQUEST_PARTS, type HttpRequestPart, InMemoryCredentialStore, KeyChainStore, LedgerArtifactSelect, type LoggerFactoryConfig, MCPToolConfig, MCPTransportType, McpClient, type McpClientOptions, type McpSSEConfig, type McpServerConfig, type McpStreamableHttpConfig, McpTool, MessageContent, MessageInsert, MessageMetadata, MessageUpdate, MessageVisibility, NangoCredentialStore, type OAuthConfig, PaginationConfig, PaginationResult, type ParsedHttpRequest, PinoLogger, type PinoLoggerConfig, type ProblemDetails, ProjectInfo, ProjectInsert, type ProjectLogger, ProjectResourceCounts, ProjectScopeConfig, ProjectSelect, ProjectUpdate, type ResolvedContext, SubAgentInsert, SubAgentRelationInsert, SubAgentRelationUpdate, SubAgentSelect, SubAgentToolRelationUpdate, SubAgentUpdate, TaskInsert, TaskMetadataConfig, TaskSelect, type TemplateContext, TemplateEngine, type TemplateRenderOptions, ToolInsert, ToolMcpConfig, ToolSelect, ToolServerCapabilities, ToolUpdate, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgentGraph, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createFullProjectServerSide, createFunctionTool, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentRelation, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, getActiveAgentForConversation, getAgentGraphById, getAgentGraphWithDefaultSubAgent, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getGraphAgentInfos, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getSubAgentById, getSubAgentsByIds, getTask, getToolById, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentFunctionToolRelation, updateTask, updateTool, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentFunctionToolRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHeaders, validateHttpRequestHeaders, validateInternalSubAgent, validateProjectExists, validationHelper, withProjectValidation };