@inkeep/agents-core 0.59.4 → 0.61.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-validation-schemas.d.ts +154 -154
- package/dist/auth/init.js +42 -0
- package/dist/auth/wait-for-spicedb.d.ts +1 -0
- package/dist/auth/wait-for-spicedb.js +51 -0
- package/dist/client-exports.d.ts +4 -107
- package/dist/client-exports.js +3 -61
- package/dist/constants/context-breakdown.js +5 -0
- package/dist/constants/otel-attributes.d.ts +25 -1
- package/dist/constants/otel-attributes.js +25 -1
- package/dist/data-access/index.d.ts +4 -3
- package/dist/data-access/index.js +4 -3
- package/dist/data-access/manage/agentFull.js +15 -10
- package/dist/data-access/manage/agents.d.ts +69 -63
- package/dist/data-access/manage/agents.js +2 -0
- 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/functionTools.js +2 -2
- package/dist/data-access/manage/projectFull.js +24 -3
- package/dist/data-access/manage/skills.d.ts +14 -14
- package/dist/data-access/manage/skills.js +2 -3
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +27 -27
- package/dist/data-access/manage/subAgentExternalAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgentRelations.d.ts +29 -29
- package/dist/data-access/manage/subAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +30 -30
- package/dist/data-access/manage/subAgentTeamAgentRelations.js +2 -2
- package/dist/data-access/manage/subAgents.d.ts +36 -36
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/manage/tools.js +2 -2
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +16 -16
- package/dist/data-access/runtime/apps.d.ts +61 -13
- package/dist/data-access/runtime/apps.js +15 -1
- package/dist/data-access/runtime/conversations.d.ts +23 -23
- package/dist/data-access/runtime/conversations.js +18 -1
- package/dist/data-access/runtime/ledgerArtifacts.d.ts +11 -2
- package/dist/data-access/runtime/ledgerArtifacts.js +12 -1
- package/dist/data-access/runtime/messages.d.ts +18 -18
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/data-access/runtime/workflowExecutions.d.ts +25 -0
- package/dist/data-access/runtime/workflowExecutions.js +32 -0
- package/dist/db/manage/manage-schema.d.ts +495 -475
- package/dist/db/manage/manage-schema.js +1 -0
- package/dist/db/runtime/runtime-schema.d.ts +568 -334
- package/dist/db/runtime/runtime-schema.js +19 -2
- package/dist/dolt/fk-map.d.ts +5 -0
- package/dist/dolt/fk-map.js +34 -0
- package/dist/dolt/index.d.ts +3 -2
- package/dist/dolt/index.js +3 -2
- package/dist/dolt/resolve-conflicts.d.ts +11 -1
- package/dist/dolt/resolve-conflicts.js +105 -47
- package/dist/index.d.ts +15 -10
- package/dist/index.js +13 -8
- package/dist/types/entities.d.ts +5 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/utility.d.ts +11 -3
- package/dist/utils/apiKeys.js +1 -1
- package/dist/utils/conversations.d.ts +10 -1
- package/dist/utils/conversations.js +19 -1
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/index.d.ts +7 -2
- package/dist/utils/index.js +5 -2
- 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/utils/validate-public-key.d.ts +10 -0
- package/dist/utils/validate-public-key.js +89 -0
- package/dist/validation/agentFull.js +0 -1
- 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.d.ts +3518 -2682
- package/dist/validation/schemas.js +104 -36
- package/drizzle/manage/0013_gorgeous_umar.sql +1 -0
- package/drizzle/manage/meta/0013_snapshot.json +3704 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0025_faulty_kylun.sql +1 -0
- package/drizzle/runtime/0026_graceful_scorpion.sql +15 -0
- package/drizzle/runtime/meta/0026_snapshot.json +4389 -0
- package/drizzle/runtime/meta/_journal.json +14 -0
- package/package.json +1 -1
|
@@ -11,25 +11,25 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
11
11
|
messageId: string;
|
|
12
12
|
}) => Promise<{
|
|
13
13
|
id: string;
|
|
14
|
-
tenantId: string;
|
|
15
|
-
projectId: string;
|
|
16
14
|
createdAt: string;
|
|
17
15
|
updatedAt: string;
|
|
18
16
|
metadata: MessageMetadata | null;
|
|
19
|
-
content: MessageContent;
|
|
20
17
|
role: string;
|
|
21
|
-
|
|
18
|
+
projectId: string;
|
|
19
|
+
tenantId: string;
|
|
20
|
+
content: MessageContent;
|
|
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: {
|
|
@@ -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
|
-
tenantId: string;
|
|
149
|
-
projectId: string;
|
|
150
148
|
createdAt: string;
|
|
151
149
|
updatedAt: string;
|
|
152
150
|
metadata: MessageMetadata | null;
|
|
153
|
-
content: MessageContent;
|
|
154
151
|
role: string;
|
|
155
|
-
|
|
152
|
+
projectId: string;
|
|
153
|
+
tenantId: string;
|
|
154
|
+
content: MessageContent;
|
|
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: {
|
|
@@ -198,25 +198,25 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
198
198
|
messageId: string;
|
|
199
199
|
}) => Promise<{
|
|
200
200
|
id: string;
|
|
201
|
-
tenantId: string;
|
|
202
|
-
projectId: string;
|
|
203
201
|
createdAt: string;
|
|
204
202
|
updatedAt: string;
|
|
205
203
|
metadata: MessageMetadata | null;
|
|
206
|
-
content: MessageContent;
|
|
207
204
|
role: string;
|
|
208
|
-
|
|
205
|
+
projectId: string;
|
|
206
|
+
tenantId: string;
|
|
207
|
+
content: MessageContent;
|
|
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;
|
|
@@ -8,18 +8,18 @@ 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
|
-
tenantId: string;
|
|
12
|
-
projectId: string;
|
|
13
|
-
agentId: string;
|
|
14
11
|
createdAt: string;
|
|
15
12
|
updatedAt: string;
|
|
16
|
-
metadata: TaskMetadataConfig | null;
|
|
17
13
|
ref: {
|
|
18
14
|
type: "commit" | "tag" | "branch";
|
|
19
15
|
name: string;
|
|
20
16
|
hash: string;
|
|
21
17
|
} | null;
|
|
18
|
+
metadata: TaskMetadataConfig | null;
|
|
22
19
|
status: string;
|
|
20
|
+
agentId: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
tenantId: string;
|
|
23
23
|
subAgentId: string;
|
|
24
24
|
contextId: string;
|
|
25
25
|
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../../types/index.js";
|
|
2
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
3
|
+
import { WorkflowExecutionInsert, WorkflowExecutionSelect } from "../../types/entities.js";
|
|
4
|
+
|
|
5
|
+
//#region src/data-access/runtime/workflowExecutions.d.ts
|
|
6
|
+
declare const createWorkflowExecution: (db: AgentsRunDatabaseClient) => (params: WorkflowExecutionInsert) => Promise<WorkflowExecutionSelect>;
|
|
7
|
+
declare const getWorkflowExecution: (db: AgentsRunDatabaseClient) => (params: {
|
|
8
|
+
tenantId: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
id: string;
|
|
11
|
+
}) => Promise<WorkflowExecutionSelect | null>;
|
|
12
|
+
declare const getWorkflowExecutionByConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
13
|
+
tenantId: string;
|
|
14
|
+
projectId: string;
|
|
15
|
+
conversationId: string;
|
|
16
|
+
}) => Promise<WorkflowExecutionSelect | null>;
|
|
17
|
+
declare const updateWorkflowExecutionStatus: (db: AgentsRunDatabaseClient) => (params: {
|
|
18
|
+
tenantId: string;
|
|
19
|
+
projectId: string;
|
|
20
|
+
id: string;
|
|
21
|
+
status: "running" | "suspended" | "completed" | "failed";
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}) => Promise<WorkflowExecutionSelect | null>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { createWorkflowExecution, getWorkflowExecution, getWorkflowExecutionByConversation, updateWorkflowExecutionStatus };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { workflowExecutions } from "../../db/runtime/runtime-schema.js";
|
|
2
|
+
import { and, desc, eq } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/workflowExecutions.ts
|
|
5
|
+
const createWorkflowExecution = (db) => async (params) => {
|
|
6
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7
|
+
const [created] = await db.insert(workflowExecutions).values({
|
|
8
|
+
...params,
|
|
9
|
+
createdAt: now,
|
|
10
|
+
updatedAt: now
|
|
11
|
+
}).returning();
|
|
12
|
+
return created;
|
|
13
|
+
};
|
|
14
|
+
const getWorkflowExecution = (db) => async (params) => {
|
|
15
|
+
return (await db.select().from(workflowExecutions).where(and(eq(workflowExecutions.tenantId, params.tenantId), eq(workflowExecutions.projectId, params.projectId), eq(workflowExecutions.id, params.id))).limit(1))[0] ?? null;
|
|
16
|
+
};
|
|
17
|
+
const getWorkflowExecutionByConversation = (db) => async (params) => {
|
|
18
|
+
return (await db.select().from(workflowExecutions).where(and(eq(workflowExecutions.tenantId, params.tenantId), eq(workflowExecutions.projectId, params.projectId), eq(workflowExecutions.conversationId, params.conversationId))).orderBy(desc(workflowExecutions.createdAt)).limit(1))[0] ?? null;
|
|
19
|
+
};
|
|
20
|
+
const updateWorkflowExecutionStatus = (db) => async (params) => {
|
|
21
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
22
|
+
const updateData = {
|
|
23
|
+
status: params.status,
|
|
24
|
+
updatedAt: now
|
|
25
|
+
};
|
|
26
|
+
if (params.metadata !== void 0) updateData.metadata = params.metadata;
|
|
27
|
+
const [updated] = await db.update(workflowExecutions).set(updateData).where(and(eq(workflowExecutions.tenantId, params.tenantId), eq(workflowExecutions.projectId, params.projectId), eq(workflowExecutions.id, params.id))).returning();
|
|
28
|
+
return updated ?? null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { createWorkflowExecution, getWorkflowExecution, getWorkflowExecutionByConversation, updateWorkflowExecutionStatus };
|