@inkeep/agents-core 0.50.0 → 0.50.3
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/dist/auth/auth-schema.d.ts +83 -83
- package/dist/auth/auth-validation-schemas.d.ts +148 -148
- package/dist/auth/auth.d.ts +20 -20
- package/dist/auth/auth.js +8 -9
- package/dist/auth/authz/sync.d.ts +22 -1
- package/dist/auth/authz/sync.js +59 -4
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +11 -11
- package/dist/constants/models.d.ts +1 -0
- package/dist/constants/models.js +1 -0
- package/dist/constants/otel-attributes.d.ts +4 -0
- package/dist/constants/otel-attributes.js +4 -0
- package/dist/data-access/manage/agents.d.ts +46 -46
- package/dist/data-access/manage/agents.js +8 -6
- package/dist/data-access/manage/artifactComponents.d.ts +4 -4
- package/dist/data-access/manage/artifactComponents.js +3 -3
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.js +2 -2
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/scope-helpers.d.ts +25 -0
- package/dist/data-access/manage/scope-helpers.js +18 -0
- package/dist/data-access/manage/skills.d.ts +11 -11
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgentExternalAgentRelations.js +13 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +2 -2
- package/dist/data-access/manage/subAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgents.d.ts +27 -27
- package/dist/data-access/manage/tools.d.ts +9 -9
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +27 -27
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +7 -7
- package/dist/db/manage/manage-schema.d.ts +96 -96
- package/dist/db/runtime/runtime-schema.d.ts +38 -38
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/middleware/authz-meta.d.ts +15 -0
- package/dist/middleware/authz-meta.js +11 -0
- package/dist/middleware/create-protected-route.d.ts +30 -0
- package/dist/middleware/create-protected-route.js +20 -0
- package/dist/middleware/index.d.ts +5 -0
- package/dist/middleware/index.js +6 -0
- package/dist/middleware/inherited-auth.d.ts +43 -0
- package/dist/middleware/inherited-auth.js +50 -0
- package/dist/middleware/no-auth.d.ts +6 -0
- package/dist/middleware/no-auth.js +11 -0
- package/dist/setup/index.d.ts +2 -0
- package/dist/setup/index.js +3 -0
- package/dist/setup/setup.d.ts +24 -0
- package/dist/setup/setup.js +506 -0
- package/dist/utils/in-process-fetch.d.ts +30 -0
- package/dist/utils/in-process-fetch.js +51 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +2065 -2065
- package/package.json +9 -1
|
@@ -9,12 +9,12 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
12
|
name: string;
|
|
13
|
+
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
+
description: string | null;
|
|
15
16
|
projectId: string;
|
|
16
17
|
tenantId: string;
|
|
17
|
-
description: string | null;
|
|
18
18
|
props: {
|
|
19
19
|
[x: string]: unknown;
|
|
20
20
|
type: "object";
|
|
@@ -65,12 +65,12 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
}>;
|
|
66
66
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
67
67
|
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
68
|
name: string;
|
|
69
|
+
createdAt: string;
|
|
70
70
|
updatedAt: string;
|
|
71
|
+
description: string | null;
|
|
71
72
|
projectId: string;
|
|
72
73
|
tenantId: string;
|
|
73
|
-
description: string | null;
|
|
74
74
|
props: {
|
|
75
75
|
[x: string]: unknown;
|
|
76
76
|
type: "object";
|
|
@@ -97,7 +97,7 @@ const getArtifactComponentsForAgent = (db) => async (params) => {
|
|
|
97
97
|
render: artifactComponents.render,
|
|
98
98
|
createdAt: artifactComponents.createdAt,
|
|
99
99
|
updatedAt: artifactComponents.updatedAt
|
|
100
|
-
}).from(artifactComponents).innerJoin(subAgentArtifactComponents, eq(artifactComponents.id, subAgentArtifactComponents.artifactComponentId)).where(and(eq(artifactComponents.tenantId, params.scopes.tenantId), eq(artifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(artifactComponents.createdAt));
|
|
100
|
+
}).from(artifactComponents).innerJoin(subAgentArtifactComponents, and(eq(artifactComponents.id, subAgentArtifactComponents.artifactComponentId), eq(artifactComponents.tenantId, subAgentArtifactComponents.tenantId), eq(artifactComponents.projectId, subAgentArtifactComponents.projectId))).where(and(eq(artifactComponents.tenantId, params.scopes.tenantId), eq(artifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(artifactComponents.createdAt));
|
|
101
101
|
};
|
|
102
102
|
const associateArtifactComponentWithAgent = (db) => async (params) => {
|
|
103
103
|
const [association] = await db.insert(subAgentArtifactComponents).values({
|
|
@@ -120,7 +120,7 @@ const removeArtifactComponentFromAgent = (db) => async (params) => {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
const deleteAgentArtifactComponentRelationByAgent = (db) => async (params) => {
|
|
123
|
-
return (await db.delete(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
|
|
123
|
+
return (await db.delete(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
|
|
124
124
|
};
|
|
125
125
|
const getAgentsUsingArtifactComponent = (db) => async (params) => {
|
|
126
126
|
return await db.select({
|
|
@@ -133,7 +133,7 @@ const isArtifactComponentAssociatedWithAgent = (db) => async (params) => {
|
|
|
133
133
|
return (await db.select({ id: subAgentArtifactComponents.id }).from(subAgentArtifactComponents).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentArtifactComponents.agentId, params.scopes.agentId), eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId), eq(subAgentArtifactComponents.artifactComponentId, params.artifactComponentId))).limit(1)).length > 0;
|
|
134
134
|
};
|
|
135
135
|
const agentHasArtifactComponents = (db) => async (params) => {
|
|
136
|
-
const total = (await db.select({ count: count() }).from(subAgentArtifactComponents).innerJoin(subAgents, and(eq(subAgentArtifactComponents.subAgentId, subAgents.id), eq(subAgentArtifactComponents.tenantId, subAgents.tenantId))).innerJoin(subAgentRelations, and(eq(subAgents.id, subAgentRelations.sourceSubAgentId), eq(subAgents.tenantId, subAgentRelations.tenantId), eq(subAgents.projectId, subAgentRelations.projectId), eq(subAgents.agentId, subAgentRelations.agentId))).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId))).limit(1))[0]?.count || 0;
|
|
136
|
+
const total = (await db.select({ count: count() }).from(subAgentArtifactComponents).innerJoin(subAgents, and(eq(subAgentArtifactComponents.subAgentId, subAgents.id), eq(subAgentArtifactComponents.tenantId, subAgents.tenantId), eq(subAgentArtifactComponents.projectId, subAgents.projectId), eq(subAgentArtifactComponents.agentId, subAgents.agentId))).innerJoin(subAgentRelations, and(eq(subAgents.id, subAgentRelations.sourceSubAgentId), eq(subAgents.tenantId, subAgentRelations.tenantId), eq(subAgents.projectId, subAgentRelations.projectId), eq(subAgents.agentId, subAgentRelations.agentId))).where(and(eq(subAgentArtifactComponents.tenantId, params.scopes.tenantId), eq(subAgentArtifactComponents.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId))).limit(1))[0]?.count || 0;
|
|
137
137
|
return (typeof total === "string" ? Number.parseInt(total, 10) : total) > 0;
|
|
138
138
|
};
|
|
139
139
|
const countArtifactComponents = (db) => async (params) => {
|
|
@@ -9,25 +9,25 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
headersSchema: unknown;
|
|
13
|
-
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
14
12
|
createdAt: string;
|
|
15
13
|
updatedAt: string;
|
|
16
14
|
agentId: string;
|
|
17
15
|
projectId: string;
|
|
18
16
|
tenantId: string;
|
|
17
|
+
headersSchema: unknown;
|
|
18
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
19
19
|
} | undefined>;
|
|
20
20
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
21
21
|
scopes: AgentScopeConfig;
|
|
22
22
|
}) => Promise<{
|
|
23
23
|
id: string;
|
|
24
|
-
headersSchema: unknown;
|
|
25
|
-
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
26
24
|
createdAt: string;
|
|
27
25
|
updatedAt: string;
|
|
28
26
|
agentId: string;
|
|
29
27
|
projectId: string;
|
|
30
28
|
tenantId: string;
|
|
29
|
+
headersSchema: unknown;
|
|
30
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
31
31
|
}[]>;
|
|
32
32
|
declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
33
|
scopes: AgentScopeConfig;
|
|
@@ -43,13 +43,13 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
43
43
|
}>;
|
|
44
44
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
45
45
|
id: string;
|
|
46
|
-
headersSchema: unknown;
|
|
47
|
-
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
48
46
|
createdAt: string;
|
|
49
47
|
updatedAt: string;
|
|
50
48
|
agentId: string;
|
|
51
49
|
projectId: string;
|
|
52
50
|
tenantId: string;
|
|
51
|
+
headersSchema: unknown;
|
|
52
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
53
53
|
}>;
|
|
54
54
|
declare const updateContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
55
55
|
scopes: AgentScopeConfig;
|
|
@@ -83,13 +83,13 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
data: ContextConfigInsert;
|
|
84
84
|
}) => Promise<{
|
|
85
85
|
id: string;
|
|
86
|
-
headersSchema: unknown;
|
|
87
|
-
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
88
86
|
createdAt: string;
|
|
89
87
|
updatedAt: string;
|
|
90
88
|
agentId: string;
|
|
91
89
|
projectId: string;
|
|
92
90
|
tenantId: string;
|
|
91
|
+
headersSchema: unknown;
|
|
92
|
+
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
93
93
|
}>;
|
|
94
94
|
//#endregion
|
|
95
95
|
export { countContextConfigs, createContextConfig, deleteContextConfig, getContextConfigById, hasContextConfig, listContextConfigs, listContextConfigsPaginated, updateContextConfig, upsertContextConfig };
|
|
@@ -110,7 +110,7 @@ const getDataComponentsForAgent = (db) => async (params) => {
|
|
|
110
110
|
createdAt: dataComponents.createdAt,
|
|
111
111
|
updatedAt: dataComponents.updatedAt,
|
|
112
112
|
render: dataComponents.render
|
|
113
|
-
}).from(dataComponents).innerJoin(subAgentDataComponents, eq(dataComponents.id, subAgentDataComponents.dataComponentId)).where(and(eq(dataComponents.tenantId, params.scopes.tenantId), eq(dataComponents.projectId, params.scopes.projectId), eq(subAgentDataComponents.agentId, params.scopes.agentId), eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(dataComponents.createdAt));
|
|
113
|
+
}).from(dataComponents).innerJoin(subAgentDataComponents, and(eq(dataComponents.id, subAgentDataComponents.dataComponentId), eq(dataComponents.tenantId, subAgentDataComponents.tenantId), eq(dataComponents.projectId, subAgentDataComponents.projectId))).where(and(eq(dataComponents.tenantId, params.scopes.tenantId), eq(dataComponents.projectId, params.scopes.projectId), eq(subAgentDataComponents.agentId, params.scopes.agentId), eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId))).orderBy(desc(dataComponents.createdAt));
|
|
114
114
|
};
|
|
115
115
|
/**
|
|
116
116
|
* Associate a data component with an agent
|
|
@@ -132,7 +132,7 @@ const removeDataComponentFromAgent = (db) => async (params) => {
|
|
|
132
132
|
return (await db.delete(subAgentDataComponents).where(and(eq(subAgentDataComponents.tenantId, params.scopes.tenantId), eq(subAgentDataComponents.projectId, params.scopes.projectId), eq(subAgentDataComponents.agentId, params.scopes.agentId), eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId), eq(subAgentDataComponents.dataComponentId, params.dataComponentId))).returning()).length > 0;
|
|
133
133
|
};
|
|
134
134
|
const deleteAgentDataComponentRelationByAgent = (db) => async (params) => {
|
|
135
|
-
return (await db.delete(subAgentDataComponents).where(and(eq(subAgentDataComponents.tenantId, params.scopes.tenantId), eq(subAgentDataComponents.agentId, params.scopes.agentId), eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
|
|
135
|
+
return (await db.delete(subAgentDataComponents).where(and(eq(subAgentDataComponents.tenantId, params.scopes.tenantId), eq(subAgentDataComponents.projectId, params.scopes.projectId), eq(subAgentDataComponents.agentId, params.scopes.agentId), eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId))).returning()).length > 0;
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
138
|
* Get all agents that use a specific data component
|
|
@@ -54,13 +54,13 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
54
54
|
scopes: AgentScopeConfig;
|
|
55
55
|
}) => Promise<{
|
|
56
56
|
id: string;
|
|
57
|
-
createdAt: string;
|
|
58
57
|
name: string;
|
|
58
|
+
createdAt: string;
|
|
59
59
|
updatedAt: string;
|
|
60
|
+
description: string | null;
|
|
60
61
|
agentId: string;
|
|
61
62
|
projectId: string;
|
|
62
63
|
tenantId: string;
|
|
63
|
-
description: string | null;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -96,13 +96,13 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
96
96
|
scopes: AgentScopeConfig;
|
|
97
97
|
}) => Promise<{
|
|
98
98
|
id: string;
|
|
99
|
-
createdAt: string;
|
|
100
99
|
name: string;
|
|
100
|
+
createdAt: string;
|
|
101
101
|
updatedAt: string;
|
|
102
|
+
description: string | null;
|
|
102
103
|
agentId: string;
|
|
103
104
|
projectId: string;
|
|
104
105
|
tenantId: string;
|
|
105
|
-
description: string | null;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -167,11 +167,11 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
167
167
|
agentId: string;
|
|
168
168
|
projectId: string;
|
|
169
169
|
tenantId: 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
|
|
@@ -232,11 +232,11 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
232
232
|
agentId: string;
|
|
233
233
|
projectId: string;
|
|
234
234
|
tenantId: 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 };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AgentScopeConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../types/utility.js";
|
|
2
|
+
import * as drizzle_orm20 from "drizzle-orm";
|
|
3
|
+
|
|
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_orm20.SQL<unknown>;
|
|
21
|
+
declare function projectScopedWhere<T extends ProjectScopedColumns>(table: T, scopes: ProjectScopeConfig): drizzle_orm20.SQL<unknown> | undefined;
|
|
22
|
+
declare function agentScopedWhere<T extends AgentScopedColumns>(table: T, scopes: AgentScopeConfig): drizzle_orm20.SQL<unknown> | undefined;
|
|
23
|
+
declare function subAgentScopedWhere<T extends SubAgentScopedColumns>(table: T, scopes: SubAgentScopeConfig): drizzle_orm20.SQL<unknown> | undefined;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { agentScopedWhere, projectScopedWhere, subAgentScopedWhere, tenantScopedWhere };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { and, eq } from "drizzle-orm";
|
|
2
|
+
|
|
3
|
+
//#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));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { agentScopedWhere, projectScopedWhere, subAgentScopedWhere, tenantScopedWhere };
|
|
@@ -8,13 +8,13 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
8
8
|
skillId: string;
|
|
9
9
|
}) => Promise<{
|
|
10
10
|
id: string;
|
|
11
|
-
createdAt: string;
|
|
12
11
|
name: string;
|
|
12
|
+
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
|
+
metadata: Record<string, string> | null;
|
|
15
|
+
description: string;
|
|
14
16
|
projectId: string;
|
|
15
17
|
tenantId: string;
|
|
16
|
-
description: string;
|
|
17
|
-
metadata: Record<string, string> | null;
|
|
18
18
|
content: string;
|
|
19
19
|
} | null>;
|
|
20
20
|
declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -41,24 +41,24 @@ declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
41
41
|
}>;
|
|
42
42
|
declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
|
|
43
43
|
id: string;
|
|
44
|
-
createdAt: string;
|
|
45
44
|
name: string;
|
|
45
|
+
createdAt: string;
|
|
46
46
|
updatedAt: string;
|
|
47
|
+
metadata: Record<string, string> | null;
|
|
48
|
+
description: string;
|
|
47
49
|
projectId: string;
|
|
48
50
|
tenantId: string;
|
|
49
|
-
description: string;
|
|
50
|
-
metadata: Record<string, string> | null;
|
|
51
51
|
content: string;
|
|
52
52
|
}>;
|
|
53
53
|
declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillInsert) => Promise<{
|
|
54
54
|
id: string;
|
|
55
|
-
createdAt: string;
|
|
56
55
|
name: string;
|
|
56
|
+
createdAt: string;
|
|
57
57
|
updatedAt: string;
|
|
58
|
+
metadata: Record<string, string> | null;
|
|
59
|
+
description: string;
|
|
58
60
|
projectId: string;
|
|
59
61
|
tenantId: string;
|
|
60
|
-
description: string;
|
|
61
|
-
metadata: Record<string, string> | null;
|
|
62
62
|
content: string;
|
|
63
63
|
}>;
|
|
64
64
|
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -96,10 +96,10 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
96
96
|
agentId: string;
|
|
97
97
|
projectId: string;
|
|
98
98
|
tenantId: string;
|
|
99
|
+
subAgentId: string;
|
|
100
|
+
skillId: string;
|
|
99
101
|
index: number;
|
|
100
102
|
alwaysLoaded: boolean;
|
|
101
|
-
skillId: string;
|
|
102
|
-
subAgentId: string;
|
|
103
103
|
}>;
|
|
104
104
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
105
105
|
scopes: AgentScopeConfig;
|
|
@@ -15,8 +15,8 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
15
15
|
projectId: string;
|
|
16
16
|
tenantId: string;
|
|
17
17
|
headers: Record<string, string> | null;
|
|
18
|
-
externalAgentId: string;
|
|
19
18
|
subAgentId: string;
|
|
19
|
+
externalAgentId: string;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
22
|
scopes: SubAgentScopeConfig;
|
|
@@ -50,8 +50,8 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
50
50
|
projectId: string;
|
|
51
51
|
tenantId: string;
|
|
52
52
|
headers: Record<string, string> | null;
|
|
53
|
-
externalAgentId: string;
|
|
54
53
|
subAgentId: string;
|
|
54
|
+
externalAgentId: string;
|
|
55
55
|
}[]>;
|
|
56
56
|
declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
57
57
|
scopes: AgentScopeConfig;
|
|
@@ -63,8 +63,8 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
|
|
|
63
63
|
projectId: string;
|
|
64
64
|
tenantId: string;
|
|
65
65
|
headers: Record<string, string> | null;
|
|
66
|
-
externalAgentId: string;
|
|
67
66
|
subAgentId: string;
|
|
67
|
+
externalAgentId: string;
|
|
68
68
|
}[]>;
|
|
69
69
|
declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
70
70
|
scopes: AgentScopeConfig;
|
|
@@ -186,8 +186,8 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
186
186
|
projectId: string;
|
|
187
187
|
tenantId: string;
|
|
188
188
|
headers: Record<string, string> | null;
|
|
189
|
-
externalAgentId: string;
|
|
190
189
|
subAgentId: string;
|
|
190
|
+
externalAgentId: string;
|
|
191
191
|
}>;
|
|
192
192
|
/**
|
|
193
193
|
* Check if sub-agent external agent relation exists by params
|
|
@@ -203,8 +203,8 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
203
203
|
projectId: string;
|
|
204
204
|
tenantId: string;
|
|
205
205
|
headers: Record<string, string> | null;
|
|
206
|
-
externalAgentId: string;
|
|
207
206
|
subAgentId: string;
|
|
207
|
+
externalAgentId: string;
|
|
208
208
|
} | undefined>;
|
|
209
209
|
/**
|
|
210
210
|
* Upsert sub-agent external agent relation (create if it doesn't exist, update if it does)
|
|
@@ -224,8 +224,8 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
224
224
|
projectId: string;
|
|
225
225
|
tenantId: string;
|
|
226
226
|
headers: Record<string, string> | null;
|
|
227
|
-
externalAgentId: string;
|
|
228
227
|
subAgentId: string;
|
|
228
|
+
externalAgentId: string;
|
|
229
229
|
}>;
|
|
230
230
|
declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
231
231
|
scopes: SubAgentScopeConfig;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { externalAgents, subAgentExternalAgentRelations, subAgents } from "../../db/manage/manage-schema.js";
|
|
2
|
+
import { agentScopedWhere, subAgentScopedWhere } from "./scope-helpers.js";
|
|
2
3
|
import { and, count, desc, eq } from "drizzle-orm";
|
|
3
4
|
import { nanoid } from "nanoid";
|
|
4
5
|
|
|
5
6
|
//#region src/data-access/manage/subAgentExternalAgentRelations.ts
|
|
6
7
|
const getSubAgentExternalAgentRelationById = (db) => async (params) => {
|
|
7
|
-
return db.query.subAgentExternalAgentRelations.findFirst({ where: and(
|
|
8
|
+
return db.query.subAgentExternalAgentRelations.findFirst({ where: and(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.id, params.relationId)) });
|
|
8
9
|
};
|
|
9
10
|
const listSubAgentExternalAgentRelations = (db) => async (params) => {
|
|
10
11
|
const page = params.pagination?.page || 1;
|
|
11
12
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
12
13
|
const offset = (page - 1) * limit;
|
|
13
|
-
const whereClause =
|
|
14
|
+
const whereClause = subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes);
|
|
14
15
|
const [data, totalResult] = await Promise.all([db.select().from(subAgentExternalAgentRelations).where(whereClause).limit(limit).offset(offset).orderBy(desc(subAgentExternalAgentRelations.createdAt)), db.select({ count: count() }).from(subAgentExternalAgentRelations).where(whereClause)]);
|
|
15
16
|
const total = totalResult[0]?.count || 0;
|
|
16
17
|
return {
|
|
@@ -24,16 +25,16 @@ const listSubAgentExternalAgentRelations = (db) => async (params) => {
|
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
const getSubAgentExternalAgentRelations = (db) => async (params) => {
|
|
27
|
-
return await db.query.subAgentExternalAgentRelations.findMany({ where:
|
|
28
|
+
return await db.query.subAgentExternalAgentRelations.findMany({ where: subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes) });
|
|
28
29
|
};
|
|
29
30
|
const getSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
|
|
30
|
-
return await db.query.subAgentExternalAgentRelations.findMany({ where:
|
|
31
|
+
return await db.query.subAgentExternalAgentRelations.findMany({ where: agentScopedWhere(subAgentExternalAgentRelations, params.scopes) });
|
|
31
32
|
};
|
|
32
33
|
const getSubAgentExternalAgentRelationsByExternalAgent = (db) => async (params) => {
|
|
33
34
|
const page = params.pagination?.page || 1;
|
|
34
35
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
35
36
|
const offset = (page - 1) * limit;
|
|
36
|
-
const whereClause = and(
|
|
37
|
+
const whereClause = and(agentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.externalAgentId, params.externalAgentId));
|
|
37
38
|
const [data, totalResult] = await Promise.all([db.select().from(subAgentExternalAgentRelations).where(whereClause).limit(limit).offset(offset).orderBy(desc(subAgentExternalAgentRelations.createdAt)), db.select({ count: count() }).from(subAgentExternalAgentRelations).where(whereClause)]);
|
|
38
39
|
const total = totalResult[0]?.count || 0;
|
|
39
40
|
return {
|
|
@@ -71,7 +72,7 @@ const getExternalAgentsForSubAgent = (db) => async (params) => {
|
|
|
71
72
|
createdAt: externalAgents.createdAt,
|
|
72
73
|
updatedAt: externalAgents.updatedAt
|
|
73
74
|
}
|
|
74
|
-
}).from(subAgentExternalAgentRelations).innerJoin(externalAgents, and(eq(subAgentExternalAgentRelations.tenantId, externalAgents.tenantId), eq(subAgentExternalAgentRelations.projectId, externalAgents.projectId), eq(subAgentExternalAgentRelations.externalAgentId, externalAgents.id))).where(
|
|
75
|
+
}).from(subAgentExternalAgentRelations).innerJoin(externalAgents, and(eq(subAgentExternalAgentRelations.tenantId, externalAgents.tenantId), eq(subAgentExternalAgentRelations.projectId, externalAgents.projectId), eq(subAgentExternalAgentRelations.externalAgentId, externalAgents.id))).where(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes)).limit(limit).offset(offset).orderBy(desc(subAgentExternalAgentRelations.createdAt)), db.select({ count: count() }).from(subAgentExternalAgentRelations).where(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes))]);
|
|
75
76
|
const total = totalResult[0]?.count || 0;
|
|
76
77
|
return {
|
|
77
78
|
data,
|
|
@@ -108,7 +109,7 @@ const getSubAgentsForExternalAgent = (db) => async (params) => {
|
|
|
108
109
|
createdAt: subAgents.createdAt,
|
|
109
110
|
updatedAt: subAgents.updatedAt
|
|
110
111
|
}
|
|
111
|
-
}).from(subAgentExternalAgentRelations).innerJoin(subAgents, and(eq(subAgentExternalAgentRelations.subAgentId, subAgents.id), eq(subAgentExternalAgentRelations.tenantId, subAgents.tenantId), eq(subAgentExternalAgentRelations.projectId, subAgents.projectId), eq(subAgentExternalAgentRelations.agentId, subAgents.agentId))).where(and(
|
|
112
|
+
}).from(subAgentExternalAgentRelations).innerJoin(subAgents, and(eq(subAgentExternalAgentRelations.subAgentId, subAgents.id), eq(subAgentExternalAgentRelations.tenantId, subAgents.tenantId), eq(subAgentExternalAgentRelations.projectId, subAgents.projectId), eq(subAgentExternalAgentRelations.agentId, subAgents.agentId))).where(and(agentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.externalAgentId, params.externalAgentId))).limit(limit).offset(offset).orderBy(desc(subAgentExternalAgentRelations.createdAt)), db.select({ count: count() }).from(subAgentExternalAgentRelations).where(and(agentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.externalAgentId, params.externalAgentId)))]);
|
|
112
113
|
const total = totalResult[0]?.count || 0;
|
|
113
114
|
return {
|
|
114
115
|
data,
|
|
@@ -136,7 +137,7 @@ const createSubAgentExternalAgentRelation = (db) => async (params) => {
|
|
|
136
137
|
* Check if sub-agent external agent relation exists by params
|
|
137
138
|
*/
|
|
138
139
|
const getSubAgentExternalAgentRelationByParams = (db) => async (params) => {
|
|
139
|
-
return db.query.subAgentExternalAgentRelations.findFirst({ where: and(
|
|
140
|
+
return db.query.subAgentExternalAgentRelations.findFirst({ where: and(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.externalAgentId, params.externalAgentId)) });
|
|
140
141
|
};
|
|
141
142
|
/**
|
|
142
143
|
* Upsert sub-agent external agent relation (create if it doesn't exist, update if it does)
|
|
@@ -163,16 +164,16 @@ const updateSubAgentExternalAgentRelation = (db) => async (params) => {
|
|
|
163
164
|
...params.data,
|
|
164
165
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
165
166
|
};
|
|
166
|
-
return (await db.update(subAgentExternalAgentRelations).set(updateData).where(and(
|
|
167
|
+
return (await db.update(subAgentExternalAgentRelations).set(updateData).where(and(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.id, params.relationId))).returning())[0];
|
|
167
168
|
};
|
|
168
169
|
const deleteSubAgentExternalAgentRelation = (db) => async (params) => {
|
|
169
|
-
return (await db.delete(subAgentExternalAgentRelations).where(and(
|
|
170
|
+
return (await db.delete(subAgentExternalAgentRelations).where(and(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes), eq(subAgentExternalAgentRelations.id, params.relationId))).returning()).length > 0;
|
|
170
171
|
};
|
|
171
172
|
const deleteSubAgentExternalAgentRelationsBySubAgent = (db) => async (params) => {
|
|
172
|
-
return (await db.delete(subAgentExternalAgentRelations).where(
|
|
173
|
+
return (await db.delete(subAgentExternalAgentRelations).where(subAgentScopedWhere(subAgentExternalAgentRelations, params.scopes)).returning()).length > 0;
|
|
173
174
|
};
|
|
174
175
|
const deleteSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
|
|
175
|
-
return (await db.delete(subAgentExternalAgentRelations).where(
|
|
176
|
+
return (await db.delete(subAgentExternalAgentRelations).where(agentScopedWhere(subAgentExternalAgentRelations, params.scopes)).returning()).length > 0;
|
|
176
177
|
};
|
|
177
178
|
|
|
178
179
|
//#endregion
|
|
@@ -211,10 +211,10 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
211
211
|
tenantId: string;
|
|
212
212
|
headers: Record<string, string> | null;
|
|
213
213
|
toolId: string;
|
|
214
|
+
subAgentId: string;
|
|
214
215
|
toolPolicies: Record<string, {
|
|
215
216
|
needsApproval?: boolean;
|
|
216
217
|
}> | null;
|
|
217
|
-
subAgentId: string;
|
|
218
218
|
selectedTools: string[] | null;
|
|
219
219
|
}>;
|
|
220
220
|
declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -255,10 +255,10 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
255
255
|
tenantId: string;
|
|
256
256
|
headers: Record<string, string> | null;
|
|
257
257
|
toolId: string;
|
|
258
|
+
subAgentId: string;
|
|
258
259
|
toolPolicies: Record<string, {
|
|
259
260
|
needsApproval?: boolean;
|
|
260
261
|
}> | null;
|
|
261
|
-
subAgentId: string;
|
|
262
262
|
selectedTools: string[] | null;
|
|
263
263
|
} | undefined>;
|
|
264
264
|
declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -124,7 +124,7 @@ const deleteSubAgentRelation = (db) => async (params) => {
|
|
|
124
124
|
return (await db.delete(subAgentRelations).where(and(eq(subAgentRelations.tenantId, params.scopes.tenantId), eq(subAgentRelations.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId), eq(subAgentRelations.id, params.relationId))).returning()).length > 0;
|
|
125
125
|
};
|
|
126
126
|
const deleteAgentRelationsByAgent = (db) => async (params) => {
|
|
127
|
-
return (await db.delete(subAgentRelations).where(and(eq(subAgentRelations.tenantId, params.scopes.tenantId), eq(subAgentRelations.agentId, params.scopes.agentId))).returning()).length > 0;
|
|
127
|
+
return (await db.delete(subAgentRelations).where(and(eq(subAgentRelations.tenantId, params.scopes.tenantId), eq(subAgentRelations.projectId, params.scopes.projectId), eq(subAgentRelations.agentId, params.scopes.agentId))).returning()).length > 0;
|
|
128
128
|
};
|
|
129
129
|
const createAgentToolRelation = (db) => async (params) => {
|
|
130
130
|
const finalRelationId = params.relationId ?? generateId();
|
|
@@ -160,7 +160,7 @@ const getAgentToolRelationByAgent = (db) => async (params) => {
|
|
|
160
160
|
const page = params.pagination?.page || 1;
|
|
161
161
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
162
162
|
const offset = (page - 1) * limit;
|
|
163
|
-
const [data, totalResult] = await Promise.all([db.select().from(subAgentToolRelations).where(and(eq(subAgentToolRelations.tenantId, params.scopes.tenantId), eq(subAgentToolRelations.projectId, params.scopes.projectId), eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId))).limit(limit).offset(offset).orderBy(desc(subAgentToolRelations.createdAt)), db.select({ count: count() }).from(subAgentToolRelations).where(and(eq(subAgentToolRelations.tenantId, params.scopes.tenantId), eq(subAgentToolRelations.projectId, params.scopes.projectId), eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId)))]);
|
|
163
|
+
const [data, totalResult] = await Promise.all([db.select().from(subAgentToolRelations).where(and(eq(subAgentToolRelations.tenantId, params.scopes.tenantId), eq(subAgentToolRelations.projectId, params.scopes.projectId), eq(subAgentToolRelations.agentId, params.scopes.agentId), eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId))).limit(limit).offset(offset).orderBy(desc(subAgentToolRelations.createdAt)), db.select({ count: count() }).from(subAgentToolRelations).where(and(eq(subAgentToolRelations.tenantId, params.scopes.tenantId), eq(subAgentToolRelations.projectId, params.scopes.projectId), eq(subAgentToolRelations.agentId, params.scopes.agentId), eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId)))]);
|
|
164
164
|
const total = totalResult[0]?.count || 0;
|
|
165
165
|
return {
|
|
166
166
|
data,
|
|
@@ -9,13 +9,15 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
9
9
|
subAgentId: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
12
|
name: string;
|
|
13
|
+
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
agentId: string;
|
|
16
|
-
projectId: string;
|
|
17
|
-
tenantId: string;
|
|
18
15
|
description: string | null;
|
|
16
|
+
stopWhen: {
|
|
17
|
+
stepCountIs?: number | undefined;
|
|
18
|
+
} | null;
|
|
19
|
+
prompt: string | null;
|
|
20
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
19
21
|
models: {
|
|
20
22
|
base?: {
|
|
21
23
|
model?: string | undefined;
|
|
@@ -30,23 +32,23 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
30
32
|
providerOptions?: Record<string, any> | undefined;
|
|
31
33
|
} | undefined;
|
|
32
34
|
} | null;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} | null;
|
|
37
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
35
|
+
agentId: string;
|
|
36
|
+
projectId: string;
|
|
37
|
+
tenantId: string;
|
|
38
38
|
} | undefined>;
|
|
39
39
|
declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
40
40
|
scopes: AgentScopeConfig;
|
|
41
41
|
}) => Promise<{
|
|
42
42
|
id: string;
|
|
43
|
-
createdAt: string;
|
|
44
43
|
name: string;
|
|
44
|
+
createdAt: string;
|
|
45
45
|
updatedAt: string;
|
|
46
|
-
agentId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
tenantId: string;
|
|
49
46
|
description: string | null;
|
|
47
|
+
stopWhen: {
|
|
48
|
+
stepCountIs?: number | undefined;
|
|
49
|
+
} | null;
|
|
50
|
+
prompt: string | null;
|
|
51
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
50
52
|
models: {
|
|
51
53
|
base?: {
|
|
52
54
|
model?: string | undefined;
|
|
@@ -61,11 +63,9 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
61
63
|
providerOptions?: Record<string, any> | undefined;
|
|
62
64
|
} | undefined;
|
|
63
65
|
} | null;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} | null;
|
|
68
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
66
|
+
agentId: string;
|
|
67
|
+
projectId: string;
|
|
68
|
+
tenantId: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
71
71
|
scopes: AgentScopeConfig;
|
|
@@ -109,13 +109,15 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
|
|
|
109
109
|
}>;
|
|
110
110
|
declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
|
|
111
111
|
id: string;
|
|
112
|
-
createdAt: string;
|
|
113
112
|
name: string;
|
|
113
|
+
createdAt: string;
|
|
114
114
|
updatedAt: string;
|
|
115
|
-
agentId: string;
|
|
116
|
-
projectId: string;
|
|
117
|
-
tenantId: string;
|
|
118
115
|
description: string | null;
|
|
116
|
+
stopWhen: {
|
|
117
|
+
stepCountIs?: number | undefined;
|
|
118
|
+
} | null;
|
|
119
|
+
prompt: string | null;
|
|
120
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
119
121
|
models: {
|
|
120
122
|
base?: {
|
|
121
123
|
model?: string | undefined;
|
|
@@ -130,11 +132,9 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
130
132
|
providerOptions?: Record<string, any> | undefined;
|
|
131
133
|
} | undefined;
|
|
132
134
|
} | null;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} | null;
|
|
137
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
135
|
+
agentId: string;
|
|
136
|
+
projectId: string;
|
|
137
|
+
tenantId: string;
|
|
138
138
|
}>;
|
|
139
139
|
declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
140
140
|
scopes: AgentScopeConfig;
|