@inkeep/agents-core 0.66.1 → 0.67.0
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 +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/constants/otel-attributes.d.ts +2 -0
- package/dist/constants/otel-attributes.js +2 -0
- package/dist/data-access/index.d.ts +2 -2
- package/dist/data-access/index.js +2 -2
- package/dist/data-access/manage/agentFull.js +23 -3
- package/dist/data-access/manage/agents.d.ts +25 -25
- package/dist/data-access/manage/agents.js +12 -1
- package/dist/data-access/manage/artifactComponents.d.ts +14 -14
- 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 +20 -20
- package/dist/data-access/manage/skills.d.ts +15 -15
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +28 -28
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +30 -30
- package/dist/data-access/manage/triggerCleanup.js +6 -1
- package/dist/data-access/manage/triggers.d.ts +60 -1
- package/dist/data-access/manage/triggers.js +88 -3
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/apps.d.ts +12 -12
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/feedback.d.ts +6 -6
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +7 -7
- package/dist/data-access/runtime/triggerInvocations.d.ts +2 -0
- package/dist/db/manage/dolt-safe-jsonb.d.ts +2 -2
- package/dist/db/manage/manage-schema.d.ts +583 -447
- package/dist/db/manage/manage-schema.js +43 -2
- package/dist/db/runtime/runtime-schema.d.ts +445 -407
- package/dist/db/runtime/runtime-schema.js +4 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/signature-validation.d.ts +2 -2
- package/dist/utils/signature-validation.js +2 -2
- 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 +59 -59
- package/dist/validation/schemas.d.ts +2464 -2270
- package/dist/validation/schemas.js +35 -13
- package/drizzle/manage/0018_gorgeous_captain_america.sql +14 -0
- package/drizzle/manage/meta/0018_snapshot.json +3884 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0035_many_steel_serpent.sql +3 -0
- package/drizzle/runtime/meta/0035_snapshot.json +5321 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { triggers } from "../../db/manage/manage-schema.js";
|
|
1
|
+
import { triggerUsers, triggers } from "../../db/manage/manage-schema.js";
|
|
2
2
|
import { agentScopedWhere, projectScopedWhere } from "./scope-helpers.js";
|
|
3
|
-
import { and, count, desc, eq } from "drizzle-orm";
|
|
3
|
+
import { and, asc, count, desc, eq, inArray } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/data-access/manage/triggers.ts
|
|
6
6
|
/**
|
|
@@ -42,6 +42,19 @@ const listTriggersPaginated = (db) => async (params) => {
|
|
|
42
42
|
const createTrigger = (db) => async (params) => {
|
|
43
43
|
return (await db.insert(triggers).values(params).returning())[0];
|
|
44
44
|
};
|
|
45
|
+
const createTriggerWithUsers = (db) => async (params) => {
|
|
46
|
+
return db.transaction(async (tx) => {
|
|
47
|
+
const trigger = await createTrigger(tx)(params.trigger);
|
|
48
|
+
if (params.userIds.length > 0) await tx.insert(triggerUsers).values(params.userIds.map((userId) => ({
|
|
49
|
+
tenantId: trigger.tenantId,
|
|
50
|
+
projectId: trigger.projectId,
|
|
51
|
+
agentId: trigger.agentId,
|
|
52
|
+
triggerId: trigger.id,
|
|
53
|
+
userId
|
|
54
|
+
})));
|
|
55
|
+
return trigger;
|
|
56
|
+
});
|
|
57
|
+
};
|
|
45
58
|
/**
|
|
46
59
|
* Update a trigger (agent-scoped)
|
|
47
60
|
*/
|
|
@@ -68,6 +81,78 @@ const deleteTriggersByRunAsUserId = (db) => async (params) => {
|
|
|
68
81
|
projectId: params.projectId
|
|
69
82
|
}), eq(triggers.runAsUserId, params.runAsUserId)));
|
|
70
83
|
};
|
|
84
|
+
const getTriggerUsers = (db) => async (params) => {
|
|
85
|
+
return db.select().from(triggerUsers).where(and(agentScopedWhere(triggerUsers, params.scopes), eq(triggerUsers.triggerId, params.triggerId))).orderBy(asc(triggerUsers.createdAt));
|
|
86
|
+
};
|
|
87
|
+
const getTriggerUsersBatch = (db) => async (params) => {
|
|
88
|
+
if (params.triggerIds.length === 0) return /* @__PURE__ */ new Map();
|
|
89
|
+
const rows = await db.select().from(triggerUsers).where(and(agentScopedWhere(triggerUsers, params.scopes), inArray(triggerUsers.triggerId, params.triggerIds))).orderBy(asc(triggerUsers.createdAt));
|
|
90
|
+
const result = /* @__PURE__ */ new Map();
|
|
91
|
+
for (const triggerId of params.triggerIds) result.set(triggerId, []);
|
|
92
|
+
for (const row of rows) {
|
|
93
|
+
const userIds = result.get(row.triggerId);
|
|
94
|
+
if (userIds) userIds.push(row.userId);
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
};
|
|
98
|
+
const createTriggerUser = (db) => async (params) => {
|
|
99
|
+
return (await db.insert(triggerUsers).values({
|
|
100
|
+
tenantId: params.scopes.tenantId,
|
|
101
|
+
projectId: params.scopes.projectId,
|
|
102
|
+
agentId: params.scopes.agentId,
|
|
103
|
+
triggerId: params.triggerId,
|
|
104
|
+
userId: params.userId
|
|
105
|
+
}).onConflictDoNothing().returning())[0];
|
|
106
|
+
};
|
|
107
|
+
const deleteTriggerUser = (db) => async (params) => {
|
|
108
|
+
await db.delete(triggerUsers).where(and(agentScopedWhere(triggerUsers, params.scopes), eq(triggerUsers.triggerId, params.triggerId), eq(triggerUsers.userId, params.userId)));
|
|
109
|
+
};
|
|
110
|
+
const setTriggerUsers = (db) => async (params) => {
|
|
111
|
+
await db.delete(triggerUsers).where(and(agentScopedWhere(triggerUsers, params.scopes), eq(triggerUsers.triggerId, params.triggerId)));
|
|
112
|
+
if (params.userIds.length > 0) await db.insert(triggerUsers).values(params.userIds.map((userId) => ({
|
|
113
|
+
tenantId: params.scopes.tenantId,
|
|
114
|
+
projectId: params.scopes.projectId,
|
|
115
|
+
agentId: params.scopes.agentId,
|
|
116
|
+
triggerId: params.triggerId,
|
|
117
|
+
userId
|
|
118
|
+
})));
|
|
119
|
+
};
|
|
120
|
+
const getTriggerUserCount = (db) => async (params) => {
|
|
121
|
+
return (await db.select({ count: count() }).from(triggerUsers).where(and(agentScopedWhere(triggerUsers, params.scopes), eq(triggerUsers.triggerId, params.triggerId))))[0]?.count ?? 0;
|
|
122
|
+
};
|
|
123
|
+
const getWebhookTriggerIdsWithUser = (db) => async (params) => {
|
|
124
|
+
return db.select({
|
|
125
|
+
agentId: triggers.agentId,
|
|
126
|
+
id: triggers.id
|
|
127
|
+
}).from(triggers).innerJoin(triggerUsers, and(eq(triggerUsers.tenantId, triggers.tenantId), eq(triggerUsers.projectId, triggers.projectId), eq(triggerUsers.agentId, triggers.agentId), eq(triggerUsers.triggerId, triggers.id))).where(and(projectScopedWhere(triggers, {
|
|
128
|
+
tenantId: params.tenantId,
|
|
129
|
+
projectId: params.projectId
|
|
130
|
+
}), eq(triggerUsers.userId, params.userId)));
|
|
131
|
+
};
|
|
132
|
+
const removeUserFromProjectTriggerUsers = (db) => async (params) => {
|
|
133
|
+
await db.transaction(async (tx) => {
|
|
134
|
+
const triggerRows = await getWebhookTriggerIdsWithUser(tx)(params);
|
|
135
|
+
if (triggerRows.length === 0) return;
|
|
136
|
+
const triggerIds = triggerRows.map((row) => row.id);
|
|
137
|
+
await tx.delete(triggerUsers).where(and(projectScopedWhere(triggerUsers, {
|
|
138
|
+
tenantId: params.tenantId,
|
|
139
|
+
projectId: params.projectId
|
|
140
|
+
}), inArray(triggerUsers.triggerId, triggerIds), eq(triggerUsers.userId, params.userId)));
|
|
141
|
+
const triggersWithRemainingUsers = await tx.select({ triggerId: triggerUsers.triggerId }).from(triggerUsers).where(and(projectScopedWhere(triggerUsers, {
|
|
142
|
+
tenantId: params.tenantId,
|
|
143
|
+
projectId: params.projectId
|
|
144
|
+
}), inArray(triggerUsers.triggerId, triggerIds))).groupBy(triggerUsers.triggerId);
|
|
145
|
+
const triggerIdsWithRemainingUsers = new Set(triggersWithRemainingUsers.map((row) => row.triggerId));
|
|
146
|
+
const emptyTriggerIds = triggerIds.filter((id) => !triggerIdsWithRemainingUsers.has(id));
|
|
147
|
+
if (emptyTriggerIds.length > 0) await tx.update(triggers).set({
|
|
148
|
+
enabled: false,
|
|
149
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
150
|
+
}).where(and(projectScopedWhere(triggers, {
|
|
151
|
+
tenantId: params.tenantId,
|
|
152
|
+
projectId: params.projectId
|
|
153
|
+
}), inArray(triggers.id, emptyTriggerIds), eq(triggers.enabled, true)));
|
|
154
|
+
});
|
|
155
|
+
};
|
|
71
156
|
/**
|
|
72
157
|
* Upsert a trigger (create or update based on existence)
|
|
73
158
|
*/
|
|
@@ -89,4 +174,4 @@ const upsertTrigger = (db) => async (params) => {
|
|
|
89
174
|
};
|
|
90
175
|
|
|
91
176
|
//#endregion
|
|
92
|
-
export { createTrigger, deleteTrigger, deleteTriggersByRunAsUserId, getTriggerById, listTriggers, listTriggersPaginated, updateTrigger, upsertTrigger };
|
|
177
|
+
export { createTrigger, createTriggerUser, createTriggerWithUsers, deleteTrigger, deleteTriggerUser, deleteTriggersByRunAsUserId, getTriggerById, getTriggerUserCount, getTriggerUsers, getTriggerUsersBatch, getWebhookTriggerIdsWithUser, listTriggers, listTriggersPaginated, removeUserFromProjectTriggerUsers, setTriggerUsers, updateTrigger, upsertTrigger };
|
|
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
8
8
|
scopes: ProjectScopeConfig;
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
-
tenantId: string;
|
|
12
|
-
projectId: string;
|
|
13
|
-
agentId: string;
|
|
14
11
|
id: string;
|
|
15
|
-
createdAt: string;
|
|
16
12
|
name: string | null;
|
|
13
|
+
createdAt: string;
|
|
17
14
|
updatedAt: string;
|
|
18
|
-
|
|
15
|
+
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
|
+
agentId: string;
|
|
19
18
|
publicId: string;
|
|
20
19
|
keyHash: string;
|
|
21
20
|
keyPrefix: string;
|
|
22
21
|
lastUsedAt: string | null;
|
|
22
|
+
expiresAt: string | null;
|
|
23
23
|
} | undefined>;
|
|
24
24
|
declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
|
|
25
|
-
tenantId: string;
|
|
26
|
-
projectId: string;
|
|
27
|
-
agentId: string;
|
|
28
25
|
id: string;
|
|
29
|
-
createdAt: string;
|
|
30
26
|
name: string | null;
|
|
27
|
+
createdAt: string;
|
|
31
28
|
updatedAt: string;
|
|
32
|
-
|
|
29
|
+
projectId: string;
|
|
30
|
+
tenantId: string;
|
|
31
|
+
agentId: string;
|
|
33
32
|
publicId: string;
|
|
34
33
|
keyHash: string;
|
|
35
34
|
keyPrefix: string;
|
|
36
35
|
lastUsedAt: string | null;
|
|
36
|
+
expiresAt: string | null;
|
|
37
37
|
} | undefined>;
|
|
38
38
|
declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
|
|
39
39
|
scopes: ProjectScopeConfig;
|
|
40
40
|
agentId?: string;
|
|
41
41
|
}) => Promise<{
|
|
42
|
-
tenantId: string;
|
|
43
|
-
projectId: string;
|
|
44
|
-
agentId: string;
|
|
45
42
|
id: string;
|
|
46
|
-
createdAt: string;
|
|
47
43
|
name: string | null;
|
|
44
|
+
createdAt: string;
|
|
48
45
|
updatedAt: string;
|
|
49
|
-
|
|
46
|
+
projectId: string;
|
|
47
|
+
tenantId: string;
|
|
48
|
+
agentId: string;
|
|
50
49
|
publicId: string;
|
|
51
50
|
keyHash: string;
|
|
52
51
|
keyPrefix: string;
|
|
53
52
|
lastUsedAt: string | null;
|
|
53
|
+
expiresAt: string | null;
|
|
54
54
|
}[]>;
|
|
55
55
|
declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
56
56
|
scopes: ProjectScopeConfig;
|
|
@@ -66,18 +66,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
66
66
|
};
|
|
67
67
|
}>;
|
|
68
68
|
declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
|
|
69
|
-
tenantId: string;
|
|
70
|
-
projectId: string;
|
|
71
|
-
agentId: string;
|
|
72
69
|
id: string;
|
|
73
|
-
createdAt: string;
|
|
74
70
|
name: string | null;
|
|
71
|
+
createdAt: string;
|
|
75
72
|
updatedAt: string;
|
|
76
|
-
|
|
73
|
+
projectId: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
agentId: string;
|
|
77
76
|
publicId: string;
|
|
78
77
|
keyHash: string;
|
|
79
78
|
keyPrefix: string;
|
|
80
79
|
lastUsedAt: string | null;
|
|
80
|
+
expiresAt: string | null;
|
|
81
81
|
}>;
|
|
82
82
|
declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
|
|
83
83
|
scopes: ProjectScopeConfig;
|
|
@@ -6,13 +6,15 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
|
|
|
6
6
|
//#region src/data-access/runtime/apps.d.ts
|
|
7
7
|
declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
|
|
8
8
|
type: AppType;
|
|
9
|
-
|
|
10
|
-
projectId: string | null;
|
|
9
|
+
description: string | null;
|
|
11
10
|
id: string;
|
|
12
|
-
createdAt: string;
|
|
13
11
|
name: string;
|
|
12
|
+
createdAt: string;
|
|
14
13
|
updatedAt: string;
|
|
15
|
-
|
|
14
|
+
projectId: string | null;
|
|
15
|
+
tenantId: string | null;
|
|
16
|
+
prompt: string | null;
|
|
17
|
+
enabled: boolean;
|
|
16
18
|
config: {
|
|
17
19
|
type: "web_client";
|
|
18
20
|
webClient: {
|
|
@@ -30,8 +32,6 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
|
|
|
30
32
|
type: "api";
|
|
31
33
|
api: Record<string, never>;
|
|
32
34
|
};
|
|
33
|
-
enabled: boolean;
|
|
34
|
-
prompt: string | null;
|
|
35
35
|
lastUsedAt: string | null;
|
|
36
36
|
defaultProjectId: string | null;
|
|
37
37
|
defaultAgentId: string | null;
|
|
@@ -62,13 +62,15 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
62
62
|
}>;
|
|
63
63
|
declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
|
|
64
64
|
type: AppType;
|
|
65
|
-
|
|
66
|
-
projectId: string | null;
|
|
65
|
+
description: string | null;
|
|
67
66
|
id: string;
|
|
68
|
-
createdAt: string;
|
|
69
67
|
name: string;
|
|
68
|
+
createdAt: string;
|
|
70
69
|
updatedAt: string;
|
|
71
|
-
|
|
70
|
+
projectId: string | null;
|
|
71
|
+
tenantId: string | null;
|
|
72
|
+
prompt: string | null;
|
|
73
|
+
enabled: boolean;
|
|
72
74
|
config: {
|
|
73
75
|
type: "web_client";
|
|
74
76
|
webClient: {
|
|
@@ -86,8 +88,6 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
|
|
|
86
88
|
type: "api";
|
|
87
89
|
api: Record<string, never>;
|
|
88
90
|
};
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
prompt: string | null;
|
|
91
91
|
lastUsedAt: string | null;
|
|
92
92
|
defaultProjectId: string | null;
|
|
93
93
|
defaultAgentId: string | null;
|
|
@@ -15,19 +15,19 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
15
15
|
total: number;
|
|
16
16
|
}>;
|
|
17
17
|
declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
|
|
18
|
-
|
|
19
|
-
projectId: string;
|
|
20
|
-
agentId: string | null;
|
|
18
|
+
title: string | null;
|
|
21
19
|
id: string;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
updatedAt: string;
|
|
24
20
|
metadata: ConversationMetadata | null;
|
|
25
21
|
ref: {
|
|
26
22
|
type: "commit" | "tag" | "branch";
|
|
27
23
|
name: string;
|
|
28
24
|
hash: string;
|
|
29
25
|
} | null;
|
|
30
|
-
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
projectId: string;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
agentId: string | null;
|
|
31
31
|
userId: string | null;
|
|
32
32
|
activeSubAgentId: string;
|
|
33
33
|
lastContextResolution: string | null;
|
|
@@ -84,19 +84,19 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
84
84
|
scopes: ProjectScopeConfig;
|
|
85
85
|
conversationId: string;
|
|
86
86
|
}) => Promise<{
|
|
87
|
-
|
|
88
|
-
projectId: string;
|
|
89
|
-
agentId: string | null;
|
|
87
|
+
title: string | null;
|
|
90
88
|
id: string;
|
|
91
|
-
createdAt: string;
|
|
92
|
-
updatedAt: string;
|
|
93
89
|
metadata: ConversationMetadata | null;
|
|
94
90
|
ref: {
|
|
95
91
|
type: "commit" | "tag" | "branch";
|
|
96
92
|
name: string;
|
|
97
93
|
hash: string;
|
|
98
94
|
} | null;
|
|
99
|
-
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
projectId: string;
|
|
98
|
+
tenantId: string;
|
|
99
|
+
agentId: string | null;
|
|
100
100
|
userId: string | null;
|
|
101
101
|
activeSubAgentId: string;
|
|
102
102
|
lastContextResolution: string | null;
|
|
@@ -120,19 +120,19 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
120
120
|
metadata?: ConversationMetadata | null | undefined;
|
|
121
121
|
contextConfigId?: string | undefined;
|
|
122
122
|
} | {
|
|
123
|
-
|
|
124
|
-
projectId: string;
|
|
125
|
-
agentId: string | null;
|
|
123
|
+
title: string | null;
|
|
126
124
|
id: string;
|
|
127
|
-
createdAt: string;
|
|
128
|
-
updatedAt: string;
|
|
129
125
|
metadata: ConversationMetadata | null;
|
|
130
126
|
ref: {
|
|
131
127
|
type: "commit" | "tag" | "branch";
|
|
132
128
|
name: string;
|
|
133
129
|
hash: string;
|
|
134
130
|
} | null;
|
|
135
|
-
|
|
131
|
+
createdAt: string;
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
projectId: string;
|
|
134
|
+
tenantId: string;
|
|
135
|
+
agentId: string | null;
|
|
136
136
|
userId: string | null;
|
|
137
137
|
activeSubAgentId: string;
|
|
138
138
|
lastContextResolution: string | null;
|
|
@@ -152,19 +152,19 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
152
152
|
scopes: ProjectScopeConfig;
|
|
153
153
|
conversationId: string;
|
|
154
154
|
}) => Promise<{
|
|
155
|
-
|
|
156
|
-
projectId: string;
|
|
157
|
-
agentId: string | null;
|
|
155
|
+
title: string | null;
|
|
158
156
|
id: string;
|
|
159
|
-
createdAt: string;
|
|
160
|
-
updatedAt: string;
|
|
161
157
|
metadata: ConversationMetadata | null;
|
|
162
158
|
ref: {
|
|
163
159
|
type: "commit" | "tag" | "branch";
|
|
164
160
|
name: string;
|
|
165
161
|
hash: string;
|
|
166
162
|
} | null;
|
|
167
|
-
|
|
163
|
+
createdAt: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
projectId: string;
|
|
166
|
+
tenantId: string;
|
|
167
|
+
agentId: string | null;
|
|
168
168
|
userId: string | null;
|
|
169
169
|
activeSubAgentId: string;
|
|
170
170
|
lastContextResolution: string | null;
|
|
@@ -59,14 +59,14 @@ declare const listFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
59
59
|
}>;
|
|
60
60
|
declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
|
|
61
61
|
type: "positive" | "negative";
|
|
62
|
-
tenantId: string;
|
|
63
|
-
projectId: string;
|
|
64
62
|
id: string;
|
|
65
63
|
createdAt: string;
|
|
66
64
|
updatedAt: string;
|
|
65
|
+
projectId: string;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
details: string | null;
|
|
67
68
|
conversationId: string;
|
|
68
69
|
messageId: string | null;
|
|
69
|
-
details: string | null;
|
|
70
70
|
}>;
|
|
71
71
|
declare const updateFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
72
72
|
scopes: ProjectScopeConfig;
|
|
@@ -88,14 +88,14 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
88
88
|
feedbackId: string;
|
|
89
89
|
}) => Promise<{
|
|
90
90
|
type: "positive" | "negative";
|
|
91
|
-
tenantId: string;
|
|
92
|
-
projectId: string;
|
|
93
91
|
id: string;
|
|
94
92
|
createdAt: string;
|
|
95
93
|
updatedAt: string;
|
|
94
|
+
projectId: string;
|
|
95
|
+
tenantId: string;
|
|
96
|
+
details: string | null;
|
|
96
97
|
conversationId: string;
|
|
97
98
|
messageId: string | null;
|
|
98
|
-
details: string | null;
|
|
99
99
|
}>;
|
|
100
100
|
//#endregion
|
|
101
101
|
export { createFeedback, deleteFeedback, getFeedbackById, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
@@ -10,26 +10,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
10
10
|
scopes: ProjectScopeConfig;
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
|
-
tenantId: string;
|
|
14
|
-
projectId: string;
|
|
15
13
|
id: string;
|
|
16
14
|
content: MessageContent;
|
|
15
|
+
metadata: MessageMetadata | null;
|
|
17
16
|
createdAt: string;
|
|
18
17
|
updatedAt: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
conversationId: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
tenantId: string;
|
|
22
20
|
fromSubAgentId: string | null;
|
|
23
21
|
toSubAgentId: string | null;
|
|
24
22
|
fromExternalAgentId: string | null;
|
|
25
23
|
toExternalAgentId: string | null;
|
|
24
|
+
taskId: string | null;
|
|
25
|
+
a2aTaskId: string | null;
|
|
26
|
+
conversationId: string;
|
|
27
|
+
role: string;
|
|
26
28
|
fromTeamAgentId: string | null;
|
|
27
29
|
toTeamAgentId: string | null;
|
|
28
30
|
visibility: string;
|
|
29
31
|
messageType: string;
|
|
30
|
-
taskId: string | null;
|
|
31
32
|
parentMessageId: string | null;
|
|
32
|
-
a2aTaskId: string | null;
|
|
33
33
|
a2aSessionId: string | null;
|
|
34
34
|
} | undefined>;
|
|
35
35
|
declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -144,26 +144,26 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
144
144
|
scopes: ProjectScopeConfig;
|
|
145
145
|
data: Omit<MessageInsert, "tenantId" | "projectId">;
|
|
146
146
|
}) => Promise<{
|
|
147
|
-
tenantId: string;
|
|
148
|
-
projectId: string;
|
|
149
147
|
id: string;
|
|
150
148
|
content: MessageContent;
|
|
149
|
+
metadata: MessageMetadata | null;
|
|
151
150
|
createdAt: string;
|
|
152
151
|
updatedAt: string;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
conversationId: string;
|
|
152
|
+
projectId: string;
|
|
153
|
+
tenantId: string;
|
|
156
154
|
fromSubAgentId: string | null;
|
|
157
155
|
toSubAgentId: string | null;
|
|
158
156
|
fromExternalAgentId: string | null;
|
|
159
157
|
toExternalAgentId: string | null;
|
|
158
|
+
taskId: string | null;
|
|
159
|
+
a2aTaskId: string | null;
|
|
160
|
+
conversationId: string;
|
|
161
|
+
role: string;
|
|
160
162
|
fromTeamAgentId: string | null;
|
|
161
163
|
toTeamAgentId: string | null;
|
|
162
164
|
visibility: string;
|
|
163
165
|
messageType: string;
|
|
164
|
-
taskId: string | null;
|
|
165
166
|
parentMessageId: string | null;
|
|
166
|
-
a2aTaskId: string | null;
|
|
167
167
|
a2aSessionId: string | null;
|
|
168
168
|
}>;
|
|
169
169
|
declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -197,26 +197,26 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
197
197
|
scopes: ProjectScopeConfig;
|
|
198
198
|
messageId: string;
|
|
199
199
|
}) => Promise<{
|
|
200
|
-
tenantId: string;
|
|
201
|
-
projectId: string;
|
|
202
200
|
id: string;
|
|
203
201
|
content: MessageContent;
|
|
202
|
+
metadata: MessageMetadata | null;
|
|
204
203
|
createdAt: string;
|
|
205
204
|
updatedAt: string;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
conversationId: string;
|
|
205
|
+
projectId: string;
|
|
206
|
+
tenantId: string;
|
|
209
207
|
fromSubAgentId: string | null;
|
|
210
208
|
toSubAgentId: string | null;
|
|
211
209
|
fromExternalAgentId: string | null;
|
|
212
210
|
toExternalAgentId: string | null;
|
|
211
|
+
taskId: string | null;
|
|
212
|
+
a2aTaskId: string | null;
|
|
213
|
+
conversationId: string;
|
|
214
|
+
role: string;
|
|
213
215
|
fromTeamAgentId: string | null;
|
|
214
216
|
toTeamAgentId: string | null;
|
|
215
217
|
visibility: string;
|
|
216
218
|
messageType: string;
|
|
217
|
-
taskId: string | null;
|
|
218
219
|
parentMessageId: string | null;
|
|
219
|
-
a2aTaskId: string | null;
|
|
220
220
|
a2aSessionId: string | null;
|
|
221
221
|
}>;
|
|
222
222
|
declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -40,7 +40,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
|
|
|
40
40
|
name: string;
|
|
41
41
|
hash: string;
|
|
42
42
|
} | null;
|
|
43
|
-
status: "pending" | "
|
|
43
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
44
44
|
scheduledFor: string;
|
|
45
45
|
startedAt: string | null;
|
|
46
46
|
completedAt: string | null;
|
|
@@ -199,7 +199,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
|
|
|
199
199
|
name: string;
|
|
200
200
|
hash: string;
|
|
201
201
|
} | null;
|
|
202
|
-
status: "pending" | "
|
|
202
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
203
203
|
scheduledFor: string;
|
|
204
204
|
startedAt: string | null;
|
|
205
205
|
completedAt: string | null;
|
|
@@ -239,7 +239,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
|
|
|
239
239
|
name: string;
|
|
240
240
|
hash: string;
|
|
241
241
|
} | null;
|
|
242
|
-
status: "pending" | "
|
|
242
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
243
243
|
scheduledFor: string;
|
|
244
244
|
startedAt: string | null;
|
|
245
245
|
completedAt: string | null;
|
|
@@ -292,7 +292,7 @@ declare const listScheduledTriggerInvocationsByTriggerId: (db: AgentsRunDatabase
|
|
|
292
292
|
name: string;
|
|
293
293
|
hash: string;
|
|
294
294
|
} | null;
|
|
295
|
-
status: "pending" | "
|
|
295
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
296
296
|
scheduledFor: string;
|
|
297
297
|
startedAt: string | null;
|
|
298
298
|
completedAt: string | null;
|
|
@@ -15,8 +15,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
|
|
|
15
15
|
scheduledTriggerId: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
}) => Promise<{
|
|
18
|
-
tenantId: string;
|
|
19
18
|
createdAt: string;
|
|
19
|
+
tenantId: string;
|
|
20
20
|
userId: string;
|
|
21
21
|
scheduledTriggerId: string;
|
|
22
22
|
}>;
|
|
@@ -7,20 +7,20 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
|
|
|
7
7
|
|
|
8
8
|
//#region src/data-access/runtime/tasks.d.ts
|
|
9
9
|
declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
|
|
10
|
-
|
|
11
|
-
projectId: string;
|
|
12
|
-
agentId: string;
|
|
13
|
-
subAgentId: string;
|
|
10
|
+
status: string;
|
|
14
11
|
id: string;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
updatedAt: string;
|
|
17
12
|
metadata: TaskMetadataConfig | null;
|
|
18
13
|
ref: {
|
|
19
14
|
type: "commit" | "tag" | "branch";
|
|
20
15
|
name: string;
|
|
21
16
|
hash: string;
|
|
22
17
|
} | null;
|
|
23
|
-
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
projectId: string;
|
|
21
|
+
tenantId: string;
|
|
22
|
+
agentId: string;
|
|
23
|
+
subAgentId: string;
|
|
24
24
|
contextId: string;
|
|
25
25
|
}>;
|
|
26
26
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -28,6 +28,8 @@ declare const listTriggerInvocationsPaginated: (db: AgentsRunDatabaseClient) =>
|
|
|
28
28
|
data: {
|
|
29
29
|
triggerId: string;
|
|
30
30
|
conversationId: string | null;
|
|
31
|
+
runAsUserId: string | null;
|
|
32
|
+
batchId: string | null;
|
|
31
33
|
ref: {
|
|
32
34
|
type: "commit" | "tag" | "branch";
|
|
33
35
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as drizzle_orm_pg_core1399 from "drizzle-orm/pg-core";
|
|
2
2
|
|
|
3
3
|
//#region src/db/manage/dolt-safe-jsonb.d.ts
|
|
4
4
|
declare function encodeBackslashes(value: unknown): unknown;
|
|
@@ -7,6 +7,6 @@ declare function decodeBackslashes(value: unknown): unknown;
|
|
|
7
7
|
* Drop-in replacement for drizzle-orm's `jsonb()`.
|
|
8
8
|
* Encodes backslashes on write and decodes on read to work around the Doltgres bug.
|
|
9
9
|
*/
|
|
10
|
-
declare function jsonb(name: string): ReturnType<typeof
|
|
10
|
+
declare function jsonb(name: string): ReturnType<typeof drizzle_orm_pg_core1399.jsonb>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { decodeBackslashes, encodeBackslashes, jsonb };
|