@inkeep/agents-core 0.63.0 → 0.63.2
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 +86 -86
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +5 -2
- package/dist/client-exports.js +6 -2
- package/dist/data-access/index.d.ts +2 -2
- package/dist/data-access/index.js +2 -2
- package/dist/data-access/manage/agents.d.ts +14 -14
- package/dist/data-access/manage/artifactComponents.d.ts +6 -6
- package/dist/data-access/manage/contextConfigs.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/projectFull.js +42 -44
- package/dist/data-access/manage/skills.d.ts +82 -34
- package/dist/data-access/manage/skills.js +259 -46
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +21 -21
- 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/apps.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +503 -344
- package/dist/db/manage/manage-schema.js +52 -2
- package/dist/db/runtime/runtime-schema.d.ts +369 -369
- package/dist/index.d.ts +8 -5
- package/dist/index.js +7 -4
- package/dist/types/entities.d.ts +11 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/skill-files.d.ts +17 -0
- package/dist/utils/skill-files.js +29 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/drizzle-schema-helpers.js +1 -2
- package/dist/validation/index.d.ts +4 -2
- package/dist/validation/index.js +4 -2
- package/dist/validation/schemas/shared.d.ts +38 -0
- package/dist/validation/schemas/shared.js +63 -0
- package/dist/validation/schemas/skills.d.ts +602 -0
- package/dist/validation/schemas/skills.js +128 -0
- package/dist/validation/schemas.d.ts +2635 -3171
- package/dist/validation/schemas.js +4 -109
- package/drizzle/manage/0014_complex_firebird.sql +15 -0
- package/drizzle/manage/0015_backfill_skill_files.sql +61 -0
- package/drizzle/manage/meta/0014_snapshot.json +3821 -0
- package/drizzle/manage/meta/0015_snapshot.json +3821 -0
- package/drizzle/manage/meta/_journal.json +14 -0
- package/package.json +4 -2
|
@@ -12,9 +12,10 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
12
12
|
}) => Promise<{
|
|
13
13
|
id: string;
|
|
14
14
|
name: string;
|
|
15
|
+
description: string | null;
|
|
15
16
|
createdAt: string;
|
|
16
17
|
updatedAt: string;
|
|
17
|
-
|
|
18
|
+
projectId: string;
|
|
18
19
|
tenantId: string;
|
|
19
20
|
models: {
|
|
20
21
|
base?: {
|
|
@@ -33,10 +34,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
33
34
|
stopWhen: {
|
|
34
35
|
transferCountIs?: number | undefined;
|
|
35
36
|
} | null;
|
|
36
|
-
|
|
37
|
+
prompt: string | null;
|
|
37
38
|
defaultSubAgentId: string | null;
|
|
38
39
|
contextConfigId: string | null;
|
|
39
|
-
prompt: string | null;
|
|
40
40
|
statusUpdates: {
|
|
41
41
|
enabled?: boolean | undefined;
|
|
42
42
|
numEvents?: number | undefined;
|
|
@@ -59,9 +59,10 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
59
59
|
}) => Promise<{
|
|
60
60
|
id: string;
|
|
61
61
|
name: string;
|
|
62
|
+
description: string | null;
|
|
62
63
|
createdAt: string;
|
|
63
64
|
updatedAt: string;
|
|
64
|
-
|
|
65
|
+
projectId: string;
|
|
65
66
|
tenantId: string;
|
|
66
67
|
models: {
|
|
67
68
|
base?: {
|
|
@@ -80,10 +81,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
80
81
|
stopWhen: {
|
|
81
82
|
transferCountIs?: number | undefined;
|
|
82
83
|
} | null;
|
|
83
|
-
|
|
84
|
+
prompt: string | null;
|
|
84
85
|
defaultSubAgentId: string | null;
|
|
85
86
|
contextConfigId: string | null;
|
|
86
|
-
prompt: string | null;
|
|
87
87
|
statusUpdates: {
|
|
88
88
|
enabled?: boolean | undefined;
|
|
89
89
|
numEvents?: number | undefined;
|
|
@@ -103,9 +103,10 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
103
103
|
defaultSubAgent: {
|
|
104
104
|
id: string;
|
|
105
105
|
name: string;
|
|
106
|
+
description: string | null;
|
|
106
107
|
createdAt: string;
|
|
107
108
|
updatedAt: string;
|
|
108
|
-
|
|
109
|
+
projectId: string;
|
|
109
110
|
tenantId: string;
|
|
110
111
|
models: {
|
|
111
112
|
base?: {
|
|
@@ -124,7 +125,6 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
124
125
|
stopWhen: {
|
|
125
126
|
stepCountIs?: number | undefined;
|
|
126
127
|
} | null;
|
|
127
|
-
projectId: string;
|
|
128
128
|
agentId: string;
|
|
129
129
|
prompt: string | null;
|
|
130
130
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
@@ -135,9 +135,10 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
135
135
|
}) => Promise<{
|
|
136
136
|
id: string;
|
|
137
137
|
name: string;
|
|
138
|
+
description: string | null;
|
|
138
139
|
createdAt: string;
|
|
139
140
|
updatedAt: string;
|
|
140
|
-
|
|
141
|
+
projectId: string;
|
|
141
142
|
tenantId: string;
|
|
142
143
|
models: {
|
|
143
144
|
base?: {
|
|
@@ -156,10 +157,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
156
157
|
stopWhen: {
|
|
157
158
|
transferCountIs?: number | undefined;
|
|
158
159
|
} | null;
|
|
159
|
-
|
|
160
|
+
prompt: string | null;
|
|
160
161
|
defaultSubAgentId: string | null;
|
|
161
162
|
contextConfigId: string | null;
|
|
162
|
-
prompt: string | null;
|
|
163
163
|
statusUpdates: {
|
|
164
164
|
enabled?: boolean | undefined;
|
|
165
165
|
numEvents?: number | undefined;
|
|
@@ -253,9 +253,10 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
253
253
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
254
254
|
id: string;
|
|
255
255
|
name: string;
|
|
256
|
+
description: string | null;
|
|
256
257
|
createdAt: string;
|
|
257
258
|
updatedAt: string;
|
|
258
|
-
|
|
259
|
+
projectId: string;
|
|
259
260
|
tenantId: string;
|
|
260
261
|
models: {
|
|
261
262
|
base?: {
|
|
@@ -274,10 +275,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
274
275
|
stopWhen: {
|
|
275
276
|
transferCountIs?: number | undefined;
|
|
276
277
|
} | null;
|
|
277
|
-
|
|
278
|
+
prompt: string | null;
|
|
278
279
|
defaultSubAgentId: string | null;
|
|
279
280
|
contextConfigId: string | null;
|
|
280
|
-
prompt: string | null;
|
|
281
281
|
statusUpdates: {
|
|
282
282
|
enabled?: boolean | undefined;
|
|
283
283
|
numEvents?: number | undefined;
|
|
@@ -11,11 +11,11 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
13
|
name: string;
|
|
14
|
+
description: string | null;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
|
-
description: string | null;
|
|
17
|
-
tenantId: string;
|
|
18
17
|
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
props: {
|
|
20
20
|
[x: string]: unknown;
|
|
21
21
|
type: "object";
|
|
@@ -67,11 +67,11 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
67
67
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
68
68
|
id: string;
|
|
69
69
|
name: string;
|
|
70
|
+
description: string | null;
|
|
70
71
|
createdAt: string;
|
|
71
72
|
updatedAt: string;
|
|
72
|
-
description: string | null;
|
|
73
|
-
tenantId: string;
|
|
74
73
|
projectId: string;
|
|
74
|
+
tenantId: string;
|
|
75
75
|
props: {
|
|
76
76
|
[x: string]: unknown;
|
|
77
77
|
type: "object";
|
|
@@ -143,8 +143,8 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
143
143
|
}) => Promise<{
|
|
144
144
|
id: string;
|
|
145
145
|
createdAt: string;
|
|
146
|
-
tenantId: string;
|
|
147
146
|
projectId: string;
|
|
147
|
+
tenantId: string;
|
|
148
148
|
agentId: string;
|
|
149
149
|
subAgentId: string;
|
|
150
150
|
artifactComponentId: string;
|
|
@@ -186,8 +186,8 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
186
186
|
}) => Promise<{
|
|
187
187
|
id: string;
|
|
188
188
|
createdAt: string;
|
|
189
|
-
tenantId: string;
|
|
190
189
|
projectId: string;
|
|
190
|
+
tenantId: string;
|
|
191
191
|
agentId: string;
|
|
192
192
|
subAgentId: string;
|
|
193
193
|
artifactComponentId: string;
|
|
@@ -12,8 +12,8 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
tenantId: string;
|
|
16
15
|
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
17
|
agentId: string;
|
|
18
18
|
headersSchema: unknown;
|
|
19
19
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
@@ -24,8 +24,8 @@ declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
24
24
|
id: string;
|
|
25
25
|
createdAt: string;
|
|
26
26
|
updatedAt: string;
|
|
27
|
-
tenantId: string;
|
|
28
27
|
projectId: string;
|
|
28
|
+
tenantId: string;
|
|
29
29
|
agentId: string;
|
|
30
30
|
headersSchema: unknown;
|
|
31
31
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
@@ -46,8 +46,8 @@ declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
46
46
|
id: string;
|
|
47
47
|
createdAt: string;
|
|
48
48
|
updatedAt: string;
|
|
49
|
-
tenantId: string;
|
|
50
49
|
projectId: string;
|
|
50
|
+
tenantId: string;
|
|
51
51
|
agentId: string;
|
|
52
52
|
headersSchema: unknown;
|
|
53
53
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
@@ -86,8 +86,8 @@ declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params:
|
|
|
86
86
|
id: string;
|
|
87
87
|
createdAt: string;
|
|
88
88
|
updatedAt: string;
|
|
89
|
-
tenantId: string;
|
|
90
89
|
projectId: string;
|
|
90
|
+
tenantId: string;
|
|
91
91
|
agentId: string;
|
|
92
92
|
headersSchema: unknown;
|
|
93
93
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
@@ -67,8 +67,8 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
67
67
|
}) => Promise<{
|
|
68
68
|
id: string;
|
|
69
69
|
createdAt: string;
|
|
70
|
-
tenantId: string;
|
|
71
70
|
projectId: string;
|
|
71
|
+
tenantId: string;
|
|
72
72
|
agentId: string;
|
|
73
73
|
subAgentId: string;
|
|
74
74
|
dataComponentId: string;
|
|
@@ -109,8 +109,8 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
109
109
|
}) => Promise<{
|
|
110
110
|
id: string;
|
|
111
111
|
createdAt: string;
|
|
112
|
-
tenantId: string;
|
|
113
112
|
projectId: string;
|
|
113
|
+
tenantId: string;
|
|
114
114
|
agentId: string;
|
|
115
115
|
subAgentId: string;
|
|
116
116
|
dataComponentId: string;
|
|
@@ -55,11 +55,11 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
55
55
|
}) => Promise<{
|
|
56
56
|
id: string;
|
|
57
57
|
name: string;
|
|
58
|
+
description: string | null;
|
|
58
59
|
createdAt: string;
|
|
59
60
|
updatedAt: string;
|
|
60
|
-
description: string | null;
|
|
61
|
-
tenantId: string;
|
|
62
61
|
projectId: string;
|
|
62
|
+
tenantId: string;
|
|
63
63
|
agentId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
@@ -97,11 +97,11 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
97
97
|
}) => Promise<{
|
|
98
98
|
id: string;
|
|
99
99
|
name: string;
|
|
100
|
+
description: string | null;
|
|
100
101
|
createdAt: string;
|
|
101
102
|
updatedAt: string;
|
|
102
|
-
description: string | null;
|
|
103
|
-
tenantId: string;
|
|
104
103
|
projectId: string;
|
|
104
|
+
tenantId: string;
|
|
105
105
|
agentId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
@@ -160,14 +160,14 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
160
160
|
id: string;
|
|
161
161
|
createdAt: string;
|
|
162
162
|
updatedAt: string;
|
|
163
|
-
tenantId: string;
|
|
164
163
|
projectId: string;
|
|
164
|
+
tenantId: string;
|
|
165
165
|
agentId: string;
|
|
166
166
|
subAgentId: string;
|
|
167
|
+
functionToolId: string;
|
|
167
168
|
toolPolicies: Record<string, {
|
|
168
169
|
needsApproval?: boolean;
|
|
169
170
|
}> | null;
|
|
170
|
-
functionToolId: string;
|
|
171
171
|
}>;
|
|
172
172
|
/**
|
|
173
173
|
* Update an agent-function tool relation
|
|
@@ -225,14 +225,14 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
225
225
|
id: string;
|
|
226
226
|
createdAt: string;
|
|
227
227
|
updatedAt: string;
|
|
228
|
-
tenantId: string;
|
|
229
228
|
projectId: string;
|
|
229
|
+
tenantId: string;
|
|
230
230
|
agentId: string;
|
|
231
231
|
subAgentId: string;
|
|
232
|
+
functionToolId: string;
|
|
232
233
|
toolPolicies: Record<string, {
|
|
233
234
|
needsApproval?: boolean;
|
|
234
235
|
}> | null;
|
|
235
|
-
functionToolId: string;
|
|
236
236
|
}>;
|
|
237
237
|
//#endregion
|
|
238
238
|
export { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLogger } from "../../utils/logger.js";
|
|
2
2
|
import { deleteExternalAgent, listExternalAgents, upsertExternalAgent } from "./externalAgents.js";
|
|
3
3
|
import { deleteFunction, listFunctions, upsertFunction } from "./functions.js";
|
|
4
|
-
import {
|
|
4
|
+
import { listSkillsWithFiles, upsertSkill } from "./skills.js";
|
|
5
5
|
import { deleteCredentialReference, listCredentialReferences, upsertCredentialReference } from "./credentialReferences.js";
|
|
6
6
|
import { deleteTool, listTools, upsertTool } from "./tools.js";
|
|
7
7
|
import { listAgents } from "./agents.js";
|
|
@@ -48,27 +48,24 @@ const createFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
48
48
|
projectId: typed.id,
|
|
49
49
|
count: Object.keys(typed.skills).length
|
|
50
50
|
}, "Creating project skills");
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
await Promise.all(skillPromises);
|
|
51
|
+
for (const [skillId, skill] of Object.entries(typed.skills)) try {
|
|
52
|
+
await upsertSkill(db)({
|
|
53
|
+
...skill,
|
|
54
|
+
tenantId,
|
|
55
|
+
projectId: typed.id
|
|
56
|
+
});
|
|
57
|
+
logger.info({
|
|
58
|
+
projectId: typed.id,
|
|
59
|
+
skillId
|
|
60
|
+
}, "Skill processed");
|
|
61
|
+
} catch (error) {
|
|
62
|
+
logger.error({
|
|
63
|
+
projectId: typed.id,
|
|
64
|
+
skillId,
|
|
65
|
+
error
|
|
66
|
+
}, "Failed to create skill");
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
72
69
|
logger.info({
|
|
73
70
|
projectId: typed.id,
|
|
74
71
|
count: Object.keys(typed.skills).length
|
|
@@ -446,27 +443,24 @@ const updateFullProjectServerSide = (db, logger = defaultLogger) => async (param
|
|
|
446
443
|
projectId: typed.id,
|
|
447
444
|
count: Object.keys(typed.skills).length
|
|
448
445
|
}, "Updating project skills");
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
await Promise.all(skillPromises);
|
|
446
|
+
for (const [skillId, skill] of Object.entries(typed.skills)) try {
|
|
447
|
+
await upsertSkill(db)({
|
|
448
|
+
...skill,
|
|
449
|
+
tenantId,
|
|
450
|
+
projectId: typed.id
|
|
451
|
+
});
|
|
452
|
+
logger.info({
|
|
453
|
+
projectId: typed.id,
|
|
454
|
+
skillId
|
|
455
|
+
}, "Skill processed");
|
|
456
|
+
} catch (error) {
|
|
457
|
+
logger.error({
|
|
458
|
+
projectId: typed.id,
|
|
459
|
+
skillId,
|
|
460
|
+
error
|
|
461
|
+
}, "Failed to update skill");
|
|
462
|
+
throw error;
|
|
463
|
+
}
|
|
470
464
|
logger.info({
|
|
471
465
|
projectId: typed.id,
|
|
472
466
|
count: Object.keys(typed.skills).length
|
|
@@ -1095,7 +1089,7 @@ const getFullProjectInternal = (db, logger = defaultLogger) => async (params) =>
|
|
|
1095
1089
|
}
|
|
1096
1090
|
const projectSkills = {};
|
|
1097
1091
|
try {
|
|
1098
|
-
const skillsList = await
|
|
1092
|
+
const skillsList = await listSkillsWithFiles(db)({
|
|
1099
1093
|
scopes: {
|
|
1100
1094
|
tenantId,
|
|
1101
1095
|
projectId
|
|
@@ -1111,6 +1105,10 @@ const getFullProjectInternal = (db, logger = defaultLogger) => async (params) =>
|
|
|
1111
1105
|
description: skill.description,
|
|
1112
1106
|
content: skill.content,
|
|
1113
1107
|
metadata: skill.metadata,
|
|
1108
|
+
files: skill.files.map((file) => ({
|
|
1109
|
+
filePath: file.filePath,
|
|
1110
|
+
content: file.content
|
|
1111
|
+
})),
|
|
1114
1112
|
createdAt: skill.createdAt,
|
|
1115
1113
|
updatedAt: skill.updatedAt
|
|
1116
1114
|
};
|
|
@@ -1,23 +1,55 @@
|
|
|
1
1
|
import { AgentScopeConfig, ProjectScopeConfig, SubAgentScopeConfig } from "../../db/manage/scope-definitions.js";
|
|
2
2
|
import { PaginationConfig } from "../../types/utility.js";
|
|
3
3
|
import { AgentsManageDatabaseClient } from "../../db/manage/manage-client.js";
|
|
4
|
-
import {
|
|
4
|
+
import { SkillApiInsert, SkillApiUpdate, SkillFileApiInsert, SkillFileSelect, SkillSelect, SubAgentSkillWithIndex } from "../../types/entities.js";
|
|
5
5
|
|
|
6
6
|
//#region src/data-access/manage/skills.d.ts
|
|
7
|
+
interface SkillRecordWithFiles extends SkillSelect {
|
|
8
|
+
files: SkillFileSelect[];
|
|
9
|
+
}
|
|
10
|
+
declare const getSkillFilesBySkillIds: (db: AgentsManageDatabaseClient) => (params: {
|
|
11
|
+
scopes: ProjectScopeConfig;
|
|
12
|
+
skillIds: string[];
|
|
13
|
+
}) => Promise<Record<string, SkillFileSelect[]>>;
|
|
7
14
|
declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
8
15
|
scopes: ProjectScopeConfig;
|
|
9
16
|
skillId: string;
|
|
10
17
|
}) => Promise<{
|
|
11
18
|
id: string;
|
|
12
19
|
name: string;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
metadata: Record<string, string> | null;
|
|
16
20
|
description: string;
|
|
17
|
-
tenantId: string;
|
|
18
21
|
content: string;
|
|
22
|
+
metadata: Record<string, string> | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
19
25
|
projectId: string;
|
|
26
|
+
tenantId: string;
|
|
20
27
|
} | null>;
|
|
28
|
+
declare const getSkillByIdWithFiles: (db: AgentsManageDatabaseClient) => (params: {
|
|
29
|
+
scopes: ProjectScopeConfig;
|
|
30
|
+
skillId: string;
|
|
31
|
+
}) => Promise<SkillRecordWithFiles | null>;
|
|
32
|
+
declare const getSkillFileById: (db: AgentsManageDatabaseClient) => (params: {
|
|
33
|
+
scopes: ProjectScopeConfig;
|
|
34
|
+
skillId: string;
|
|
35
|
+
fileId: string;
|
|
36
|
+
}) => Promise<SkillFileSelect | null>;
|
|
37
|
+
declare const createSkillFileById: (db: AgentsManageDatabaseClient) => (params: {
|
|
38
|
+
scopes: ProjectScopeConfig;
|
|
39
|
+
skillId: string;
|
|
40
|
+
data: SkillFileApiInsert;
|
|
41
|
+
}) => Promise<SkillFileSelect | null>;
|
|
42
|
+
declare const updateSkillFileById: (db: AgentsManageDatabaseClient) => (params: {
|
|
43
|
+
scopes: ProjectScopeConfig;
|
|
44
|
+
skillId: string;
|
|
45
|
+
fileId: string;
|
|
46
|
+
content: string;
|
|
47
|
+
}) => Promise<SkillFileSelect | null>;
|
|
48
|
+
declare const deleteSkillFileById: (db: AgentsManageDatabaseClient) => (params: {
|
|
49
|
+
scopes: ProjectScopeConfig;
|
|
50
|
+
skillId: string;
|
|
51
|
+
fileId: string;
|
|
52
|
+
}) => Promise<boolean | null>;
|
|
21
53
|
declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
54
|
scopes: ProjectScopeConfig;
|
|
23
55
|
pagination?: PaginationConfig;
|
|
@@ -40,43 +72,59 @@ declare const listSkills: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
40
72
|
pages: number;
|
|
41
73
|
};
|
|
42
74
|
}>;
|
|
43
|
-
declare const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
75
|
+
declare const listSkillsWithFiles: (db: AgentsManageDatabaseClient) => (params: {
|
|
76
|
+
scopes: ProjectScopeConfig;
|
|
77
|
+
pagination?: PaginationConfig;
|
|
78
|
+
}) => Promise<{
|
|
79
|
+
data: {
|
|
80
|
+
files: {
|
|
81
|
+
createdAt: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
skillId: string;
|
|
84
|
+
filePath: string;
|
|
85
|
+
content: string;
|
|
86
|
+
projectId: string;
|
|
87
|
+
tenantId: string;
|
|
88
|
+
id: string;
|
|
89
|
+
}[];
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
content: string;
|
|
96
|
+
metadata: Record<string, string> | null;
|
|
97
|
+
projectId: string;
|
|
98
|
+
tenantId: string;
|
|
99
|
+
}[];
|
|
100
|
+
pagination: {
|
|
101
|
+
page: number;
|
|
102
|
+
limit: number;
|
|
103
|
+
total: number;
|
|
104
|
+
pages: number;
|
|
105
|
+
};
|
|
53
106
|
}>;
|
|
54
|
-
|
|
55
|
-
id: string;
|
|
56
|
-
name: string;
|
|
57
|
-
createdAt: string;
|
|
58
|
-
updatedAt: string;
|
|
59
|
-
metadata: Record<string, string> | null;
|
|
60
|
-
description: string;
|
|
107
|
+
interface WithTenantIdProjectId {
|
|
61
108
|
tenantId: string;
|
|
62
|
-
content: string;
|
|
63
109
|
projectId: string;
|
|
64
|
-
}
|
|
65
|
-
declare const
|
|
66
|
-
|
|
67
|
-
skillId: string;
|
|
68
|
-
data: SkillUpdate;
|
|
69
|
-
}) => Promise<{
|
|
70
|
-
createdAt: string;
|
|
71
|
-
updatedAt: string;
|
|
110
|
+
}
|
|
111
|
+
declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<SkillRecordWithFiles>;
|
|
112
|
+
declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<{
|
|
72
113
|
id: string;
|
|
73
114
|
name: string;
|
|
74
115
|
description: string;
|
|
75
116
|
content: string;
|
|
76
117
|
metadata: Record<string, string> | null;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
updatedAt: string;
|
|
77
120
|
projectId: string;
|
|
78
121
|
tenantId: string;
|
|
79
122
|
}>;
|
|
123
|
+
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
124
|
+
scopes: ProjectScopeConfig;
|
|
125
|
+
skillId: string;
|
|
126
|
+
data: SkillApiUpdate;
|
|
127
|
+
}) => Promise<SkillRecordWithFiles | null>;
|
|
80
128
|
declare const deleteSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
81
129
|
scopes: ProjectScopeConfig;
|
|
82
130
|
skillId: string;
|
|
@@ -94,17 +142,17 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
94
142
|
id: string;
|
|
95
143
|
createdAt: string;
|
|
96
144
|
updatedAt: string;
|
|
97
|
-
tenantId: string;
|
|
98
145
|
projectId: string;
|
|
146
|
+
tenantId: string;
|
|
99
147
|
agentId: string;
|
|
100
148
|
subAgentId: string;
|
|
101
|
-
skillId: string;
|
|
102
149
|
index: number;
|
|
103
150
|
alwaysLoaded: boolean;
|
|
151
|
+
skillId: string;
|
|
104
152
|
}>;
|
|
105
153
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
106
154
|
scopes: AgentScopeConfig;
|
|
107
155
|
subAgentSkillId: string;
|
|
108
156
|
}) => Promise<boolean>;
|
|
109
157
|
//#endregion
|
|
110
|
-
export { createSkill, deleteSkill, deleteSubAgentSkill, getSkillById, getSkillsForSubAgents, listSkills, updateSkill, upsertSkill, upsertSubAgentSkill };
|
|
158
|
+
export { createSkill, createSkillFileById, deleteSkill, deleteSkillFileById, deleteSubAgentSkill, getSkillById, getSkillByIdWithFiles, getSkillFileById, getSkillFilesBySkillIds, getSkillsForSubAgents, listSkills, listSkillsWithFiles, updateSkill, updateSkillFileById, upsertSkill, upsertSubAgentSkill };
|