@inkeep/agents-core 0.18.1 → 0.19.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.
- package/README.md +4 -4
- package/dist/{chunk-E4SFK6AI.js → chunk-3GZBRBXP.js} +84 -87
- package/dist/{chunk-JTHQYGCX.js → chunk-3XUV5Q4D.js} +34 -34
- package/dist/{chunk-ID4CFGVF.js → chunk-B6F3RF4T.js} +87 -120
- package/dist/chunk-E6R6PML7.js +19 -0
- package/dist/chunk-HYS7HUYJ.js +27 -0
- package/dist/{chunk-H6PMWHNV.js → chunk-SLL6V3AE.js} +12 -12
- package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
- package/dist/client-exports.cjs +189 -225
- package/dist/client-exports.d.cts +13 -14
- package/dist/client-exports.d.ts +13 -14
- package/dist/client-exports.js +10 -10
- package/dist/constants/models.cjs +31 -0
- package/dist/constants/models.d.cts +33 -0
- package/dist/constants/models.d.ts +33 -0
- package/dist/constants/models.js +1 -0
- package/dist/db/schema.cjs +85 -118
- package/dist/db/schema.d.cts +2 -3
- package/dist/db/schema.d.ts +2 -3
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +213931 -1040
- package/dist/index.d.cts +209 -208
- package/dist/index.d.ts +209 -208
- package/dist/index.js +213657 -767
- package/dist/{schema-ULFEZCOL.d.cts → schema-Dp-qgdBT.d.ts} +54 -52
- package/dist/{schema-wbZXiVWb.d.ts → schema-DrDaCn6H.d.cts} +54 -52
- package/dist/{signoz-queries-BuiipZTk.d.cts → signoz-queries-CuWMQh1H.d.cts} +10 -10
- package/dist/{signoz-queries-BuiipZTk.d.ts → signoz-queries-CuWMQh1H.d.ts} +10 -10
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/dist/{utility-CyPQ1tC_.d.cts → utility-BxbySenH.d.cts} +152 -301
- package/dist/{utility-CyPQ1tC_.d.ts → utility-BxbySenH.d.ts} +152 -301
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.cjs +212 -249
- package/dist/validation/index.d.cts +12 -13
- package/dist/validation/index.d.ts +12 -13
- package/dist/validation/index.js +2 -2
- package/drizzle/0007_mighty_typhoid_mary.sql +227 -0
- package/drizzle/meta/0007_snapshot.json +2766 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +6 -1
- package/dist/chunk-MKBO26DX.js +0 -9
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { d6 as
|
|
3
|
-
export { dY as
|
|
2
|
+
import { d6 as SubAgentDefinition, d5 as InternalSubAgentDefinition, cM as ExternalSubAgentApiInsert, fP as AgentWithinContextOfProjectSchema, B as FullAgentDefinition } from '../utility-BxbySenH.cjs';
|
|
3
|
+
export { dY as AgentApiInsertSchema, dX as AgentApiSelectSchema, dZ as AgentApiUpdateSchema, dV as AgentInsertSchema, 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, 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, fT as ErrorResponseSchema, fU 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 FullAgentAgentInsertSchema, g0 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k 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, g1 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, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, ga as PaginationQueryParamsSchema, fQ as PaginationSchema, f_ as ProjectApiInsertSchema, fZ as ProjectApiSelectSchema, f$ as ProjectApiUpdateSchema, fX as ProjectInsertSchema, dB as ProjectModelSchema, 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, 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, f as SubAgentStopWhen, c 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, g3 as TenantIdParamsSchema, g2 as TenantParamsSchema, g7 as TenantProjectAgentIdParamsSchema, g6 as TenantProjectAgentParamsSchema, g9 as TenantProjectAgentSubAgentIdParamsSchema, g8 as TenantProjectAgentSubAgentParamsSchema, g5 as TenantProjectIdParamsSchema, g4 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-BxbySenH.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:
|
|
83
|
-
declare function isExternalAgent(agent:
|
|
84
|
-
declare function
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
103
|
+
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
105
104
|
/**
|
|
106
|
-
* Validates the
|
|
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
|
|
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,
|
|
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
|
|
3
|
-
export { dY as
|
|
2
|
+
import { d6 as SubAgentDefinition, d5 as InternalSubAgentDefinition, cM as ExternalSubAgentApiInsert, fP as AgentWithinContextOfProjectSchema, B as FullAgentDefinition } from '../utility-BxbySenH.js';
|
|
3
|
+
export { dY as AgentApiInsertSchema, dX as AgentApiSelectSchema, dZ as AgentApiUpdateSchema, dV as AgentInsertSchema, 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, 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, fT as ErrorResponseSchema, fU 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 FullAgentAgentInsertSchema, g0 as FullProjectDefinitionSchema, F as FunctionApiInsertSchema, j as FunctionApiSelectSchema, k 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, g1 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, el as MessageSelectSchema, en as MessageUpdateSchema, dA as ModelSchema, g as ModelSettings, M as ModelSettingsSchema, ga as PaginationQueryParamsSchema, fQ as PaginationSchema, f_ as ProjectApiInsertSchema, fZ as ProjectApiSelectSchema, f$ as ProjectApiUpdateSchema, fX as ProjectInsertSchema, dB as ProjectModelSchema, 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, 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, f as SubAgentStopWhen, c 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, g3 as TenantIdParamsSchema, g2 as TenantParamsSchema, g7 as TenantProjectAgentIdParamsSchema, g6 as TenantProjectAgentParamsSchema, g9 as TenantProjectAgentSubAgentIdParamsSchema, g8 as TenantProjectAgentSubAgentParamsSchema, g5 as TenantProjectIdParamsSchema, g4 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-BxbySenH.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:
|
|
83
|
-
declare function isExternalAgent(agent:
|
|
84
|
-
declare function
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
103
|
+
declare function validateAgentRelationships(agentData: FullAgentDefinition): void;
|
|
105
104
|
/**
|
|
106
|
-
* Validates the
|
|
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
|
|
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,
|
|
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 };
|
package/dist/validation/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships,
|
|
2
|
-
export {
|
|
1
|
+
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences } from '../chunk-3XUV5Q4D.js';
|
|
2
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, 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, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, 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, 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, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema, validatePropsAsJsonSchema } from '../chunk-3GZBRBXP.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;
|