@inkeep/agents-core 0.63.1 → 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/auth.d.ts +6 -6
- package/dist/auth/permissions.d.ts +13 -13
- 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 +30 -30
- package/dist/data-access/manage/artifactComponents.d.ts +12 -12
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +6 -6
- package/dist/data-access/manage/functionTools.d.ts +18 -18
- package/dist/data-access/manage/projectFull.js +42 -44
- package/dist/data-access/manage/skills.d.ts +85 -37
- package/dist/data-access/manage/skills.js +259 -46
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +30 -30
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +18 -18
- package/dist/data-access/manage/tools.d.ts +33 -33
- package/dist/data-access/manage/triggers.d.ts +1 -1
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/apps.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +20 -20
- package/dist/data-access/runtime/messages.d.ts +24 -24
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/db/manage/manage-schema.d.ts +163 -4
- 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/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 +2741 -3277
- 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
|
@@ -10,11 +10,13 @@ import { PgColumn } from "drizzle-orm/pg-core";
|
|
|
10
10
|
declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
11
11
|
scopes: AgentScopeConfig;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
description: string | null;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
13
|
id: string;
|
|
17
14
|
name: string;
|
|
15
|
+
description: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
tenantId: string;
|
|
18
20
|
models: {
|
|
19
21
|
base?: {
|
|
20
22
|
model?: string | undefined;
|
|
@@ -32,11 +34,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
32
34
|
stopWhen: {
|
|
33
35
|
transferCountIs?: number | undefined;
|
|
34
36
|
} | null;
|
|
35
|
-
|
|
36
|
-
updatedAt: string;
|
|
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;
|
|
@@ -57,11 +57,13 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
57
57
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
58
58
|
scopes: AgentScopeConfig;
|
|
59
59
|
}) => Promise<{
|
|
60
|
-
description: string | null;
|
|
61
|
-
tenantId: string;
|
|
62
|
-
projectId: string;
|
|
63
60
|
id: string;
|
|
64
61
|
name: string;
|
|
62
|
+
description: string | null;
|
|
63
|
+
createdAt: string;
|
|
64
|
+
updatedAt: string;
|
|
65
|
+
projectId: string;
|
|
66
|
+
tenantId: string;
|
|
65
67
|
models: {
|
|
66
68
|
base?: {
|
|
67
69
|
model?: string | undefined;
|
|
@@ -79,11 +81,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
79
81
|
stopWhen: {
|
|
80
82
|
transferCountIs?: number | undefined;
|
|
81
83
|
} | null;
|
|
82
|
-
|
|
83
|
-
updatedAt: string;
|
|
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;
|
|
@@ -101,12 +101,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
101
101
|
} | null;
|
|
102
102
|
executionMode: "classic" | "durable";
|
|
103
103
|
defaultSubAgent: {
|
|
104
|
-
description: string | null;
|
|
105
|
-
tenantId: string;
|
|
106
|
-
projectId: string;
|
|
107
|
-
agentId: string;
|
|
108
104
|
id: string;
|
|
109
105
|
name: string;
|
|
106
|
+
description: string | null;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
projectId: string;
|
|
110
|
+
tenantId: string;
|
|
110
111
|
models: {
|
|
111
112
|
base?: {
|
|
112
113
|
model?: string | undefined;
|
|
@@ -124,8 +125,7 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
124
125
|
stopWhen: {
|
|
125
126
|
stepCountIs?: number | undefined;
|
|
126
127
|
} | null;
|
|
127
|
-
|
|
128
|
-
updatedAt: string;
|
|
128
|
+
agentId: string;
|
|
129
129
|
prompt: string | null;
|
|
130
130
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
131
131
|
} | null;
|
|
@@ -133,11 +133,13 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
133
133
|
declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
134
134
|
scopes: ProjectScopeConfig;
|
|
135
135
|
}) => Promise<{
|
|
136
|
-
description: string | null;
|
|
137
|
-
tenantId: string;
|
|
138
|
-
projectId: string;
|
|
139
136
|
id: string;
|
|
140
137
|
name: string;
|
|
138
|
+
description: string | null;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
projectId: string;
|
|
142
|
+
tenantId: string;
|
|
141
143
|
models: {
|
|
142
144
|
base?: {
|
|
143
145
|
model?: string | undefined;
|
|
@@ -155,11 +157,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
155
157
|
stopWhen: {
|
|
156
158
|
transferCountIs?: number | undefined;
|
|
157
159
|
} | null;
|
|
158
|
-
|
|
159
|
-
updatedAt: string;
|
|
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;
|
|
@@ -251,11 +251,13 @@ declare function listAgentsAcrossProjectMainBranches(db: AgentsManageDatabaseCli
|
|
|
251
251
|
projectIds: string[];
|
|
252
252
|
}): Promise<AvailableAgentInfo[]>;
|
|
253
253
|
declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInsert) => Promise<{
|
|
254
|
-
description: string | null;
|
|
255
|
-
tenantId: string;
|
|
256
|
-
projectId: string;
|
|
257
254
|
id: string;
|
|
258
255
|
name: string;
|
|
256
|
+
description: string | null;
|
|
257
|
+
createdAt: string;
|
|
258
|
+
updatedAt: string;
|
|
259
|
+
projectId: string;
|
|
260
|
+
tenantId: string;
|
|
259
261
|
models: {
|
|
260
262
|
base?: {
|
|
261
263
|
model?: string | undefined;
|
|
@@ -273,11 +275,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
273
275
|
stopWhen: {
|
|
274
276
|
transferCountIs?: number | undefined;
|
|
275
277
|
} | null;
|
|
276
|
-
|
|
277
|
-
updatedAt: string;
|
|
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;
|
|
@@ -9,13 +9,13 @@ declare const getArtifactComponentById: (db: AgentsManageDatabaseClient) => (par
|
|
|
9
9
|
scopes: ProjectScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
description: string | null;
|
|
13
|
-
tenantId: string;
|
|
14
|
-
projectId: string;
|
|
15
12
|
id: string;
|
|
16
13
|
name: string;
|
|
14
|
+
description: string | null;
|
|
17
15
|
createdAt: string;
|
|
18
16
|
updatedAt: string;
|
|
17
|
+
projectId: string;
|
|
18
|
+
tenantId: string;
|
|
19
19
|
props: {
|
|
20
20
|
[x: string]: unknown;
|
|
21
21
|
type: "object";
|
|
@@ -65,13 +65,13 @@ declare const listArtifactComponentsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
};
|
|
66
66
|
}>;
|
|
67
67
|
declare const createArtifactComponent: (db: AgentsManageDatabaseClient) => (params: ArtifactComponentInsert) => Promise<{
|
|
68
|
-
description: string | null;
|
|
69
|
-
tenantId: string;
|
|
70
|
-
projectId: string;
|
|
71
68
|
id: string;
|
|
72
69
|
name: string;
|
|
70
|
+
description: string | null;
|
|
73
71
|
createdAt: string;
|
|
74
72
|
updatedAt: string;
|
|
73
|
+
projectId: string;
|
|
74
|
+
tenantId: string;
|
|
75
75
|
props: {
|
|
76
76
|
[x: string]: unknown;
|
|
77
77
|
type: "object";
|
|
@@ -141,12 +141,12 @@ declare const associateArtifactComponentWithAgent: (db: AgentsManageDatabaseClie
|
|
|
141
141
|
scopes: SubAgentScopeConfig;
|
|
142
142
|
artifactComponentId: string;
|
|
143
143
|
}) => Promise<{
|
|
144
|
-
|
|
144
|
+
id: string;
|
|
145
|
+
createdAt: string;
|
|
145
146
|
projectId: string;
|
|
147
|
+
tenantId: string;
|
|
146
148
|
agentId: string;
|
|
147
149
|
subAgentId: string;
|
|
148
|
-
id: string;
|
|
149
|
-
createdAt: string;
|
|
150
150
|
artifactComponentId: string;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeArtifactComponentFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -184,12 +184,12 @@ declare const upsertAgentArtifactComponentRelation: (db: AgentsManageDatabaseCli
|
|
|
184
184
|
scopes: SubAgentScopeConfig;
|
|
185
185
|
artifactComponentId: string;
|
|
186
186
|
}) => Promise<{
|
|
187
|
-
|
|
187
|
+
id: string;
|
|
188
|
+
createdAt: string;
|
|
188
189
|
projectId: string;
|
|
190
|
+
tenantId: string;
|
|
189
191
|
agentId: string;
|
|
190
192
|
subAgentId: string;
|
|
191
|
-
id: string;
|
|
192
|
-
createdAt: string;
|
|
193
193
|
artifactComponentId: string;
|
|
194
194
|
} | null>;
|
|
195
195
|
/**
|
|
@@ -9,24 +9,24 @@ declare const getContextConfigById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
id: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
tenantId: string;
|
|
13
|
-
projectId: string;
|
|
14
|
-
agentId: string;
|
|
15
12
|
id: string;
|
|
16
13
|
createdAt: string;
|
|
17
14
|
updatedAt: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
agentId: string;
|
|
18
18
|
headersSchema: unknown;
|
|
19
19
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
20
20
|
} | undefined>;
|
|
21
21
|
declare const listContextConfigs: (db: AgentsManageDatabaseClient) => (params: {
|
|
22
22
|
scopes: AgentScopeConfig;
|
|
23
23
|
}) => Promise<{
|
|
24
|
-
tenantId: string;
|
|
25
|
-
projectId: string;
|
|
26
|
-
agentId: string;
|
|
27
24
|
id: string;
|
|
28
25
|
createdAt: string;
|
|
29
26
|
updatedAt: string;
|
|
27
|
+
projectId: string;
|
|
28
|
+
tenantId: string;
|
|
29
|
+
agentId: string;
|
|
30
30
|
headersSchema: unknown;
|
|
31
31
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
32
32
|
}[]>;
|
|
@@ -43,12 +43,12 @@ declare const listContextConfigsPaginated: (db: AgentsManageDatabaseClient) => (
|
|
|
43
43
|
};
|
|
44
44
|
}>;
|
|
45
45
|
declare const createContextConfig: (db: AgentsManageDatabaseClient) => (params: ContextConfigInsert) => Promise<{
|
|
46
|
-
tenantId: string;
|
|
47
|
-
projectId: string;
|
|
48
|
-
agentId: string;
|
|
49
46
|
id: string;
|
|
50
47
|
createdAt: string;
|
|
51
48
|
updatedAt: string;
|
|
49
|
+
projectId: string;
|
|
50
|
+
tenantId: string;
|
|
51
|
+
agentId: string;
|
|
52
52
|
headersSchema: unknown;
|
|
53
53
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
54
54
|
}>;
|
|
@@ -83,12 +83,12 @@ declare const countContextConfigs: (db: AgentsManageDatabaseClient) => (params:
|
|
|
83
83
|
declare const upsertContextConfig: (db: AgentsManageDatabaseClient) => (params: {
|
|
84
84
|
data: ContextConfigInsert;
|
|
85
85
|
}) => Promise<{
|
|
86
|
-
tenantId: string;
|
|
87
|
-
projectId: string;
|
|
88
|
-
agentId: string;
|
|
89
86
|
id: string;
|
|
90
87
|
createdAt: string;
|
|
91
88
|
updatedAt: string;
|
|
89
|
+
projectId: string;
|
|
90
|
+
tenantId: string;
|
|
91
|
+
agentId: string;
|
|
92
92
|
headersSchema: unknown;
|
|
93
93
|
contextVariables: Record<string, ContextFetchDefinition> | null;
|
|
94
94
|
}>;
|
|
@@ -65,12 +65,12 @@ declare const associateDataComponentWithAgent: (db: AgentsManageDatabaseClient)
|
|
|
65
65
|
scopes: SubAgentScopeConfig;
|
|
66
66
|
dataComponentId: string;
|
|
67
67
|
}) => Promise<{
|
|
68
|
-
|
|
68
|
+
id: string;
|
|
69
|
+
createdAt: string;
|
|
69
70
|
projectId: string;
|
|
71
|
+
tenantId: string;
|
|
70
72
|
agentId: string;
|
|
71
73
|
subAgentId: string;
|
|
72
|
-
id: string;
|
|
73
|
-
createdAt: string;
|
|
74
74
|
dataComponentId: string;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
@@ -107,12 +107,12 @@ declare const upsertAgentDataComponentRelation: (db: AgentsManageDatabaseClient)
|
|
|
107
107
|
scopes: SubAgentScopeConfig;
|
|
108
108
|
dataComponentId: string;
|
|
109
109
|
}) => Promise<{
|
|
110
|
-
|
|
110
|
+
id: string;
|
|
111
|
+
createdAt: string;
|
|
111
112
|
projectId: string;
|
|
113
|
+
tenantId: string;
|
|
112
114
|
agentId: string;
|
|
113
115
|
subAgentId: string;
|
|
114
|
-
id: string;
|
|
115
|
-
createdAt: string;
|
|
116
116
|
dataComponentId: string;
|
|
117
117
|
} | null>;
|
|
118
118
|
/**
|
|
@@ -53,14 +53,14 @@ declare const createFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
53
53
|
data: FunctionToolApiInsert;
|
|
54
54
|
scopes: AgentScopeConfig;
|
|
55
55
|
}) => Promise<{
|
|
56
|
-
description: string | null;
|
|
57
|
-
tenantId: string;
|
|
58
|
-
projectId: string;
|
|
59
|
-
agentId: string;
|
|
60
56
|
id: string;
|
|
61
57
|
name: string;
|
|
58
|
+
description: string | null;
|
|
62
59
|
createdAt: string;
|
|
63
60
|
updatedAt: string;
|
|
61
|
+
projectId: string;
|
|
62
|
+
tenantId: string;
|
|
63
|
+
agentId: string;
|
|
64
64
|
functionId: string;
|
|
65
65
|
}>;
|
|
66
66
|
/**
|
|
@@ -95,14 +95,14 @@ declare const upsertFunctionTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
95
95
|
data: FunctionToolApiInsert;
|
|
96
96
|
scopes: AgentScopeConfig;
|
|
97
97
|
}) => Promise<{
|
|
98
|
-
description: string | null;
|
|
99
|
-
tenantId: string;
|
|
100
|
-
projectId: string;
|
|
101
|
-
agentId: string;
|
|
102
98
|
id: string;
|
|
103
99
|
name: string;
|
|
100
|
+
description: string | null;
|
|
104
101
|
createdAt: string;
|
|
105
102
|
updatedAt: string;
|
|
103
|
+
projectId: string;
|
|
104
|
+
tenantId: string;
|
|
105
|
+
agentId: string;
|
|
106
106
|
functionId: string;
|
|
107
107
|
}>;
|
|
108
108
|
declare const getFunctionToolsForSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -157,17 +157,17 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
157
157
|
needsApproval?: boolean;
|
|
158
158
|
}> | null;
|
|
159
159
|
}) => Promise<{
|
|
160
|
-
tenantId: string;
|
|
161
|
-
projectId: string;
|
|
162
|
-
agentId: string;
|
|
163
|
-
subAgentId: string;
|
|
164
160
|
id: string;
|
|
165
161
|
createdAt: string;
|
|
166
162
|
updatedAt: string;
|
|
163
|
+
projectId: string;
|
|
164
|
+
tenantId: string;
|
|
165
|
+
agentId: string;
|
|
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
|
|
@@ -222,17 +222,17 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
222
222
|
needsApproval?: boolean;
|
|
223
223
|
}> | null;
|
|
224
224
|
}) => Promise<{
|
|
225
|
-
tenantId: string;
|
|
226
|
-
projectId: string;
|
|
227
|
-
agentId: string;
|
|
228
|
-
subAgentId: string;
|
|
229
225
|
id: string;
|
|
230
226
|
createdAt: string;
|
|
231
227
|
updatedAt: string;
|
|
228
|
+
projectId: string;
|
|
229
|
+
tenantId: string;
|
|
230
|
+
agentId: string;
|
|
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
|
-
description: string;
|
|
12
|
-
tenantId: string;
|
|
13
|
-
projectId: string;
|
|
14
18
|
id: string;
|
|
15
19
|
name: string;
|
|
16
|
-
|
|
17
|
-
updatedAt: string;
|
|
20
|
+
description: string;
|
|
18
21
|
content: string;
|
|
19
22
|
metadata: Record<string, string> | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
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
|
-
description: string;
|
|
107
|
+
interface WithTenantIdProjectId {
|
|
56
108
|
tenantId: string;
|
|
57
109
|
projectId: string;
|
|
110
|
+
}
|
|
111
|
+
declare const createSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<SkillRecordWithFiles>;
|
|
112
|
+
declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiInsert & WithTenantIdProjectId) => Promise<{
|
|
58
113
|
id: string;
|
|
59
114
|
name: string;
|
|
60
|
-
|
|
61
|
-
updatedAt: string;
|
|
115
|
+
description: string;
|
|
62
116
|
content: string;
|
|
63
117
|
metadata: Record<string, string> | null;
|
|
64
|
-
}>;
|
|
65
|
-
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
66
|
-
scopes: ProjectScopeConfig;
|
|
67
|
-
skillId: string;
|
|
68
|
-
data: SkillUpdate;
|
|
69
|
-
}) => Promise<{
|
|
70
118
|
createdAt: string;
|
|
71
119
|
updatedAt: string;
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
description: string;
|
|
75
|
-
content: string;
|
|
76
|
-
metadata: Record<string, string> | null;
|
|
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;
|
|
@@ -91,20 +139,20 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
91
139
|
index: number;
|
|
92
140
|
alwaysLoaded?: boolean;
|
|
93
141
|
}) => Promise<{
|
|
94
|
-
tenantId: string;
|
|
95
|
-
projectId: string;
|
|
96
|
-
agentId: string;
|
|
97
|
-
subAgentId: string;
|
|
98
142
|
id: string;
|
|
99
143
|
createdAt: string;
|
|
100
144
|
updatedAt: string;
|
|
101
|
-
|
|
145
|
+
projectId: string;
|
|
146
|
+
tenantId: string;
|
|
147
|
+
agentId: string;
|
|
148
|
+
subAgentId: 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 };
|