@inkeep/agents-core 0.51.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/auth/auth-schema.d.ts +107 -107
  2. package/dist/auth/auth-validation-schemas.d.ts +152 -152
  3. package/dist/auth/auth.d.ts +57 -57
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/client-exports.d.ts +6 -12
  6. package/dist/data-access/manage/agentFull.d.ts +2 -1
  7. package/dist/data-access/manage/agents.d.ts +22 -21
  8. package/dist/data-access/manage/artifactComponents.d.ts +8 -7
  9. package/dist/data-access/manage/contextConfigs.d.ts +10 -9
  10. package/dist/data-access/manage/credentialReferences.d.ts +2 -1
  11. package/dist/data-access/manage/dataComponents.d.ts +4 -3
  12. package/dist/data-access/manage/evalConfig.d.ts +2 -1
  13. package/dist/data-access/manage/externalAgents.d.ts +2 -1
  14. package/dist/data-access/manage/functionTools.d.ts +14 -14
  15. package/dist/data-access/manage/functions.d.ts +2 -2
  16. package/dist/data-access/manage/projectFull.d.ts +2 -1
  17. package/dist/data-access/manage/projects.d.ts +2 -1
  18. package/dist/data-access/manage/scheduledTriggers.d.ts +2 -2
  19. package/dist/data-access/manage/scheduledWorkflows.d.ts +2 -2
  20. package/dist/data-access/manage/scope-helpers.d.ts +15 -22
  21. package/dist/data-access/manage/scope-helpers.js +15 -12
  22. package/dist/data-access/manage/skills.d.ts +15 -14
  23. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +26 -25
  24. package/dist/data-access/manage/subAgentRelations.d.ts +22 -21
  25. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +20 -19
  26. package/dist/data-access/manage/subAgents.d.ts +14 -13
  27. package/dist/data-access/manage/tools.d.ts +23 -22
  28. package/dist/data-access/manage/triggers.d.ts +4 -4
  29. package/dist/data-access/runtime/apiKeys.d.ts +14 -13
  30. package/dist/data-access/runtime/cascade-delete.d.ts +1 -1
  31. package/dist/data-access/runtime/contextCache.d.ts +2 -2
  32. package/dist/data-access/runtime/conversations.d.ts +26 -25
  33. package/dist/data-access/runtime/evalRuns.d.ts +2 -1
  34. package/dist/data-access/runtime/ledgerArtifacts.d.ts +1 -1
  35. package/dist/data-access/runtime/messages.d.ts +11 -10
  36. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +2 -2
  37. package/dist/data-access/runtime/tasks.d.ts +7 -7
  38. package/dist/data-access/runtime/triggerInvocations.d.ts +2 -2
  39. package/dist/db/manage/manage-schema.d.ts +449 -449
  40. package/dist/db/manage/manage-schema.js +1 -1
  41. package/dist/db/manage/scope-definitions.d.ts +31 -0
  42. package/dist/db/manage/scope-definitions.js +31 -0
  43. package/dist/db/runtime/runtime-schema.d.ts +290 -290
  44. package/dist/dolt/branches-api.d.ts +2 -1
  45. package/dist/index.d.ts +5 -3
  46. package/dist/index.js +3 -2
  47. package/dist/setup/setup.js +52 -14
  48. package/dist/types/index.d.ts +2 -1
  49. package/dist/types/utility.d.ts +2 -11
  50. package/dist/utils/error.d.ts +3 -1
  51. package/dist/utils/error.js +11 -1
  52. package/dist/utils/index.d.ts +3 -2
  53. package/dist/utils/index.js +3 -2
  54. package/dist/utils/retry.d.ts +8 -0
  55. package/dist/utils/retry.js +30 -0
  56. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  57. package/dist/validation/schemas.d.ts +1791 -1821
  58. package/dist/validation/schemas.js +2 -1
  59. package/drizzle/manage/0010_oval_angel.sql +2 -0
  60. package/drizzle/manage/meta/0010_snapshot.json +3673 -0
  61. package/drizzle/manage/meta/_journal.json +7 -0
  62. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
- import { PaginationConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig, SubAgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import "../../types/index.js";
3
4
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
4
5
  import { DataComponentInsert, DataComponentSelect, DataComponentUpdate } from "../../types/entities.js";
@@ -65,10 +66,10 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
65
66
  dataComponentId: string;
66
67
  }) => Promise<{
67
68
  id: string;
69
+ createdAt: string;
68
70
  tenantId: string;
69
71
  projectId: string;
70
72
  agentId: string;
71
- createdAt: string;
72
73
  subAgentId: string;
73
74
  dataComponentId: string;
74
75
  }>;
@@ -107,10 +108,10 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
107
108
  dataComponentId: string;
108
109
  }) => Promise<{
109
110
  id: string;
111
+ createdAt: string;
110
112
  tenantId: string;
111
113
  projectId: string;
112
114
  agentId: string;
113
- createdAt: string;
114
115
  subAgentId: string;
115
116
  dataComponentId: string;
116
117
  } | null>;
@@ -1,4 +1,5 @@
1
- import { ProjectScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
4
5
  import { DatasetInsert, DatasetItemInsert, DatasetItemSelect, DatasetItemUpdate, DatasetRunConfigAgentRelationInsert, DatasetRunConfigAgentRelationSelect, DatasetRunConfigInsert, DatasetRunConfigSelect, DatasetRunConfigUpdate, DatasetSelect, DatasetUpdate, EvaluationJobConfigEvaluatorRelationInsert, EvaluationJobConfigEvaluatorRelationSelect, EvaluationJobConfigInsert, EvaluationJobConfigSelect, EvaluationRunConfigEvaluationSuiteConfigRelationInsert, EvaluationRunConfigEvaluationSuiteConfigRelationSelect, EvaluationRunConfigInsert, EvaluationRunConfigSelect, EvaluationRunConfigUpdate, EvaluationRunConfigWithSuiteConfigs, EvaluationSuiteConfigEvaluatorRelationInsert, EvaluationSuiteConfigEvaluatorRelationSelect, EvaluationSuiteConfigInsert, EvaluationSuiteConfigSelect, EvaluationSuiteConfigUpdate, EvaluatorInsert, EvaluatorSelect, EvaluatorUpdate } from "../../types/entities.js";
@@ -1,4 +1,5 @@
1
- import { PaginationConfig, ProjectScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import "../../types/index.js";
3
4
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
4
5
  import { ExternalAgentInsert, ExternalAgentSelect, ExternalAgentUpdate } from "../../types/entities.js";
@@ -1,9 +1,9 @@
1
- import { AgentScopeConfig, PaginationConfig } from "../../types/utility.js";
1
+ import { AgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { FunctionToolApiInsert, FunctionToolApiUpdate } from "../../types/entities.js";
4
5
 
5
6
  //#region src/data-access/manage/functionTools.d.ts
6
-
7
7
  /**
8
8
  * Get a function tool by ID (agent-scoped)
9
9
  */
@@ -55,12 +55,12 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
55
55
  }) => Promise<{
56
56
  id: string;
57
57
  name: string;
58
+ createdAt: string;
59
+ updatedAt: string;
58
60
  description: string | null;
59
61
  tenantId: string;
60
62
  projectId: string;
61
63
  agentId: string;
62
- createdAt: string;
63
- updatedAt: string;
64
64
  functionId: string;
65
65
  }>;
66
66
  /**
@@ -97,12 +97,12 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
97
97
  }) => Promise<{
98
98
  id: string;
99
99
  name: string;
100
+ createdAt: string;
101
+ updatedAt: string;
100
102
  description: string | null;
101
103
  tenantId: string;
102
104
  projectId: string;
103
105
  agentId: string;
104
- createdAt: string;
105
- updatedAt: string;
106
106
  functionId: string;
107
107
  }>;
108
108
  declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -162,16 +162,16 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
162
162
  }> | null;
163
163
  }) => Promise<{
164
164
  id: string;
165
+ createdAt: string;
166
+ updatedAt: string;
165
167
  tenantId: string;
166
168
  projectId: string;
167
169
  agentId: string;
168
- createdAt: string;
169
- updatedAt: string;
170
+ subAgentId: string;
171
+ functionToolId: string;
170
172
  toolPolicies: Record<string, {
171
173
  needsApproval?: boolean;
172
174
  }> | null;
173
- subAgentId: string;
174
- functionToolId: string;
175
175
  }>;
176
176
  /**
177
177
  * Update an agent-function tool relation
@@ -227,16 +227,16 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
227
227
  }> | null;
228
228
  }) => Promise<{
229
229
  id: string;
230
+ createdAt: string;
231
+ updatedAt: string;
230
232
  tenantId: string;
231
233
  projectId: string;
232
234
  agentId: string;
233
- createdAt: string;
234
- updatedAt: string;
235
+ subAgentId: string;
236
+ functionToolId: string;
235
237
  toolPolicies: Record<string, {
236
238
  needsApproval?: boolean;
237
239
  }> | null;
238
- subAgentId: string;
239
- functionToolId: string;
240
240
  }>;
241
241
  //#endregion
242
242
  export { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation };
@@ -1,9 +1,9 @@
1
- import { PaginationConfig, ProjectScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { FunctionApiInsert } from "../../types/entities.js";
4
5
 
5
6
  //#region src/data-access/manage/functions.d.ts
6
-
7
7
  /**
8
8
  * Create or update a function (project-scoped)
9
9
  */
@@ -1,4 +1,5 @@
1
- import { ProjectScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import "../../types/utility.js";
2
3
  import { getLogger } from "../../utils/logger.js";
3
4
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
4
5
  import { FullProjectDefinition, FullProjectSelect, FullProjectSelectWithRelationIds } from "../../types/entities.js";
@@ -1,4 +1,5 @@
1
- import { PaginationConfig, PaginationResult, ProjectInfo, ProjectResourceCounts, ProjectScopeConfig } from "../../types/utility.js";
1
+ import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig, PaginationResult, ProjectInfo, ProjectResourceCounts } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { ProjectInsert, ProjectSelect, ProjectUpdate } from "../../types/entities.js";
4
5
 
@@ -1,9 +1,9 @@
1
- import { AgentScopeConfig, PaginationConfig } from "../../types/utility.js";
1
+ import { AgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { ScheduledTrigger, ScheduledTriggerInsert, ScheduledTriggerUpdate } from "../../validation/schemas.js";
4
5
 
5
6
  //#region src/data-access/manage/scheduledTriggers.d.ts
6
-
7
7
  /**
8
8
  * Get a scheduled trigger by ID (agent-scoped)
9
9
  */
@@ -1,9 +1,9 @@
1
- import { AgentScopeConfig } from "../../types/utility.js";
1
+ import { AgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { ScheduledWorkflow, ScheduledWorkflowInsert } from "../../validation/schemas.js";
4
5
 
5
6
  //#region src/data-access/manage/scheduledWorkflows.d.ts
6
-
7
7
  /**
8
8
  * Get a scheduled workflow by trigger ID (agent-scoped)
9
9
  */
@@ -1,25 +1,18 @@
1
- import { AgentScopeConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../types/utility.js";
2
- import * as drizzle_orm0 from "drizzle-orm";
1
+ import { ScopeConfig, ScopeLevel, ScopedTable } from "../../db/manage/scope-definitions.js";
2
+ import { SQL } from "drizzle-orm";
3
3
 
4
4
  //#region src/data-access/manage/scope-helpers.d.ts
5
- type TenantScopeConfig = {
6
- tenantId: string;
7
- };
8
- type TenantScopedColumns = {
9
- tenantId: any;
10
- };
11
- type ProjectScopedColumns = TenantScopedColumns & {
12
- projectId: any;
13
- };
14
- type AgentScopedColumns = ProjectScopedColumns & {
15
- agentId: any;
16
- };
17
- type SubAgentScopedColumns = AgentScopedColumns & {
18
- subAgentId: any;
19
- };
20
- declare function tenantScopedWhere<T extends TenantScopedColumns>(table: T, scopes: TenantScopeConfig): drizzle_orm0.SQL<unknown>;
21
- declare function projectScopedWhere<T extends ProjectScopedColumns>(table: T, scopes: ProjectScopeConfig): drizzle_orm0.SQL<unknown> | undefined;
22
- declare function agentScopedWhere<T extends AgentScopedColumns>(table: T, scopes: AgentScopeConfig): drizzle_orm0.SQL<unknown> | undefined;
23
- declare function subAgentScopedWhere<T extends SubAgentScopedColumns>(table: T, scopes: SubAgentScopeConfig): drizzle_orm0.SQL<unknown> | undefined;
5
+
6
+ /**
7
+ * Build a WHERE clause that filters by all scope columns for the given level.
8
+ *
9
+ * The columns and config shape are both derived from `SCOPE_KEYS` in
10
+ * `scope-definitions.ts`, so they cannot drift apart.
11
+ */
12
+ declare function scopedWhere<L extends ScopeLevel>(level: L, table: ScopedTable<L>, scopes: ScopeConfig<L>): SQL | undefined;
13
+ declare const tenantScopedWhere: <T extends ScopedTable<"tenant">>(table: T, scopes: ScopeConfig<"tenant">) => SQL<unknown> | undefined;
14
+ declare const projectScopedWhere: <T extends ScopedTable<"project">>(table: T, scopes: ScopeConfig<"project">) => SQL<unknown> | undefined;
15
+ declare const agentScopedWhere: <T extends ScopedTable<"agent">>(table: T, scopes: ScopeConfig<"agent">) => SQL<unknown> | undefined;
16
+ declare const subAgentScopedWhere: <T extends ScopedTable<"subAgent">>(table: T, scopes: ScopeConfig<"subAgent">) => SQL<unknown> | undefined;
24
17
  //#endregion
25
- export { agentScopedWhere, projectScopedWhere, subAgentScopedWhere, tenantScopedWhere };
18
+ export { agentScopedWhere, projectScopedWhere, scopedWhere, subAgentScopedWhere, tenantScopedWhere };
@@ -1,18 +1,21 @@
1
+ import { SCOPE_KEYS } from "../../db/manage/scope-definitions.js";
1
2
  import { and, eq } from "drizzle-orm";
2
3
 
3
4
  //#region src/data-access/manage/scope-helpers.ts
4
- function tenantScopedWhere(table, scopes) {
5
- return eq(table.tenantId, scopes.tenantId);
6
- }
7
- function projectScopedWhere(table, scopes) {
8
- return and(eq(table.tenantId, scopes.tenantId), eq(table.projectId, scopes.projectId));
9
- }
10
- function agentScopedWhere(table, scopes) {
11
- return and(eq(table.tenantId, scopes.tenantId), eq(table.projectId, scopes.projectId), eq(table.agentId, scopes.agentId));
12
- }
13
- function subAgentScopedWhere(table, scopes) {
14
- return and(eq(table.tenantId, scopes.tenantId), eq(table.projectId, scopes.projectId), eq(table.agentId, scopes.agentId), eq(table.subAgentId, scopes.subAgentId));
5
+ /**
6
+ * Build a WHERE clause that filters by all scope columns for the given level.
7
+ *
8
+ * The columns and config shape are both derived from `SCOPE_KEYS` in
9
+ * `scope-definitions.ts`, so they cannot drift apart.
10
+ */
11
+ function scopedWhere(level, table, scopes) {
12
+ const conditions = SCOPE_KEYS[level].map((key) => eq(table[key], scopes[key]));
13
+ return conditions.length === 1 ? conditions[0] : and(...conditions);
15
14
  }
15
+ const tenantScopedWhere = (table, scopes) => scopedWhere("tenant", table, scopes);
16
+ const projectScopedWhere = (table, scopes) => scopedWhere("project", table, scopes);
17
+ const agentScopedWhere = (table, scopes) => scopedWhere("agent", table, scopes);
18
+ const subAgentScopedWhere = (table, scopes) => scopedWhere("subAgent", table, scopes);
16
19
 
17
20
  //#endregion
18
- export { agentScopedWhere, projectScopedWhere, subAgentScopedWhere, tenantScopedWhere };
21
+ export { agentScopedWhere, projectScopedWhere, scopedWhere, subAgentScopedWhere, tenantScopedWhere };
@@ -1,4 +1,5 @@
1
- import { AgentScopeConfig, PaginationConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../types/utility.js";
1
+ import { AgentScopeConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { PaginationConfig } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import { SkillInsert, SkillUpdate, SubAgentSkillWithIndex } from "../../types/entities.js";
4
5
 
@@ -9,12 +10,12 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
9
10
  }) => Promise<{
10
11
  id: string;
11
12
  name: string;
12
- description: string;
13
- tenantId: string;
14
- projectId: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
17
15
  metadata: Record<string, string> | null;
16
+ description: string;
17
+ tenantId: string;
18
+ projectId: string;
18
19
  content: string;
19
20
  } | null>;
20
21
  declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
@@ -42,23 +43,23 @@ declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
42
43
  declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
43
44
  id: string;
44
45
  name: string;
45
- description: string;
46
- tenantId: string;
47
- projectId: string;
48
46
  createdAt: string;
49
47
  updatedAt: string;
50
48
  metadata: Record<string, string> | null;
49
+ description: string;
50
+ tenantId: string;
51
+ projectId: string;
51
52
  content: string;
52
53
  }>;
53
54
  declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
54
55
  id: string;
55
56
  name: string;
56
- description: string;
57
- tenantId: string;
58
- projectId: string;
59
57
  createdAt: string;
60
58
  updatedAt: string;
61
59
  metadata: Record<string, string> | null;
60
+ description: string;
61
+ tenantId: string;
62
+ projectId: string;
62
63
  content: string;
63
64
  }>;
64
65
  declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
@@ -91,15 +92,15 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
91
92
  alwaysLoaded?: boolean;
92
93
  }) => Promise<{
93
94
  id: string;
95
+ createdAt: string;
96
+ updatedAt: string;
94
97
  tenantId: string;
95
98
  projectId: string;
96
99
  agentId: string;
97
- createdAt: string;
98
- updatedAt: string;
99
- index: number;
100
- alwaysLoaded: boolean;
101
100
  subAgentId: string;
102
101
  skillId: string;
102
+ index: number;
103
+ alwaysLoaded: boolean;
103
104
  }>;
104
105
  declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
105
106
  scopes: AgentScopeConfig;
@@ -1,4 +1,5 @@
1
- import { AgentScopeConfig, ConversationHistoryConfig, PaginationConfig, SubAgentScopeConfig } from "../../types/utility.js";
1
+ import { AgentScopeConfig, SubAgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { ConversationHistoryConfig, PaginationConfig } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import "../../index.js";
4
5
  import { SubAgentExternalAgentRelationInsert } from "../../types/entities.js";
@@ -9,14 +10,14 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
9
10
  relationId: string;
10
11
  }) => Promise<{
11
12
  id: string;
12
- tenantId: string;
13
- projectId: string;
14
- agentId: string;
15
13
  createdAt: string;
16
14
  updatedAt: string;
17
15
  headers: Record<string, string> | null;
18
- externalAgentId: string;
16
+ tenantId: string;
17
+ projectId: string;
18
+ agentId: string;
19
19
  subAgentId: string;
20
+ externalAgentId: string;
20
21
  } | undefined>;
21
22
  declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
22
23
  scopes: SubAgentScopeConfig;
@@ -44,27 +45,27 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
44
45
  scopes: SubAgentScopeConfig;
45
46
  }) => Promise<{
46
47
  id: string;
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
48
  createdAt: string;
51
49
  updatedAt: string;
52
50
  headers: Record<string, string> | null;
53
- externalAgentId: string;
51
+ tenantId: string;
52
+ projectId: string;
53
+ agentId: string;
54
54
  subAgentId: string;
55
+ externalAgentId: string;
55
56
  }[]>;
56
57
  declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
57
58
  scopes: AgentScopeConfig;
58
59
  }) => Promise<{
59
60
  id: string;
60
- tenantId: string;
61
- projectId: string;
62
- agentId: string;
63
61
  createdAt: string;
64
62
  updatedAt: string;
65
63
  headers: Record<string, string> | null;
66
- externalAgentId: string;
64
+ tenantId: string;
65
+ projectId: string;
66
+ agentId: string;
67
67
  subAgentId: string;
68
+ externalAgentId: string;
68
69
  }[]>;
69
70
  declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
70
71
  scopes: AgentScopeConfig;
@@ -180,14 +181,14 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
180
181
  };
181
182
  }) => Promise<{
182
183
  id: string;
183
- tenantId: string;
184
- projectId: string;
185
- agentId: string;
186
184
  createdAt: string;
187
185
  updatedAt: string;
188
186
  headers: Record<string, string> | null;
189
- externalAgentId: string;
187
+ tenantId: string;
188
+ projectId: string;
189
+ agentId: string;
190
190
  subAgentId: string;
191
+ externalAgentId: string;
191
192
  }>;
192
193
  /**
193
194
  * Check if sub-agent external agent relation exists by params
@@ -197,14 +198,14 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
197
198
  externalAgentId: string;
198
199
  }) => Promise<{
199
200
  id: string;
200
- tenantId: string;
201
- projectId: string;
202
- agentId: string;
203
201
  createdAt: string;
204
202
  updatedAt: string;
205
203
  headers: Record<string, string> | null;
206
- externalAgentId: string;
204
+ tenantId: string;
205
+ projectId: string;
206
+ agentId: string;
207
207
  subAgentId: string;
208
+ externalAgentId: string;
208
209
  } | undefined>;
209
210
  /**
210
211
  * Upsert sub-agent external agent relation (create if it doesn't exist, update if it does)
@@ -218,14 +219,14 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
218
219
  };
219
220
  }) => Promise<{
220
221
  id: string;
221
- tenantId: string;
222
- projectId: string;
223
- agentId: string;
224
222
  createdAt: string;
225
223
  updatedAt: string;
226
224
  headers: Record<string, string> | null;
227
- externalAgentId: string;
225
+ tenantId: string;
226
+ projectId: string;
227
+ agentId: string;
228
228
  subAgentId: string;
229
+ externalAgentId: string;
229
230
  }>;
230
231
  declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
231
232
  scopes: SubAgentScopeConfig;
@@ -1,4 +1,5 @@
1
- import { AgentScopeConfig, ConversationHistoryConfig, PaginationConfig, SubAgentScopeConfig, ToolMcpConfig, ToolServerCapabilities } from "../../types/utility.js";
1
+ import { AgentScopeConfig, SubAgentScopeConfig } from "../../db/manage/scope-definitions.js";
2
+ import { ConversationHistoryConfig, PaginationConfig, ToolMcpConfig, ToolServerCapabilities } from "../../types/utility.js";
2
3
  import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
3
4
  import "../../index.js";
4
5
  import { SubAgentRelationInsert, SubAgentRelationUpdate, SubAgentToolRelationUpdate } from "../../types/entities.js";
@@ -9,11 +10,11 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
9
10
  relationId: string;
10
11
  }) => Promise<{
11
12
  id: string;
13
+ createdAt: string;
14
+ updatedAt: string;
12
15
  tenantId: string;
13
16
  projectId: string;
14
17
  agentId: string;
15
- createdAt: string;
16
- updatedAt: string;
17
18
  sourceSubAgentId: string;
18
19
  targetSubAgentId: string | null;
19
20
  relationType: string | null;
@@ -44,11 +45,11 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
45
  scopes: SubAgentScopeConfig;
45
46
  }) => Promise<{
46
47
  id: string;
48
+ createdAt: string;
49
+ updatedAt: string;
47
50
  tenantId: string;
48
51
  projectId: string;
49
52
  agentId: string;
50
- createdAt: string;
51
- updatedAt: string;
52
53
  sourceSubAgentId: string;
53
54
  targetSubAgentId: string | null;
54
55
  relationType: string | null;
@@ -57,11 +58,11 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
57
58
  scopes: AgentScopeConfig;
58
59
  }) => Promise<{
59
60
  id: string;
61
+ createdAt: string;
62
+ updatedAt: string;
60
63
  tenantId: string;
61
64
  projectId: string;
62
65
  agentId: string;
63
- createdAt: string;
64
- updatedAt: string;
65
66
  sourceSubAgentId: string;
66
67
  targetSubAgentId: string | null;
67
68
  relationType: string | null;
@@ -126,11 +127,11 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
126
127
  }>;
127
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
128
129
  id: string;
130
+ createdAt: string;
131
+ updatedAt: string;
129
132
  tenantId: string;
130
133
  projectId: string;
131
134
  agentId: string;
132
- createdAt: string;
133
- updatedAt: string;
134
135
  sourceSubAgentId: string;
135
136
  targetSubAgentId: string | null;
136
137
  relationType: string | null;
@@ -145,11 +146,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
145
146
  relationType: string;
146
147
  }) => Promise<{
147
148
  id: string;
149
+ createdAt: string;
150
+ updatedAt: string;
148
151
  tenantId: string;
149
152
  projectId: string;
150
153
  agentId: string;
151
- createdAt: string;
152
- updatedAt: string;
153
154
  sourceSubAgentId: string;
154
155
  targetSubAgentId: string | null;
155
156
  relationType: string | null;
@@ -159,11 +160,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
159
160
  */
160
161
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
161
162
  id: string;
163
+ createdAt: string;
164
+ updatedAt: string;
162
165
  tenantId: string;
163
166
  projectId: string;
164
167
  agentId: string;
165
- createdAt: string;
166
- updatedAt: string;
167
168
  sourceSubAgentId: string;
168
169
  targetSubAgentId: string | null;
169
170
  relationType: string | null;
@@ -204,17 +205,17 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
204
205
  };
205
206
  }) => Promise<{
206
207
  id: string;
208
+ createdAt: string;
209
+ updatedAt: string;
210
+ headers: Record<string, string> | null;
207
211
  tenantId: string;
208
212
  projectId: string;
209
213
  agentId: string;
210
- createdAt: string;
211
- updatedAt: string;
214
+ subAgentId: string;
212
215
  toolId: string;
213
- headers: Record<string, string> | null;
214
216
  toolPolicies: Record<string, {
215
217
  needsApproval?: boolean;
216
218
  }> | null;
217
- subAgentId: string;
218
219
  selectedTools: string[] | null;
219
220
  }>;
220
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -248,17 +249,17 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
248
249
  relationId: string;
249
250
  }) => Promise<{
250
251
  id: string;
252
+ createdAt: string;
253
+ updatedAt: string;
254
+ headers: Record<string, string> | null;
251
255
  tenantId: string;
252
256
  projectId: string;
253
257
  agentId: string;
254
- createdAt: string;
255
- updatedAt: string;
258
+ subAgentId: string;
256
259
  toolId: string;
257
- headers: Record<string, string> | null;
258
260
  toolPolicies: Record<string, {
259
261
  needsApproval?: boolean;
260
262
  }> | null;
261
- subAgentId: string;
262
263
  selectedTools: string[] | null;
263
264
  } | undefined>;
264
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {