@inkeep/agents-core 0.18.1 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +4 -4
  2. package/dist/{chunk-JTHQYGCX.js → chunk-4FMDWUE4.js} +34 -34
  3. package/dist/{chunk-ID4CFGVF.js → chunk-B6F3RF4T.js} +87 -120
  4. package/dist/chunk-E6R6PML7.js +19 -0
  5. package/dist/chunk-HYS7HUYJ.js +27 -0
  6. package/dist/{chunk-H6PMWHNV.js → chunk-SLL6V3AE.js} +12 -12
  7. package/dist/{chunk-E4SFK6AI.js → chunk-VICWT3WO.js} +281 -142
  8. package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
  9. package/dist/client-exports.cjs +390 -283
  10. package/dist/client-exports.d.cts +13 -14
  11. package/dist/client-exports.d.ts +13 -14
  12. package/dist/client-exports.js +10 -10
  13. package/dist/constants/models.cjs +31 -0
  14. package/dist/constants/models.d.cts +33 -0
  15. package/dist/constants/models.d.ts +33 -0
  16. package/dist/constants/models.js +1 -0
  17. package/dist/db/schema.cjs +85 -118
  18. package/dist/db/schema.d.cts +2 -3
  19. package/dist/db/schema.d.ts +2 -3
  20. package/dist/db/schema.js +1 -1
  21. package/dist/index.cjs +214164 -1095
  22. package/dist/index.d.cts +215 -214
  23. package/dist/index.d.ts +215 -214
  24. package/dist/index.js +213657 -767
  25. package/dist/{schema-ULFEZCOL.d.cts → schema-CcSN2XcZ.d.cts} +54 -52
  26. package/dist/{schema-wbZXiVWb.d.ts → schema-D8h85qdU.d.ts} +54 -52
  27. package/dist/{signoz-queries-BuiipZTk.d.cts → signoz-queries-CuWMQh1H.d.cts} +10 -10
  28. package/dist/{signoz-queries-BuiipZTk.d.ts → signoz-queries-CuWMQh1H.d.ts} +10 -10
  29. package/dist/types/index.d.cts +2 -3
  30. package/dist/types/index.d.ts +2 -3
  31. package/dist/{utility-CyPQ1tC_.d.cts → utility-HqRMF7sM.d.cts} +1775 -320
  32. package/dist/{utility-CyPQ1tC_.d.ts → utility-HqRMF7sM.d.ts} +1775 -320
  33. package/dist/utils/schema-conversion.js +1 -1
  34. package/dist/validation/index.cjs +445 -304
  35. package/dist/validation/index.d.cts +12 -13
  36. package/dist/validation/index.d.ts +12 -13
  37. package/dist/validation/index.js +2 -2
  38. package/drizzle/0007_mighty_typhoid_mary.sql +227 -0
  39. package/drizzle/meta/0007_snapshot.json +2766 -0
  40. package/drizzle/meta/_journal.json +7 -0
  41. package/package.json +6 -1
  42. package/dist/chunk-MKBO26DX.js +0 -9
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { d6 as AgentDefinition, d5 as InternalAgentDefinition, cM as ExternalAgentApiInsert, fQ as GraphWithinContextOfProjectSchema, z as FullGraphDefinition } from '../utility-CyPQ1tC_.cjs';
3
- export { dY as AgentGraphApiInsertSchema, dX as AgentGraphApiSelectSchema, dZ as AgentGraphApiUpdateSchema, dV as AgentGraphInsertSchema, dU as AgentGraphSelectSchema, dW as AgentGraphUpdateSchema, f0 as AllAgentSchema, f5 as ApiKeyApiCreationResponseSchema, f6 as ApiKeyApiInsertSchema, f4 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f2 as ApiKeyInsertSchema, f1 as ApiKeySelectSchema, f3 as ApiKeyUpdateSchema, eO as ArtifactComponentApiInsertSchema, eN as ArtifactComponentApiSelectSchema, eP as ArtifactComponentApiUpdateSchema, eL as ArtifactComponentInsertSchema, eK as ArtifactComponentSelectSchema, eM as ArtifactComponentUpdateSchema, fO as CanUseItemSchema, ev as ContextCacheApiInsertSchema, eu as ContextCacheApiSelectSchema, ew as ContextCacheApiUpdateSchema, es as ContextCacheInsertSchema, er as ContextCacheSelectSchema, et as ContextCacheUpdateSchema, fy as ContextConfigApiInsertSchema, fx as ContextConfigApiSelectSchema, fz as ContextConfigApiUpdateSchema, fv as ContextConfigInsertSchema, fu as ContextConfigSelectSchema, fw as ContextConfigUpdateSchema, ej as ConversationApiInsertSchema, ei as ConversationApiSelectSchema, ek as ConversationApiUpdateSchema, eg as ConversationInsertSchema, ef as ConversationSelectSchema, eh as ConversationUpdateSchema, fb as CredentialReferenceApiInsertSchema, fa as CredentialReferenceApiSelectSchema, fc as CredentialReferenceApiUpdateSchema, f8 as CredentialReferenceInsertSchema, f7 as CredentialReferenceSelectSchema, f9 as CredentialReferenceUpdateSchema, eC as DataComponentApiInsertSchema, eB as DataComponentApiSelectSchema, eD as DataComponentApiUpdateSchema, ez as DataComponentBaseSchema, ey as DataComponentInsertSchema, ex as DataComponentSelectSchema, eA as DataComponentUpdateSchema, fU as ErrorResponseSchema, fV as ExistsResponseSchema, e_ as ExternalAgentApiInsertSchema, eZ as ExternalAgentApiSelectSchema, e$ as ExternalAgentApiUpdateSchema, eX as ExternalAgentInsertSchema, eW as ExternalAgentSelectSchema, eY as ExternalAgentUpdateSchema, dT as ExternalSubAgentRelationApiInsertSchema, dS as ExternalSubAgentRelationInsertSchema, fs as FetchConfigSchema, ft as FetchDefinitionSchema, a as FullGraphAgentInsertSchema, fP as FullGraphDefinitionSchema, g1 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, i as FunctionApiSelectSchema, j as FunctionApiUpdateSchema, fq as FunctionInsertSchema, fp as FunctionSelectSchema, fn as FunctionToolApiInsertSchema, fm as FunctionToolApiSelectSchema, fo as FunctionToolApiUpdateSchema, dE as FunctionToolConfig, dD as FunctionToolConfigSchema, fk as FunctionToolInsertSchema, fj as FunctionToolSelectSchema, fl as FunctionToolUpdateSchema, fr as FunctionUpdateSchema, d as GraphStopWhen, G as GraphStopWhenSchema, g2 as HeadersScopeSchema, fK as LedgerArtifactApiInsertSchema, fJ as LedgerArtifactApiSelectSchema, fL as LedgerArtifactApiUpdateSchema, fH as LedgerArtifactInsertSchema, fG as LedgerArtifactSelectSchema, fI as LedgerArtifactUpdateSchema, fS as ListResponseSchema, dx as MAX_ID_LENGTH, fe as MCPToolConfigSchema, dw as MIN_ID_LENGTH, ec as McpToolDefinitionSchema, fd as McpToolSchema, ea as McpTransportConfigSchema, ep as MessageApiInsertSchema, eo as MessageApiSelectSchema, eq as MessageApiUpdateSchema, em as MessageInsertSchema, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, f as ModelSettings, M as ModelSettingsSchema, gb as PaginationQueryParamsSchema, fR as PaginationSchema, f$ as ProjectApiInsertSchema, f_ as ProjectApiSelectSchema, g0 as ProjectApiUpdateSchema, fY as ProjectInsertSchema, dB as ProjectModelSchema, fX as ProjectSelectSchema, fZ as ProjectUpdateSchema, fW as RemovedResponseSchema, dC as SandboxConfig, k as SandboxConfigSchema, fT as SingleResponseSchema, fM as StatusComponentSchema, fN as StatusUpdateSchema, c as StopWhen, S as StopWhenSchema, dJ as SubAgentApiInsertSchema, dI as SubAgentApiSelectSchema, dK as SubAgentApiUpdateSchema, eU as SubAgentArtifactComponentApiInsertSchema, eT as SubAgentArtifactComponentApiSelectSchema, eV as SubAgentArtifactComponentApiUpdateSchema, eR as SubAgentArtifactComponentInsertSchema, eQ as SubAgentArtifactComponentSelectSchema, eS as SubAgentArtifactComponentUpdateSchema, eI as SubAgentDataComponentApiInsertSchema, eH as SubAgentDataComponentApiSelectSchema, eJ as SubAgentDataComponentApiUpdateSchema, eF as SubAgentDataComponentInsertSchema, eE as SubAgentDataComponentSelectSchema, eG as SubAgentDataComponentUpdateSchema, dG as SubAgentInsertSchema, dP as SubAgentRelationApiInsertSchema, dO as SubAgentRelationApiSelectSchema, dQ as SubAgentRelationApiUpdateSchema, dM as SubAgentRelationInsertSchema, dR as SubAgentRelationQuerySchema, dL as SubAgentRelationSelectSchema, dN as SubAgentRelationUpdateSchema, dF as SubAgentSelectSchema, e as SubAgentStopWhen, b as SubAgentStopWhenSchema, fE as SubAgentToolRelationApiInsertSchema, fD as SubAgentToolRelationApiSelectSchema, fF as SubAgentToolRelationApiUpdateSchema, fB as SubAgentToolRelationInsertSchema, fA as SubAgentToolRelationSelectSchema, fC as SubAgentToolRelationUpdateSchema, dH as SubAgentUpdateSchema, e2 as TaskApiInsertSchema, e1 as TaskApiSelectSchema, e3 as TaskApiUpdateSchema, d$ as TaskInsertSchema, e8 as TaskRelationApiInsertSchema, e7 as TaskRelationApiSelectSchema, e9 as TaskRelationApiUpdateSchema, e5 as TaskRelationInsertSchema, e4 as TaskRelationSelectSchema, e6 as TaskRelationUpdateSchema, d_ as TaskSelectSchema, 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, fh as ToolApiInsertSchema, fg as ToolApiSelectSchema, fi as ToolApiUpdateSchema, ee as ToolInsertSchema, ed as ToolSelectSchema, eb as ToolStatusSchema, ff as ToolUpdateSchema, dy as URL_SAFE_ID_PATTERN, dz as resourceIdSchema } from '../utility-CyPQ1tC_.cjs';
2
+ import { d6 as SubAgentDefinition, d5 as InternalSubAgentDefinition, cM as ExternalSubAgentApiInsert, fP as AgentWithinContextOfProjectSchema, B as FullAgentDefinition } from '../utility-HqRMF7sM.cjs';
3
+ export { dY as AgentApiInsertSchema, dX as AgentApiSelectSchema, dZ as AgentApiUpdateSchema, dV as AgentInsertSchema, gj as AgentListResponse, g3 as AgentResponse, dU as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, dW as AgentUpdateSchema, f0 as AllAgentSchema, f5 as ApiKeyApiCreationResponseSchema, f6 as ApiKeyApiInsertSchema, f4 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f2 as ApiKeyInsertSchema, gn as ApiKeyListResponse, g7 as ApiKeyResponse, f1 as ApiKeySelectSchema, f3 as ApiKeyUpdateSchema, eO as ArtifactComponentApiInsertSchema, eN as ArtifactComponentApiSelectSchema, eP as ArtifactComponentApiUpdateSchema, eL as ArtifactComponentInsertSchema, gs as ArtifactComponentListResponse, gc as ArtifactComponentResponse, eK as ArtifactComponentSelectSchema, eM as ArtifactComponentUpdateSchema, fO as CanUseItemSchema, ev as ContextCacheApiInsertSchema, eu as ContextCacheApiSelectSchema, ew as ContextCacheApiUpdateSchema, es as ContextCacheInsertSchema, er as ContextCacheSelectSchema, et as ContextCacheUpdateSchema, fy as ContextConfigApiInsertSchema, fx as ContextConfigApiSelectSchema, fz as ContextConfigApiUpdateSchema, fv as ContextConfigInsertSchema, gm as ContextConfigListResponse, g6 as ContextConfigResponse, fu as ContextConfigSelectSchema, fw as ContextConfigUpdateSchema, ej as ConversationApiInsertSchema, ei as ConversationApiSelectSchema, ek as ConversationApiUpdateSchema, eg as ConversationInsertSchema, gv as ConversationListResponse, gf as ConversationResponse, ef as ConversationSelectSchema, eh as ConversationUpdateSchema, fb as CredentialReferenceApiInsertSchema, fa as CredentialReferenceApiSelectSchema, fc as CredentialReferenceApiUpdateSchema, f8 as CredentialReferenceInsertSchema, go as CredentialReferenceListResponse, g8 as CredentialReferenceResponse, f7 as CredentialReferenceSelectSchema, f9 as CredentialReferenceUpdateSchema, eC as DataComponentApiInsertSchema, eB as DataComponentApiSelectSchema, eD as DataComponentApiUpdateSchema, ez as DataComponentBaseSchema, ey as DataComponentInsertSchema, gr as DataComponentListResponse, gb as DataComponentResponse, ex as DataComponentSelectSchema, eA as DataComponentUpdateSchema, fT as ErrorResponseSchema, fU as ExistsResponseSchema, e_ as ExternalAgentApiInsertSchema, eZ as ExternalAgentApiSelectSchema, e$ as ExternalAgentApiUpdateSchema, eX as ExternalAgentInsertSchema, gl as ExternalAgentListResponse, g5 as ExternalAgentResponse, eW as ExternalAgentSelectSchema, eY as ExternalAgentUpdateSchema, dT as ExternalSubAgentRelationApiInsertSchema, dS as ExternalSubAgentRelationInsertSchema, fs as FetchConfigSchema, ft as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, g0 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fq as FunctionInsertSchema, gp as FunctionListResponse, g9 as FunctionResponse, fp as FunctionSelectSchema, fn as FunctionToolApiInsertSchema, fm as FunctionToolApiSelectSchema, fo as FunctionToolApiUpdateSchema, dE as FunctionToolConfig, dD as FunctionToolConfigSchema, fk as FunctionToolInsertSchema, gq as FunctionToolListResponse, ga as FunctionToolResponse, fj as FunctionToolSelectSchema, fl as FunctionToolUpdateSchema, fr as FunctionUpdateSchema, gB as HeadersScopeSchema, fK as LedgerArtifactApiInsertSchema, fJ as LedgerArtifactApiSelectSchema, fL as LedgerArtifactApiUpdateSchema, fH as LedgerArtifactInsertSchema, fG as LedgerArtifactSelectSchema, fI as LedgerArtifactUpdateSchema, fR as ListResponseSchema, dx as MAX_ID_LENGTH, fe as MCPToolConfigSchema, dw as MIN_ID_LENGTH, ec as McpToolDefinitionSchema, fd as McpToolSchema, ea as McpTransportConfigSchema, ep as MessageApiInsertSchema, eo as MessageApiSelectSchema, eq as MessageApiUpdateSchema, em as MessageInsertSchema, gw as MessageListResponse, gg as MessageResponse, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gK as PaginationQueryParamsSchema, fQ as PaginationSchema, f_ as ProjectApiInsertSchema, fZ as ProjectApiSelectSchema, f$ as ProjectApiUpdateSchema, fX as ProjectInsertSchema, gh as ProjectListResponse, dB as ProjectModelSchema, g1 as ProjectResponse, fW as ProjectSelectSchema, fY as ProjectUpdateSchema, fV as RemovedResponseSchema, dC as SandboxConfig, l as SandboxConfigSchema, fS as SingleResponseSchema, fM as StatusComponentSchema, fN as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dJ as SubAgentApiInsertSchema, dI as SubAgentApiSelectSchema, dK as SubAgentApiUpdateSchema, eU as SubAgentArtifactComponentApiInsertSchema, eT as SubAgentArtifactComponentApiSelectSchema, eV as SubAgentArtifactComponentApiUpdateSchema, eR as SubAgentArtifactComponentInsertSchema, gA as SubAgentArtifactComponentListResponse, gy as SubAgentArtifactComponentResponse, eQ as SubAgentArtifactComponentSelectSchema, eS as SubAgentArtifactComponentUpdateSchema, eI as SubAgentDataComponentApiInsertSchema, eH as SubAgentDataComponentApiSelectSchema, eJ as SubAgentDataComponentApiUpdateSchema, eF as SubAgentDataComponentInsertSchema, gz as SubAgentDataComponentListResponse, gx as SubAgentDataComponentResponse, eE as SubAgentDataComponentSelectSchema, eG as SubAgentDataComponentUpdateSchema, dG as SubAgentInsertSchema, gi as SubAgentListResponse, dP as SubAgentRelationApiInsertSchema, dO as SubAgentRelationApiSelectSchema, dQ as SubAgentRelationApiUpdateSchema, dM as SubAgentRelationInsertSchema, gt as SubAgentRelationListResponse, dR as SubAgentRelationQuerySchema, gd as SubAgentRelationResponse, dL as SubAgentRelationSelectSchema, dN as SubAgentRelationUpdateSchema, g2 as SubAgentResponse, dF as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fE as SubAgentToolRelationApiInsertSchema, fD as SubAgentToolRelationApiSelectSchema, fF as SubAgentToolRelationApiUpdateSchema, fB as SubAgentToolRelationInsertSchema, gu as SubAgentToolRelationListResponse, ge as SubAgentToolRelationResponse, fA as SubAgentToolRelationSelectSchema, fC as SubAgentToolRelationUpdateSchema, dH as SubAgentUpdateSchema, e2 as TaskApiInsertSchema, e1 as TaskApiSelectSchema, e3 as TaskApiUpdateSchema, d$ as TaskInsertSchema, e8 as TaskRelationApiInsertSchema, e7 as TaskRelationApiSelectSchema, e9 as TaskRelationApiUpdateSchema, e5 as TaskRelationInsertSchema, e4 as TaskRelationSelectSchema, e6 as TaskRelationUpdateSchema, d_ as TaskSelectSchema, e0 as TaskUpdateSchema, gD as TenantIdParamsSchema, gC as TenantParamsSchema, gH as TenantProjectAgentIdParamsSchema, gG as TenantProjectAgentParamsSchema, gJ as TenantProjectAgentSubAgentIdParamsSchema, gI as TenantProjectAgentSubAgentParamsSchema, gF as TenantProjectIdParamsSchema, gE as TenantProjectParamsSchema, fh as ToolApiInsertSchema, fg as ToolApiSelectSchema, fi as ToolApiUpdateSchema, ee as ToolInsertSchema, gk as ToolListResponse, g4 as ToolResponse, ed as ToolSelectSchema, eb as ToolStatusSchema, ff as ToolUpdateSchema, dy as URL_SAFE_ID_PATTERN, dz as resourceIdSchema } from '../utility-HqRMF7sM.cjs';
4
4
  export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.cjs';
5
5
  import 'drizzle-zod';
6
6
  import 'drizzle-orm/sqlite-core';
7
7
  import '@hono/zod-openapi';
8
- import '@modelcontextprotocol/sdk/client/streamableHttp.js';
9
8
 
10
9
  /**
11
10
  * Agent transfer event data
@@ -79,34 +78,34 @@ declare const A2AMessageMetadataSchema: z.ZodObject<{
79
78
  }, z.core.$strip>;
80
79
  type A2AMessageMetadata = z.infer<typeof A2AMessageMetadataSchema>;
81
80
 
82
- declare function isInternalAgent(agent: AgentDefinition): agent is InternalAgentDefinition;
83
- declare function isExternalAgent(agent: AgentDefinition): agent is ExternalAgentApiInsert;
84
- declare function validateAndTypeGraphData(data: unknown): z.infer<typeof GraphWithinContextOfProjectSchema>;
81
+ declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
82
+ declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
83
+ declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
85
84
  /**
86
85
  * Validates that all tool IDs referenced in agents exist in the tools record
87
86
  * Note: With scoped architecture, tool validation should be done at the project level
88
87
  * This function is kept for backward compatibility but will need project-scoped tool data
89
88
  */
90
- declare function validateToolReferences(graphData: FullGraphDefinition, availableToolIds?: Set<string>): void;
89
+ declare function validateToolReferences(agentData: FullAgentDefinition, availableToolIds?: Set<string>): void;
91
90
  /**
92
91
  * Validates that all dataComponent IDs referenced in agents exist in the dataComponents record
93
92
  * Note: With scoped architecture, dataComponent validation should be done at the project level
94
93
  */
95
- declare function validateDataComponentReferences(graphData: FullGraphDefinition, availableDataComponentIds?: Set<string>): void;
94
+ declare function validateDataComponentReferences(agentData: FullAgentDefinition, availableDataComponentIds?: Set<string>): void;
96
95
  /**
97
96
  * Validates that all artifactComponent IDs referenced in agents exist in the artifactComponents record.
98
97
  * Note: With scoped architecture, artifactComponent validation should be done at the project level
99
98
  */
100
- declare function validateArtifactComponentReferences(graphData: FullGraphDefinition, availableArtifactComponentIds?: Set<string>): void;
99
+ declare function validateArtifactComponentReferences(agentData: FullAgentDefinition, availableArtifactComponentIds?: Set<string>): void;
101
100
  /**
102
101
  * Validates agent relationships (transfer and delegation targets exist)
103
102
  */
104
- declare function validateAgentRelationships(graphData: FullGraphDefinition): void;
103
+ declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
105
104
  /**
106
- * Validates the graph structure before creation/update
105
+ * Validates the agent structure before creation/update
107
106
  * Note: With scoped architecture, project-scoped resource validation should be done at project level
108
107
  */
109
- declare function validateGraphStructure(graphData: FullGraphDefinition, projectResources?: {
108
+ declare function validateAgentStructure(agentData: FullAgentDefinition, projectResources?: {
110
109
  toolIds?: Set<string>;
111
110
  dataComponentIds?: Set<string>;
112
111
  artifactComponentIds?: Set<string>;
@@ -134,4 +133,4 @@ declare function isValidResourceId(id: string): boolean;
134
133
  */
135
134
  declare function generateIdFromName(name: string): string;
136
135
 
137
- export { type A2AMessageMetadata, A2AMessageMetadataSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, GraphWithinContextOfProjectSchema, type TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences };
136
+ export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences };
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { d6 as AgentDefinition, d5 as InternalAgentDefinition, cM as ExternalAgentApiInsert, fQ as GraphWithinContextOfProjectSchema, z as FullGraphDefinition } from '../utility-CyPQ1tC_.js';
3
- export { dY as AgentGraphApiInsertSchema, dX as AgentGraphApiSelectSchema, dZ as AgentGraphApiUpdateSchema, dV as AgentGraphInsertSchema, dU as AgentGraphSelectSchema, dW as AgentGraphUpdateSchema, f0 as AllAgentSchema, f5 as ApiKeyApiCreationResponseSchema, f6 as ApiKeyApiInsertSchema, f4 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f2 as ApiKeyInsertSchema, f1 as ApiKeySelectSchema, f3 as ApiKeyUpdateSchema, eO as ArtifactComponentApiInsertSchema, eN as ArtifactComponentApiSelectSchema, eP as ArtifactComponentApiUpdateSchema, eL as ArtifactComponentInsertSchema, eK as ArtifactComponentSelectSchema, eM as ArtifactComponentUpdateSchema, fO as CanUseItemSchema, ev as ContextCacheApiInsertSchema, eu as ContextCacheApiSelectSchema, ew as ContextCacheApiUpdateSchema, es as ContextCacheInsertSchema, er as ContextCacheSelectSchema, et as ContextCacheUpdateSchema, fy as ContextConfigApiInsertSchema, fx as ContextConfigApiSelectSchema, fz as ContextConfigApiUpdateSchema, fv as ContextConfigInsertSchema, fu as ContextConfigSelectSchema, fw as ContextConfigUpdateSchema, ej as ConversationApiInsertSchema, ei as ConversationApiSelectSchema, ek as ConversationApiUpdateSchema, eg as ConversationInsertSchema, ef as ConversationSelectSchema, eh as ConversationUpdateSchema, fb as CredentialReferenceApiInsertSchema, fa as CredentialReferenceApiSelectSchema, fc as CredentialReferenceApiUpdateSchema, f8 as CredentialReferenceInsertSchema, f7 as CredentialReferenceSelectSchema, f9 as CredentialReferenceUpdateSchema, eC as DataComponentApiInsertSchema, eB as DataComponentApiSelectSchema, eD as DataComponentApiUpdateSchema, ez as DataComponentBaseSchema, ey as DataComponentInsertSchema, ex as DataComponentSelectSchema, eA as DataComponentUpdateSchema, fU as ErrorResponseSchema, fV as ExistsResponseSchema, e_ as ExternalAgentApiInsertSchema, eZ as ExternalAgentApiSelectSchema, e$ as ExternalAgentApiUpdateSchema, eX as ExternalAgentInsertSchema, eW as ExternalAgentSelectSchema, eY as ExternalAgentUpdateSchema, dT as ExternalSubAgentRelationApiInsertSchema, dS as ExternalSubAgentRelationInsertSchema, fs as FetchConfigSchema, ft as FetchDefinitionSchema, a as FullGraphAgentInsertSchema, fP as FullGraphDefinitionSchema, g1 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, i as FunctionApiSelectSchema, j as FunctionApiUpdateSchema, fq as FunctionInsertSchema, fp as FunctionSelectSchema, fn as FunctionToolApiInsertSchema, fm as FunctionToolApiSelectSchema, fo as FunctionToolApiUpdateSchema, dE as FunctionToolConfig, dD as FunctionToolConfigSchema, fk as FunctionToolInsertSchema, fj as FunctionToolSelectSchema, fl as FunctionToolUpdateSchema, fr as FunctionUpdateSchema, d as GraphStopWhen, G as GraphStopWhenSchema, g2 as HeadersScopeSchema, fK as LedgerArtifactApiInsertSchema, fJ as LedgerArtifactApiSelectSchema, fL as LedgerArtifactApiUpdateSchema, fH as LedgerArtifactInsertSchema, fG as LedgerArtifactSelectSchema, fI as LedgerArtifactUpdateSchema, fS as ListResponseSchema, dx as MAX_ID_LENGTH, fe as MCPToolConfigSchema, dw as MIN_ID_LENGTH, ec as McpToolDefinitionSchema, fd as McpToolSchema, ea as McpTransportConfigSchema, ep as MessageApiInsertSchema, eo as MessageApiSelectSchema, eq as MessageApiUpdateSchema, em as MessageInsertSchema, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, f as ModelSettings, M as ModelSettingsSchema, gb as PaginationQueryParamsSchema, fR as PaginationSchema, f$ as ProjectApiInsertSchema, f_ as ProjectApiSelectSchema, g0 as ProjectApiUpdateSchema, fY as ProjectInsertSchema, dB as ProjectModelSchema, fX as ProjectSelectSchema, fZ as ProjectUpdateSchema, fW as RemovedResponseSchema, dC as SandboxConfig, k as SandboxConfigSchema, fT as SingleResponseSchema, fM as StatusComponentSchema, fN as StatusUpdateSchema, c as StopWhen, S as StopWhenSchema, dJ as SubAgentApiInsertSchema, dI as SubAgentApiSelectSchema, dK as SubAgentApiUpdateSchema, eU as SubAgentArtifactComponentApiInsertSchema, eT as SubAgentArtifactComponentApiSelectSchema, eV as SubAgentArtifactComponentApiUpdateSchema, eR as SubAgentArtifactComponentInsertSchema, eQ as SubAgentArtifactComponentSelectSchema, eS as SubAgentArtifactComponentUpdateSchema, eI as SubAgentDataComponentApiInsertSchema, eH as SubAgentDataComponentApiSelectSchema, eJ as SubAgentDataComponentApiUpdateSchema, eF as SubAgentDataComponentInsertSchema, eE as SubAgentDataComponentSelectSchema, eG as SubAgentDataComponentUpdateSchema, dG as SubAgentInsertSchema, dP as SubAgentRelationApiInsertSchema, dO as SubAgentRelationApiSelectSchema, dQ as SubAgentRelationApiUpdateSchema, dM as SubAgentRelationInsertSchema, dR as SubAgentRelationQuerySchema, dL as SubAgentRelationSelectSchema, dN as SubAgentRelationUpdateSchema, dF as SubAgentSelectSchema, e as SubAgentStopWhen, b as SubAgentStopWhenSchema, fE as SubAgentToolRelationApiInsertSchema, fD as SubAgentToolRelationApiSelectSchema, fF as SubAgentToolRelationApiUpdateSchema, fB as SubAgentToolRelationInsertSchema, fA as SubAgentToolRelationSelectSchema, fC as SubAgentToolRelationUpdateSchema, dH as SubAgentUpdateSchema, e2 as TaskApiInsertSchema, e1 as TaskApiSelectSchema, e3 as TaskApiUpdateSchema, d$ as TaskInsertSchema, e8 as TaskRelationApiInsertSchema, e7 as TaskRelationApiSelectSchema, e9 as TaskRelationApiUpdateSchema, e5 as TaskRelationInsertSchema, e4 as TaskRelationSelectSchema, e6 as TaskRelationUpdateSchema, d_ as TaskSelectSchema, 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, fh as ToolApiInsertSchema, fg as ToolApiSelectSchema, fi as ToolApiUpdateSchema, ee as ToolInsertSchema, ed as ToolSelectSchema, eb as ToolStatusSchema, ff as ToolUpdateSchema, dy as URL_SAFE_ID_PATTERN, dz as resourceIdSchema } from '../utility-CyPQ1tC_.js';
2
+ import { d6 as SubAgentDefinition, d5 as InternalSubAgentDefinition, cM as ExternalSubAgentApiInsert, fP as AgentWithinContextOfProjectSchema, B as FullAgentDefinition } from '../utility-HqRMF7sM.js';
3
+ export { dY as AgentApiInsertSchema, dX as AgentApiSelectSchema, dZ as AgentApiUpdateSchema, dV as AgentInsertSchema, gj as AgentListResponse, g3 as AgentResponse, dU as AgentSelectSchema, e as AgentStopWhen, b as AgentStopWhenSchema, dW as AgentUpdateSchema, f0 as AllAgentSchema, f5 as ApiKeyApiCreationResponseSchema, f6 as ApiKeyApiInsertSchema, f4 as ApiKeyApiSelectSchema, A as ApiKeyApiUpdateSchema, f2 as ApiKeyInsertSchema, gn as ApiKeyListResponse, g7 as ApiKeyResponse, f1 as ApiKeySelectSchema, f3 as ApiKeyUpdateSchema, eO as ArtifactComponentApiInsertSchema, eN as ArtifactComponentApiSelectSchema, eP as ArtifactComponentApiUpdateSchema, eL as ArtifactComponentInsertSchema, gs as ArtifactComponentListResponse, gc as ArtifactComponentResponse, eK as ArtifactComponentSelectSchema, eM as ArtifactComponentUpdateSchema, fO as CanUseItemSchema, ev as ContextCacheApiInsertSchema, eu as ContextCacheApiSelectSchema, ew as ContextCacheApiUpdateSchema, es as ContextCacheInsertSchema, er as ContextCacheSelectSchema, et as ContextCacheUpdateSchema, fy as ContextConfigApiInsertSchema, fx as ContextConfigApiSelectSchema, fz as ContextConfigApiUpdateSchema, fv as ContextConfigInsertSchema, gm as ContextConfigListResponse, g6 as ContextConfigResponse, fu as ContextConfigSelectSchema, fw as ContextConfigUpdateSchema, ej as ConversationApiInsertSchema, ei as ConversationApiSelectSchema, ek as ConversationApiUpdateSchema, eg as ConversationInsertSchema, gv as ConversationListResponse, gf as ConversationResponse, ef as ConversationSelectSchema, eh as ConversationUpdateSchema, fb as CredentialReferenceApiInsertSchema, fa as CredentialReferenceApiSelectSchema, fc as CredentialReferenceApiUpdateSchema, f8 as CredentialReferenceInsertSchema, go as CredentialReferenceListResponse, g8 as CredentialReferenceResponse, f7 as CredentialReferenceSelectSchema, f9 as CredentialReferenceUpdateSchema, eC as DataComponentApiInsertSchema, eB as DataComponentApiSelectSchema, eD as DataComponentApiUpdateSchema, ez as DataComponentBaseSchema, ey as DataComponentInsertSchema, gr as DataComponentListResponse, gb as DataComponentResponse, ex as DataComponentSelectSchema, eA as DataComponentUpdateSchema, fT as ErrorResponseSchema, fU as ExistsResponseSchema, e_ as ExternalAgentApiInsertSchema, eZ as ExternalAgentApiSelectSchema, e$ as ExternalAgentApiUpdateSchema, eX as ExternalAgentInsertSchema, gl as ExternalAgentListResponse, g5 as ExternalAgentResponse, eW as ExternalAgentSelectSchema, eY as ExternalAgentUpdateSchema, dT as ExternalSubAgentRelationApiInsertSchema, dS as ExternalSubAgentRelationInsertSchema, fs as FetchConfigSchema, ft as FetchDefinitionSchema, a as FullAgentAgentInsertSchema, g0 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, fq as FunctionInsertSchema, gp as FunctionListResponse, g9 as FunctionResponse, fp as FunctionSelectSchema, fn as FunctionToolApiInsertSchema, fm as FunctionToolApiSelectSchema, fo as FunctionToolApiUpdateSchema, dE as FunctionToolConfig, dD as FunctionToolConfigSchema, fk as FunctionToolInsertSchema, gq as FunctionToolListResponse, ga as FunctionToolResponse, fj as FunctionToolSelectSchema, fl as FunctionToolUpdateSchema, fr as FunctionUpdateSchema, gB as HeadersScopeSchema, fK as LedgerArtifactApiInsertSchema, fJ as LedgerArtifactApiSelectSchema, fL as LedgerArtifactApiUpdateSchema, fH as LedgerArtifactInsertSchema, fG as LedgerArtifactSelectSchema, fI as LedgerArtifactUpdateSchema, fR as ListResponseSchema, dx as MAX_ID_LENGTH, fe as MCPToolConfigSchema, dw as MIN_ID_LENGTH, ec as McpToolDefinitionSchema, fd as McpToolSchema, ea as McpTransportConfigSchema, ep as MessageApiInsertSchema, eo as MessageApiSelectSchema, eq as MessageApiUpdateSchema, em as MessageInsertSchema, gw as MessageListResponse, gg as MessageResponse, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, gK as PaginationQueryParamsSchema, fQ as PaginationSchema, f_ as ProjectApiInsertSchema, fZ as ProjectApiSelectSchema, f$ as ProjectApiUpdateSchema, fX as ProjectInsertSchema, gh as ProjectListResponse, dB as ProjectModelSchema, g1 as ProjectResponse, fW as ProjectSelectSchema, fY as ProjectUpdateSchema, fV as RemovedResponseSchema, dC as SandboxConfig, l as SandboxConfigSchema, fS as SingleResponseSchema, fM as StatusComponentSchema, fN as StatusUpdateSchema, d as StopWhen, S as StopWhenSchema, dJ as SubAgentApiInsertSchema, dI as SubAgentApiSelectSchema, dK as SubAgentApiUpdateSchema, eU as SubAgentArtifactComponentApiInsertSchema, eT as SubAgentArtifactComponentApiSelectSchema, eV as SubAgentArtifactComponentApiUpdateSchema, eR as SubAgentArtifactComponentInsertSchema, gA as SubAgentArtifactComponentListResponse, gy as SubAgentArtifactComponentResponse, eQ as SubAgentArtifactComponentSelectSchema, eS as SubAgentArtifactComponentUpdateSchema, eI as SubAgentDataComponentApiInsertSchema, eH as SubAgentDataComponentApiSelectSchema, eJ as SubAgentDataComponentApiUpdateSchema, eF as SubAgentDataComponentInsertSchema, gz as SubAgentDataComponentListResponse, gx as SubAgentDataComponentResponse, eE as SubAgentDataComponentSelectSchema, eG as SubAgentDataComponentUpdateSchema, dG as SubAgentInsertSchema, gi as SubAgentListResponse, dP as SubAgentRelationApiInsertSchema, dO as SubAgentRelationApiSelectSchema, dQ as SubAgentRelationApiUpdateSchema, dM as SubAgentRelationInsertSchema, gt as SubAgentRelationListResponse, dR as SubAgentRelationQuerySchema, gd as SubAgentRelationResponse, dL as SubAgentRelationSelectSchema, dN as SubAgentRelationUpdateSchema, g2 as SubAgentResponse, dF as SubAgentSelectSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema, fE as SubAgentToolRelationApiInsertSchema, fD as SubAgentToolRelationApiSelectSchema, fF as SubAgentToolRelationApiUpdateSchema, fB as SubAgentToolRelationInsertSchema, gu as SubAgentToolRelationListResponse, ge as SubAgentToolRelationResponse, fA as SubAgentToolRelationSelectSchema, fC as SubAgentToolRelationUpdateSchema, dH as SubAgentUpdateSchema, e2 as TaskApiInsertSchema, e1 as TaskApiSelectSchema, e3 as TaskApiUpdateSchema, d$ as TaskInsertSchema, e8 as TaskRelationApiInsertSchema, e7 as TaskRelationApiSelectSchema, e9 as TaskRelationApiUpdateSchema, e5 as TaskRelationInsertSchema, e4 as TaskRelationSelectSchema, e6 as TaskRelationUpdateSchema, d_ as TaskSelectSchema, e0 as TaskUpdateSchema, gD as TenantIdParamsSchema, gC as TenantParamsSchema, gH as TenantProjectAgentIdParamsSchema, gG as TenantProjectAgentParamsSchema, gJ as TenantProjectAgentSubAgentIdParamsSchema, gI as TenantProjectAgentSubAgentParamsSchema, gF as TenantProjectIdParamsSchema, gE as TenantProjectParamsSchema, fh as ToolApiInsertSchema, fg as ToolApiSelectSchema, fi as ToolApiUpdateSchema, ee as ToolInsertSchema, gk as ToolListResponse, g4 as ToolResponse, ed as ToolSelectSchema, eb as ToolStatusSchema, ff as ToolUpdateSchema, dy as URL_SAFE_ID_PATTERN, dz as resourceIdSchema } from '../utility-HqRMF7sM.js';
4
4
  export { P as PropsValidationResult, v as validatePropsAsJsonSchema } from '../props-validation-BMR1qNiy.js';
5
5
  import 'drizzle-zod';
6
6
  import 'drizzle-orm/sqlite-core';
7
7
  import '@hono/zod-openapi';
8
- import '@modelcontextprotocol/sdk/client/streamableHttp.js';
9
8
 
10
9
  /**
11
10
  * Agent transfer event data
@@ -79,34 +78,34 @@ declare const A2AMessageMetadataSchema: z.ZodObject<{
79
78
  }, z.core.$strip>;
80
79
  type A2AMessageMetadata = z.infer<typeof A2AMessageMetadataSchema>;
81
80
 
82
- declare function isInternalAgent(agent: AgentDefinition): agent is InternalAgentDefinition;
83
- declare function isExternalAgent(agent: AgentDefinition): agent is ExternalAgentApiInsert;
84
- declare function validateAndTypeGraphData(data: unknown): z.infer<typeof GraphWithinContextOfProjectSchema>;
81
+ declare function isInternalAgent(agent: SubAgentDefinition): agent is InternalSubAgentDefinition;
82
+ declare function isExternalAgent(agent: SubAgentDefinition): agent is ExternalSubAgentApiInsert;
83
+ declare function validateAndTypeAgentData(data: unknown): z.infer<typeof AgentWithinContextOfProjectSchema>;
85
84
  /**
86
85
  * Validates that all tool IDs referenced in agents exist in the tools record
87
86
  * Note: With scoped architecture, tool validation should be done at the project level
88
87
  * This function is kept for backward compatibility but will need project-scoped tool data
89
88
  */
90
- declare function validateToolReferences(graphData: FullGraphDefinition, availableToolIds?: Set<string>): void;
89
+ declare function validateToolReferences(agentData: FullAgentDefinition, availableToolIds?: Set<string>): void;
91
90
  /**
92
91
  * Validates that all dataComponent IDs referenced in agents exist in the dataComponents record
93
92
  * Note: With scoped architecture, dataComponent validation should be done at the project level
94
93
  */
95
- declare function validateDataComponentReferences(graphData: FullGraphDefinition, availableDataComponentIds?: Set<string>): void;
94
+ declare function validateDataComponentReferences(agentData: FullAgentDefinition, availableDataComponentIds?: Set<string>): void;
96
95
  /**
97
96
  * Validates that all artifactComponent IDs referenced in agents exist in the artifactComponents record.
98
97
  * Note: With scoped architecture, artifactComponent validation should be done at the project level
99
98
  */
100
- declare function validateArtifactComponentReferences(graphData: FullGraphDefinition, availableArtifactComponentIds?: Set<string>): void;
99
+ declare function validateArtifactComponentReferences(agentData: FullAgentDefinition, availableArtifactComponentIds?: Set<string>): void;
101
100
  /**
102
101
  * Validates agent relationships (transfer and delegation targets exist)
103
102
  */
104
- declare function validateAgentRelationships(graphData: FullGraphDefinition): void;
103
+ declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
105
104
  /**
106
- * Validates the graph structure before creation/update
105
+ * Validates the agent structure before creation/update
107
106
  * Note: With scoped architecture, project-scoped resource validation should be done at project level
108
107
  */
109
- declare function validateGraphStructure(graphData: FullGraphDefinition, projectResources?: {
108
+ declare function validateAgentStructure(agentData: FullAgentDefinition, projectResources?: {
110
109
  toolIds?: Set<string>;
111
110
  dataComponentIds?: Set<string>;
112
111
  artifactComponentIds?: Set<string>;
@@ -134,4 +133,4 @@ declare function isValidResourceId(id: string): boolean;
134
133
  */
135
134
  declare function generateIdFromName(name: string): string;
136
135
 
137
- export { type A2AMessageMetadata, A2AMessageMetadataSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, GraphWithinContextOfProjectSchema, type TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences };
136
+ export { type A2AMessageMetadata, A2AMessageMetadataSchema, AgentWithinContextOfProjectSchema, type DataOperationDetails, DataOperationDetailsSchema, type DataOperationEvent, DataOperationEventSchema, type DelegationReturnedData, DelegationReturnedDataSchema, type DelegationSentData, DelegationSentDataSchema, type TransferData, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences };
@@ -1,2 +1,2 @@
1
- export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from '../chunk-JTHQYGCX.js';
2
- export { AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SandboxConfigSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationQuerySchema, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphSubAgentIdParamsSchema, TenantProjectGraphSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from '../chunk-E4SFK6AI.js';
1
+ export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences } from '../chunk-4FMDWUE4.js';
2
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SandboxConfigSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from '../chunk-VICWT3WO.js';
@@ -0,0 +1,227 @@
1
+ ALTER TABLE `agent_graph` RENAME TO `agent`;--> statement-breakpoint
2
+ ALTER TABLE `agent` RENAME COLUMN "graph_prompt" TO "prompt";--> statement-breakpoint
3
+ PRAGMA foreign_keys=OFF;--> statement-breakpoint
4
+ CREATE TABLE `__new_agent` (
5
+ `tenant_id` text NOT NULL,
6
+ `id` text NOT NULL,
7
+ `project_id` text NOT NULL,
8
+ `name` text NOT NULL,
9
+ `description` text,
10
+ `default_sub_agent_id` text,
11
+ `context_config_id` text,
12
+ `models` text,
13
+ `status_updates` text,
14
+ `prompt` text,
15
+ `stop_when` text,
16
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
17
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
18
+ PRIMARY KEY(`tenant_id`, `project_id`, `id`),
19
+ FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade
20
+ );
21
+ --> statement-breakpoint
22
+ INSERT INTO `__new_agent`("tenant_id", "id", "project_id", "name", "description", "default_sub_agent_id", "context_config_id", "models", "status_updates", "prompt", "stop_when", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "name", "description", "default_sub_agent_id", "context_config_id", "models", "status_updates", "prompt", "stop_when", "created_at", "updated_at" FROM `agent`;--> statement-breakpoint
23
+ DROP TABLE `agent`;--> statement-breakpoint
24
+ ALTER TABLE `__new_agent` RENAME TO `agent`;--> statement-breakpoint
25
+ CREATE TABLE `__new_agent_function_tool_relations` (
26
+ `tenant_id` text NOT NULL,
27
+ `id` text NOT NULL,
28
+ `project_id` text NOT NULL,
29
+ `agent_id` text NOT NULL,
30
+ `sub_agent_id` text NOT NULL,
31
+ `function_tool_id` text NOT NULL,
32
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
33
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
34
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
35
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
36
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`function_tool_id`) REFERENCES `function_tools`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade
37
+ );
38
+ --> statement-breakpoint
39
+ INSERT INTO `__new_agent_function_tool_relations`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "function_tool_id", "created_at", "updated_at" FROM `agent_function_tool_relations`;--> statement-breakpoint
40
+ DROP TABLE `agent_function_tool_relations`;--> statement-breakpoint
41
+ ALTER TABLE `__new_agent_function_tool_relations` RENAME TO `agent_function_tool_relations`;--> statement-breakpoint
42
+ CREATE TABLE `__new_api_keys` (
43
+ `tenant_id` text NOT NULL,
44
+ `id` text NOT NULL,
45
+ `project_id` text NOT NULL,
46
+ `agent_id` text NOT NULL,
47
+ `public_id` text NOT NULL,
48
+ `key_hash` text NOT NULL,
49
+ `key_prefix` text NOT NULL,
50
+ `name` text,
51
+ `last_used_at` text,
52
+ `expires_at` text,
53
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
54
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
55
+ FOREIGN KEY (`tenant_id`,`project_id`) REFERENCES `projects`(`tenant_id`,`id`) ON UPDATE no action ON DELETE cascade,
56
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
57
+ );
58
+ --> statement-breakpoint
59
+ INSERT INTO `__new_api_keys`("tenant_id", "id", "project_id", "agent_id", "public_id", "key_hash", "key_prefix", "name", "last_used_at", "expires_at", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "public_id", "key_hash", "key_prefix", "name", "last_used_at", "expires_at", "created_at", "updated_at" FROM `api_keys`;--> statement-breakpoint
60
+ DROP TABLE `api_keys`;--> statement-breakpoint
61
+ ALTER TABLE `__new_api_keys` RENAME TO `api_keys`;--> statement-breakpoint
62
+ CREATE UNIQUE INDEX `api_keys_public_id_unique` ON `api_keys` (`public_id`);--> statement-breakpoint
63
+ CREATE INDEX `api_keys_tenant_agent_idx` ON `api_keys` (`tenant_id`,`agent_id`);--> statement-breakpoint
64
+ CREATE INDEX `api_keys_prefix_idx` ON `api_keys` (`key_prefix`);--> statement-breakpoint
65
+ CREATE INDEX `api_keys_public_id_idx` ON `api_keys` (`public_id`);--> statement-breakpoint
66
+ CREATE TABLE `__new_context_configs` (
67
+ `tenant_id` text NOT NULL,
68
+ `id` text NOT NULL,
69
+ `project_id` text NOT NULL,
70
+ `agent_id` text NOT NULL,
71
+ `headers_schema` blob,
72
+ `context_variables` blob,
73
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
74
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
75
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
76
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
77
+ );
78
+ --> statement-breakpoint
79
+ INSERT INTO `__new_context_configs`("tenant_id", "id", "project_id", "agent_id", "headers_schema", "context_variables", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "headers_schema", "context_variables", "created_at", "updated_at" FROM `context_configs`;--> statement-breakpoint
80
+ DROP TABLE `context_configs`;--> statement-breakpoint
81
+ ALTER TABLE `__new_context_configs` RENAME TO `context_configs`;--> statement-breakpoint
82
+ CREATE TABLE `__new_external_agents` (
83
+ `tenant_id` text NOT NULL,
84
+ `id` text NOT NULL,
85
+ `project_id` text NOT NULL,
86
+ `agent_id` text NOT NULL,
87
+ `name` text NOT NULL,
88
+ `description` text NOT NULL,
89
+ `base_url` text NOT NULL,
90
+ `credential_reference_id` text,
91
+ `headers` blob,
92
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
93
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
94
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
95
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade,
96
+ FOREIGN KEY (`tenant_id`,`project_id`,`credential_reference_id`) REFERENCES `credential_references`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE set null
97
+ );
98
+ --> statement-breakpoint
99
+ INSERT INTO `__new_external_agents`("tenant_id", "id", "project_id", "agent_id", "name", "description", "base_url", "credential_reference_id", "headers", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "base_url", "credential_reference_id", "headers", "created_at", "updated_at" FROM `external_agents`;--> statement-breakpoint
100
+ DROP TABLE `external_agents`;--> statement-breakpoint
101
+ ALTER TABLE `__new_external_agents` RENAME TO `external_agents`;--> statement-breakpoint
102
+ CREATE TABLE `__new_function_tools` (
103
+ `tenant_id` text NOT NULL,
104
+ `id` text NOT NULL,
105
+ `project_id` text NOT NULL,
106
+ `agent_id` text NOT NULL,
107
+ `name` text NOT NULL,
108
+ `description` text,
109
+ `function_id` text NOT NULL,
110
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
111
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
112
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
113
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade,
114
+ FOREIGN KEY (`tenant_id`,`project_id`,`function_id`) REFERENCES `functions`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
115
+ );
116
+ --> statement-breakpoint
117
+ INSERT INTO `__new_function_tools`("tenant_id", "id", "project_id", "agent_id", "name", "description", "function_id", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "function_id", "created_at", "updated_at" FROM `function_tools`;--> statement-breakpoint
118
+ DROP TABLE `function_tools`;--> statement-breakpoint
119
+ ALTER TABLE `__new_function_tools` RENAME TO `function_tools`;--> statement-breakpoint
120
+ CREATE TABLE `__new_sub_agent_artifact_components` (
121
+ `tenant_id` text NOT NULL,
122
+ `id` text NOT NULL,
123
+ `project_id` text NOT NULL,
124
+ `agent_id` text NOT NULL,
125
+ `sub_agent_id` text NOT NULL,
126
+ `artifact_component_id` text NOT NULL,
127
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
128
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `sub_agent_id`, `id`),
129
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
130
+ FOREIGN KEY (`tenant_id`,`project_id`,`artifact_component_id`) REFERENCES `artifact_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
131
+ );
132
+ --> statement-breakpoint
133
+ INSERT INTO `__new_sub_agent_artifact_components`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "artifact_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "artifact_component_id", "created_at" FROM `sub_agent_artifact_components`;--> statement-breakpoint
134
+ DROP TABLE `sub_agent_artifact_components`;--> statement-breakpoint
135
+ ALTER TABLE `__new_sub_agent_artifact_components` RENAME TO `sub_agent_artifact_components`;--> statement-breakpoint
136
+ CREATE TABLE `__new_sub_agent_data_components` (
137
+ `tenant_id` text NOT NULL,
138
+ `id` text NOT NULL,
139
+ `project_id` text NOT NULL,
140
+ `agent_id` text NOT NULL,
141
+ `sub_agent_id` text NOT NULL,
142
+ `data_component_id` text NOT NULL,
143
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
144
+ PRIMARY KEY(`tenant_id`, `project_id`, `id`),
145
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
146
+ FOREIGN KEY (`tenant_id`,`project_id`,`data_component_id`) REFERENCES `data_components`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
147
+ );
148
+ --> statement-breakpoint
149
+ INSERT INTO `__new_sub_agent_data_components`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "data_component_id", "created_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "data_component_id", "created_at" FROM `sub_agent_data_components`;--> statement-breakpoint
150
+ DROP TABLE `sub_agent_data_components`;--> statement-breakpoint
151
+ ALTER TABLE `__new_sub_agent_data_components` RENAME TO `sub_agent_data_components`;--> statement-breakpoint
152
+ CREATE TABLE `__new_sub_agent_relations` (
153
+ `tenant_id` text NOT NULL,
154
+ `id` text NOT NULL,
155
+ `project_id` text NOT NULL,
156
+ `agent_id` text NOT NULL,
157
+ `source_sub_agent_id` text NOT NULL,
158
+ `target_sub_agent_id` text,
159
+ `external_sub_agent_id` text,
160
+ `relation_type` text,
161
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
162
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
163
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
164
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
165
+ );
166
+ --> statement-breakpoint
167
+ INSERT INTO `__new_sub_agent_relations`("tenant_id", "id", "project_id", "agent_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "source_sub_agent_id", "target_sub_agent_id", "external_sub_agent_id", "relation_type", "created_at", "updated_at" FROM `sub_agent_relations`;--> statement-breakpoint
168
+ DROP TABLE `sub_agent_relations`;--> statement-breakpoint
169
+ ALTER TABLE `__new_sub_agent_relations` RENAME TO `sub_agent_relations`;--> statement-breakpoint
170
+ CREATE TABLE `__new_sub_agent_tool_relations` (
171
+ `tenant_id` text NOT NULL,
172
+ `id` text NOT NULL,
173
+ `project_id` text NOT NULL,
174
+ `agent_id` text NOT NULL,
175
+ `sub_agent_id` text NOT NULL,
176
+ `tool_id` text NOT NULL,
177
+ `selected_tools` blob,
178
+ `headers` blob,
179
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
180
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
181
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
182
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade,
183
+ FOREIGN KEY (`tenant_id`,`project_id`,`tool_id`) REFERENCES `tools`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
184
+ );
185
+ --> statement-breakpoint
186
+ INSERT INTO `__new_sub_agent_tool_relations`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "tool_id", "selected_tools", "headers", "created_at", "updated_at" FROM `sub_agent_tool_relations`;--> statement-breakpoint
187
+ DROP TABLE `sub_agent_tool_relations`;--> statement-breakpoint
188
+ ALTER TABLE `__new_sub_agent_tool_relations` RENAME TO `sub_agent_tool_relations`;--> statement-breakpoint
189
+ CREATE TABLE `__new_sub_agents` (
190
+ `tenant_id` text NOT NULL,
191
+ `id` text NOT NULL,
192
+ `project_id` text NOT NULL,
193
+ `agent_id` text NOT NULL,
194
+ `name` text NOT NULL,
195
+ `description` text NOT NULL,
196
+ `prompt` text NOT NULL,
197
+ `conversation_history_config` text,
198
+ `models` text,
199
+ `stop_when` text,
200
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
201
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
202
+ PRIMARY KEY(`tenant_id`, `project_id`, `agent_id`, `id`),
203
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`) REFERENCES `agent`(`tenant_id`,`project_id`,`id`) ON UPDATE no action ON DELETE cascade
204
+ );
205
+ --> statement-breakpoint
206
+ INSERT INTO `__new_sub_agents`("tenant_id", "id", "project_id", "agent_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "name", "description", "prompt", "conversation_history_config", "models", "stop_when", "created_at", "updated_at" FROM `sub_agents`;--> statement-breakpoint
207
+ DROP TABLE `sub_agents`;--> statement-breakpoint
208
+ ALTER TABLE `__new_sub_agents` RENAME TO `sub_agents`;--> statement-breakpoint
209
+ CREATE TABLE `__new_tasks` (
210
+ `tenant_id` text NOT NULL,
211
+ `id` text NOT NULL,
212
+ `project_id` text NOT NULL,
213
+ `agent_id` text NOT NULL,
214
+ `sub_agent_id` text NOT NULL,
215
+ `context_id` text NOT NULL,
216
+ `status` text NOT NULL,
217
+ `metadata` blob,
218
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
219
+ `updated_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
220
+ PRIMARY KEY(`tenant_id`, `project_id`, `id`),
221
+ FOREIGN KEY (`tenant_id`,`project_id`,`agent_id`,`sub_agent_id`) REFERENCES `sub_agents`(`tenant_id`,`project_id`,`agent_id`,`id`) ON UPDATE no action ON DELETE cascade
222
+ );
223
+ --> statement-breakpoint
224
+ INSERT INTO `__new_tasks`("tenant_id", "id", "project_id", "agent_id", "sub_agent_id", "context_id", "status", "metadata", "created_at", "updated_at") SELECT "tenant_id", "id", "project_id", "graph_id", "sub_agent_id", "context_id", "status", "metadata", "created_at", "updated_at" FROM `tasks`;--> statement-breakpoint
225
+ DROP TABLE `tasks`;--> statement-breakpoint
226
+ ALTER TABLE `__new_tasks` RENAME TO `tasks`;--> statement-breakpoint
227
+ PRAGMA foreign_keys=ON;