@inkeep/agents-core 0.70.5 → 0.70.8
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 +227 -227
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/auth.d.ts +122 -122
- package/dist/auth/auth.js +13 -7
- package/dist/auth/init.js +4 -2
- package/dist/auth/password-policy.d.ts +2 -2
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/auth/session-hooks.d.ts +11 -0
- package/dist/auth/session-hooks.js +27 -0
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -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 +21 -21
- 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 +4 -4
- package/dist/data-access/manage/functionTools.d.ts +18 -18
- package/dist/data-access/manage/skills.d.ts +14 -14
- 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 +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 +16 -16
- package/dist/data-access/runtime/conversations.js +2 -2
- package/dist/data-access/runtime/feedback.d.ts +7 -5
- package/dist/data-access/runtime/feedback.js +11 -1
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/db/runtime/runtime-schema.d.ts +421 -421
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- 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 +60 -60
- package/dist/validation/schemas.d.ts +2063 -2047
- package/dist/validation/schemas.js +9 -1
- package/package.json +1 -1
|
@@ -6,13 +6,13 @@ 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
|
+
tenantId: string | null;
|
|
10
|
+
projectId: string | null;
|
|
9
11
|
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
description: string | null;
|
|
12
12
|
createdAt: string;
|
|
13
|
+
name: string;
|
|
13
14
|
updatedAt: string;
|
|
14
|
-
|
|
15
|
-
projectId: string | null;
|
|
15
|
+
description: string | null;
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
prompt: string | null;
|
|
18
18
|
config: {
|
|
@@ -75,13 +75,13 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
75
75
|
}>;
|
|
76
76
|
declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
|
|
77
77
|
type: AppType;
|
|
78
|
+
tenantId: string | null;
|
|
79
|
+
projectId: string | null;
|
|
78
80
|
id: string;
|
|
79
|
-
name: string;
|
|
80
|
-
description: string | null;
|
|
81
81
|
createdAt: string;
|
|
82
|
+
name: string;
|
|
82
83
|
updatedAt: string;
|
|
83
|
-
|
|
84
|
-
projectId: string | null;
|
|
84
|
+
description: string | null;
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
prompt: string | null;
|
|
87
87
|
config: {
|
|
@@ -15,14 +15,14 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
15
15
|
total: number;
|
|
16
16
|
}>;
|
|
17
17
|
declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
|
|
18
|
+
tenantId: string;
|
|
19
|
+
projectId: string;
|
|
20
|
+
agentId: string | null;
|
|
18
21
|
id: string;
|
|
19
|
-
title: string | null;
|
|
20
22
|
createdAt: string;
|
|
21
23
|
updatedAt: string;
|
|
22
|
-
tenantId: string;
|
|
23
|
-
projectId: string;
|
|
24
24
|
metadata: ConversationMetadata | null;
|
|
25
|
-
|
|
25
|
+
title: string | null;
|
|
26
26
|
userId: string | null;
|
|
27
27
|
ref: {
|
|
28
28
|
type: "commit" | "tag" | "branch";
|
|
@@ -84,14 +84,14 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
84
84
|
scopes: ProjectScopeConfig;
|
|
85
85
|
conversationId: string;
|
|
86
86
|
}) => Promise<{
|
|
87
|
+
tenantId: string;
|
|
88
|
+
projectId: string;
|
|
89
|
+
agentId: string | null;
|
|
87
90
|
id: string;
|
|
88
|
-
title: string | null;
|
|
89
91
|
createdAt: string;
|
|
90
92
|
updatedAt: string;
|
|
91
|
-
tenantId: string;
|
|
92
|
-
projectId: string;
|
|
93
93
|
metadata: ConversationMetadata | null;
|
|
94
|
-
|
|
94
|
+
title: string | null;
|
|
95
95
|
userId: string | null;
|
|
96
96
|
ref: {
|
|
97
97
|
type: "commit" | "tag" | "branch";
|
|
@@ -120,14 +120,14 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
120
120
|
metadata?: ConversationMetadata | null | undefined;
|
|
121
121
|
contextConfigId?: string | undefined;
|
|
122
122
|
} | {
|
|
123
|
+
tenantId: string;
|
|
124
|
+
projectId: string;
|
|
125
|
+
agentId: string | null;
|
|
123
126
|
id: string;
|
|
124
|
-
title: string | null;
|
|
125
127
|
createdAt: string;
|
|
126
128
|
updatedAt: string;
|
|
127
|
-
tenantId: string;
|
|
128
|
-
projectId: string;
|
|
129
129
|
metadata: ConversationMetadata | null;
|
|
130
|
-
|
|
130
|
+
title: string | null;
|
|
131
131
|
userId: string | null;
|
|
132
132
|
ref: {
|
|
133
133
|
type: "commit" | "tag" | "branch";
|
|
@@ -152,14 +152,14 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
152
152
|
scopes: ProjectScopeConfig;
|
|
153
153
|
conversationId: string;
|
|
154
154
|
}) => Promise<{
|
|
155
|
+
tenantId: string;
|
|
156
|
+
projectId: string;
|
|
157
|
+
agentId: string | null;
|
|
155
158
|
id: string;
|
|
156
|
-
title: string | null;
|
|
157
159
|
createdAt: string;
|
|
158
160
|
updatedAt: string;
|
|
159
|
-
tenantId: string;
|
|
160
|
-
projectId: string;
|
|
161
161
|
metadata: ConversationMetadata | null;
|
|
162
|
-
|
|
162
|
+
title: string | null;
|
|
163
163
|
userId: string | null;
|
|
164
164
|
ref: {
|
|
165
165
|
type: "commit" | "tag" | "branch";
|
|
@@ -101,14 +101,14 @@ function extractMessageText(content) {
|
|
|
101
101
|
/**
|
|
102
102
|
* Apply context window management by truncating or summarizing old messages
|
|
103
103
|
*/
|
|
104
|
-
function applyContextWindowManagement(messageHistory,
|
|
104
|
+
function applyContextWindowManagement(messageHistory, maxOutputTokens) {
|
|
105
105
|
const estimateTokens = (text) => Math.ceil(text.length / 4);
|
|
106
106
|
let totalTokens = 0;
|
|
107
107
|
const managedHistory = [];
|
|
108
108
|
for (let i = messageHistory.length - 1; i >= 0; i--) {
|
|
109
109
|
const message = messageHistory[i];
|
|
110
110
|
const messageTokens = estimateTokens(extractMessageText(message.content));
|
|
111
|
-
if (totalTokens + messageTokens <=
|
|
111
|
+
if (totalTokens + messageTokens <= maxOutputTokens) {
|
|
112
112
|
managedHistory.unshift(message);
|
|
113
113
|
totalTokens += messageTokens;
|
|
114
114
|
} else {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
|
|
2
2
|
import { PaginationConfig } from "../../types/utility.js";
|
|
3
|
+
import { feedback } from "../../db/runtime/runtime-schema.js";
|
|
3
4
|
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
4
5
|
import "../../types/index.js";
|
|
5
6
|
import { FeedbackInsert, FeedbackUpdate } from "../../types/entities.js";
|
|
@@ -70,15 +71,16 @@ declare const getFeedbackByIds: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
70
71
|
}[]>;
|
|
71
72
|
declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
|
|
72
73
|
type: "positive" | "negative";
|
|
74
|
+
tenantId: string;
|
|
75
|
+
projectId: string;
|
|
73
76
|
id: string;
|
|
74
77
|
createdAt: string;
|
|
75
78
|
updatedAt: string;
|
|
76
|
-
tenantId: string;
|
|
77
|
-
projectId: string;
|
|
78
79
|
conversationId: string;
|
|
79
80
|
messageId: string | null;
|
|
80
81
|
details: string | null;
|
|
81
82
|
}>;
|
|
83
|
+
declare const createFeedbackBulk: (db: AgentsRunDatabaseClient) => (items: FeedbackInsert[]) => Promise<(typeof feedback.$inferSelect)[]>;
|
|
82
84
|
declare const updateFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
83
85
|
scopes: ProjectScopeConfig;
|
|
84
86
|
feedbackId: string;
|
|
@@ -99,14 +101,14 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
99
101
|
feedbackId: string;
|
|
100
102
|
}) => Promise<{
|
|
101
103
|
type: "positive" | "negative";
|
|
104
|
+
tenantId: string;
|
|
105
|
+
projectId: string;
|
|
102
106
|
id: string;
|
|
103
107
|
createdAt: string;
|
|
104
108
|
updatedAt: string;
|
|
105
|
-
tenantId: string;
|
|
106
|
-
projectId: string;
|
|
107
109
|
conversationId: string;
|
|
108
110
|
messageId: string | null;
|
|
109
111
|
details: string | null;
|
|
110
112
|
}>;
|
|
111
113
|
//#endregion
|
|
112
|
-
export { createFeedback, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
114
|
+
export { createFeedback, createFeedbackBulk, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
@@ -82,6 +82,16 @@ const createFeedback = (db) => async (params) => {
|
|
|
82
82
|
}).returning();
|
|
83
83
|
return created;
|
|
84
84
|
};
|
|
85
|
+
const createFeedbackBulk = (db) => async (items) => {
|
|
86
|
+
if (items.length === 0) return [];
|
|
87
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
88
|
+
const values = items.map((item) => ({
|
|
89
|
+
...item,
|
|
90
|
+
createdAt: now,
|
|
91
|
+
updatedAt: now
|
|
92
|
+
}));
|
|
93
|
+
return db.insert(feedback).values(values).returning();
|
|
94
|
+
};
|
|
85
95
|
const updateFeedback = (db) => async (params) => {
|
|
86
96
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
87
97
|
const [updated] = await db.update(feedback).set({
|
|
@@ -96,4 +106,4 @@ const deleteFeedback = (db) => async (params) => {
|
|
|
96
106
|
};
|
|
97
107
|
|
|
98
108
|
//#endregion
|
|
99
|
-
export { createFeedback, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
109
|
+
export { createFeedback, createFeedbackBulk, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
|
|
@@ -10,13 +10,13 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
10
10
|
scopes: ProjectScopeConfig;
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
|
+
tenantId: string;
|
|
14
|
+
projectId: string;
|
|
13
15
|
id: string;
|
|
16
|
+
content: MessageContent;
|
|
14
17
|
createdAt: string;
|
|
15
18
|
updatedAt: string;
|
|
16
|
-
tenantId: string;
|
|
17
|
-
projectId: string;
|
|
18
19
|
metadata: MessageMetadata | null;
|
|
19
|
-
content: MessageContent;
|
|
20
20
|
role: string;
|
|
21
21
|
conversationId: string;
|
|
22
22
|
fromSubAgentId: string | null;
|
|
@@ -144,13 +144,13 @@ 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;
|
|
147
149
|
id: string;
|
|
150
|
+
content: MessageContent;
|
|
148
151
|
createdAt: string;
|
|
149
152
|
updatedAt: string;
|
|
150
|
-
tenantId: string;
|
|
151
|
-
projectId: string;
|
|
152
153
|
metadata: MessageMetadata | null;
|
|
153
|
-
content: MessageContent;
|
|
154
154
|
role: string;
|
|
155
155
|
conversationId: string;
|
|
156
156
|
fromSubAgentId: string | null;
|
|
@@ -197,13 +197,13 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
197
197
|
scopes: ProjectScopeConfig;
|
|
198
198
|
messageId: string;
|
|
199
199
|
}) => Promise<{
|
|
200
|
+
tenantId: string;
|
|
201
|
+
projectId: string;
|
|
200
202
|
id: string;
|
|
203
|
+
content: MessageContent;
|
|
201
204
|
createdAt: string;
|
|
202
205
|
updatedAt: string;
|
|
203
|
-
tenantId: string;
|
|
204
|
-
projectId: string;
|
|
205
206
|
metadata: MessageMetadata | null;
|
|
206
|
-
content: MessageContent;
|
|
207
207
|
role: string;
|
|
208
208
|
conversationId: string;
|
|
209
209
|
fromSubAgentId: string | null;
|
|
@@ -15,8 +15,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
|
|
|
15
15
|
scheduledTriggerId: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
}) => Promise<{
|
|
18
|
-
createdAt: string;
|
|
19
18
|
tenantId: string;
|
|
19
|
+
createdAt: string;
|
|
20
20
|
userId: string;
|
|
21
21
|
scheduledTriggerId: string;
|
|
22
22
|
}>;
|
|
@@ -7,14 +7,14 @@ 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
|
-
id: string;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
updatedAt: string;
|
|
13
10
|
tenantId: string;
|
|
14
11
|
projectId: string;
|
|
15
|
-
metadata: TaskMetadataConfig | null;
|
|
16
12
|
agentId: string;
|
|
17
13
|
subAgentId: string;
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
metadata: TaskMetadataConfig | null;
|
|
18
18
|
status: string;
|
|
19
19
|
ref: {
|
|
20
20
|
type: "commit" | "tag" | "branch";
|