@inkeep/agents-core 0.70.1 → 0.70.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 +163 -163
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/data-access/index.d.ts +4 -2
- package/dist/data-access/index.js +4 -2
- package/dist/data-access/manage/agents.d.ts +16 -16
- 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 +6 -6
- package/dist/data-access/manage/improvementRowRevert.d.ts +29 -0
- package/dist/data-access/manage/improvementRowRevert.js +84 -0
- package/dist/data-access/manage/skills.d.ts +10 -10
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +10 -10
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +12 -12
- package/dist/data-access/manage/tools.d.ts +18 -18
- package/dist/data-access/manage/triggers.d.ts +4 -4
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/apps.d.ts +11 -11
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/feedback.d.ts +16 -5
- package/dist/data-access/runtime/feedback.js +18 -2
- package/dist/data-access/runtime/improvementRuns.d.ts +49 -0
- package/dist/data-access/runtime/improvementRuns.js +41 -0
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +362 -362
- package/dist/db/runtime/runtime-schema.d.ts +195 -12
- package/dist/db/runtime/runtime-schema.js +18 -1
- package/dist/dolt/diff.d.ts +2 -1
- package/dist/dolt/fk-map.d.ts +10 -1
- package/dist/dolt/fk-map.js +37 -1
- package/dist/dolt/index.d.ts +3 -3
- package/dist/dolt/index.js +3 -3
- package/dist/dolt/pk-map.d.ts +5 -1
- package/dist/dolt/pk-map.js +17 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -6
- package/dist/utils/error.d.ts +51 -51
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas/skills.d.ts +44 -44
- package/dist/validation/schemas.d.ts +2338 -2105
- package/dist/validation/schemas.js +131 -2
- package/drizzle/runtime/0038_windy_kinsey_walden.sql +15 -0
- package/drizzle/runtime/meta/0038_snapshot.json +6111 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { conversations, feedback } from "../../db/runtime/runtime-schema.js";
|
|
2
2
|
import { projectScopedWhere } from "../manage/scope-helpers.js";
|
|
3
|
-
import { and, count, desc, eq, gte, lte } from "drizzle-orm";
|
|
3
|
+
import { and, count, desc, eq, gte, inArray, lte } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/data-access/runtime/feedback.ts
|
|
6
6
|
const getFeedbackById = (db) => async (params) => {
|
|
@@ -57,6 +57,22 @@ const listFeedback = (db) => async (params) => {
|
|
|
57
57
|
total: typeof total[0]?.count === "string" ? Number.parseInt(total[0].count, 10) : total[0]?.count ?? 0
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
+
const getFeedbackByIds = (db) => async (params) => {
|
|
61
|
+
if (params.feedbackIds.length === 0) return [];
|
|
62
|
+
const conversationsJoin = [
|
|
63
|
+
eq(feedback.tenantId, conversations.tenantId),
|
|
64
|
+
eq(feedback.projectId, conversations.projectId),
|
|
65
|
+
eq(feedback.conversationId, conversations.id)
|
|
66
|
+
];
|
|
67
|
+
return db.select({
|
|
68
|
+
id: feedback.id,
|
|
69
|
+
conversationId: feedback.conversationId,
|
|
70
|
+
type: feedback.type,
|
|
71
|
+
details: feedback.details,
|
|
72
|
+
createdAt: feedback.createdAt,
|
|
73
|
+
agentId: conversations.agentId
|
|
74
|
+
}).from(feedback).leftJoin(conversations, and(...conversationsJoin)).where(and(projectScopedWhere(feedback, params.scopes), inArray(feedback.id, params.feedbackIds)));
|
|
75
|
+
};
|
|
60
76
|
const createFeedback = (db) => async (params) => {
|
|
61
77
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
62
78
|
const [created] = await db.insert(feedback).values({
|
|
@@ -80,4 +96,4 @@ const deleteFeedback = (db) => async (params) => {
|
|
|
80
96
|
};
|
|
81
97
|
|
|
82
98
|
//#endregion
|
|
83
|
-
export { createFeedback, deleteFeedback, getFeedbackById, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
99
|
+
export { createFeedback, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ResolvedRef } from "../../validation/dolt-schemas.js";
|
|
2
|
+
import { coPilotRuns } from "../../db/runtime/runtime-schema.js";
|
|
3
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-access/runtime/improvementRuns.d.ts
|
|
6
|
+
type CoPilotRunInsert = typeof coPilotRuns.$inferInsert;
|
|
7
|
+
type CoPilotRunSelect = typeof coPilotRuns.$inferSelect;
|
|
8
|
+
type CoPilotRunStatus = 'running' | 'suspended' | 'completed' | 'failed';
|
|
9
|
+
declare const createCoPilotRun: (db: AgentsRunDatabaseClient) => (params: CoPilotRunInsert) => Promise<CoPilotRunSelect>;
|
|
10
|
+
declare const getCoPilotRunByRef: (db: AgentsRunDatabaseClient) => (params: {
|
|
11
|
+
scopes: {
|
|
12
|
+
tenantId: string;
|
|
13
|
+
projectId: string;
|
|
14
|
+
};
|
|
15
|
+
ref: ResolvedRef;
|
|
16
|
+
}) => Promise<CoPilotRunSelect | null>;
|
|
17
|
+
declare const getCoPilotRunByBranchName: (db: AgentsRunDatabaseClient) => (params: {
|
|
18
|
+
scopes: {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
projectId: string;
|
|
21
|
+
};
|
|
22
|
+
branchName: string;
|
|
23
|
+
}) => Promise<CoPilotRunSelect | null>;
|
|
24
|
+
declare const listCoPilotRunsByBranchName: (db: AgentsRunDatabaseClient) => (params: {
|
|
25
|
+
scopes: {
|
|
26
|
+
tenantId: string;
|
|
27
|
+
projectId: string;
|
|
28
|
+
};
|
|
29
|
+
branchName: string;
|
|
30
|
+
}) => Promise<CoPilotRunSelect[]>;
|
|
31
|
+
declare const listCoPilotRuns: (db: AgentsRunDatabaseClient) => (params: {
|
|
32
|
+
scopes: {
|
|
33
|
+
tenantId: string;
|
|
34
|
+
projectId: string;
|
|
35
|
+
};
|
|
36
|
+
}) => Promise<CoPilotRunSelect[]>;
|
|
37
|
+
declare const updateCoPilotRunStatusByConversationId: (db: AgentsRunDatabaseClient) => (params: {
|
|
38
|
+
conversationId: string;
|
|
39
|
+
status: CoPilotRunStatus;
|
|
40
|
+
}) => Promise<CoPilotRunSelect | null>;
|
|
41
|
+
declare const deleteCoPilotRunsByBranchName: (db: AgentsRunDatabaseClient) => (params: {
|
|
42
|
+
scopes: {
|
|
43
|
+
tenantId: string;
|
|
44
|
+
projectId: string;
|
|
45
|
+
};
|
|
46
|
+
branchName: string;
|
|
47
|
+
}) => Promise<number>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { CoPilotRunInsert, CoPilotRunSelect, CoPilotRunStatus, createCoPilotRun, deleteCoPilotRunsByBranchName, getCoPilotRunByBranchName, getCoPilotRunByRef, listCoPilotRuns, listCoPilotRunsByBranchName, updateCoPilotRunStatusByConversationId };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { coPilotRuns } from "../../db/runtime/runtime-schema.js";
|
|
2
|
+
import { and, asc, desc, eq, sql } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/improvementRuns.ts
|
|
5
|
+
const createCoPilotRun = (db) => async (params) => {
|
|
6
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7
|
+
const [created] = await db.insert(coPilotRuns).values({
|
|
8
|
+
...params,
|
|
9
|
+
createdAt: now,
|
|
10
|
+
updatedAt: now
|
|
11
|
+
}).returning();
|
|
12
|
+
return created;
|
|
13
|
+
};
|
|
14
|
+
const getCoPilotRunByRef = (db) => async (params) => {
|
|
15
|
+
const [match] = await db.select().from(coPilotRuns).where(and(eq(coPilotRuns.tenantId, params.scopes.tenantId), eq(coPilotRuns.projectId, params.scopes.projectId), sql`${coPilotRuns.ref}->>'type' = ${params.ref.type}`, sql`${coPilotRuns.ref}->>'name' = ${params.ref.name}`)).orderBy(desc(coPilotRuns.createdAt)).limit(1);
|
|
16
|
+
return match ?? null;
|
|
17
|
+
};
|
|
18
|
+
const getCoPilotRunByBranchName = (db) => async (params) => {
|
|
19
|
+
const [match] = await db.select().from(coPilotRuns).where(and(eq(coPilotRuns.tenantId, params.scopes.tenantId), eq(coPilotRuns.projectId, params.scopes.projectId), sql`${coPilotRuns.ref}->>'type' = 'branch'`, sql`${coPilotRuns.ref}->>'name' = ${params.branchName}`)).orderBy(desc(coPilotRuns.createdAt)).limit(1);
|
|
20
|
+
return match ?? null;
|
|
21
|
+
};
|
|
22
|
+
const listCoPilotRunsByBranchName = (db) => async (params) => {
|
|
23
|
+
return await db.select().from(coPilotRuns).where(and(eq(coPilotRuns.tenantId, params.scopes.tenantId), eq(coPilotRuns.projectId, params.scopes.projectId), sql`${coPilotRuns.ref}->>'type' = 'branch'`, sql`${coPilotRuns.ref}->>'name' = ${params.branchName}`)).orderBy(asc(coPilotRuns.createdAt));
|
|
24
|
+
};
|
|
25
|
+
const listCoPilotRuns = (db) => async (params) => {
|
|
26
|
+
return await db.select().from(coPilotRuns).where(and(eq(coPilotRuns.tenantId, params.scopes.tenantId), eq(coPilotRuns.projectId, params.scopes.projectId))).orderBy(desc(coPilotRuns.createdAt));
|
|
27
|
+
};
|
|
28
|
+
const updateCoPilotRunStatusByConversationId = (db) => async (params) => {
|
|
29
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
30
|
+
const [updated] = await db.update(coPilotRuns).set({
|
|
31
|
+
status: params.status,
|
|
32
|
+
updatedAt: now
|
|
33
|
+
}).where(eq(coPilotRuns.conversationId, params.conversationId)).returning();
|
|
34
|
+
return updated ?? null;
|
|
35
|
+
};
|
|
36
|
+
const deleteCoPilotRunsByBranchName = (db) => async (params) => {
|
|
37
|
+
return (await db.delete(coPilotRuns).where(and(eq(coPilotRuns.tenantId, params.scopes.tenantId), eq(coPilotRuns.projectId, params.scopes.projectId), sql`${coPilotRuns.ref}->>'type' = 'branch'`, sql`${coPilotRuns.ref}->>'name' = ${params.branchName}`)).returning()).length;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { createCoPilotRun, deleteCoPilotRunsByBranchName, getCoPilotRunByBranchName, getCoPilotRunByRef, listCoPilotRuns, listCoPilotRunsByBranchName, updateCoPilotRunStatusByConversationId };
|
|
@@ -11,25 +11,25 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
13
|
id: string;
|
|
14
|
-
content: MessageContent;
|
|
15
|
-
metadata: MessageMetadata | null;
|
|
16
14
|
createdAt: string;
|
|
17
15
|
updatedAt: string;
|
|
18
|
-
|
|
16
|
+
metadata: MessageMetadata | null;
|
|
17
|
+
role: string;
|
|
18
|
+
content: MessageContent;
|
|
19
19
|
tenantId: string;
|
|
20
|
+
projectId: string;
|
|
21
|
+
conversationId: string;
|
|
20
22
|
fromSubAgentId: string | null;
|
|
21
23
|
toSubAgentId: string | null;
|
|
22
24
|
fromExternalAgentId: string | null;
|
|
23
25
|
toExternalAgentId: string | null;
|
|
24
|
-
taskId: string | null;
|
|
25
|
-
a2aTaskId: string | null;
|
|
26
|
-
conversationId: string;
|
|
27
|
-
role: string;
|
|
28
26
|
fromTeamAgentId: string | null;
|
|
29
27
|
toTeamAgentId: string | null;
|
|
30
28
|
visibility: string;
|
|
31
29
|
messageType: string;
|
|
30
|
+
taskId: string | null;
|
|
32
31
|
parentMessageId: string | null;
|
|
32
|
+
a2aTaskId: string | null;
|
|
33
33
|
a2aSessionId: string | null;
|
|
34
34
|
} | undefined>;
|
|
35
35
|
declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -145,25 +145,25 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
145
145
|
data: Omit<MessageInsert, "tenantId" | "projectId">;
|
|
146
146
|
}) => Promise<{
|
|
147
147
|
id: string;
|
|
148
|
-
content: MessageContent;
|
|
149
|
-
metadata: MessageMetadata | null;
|
|
150
148
|
createdAt: string;
|
|
151
149
|
updatedAt: string;
|
|
152
|
-
|
|
150
|
+
metadata: MessageMetadata | null;
|
|
151
|
+
role: string;
|
|
152
|
+
content: MessageContent;
|
|
153
153
|
tenantId: string;
|
|
154
|
+
projectId: string;
|
|
155
|
+
conversationId: string;
|
|
154
156
|
fromSubAgentId: string | null;
|
|
155
157
|
toSubAgentId: string | null;
|
|
156
158
|
fromExternalAgentId: string | null;
|
|
157
159
|
toExternalAgentId: string | null;
|
|
158
|
-
taskId: string | null;
|
|
159
|
-
a2aTaskId: string | null;
|
|
160
|
-
conversationId: string;
|
|
161
|
-
role: string;
|
|
162
160
|
fromTeamAgentId: string | null;
|
|
163
161
|
toTeamAgentId: string | null;
|
|
164
162
|
visibility: string;
|
|
165
163
|
messageType: string;
|
|
164
|
+
taskId: string | null;
|
|
166
165
|
parentMessageId: string | null;
|
|
166
|
+
a2aTaskId: string | null;
|
|
167
167
|
a2aSessionId: string | null;
|
|
168
168
|
}>;
|
|
169
169
|
declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -198,25 +198,25 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
198
198
|
messageId: string;
|
|
199
199
|
}) => Promise<{
|
|
200
200
|
id: string;
|
|
201
|
-
content: MessageContent;
|
|
202
|
-
metadata: MessageMetadata | null;
|
|
203
201
|
createdAt: string;
|
|
204
202
|
updatedAt: string;
|
|
205
|
-
|
|
203
|
+
metadata: MessageMetadata | null;
|
|
204
|
+
role: string;
|
|
205
|
+
content: MessageContent;
|
|
206
206
|
tenantId: string;
|
|
207
|
+
projectId: string;
|
|
208
|
+
conversationId: string;
|
|
207
209
|
fromSubAgentId: string | null;
|
|
208
210
|
toSubAgentId: string | null;
|
|
209
211
|
fromExternalAgentId: string | null;
|
|
210
212
|
toExternalAgentId: string | null;
|
|
211
|
-
taskId: string | null;
|
|
212
|
-
a2aTaskId: string | null;
|
|
213
|
-
conversationId: string;
|
|
214
|
-
role: string;
|
|
215
213
|
fromTeamAgentId: string | null;
|
|
216
214
|
toTeamAgentId: string | null;
|
|
217
215
|
visibility: string;
|
|
218
216
|
messageType: string;
|
|
217
|
+
taskId: string | null;
|
|
219
218
|
parentMessageId: string | null;
|
|
219
|
+
a2aTaskId: string | null;
|
|
220
220
|
a2aSessionId: string | null;
|
|
221
221
|
}>;
|
|
222
222
|
declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -16,8 +16,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
|
|
|
16
16
|
userId: string;
|
|
17
17
|
}) => Promise<{
|
|
18
18
|
createdAt: string;
|
|
19
|
-
tenantId: string;
|
|
20
19
|
userId: string;
|
|
20
|
+
tenantId: string;
|
|
21
21
|
scheduledTriggerId: string;
|
|
22
22
|
}>;
|
|
23
23
|
declare const deleteScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -8,19 +8,19 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
|
|
|
8
8
|
//#region src/data-access/runtime/tasks.d.ts
|
|
9
9
|
declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
|
|
10
10
|
id: string;
|
|
11
|
-
metadata: TaskMetadataConfig | null;
|
|
12
11
|
createdAt: string;
|
|
13
12
|
updatedAt: string;
|
|
14
|
-
projectId: string;
|
|
15
|
-
tenantId: string;
|
|
16
|
-
agentId: string;
|
|
17
|
-
status: string;
|
|
18
|
-
subAgentId: string;
|
|
19
13
|
ref: {
|
|
20
14
|
type: "commit" | "tag" | "branch";
|
|
21
15
|
name: string;
|
|
22
16
|
hash: string;
|
|
23
17
|
} | null;
|
|
18
|
+
metadata: TaskMetadataConfig | null;
|
|
19
|
+
status: string;
|
|
20
|
+
tenantId: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
agentId: string;
|
|
23
|
+
subAgentId: string;
|
|
24
24
|
contextId: string;
|
|
25
25
|
}>;
|
|
26
26
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|