@inkeep/agents-core 0.50.0 → 0.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-schema.d.ts +105 -105
- package/dist/auth/auth-validation-schemas.d.ts +148 -148
- package/dist/auth/auth.d.ts +22 -22
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +3 -4
- package/dist/data-access/manage/agents.d.ts +44 -44
- package/dist/data-access/manage/agents.js +8 -6
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- package/dist/data-access/manage/artifactComponents.js +3 -3
- package/dist/data-access/manage/contextConfigs.d.ts +20 -20
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/dataComponents.js +2 -2
- package/dist/data-access/manage/functionTools.d.ts +16 -16
- package/dist/data-access/manage/skills.d.ts +16 -16
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
- package/dist/data-access/manage/subAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +21 -21
- package/dist/data-access/manage/tools.d.ts +24 -24
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/conversations.d.ts +27 -27
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +8 -8
- package/dist/db/manage/manage-schema.d.ts +449 -449
- package/dist/db/runtime/runtime-schema.d.ts +298 -298
- 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/validation/dolt-schemas.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1953 -1953
- package/package.json +5 -1
|
@@ -65,10 +65,10 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
dataComponentId: string;
|
|
66
66
|
}) => Promise<{
|
|
67
67
|
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
|
-
agentId: string;
|
|
70
|
-
projectId: string;
|
|
71
68
|
tenantId: string;
|
|
69
|
+
projectId: string;
|
|
70
|
+
agentId: string;
|
|
71
|
+
createdAt: string;
|
|
72
72
|
subAgentId: string;
|
|
73
73
|
dataComponentId: string;
|
|
74
74
|
}>;
|
|
@@ -107,10 +107,10 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
107
107
|
dataComponentId: string;
|
|
108
108
|
}) => Promise<{
|
|
109
109
|
id: string;
|
|
110
|
-
createdAt: string;
|
|
111
|
-
agentId: string;
|
|
112
|
-
projectId: string;
|
|
113
110
|
tenantId: string;
|
|
111
|
+
projectId: string;
|
|
112
|
+
agentId: string;
|
|
113
|
+
createdAt: string;
|
|
114
114
|
subAgentId: string;
|
|
115
115
|
dataComponentId: string;
|
|
116
116
|
} | null>;
|
|
@@ -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;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
agentId: string;
|
|
61
|
-
projectId: string;
|
|
62
|
-
tenantId: string;
|
|
63
58
|
description: string | null;
|
|
59
|
+
tenantId: string;
|
|
60
|
+
projectId: string;
|
|
61
|
+
agentId: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
updatedAt: string;
|
|
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;
|
|
101
|
-
updatedAt: string;
|
|
102
|
-
agentId: string;
|
|
103
|
-
projectId: string;
|
|
104
|
-
tenantId: string;
|
|
105
100
|
description: string | null;
|
|
101
|
+
tenantId: string;
|
|
102
|
+
projectId: string;
|
|
103
|
+
agentId: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -162,11 +162,11 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
162
162
|
}> | null;
|
|
163
163
|
}) => Promise<{
|
|
164
164
|
id: string;
|
|
165
|
+
tenantId: string;
|
|
166
|
+
projectId: string;
|
|
167
|
+
agentId: string;
|
|
165
168
|
createdAt: string;
|
|
166
169
|
updatedAt: string;
|
|
167
|
-
agentId: string;
|
|
168
|
-
projectId: string;
|
|
169
|
-
tenantId: string;
|
|
170
170
|
toolPolicies: Record<string, {
|
|
171
171
|
needsApproval?: boolean;
|
|
172
172
|
}> | null;
|
|
@@ -227,11 +227,11 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
227
227
|
}> | null;
|
|
228
228
|
}) => Promise<{
|
|
229
229
|
id: string;
|
|
230
|
+
tenantId: string;
|
|
231
|
+
projectId: string;
|
|
232
|
+
agentId: string;
|
|
230
233
|
createdAt: string;
|
|
231
234
|
updatedAt: string;
|
|
232
|
-
agentId: string;
|
|
233
|
-
projectId: string;
|
|
234
|
-
tenantId: string;
|
|
235
235
|
toolPolicies: Record<string, {
|
|
236
236
|
needsApproval?: boolean;
|
|
237
237
|
}> | null;
|
|
@@ -8,12 +8,12 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
8
8
|
skillId: string;
|
|
9
9
|
}) => Promise<{
|
|
10
10
|
id: string;
|
|
11
|
-
createdAt: string;
|
|
12
11
|
name: string;
|
|
13
|
-
updatedAt: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
tenantId: string;
|
|
16
12
|
description: string;
|
|
13
|
+
tenantId: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
17
|
metadata: Record<string, string> | null;
|
|
18
18
|
content: string;
|
|
19
19
|
} | null>;
|
|
@@ -41,23 +41,23 @@ 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;
|
|
46
|
-
updatedAt: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
tenantId: string;
|
|
49
45
|
description: string;
|
|
46
|
+
tenantId: string;
|
|
47
|
+
projectId: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
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;
|
|
57
|
-
updatedAt: string;
|
|
58
|
-
projectId: string;
|
|
59
|
-
tenantId: string;
|
|
60
56
|
description: string;
|
|
57
|
+
tenantId: string;
|
|
58
|
+
projectId: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
updatedAt: string;
|
|
61
61
|
metadata: Record<string, string> | null;
|
|
62
62
|
content: string;
|
|
63
63
|
}>;
|
|
@@ -91,15 +91,15 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
91
91
|
alwaysLoaded?: boolean;
|
|
92
92
|
}) => Promise<{
|
|
93
93
|
id: string;
|
|
94
|
+
tenantId: string;
|
|
95
|
+
projectId: string;
|
|
96
|
+
agentId: string;
|
|
94
97
|
createdAt: string;
|
|
95
98
|
updatedAt: string;
|
|
96
|
-
agentId: string;
|
|
97
|
-
projectId: string;
|
|
98
|
-
tenantId: string;
|
|
99
99
|
index: number;
|
|
100
100
|
alwaysLoaded: boolean;
|
|
101
|
-
skillId: string;
|
|
102
101
|
subAgentId: string;
|
|
102
|
+
skillId: string;
|
|
103
103
|
}>;
|
|
104
104
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
105
105
|
scopes: AgentScopeConfig;
|
|
@@ -9,11 +9,11 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
9
9
|
relationId: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
+
tenantId: string;
|
|
13
|
+
projectId: string;
|
|
14
|
+
agentId: string;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
agentId: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
17
17
|
headers: Record<string, string> | null;
|
|
18
18
|
externalAgentId: string;
|
|
19
19
|
subAgentId: string;
|
|
@@ -44,11 +44,11 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
44
44
|
scopes: SubAgentScopeConfig;
|
|
45
45
|
}) => Promise<{
|
|
46
46
|
id: string;
|
|
47
|
+
tenantId: string;
|
|
48
|
+
projectId: string;
|
|
49
|
+
agentId: string;
|
|
47
50
|
createdAt: string;
|
|
48
51
|
updatedAt: string;
|
|
49
|
-
agentId: string;
|
|
50
|
-
projectId: string;
|
|
51
|
-
tenantId: string;
|
|
52
52
|
headers: Record<string, string> | null;
|
|
53
53
|
externalAgentId: string;
|
|
54
54
|
subAgentId: string;
|
|
@@ -57,11 +57,11 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
|
|
|
57
57
|
scopes: AgentScopeConfig;
|
|
58
58
|
}) => Promise<{
|
|
59
59
|
id: string;
|
|
60
|
+
tenantId: string;
|
|
61
|
+
projectId: string;
|
|
62
|
+
agentId: string;
|
|
60
63
|
createdAt: string;
|
|
61
64
|
updatedAt: string;
|
|
62
|
-
agentId: string;
|
|
63
|
-
projectId: string;
|
|
64
|
-
tenantId: string;
|
|
65
65
|
headers: Record<string, string> | null;
|
|
66
66
|
externalAgentId: string;
|
|
67
67
|
subAgentId: string;
|
|
@@ -180,11 +180,11 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
180
180
|
};
|
|
181
181
|
}) => Promise<{
|
|
182
182
|
id: string;
|
|
183
|
+
tenantId: string;
|
|
184
|
+
projectId: string;
|
|
185
|
+
agentId: string;
|
|
183
186
|
createdAt: string;
|
|
184
187
|
updatedAt: string;
|
|
185
|
-
agentId: string;
|
|
186
|
-
projectId: string;
|
|
187
|
-
tenantId: string;
|
|
188
188
|
headers: Record<string, string> | null;
|
|
189
189
|
externalAgentId: string;
|
|
190
190
|
subAgentId: string;
|
|
@@ -197,11 +197,11 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
197
197
|
externalAgentId: string;
|
|
198
198
|
}) => Promise<{
|
|
199
199
|
id: string;
|
|
200
|
+
tenantId: string;
|
|
201
|
+
projectId: string;
|
|
202
|
+
agentId: string;
|
|
200
203
|
createdAt: string;
|
|
201
204
|
updatedAt: string;
|
|
202
|
-
agentId: string;
|
|
203
|
-
projectId: string;
|
|
204
|
-
tenantId: string;
|
|
205
205
|
headers: Record<string, string> | null;
|
|
206
206
|
externalAgentId: string;
|
|
207
207
|
subAgentId: string;
|
|
@@ -218,11 +218,11 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
218
218
|
};
|
|
219
219
|
}) => Promise<{
|
|
220
220
|
id: string;
|
|
221
|
+
tenantId: string;
|
|
222
|
+
projectId: string;
|
|
223
|
+
agentId: string;
|
|
221
224
|
createdAt: string;
|
|
222
225
|
updatedAt: string;
|
|
223
|
-
agentId: string;
|
|
224
|
-
projectId: string;
|
|
225
|
-
tenantId: string;
|
|
226
226
|
headers: Record<string, string> | null;
|
|
227
227
|
externalAgentId: string;
|
|
228
228
|
subAgentId: string;
|
|
@@ -11,9 +11,9 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
11
11
|
id: string;
|
|
12
12
|
createdAt: string;
|
|
13
13
|
updatedAt: string;
|
|
14
|
-
agentId: string;
|
|
15
|
-
projectId: string;
|
|
16
14
|
tenantId: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
agentId: string;
|
|
17
17
|
sourceSubAgentId: string;
|
|
18
18
|
targetSubAgentId: string | null;
|
|
19
19
|
relationType: string | null;
|
|
@@ -46,9 +46,9 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
46
46
|
id: string;
|
|
47
47
|
createdAt: string;
|
|
48
48
|
updatedAt: string;
|
|
49
|
-
agentId: string;
|
|
50
|
-
projectId: string;
|
|
51
49
|
tenantId: string;
|
|
50
|
+
projectId: string;
|
|
51
|
+
agentId: string;
|
|
52
52
|
sourceSubAgentId: string;
|
|
53
53
|
targetSubAgentId: string | null;
|
|
54
54
|
relationType: string | null;
|
|
@@ -59,9 +59,9 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
|
|
|
59
59
|
id: string;
|
|
60
60
|
createdAt: string;
|
|
61
61
|
updatedAt: string;
|
|
62
|
-
agentId: string;
|
|
63
|
-
projectId: string;
|
|
64
62
|
tenantId: string;
|
|
63
|
+
projectId: string;
|
|
64
|
+
agentId: string;
|
|
65
65
|
sourceSubAgentId: string;
|
|
66
66
|
targetSubAgentId: string | null;
|
|
67
67
|
relationType: string | null;
|
|
@@ -128,9 +128,9 @@ declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
128
128
|
id: string;
|
|
129
129
|
createdAt: string;
|
|
130
130
|
updatedAt: string;
|
|
131
|
-
agentId: string;
|
|
132
|
-
projectId: string;
|
|
133
131
|
tenantId: string;
|
|
132
|
+
projectId: string;
|
|
133
|
+
agentId: string;
|
|
134
134
|
sourceSubAgentId: string;
|
|
135
135
|
targetSubAgentId: string | null;
|
|
136
136
|
relationType: string | null;
|
|
@@ -147,9 +147,9 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
|
|
|
147
147
|
id: string;
|
|
148
148
|
createdAt: string;
|
|
149
149
|
updatedAt: string;
|
|
150
|
-
agentId: string;
|
|
151
|
-
projectId: string;
|
|
152
150
|
tenantId: string;
|
|
151
|
+
projectId: string;
|
|
152
|
+
agentId: string;
|
|
153
153
|
sourceSubAgentId: string;
|
|
154
154
|
targetSubAgentId: string | null;
|
|
155
155
|
relationType: string | null;
|
|
@@ -161,9 +161,9 @@ declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
161
161
|
id: string;
|
|
162
162
|
createdAt: string;
|
|
163
163
|
updatedAt: string;
|
|
164
|
-
agentId: string;
|
|
165
|
-
projectId: string;
|
|
166
164
|
tenantId: string;
|
|
165
|
+
projectId: string;
|
|
166
|
+
agentId: string;
|
|
167
167
|
sourceSubAgentId: string;
|
|
168
168
|
targetSubAgentId: string | null;
|
|
169
169
|
relationType: string | null;
|
|
@@ -206,16 +206,16 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
206
206
|
id: string;
|
|
207
207
|
createdAt: string;
|
|
208
208
|
updatedAt: string;
|
|
209
|
-
agentId: string;
|
|
210
|
-
projectId: string;
|
|
211
209
|
tenantId: string;
|
|
212
|
-
|
|
210
|
+
projectId: string;
|
|
211
|
+
agentId: string;
|
|
213
212
|
toolId: string;
|
|
213
|
+
subAgentId: string;
|
|
214
|
+
headers: Record<string, string> | null;
|
|
215
|
+
selectedTools: string[] | null;
|
|
214
216
|
toolPolicies: Record<string, {
|
|
215
217
|
needsApproval?: boolean;
|
|
216
218
|
}> | null;
|
|
217
|
-
subAgentId: string;
|
|
218
|
-
selectedTools: string[] | null;
|
|
219
219
|
}>;
|
|
220
220
|
declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
221
221
|
scopes: AgentScopeConfig;
|
|
@@ -250,16 +250,16 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
250
250
|
id: string;
|
|
251
251
|
createdAt: string;
|
|
252
252
|
updatedAt: string;
|
|
253
|
-
agentId: string;
|
|
254
|
-
projectId: string;
|
|
255
253
|
tenantId: string;
|
|
256
|
-
|
|
254
|
+
projectId: string;
|
|
255
|
+
agentId: string;
|
|
257
256
|
toolId: string;
|
|
257
|
+
subAgentId: string;
|
|
258
|
+
headers: Record<string, string> | null;
|
|
259
|
+
selectedTools: string[] | null;
|
|
258
260
|
toolPolicies: Record<string, {
|
|
259
261
|
needsApproval?: boolean;
|
|
260
262
|
}> | null;
|
|
261
|
-
subAgentId: string;
|
|
262
|
-
selectedTools: string[] | null;
|
|
263
263
|
} | undefined>;
|
|
264
264
|
declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
265
265
|
scopes: SubAgentScopeConfig;
|
|
@@ -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,11 +9,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
|
|
|
9
9
|
relationId: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
+
tenantId: string;
|
|
13
|
+
projectId: string;
|
|
14
|
+
agentId: string;
|
|
12
15
|
createdAt: string;
|
|
13
16
|
updatedAt: string;
|
|
14
|
-
agentId: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
17
17
|
headers: Record<string, string> | null;
|
|
18
18
|
subAgentId: string;
|
|
19
19
|
targetAgentId: string;
|
|
@@ -44,11 +44,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
|
|
|
44
44
|
scopes: SubAgentScopeConfig;
|
|
45
45
|
}) => Promise<{
|
|
46
46
|
id: string;
|
|
47
|
+
tenantId: string;
|
|
48
|
+
projectId: string;
|
|
49
|
+
agentId: string;
|
|
47
50
|
createdAt: string;
|
|
48
51
|
updatedAt: string;
|
|
49
|
-
agentId: string;
|
|
50
|
-
projectId: string;
|
|
51
|
-
tenantId: string;
|
|
52
52
|
headers: Record<string, string> | null;
|
|
53
53
|
subAgentId: string;
|
|
54
54
|
targetAgentId: string;
|
|
@@ -57,11 +57,11 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
|
|
|
57
57
|
scopes: AgentScopeConfig;
|
|
58
58
|
}) => Promise<{
|
|
59
59
|
id: string;
|
|
60
|
+
tenantId: string;
|
|
61
|
+
projectId: string;
|
|
62
|
+
agentId: string;
|
|
60
63
|
createdAt: string;
|
|
61
64
|
updatedAt: string;
|
|
62
|
-
agentId: string;
|
|
63
|
-
projectId: string;
|
|
64
|
-
tenantId: string;
|
|
65
65
|
headers: Record<string, string> | null;
|
|
66
66
|
subAgentId: string;
|
|
67
67
|
targetAgentId: string;
|
|
@@ -210,11 +210,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
210
210
|
};
|
|
211
211
|
}) => Promise<{
|
|
212
212
|
id: string;
|
|
213
|
+
tenantId: string;
|
|
214
|
+
projectId: string;
|
|
215
|
+
agentId: string;
|
|
213
216
|
createdAt: string;
|
|
214
217
|
updatedAt: string;
|
|
215
|
-
agentId: string;
|
|
216
|
-
projectId: string;
|
|
217
|
-
tenantId: string;
|
|
218
218
|
headers: Record<string, string> | null;
|
|
219
219
|
subAgentId: string;
|
|
220
220
|
targetAgentId: string;
|
|
@@ -227,11 +227,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
|
|
|
227
227
|
targetAgentId: string;
|
|
228
228
|
}) => Promise<{
|
|
229
229
|
id: string;
|
|
230
|
+
tenantId: string;
|
|
231
|
+
projectId: string;
|
|
232
|
+
agentId: string;
|
|
230
233
|
createdAt: string;
|
|
231
234
|
updatedAt: string;
|
|
232
|
-
agentId: string;
|
|
233
|
-
projectId: string;
|
|
234
|
-
tenantId: string;
|
|
235
235
|
headers: Record<string, string> | null;
|
|
236
236
|
subAgentId: string;
|
|
237
237
|
targetAgentId: string;
|
|
@@ -248,11 +248,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
248
248
|
};
|
|
249
249
|
}) => Promise<{
|
|
250
250
|
id: string;
|
|
251
|
+
tenantId: string;
|
|
252
|
+
projectId: string;
|
|
253
|
+
agentId: string;
|
|
251
254
|
createdAt: string;
|
|
252
255
|
updatedAt: string;
|
|
253
|
-
agentId: string;
|
|
254
|
-
projectId: string;
|
|
255
|
-
tenantId: string;
|
|
256
256
|
headers: Record<string, string> | null;
|
|
257
257
|
subAgentId: string;
|
|
258
258
|
targetAgentId: string;
|
|
@@ -9,13 +9,13 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
9
9
|
subAgentId: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
12
|
name: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
agentId: string;
|
|
16
|
-
projectId: string;
|
|
17
|
-
tenantId: string;
|
|
18
13
|
description: string | null;
|
|
14
|
+
tenantId: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
agentId: string;
|
|
17
|
+
prompt: string | null;
|
|
18
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
19
19
|
models: {
|
|
20
20
|
base?: {
|
|
21
21
|
model?: string | undefined;
|
|
@@ -30,23 +30,23 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
30
30
|
providerOptions?: Record<string, any> | undefined;
|
|
31
31
|
} | undefined;
|
|
32
32
|
} | null;
|
|
33
|
-
prompt: string | null;
|
|
34
33
|
stopWhen: {
|
|
35
34
|
stepCountIs?: number | undefined;
|
|
36
35
|
} | null;
|
|
37
|
-
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: 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;
|
|
45
|
-
updatedAt: string;
|
|
46
|
-
agentId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
tenantId: string;
|
|
49
44
|
description: string | null;
|
|
45
|
+
tenantId: string;
|
|
46
|
+
projectId: string;
|
|
47
|
+
agentId: string;
|
|
48
|
+
prompt: string | null;
|
|
49
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
50
50
|
models: {
|
|
51
51
|
base?: {
|
|
52
52
|
model?: string | undefined;
|
|
@@ -61,11 +61,11 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
61
61
|
providerOptions?: Record<string, any> | undefined;
|
|
62
62
|
} | undefined;
|
|
63
63
|
} | null;
|
|
64
|
-
prompt: string | null;
|
|
65
64
|
stopWhen: {
|
|
66
65
|
stepCountIs?: number | undefined;
|
|
67
66
|
} | null;
|
|
68
|
-
|
|
67
|
+
createdAt: string;
|
|
68
|
+
updatedAt: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
71
71
|
scopes: AgentScopeConfig;
|
|
@@ -109,13 +109,13 @@ 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;
|
|
114
|
-
updatedAt: string;
|
|
115
|
-
agentId: string;
|
|
116
|
-
projectId: string;
|
|
117
|
-
tenantId: string;
|
|
118
113
|
description: string | null;
|
|
114
|
+
tenantId: string;
|
|
115
|
+
projectId: string;
|
|
116
|
+
agentId: string;
|
|
117
|
+
prompt: string | null;
|
|
118
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
119
119
|
models: {
|
|
120
120
|
base?: {
|
|
121
121
|
model?: string | undefined;
|
|
@@ -130,11 +130,11 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
130
130
|
providerOptions?: Record<string, any> | undefined;
|
|
131
131
|
} | undefined;
|
|
132
132
|
} | null;
|
|
133
|
-
prompt: string | null;
|
|
134
133
|
stopWhen: {
|
|
135
134
|
stepCountIs?: number | undefined;
|
|
136
135
|
} | null;
|
|
137
|
-
|
|
136
|
+
createdAt: string;
|
|
137
|
+
updatedAt: string;
|
|
138
138
|
}>;
|
|
139
139
|
declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
140
140
|
scopes: AgentScopeConfig;
|
|
@@ -19,12 +19,12 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
19
19
|
toolId: string;
|
|
20
20
|
}) => Promise<{
|
|
21
21
|
id: string;
|
|
22
|
-
createdAt: string;
|
|
23
22
|
name: string;
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
projectId: string;
|
|
26
|
-
tenantId: string;
|
|
27
23
|
description: string | null;
|
|
24
|
+
tenantId: string;
|
|
25
|
+
projectId: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
28
|
headers: Record<string, string> | null;
|
|
29
29
|
config: {
|
|
30
30
|
type: "mcp";
|
|
@@ -77,12 +77,12 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
77
77
|
}>;
|
|
78
78
|
declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
|
|
79
79
|
id: string;
|
|
80
|
-
createdAt: string;
|
|
81
80
|
name: string;
|
|
82
|
-
updatedAt: string;
|
|
83
|
-
projectId: string;
|
|
84
|
-
tenantId: string;
|
|
85
81
|
description: string | null;
|
|
82
|
+
tenantId: string;
|
|
83
|
+
projectId: string;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
updatedAt: string;
|
|
86
86
|
headers: Record<string, string> | null;
|
|
87
87
|
config: {
|
|
88
88
|
type: "mcp";
|
|
@@ -134,13 +134,13 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
134
134
|
}> | null;
|
|
135
135
|
}) => Promise<{
|
|
136
136
|
id: string;
|
|
137
|
+
tenantId: string;
|
|
138
|
+
projectId: string;
|
|
139
|
+
agentId: string;
|
|
137
140
|
createdAt: string;
|
|
138
141
|
updatedAt: string;
|
|
139
|
-
agentId: string;
|
|
140
|
-
projectId: string;
|
|
141
|
-
tenantId: string;
|
|
142
|
-
headers: Record<string, string> | null;
|
|
143
142
|
toolId: string;
|
|
143
|
+
headers: Record<string, string> | null;
|
|
144
144
|
toolPolicies: Record<string, {
|
|
145
145
|
needsApproval?: boolean;
|
|
146
146
|
}> | null;
|
|
@@ -153,13 +153,13 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
|
|
|
153
153
|
toolId: string;
|
|
154
154
|
}) => Promise<{
|
|
155
155
|
id: string;
|
|
156
|
+
tenantId: string;
|
|
157
|
+
projectId: string;
|
|
158
|
+
agentId: string;
|
|
156
159
|
createdAt: string;
|
|
157
160
|
updatedAt: string;
|
|
158
|
-
agentId: string;
|
|
159
|
-
projectId: string;
|
|
160
|
-
tenantId: string;
|
|
161
|
-
headers: Record<string, string> | null;
|
|
162
161
|
toolId: string;
|
|
162
|
+
headers: Record<string, string> | null;
|
|
163
163
|
toolPolicies: Record<string, {
|
|
164
164
|
needsApproval?: boolean;
|
|
165
165
|
}> | null;
|
|
@@ -181,13 +181,13 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
181
181
|
relationId?: string;
|
|
182
182
|
}) => Promise<{
|
|
183
183
|
id: string;
|
|
184
|
+
tenantId: string;
|
|
185
|
+
projectId: string;
|
|
186
|
+
agentId: string;
|
|
184
187
|
createdAt: string;
|
|
185
188
|
updatedAt: string;
|
|
186
|
-
agentId: string;
|
|
187
|
-
projectId: string;
|
|
188
|
-
tenantId: string;
|
|
189
|
-
headers: Record<string, string> | null;
|
|
190
189
|
toolId: string;
|
|
190
|
+
headers: Record<string, string> | null;
|
|
191
191
|
toolPolicies: Record<string, {
|
|
192
192
|
needsApproval?: boolean;
|
|
193
193
|
}> | null;
|
|
@@ -201,12 +201,12 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
201
201
|
data: ToolInsert;
|
|
202
202
|
}) => Promise<{
|
|
203
203
|
id: string;
|
|
204
|
-
createdAt: string;
|
|
205
204
|
name: string;
|
|
206
|
-
updatedAt: string;
|
|
207
|
-
projectId: string;
|
|
208
|
-
tenantId: string;
|
|
209
205
|
description: string | null;
|
|
206
|
+
tenantId: string;
|
|
207
|
+
projectId: string;
|
|
208
|
+
createdAt: string;
|
|
209
|
+
updatedAt: string;
|
|
210
210
|
headers: Record<string, string> | null;
|
|
211
211
|
config: {
|
|
212
212
|
type: "mcp";
|