@inkeep/agents-core 0.16.3 → 0.18.0

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-72MXE5SX.js → chunk-E4SFK6AI.js} +143 -157
  3. package/dist/{chunk-VPJ6Z5QZ.js → chunk-ID4CFGVF.js} +202 -131
  4. package/dist/chunk-JTHQYGCX.js +173 -0
  5. package/dist/chunk-TCLX6C3C.js +271 -0
  6. package/dist/client-exports.cjs +622 -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 +2734 -1831
  15. package/dist/index.d.cts +1667 -1550
  16. package/dist/index.d.ts +1667 -1550
  17. package/dist/index.js +1880 -1394
  18. package/dist/{schema-BQk_FMBV.d.ts → schema-Bjy5TkFv.d.cts} +473 -172
  19. package/dist/{schema-Ct2NlO81.d.cts → schema-CfWbqju2.d.ts} +473 -172
  20. package/dist/signoz-queries-CifqdbnO.d.cts +269 -0
  21. package/dist/signoz-queries-CifqdbnO.d.ts +269 -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-Fxoh7s82.d.cts} +585 -384
  25. package/dist/{utility-s9c5CVOe.d.ts → utility-Fxoh7s82.d.ts} +585 -384
  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-N43VFJD3.js +0 -134
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
+ export { h as ACTIVITY_NAMES, f as ACTIVITY_STATUS, e as ACTIVITY_TYPES, g as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k 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, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, d as SPAN_KEYS, S as SPAN_NAMES, i as TOOL_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE } from './signoz-queries-CifqdbnO.js';
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.js';
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.js';
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-Fxoh7s82.js';
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-Fxoh7s82.js';
4
5
  import { CredentialStore } from './types/index.js';
5
6
  export { CorsConfig, ServerConfig, ServerOptions } from './types/index.js';
6
7
  import { LibSQLDatabase } from 'drizzle-orm/libsql';
7
- import { s as schema } from './schema-BQk_FMBV.js';
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-BQk_FMBV.js';
8
+ import { s as schema } from './schema-CfWbqju2.js';
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-CfWbqju2.js';
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.js';
18
19
  import { Span, Tracer } from '@opentelemetry/api';
19
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './validation/index.js';
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.js';
20
21
  export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.js';
21
22
  import 'drizzle-zod';
22
23
  import 'drizzle-orm/sqlite-core';
@@ -67,11 +68,8 @@ type ExtractSchemasFromCV<CV> = {
67
68
  type InferContextFromSchemas<CZ> = {
68
69
  [K in keyof CZ]: CZ[K] extends z.ZodTypeAny ? z.infer<CZ[K]> : never;
69
70
  };
70
- type MergeHeaders<R extends z.ZodTypeAny | undefined> = R extends z.ZodTypeAny ? {
71
- headers: z.infer<R>;
72
- } : {};
73
- type FullContext<R extends z.ZodTypeAny | undefined, CV> = MergeHeaders<R> & InferContextFromSchemas<ExtractSchemasFromCV<CV>>;
74
- type AllowedPaths<R extends z.ZodTypeAny | undefined, CV> = DotPaths<FullContext<R, CV>>;
71
+ type FullContext<CV> = InferContextFromSchemas<ExtractSchemasFromCV<CV>>;
72
+ type AllowedPaths<CV> = DotPaths<FullContext<CV>>;
75
73
  interface HeadersSchemaBuilderOptions<R extends z.ZodTypeAny> {
76
74
  schema: R;
77
75
  }
@@ -129,7 +127,7 @@ declare class ContextConfigBuilder<R extends z.ZodTypeAny | undefined, CV extend
129
127
  getContextVariables(): Record<string, ContextFetchDefinition>;
130
128
  withHeadersSchema(schema: any): this;
131
129
  /** 4) The function you ship: path autocomplete + validation, returns {{path}} */
132
- toTemplate<P extends AllowedPaths<R, CV>>(path: P): `{{${P}}}`;
130
+ toTemplate<P extends AllowedPaths<CV>>(path: P): `{{${P}}}`;
133
131
  validate(): {
134
132
  valid: boolean;
135
133
  errors: string[];
@@ -848,7 +846,7 @@ declare const getAgentGraphById: (db: DatabaseClient) => (params: {
848
846
  stopWhen: {
849
847
  transferCountIs?: number | undefined;
850
848
  } | null;
851
- defaultAgentId: string | null;
849
+ defaultSubAgentId: string | null;
852
850
  contextConfigId: string | null;
853
851
  statusUpdates: {
854
852
  enabled?: boolean | undefined;
@@ -867,7 +865,7 @@ declare const getAgentGraphById: (db: DatabaseClient) => (params: {
867
865
  } | null;
868
866
  graphPrompt: string | null;
869
867
  } | null>;
870
- declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
868
+ declare const getAgentGraphWithDefaultSubAgent: (db: DatabaseClient) => (params: {
871
869
  scopes: GraphScopeConfig;
872
870
  }) => Promise<{
873
871
  tenantId: string;
@@ -894,7 +892,7 @@ declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
894
892
  stopWhen: {
895
893
  transferCountIs?: number | undefined;
896
894
  } | null;
897
- defaultAgentId: string | null;
895
+ defaultSubAgentId: string | null;
898
896
  contextConfigId: string | null;
899
897
  statusUpdates: {
900
898
  enabled?: boolean | undefined;
@@ -912,7 +910,7 @@ declare const getAgentGraphWithDefaultAgent: (db: DatabaseClient) => (params: {
912
910
  }[] | undefined;
913
911
  } | null;
914
912
  graphPrompt: string | null;
915
- defaultAgent: {
913
+ defaultSubAgent: {
916
914
  tenantId: string;
917
915
  projectId: string;
918
916
  id: string;
@@ -969,7 +967,7 @@ declare const listAgentGraphs: (db: DatabaseClient) => (params: {
969
967
  stopWhen: {
970
968
  transferCountIs?: number | undefined;
971
969
  } | null;
972
- defaultAgentId: string | null;
970
+ defaultSubAgentId: string | null;
973
971
  contextConfigId: string | null;
974
972
  statusUpdates: {
975
973
  enabled?: boolean | undefined;
@@ -997,7 +995,7 @@ declare const listAgentGraphsPaginated: (db: DatabaseClient) => (params: {
997
995
  updatedAt: string;
998
996
  name: string;
999
997
  description: string | null;
1000
- defaultAgentId: string | null;
998
+ defaultSubAgentId: string | null;
1001
999
  contextConfigId: string | null;
1002
1000
  models: {
1003
1001
  base?: {
@@ -1068,7 +1066,7 @@ declare const createAgentGraph: (db: DatabaseClient) => (data: AgentGraphInsert)
1068
1066
  stopWhen: {
1069
1067
  transferCountIs?: number | undefined;
1070
1068
  } | null;
1071
- defaultAgentId: string | null;
1069
+ defaultSubAgentId: string | null;
1072
1070
  contextConfigId: string | null;
1073
1071
  statusUpdates: {
1074
1072
  enabled?: boolean | undefined;
@@ -1115,7 +1113,7 @@ declare const updateAgentGraph: (db: DatabaseClient) => (params: {
1115
1113
  stopWhen: {
1116
1114
  transferCountIs?: number | undefined;
1117
1115
  } | null;
1118
- defaultAgentId: string | null;
1116
+ defaultSubAgentId: string | null;
1119
1117
  contextConfigId: string | null;
1120
1118
  statusUpdates: {
1121
1119
  enabled?: boolean | undefined;
@@ -1140,17 +1138,18 @@ declare const deleteAgentGraph: (db: DatabaseClient) => (params: {
1140
1138
  /**
1141
1139
  * Helper function to fetch component relationships using efficient joins
1142
1140
  */
1143
- 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: {
1144
1142
  relationTable: any;
1145
1143
  componentTable: any;
1146
1144
  relationIdField: any;
1147
1145
  componentIdField: any;
1146
+ subAgentIdField: any;
1148
1147
  selectFields: Record<string, any>;
1149
1148
  }) => Promise<Record<string, T>>;
1150
- declare const getGraphAgentInfos: (db: DatabaseClient) => ({ scopes, graphId, agentId, }: {
1149
+ declare const getGraphAgentInfos: (db: DatabaseClient) => ({ scopes, graphId, subAgentId, }: {
1151
1150
  scopes: ProjectScopeConfig;
1152
1151
  graphId: string;
1153
- agentId: string;
1152
+ subAgentId: string;
1154
1153
  }) => Promise<{
1155
1154
  id: string;
1156
1155
  name: string;
@@ -1166,137 +1165,60 @@ declare const upsertAgentGraph: (db: DatabaseClient) => (params: {
1166
1165
  data: AgentGraphInsert;
1167
1166
  }) => Promise<any>;
1168
1167
 
1169
- declare const getAgentRelationById: (db: DatabaseClient) => (params: {
1170
- scopes: GraphScopeConfig;
1171
- relationId: string;
1168
+ declare const getApiKeyById: (db: DatabaseClient) => (params: {
1169
+ scopes: ProjectScopeConfig;
1170
+ id: string;
1172
1171
  }) => Promise<{
1173
1172
  tenantId: string;
1174
1173
  projectId: string;
1175
1174
  id: string;
1175
+ name: string | null;
1176
1176
  graphId: string;
1177
+ publicId: string;
1178
+ keyHash: string;
1179
+ keyPrefix: string;
1180
+ lastUsedAt: string | null;
1181
+ expiresAt: string | null;
1177
1182
  createdAt: string;
1178
1183
  updatedAt: string;
1179
- sourceAgentId: string;
1180
- targetAgentId: string | null;
1181
- externalAgentId: string | null;
1182
- relationType: string | null;
1183
1184
  } | undefined>;
1184
- declare const listAgentRelations: (db: DatabaseClient) => (params: {
1185
- scopes: GraphScopeConfig;
1186
- pagination?: PaginationConfig;
1187
- }) => Promise<{
1188
- data: {
1189
- createdAt: string;
1190
- updatedAt: string;
1191
- sourceAgentId: string;
1192
- targetAgentId: string | null;
1193
- externalAgentId: string | null;
1194
- relationType: string | null;
1195
- graphId: string;
1196
- projectId: string;
1197
- tenantId: string;
1198
- id: string;
1199
- }[];
1200
- pagination: {
1201
- page: number;
1202
- limit: number;
1203
- total: number;
1204
- pages: number;
1205
- };
1206
- }>;
1207
- declare const getAgentRelations: (db: DatabaseClient) => (params: {
1208
- scopes: AgentScopeConfig;
1209
- }) => Promise<{
1185
+ declare const getApiKeyByPublicId: (db: DatabaseClient) => (publicId: string) => Promise<{
1210
1186
  tenantId: string;
1211
1187
  projectId: string;
1212
1188
  id: string;
1189
+ name: string | null;
1213
1190
  graphId: string;
1191
+ publicId: string;
1192
+ keyHash: string;
1193
+ keyPrefix: string;
1194
+ lastUsedAt: string | null;
1195
+ expiresAt: string | null;
1214
1196
  createdAt: string;
1215
1197
  updatedAt: string;
1216
- sourceAgentId: string;
1217
- targetAgentId: string | null;
1218
- externalAgentId: string | null;
1219
- relationType: string | null;
1220
- }[]>;
1221
- declare const getAgentRelationsByGraph: (db: DatabaseClient) => (params: {
1222
- scopes: GraphScopeConfig;
1198
+ } | undefined>;
1199
+ declare const listApiKeys: (db: DatabaseClient) => (params: {
1200
+ scopes: ProjectScopeConfig;
1201
+ graphId?: string;
1223
1202
  }) => Promise<{
1224
1203
  tenantId: string;
1225
1204
  projectId: string;
1226
1205
  id: string;
1206
+ name: string | null;
1227
1207
  graphId: string;
1208
+ publicId: string;
1209
+ keyHash: string;
1210
+ keyPrefix: string;
1211
+ lastUsedAt: string | null;
1212
+ expiresAt: string | null;
1228
1213
  createdAt: string;
1229
1214
  updatedAt: string;
1230
- sourceAgentId: string;
1231
- targetAgentId: string | null;
1232
- externalAgentId: string | null;
1233
- relationType: string | null;
1234
1215
  }[]>;
1235
- declare const getAgentRelationsBySource: (db: DatabaseClient) => (params: {
1236
- scopes: GraphScopeConfig;
1237
- sourceAgentId: string;
1238
- pagination?: PaginationConfig;
1239
- }) => Promise<{
1240
- data: {
1241
- createdAt: string;
1242
- updatedAt: string;
1243
- sourceAgentId: string;
1244
- targetAgentId: string | null;
1245
- externalAgentId: string | null;
1246
- relationType: string | null;
1247
- graphId: string;
1248
- projectId: string;
1249
- tenantId: string;
1250
- id: string;
1251
- }[];
1252
- pagination: {
1253
- page: number;
1254
- limit: number;
1255
- total: number;
1256
- pages: number;
1257
- };
1258
- }>;
1259
- declare const getAgentRelationsByTarget: (db: DatabaseClient) => (params: {
1260
- scopes: GraphScopeConfig;
1261
- targetAgentId: string;
1262
- pagination?: PaginationConfig;
1263
- }) => Promise<{
1264
- data: {
1265
- createdAt: string;
1266
- updatedAt: string;
1267
- sourceAgentId: string;
1268
- targetAgentId: string | null;
1269
- externalAgentId: string | null;
1270
- relationType: string | null;
1271
- graphId: string;
1272
- projectId: string;
1273
- tenantId: string;
1274
- id: string;
1275
- }[];
1276
- pagination: {
1277
- page: number;
1278
- limit: number;
1279
- total: number;
1280
- pages: number;
1281
- };
1282
- }>;
1283
- declare const getExternalAgentRelations: (db: DatabaseClient) => (params: {
1284
- scopes: GraphScopeConfig;
1285
- externalAgentId: string;
1216
+ declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
1217
+ scopes: ProjectScopeConfig;
1286
1218
  pagination?: PaginationConfig;
1219
+ graphId?: string;
1287
1220
  }) => Promise<{
1288
- data: {
1289
- createdAt: string;
1290
- updatedAt: string;
1291
- sourceAgentId: string;
1292
- targetAgentId: string | null;
1293
- externalAgentId: string | null;
1294
- relationType: string | null;
1295
- graphId: string;
1296
- projectId: string;
1297
- tenantId: string;
1298
- id: string;
1299
- }[];
1221
+ data: ApiKeySelect[];
1300
1222
  pagination: {
1301
1223
  page: number;
1302
1224
  limit: number;
@@ -1304,157 +1226,268 @@ declare const getExternalAgentRelations: (db: DatabaseClient) => (params: {
1304
1226
  pages: number;
1305
1227
  };
1306
1228
  }>;
1307
- declare const getRelatedAgentsForGraph: (db: DatabaseClient) => (params: {
1308
- scopes: GraphScopeConfig;
1309
- agentId: string;
1310
- }) => Promise<{
1311
- internalRelations: {
1312
- id: string;
1313
- name: string;
1314
- description: string;
1315
- relationType: string | null;
1316
- }[];
1317
- externalRelations: {
1318
- id: string;
1319
- relationType: string | null;
1320
- externalAgent: {
1321
- id: string;
1322
- name: string;
1323
- description: string;
1324
- baseUrl: string;
1325
- };
1326
- }[];
1327
- }>;
1328
- declare const createAgentRelation: (db: DatabaseClient) => (params: AgentRelationInsert) => Promise<{
1229
+ declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Promise<{
1329
1230
  tenantId: string;
1330
1231
  projectId: string;
1331
1232
  id: string;
1233
+ name: string | null;
1332
1234
  graphId: string;
1235
+ publicId: string;
1236
+ keyHash: string;
1237
+ keyPrefix: string;
1238
+ lastUsedAt: string | null;
1239
+ expiresAt: string | null;
1333
1240
  createdAt: string;
1334
1241
  updatedAt: string;
1335
- sourceAgentId: string;
1336
- targetAgentId: string | null;
1337
- externalAgentId: string | null;
1338
- relationType: string | null;
1339
1242
  }>;
1340
- /**
1341
- * Check if agent relation exists by graph, source, target, and relation type
1342
- */
1343
- declare const getAgentRelationByParams: (db: DatabaseClient) => (params: {
1344
- scopes: GraphScopeConfig;
1345
- sourceAgentId: string;
1346
- targetAgentId?: string;
1347
- externalAgentId?: string;
1348
- relationType: string;
1243
+ declare const updateApiKey: (db: DatabaseClient) => (params: {
1244
+ scopes: ProjectScopeConfig;
1245
+ id: string;
1246
+ data: ApiKeyUpdate;
1349
1247
  }) => Promise<{
1350
1248
  tenantId: string;
1351
1249
  projectId: string;
1352
1250
  id: string;
1251
+ name: string | null;
1353
1252
  graphId: string;
1253
+ publicId: string;
1254
+ keyHash: string;
1255
+ keyPrefix: string;
1256
+ lastUsedAt: string | null;
1257
+ expiresAt: string | null;
1354
1258
  createdAt: string;
1355
1259
  updatedAt: string;
1356
- sourceAgentId: string;
1357
- targetAgentId: string | null;
1358
- externalAgentId: string | null;
1359
- relationType: string | null;
1360
- } | 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>;
1361
1274
  /**
1362
- * 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)
1363
1277
  */
1364
- 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<{
1365
1288
  tenantId: string;
1366
1289
  projectId: string;
1367
1290
  id: string;
1368
- graphId: string;
1291
+ name: string;
1292
+ description: string;
1369
1293
  createdAt: string;
1370
1294
  updatedAt: string;
1371
- sourceAgentId: string;
1372
- targetAgentId: string | null;
1373
- externalAgentId: string | null;
1374
- 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
+ };
1375
1320
  }>;
1376
- declare const createExternalAgentRelation: (db: DatabaseClient) => (params: ExternalAgentRelationInsert) => Promise<{
1321
+ declare const createArtifactComponent: (db: DatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
1377
1322
  tenantId: string;
1378
1323
  projectId: string;
1379
1324
  id: string;
1380
- graphId: string;
1325
+ name: string;
1326
+ description: string;
1381
1327
  createdAt: string;
1382
1328
  updatedAt: string;
1383
- sourceAgentId: string;
1384
- targetAgentId: string | null;
1385
- externalAgentId: string | null;
1386
- relationType: string | null;
1329
+ props: Record<string, unknown> | null;
1387
1330
  }>;
1388
- declare const updateAgentRelation: (db: DatabaseClient) => (params: {
1389
- scopes: GraphScopeConfig;
1390
- relationId: string;
1391
- data: AgentRelationUpdate;
1331
+ declare const updateArtifactComponent: (db: DatabaseClient) => (params: {
1332
+ scopes: ProjectScopeConfig;
1333
+ id: string;
1334
+ data: ArtifactComponentUpdate;
1392
1335
  }) => Promise<{
1393
1336
  tenantId: string;
1394
1337
  projectId: string;
1395
1338
  id: string;
1396
- graphId: string;
1339
+ name: string;
1340
+ description: string;
1397
1341
  createdAt: string;
1398
1342
  updatedAt: string;
1399
- sourceAgentId: string;
1400
- targetAgentId: string | null;
1401
- externalAgentId: string | null;
1402
- relationType: string | null;
1343
+ props: Record<string, unknown> | null;
1403
1344
  }>;
1404
- declare const deleteAgentRelation: (db: DatabaseClient) => (params: {
1405
- scopes: GraphScopeConfig;
1406
- relationId: string;
1407
- }) => Promise<boolean>;
1408
- declare const deleteAgentRelationsByGraph: (db: DatabaseClient) => (params: {
1409
- scopes: GraphScopeConfig;
1345
+ declare const deleteArtifactComponent: (db: DatabaseClient) => (params: {
1346
+ scopes: ProjectScopeConfig;
1347
+ id: string;
1410
1348
  }) => Promise<boolean>;
1411
- declare const createAgentToolRelation: (db: DatabaseClient) => (params: {
1412
- scopes: GraphScopeConfig;
1413
- relationId?: string;
1414
- data: {
1415
- agentId: string;
1416
- toolId: string;
1417
- selectedTools?: string[] | null;
1418
- headers?: Record<string, string> | null;
1419
- };
1349
+ declare const getArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
1350
+ scopes: AgentScopeConfig;
1420
1351
  }) => Promise<{
1352
+ id: string;
1421
1353
  tenantId: string;
1422
1354
  projectId: string;
1423
- id: string;
1424
- graphId: string;
1425
- createdAt: string;
1426
- updatedAt: string;
1427
- headers: Record<string, string> | null;
1428
- toolId: string;
1429
- selectedTools: string[] | null;
1430
- agentId: string;
1431
- }>;
1432
- declare const updateAgentToolRelation: (db: DatabaseClient) => (params: {
1433
- scopes: GraphScopeConfig;
1434
- relationId: string;
1435
- 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;
1436
1364
  }) => Promise<{
1437
1365
  tenantId: string;
1438
1366
  projectId: string;
1439
1367
  id: string;
1440
1368
  graphId: string;
1441
1369
  createdAt: string;
1442
- updatedAt: string;
1443
- headers: Record<string, string> | null;
1444
- toolId: string;
1445
- selectedTools: string[] | null;
1446
- agentId: string;
1370
+ subAgentId: string;
1371
+ artifactComponentId: string;
1447
1372
  }>;
1448
- declare const deleteAgentToolRelation: (db: DatabaseClient) => (params: {
1449
- scopes: GraphScopeConfig;
1450
- relationId: string;
1373
+ declare const removeArtifactComponentFromAgent: (db: DatabaseClient) => (params: {
1374
+ scopes: AgentScopeConfig;
1375
+ artifactComponentId: string;
1451
1376
  }) => Promise<boolean>;
1452
- declare const deleteAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
1377
+ declare const deleteAgentArtifactComponentRelationByAgent: (db: DatabaseClient) => (params: {
1453
1378
  scopes: AgentScopeConfig;
1454
1379
  }) => Promise<boolean>;
1455
- 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: {
1456
1389
  scopes: AgentScopeConfig;
1457
- 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;
1458
1491
  }) => Promise<{
1459
1492
  tenantId: string;
1460
1493
  projectId: string;
@@ -1462,51 +1495,26 @@ declare const getAgentToolRelationById: (db: DatabaseClient) => (params: {
1462
1495
  graphId: string;
1463
1496
  createdAt: string;
1464
1497
  updatedAt: string;
1465
- headers: Record<string, string> | null;
1466
- toolId: string;
1467
- selectedTools: string[] | null;
1468
- agentId: string;
1498
+ headersSchema: unknown;
1499
+ contextVariables: Record<string, ContextFetchDefinition> | null;
1469
1500
  } | undefined>;
1470
- declare const getAgentToolRelationByAgent: (db: DatabaseClient) => (params: {
1471
- scopes: AgentScopeConfig;
1472
- pagination?: PaginationConfig;
1501
+ declare const listContextConfigs: (db: DatabaseClient) => (params: {
1502
+ scopes: GraphScopeConfig;
1473
1503
  }) => Promise<{
1474
- data: {
1475
- createdAt: string;
1476
- updatedAt: string;
1477
- toolId: string;
1478
- selectedTools: string[] | null;
1479
- headers: Record<string, string> | null;
1480
- agentId: string;
1481
- graphId: string;
1482
- projectId: string;
1483
- tenantId: string;
1484
- id: string;
1485
- }[];
1486
- pagination: {
1487
- page: number;
1488
- limit: number;
1489
- total: number;
1490
- pages: number;
1491
- };
1492
- }>;
1493
- 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: {
1494
1514
  scopes: GraphScopeConfig;
1495
- toolId: string;
1496
1515
  pagination?: PaginationConfig;
1497
1516
  }) => Promise<{
1498
- data: {
1499
- createdAt: string;
1500
- updatedAt: string;
1501
- toolId: string;
1502
- selectedTools: string[] | null;
1503
- headers: Record<string, string> | null;
1504
- agentId: string;
1505
- graphId: string;
1506
- projectId: string;
1507
- tenantId: string;
1508
- id: string;
1509
- }[];
1517
+ data: any[];
1510
1518
  pagination: {
1511
1519
  page: number;
1512
1520
  limit: number;
@@ -1514,393 +1522,223 @@ declare const getAgentToolRelationByTool: (db: DatabaseClient) => (params: {
1514
1522
  pages: number;
1515
1523
  };
1516
1524
  }>;
1517
- 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: {
1518
1536
  scopes: GraphScopeConfig;
1519
- pagination?: PaginationConfig;
1537
+ id: string;
1538
+ data: Partial<ContextConfigUpdate>;
1520
1539
  }) => Promise<{
1521
- data: {
1522
- createdAt: string;
1523
- updatedAt: string;
1524
- toolId: string;
1525
- selectedTools: string[] | null;
1526
- headers: Record<string, string> | null;
1527
- agentId: string;
1528
- graphId: string;
1529
- projectId: string;
1530
- tenantId: string;
1531
- id: string;
1532
- }[];
1533
- pagination: {
1534
- page: number;
1535
- limit: number;
1536
- total: number;
1537
- pages: number;
1538
- };
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;
1539
1548
  }>;
1540
- declare const getToolsForAgent: (db: DatabaseClient) => (params: {
1541
- scopes: AgentScopeConfig;
1542
- 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;
1543
1565
  }) => Promise<{
1544
- data: {
1545
- id: string;
1546
- tenantId: string;
1547
- agentId: string;
1548
- toolId: string;
1549
- selectedTools: string[] | null;
1550
- headers: Record<string, string> | null;
1551
- createdAt: string;
1552
- updatedAt: string;
1553
- tool: {
1554
- id: string;
1555
- name: string;
1556
- description: string | null;
1557
- config: {
1558
- type: "mcp";
1559
- mcp: ToolMcpConfig;
1560
- } | {
1561
- type: "function";
1562
- function?: {
1563
- inputSchema: Record<string, unknown>;
1564
- executeCode: string;
1565
- dependencies: Record<string, unknown>;
1566
- };
1567
- };
1568
- functionId: string | null;
1569
- createdAt: string;
1570
- updatedAt: string;
1571
- capabilities: ToolServerCapabilities | null;
1572
- lastError: string | null;
1573
- credentialReferenceId: string | null;
1574
- tenantId: string;
1575
- projectId: string;
1576
- headers: Record<string, string> | null;
1577
- imageUrl: string | null;
1578
- };
1579
- }[];
1580
- pagination: {
1581
- page: number;
1582
- limit: number;
1583
- total: number;
1584
- pages: number;
1585
- };
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;
1586
1574
  }>;
1587
- declare const getAgentsForTool: (db: DatabaseClient) => (params: {
1588
- scopes: GraphScopeConfig;
1589
- toolId: string;
1575
+
1576
+ declare const listConversations: (db: DatabaseClient) => (params: {
1577
+ scopes: ProjectScopeConfig;
1578
+ userId?: string;
1590
1579
  pagination?: PaginationConfig;
1591
1580
  }) => Promise<{
1592
- data: {
1593
- id: string;
1594
- tenantId: string;
1595
- agentId: string;
1596
- toolId: string;
1597
- selectedTools: string[] | null;
1598
- headers: Record<string, string> | null;
1599
- createdAt: string;
1600
- updatedAt: string;
1601
- agent: {
1602
- id: string;
1603
- name: string;
1604
- description: string;
1605
- prompt: string;
1606
- conversationHistoryConfig: ConversationHistoryConfig | null;
1607
- models: {
1608
- base?: {
1609
- model?: string | undefined;
1610
- providerOptions?: Record<string, any> | undefined;
1611
- } | undefined;
1612
- structuredOutput?: {
1613
- model?: string | undefined;
1614
- providerOptions?: Record<string, any> | undefined;
1615
- } | undefined;
1616
- summarizer?: {
1617
- model?: string | undefined;
1618
- providerOptions?: Record<string, any> | undefined;
1619
- } | undefined;
1620
- } | null;
1621
- stopWhen: {
1622
- stepCountIs?: number | undefined;
1623
- } | null;
1624
- createdAt: string;
1625
- updatedAt: string;
1626
- };
1627
- }[];
1628
- pagination: {
1629
- page: number;
1630
- limit: number;
1631
- total: number;
1632
- pages: number;
1633
- };
1581
+ conversations: ConversationSelect[];
1582
+ total: number;
1634
1583
  }>;
1635
- declare const validateInternalAgent: (db: DatabaseClient) => (params: {
1636
- scopes: AgentScopeConfig;
1637
- }) => Promise<boolean>;
1638
- declare const validateExternalAgent: (db: DatabaseClient) => (params: {
1639
- scopes: AgentScopeConfig;
1640
- }) => Promise<boolean>;
1641
-
1642
- declare const getAgentById: (db: DatabaseClient) => (params: {
1643
- scopes: GraphScopeConfig;
1644
- agentId: string;
1645
- }) => Promise<{
1584
+ declare const createConversation: (db: DatabaseClient) => (params: ConversationInsert) => Promise<{
1646
1585
  tenantId: string;
1647
1586
  projectId: string;
1648
1587
  id: string;
1649
- name: string;
1650
- description: string;
1651
- prompt: string;
1652
- graphId: string;
1653
1588
  createdAt: string;
1654
1589
  updatedAt: string;
1655
- models: {
1656
- base?: {
1657
- model?: string | undefined;
1658
- providerOptions?: Record<string, any> | undefined;
1659
- } | undefined;
1660
- structuredOutput?: {
1661
- model?: string | undefined;
1662
- providerOptions?: Record<string, any> | undefined;
1663
- } | undefined;
1664
- summarizer?: {
1665
- model?: string | undefined;
1666
- providerOptions?: Record<string, any> | undefined;
1667
- } | undefined;
1668
- } | null;
1669
- stopWhen: {
1670
- stepCountIs?: number | undefined;
1671
- } | null;
1672
- conversationHistoryConfig: ConversationHistoryConfig | null;
1673
- } | undefined>;
1674
- declare const listAgents: (db: DatabaseClient) => (params: {
1675
- 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;
1676
1600
  }) => Promise<{
1677
1601
  tenantId: string;
1678
1602
  projectId: string;
1679
1603
  id: string;
1680
- name: string;
1681
- description: string;
1682
- prompt: string;
1683
- graphId: string;
1684
1604
  createdAt: string;
1685
1605
  updatedAt: string;
1686
- models: {
1687
- base?: {
1688
- model?: string | undefined;
1689
- providerOptions?: Record<string, any> | undefined;
1690
- } | undefined;
1691
- structuredOutput?: {
1692
- model?: string | undefined;
1693
- providerOptions?: Record<string, any> | undefined;
1694
- } | undefined;
1695
- summarizer?: {
1696
- model?: string | undefined;
1697
- providerOptions?: Record<string, any> | undefined;
1698
- } | undefined;
1699
- } | null;
1700
- stopWhen: {
1701
- stepCountIs?: number | undefined;
1702
- } | null;
1703
- conversationHistoryConfig: ConversationHistoryConfig | null;
1704
- }[]>;
1705
- declare const listAgentsPaginated: (db: DatabaseClient) => (params: {
1706
- scopes: GraphScopeConfig;
1707
- pagination?: PaginationConfig;
1708
- }) => Promise<{
1709
- data: {
1710
- createdAt: string;
1711
- updatedAt: string;
1712
- prompt: string;
1713
- conversationHistoryConfig: ConversationHistoryConfig | null;
1714
- models: {
1715
- base?: {
1716
- model?: string | undefined;
1717
- providerOptions?: Record<string, any> | undefined;
1718
- } | undefined;
1719
- structuredOutput?: {
1720
- model?: string | undefined;
1721
- providerOptions?: Record<string, any> | undefined;
1722
- } | undefined;
1723
- summarizer?: {
1724
- model?: string | undefined;
1725
- providerOptions?: Record<string, any> | undefined;
1726
- } | undefined;
1727
- } | null;
1728
- stopWhen: {
1729
- stepCountIs?: number | undefined;
1730
- } | null;
1731
- name: string;
1732
- description: string;
1733
- graphId: string;
1734
- projectId: string;
1735
- tenantId: string;
1736
- id: string;
1737
- }[];
1738
- pagination: {
1739
- page: number;
1740
- limit: number;
1741
- total: number;
1742
- pages: number;
1743
- };
1606
+ title: string | null;
1607
+ metadata: ConversationMetadata | null;
1608
+ userId: string | null;
1609
+ activeSubAgentId: string;
1610
+ lastContextResolution: string | null;
1744
1611
  }>;
1745
- 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<{
1746
1621
  tenantId: string;
1747
1622
  projectId: string;
1748
1623
  id: string;
1749
- name: string;
1750
- description: string;
1751
- prompt: string;
1752
- graphId: string;
1753
1624
  createdAt: string;
1754
1625
  updatedAt: string;
1755
- models: {
1756
- base?: {
1757
- model?: string | undefined;
1758
- providerOptions?: Record<string, any> | undefined;
1759
- } | undefined;
1760
- structuredOutput?: {
1761
- model?: string | undefined;
1762
- providerOptions?: Record<string, any> | undefined;
1763
- } | undefined;
1764
- summarizer?: {
1765
- model?: string | undefined;
1766
- providerOptions?: Record<string, any> | undefined;
1767
- } | undefined;
1768
- } | null;
1769
- stopWhen: {
1770
- stepCountIs?: number | undefined;
1771
- } | null;
1772
- conversationHistoryConfig: ConversationHistoryConfig | null;
1626
+ title: string | null;
1627
+ metadata: ConversationMetadata | null;
1628
+ userId: string | null;
1629
+ activeSubAgentId: string;
1630
+ lastContextResolution: string | null;
1773
1631
  }>;
1774
- declare const updateAgent: (db: DatabaseClient) => (params: {
1775
- scopes: GraphScopeConfig;
1776
- agentId: string;
1777
- data: AgentUpdate;
1632
+ declare const getConversation: (db: DatabaseClient) => (params: {
1633
+ scopes: ProjectScopeConfig;
1634
+ conversationId: string;
1778
1635
  }) => Promise<{
1779
1636
  tenantId: string;
1780
1637
  projectId: string;
1781
1638
  id: string;
1782
- name: string;
1783
- description: string;
1784
- prompt: string;
1785
- graphId: string;
1786
1639
  createdAt: string;
1787
1640
  updatedAt: string;
1788
- models: {
1789
- base?: {
1790
- model?: string | undefined;
1791
- providerOptions?: Record<string, any> | undefined;
1792
- } | undefined;
1793
- structuredOutput?: {
1794
- model?: string | undefined;
1795
- providerOptions?: Record<string, any> | undefined;
1796
- } | undefined;
1797
- summarizer?: {
1798
- model?: string | undefined;
1799
- providerOptions?: Record<string, any> | undefined;
1800
- } | undefined;
1801
- } | null;
1802
- stopWhen: {
1803
- stepCountIs?: number | undefined;
1804
- } | null;
1805
- conversationHistoryConfig: ConversationHistoryConfig | null;
1806
- }>;
1807
- /**
1808
- * Upsert agent (create if it doesn't exist, update if it does)
1809
- */
1810
- declare const upsertAgent: (db: DatabaseClient) => (params: {
1811
- data: AgentInsert;
1812
- }) => Promise<AgentSelect>;
1813
- declare const deleteAgent: (db: DatabaseClient) => (params: {
1814
- scopes: GraphScopeConfig;
1815
- agentId: string;
1816
- }) => Promise<boolean>;
1817
- declare const getAgentsByIds: (db: DatabaseClient) => (params: {
1818
- scopes: GraphScopeConfig;
1819
- agentIds: string[];
1820
- }) => Promise<{
1821
- createdAt: string;
1822
- updatedAt: string;
1823
- prompt: string;
1824
- conversationHistoryConfig: ConversationHistoryConfig | null;
1825
- models: {
1826
- base?: {
1827
- model?: string | undefined;
1828
- providerOptions?: Record<string, any> | undefined;
1829
- } | undefined;
1830
- structuredOutput?: {
1831
- model?: string | undefined;
1832
- providerOptions?: Record<string, any> | undefined;
1833
- } | undefined;
1834
- summarizer?: {
1835
- model?: string | undefined;
1836
- providerOptions?: Record<string, any> | undefined;
1837
- } | undefined;
1838
- } | null;
1839
- stopWhen: {
1840
- stepCountIs?: number | undefined;
1841
- } | null;
1842
- name: string;
1843
- description: string;
1844
- 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;
1845
1649
  projectId: string;
1846
1650
  tenantId: string;
1847
1651
  id: string;
1848
- }[]>;
1849
-
1850
- declare const getApiKeyById: (db: DatabaseClient) => (params: {
1851
- scopes: ProjectScopeConfig;
1852
- id: string;
1853
- }) => 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
+ } | {
1854
1660
  tenantId: string;
1855
1661
  projectId: string;
1856
1662
  id: string;
1857
- name: string | null;
1858
- graphId: string;
1859
- publicId: string;
1860
- keyHash: string;
1861
- keyPrefix: string;
1862
- lastUsedAt: string | null;
1863
- expiresAt: string | null;
1864
1663
  createdAt: string;
1865
1664
  updatedAt: string;
1866
- } | undefined>;
1867
- 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<{
1868
1686
  tenantId: string;
1869
1687
  projectId: string;
1870
1688
  id: string;
1871
- name: string | null;
1872
- graphId: string;
1873
- publicId: string;
1874
- keyHash: string;
1875
- keyPrefix: string;
1876
- lastUsedAt: string | null;
1877
- expiresAt: string | null;
1878
1689
  createdAt: string;
1879
1690
  updatedAt: string;
1691
+ title: string | null;
1692
+ metadata: ConversationMetadata | null;
1693
+ userId: string | null;
1694
+ activeSubAgentId: string;
1695
+ lastContextResolution: string | null;
1880
1696
  } | undefined>;
1881
- 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: {
1882
1718
  scopes: ProjectScopeConfig;
1883
- graphId?: string;
1884
- }) => Promise<{
1885
- tenantId: string;
1886
- projectId: string;
1887
1719
  id: string;
1888
- name: string | null;
1889
- graphId: string;
1890
- publicId: string;
1891
- keyHash: string;
1892
- keyPrefix: string;
1893
- lastUsedAt: string | null;
1894
- expiresAt: string | null;
1895
- createdAt: string;
1896
- updatedAt: string;
1897
- }[]>;
1898
- 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: {
1899
1738
  scopes: ProjectScopeConfig;
1900
1739
  pagination?: PaginationConfig;
1901
- graphId?: string;
1902
1740
  }) => Promise<{
1903
- data: ApiKeySelect[];
1741
+ data: CredentialReferenceSelect[];
1904
1742
  pagination: {
1905
1743
  page: number;
1906
1744
  limit: number;
@@ -1908,91 +1746,73 @@ declare const listApiKeysPaginated: (db: DatabaseClient) => (params: {
1908
1746
  pages: number;
1909
1747
  };
1910
1748
  }>;
1911
- declare const createApiKey: (db: DatabaseClient) => (params: ApiKeyInsert) => Promise<{
1912
- tenantId: string;
1913
- projectId: string;
1914
- id: string;
1915
- name: string | null;
1916
- graphId: string;
1917
- publicId: string;
1918
- keyHash: string;
1919
- keyPrefix: string;
1920
- lastUsedAt: string | null;
1921
- expiresAt: string | null;
1922
- createdAt: string;
1923
- updatedAt: string;
1924
- }>;
1925
- 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: {
1926
1757
  scopes: ProjectScopeConfig;
1927
1758
  id: string;
1928
- data: ApiKeyUpdate;
1929
- }) => Promise<{
1930
- tenantId: string;
1931
- projectId: string;
1932
- id: string;
1933
- name: string | null;
1934
- graphId: string;
1935
- publicId: string;
1936
- keyHash: string;
1937
- keyPrefix: string;
1938
- lastUsedAt: string | null;
1939
- expiresAt: string | null;
1940
- createdAt: string;
1941
- updatedAt: string;
1942
- }>;
1943
- 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: {
1944
1765
  scopes: ProjectScopeConfig;
1945
1766
  id: string;
1946
1767
  }) => Promise<boolean>;
1947
- declare const hasApiKey: (db: DatabaseClient) => (params: {
1768
+ /**
1769
+ * Check if a credential reference exists
1770
+ */
1771
+ declare const hasCredentialReference: (db: DatabaseClient) => (params: {
1948
1772
  scopes: ProjectScopeConfig;
1949
1773
  id: string;
1950
1774
  }) => Promise<boolean>;
1951
- declare const updateApiKeyLastUsed: (db: DatabaseClient) => (id: string) => Promise<void>;
1952
- 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: {
1953
1779
  scopes: ProjectScopeConfig;
1954
- graphId?: string;
1955
- }) => Promise<number>;
1780
+ id: string;
1781
+ }) => Promise<CredentialReferenceSelect | null>;
1956
1782
  /**
1957
- * Create a new API key
1958
- * 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
1959
1784
  */
1960
- declare const generateAndCreateApiKey: (params: CreateApiKeyParams, db: DatabaseClient) => Promise<ApiKeyCreateResult>;
1785
+ declare const countCredentialReferences: (db: DatabaseClient) => (params: {
1786
+ scopes: ProjectScopeConfig;
1787
+ }) => Promise<number>;
1961
1788
  /**
1962
- * 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)
1963
1790
  */
1964
- declare const validateAndGetApiKey: (key: string, db: DatabaseClient) => Promise<ApiKeySelect | null>;
1791
+ declare const upsertCredentialReference: (db: DatabaseClient) => (params: {
1792
+ data: CredentialReferenceInsert;
1793
+ }) => Promise<CredentialReferenceSelect>;
1965
1794
 
1966
- declare const getArtifactComponentById: (db: DatabaseClient) => (params: {
1795
+ /**
1796
+ * Get a data component by ID
1797
+ */
1798
+ declare const getDataComponent: (db: DatabaseClient) => (params: {
1967
1799
  scopes: ProjectScopeConfig;
1968
- id: string;
1969
- }) => Promise<{
1970
- tenantId: string;
1971
- projectId: string;
1972
- id: string;
1973
- name: string;
1974
- description: string;
1975
- createdAt: string;
1976
- updatedAt: string;
1977
- props: Record<string, unknown> | null;
1978
- } | undefined>;
1979
- 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: {
1980
1806
  scopes: ProjectScopeConfig;
1981
- }) => Promise<{
1982
- createdAt: string;
1983
- updatedAt: string;
1984
- props: Record<string, unknown> | null;
1985
- name: string;
1986
- description: string;
1987
- projectId: string;
1988
- tenantId: string;
1989
- id: string;
1990
- }[]>;
1991
- declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params: {
1807
+ }) => Promise<DataComponentSelect[]>;
1808
+ /**
1809
+ * List data components with pagination
1810
+ */
1811
+ declare const listDataComponentsPaginated: (db: DatabaseClient) => (params: {
1992
1812
  scopes: ProjectScopeConfig;
1993
1813
  pagination?: PaginationConfig;
1994
1814
  }) => Promise<{
1995
- data: ArtifactComponentSelect[];
1815
+ data: DataComponentSelect[];
1996
1816
  pagination: {
1997
1817
  page: number;
1998
1818
  limit: number;
@@ -2000,203 +1820,245 @@ declare const listArtifactComponentsPaginated: (db: DatabaseClient) => (params:
2000
1820
  pages: number;
2001
1821
  };
2002
1822
  }>;
2003
- declare const createArtifactComponent: (db: DatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
2004
- tenantId: string;
2005
- projectId: string;
2006
- id: string;
2007
- name: string;
2008
- description: string;
2009
- createdAt: string;
2010
- updatedAt: string;
2011
- props: Record<string, unknown> | null;
2012
- }>;
2013
- 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: {
2014
1831
  scopes: ProjectScopeConfig;
2015
- id: string;
2016
- data: ArtifactComponentUpdate;
2017
- }) => Promise<{
2018
- tenantId: string;
2019
- projectId: string;
2020
- id: string;
2021
- name: string;
2022
- description: string;
2023
- createdAt: string;
2024
- updatedAt: string;
2025
- props: Record<string, unknown> | null;
2026
- }>;
2027
- 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: {
2028
1839
  scopes: ProjectScopeConfig;
2029
- id: string;
1840
+ dataComponentId: string;
2030
1841
  }) => Promise<boolean>;
2031
- declare const getArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
1842
+ /**
1843
+ * Get data components for a specific agent
1844
+ */
1845
+ declare const getDataComponentsForAgent: (db: DatabaseClient) => (params: {
2032
1846
  scopes: AgentScopeConfig;
2033
- }) => Promise<{
2034
- id: string;
2035
- tenantId: string;
2036
- projectId: string;
2037
- name: string;
2038
- description: string;
2039
- props: Record<string, unknown> | null;
2040
- createdAt: string;
2041
- updatedAt: string;
2042
- }[]>;
2043
- 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: {
2044
1852
  scopes: AgentScopeConfig;
2045
- artifactComponentId: string;
1853
+ dataComponentId: string;
2046
1854
  }) => Promise<{
2047
1855
  tenantId: string;
2048
1856
  projectId: string;
2049
1857
  id: string;
2050
1858
  graphId: string;
2051
1859
  createdAt: string;
2052
- agentId: string;
2053
- artifactComponentId: string;
1860
+ subAgentId: string;
1861
+ dataComponentId: string;
2054
1862
  }>;
2055
- declare const removeArtifactComponentFromAgent: (db: DatabaseClient) => (params: {
1863
+ /**
1864
+ * Remove association between data component and agent
1865
+ */
1866
+ declare const removeDataComponentFromAgent: (db: DatabaseClient) => (params: {
2056
1867
  scopes: AgentScopeConfig;
2057
- artifactComponentId: string;
1868
+ dataComponentId: string;
2058
1869
  }) => Promise<boolean>;
2059
- declare const deleteAgentArtifactComponentRelationByAgent: (db: DatabaseClient) => (params: {
1870
+ declare const deleteAgentDataComponentRelationByAgent: (db: DatabaseClient) => (params: {
2060
1871
  scopes: AgentScopeConfig;
2061
1872
  }) => Promise<boolean>;
2062
- 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: {
2063
1877
  scopes: ProjectScopeConfig;
2064
- artifactComponentId: string;
1878
+ dataComponentId: string;
2065
1879
  }) => Promise<{
2066
- graphId: string;
2067
- agentId: string;
1880
+ subAgentId: string;
2068
1881
  createdAt: string;
2069
1882
  }[]>;
2070
- 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: {
2071
1887
  scopes: AgentScopeConfig;
2072
- artifactComponentId: string;
2073
- }) => Promise<boolean>;
2074
- declare const graphHasArtifactComponents: (db: DatabaseClient) => (params: {
2075
- scopes: GraphScopeConfig;
1888
+ dataComponentId: string;
2076
1889
  }) => Promise<boolean>;
2077
- declare const countArtifactComponents: (db: DatabaseClient) => (params: {
2078
- scopes: ProjectScopeConfig;
2079
- }) => Promise<number>;
2080
- declare const countArtifactComponentsForAgent: (db: DatabaseClient) => (params: {
2081
- scopes: AgentScopeConfig;
2082
- }) => Promise<number>;
2083
1890
  /**
2084
- * 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)
2085
1892
  */
2086
- declare const upsertAgentArtifactComponentRelation: (db: DatabaseClient) => (params: {
1893
+ declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params: {
2087
1894
  scopes: AgentScopeConfig;
2088
- artifactComponentId: string;
1895
+ dataComponentId: string;
2089
1896
  }) => Promise<{
2090
1897
  tenantId: string;
2091
1898
  projectId: string;
2092
1899
  id: string;
2093
1900
  graphId: string;
2094
1901
  createdAt: string;
2095
- agentId: string;
2096
- artifactComponentId: string;
1902
+ subAgentId: string;
1903
+ dataComponentId: string;
2097
1904
  } | null>;
2098
1905
  /**
2099
- * Upsert an artifact component (create if it doesn't exist, update if it does)
1906
+ * Count data components for a tenant/project
2100
1907
  */
2101
- declare const upsertArtifactComponent: (db: DatabaseClient) => (params: {
2102
- data: ArtifactComponentInsert;
2103
- }) => 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>;
2104
1917
 
2105
1918
  /**
2106
- * Get cached context data for a conversation with optional request hash validation
1919
+ * Create a new external agent
2107
1920
  */
2108
- declare const getCacheEntry: (db: DatabaseClient) => (params: {
2109
- conversationId: string;
2110
- contextConfigId: string;
2111
- contextVariableKey: string;
2112
- requestHash?: string;
2113
- }) => Promise<ContextCacheSelect | null>;
1921
+ declare const createExternalAgent: (db: DatabaseClient) => (params: ExternalAgentInsert) => Promise<ExternalAgentSelect>;
2114
1922
  /**
2115
- * Set cached context data for a conversation
1923
+ * Get external agent by ID
2116
1924
  */
2117
- 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>;
2118
1929
  /**
2119
- * Clear cache entries for a specific conversation
1930
+ * Get external agent by base URL
2120
1931
  */
2121
- declare const clearConversationCache: (db: DatabaseClient) => (params: {
2122
- scopes: ProjectScopeConfig;
2123
- conversationId: string;
2124
- }) => Promise<number>;
1932
+ declare const getExternalAgentByUrl: (db: DatabaseClient) => (params: {
1933
+ scopes: GraphScopeConfig;
1934
+ baseUrl: string;
1935
+ }) => Promise<ExternalAgentSelect | null>;
2125
1936
  /**
2126
- * Clear all cache entries for a specific context configuration
1937
+ * List external agents for a tenant
2127
1938
  */
2128
- declare const clearContextConfigCache: (db: DatabaseClient) => (params: {
2129
- scopes: ProjectScopeConfig;
2130
- contextConfigId: string;
2131
- }) => Promise<number>;
1939
+ declare const listExternalAgents: (db: DatabaseClient) => (params: {
1940
+ scopes: GraphScopeConfig;
1941
+ }) => Promise<ExternalAgentSelect[]>;
2132
1942
  /**
2133
- * Clean up all cache entries for a tenant
1943
+ * List external agents with pagination
2134
1944
  */
2135
- declare const cleanupTenantCache: (db: DatabaseClient) => (params: {
2136
- 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;
2137
1997
  }) => Promise<number>;
1998
+
2138
1999
  /**
2139
- * Invalidate the headers cache for a conversation
2000
+ * Create or update a function (project-scoped)
2140
2001
  */
2141
- declare const invalidateHeadersCache: (db: DatabaseClient) => (params: {
2002
+ declare const upsertFunction: (db: DatabaseClient) => (params: {
2003
+ data: FunctionApiInsert;
2142
2004
  scopes: ProjectScopeConfig;
2143
- conversationId: string;
2144
- contextConfigId: string;
2145
- }) => Promise<number>;
2005
+ }) => Promise<void>;
2146
2006
  /**
2147
- * Invalidate specific cache entries for invocation-trigger definitions
2007
+ * Get a function by ID (project-scoped)
2148
2008
  */
2149
- declare const invalidateInvocationDefinitionsCache: (db: DatabaseClient) => (params: {
2009
+ declare const getFunction: (db: DatabaseClient) => (params: {
2010
+ functionId: string;
2150
2011
  scopes: ProjectScopeConfig;
2151
- conversationId: string;
2152
- contextConfigId: string;
2153
- invocationDefinitionIds: string[];
2154
- }) => Promise<number>;
2012
+ }) => Promise<FunctionApiInsert | null>;
2155
2013
  /**
2156
- * Get all cache entries for a conversation
2014
+ * List all functions for a project
2157
2015
  */
2158
- declare const getConversationCacheEntries: (db: DatabaseClient) => (params: {
2016
+ declare const listFunctions: (db: DatabaseClient) => (params: {
2159
2017
  scopes: ProjectScopeConfig;
2160
- conversationId: string;
2161
- }) => Promise<ContextCacheSelect[]>;
2018
+ }) => Promise<FunctionApiInsert[]>;
2162
2019
  /**
2163
- * Get all cache entries for a context configuration
2020
+ * Delete a function (project-scoped)
2164
2021
  */
2165
- declare const getContextConfigCacheEntries: (db: DatabaseClient) => (params: {
2022
+ declare const deleteFunction: (db: DatabaseClient) => (params: {
2023
+ functionId: string;
2166
2024
  scopes: ProjectScopeConfig;
2167
- contextConfigId: string;
2168
- }) => Promise<ContextCacheSelect[]>;
2025
+ }) => Promise<void>;
2169
2026
 
2170
- declare const getContextConfigById: (db: DatabaseClient) => (params: {
2027
+ /**
2028
+ * Get a function tool by ID (graph-scoped)
2029
+ */
2030
+ declare const getFunctionToolById: (db: DatabaseClient) => (params: {
2171
2031
  scopes: GraphScopeConfig;
2172
- id: string;
2032
+ functionToolId: string;
2173
2033
  }) => Promise<{
2174
- tenantId: string;
2175
- projectId: string;
2176
- id: string;
2177
- graphId: string;
2178
2034
  createdAt: string;
2179
2035
  updatedAt: string;
2180
- headersSchema: unknown;
2181
- contextVariables: Record<string, ContextFetchDefinition> | null;
2182
- } | undefined>;
2183
- declare const listContextConfigs: (db: DatabaseClient) => (params: {
2184
- scopes: GraphScopeConfig;
2185
- }) => Promise<{
2186
- tenantId: string;
2036
+ name: string;
2037
+ description: string | null;
2038
+ functionId: string;
2039
+ graphId: string;
2187
2040
  projectId: string;
2041
+ tenantId: string;
2188
2042
  id: string;
2189
- graphId: string;
2190
- createdAt: string;
2191
- updatedAt: string;
2192
- headersSchema: unknown;
2193
- contextVariables: Record<string, ContextFetchDefinition> | null;
2194
- }[]>;
2195
- declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
2043
+ }>;
2044
+ /**
2045
+ * List function tools (graph-scoped)
2046
+ */
2047
+ declare const listFunctionTools: (db: DatabaseClient) => (params: {
2196
2048
  scopes: GraphScopeConfig;
2197
2049
  pagination?: PaginationConfig;
2198
2050
  }) => Promise<{
2199
- 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
+ }[];
2200
2062
  pagination: {
2201
2063
  page: number;
2202
2064
  limit: number;
@@ -2204,419 +2066,539 @@ declare const listContextConfigsPaginated: (db: DatabaseClient) => (params: {
2204
2066
  pages: number;
2205
2067
  };
2206
2068
  }>;
2207
- 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<{
2208
2076
  tenantId: string;
2209
2077
  projectId: string;
2210
2078
  id: string;
2079
+ name: string;
2080
+ description: string | null;
2211
2081
  graphId: string;
2212
2082
  createdAt: string;
2213
2083
  updatedAt: string;
2214
- headersSchema: unknown;
2215
- contextVariables: Record<string, ContextFetchDefinition> | null;
2084
+ functionId: string;
2216
2085
  }>;
2217
- declare const updateContextConfig: (db: DatabaseClient) => (params: {
2086
+ /**
2087
+ * Update a function tool (graph-scoped)
2088
+ */
2089
+ declare const updateFunctionTool: (db: DatabaseClient) => (params: {
2218
2090
  scopes: GraphScopeConfig;
2219
- id: string;
2220
- data: Partial<ContextConfigUpdate>;
2091
+ functionToolId: string;
2092
+ data: FunctionToolApiUpdate;
2221
2093
  }) => Promise<{
2222
2094
  tenantId: string;
2223
2095
  projectId: string;
2224
2096
  id: string;
2097
+ name: string;
2098
+ description: string | null;
2225
2099
  graphId: string;
2226
2100
  createdAt: string;
2227
2101
  updatedAt: string;
2228
- headersSchema: unknown;
2229
- contextVariables: Record<string, ContextFetchDefinition> | null;
2102
+ functionId: string;
2230
2103
  }>;
2231
- declare const deleteContextConfig: (db: DatabaseClient) => (params: {
2232
- scopes: GraphScopeConfig;
2233
- id: string;
2234
- }) => Promise<boolean>;
2235
- declare const hasContextConfig: (db: DatabaseClient) => (params: {
2104
+ /**
2105
+ * Delete a function tool (graph-scoped)
2106
+ */
2107
+ declare const deleteFunctionTool: (db: DatabaseClient) => (params: {
2236
2108
  scopes: GraphScopeConfig;
2237
- id: string;
2109
+ functionToolId: string;
2238
2110
  }) => Promise<boolean>;
2239
- declare const countContextConfigs: (db: DatabaseClient) => (params: {
2240
- scopes: GraphScopeConfig;
2241
- }) => Promise<number>;
2242
2111
  /**
2243
- * 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)
2244
2113
  */
2245
- declare const upsertContextConfig: (db: DatabaseClient) => (params: {
2246
- data: ContextConfigInsert;
2114
+ declare const upsertFunctionTool: (db: DatabaseClient) => (params: {
2115
+ data: FunctionToolApiInsert;
2116
+ scopes: GraphScopeConfig;
2247
2117
  }) => Promise<{
2248
2118
  tenantId: string;
2249
2119
  projectId: string;
2250
2120
  id: string;
2121
+ name: string;
2122
+ description: string | null;
2251
2123
  graphId: string;
2252
2124
  createdAt: string;
2253
2125
  updatedAt: string;
2254
- headersSchema: unknown;
2255
- contextVariables: Record<string, ContextFetchDefinition> | null;
2126
+ functionId: string;
2256
2127
  }>;
2257
-
2258
- declare const listConversations: (db: DatabaseClient) => (params: {
2259
- scopes: ProjectScopeConfig;
2260
- userId?: string;
2261
- pagination?: PaginationConfig;
2128
+ declare const getFunctionToolsForSubAgent: (db: DatabaseClient) => (params: {
2129
+ scopes: {
2130
+ tenantId: string;
2131
+ projectId: string;
2132
+ graphId: string;
2133
+ };
2134
+ subAgentId: string;
2262
2135
  }) => Promise<{
2263
- conversations: ConversationSelect[];
2264
- total: number;
2265
- }>;
2266
- declare const createConversation: (db: DatabaseClient) => (params: ConversationInsert) => Promise<{
2267
- tenantId: string;
2268
- projectId: string;
2269
- id: string;
2270
- createdAt: string;
2271
- updatedAt: string;
2272
- title: string | null;
2273
- metadata: ConversationMetadata | null;
2274
- userId: string | null;
2275
- activeAgentId: string;
2276
- 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
+ };
2277
2153
  }>;
2278
- declare const updateConversation: (db: DatabaseClient) => (params: {
2279
- scopes: ProjectScopeConfig;
2280
- conversationId: string;
2281
- 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;
2282
2162
  }) => Promise<{
2283
- tenantId: string;
2284
- projectId: string;
2285
2163
  id: string;
2286
- createdAt: string;
2287
- updatedAt: string;
2288
- title: string | null;
2289
- metadata: ConversationMetadata | null;
2290
- userId: string | null;
2291
- activeAgentId: string;
2292
- lastContextResolution: string | null;
2293
2164
  }>;
2294
- declare const deleteConversation: (db: DatabaseClient) => (params: {
2295
- scopes: ProjectScopeConfig;
2296
- conversationId: string;
2297
- }) => Promise<boolean>;
2298
- declare const updateConversationActiveAgent: (db: DatabaseClient) => (params: {
2299
- scopes: ProjectScopeConfig;
2300
- conversationId: string;
2301
- 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;
2302
2172
  }) => Promise<{
2303
- tenantId: string;
2304
- projectId: string;
2305
2173
  id: string;
2306
- createdAt: string;
2307
- updatedAt: string;
2308
- title: string | null;
2309
- metadata: ConversationMetadata | null;
2310
- userId: string | null;
2311
- activeAgentId: string;
2312
- lastContextResolution: string | null;
2313
2174
  }>;
2314
- declare const getConversation: (db: DatabaseClient) => (params: {
2315
- scopes: ProjectScopeConfig;
2316
- 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
+ };
2317
2185
  }) => Promise<{
2318
- tenantId: string;
2319
- projectId: string;
2320
- id: string;
2321
- createdAt: string;
2322
- updatedAt: string;
2323
- title: string | null;
2324
- metadata: ConversationMetadata | null;
2325
- userId: string | null;
2326
- activeAgentId: string;
2327
- lastContextResolution: string | null;
2328
- } | undefined>;
2329
- declare const createOrGetConversation: (db: DatabaseClient) => (input: ConversationInsert) => Promise<{
2330
2186
  id: string;
2331
- tenantId: string;
2332
- projectId: string;
2333
- userId: string | null | undefined;
2334
- activeAgentId: string;
2335
- title: string | null | undefined;
2336
- lastContextResolution: string | null | undefined;
2337
- metadata: ConversationMetadata | null | undefined;
2338
- createdAt: string;
2339
- updatedAt: string;
2340
2187
  }>;
2188
+
2189
+ interface GraphLogger {
2190
+ info(obj: Record<string, any>, msg?: string): void;
2191
+ error(obj: Record<string, any>, msg?: string): void;
2192
+ }
2341
2193
  /**
2342
- * 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.
2343
2196
  */
2344
- declare const getConversationHistory: (db: DatabaseClient) => (params: {
2345
- scopes: ProjectScopeConfig;
2346
- conversationId: string;
2347
- options?: ConversationHistoryConfig;
2348
- }) => Promise<any[]>;
2197
+ declare const createFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2349
2198
  /**
2350
- * 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.
2351
2201
  */
2352
- 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: {
2353
2220
  scopes: ProjectScopeConfig;
2354
- conversationId: string;
2221
+ contextId: string;
2222
+ taskId: string;
2223
+ toolCallId?: string | null;
2224
+ artifact: Artifact;
2355
2225
  }) => Promise<{
2356
- tenantId: string;
2357
- projectId: string;
2358
- id: string;
2359
- createdAt: string;
2360
- updatedAt: string;
2361
- title: string | null;
2362
- metadata: ConversationMetadata | null;
2363
- userId: string | null;
2364
- activeAgentId: string;
2365
- lastContextResolution: string | null;
2366
- } | undefined>;
2226
+ created: boolean;
2227
+ existing?: any;
2228
+ }>;
2367
2229
  /**
2368
- * Set active agent for a conversation (upsert operation)
2230
+ * Save one or more artifacts to the ledger
2369
2231
  */
2370
- declare const setActiveAgentForConversation: (db: DatabaseClient) => (params: {
2371
- scopes: ProjectScopeConfig;
2372
- conversationId: string;
2373
- agentId: string;
2374
- }) => Promise<void>;
2375
- declare const setActiveAgentForThread: (db: DatabaseClient) => ({ scopes, threadId, agentId, }: {
2232
+ declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
2376
2233
  scopes: ProjectScopeConfig;
2377
- threadId: string;
2378
- agentId: string;
2234
+ contextId: string;
2235
+ taskId?: string | null;
2236
+ toolCallId?: string | null;
2237
+ artifacts: Artifact[];
2379
2238
  }) => Promise<void>;
2380
-
2381
- type CredentialReferenceWithTools = CredentialReferenceSelect & {
2382
- tools: ToolSelect[];
2383
- };
2384
2239
  /**
2385
- * 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.
2386
2242
  */
2387
- declare const getCredentialReference: (db: DatabaseClient) => (params: {
2243
+ declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
2388
2244
  scopes: ProjectScopeConfig;
2389
- id: string;
2390
- }) => Promise<CredentialReferenceSelect | undefined>;
2245
+ taskId?: string;
2246
+ toolCallId?: string;
2247
+ artifactId?: string;
2248
+ }) => Promise<Artifact[]>;
2391
2249
  /**
2392
- * Get a credential reference by ID with its related tools
2250
+ * Get ledger artifacts by context ID
2393
2251
  */
2394
- declare const getCredentialReferenceWithTools: (db: DatabaseClient) => (params: {
2252
+ declare const getLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2395
2253
  scopes: ProjectScopeConfig;
2396
- id: string;
2397
- }) => Promise<CredentialReferenceWithTools | undefined>;
2254
+ contextId: string;
2255
+ }) => Promise<LedgerArtifactSelect[]>;
2398
2256
  /**
2399
- * List all credential references for a tenant/project
2257
+ * Delete ledger artifacts by task ID
2400
2258
  */
2401
- declare const listCredentialReferences: (db: DatabaseClient) => (params: {
2259
+ declare const deleteLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2402
2260
  scopes: ProjectScopeConfig;
2403
- }) => Promise<CredentialReferenceSelect[]>;
2261
+ taskId: string;
2262
+ }) => Promise<boolean>;
2404
2263
  /**
2405
- * List credential references with pagination
2264
+ * Delete ledger artifacts by context ID
2406
2265
  */
2407
- declare const listCredentialReferencesPaginated: (db: DatabaseClient) => (params: {
2266
+ declare const deleteLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2408
2267
  scopes: ProjectScopeConfig;
2409
- pagination?: PaginationConfig;
2410
- }) => Promise<{
2411
- data: CredentialReferenceSelect[];
2412
- pagination: {
2413
- page: number;
2414
- limit: number;
2415
- total: number;
2416
- pages: number;
2417
- };
2418
- }>;
2419
- /**
2420
- * Create a new credential reference
2421
- */
2422
- declare const createCredentialReference: (db: DatabaseClient) => (params: CredentialReferenceInsert) => Promise<CredentialReferenceSelect>;
2268
+ contextId: string;
2269
+ }) => Promise<boolean>;
2423
2270
  /**
2424
- * Update a credential reference
2271
+ * Count ledger artifacts by task ID
2425
2272
  */
2426
- 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: {
2427
2279
  scopes: ProjectScopeConfig;
2280
+ messageId: string;
2281
+ }) => Promise<{
2282
+ tenantId: string;
2283
+ projectId: string;
2428
2284
  id: string;
2429
- data: Partial<CredentialReferenceUpdate>;
2430
- }) => Promise<CredentialReferenceWithTools | undefined>;
2431
- /**
2432
- * Delete a credential reference
2433
- */
2434
- 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: {
2435
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;
2436
2324
  id: string;
2437
- }) => Promise<boolean>;
2438
- /**
2439
- * Check if a credential reference exists
2440
- */
2441
- declare const hasCredentialReference: (db: DatabaseClient) => (params: {
2325
+ }[]>;
2326
+ declare const getMessagesByConversation: (db: DatabaseClient) => (params: {
2442
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;
2443
2349
  id: string;
2444
- }) => Promise<boolean>;
2445
- /**
2446
- * Get credential reference by ID (simple version without tools)
2447
- */
2448
- declare const getCredentialReferenceById: (db: DatabaseClient) => (params: {
2350
+ }[]>;
2351
+ declare const getMessagesByTask: (db: DatabaseClient) => (params: {
2449
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;
2450
2374
  id: string;
2451
- }) => Promise<CredentialReferenceSelect | null>;
2452
- /**
2453
- * Count credential references for a tenant/project
2454
- */
2455
- declare const countCredentialReferences: (db: DatabaseClient) => (params: {
2375
+ }[]>;
2376
+ declare const getVisibleMessages: (db: DatabaseClient) => (params: {
2456
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;
2457
2475
  }) => Promise<number>;
2476
+
2458
2477
  /**
2459
- * 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.).
2460
2481
  */
2461
- declare const upsertCredentialReference: (db: DatabaseClient) => (params: {
2462
- data: CredentialReferenceInsert;
2463
- }) => Promise<CredentialReferenceSelect>;
2464
2482
 
2483
+ type ProjectLogger = ReturnType<typeof getLogger>;
2465
2484
  /**
2466
- * 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.
2467
2487
  */
2468
- declare const getDataComponent: (db: DatabaseClient) => (params: {
2469
- scopes: ProjectScopeConfig;
2470
- dataComponentId: string;
2471
- }) => Promise<DataComponentSelect | null>;
2488
+ declare const createFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
2472
2489
  /**
2473
- * 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.
2474
2492
  */
2475
- declare const listDataComponents: (db: DatabaseClient) => (params: {
2476
- scopes: ProjectScopeConfig;
2477
- }) => Promise<DataComponentSelect[]>;
2493
+ declare const updateFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
2478
2494
  /**
2479
- * List data components with pagination
2495
+ * Get a complete project definition with all nested resources
2480
2496
  */
2481
- declare const listDataComponentsPaginated: (db: DatabaseClient) => (params: {
2497
+ declare const getFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
2482
2498
  scopes: ProjectScopeConfig;
2483
- pagination?: PaginationConfig;
2484
- }) => Promise<{
2485
- data: DataComponentSelect[];
2486
- pagination: {
2487
- page: number;
2488
- limit: number;
2489
- total: number;
2490
- pages: number;
2491
- };
2492
- }>;
2499
+ }) => Promise<FullProjectDefinition | null>;
2493
2500
  /**
2494
- * Create a new data component
2495
- */
2496
- declare const createDataComponent: (db: DatabaseClient) => (params: DataComponentInsert) => Promise<DataComponentSelect>;
2497
- /**
2498
- * Update a data component
2499
- */
2500
- declare const updateDataComponent: (db: DatabaseClient) => (params: {
2501
- scopes: ProjectScopeConfig;
2502
- dataComponentId: string;
2503
- data: DataComponentUpdate;
2504
- }) => Promise<DataComponentSelect | null>;
2505
- /**
2506
- * Delete a data component
2501
+ * Delete a complete project and cascade to all related entities
2507
2502
  */
2508
- declare const deleteDataComponent: (db: DatabaseClient) => (params: {
2503
+ declare const deleteFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
2509
2504
  scopes: ProjectScopeConfig;
2510
- dataComponentId: string;
2511
2505
  }) => Promise<boolean>;
2506
+
2512
2507
  /**
2513
- * Get data components for a specific agent
2508
+ * List all unique project IDs within a tenant by scanning all resource tables
2514
2509
  */
2515
- declare const getDataComponentsForAgent: (db: DatabaseClient) => (params: {
2516
- scopes: AgentScopeConfig;
2517
- }) => Promise<DataComponentSelect[]>;
2510
+ declare const listProjects: (db: DatabaseClient) => (params: {
2511
+ tenantId: string;
2512
+ }) => Promise<ProjectInfo[]>;
2518
2513
  /**
2519
- * Associate a data component with an agent
2514
+ * List all unique project IDs within a tenant with pagination
2520
2515
  */
2521
- declare const associateDataComponentWithAgent: (db: DatabaseClient) => (params: {
2522
- scopes: AgentScopeConfig;
2523
- dataComponentId: string;
2524
- }) => Promise<{
2516
+ declare const listProjectsPaginated: (db: DatabaseClient) => (params: {
2525
2517
  tenantId: string;
2526
- projectId: string;
2527
- id: string;
2528
- graphId: string;
2529
- createdAt: string;
2530
- agentId: string;
2531
- dataComponentId: string;
2518
+ pagination?: PaginationConfig;
2519
+ }) => Promise<{
2520
+ data: ProjectSelect[];
2521
+ pagination: PaginationResult;
2532
2522
  }>;
2533
2523
  /**
2534
- * Remove association between data component and agent
2535
- */
2536
- declare const removeDataComponentFromAgent: (db: DatabaseClient) => (params: {
2537
- scopes: AgentScopeConfig;
2538
- dataComponentId: string;
2539
- }) => Promise<boolean>;
2540
- declare const deleteAgentDataComponentRelationByAgent: (db: DatabaseClient) => (params: {
2541
- scopes: AgentScopeConfig;
2542
- }) => Promise<boolean>;
2543
- /**
2544
- * Get all agents that use a specific data component
2524
+ * Get resource counts for a specific project
2545
2525
  */
2546
- declare const getAgentsUsingDataComponent: (db: DatabaseClient) => (params: {
2547
- scopes: ProjectScopeConfig;
2548
- dataComponentId: string;
2549
- }) => Promise<{
2550
- agentId: string;
2551
- createdAt: string;
2552
- }[]>;
2526
+ declare const getProjectResourceCounts: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<ProjectResourceCounts>;
2553
2527
  /**
2554
- * Check if a data component is associated with an agent
2528
+ * Check if a project exists (has any resources)
2555
2529
  */
2556
- declare const isDataComponentAssociatedWithAgent: (db: DatabaseClient) => (params: {
2557
- scopes: AgentScopeConfig;
2558
- dataComponentId: string;
2559
- }) => Promise<boolean>;
2530
+ declare const projectExists: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
2560
2531
  /**
2561
- * Upsert agent-data component relation (create if it doesn't exist, no-op if it does)
2532
+ * Count total projects for a tenant
2562
2533
  */
2563
- declare const upsertAgentDataComponentRelation: (db: DatabaseClient) => (params: {
2564
- scopes: AgentScopeConfig;
2565
- dataComponentId: string;
2566
- }) => Promise<{
2534
+ declare const countProjects: (db: DatabaseClient) => (params: {
2567
2535
  tenantId: string;
2568
- projectId: string;
2569
- id: string;
2570
- graphId: string;
2571
- createdAt: string;
2572
- agentId: string;
2573
- dataComponentId: string;
2574
- } | null>;
2536
+ }) => Promise<number>;
2575
2537
  /**
2576
- * Count data components for a tenant/project
2538
+ * Get a single project by ID
2577
2539
  */
2578
- declare const countDataComponents: (db: DatabaseClient) => (params: {
2540
+ declare const getProject: (db: DatabaseClient) => (params: {
2579
2541
  scopes: ProjectScopeConfig;
2580
- }) => Promise<number>;
2542
+ }) => Promise<ProjectSelect | null>;
2581
2543
  /**
2582
- * Upsert a data component (create if it doesn't exist, update if it does)
2544
+ * Create a new project
2583
2545
  */
2584
- declare const upsertDataComponent: (db: DatabaseClient) => (params: {
2585
- data: DataComponentInsert;
2586
- }) => Promise<DataComponentSelect | null>;
2587
-
2546
+ declare const createProject: (db: DatabaseClient) => (params: ProjectInsert) => Promise<ProjectSelect>;
2588
2547
  /**
2589
- * Create a new external agent
2548
+ * Update an existing project
2590
2549
  */
2591
- 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>;
2592
2554
  /**
2593
- * Get external agent by ID
2555
+ * Check if a project exists in the projects table
2594
2556
  */
2595
- declare const getExternalAgent: (db: DatabaseClient) => (params: {
2596
- scopes: GraphScopeConfig;
2597
- agentId: string;
2598
- }) => Promise<ExternalAgentSelect | null>;
2557
+ declare const projectExistsInTable: (db: DatabaseClient) => (params: {
2558
+ scopes: ProjectScopeConfig;
2559
+ }) => Promise<boolean>;
2599
2560
  /**
2600
- * Get external agent by base URL
2561
+ * Check if a project has any resources (used before deletion)
2601
2562
  */
2602
- declare const getExternalAgentByUrl: (db: DatabaseClient) => (params: {
2603
- scopes: GraphScopeConfig;
2604
- baseUrl: string;
2605
- }) => Promise<ExternalAgentSelect | null>;
2563
+ declare const projectHasResources: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
2606
2564
  /**
2607
- * List external agents for a tenant
2565
+ * Delete a project (with validation for existing resources)
2608
2566
  */
2609
- 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: {
2610
2572
  scopes: GraphScopeConfig;
2611
- }) => Promise<ExternalAgentSelect[]>;
2612
- /**
2613
- * List external agents with pagination
2614
- */
2615
- 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: {
2616
2587
  scopes: GraphScopeConfig;
2617
2588
  pagination?: PaginationConfig;
2618
2589
  }) => Promise<{
2619
- 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
+ }[];
2620
2602
  pagination: {
2621
2603
  page: number;
2622
2604
  limit: number;
@@ -2624,465 +2606,640 @@ declare const listExternalAgentsPaginated: (db: DatabaseClient) => (params: {
2624
2606
  pages: number;
2625
2607
  };
2626
2608
  }>;
2627
- /**
2628
- * Update an existing external agent
2629
- */
2630
- declare const updateExternalAgent: (db: DatabaseClient) => (params: {
2631
- scopes: GraphScopeConfig;
2632
- agentId: string;
2633
- data: Partial<ExternalAgentUpdate>;
2634
- }) => Promise<ExternalAgentSelect | null>;
2635
- /**
2636
- * Upsert external agent (create if it doesn't exist, update if it does)
2637
- */
2638
- declare const upsertExternalAgent: (db: DatabaseClient) => (params: {
2639
- data: ExternalAgentInsert;
2640
- }) => Promise<ExternalAgentSelect>;
2641
- /**
2642
- * Delete an external agent
2643
- */
2644
- 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: {
2645
2624
  scopes: GraphScopeConfig;
2646
- agentId: string;
2647
- }) => Promise<boolean>;
2648
- /**
2649
- * Check if an external agent exists
2650
- */
2651
- 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: {
2652
2638
  scopes: GraphScopeConfig;
2653
- agentId: string;
2654
- }) => Promise<boolean>;
2655
- /**
2656
- * Check if an external agent exists by URL
2657
- */
2658
- 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: {
2659
2662
  scopes: GraphScopeConfig;
2660
- baseUrl: string;
2661
- }) => Promise<boolean>;
2662
- /**
2663
- * Count external agents for a tenant
2664
- */
2665
- 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: {
2666
2686
  scopes: GraphScopeConfig;
2667
- }) => Promise<number>;
2668
-
2669
- /**
2670
- * Create or update a function (project-scoped)
2671
- */
2672
- declare const upsertFunction: (db: DatabaseClient) => (params: {
2673
- data: FunctionApiInsert;
2674
- scopes: ProjectScopeConfig;
2675
- }) => Promise<void>;
2676
- /**
2677
- * Get a function by ID (project-scoped)
2678
- */
2679
- declare const getFunction: (db: DatabaseClient) => (params: {
2680
- functionId: string;
2681
- scopes: ProjectScopeConfig;
2682
- }) => Promise<FunctionApiInsert | null>;
2683
- /**
2684
- * List all functions for a project
2685
- */
2686
- declare const listFunctions: (db: DatabaseClient) => (params: {
2687
- scopes: ProjectScopeConfig;
2688
- }) => Promise<FunctionApiInsert[]>;
2689
- /**
2690
- * Delete a function (project-scoped)
2691
- */
2692
- declare const deleteFunction: (db: DatabaseClient) => (params: {
2693
- functionId: string;
2694
- scopes: ProjectScopeConfig;
2695
- }) => Promise<void>;
2696
-
2697
- interface GraphLogger {
2698
- info(obj: Record<string, any>, msg?: string): void;
2699
- error(obj: Record<string, any>, msg?: string): void;
2700
- }
2701
- /**
2702
- * Server-side implementation of createFullGraph that performs actual database operations.
2703
- * This function creates a complete graph with all agents, tools, and relationships.
2704
- */
2705
- declare const createFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2706
- /**
2707
- * Server-side implementation of updateFullGraph that performs actual database operations.
2708
- * This function updates a complete graph with all agents, tools, and relationships.
2709
- */
2710
- declare const updateFullGraphServerSide: (db: DatabaseClient, logger?: GraphLogger) => (scopes: ProjectScopeConfig, graphData: FullGraphDefinition) => Promise<FullGraphDefinition>;
2711
- /**
2712
- * Get a complete graph definition by ID
2713
- */
2714
- declare const getFullGraph: (db: DatabaseClient, logger?: GraphLogger) => (params: {
2715
- scopes: GraphScopeConfig;
2716
- }) => Promise<FullGraphDefinition | null>;
2717
- /**
2718
- * Delete a complete graph and cascade to all related entities
2719
- */
2720
- 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: {
2721
2710
  scopes: GraphScopeConfig;
2722
- }) => Promise<boolean>;
2723
-
2724
- /**
2725
- * Atomic upsert operation for a single artifact - prevents race conditions
2726
- */
2727
- declare const upsertLedgerArtifact: (db: DatabaseClient) => (params: {
2728
- scopes: ProjectScopeConfig;
2729
- contextId: string;
2730
- taskId: string;
2731
- toolCallId?: string | null;
2732
- artifact: Artifact;
2711
+ subAgentId: string;
2733
2712
  }) => Promise<{
2734
- created: boolean;
2735
- 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;
2736
2741
  }>;
2737
2742
  /**
2738
- * Save one or more artifacts to the ledger
2739
- */
2740
- declare const addLedgerArtifacts: (db: DatabaseClient) => (params: {
2741
- scopes: ProjectScopeConfig;
2742
- contextId: string;
2743
- taskId?: string | null;
2744
- toolCallId?: string | null;
2745
- artifacts: Artifact[];
2746
- }) => Promise<void>;
2747
- /**
2748
- * Retrieve artifacts by taskId, toolCallId, and/or artifactId.
2749
- * At least one of taskId, toolCallId, or artifactId must be provided.
2750
- */
2751
- declare const getLedgerArtifacts: (db: DatabaseClient) => (params: {
2752
- scopes: ProjectScopeConfig;
2753
- taskId?: string;
2754
- toolCallId?: string;
2755
- artifactId?: string;
2756
- }) => Promise<Artifact[]>;
2757
- /**
2758
- * Get ledger artifacts by context ID
2759
- */
2760
- declare const getLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2761
- scopes: ProjectScopeConfig;
2762
- contextId: string;
2763
- }) => Promise<LedgerArtifactSelect[]>;
2764
- /**
2765
- * Delete ledger artifacts by task ID
2766
- */
2767
- declare const deleteLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2768
- scopes: ProjectScopeConfig;
2769
- taskId: string;
2770
- }) => Promise<boolean>;
2771
- /**
2772
- * Delete ledger artifacts by context ID
2773
- */
2774
- declare const deleteLedgerArtifactsByContext: (db: DatabaseClient) => (params: {
2775
- scopes: ProjectScopeConfig;
2776
- contextId: string;
2777
- }) => Promise<boolean>;
2778
- /**
2779
- * Count ledger artifacts by task ID
2743
+ * Check if agent relation exists by graph, source, target, and relation type
2780
2744
  */
2781
- declare const countLedgerArtifactsByTask: (db: DatabaseClient) => (params: {
2782
- scopes: ProjectScopeConfig;
2783
- taskId: string;
2784
- }) => Promise<number>;
2785
-
2786
- declare const getMessageById: (db: DatabaseClient) => (params: {
2787
- scopes: ProjectScopeConfig;
2788
- messageId: string;
2745
+ declare const getAgentRelationByParams: (db: DatabaseClient) => (params: {
2746
+ scopes: GraphScopeConfig;
2747
+ sourceSubAgentId: string;
2748
+ targetSubAgentId?: string;
2749
+ externalSubAgentId?: string;
2750
+ relationType: string;
2789
2751
  }) => Promise<{
2790
2752
  tenantId: string;
2791
2753
  projectId: string;
2792
2754
  id: string;
2755
+ graphId: string;
2793
2756
  createdAt: string;
2794
2757
  updatedAt: string;
2795
- metadata: MessageMetadata | null;
2796
- content: MessageContent;
2797
- conversationId: string;
2798
- agentId: string | null;
2799
- role: string;
2800
- fromAgentId: string | null;
2801
- toAgentId: string | null;
2802
- fromExternalAgentId: string | null;
2803
- toExternalAgentId: string | null;
2804
- visibility: string;
2805
- messageType: string;
2806
- taskId: string | null;
2807
- parentMessageId: string | null;
2808
- a2aTaskId: string | null;
2809
- a2aSessionId: string | null;
2758
+ sourceSubAgentId: string;
2759
+ targetSubAgentId: string | null;
2760
+ externalSubAgentId: string | null;
2761
+ relationType: string | null;
2810
2762
  } | undefined>;
2811
- declare const listMessages: (db: DatabaseClient) => (params: {
2812
- scopes: ProjectScopeConfig;
2813
- pagination: PaginationConfig;
2814
- }) => Promise<{
2815
- createdAt: string;
2816
- updatedAt: string;
2817
- conversationId: string;
2818
- role: string;
2819
- fromAgentId: string | null;
2820
- toAgentId: string | null;
2821
- fromExternalAgentId: string | null;
2822
- toExternalAgentId: string | null;
2823
- content: MessageContent;
2824
- visibility: string;
2825
- messageType: string;
2826
- agentId: string | null;
2827
- taskId: string | null;
2828
- parentMessageId: string | null;
2829
- a2aTaskId: string | null;
2830
- a2aSessionId: string | null;
2831
- metadata: MessageMetadata | null;
2832
- 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<{
2833
2767
  tenantId: string;
2768
+ projectId: string;
2834
2769
  id: string;
2835
- }[]>;
2836
- declare const getMessagesByConversation: (db: DatabaseClient) => (params: {
2837
- scopes: ProjectScopeConfig;
2838
- conversationId: string;
2839
- pagination: PaginationConfig;
2840
- }) => Promise<{
2770
+ graphId: string;
2841
2771
  createdAt: string;
2842
2772
  updatedAt: string;
2843
- conversationId: string;
2844
- role: string;
2845
- fromAgentId: string | null;
2846
- toAgentId: string | null;
2847
- fromExternalAgentId: string | null;
2848
- toExternalAgentId: string | null;
2849
- content: MessageContent;
2850
- visibility: string;
2851
- messageType: string;
2852
- agentId: string | null;
2853
- taskId: string | null;
2854
- parentMessageId: string | null;
2855
- a2aTaskId: string | null;
2856
- a2aSessionId: string | null;
2857
- metadata: MessageMetadata | null;
2858
- 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<{
2859
2779
  tenantId: string;
2780
+ projectId: string;
2860
2781
  id: string;
2861
- }[]>;
2862
- declare const getMessagesByTask: (db: DatabaseClient) => (params: {
2863
- scopes: ProjectScopeConfig;
2864
- taskId: string;
2865
- pagination: PaginationConfig;
2866
- }) => Promise<{
2782
+ graphId: string;
2867
2783
  createdAt: string;
2868
2784
  updatedAt: string;
2869
- conversationId: string;
2870
- role: string;
2871
- fromAgentId: string | null;
2872
- toAgentId: string | null;
2873
- fromExternalAgentId: string | null;
2874
- toExternalAgentId: string | null;
2875
- content: MessageContent;
2876
- visibility: string;
2877
- messageType: string;
2878
- agentId: string | null;
2879
- taskId: string | null;
2880
- parentMessageId: string | null;
2881
- a2aTaskId: string | null;
2882
- a2aSessionId: string | null;
2883
- metadata: MessageMetadata | null;
2884
- 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<{
2885
2795
  tenantId: string;
2796
+ projectId: string;
2886
2797
  id: string;
2887
- }[]>;
2888
- declare const getVisibleMessages: (db: DatabaseClient) => (params: {
2889
- scopes: ProjectScopeConfig;
2890
- conversationId: string;
2891
- visibility?: MessageVisibility[];
2892
- pagination: PaginationConfig;
2893
- }) => Promise<{
2798
+ graphId: string;
2894
2799
  createdAt: string;
2895
2800
  updatedAt: string;
2896
- conversationId: string;
2897
- role: string;
2898
- fromAgentId: string | null;
2899
- toAgentId: string | null;
2900
- fromExternalAgentId: string | null;
2901
- toExternalAgentId: string | null;
2902
- content: MessageContent;
2903
- visibility: string;
2904
- messageType: string;
2905
- agentId: string | null;
2906
- taskId: string | null;
2907
- parentMessageId: string | null;
2908
- a2aTaskId: string | null;
2909
- a2aSessionId: string | null;
2910
- 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;
2911
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<{
2912
2839
  tenantId: string;
2840
+ projectId: string;
2913
2841
  id: string;
2914
- }[]>;
2915
- 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<{
2916
2861
  tenantId: string;
2917
2862
  projectId: string;
2918
2863
  id: string;
2864
+ graphId: string;
2919
2865
  createdAt: string;
2920
2866
  updatedAt: string;
2921
- metadata: MessageMetadata | null;
2922
- content: MessageContent;
2923
- conversationId: string;
2924
- agentId: string | null;
2925
- role: string;
2926
- fromAgentId: string | null;
2927
- toAgentId: string | null;
2928
- fromExternalAgentId: string | null;
2929
- toExternalAgentId: string | null;
2930
- visibility: string;
2931
- messageType: string;
2932
- taskId: string | null;
2933
- parentMessageId: string | null;
2934
- a2aTaskId: string | null;
2935
- 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
+ };
2936
2894
  }>;
2937
- declare const updateMessage: (db: DatabaseClient) => (params: {
2938
- scopes: ProjectScopeConfig;
2939
- messageId: string;
2940
- 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;
2941
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<{
2942
3140
  tenantId: string;
2943
3141
  projectId: string;
2944
3142
  id: string;
3143
+ name: string;
3144
+ description: string;
3145
+ prompt: string;
3146
+ graphId: string;
2945
3147
  createdAt: string;
2946
3148
  updatedAt: string;
2947
- metadata: MessageMetadata | null;
2948
- content: MessageContent;
2949
- conversationId: string;
2950
- agentId: string | null;
2951
- role: string;
2952
- fromAgentId: string | null;
2953
- toAgentId: string | null;
2954
- fromExternalAgentId: string | null;
2955
- toExternalAgentId: string | null;
2956
- visibility: string;
2957
- messageType: string;
2958
- taskId: string | null;
2959
- parentMessageId: string | null;
2960
- a2aTaskId: string | null;
2961
- 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;
2962
3167
  }>;
2963
- declare const deleteMessage: (db: DatabaseClient) => (params: {
2964
- scopes: ProjectScopeConfig;
2965
- messageId: string;
3168
+ declare const updateSubAgent: (db: DatabaseClient) => (params: {
3169
+ scopes: GraphScopeConfig;
3170
+ subAgentId: string;
3171
+ data: SubAgentUpdate;
2966
3172
  }) => Promise<{
2967
3173
  tenantId: string;
2968
3174
  projectId: string;
2969
3175
  id: string;
3176
+ name: string;
3177
+ description: string;
3178
+ prompt: string;
3179
+ graphId: string;
2970
3180
  createdAt: string;
2971
3181
  updatedAt: string;
2972
- metadata: MessageMetadata | null;
2973
- content: MessageContent;
2974
- conversationId: string;
2975
- agentId: string | null;
2976
- role: string;
2977
- fromAgentId: string | null;
2978
- toAgentId: string | null;
2979
- fromExternalAgentId: string | null;
2980
- toExternalAgentId: string | null;
2981
- visibility: string;
2982
- messageType: string;
2983
- taskId: string | null;
2984
- parentMessageId: string | null;
2985
- a2aTaskId: string | null;
2986
- 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;
2987
3200
  }>;
2988
- declare const countMessagesByConversation: (db: DatabaseClient) => (params: {
2989
- scopes: ProjectScopeConfig;
2990
- conversationId: string;
2991
- }) => Promise<number>;
2992
-
2993
- /**
2994
- * Server-side data access layer for Full Project operations.
2995
- * This module provides functions for creating, retrieving, updating, and deleting
2996
- * complete project definitions with all nested resources (graphs, agents, tools, etc.).
2997
- */
2998
-
2999
- type ProjectLogger = ReturnType<typeof getLogger>;
3000
- /**
3001
- * Server-side implementation of createFullProject that performs actual database operations.
3002
- * This function creates a complete project with all graphs and their nested resources.
3003
- */
3004
- declare const createFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
3005
- /**
3006
- * Server-side implementation of updateFullProject that performs actual database operations.
3007
- * This function updates a complete project with all graphs and their nested resources.
3008
- */
3009
- declare const updateFullProjectServerSide: (db: DatabaseClient, logger?: ProjectLogger) => (scopes: ProjectScopeConfig, projectData: FullProjectDefinition) => Promise<FullProjectDefinition>;
3010
- /**
3011
- * Get a complete project definition with all nested resources
3012
- */
3013
- declare const getFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
3014
- scopes: ProjectScopeConfig;
3015
- }) => Promise<FullProjectDefinition | null>;
3016
3201
  /**
3017
- * Delete a complete project and cascade to all related entities
3202
+ * Upsert agent (create if it doesn't exist, update if it does)
3018
3203
  */
3019
- declare const deleteFullProject: (db: DatabaseClient, logger?: ProjectLogger) => (params: {
3020
- 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;
3021
3210
  }) => Promise<boolean>;
3022
-
3023
- /**
3024
- * List all unique project IDs within a tenant by scanning all resource tables
3025
- */
3026
- declare const listProjects: (db: DatabaseClient) => (params: {
3027
- tenantId: string;
3028
- }) => Promise<ProjectInfo[]>;
3029
- /**
3030
- * List all unique project IDs within a tenant with pagination
3031
- */
3032
- declare const listProjectsPaginated: (db: DatabaseClient) => (params: {
3033
- tenantId: string;
3034
- pagination?: PaginationConfig;
3211
+ declare const getSubAgentsByIds: (db: DatabaseClient) => (params: {
3212
+ scopes: GraphScopeConfig;
3213
+ subAgentIds: string[];
3035
3214
  }) => Promise<{
3036
- data: ProjectSelect[];
3037
- pagination: PaginationResult;
3038
- }>;
3039
- /**
3040
- * Get resource counts for a specific project
3041
- */
3042
- declare const getProjectResourceCounts: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<ProjectResourceCounts>;
3043
- /**
3044
- * Check if a project exists (has any resources)
3045
- */
3046
- declare const projectExists: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
3047
- /**
3048
- * Count total projects for a tenant
3049
- */
3050
- 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;
3051
3240
  tenantId: string;
3052
- }) => Promise<number>;
3053
- /**
3054
- * Get a single project by ID
3055
- */
3056
- declare const getProject: (db: DatabaseClient) => (params: {
3057
- scopes: ProjectScopeConfig;
3058
- }) => Promise<ProjectSelect | null>;
3059
- /**
3060
- * Create a new project
3061
- */
3062
- declare const createProject: (db: DatabaseClient) => (params: ProjectInsert) => Promise<ProjectSelect>;
3063
- /**
3064
- * Update an existing project
3065
- */
3066
- declare const updateProject: (db: DatabaseClient) => (params: {
3067
- scopes: ProjectScopeConfig;
3068
- data: ProjectUpdate;
3069
- }) => Promise<ProjectSelect | null>;
3070
- /**
3071
- * Check if a project exists in the projects table
3072
- */
3073
- declare const projectExistsInTable: (db: DatabaseClient) => (params: {
3074
- scopes: ProjectScopeConfig;
3075
- }) => Promise<boolean>;
3076
- /**
3077
- * Check if a project has any resources (used before deletion)
3078
- */
3079
- declare const projectHasResources: (db: DatabaseClient) => (params: ProjectScopeConfig) => Promise<boolean>;
3080
- /**
3081
- * Delete a project (with validation for existing resources)
3082
- */
3083
- declare const deleteProject: (db: DatabaseClient) => (params: {
3084
- scopes: ProjectScopeConfig;
3085
- }) => Promise<boolean>;
3241
+ id: string;
3242
+ }[]>;
3086
3243
 
3087
3244
  declare const createTask: (db: DatabaseClient) => (params: TaskInsert) => Promise<{
3088
3245
  tenantId: string;
@@ -3094,7 +3251,7 @@ declare const createTask: (db: DatabaseClient) => (params: TaskInsert) => Promis
3094
3251
  status: string;
3095
3252
  metadata: TaskMetadataConfig | null;
3096
3253
  contextId: string;
3097
- agentId: string;
3254
+ subAgentId: string;
3098
3255
  }>;
3099
3256
  declare const getTask: (db: DatabaseClient) => (params: {
3100
3257
  id: string;
@@ -3115,7 +3272,7 @@ declare const updateTask: (db: DatabaseClient) => (params: {
3115
3272
  status: string;
3116
3273
  metadata: TaskMetadataConfig | null;
3117
3274
  contextId: string;
3118
- agentId: string;
3275
+ subAgentId: string;
3119
3276
  }>;
3120
3277
  declare const listTaskIdsByContextId: (db: DatabaseClient) => (params: {
3121
3278
  contextId: string;
@@ -3134,20 +3291,12 @@ declare const getToolById: (db: DatabaseClient) => (params: {
3134
3291
  config: {
3135
3292
  type: "mcp";
3136
3293
  mcp: ToolMcpConfig;
3137
- } | {
3138
- type: "function";
3139
- function?: {
3140
- inputSchema: Record<string, unknown>;
3141
- executeCode: string;
3142
- dependencies: Record<string, unknown>;
3143
- };
3144
3294
  };
3145
3295
  credentialReferenceId: string | null;
3146
3296
  createdAt: string;
3147
3297
  updatedAt: string;
3148
3298
  headers: Record<string, string> | null;
3149
3299
  capabilities: ToolServerCapabilities | null;
3150
- functionId: string | null;
3151
3300
  imageUrl: string | null;
3152
3301
  lastError: string | null;
3153
3302
  } | null>;
@@ -3163,15 +3312,7 @@ declare const listTools: (db: DatabaseClient) => (params: {
3163
3312
  config: {
3164
3313
  type: "mcp";
3165
3314
  mcp: ToolMcpConfig;
3166
- } | {
3167
- type: "function";
3168
- function?: {
3169
- inputSchema: Record<string, unknown>;
3170
- executeCode: string;
3171
- dependencies: Record<string, unknown>;
3172
- };
3173
3315
  };
3174
- functionId: string | null;
3175
3316
  credentialReferenceId: string | null;
3176
3317
  headers: Record<string, string> | null;
3177
3318
  imageUrl: string | null;
@@ -3197,20 +3338,12 @@ declare const createTool: (db: DatabaseClient) => (params: ToolInsert) => Promis
3197
3338
  config: {
3198
3339
  type: "mcp";
3199
3340
  mcp: ToolMcpConfig;
3200
- } | {
3201
- type: "function";
3202
- function?: {
3203
- inputSchema: Record<string, unknown>;
3204
- executeCode: string;
3205
- dependencies: Record<string, unknown>;
3206
- };
3207
3341
  };
3208
3342
  credentialReferenceId: string | null;
3209
3343
  createdAt: string;
3210
3344
  updatedAt: string;
3211
3345
  headers: Record<string, string> | null;
3212
3346
  capabilities: ToolServerCapabilities | null;
3213
- functionId: string | null;
3214
3347
  imageUrl: string | null;
3215
3348
  lastError: string | null;
3216
3349
  }>;
@@ -3227,20 +3360,12 @@ declare const updateTool: (db: DatabaseClient) => (params: {
3227
3360
  config: {
3228
3361
  type: "mcp";
3229
3362
  mcp: ToolMcpConfig;
3230
- } | {
3231
- type: "function";
3232
- function?: {
3233
- inputSchema: Record<string, unknown>;
3234
- executeCode: string;
3235
- dependencies: Record<string, unknown>;
3236
- };
3237
3363
  };
3238
3364
  credentialReferenceId: string | null;
3239
3365
  createdAt: string;
3240
3366
  updatedAt: string;
3241
3367
  headers: Record<string, string> | null;
3242
3368
  capabilities: ToolServerCapabilities | null;
3243
- functionId: string | null;
3244
3369
  imageUrl: string | null;
3245
3370
  lastError: string | null;
3246
3371
  }>;
@@ -3250,7 +3375,7 @@ declare const deleteTool: (db: DatabaseClient) => (params: {
3250
3375
  }) => Promise<boolean>;
3251
3376
  declare const addToolToAgent: (db: DatabaseClient) => (params: {
3252
3377
  scopes: GraphScopeConfig;
3253
- agentId: string;
3378
+ subAgentId: string;
3254
3379
  toolId: string;
3255
3380
  selectedTools?: string[] | null;
3256
3381
  headers?: Record<string, string> | null;
@@ -3264,11 +3389,11 @@ declare const addToolToAgent: (db: DatabaseClient) => (params: {
3264
3389
  headers: Record<string, string> | null;
3265
3390
  toolId: string;
3266
3391
  selectedTools: string[] | null;
3267
- agentId: string;
3392
+ subAgentId: string;
3268
3393
  }>;
3269
3394
  declare const removeToolFromAgent: (db: DatabaseClient) => (params: {
3270
3395
  scopes: GraphScopeConfig;
3271
- agentId: string;
3396
+ subAgentId: string;
3272
3397
  toolId: string;
3273
3398
  }) => Promise<{
3274
3399
  tenantId: string;
@@ -3280,14 +3405,14 @@ declare const removeToolFromAgent: (db: DatabaseClient) => (params: {
3280
3405
  headers: Record<string, string> | null;
3281
3406
  toolId: string;
3282
3407
  selectedTools: string[] | null;
3283
- agentId: string;
3408
+ subAgentId: string;
3284
3409
  }>;
3285
3410
  /**
3286
3411
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
3287
3412
  */
3288
- declare const upsertAgentToolRelation: (db: DatabaseClient) => (params: {
3413
+ declare const upsertSubAgentToolRelation: (db: DatabaseClient) => (params: {
3289
3414
  scopes: GraphScopeConfig;
3290
- agentId: string;
3415
+ subAgentId: string;
3291
3416
  toolId: string;
3292
3417
  selectedTools?: string[] | null;
3293
3418
  headers?: Record<string, string> | null;
@@ -3302,7 +3427,7 @@ declare const upsertAgentToolRelation: (db: DatabaseClient) => (params: {
3302
3427
  headers: Record<string, string> | null;
3303
3428
  toolId: string;
3304
3429
  selectedTools: string[] | null;
3305
- agentId: string;
3430
+ subAgentId: string;
3306
3431
  }>;
3307
3432
  /**
3308
3433
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -3318,20 +3443,12 @@ declare const upsertTool: (db: DatabaseClient) => (params: {
3318
3443
  config: {
3319
3444
  type: "mcp";
3320
3445
  mcp: ToolMcpConfig;
3321
- } | {
3322
- type: "function";
3323
- function?: {
3324
- inputSchema: Record<string, unknown>;
3325
- executeCode: string;
3326
- dependencies: Record<string, unknown>;
3327
- };
3328
3446
  };
3329
3447
  credentialReferenceId: string | null;
3330
3448
  createdAt: string;
3331
3449
  updatedAt: string;
3332
3450
  headers: Record<string, string> | null;
3333
3451
  capabilities: ToolServerCapabilities | null;
3334
- functionId: string | null;
3335
3452
  imageUrl: string | null;
3336
3453
  lastError: string | null;
3337
3454
  }>;
@@ -4035,4 +4152,4 @@ declare function setSpanWithError(span: Span, error: Error, logger?: {
4035
4152
  */
4036
4153
  declare function getTracer(serviceName: string, serviceVersion?: string): Tracer;
4037
4154
 
4038
- 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 };