@inkeep/agents-core 0.0.0-dev-20260325193448 → 0.0.0-dev-20260325203817
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 +108 -108
- 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 +6 -6
- package/dist/client-exports.js +2 -2
- package/dist/constants/otel-attributes.d.ts +25 -1
- package/dist/constants/otel-attributes.js +25 -1
- package/dist/data-access/manage/agents.d.ts +25 -25
- package/dist/data-access/manage/artifactComponents.d.ts +8 -8
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/skills.d.ts +16 -16
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +20 -20
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +24 -24
- package/dist/data-access/manage/triggers.d.ts +2 -2
- 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 +22 -22
- package/dist/data-access/runtime/conversations.js +17 -1
- 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 +5 -5
- package/dist/db/manage/manage-schema.d.ts +453 -453
- package/dist/db/runtime/runtime-schema.d.ts +336 -334
- package/dist/db/runtime/runtime-schema.js +3 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/types/utility.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/model-factory.js +35 -10
- package/dist/utils/token-estimator.d.ts +19 -0
- package/dist/utils/token-estimator.js +17 -0
- package/dist/utils/usage-cost-middleware.d.ts +13 -0
- package/dist/utils/usage-cost-middleware.js +60 -0
- package/dist/utils/usage-tracker.d.ts +2 -0
- package/dist/utils/usage-tracker.js +1 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1996 -1996
- package/package.json +1 -1
|
@@ -9,14 +9,14 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
9
9
|
scopes: AgentScopeConfig;
|
|
10
10
|
subAgentId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
|
-
id: string;
|
|
13
12
|
name: string;
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
14
16
|
description: string | null;
|
|
15
17
|
tenantId: string;
|
|
16
18
|
projectId: string;
|
|
17
19
|
agentId: string;
|
|
18
|
-
prompt: string | null;
|
|
19
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
20
20
|
models: {
|
|
21
21
|
base?: {
|
|
22
22
|
model?: string | undefined;
|
|
@@ -34,20 +34,20 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
34
34
|
stopWhen: {
|
|
35
35
|
stepCountIs?: number | undefined;
|
|
36
36
|
} | null;
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
prompt: string | null;
|
|
38
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
39
39
|
} | undefined>;
|
|
40
40
|
declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
41
41
|
scopes: AgentScopeConfig;
|
|
42
42
|
}) => Promise<{
|
|
43
|
-
id: string;
|
|
44
43
|
name: string;
|
|
44
|
+
id: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
45
47
|
description: string | null;
|
|
46
48
|
tenantId: string;
|
|
47
49
|
projectId: string;
|
|
48
50
|
agentId: string;
|
|
49
|
-
prompt: string | null;
|
|
50
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
51
51
|
models: {
|
|
52
52
|
base?: {
|
|
53
53
|
model?: string | undefined;
|
|
@@ -65,8 +65,8 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
65
65
|
stopWhen: {
|
|
66
66
|
stepCountIs?: number | undefined;
|
|
67
67
|
} | null;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
prompt: string | null;
|
|
69
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
70
70
|
}[]>;
|
|
71
71
|
declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
72
72
|
scopes: AgentScopeConfig;
|
|
@@ -109,14 +109,14 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
|
|
|
109
109
|
};
|
|
110
110
|
}>;
|
|
111
111
|
declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
|
|
112
|
-
id: string;
|
|
113
112
|
name: string;
|
|
113
|
+
id: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
updatedAt: string;
|
|
114
116
|
description: string | null;
|
|
115
117
|
tenantId: string;
|
|
116
118
|
projectId: string;
|
|
117
119
|
agentId: string;
|
|
118
|
-
prompt: string | null;
|
|
119
|
-
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
120
120
|
models: {
|
|
121
121
|
base?: {
|
|
122
122
|
model?: string | undefined;
|
|
@@ -134,8 +134,8 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
134
134
|
stopWhen: {
|
|
135
135
|
stepCountIs?: number | undefined;
|
|
136
136
|
} | null;
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
prompt: string | null;
|
|
138
|
+
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
139
139
|
}>;
|
|
140
140
|
declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
141
141
|
scopes: AgentScopeConfig;
|
|
@@ -20,14 +20,14 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
20
20
|
scopes: ProjectScopeConfig;
|
|
21
21
|
toolId: string;
|
|
22
22
|
}) => Promise<{
|
|
23
|
-
|
|
23
|
+
headers: Record<string, string> | null;
|
|
24
24
|
name: string;
|
|
25
|
+
id: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
25
28
|
description: string | null;
|
|
26
29
|
tenantId: string;
|
|
27
30
|
projectId: string;
|
|
28
|
-
createdAt: string;
|
|
29
|
-
updatedAt: string;
|
|
30
|
-
headers: Record<string, string> | null;
|
|
31
31
|
config: {
|
|
32
32
|
type: "mcp";
|
|
33
33
|
mcp: ToolMcpConfig;
|
|
@@ -78,14 +78,14 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
78
78
|
};
|
|
79
79
|
}>;
|
|
80
80
|
declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
|
|
81
|
-
|
|
81
|
+
headers: Record<string, string> | null;
|
|
82
82
|
name: string;
|
|
83
|
+
id: string;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
updatedAt: string;
|
|
83
86
|
description: string | null;
|
|
84
87
|
tenantId: string;
|
|
85
88
|
projectId: string;
|
|
86
|
-
createdAt: string;
|
|
87
|
-
updatedAt: string;
|
|
88
|
-
headers: Record<string, string> | null;
|
|
89
89
|
config: {
|
|
90
90
|
type: "mcp";
|
|
91
91
|
mcp: ToolMcpConfig;
|
|
@@ -135,18 +135,18 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
135
135
|
needsApproval?: boolean;
|
|
136
136
|
}> | null;
|
|
137
137
|
}) => Promise<{
|
|
138
|
+
headers: Record<string, string> | null;
|
|
138
139
|
id: string;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
updatedAt: string;
|
|
139
142
|
tenantId: string;
|
|
140
143
|
projectId: string;
|
|
141
144
|
agentId: string;
|
|
142
|
-
|
|
143
|
-
updatedAt: string;
|
|
145
|
+
subAgentId: string;
|
|
144
146
|
toolId: string;
|
|
145
|
-
headers: Record<string, string> | null;
|
|
146
147
|
toolPolicies: Record<string, {
|
|
147
148
|
needsApproval?: boolean;
|
|
148
149
|
}> | null;
|
|
149
|
-
subAgentId: string;
|
|
150
150
|
selectedTools: string[] | null;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -154,18 +154,18 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
|
|
|
154
154
|
subAgentId: string;
|
|
155
155
|
toolId: string;
|
|
156
156
|
}) => Promise<{
|
|
157
|
+
headers: Record<string, string> | null;
|
|
157
158
|
id: string;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
updatedAt: string;
|
|
158
161
|
tenantId: string;
|
|
159
162
|
projectId: string;
|
|
160
163
|
agentId: string;
|
|
161
|
-
|
|
162
|
-
updatedAt: string;
|
|
164
|
+
subAgentId: string;
|
|
163
165
|
toolId: string;
|
|
164
|
-
headers: Record<string, string> | null;
|
|
165
166
|
toolPolicies: Record<string, {
|
|
166
167
|
needsApproval?: boolean;
|
|
167
168
|
}> | null;
|
|
168
|
-
subAgentId: string;
|
|
169
169
|
selectedTools: string[] | null;
|
|
170
170
|
}>;
|
|
171
171
|
/**
|
|
@@ -182,18 +182,18 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
182
182
|
}> | null;
|
|
183
183
|
relationId?: string;
|
|
184
184
|
}) => Promise<{
|
|
185
|
+
headers: Record<string, string> | null;
|
|
185
186
|
id: string;
|
|
187
|
+
createdAt: string;
|
|
188
|
+
updatedAt: string;
|
|
186
189
|
tenantId: string;
|
|
187
190
|
projectId: string;
|
|
188
191
|
agentId: string;
|
|
189
|
-
|
|
190
|
-
updatedAt: string;
|
|
192
|
+
subAgentId: string;
|
|
191
193
|
toolId: string;
|
|
192
|
-
headers: Record<string, string> | null;
|
|
193
194
|
toolPolicies: Record<string, {
|
|
194
195
|
needsApproval?: boolean;
|
|
195
196
|
}> | null;
|
|
196
|
-
subAgentId: string;
|
|
197
197
|
selectedTools: string[] | null;
|
|
198
198
|
}>;
|
|
199
199
|
/**
|
|
@@ -202,14 +202,14 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
202
202
|
declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
203
203
|
data: ToolInsert;
|
|
204
204
|
}) => Promise<{
|
|
205
|
-
|
|
205
|
+
headers: Record<string, string> | null;
|
|
206
206
|
name: string;
|
|
207
|
+
id: string;
|
|
208
|
+
createdAt: string;
|
|
209
|
+
updatedAt: string;
|
|
207
210
|
description: string | null;
|
|
208
211
|
tenantId: string;
|
|
209
212
|
projectId: string;
|
|
210
|
-
createdAt: string;
|
|
211
|
-
updatedAt: string;
|
|
212
|
-
headers: Record<string, string> | null;
|
|
213
213
|
config: {
|
|
214
214
|
type: "mcp";
|
|
215
215
|
mcp: ToolMcpConfig;
|
|
@@ -40,13 +40,13 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
|
|
|
40
40
|
algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
|
|
41
41
|
encoding: "hex" | "base64";
|
|
42
42
|
signature: {
|
|
43
|
-
source: "
|
|
43
|
+
source: "body" | "query" | "header";
|
|
44
44
|
key: string;
|
|
45
45
|
prefix?: string | undefined;
|
|
46
46
|
regex?: string | undefined;
|
|
47
47
|
};
|
|
48
48
|
signedComponents: {
|
|
49
|
-
source: "
|
|
49
|
+
source: "body" | "header" | "literal";
|
|
50
50
|
required: boolean;
|
|
51
51
|
key?: string | undefined;
|
|
52
52
|
value?: string | undefined;
|
|
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
8
8
|
scopes: ProjectScopeConfig;
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
-
id: string;
|
|
12
11
|
name: string | null;
|
|
12
|
+
id: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
expiresAt: string | null;
|
|
15
|
+
updatedAt: string;
|
|
13
16
|
tenantId: string;
|
|
14
17
|
projectId: string;
|
|
15
18
|
agentId: string;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
updatedAt: string;
|
|
18
|
-
expiresAt: string | null;
|
|
19
|
-
lastUsedAt: string | null;
|
|
20
19
|
publicId: string;
|
|
21
20
|
keyHash: string;
|
|
22
21
|
keyPrefix: string;
|
|
22
|
+
lastUsedAt: string | null;
|
|
23
23
|
} | undefined>;
|
|
24
24
|
declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
|
|
25
|
-
id: string;
|
|
26
25
|
name: string | null;
|
|
26
|
+
id: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
expiresAt: string | null;
|
|
29
|
+
updatedAt: string;
|
|
27
30
|
tenantId: string;
|
|
28
31
|
projectId: string;
|
|
29
32
|
agentId: string;
|
|
30
|
-
createdAt: string;
|
|
31
|
-
updatedAt: string;
|
|
32
|
-
expiresAt: string | null;
|
|
33
|
-
lastUsedAt: string | null;
|
|
34
33
|
publicId: string;
|
|
35
34
|
keyHash: string;
|
|
36
35
|
keyPrefix: string;
|
|
36
|
+
lastUsedAt: 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
|
-
id: string;
|
|
43
42
|
name: string | null;
|
|
43
|
+
id: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
expiresAt: string | null;
|
|
46
|
+
updatedAt: string;
|
|
44
47
|
tenantId: string;
|
|
45
48
|
projectId: string;
|
|
46
49
|
agentId: string;
|
|
47
|
-
createdAt: string;
|
|
48
|
-
updatedAt: string;
|
|
49
|
-
expiresAt: string | null;
|
|
50
|
-
lastUsedAt: string | null;
|
|
51
50
|
publicId: string;
|
|
52
51
|
keyHash: string;
|
|
53
52
|
keyPrefix: string;
|
|
53
|
+
lastUsedAt: 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
|
-
id: string;
|
|
70
69
|
name: string | null;
|
|
70
|
+
id: string;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
expiresAt: string | null;
|
|
73
|
+
updatedAt: string;
|
|
71
74
|
tenantId: string;
|
|
72
75
|
projectId: string;
|
|
73
76
|
agentId: string;
|
|
74
|
-
createdAt: string;
|
|
75
|
-
updatedAt: string;
|
|
76
|
-
expiresAt: string | null;
|
|
77
|
-
lastUsedAt: string | null;
|
|
78
77
|
publicId: string;
|
|
79
78
|
keyHash: string;
|
|
80
79
|
keyPrefix: string;
|
|
80
|
+
lastUsedAt: string | null;
|
|
81
81
|
}>;
|
|
82
82
|
declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
|
|
83
83
|
scopes: ProjectScopeConfig;
|
|
@@ -5,14 +5,14 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
|
|
|
5
5
|
|
|
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
9
|
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
10
13
|
description: string | null;
|
|
11
14
|
tenantId: string | null;
|
|
12
15
|
projectId: string | null;
|
|
13
|
-
type: AppType;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
updatedAt: string;
|
|
16
16
|
enabled: boolean;
|
|
17
17
|
config: {
|
|
18
18
|
type: "web_client";
|
|
@@ -23,9 +23,9 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
|
|
|
23
23
|
type: "api";
|
|
24
24
|
api: Record<string, never>;
|
|
25
25
|
};
|
|
26
|
-
defaultAgentId: string | null;
|
|
27
|
-
defaultProjectId: string | null;
|
|
28
26
|
lastUsedAt: string | null;
|
|
27
|
+
defaultProjectId: string | null;
|
|
28
|
+
defaultAgentId: string | null;
|
|
29
29
|
} | undefined>;
|
|
30
30
|
declare const updateAppLastUsed: (db: AgentsRunDatabaseClient) => (id: string) => Promise<void>;
|
|
31
31
|
declare const getAppByIdForTenant: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -52,14 +52,14 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
54
|
declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
|
|
55
|
-
|
|
55
|
+
type: AppType;
|
|
56
56
|
name: string;
|
|
57
|
+
id: string;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
updatedAt: string;
|
|
57
60
|
description: string | null;
|
|
58
61
|
tenantId: string | null;
|
|
59
62
|
projectId: string | null;
|
|
60
|
-
type: AppType;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
63
|
enabled: boolean;
|
|
64
64
|
config: {
|
|
65
65
|
type: "web_client";
|
|
@@ -70,9 +70,9 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
|
|
|
70
70
|
type: "api";
|
|
71
71
|
api: Record<string, never>;
|
|
72
72
|
};
|
|
73
|
-
defaultAgentId: string | null;
|
|
74
|
-
defaultProjectId: string | null;
|
|
75
73
|
lastUsedAt: string | null;
|
|
74
|
+
defaultProjectId: string | null;
|
|
75
|
+
defaultAgentId: string | null;
|
|
76
76
|
}>;
|
|
77
77
|
declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
|
|
78
78
|
scopes: TenantScopeConfig;
|
|
@@ -4,7 +4,7 @@ import { ConversationHistoryConfig, ConversationMetadata, PaginationConfig } fro
|
|
|
4
4
|
import "../../types/index.js";
|
|
5
5
|
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
6
6
|
import "../../index.js";
|
|
7
|
-
import { ConversationInsert, ConversationSelect, ConversationUpdate } from "../../types/entities.js";
|
|
7
|
+
import { ConversationInsert, ConversationSelect, ConversationUpdate, MessageSelect } from "../../types/entities.js";
|
|
8
8
|
|
|
9
9
|
//#region src/data-access/runtime/conversations.d.ts
|
|
10
10
|
declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
|
|
@@ -16,20 +16,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
16
16
|
total: number;
|
|
17
17
|
}>;
|
|
18
18
|
declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
|
|
19
|
+
metadata: ConversationMetadata | null;
|
|
20
|
+
userId: string | null;
|
|
19
21
|
id: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
title: string | null;
|
|
20
25
|
tenantId: string;
|
|
21
26
|
projectId: string;
|
|
22
27
|
agentId: string | null;
|
|
23
|
-
title: string | null;
|
|
24
|
-
createdAt: string;
|
|
25
|
-
updatedAt: string;
|
|
26
|
-
metadata: ConversationMetadata | null;
|
|
27
28
|
ref: {
|
|
28
29
|
type: "commit" | "tag" | "branch";
|
|
29
30
|
name: string;
|
|
30
31
|
hash: string;
|
|
31
32
|
} | null;
|
|
32
|
-
userId: string | null;
|
|
33
33
|
activeSubAgentId: string;
|
|
34
34
|
lastContextResolution: string | null;
|
|
35
35
|
}>;
|
|
@@ -85,20 +85,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
85
85
|
scopes: ProjectScopeConfig;
|
|
86
86
|
conversationId: string;
|
|
87
87
|
}) => Promise<{
|
|
88
|
+
metadata: ConversationMetadata | null;
|
|
89
|
+
userId: string | null;
|
|
88
90
|
id: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
title: string | null;
|
|
89
94
|
tenantId: string;
|
|
90
95
|
projectId: string;
|
|
91
96
|
agentId: string | null;
|
|
92
|
-
title: string | null;
|
|
93
|
-
createdAt: string;
|
|
94
|
-
updatedAt: string;
|
|
95
|
-
metadata: ConversationMetadata | null;
|
|
96
97
|
ref: {
|
|
97
98
|
type: "commit" | "tag" | "branch";
|
|
98
99
|
name: string;
|
|
99
100
|
hash: string;
|
|
100
101
|
} | null;
|
|
101
|
-
userId: string | null;
|
|
102
102
|
activeSubAgentId: string;
|
|
103
103
|
lastContextResolution: string | null;
|
|
104
104
|
} | undefined>;
|
|
@@ -121,20 +121,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
121
121
|
metadata?: ConversationMetadata | null | undefined;
|
|
122
122
|
contextConfigId?: string | undefined;
|
|
123
123
|
} | {
|
|
124
|
+
metadata: ConversationMetadata | null;
|
|
125
|
+
userId: string | null;
|
|
124
126
|
id: string;
|
|
127
|
+
createdAt: string;
|
|
128
|
+
updatedAt: string;
|
|
129
|
+
title: string | null;
|
|
125
130
|
tenantId: string;
|
|
126
131
|
projectId: string;
|
|
127
132
|
agentId: string | null;
|
|
128
|
-
title: string | null;
|
|
129
|
-
createdAt: string;
|
|
130
|
-
updatedAt: string;
|
|
131
|
-
metadata: ConversationMetadata | null;
|
|
132
133
|
ref: {
|
|
133
134
|
type: "commit" | "tag" | "branch";
|
|
134
135
|
name: string;
|
|
135
136
|
hash: string;
|
|
136
137
|
} | null;
|
|
137
|
-
userId: string | null;
|
|
138
138
|
activeSubAgentId: string;
|
|
139
139
|
lastContextResolution: string | null;
|
|
140
140
|
}>;
|
|
@@ -145,7 +145,7 @@ declare const getConversationHistory: (db: AgentsRunDatabaseClient) => (params:
|
|
|
145
145
|
scopes: ProjectScopeConfig;
|
|
146
146
|
conversationId: string;
|
|
147
147
|
options?: ConversationHistoryConfig;
|
|
148
|
-
}) => Promise<
|
|
148
|
+
}) => Promise<MessageSelect[]>;
|
|
149
149
|
/**
|
|
150
150
|
* Get active agent for a conversation
|
|
151
151
|
*/
|
|
@@ -153,20 +153,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
153
153
|
scopes: ProjectScopeConfig;
|
|
154
154
|
conversationId: string;
|
|
155
155
|
}) => Promise<{
|
|
156
|
+
metadata: ConversationMetadata | null;
|
|
157
|
+
userId: string | null;
|
|
156
158
|
id: string;
|
|
159
|
+
createdAt: string;
|
|
160
|
+
updatedAt: string;
|
|
161
|
+
title: string | null;
|
|
157
162
|
tenantId: string;
|
|
158
163
|
projectId: string;
|
|
159
164
|
agentId: string | null;
|
|
160
|
-
title: string | null;
|
|
161
|
-
createdAt: string;
|
|
162
|
-
updatedAt: string;
|
|
163
|
-
metadata: ConversationMetadata | null;
|
|
164
165
|
ref: {
|
|
165
166
|
type: "commit" | "tag" | "branch";
|
|
166
167
|
name: string;
|
|
167
168
|
hash: string;
|
|
168
169
|
} | null;
|
|
169
|
-
userId: string | null;
|
|
170
170
|
activeSubAgentId: string;
|
|
171
171
|
lastContextResolution: string | null;
|
|
172
172
|
} | undefined>;
|
|
@@ -113,13 +113,29 @@ function applyContextWindowManagement(messageHistory, maxTokens) {
|
|
|
113
113
|
totalTokens += messageTokens;
|
|
114
114
|
} else {
|
|
115
115
|
if (i > 0) {
|
|
116
|
+
const referenceMessage = messageHistory[0];
|
|
116
117
|
const summaryMessage = {
|
|
117
118
|
id: `summary-${getConversationId()}`,
|
|
119
|
+
tenantId: referenceMessage.tenantId,
|
|
120
|
+
projectId: referenceMessage.projectId,
|
|
121
|
+
conversationId: referenceMessage.conversationId,
|
|
118
122
|
role: "system",
|
|
123
|
+
fromSubAgentId: null,
|
|
124
|
+
toSubAgentId: null,
|
|
125
|
+
fromExternalAgentId: null,
|
|
126
|
+
toExternalAgentId: null,
|
|
127
|
+
fromTeamAgentId: null,
|
|
128
|
+
toTeamAgentId: null,
|
|
119
129
|
content: { text: `[Previous conversation history truncated - ${i + 1} earlier messages]` },
|
|
120
130
|
visibility: "system",
|
|
121
131
|
messageType: "chat",
|
|
122
|
-
|
|
132
|
+
taskId: null,
|
|
133
|
+
parentMessageId: null,
|
|
134
|
+
a2aTaskId: null,
|
|
135
|
+
a2aSessionId: null,
|
|
136
|
+
metadata: null,
|
|
137
|
+
createdAt: referenceMessage.createdAt,
|
|
138
|
+
updatedAt: referenceMessage.updatedAt
|
|
123
139
|
};
|
|
124
140
|
managedHistory.unshift(summaryMessage);
|
|
125
141
|
}
|
|
@@ -10,26 +10,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
10
10
|
scopes: ProjectScopeConfig;
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
|
+
metadata: MessageMetadata | null;
|
|
14
|
+
role: string;
|
|
13
15
|
id: string;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
16
|
createdAt: string;
|
|
17
17
|
updatedAt: string;
|
|
18
|
-
|
|
18
|
+
tenantId: string;
|
|
19
|
+
projectId: string;
|
|
19
20
|
content: MessageContent;
|
|
20
|
-
role: string;
|
|
21
|
-
conversationId: string;
|
|
22
21
|
fromSubAgentId: string | null;
|
|
23
22
|
toSubAgentId: string | null;
|
|
24
23
|
fromExternalAgentId: string | null;
|
|
25
24
|
toExternalAgentId: string | null;
|
|
25
|
+
taskId: string | null;
|
|
26
|
+
a2aTaskId: string | null;
|
|
27
|
+
conversationId: 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
|
+
metadata: MessageMetadata | null;
|
|
148
|
+
role: string;
|
|
147
149
|
id: string;
|
|
148
|
-
tenantId: string;
|
|
149
|
-
projectId: string;
|
|
150
150
|
createdAt: string;
|
|
151
151
|
updatedAt: string;
|
|
152
|
-
|
|
152
|
+
tenantId: string;
|
|
153
|
+
projectId: string;
|
|
153
154
|
content: MessageContent;
|
|
154
|
-
role: string;
|
|
155
|
-
conversationId: string;
|
|
156
155
|
fromSubAgentId: string | null;
|
|
157
156
|
toSubAgentId: string | null;
|
|
158
157
|
fromExternalAgentId: string | null;
|
|
159
158
|
toExternalAgentId: string | null;
|
|
159
|
+
taskId: string | null;
|
|
160
|
+
a2aTaskId: string | null;
|
|
161
|
+
conversationId: 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
|
+
metadata: MessageMetadata | null;
|
|
201
|
+
role: string;
|
|
200
202
|
id: string;
|
|
201
|
-
tenantId: string;
|
|
202
|
-
projectId: string;
|
|
203
203
|
createdAt: string;
|
|
204
204
|
updatedAt: string;
|
|
205
|
-
|
|
205
|
+
tenantId: string;
|
|
206
|
+
projectId: string;
|
|
206
207
|
content: MessageContent;
|
|
207
|
-
role: string;
|
|
208
|
-
conversationId: string;
|
|
209
208
|
fromSubAgentId: string | null;
|
|
210
209
|
toSubAgentId: string | null;
|
|
211
210
|
fromExternalAgentId: string | null;
|
|
212
211
|
toExternalAgentId: string | null;
|
|
212
|
+
taskId: string | null;
|
|
213
|
+
a2aTaskId: string | null;
|
|
214
|
+
conversationId: 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: {
|
|
@@ -39,7 +39,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
|
|
|
39
39
|
name: string;
|
|
40
40
|
hash: string;
|
|
41
41
|
} | null;
|
|
42
|
-
status: "pending" | "
|
|
42
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
43
43
|
scheduledFor: string;
|
|
44
44
|
startedAt: string | null;
|
|
45
45
|
completedAt: string | null;
|
|
@@ -193,7 +193,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
|
|
|
193
193
|
name: string;
|
|
194
194
|
hash: string;
|
|
195
195
|
} | null;
|
|
196
|
-
status: "pending" | "
|
|
196
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
197
197
|
scheduledFor: string;
|
|
198
198
|
startedAt: string | null;
|
|
199
199
|
completedAt: string | null;
|
|
@@ -232,7 +232,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
|
|
|
232
232
|
name: string;
|
|
233
233
|
hash: string;
|
|
234
234
|
} | null;
|
|
235
|
-
status: "pending" | "
|
|
235
|
+
status: "pending" | "failed" | "running" | "completed" | "cancelled";
|
|
236
236
|
scheduledFor: string;
|
|
237
237
|
startedAt: string | null;
|
|
238
238
|
completedAt: string | null;
|
|
@@ -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
|
+
metadata: TaskMetadataConfig | null;
|
|
10
11
|
id: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
status: string;
|
|
14
|
+
updatedAt: string;
|
|
11
15
|
tenantId: string;
|
|
12
16
|
projectId: string;
|
|
13
17
|
agentId: string;
|
|
14
|
-
|
|
15
|
-
updatedAt: string;
|
|
16
|
-
metadata: TaskMetadataConfig | null;
|
|
18
|
+
subAgentId: string;
|
|
17
19
|
ref: {
|
|
18
20
|
type: "commit" | "tag" | "branch";
|
|
19
21
|
name: string;
|
|
20
22
|
hash: string;
|
|
21
23
|
} | null;
|
|
22
|
-
status: string;
|
|
23
|
-
subAgentId: string;
|
|
24
24
|
contextId: string;
|
|
25
25
|
}>;
|
|
26
26
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|