@inkeep/agents-core 0.0.0-dev-20260330181711 → 0.0.0-dev-20260330205052
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-config-utils.js +1 -1
- 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/auth.js +1 -1
- 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/data-access/index.d.ts +4 -7
- package/dist/data-access/index.js +4 -7
- package/dist/data-access/manage/agentFull.js +0 -116
- package/dist/data-access/manage/agents.d.ts +47 -47
- package/dist/data-access/manage/agents.js +0 -30
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/audit-queries.d.ts +1 -14
- package/dist/data-access/manage/audit-queries.js +2 -16
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/skills.d.ts +14 -14
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +33 -33
- package/dist/data-access/manage/tools.d.ts +30 -30
- package/dist/data-access/manage/triggerCleanup.js +18 -7
- 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 +12 -12
- package/dist/data-access/runtime/cascade-delete.d.ts +2 -0
- package/dist/data-access/runtime/cascade-delete.js +13 -6
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +5 -4
- package/dist/data-access/runtime/scheduledTriggers.d.ts +89 -0
- package/dist/data-access/runtime/scheduledTriggers.js +91 -0
- package/dist/data-access/runtime/schedulerState.d.ts +11 -0
- package/dist/data-access/runtime/schedulerState.js +30 -0
- package/dist/data-access/runtime/tasks.d.ts +5 -5
- package/dist/data-reconciliation/index.d.ts +2 -2
- package/dist/data-reconciliation/types.d.ts +1 -28
- package/dist/db/manage/manage-schema.d.ts +344 -698
- package/dist/db/manage/manage-schema.js +2 -4
- package/dist/db/runtime/runtime-schema.d.ts +809 -348
- package/dist/db/runtime/runtime-schema.js +38 -5
- package/dist/index.d.ts +11 -12
- package/dist/index.js +8 -10
- package/dist/types/entities.d.ts +12 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/compute-next-run-at.d.ts +9 -0
- package/dist/utils/compute-next-run-at.js +18 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -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 +2708 -3688
- package/dist/validation/schemas.js +16 -32
- package/drizzle/runtime/0028_thick_squirrel_girl.sql +36 -0
- package/drizzle/runtime/meta/0028_snapshot.json +4661 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +2 -1
- package/dist/data-access/manage/scheduledTriggers.d.ts +0 -91
- package/dist/data-access/manage/scheduledTriggers.js +0 -87
- package/dist/data-access/manage/scheduledWorkflows.d.ts +0 -29
- package/dist/data-access/manage/scheduledWorkflows.js +0 -33
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
|
|
2
|
+
import { SchedulerState } from "../../types/entities.js";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/schedulerState.d.ts
|
|
5
|
+
declare const getSchedulerState: (db: AgentsRunDatabaseClient) => () => Promise<SchedulerState | undefined>;
|
|
6
|
+
declare const upsertSchedulerState: (db: AgentsRunDatabaseClient) => (params: {
|
|
7
|
+
currentRunId: string;
|
|
8
|
+
}) => Promise<SchedulerState>;
|
|
9
|
+
declare const clearSchedulerState: (db: AgentsRunDatabaseClient) => () => Promise<void>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { clearSchedulerState, getSchedulerState, upsertSchedulerState };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { schedulerState } from "../../db/runtime/runtime-schema.js";
|
|
2
|
+
import { eq, sql } from "drizzle-orm";
|
|
3
|
+
|
|
4
|
+
//#region src/data-access/runtime/schedulerState.ts
|
|
5
|
+
const SINGLETON_ID = "singleton";
|
|
6
|
+
const getSchedulerState = (db) => async () => {
|
|
7
|
+
return await db.query.schedulerState.findFirst({ where: eq(schedulerState.id, SINGLETON_ID) });
|
|
8
|
+
};
|
|
9
|
+
const upsertSchedulerState = (db) => async (params) => {
|
|
10
|
+
const [row] = await db.insert(schedulerState).values({
|
|
11
|
+
id: SINGLETON_ID,
|
|
12
|
+
currentRunId: params.currentRunId
|
|
13
|
+
}).onConflictDoUpdate({
|
|
14
|
+
target: schedulerState.id,
|
|
15
|
+
set: {
|
|
16
|
+
currentRunId: params.currentRunId,
|
|
17
|
+
updatedAt: sql`now()`.mapWith(String)
|
|
18
|
+
}
|
|
19
|
+
}).returning();
|
|
20
|
+
return row;
|
|
21
|
+
};
|
|
22
|
+
const clearSchedulerState = (db) => async () => {
|
|
23
|
+
await db.update(schedulerState).set({
|
|
24
|
+
currentRunId: null,
|
|
25
|
+
updatedAt: sql`now()`.mapWith(String)
|
|
26
|
+
}).where(eq(schedulerState.id, SINGLETON_ID));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { clearSchedulerState, getSchedulerState, upsertSchedulerState };
|
|
@@ -7,21 +7,21 @@ 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;
|
|
11
10
|
id: string;
|
|
12
11
|
createdAt: string;
|
|
13
12
|
updatedAt: string;
|
|
14
|
-
agentId: string;
|
|
15
|
-
projectId: string;
|
|
16
|
-
tenantId: string;
|
|
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;
|
|
23
|
-
|
|
20
|
+
tenantId: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
agentId: string;
|
|
24
23
|
subAgentId: string;
|
|
24
|
+
contextId: string;
|
|
25
25
|
}>;
|
|
26
26
|
declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
|
|
27
27
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult,
|
|
1
|
+
import { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult, SkippedDiff, defineHandlers } from "./types.js";
|
|
2
2
|
import { audit } from "./audit.js";
|
|
3
3
|
import { reconcile } from "./reconcile.js";
|
|
4
|
-
export { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult,
|
|
4
|
+
export { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult, SkippedDiff, audit, defineHandlers, reconcile };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { PinoLogger } from "../utils/logger.js";
|
|
2
2
|
import { AgentsManageDatabaseClient } from "../db/manage/manage-client.js";
|
|
3
3
|
import { AgentsRunDatabaseClient } from "../db/runtime/runtime-client.js";
|
|
4
|
-
import { ScheduledTrigger } from "../validation/schemas.js";
|
|
5
4
|
import { AgentSelect, ContextConfigSelect, SubAgentSelect, ToolSelect } from "../types/entities.js";
|
|
6
5
|
|
|
7
6
|
//#region src/data-reconciliation/types.d.ts
|
|
8
7
|
type EntityRowByTable = {
|
|
9
|
-
scheduled_triggers: ScheduledTrigger;
|
|
10
8
|
tools: ToolSelect;
|
|
11
9
|
context_configs: ContextConfigSelect;
|
|
12
10
|
agent: AgentSelect;
|
|
@@ -80,31 +78,6 @@ type AuditReport = {
|
|
|
80
78
|
checkedEntities: string[];
|
|
81
79
|
skippedEntities: string[];
|
|
82
80
|
};
|
|
83
|
-
type ScheduledTriggerAuditResult = {
|
|
84
|
-
missingWorkflows: Array<{
|
|
85
|
-
triggerId: string;
|
|
86
|
-
triggerName: string;
|
|
87
|
-
}>;
|
|
88
|
-
orphanedWorkflows: Array<{
|
|
89
|
-
workflowRunId: string;
|
|
90
|
-
scheduledTriggerId: string;
|
|
91
|
-
}>;
|
|
92
|
-
staleWorkflows: Array<{
|
|
93
|
-
triggerId: string;
|
|
94
|
-
triggerName: string;
|
|
95
|
-
workflowId: string;
|
|
96
|
-
}>;
|
|
97
|
-
deadWorkflows: Array<{
|
|
98
|
-
triggerId: string;
|
|
99
|
-
triggerName: string;
|
|
100
|
-
workflowRunId: string;
|
|
101
|
-
runStatus: string;
|
|
102
|
-
}>;
|
|
103
|
-
verificationFailures: Array<{
|
|
104
|
-
workflowRunId: string;
|
|
105
|
-
error: string;
|
|
106
|
-
}>;
|
|
107
|
-
};
|
|
108
81
|
type OrphanedRuntimeRowsResult = {
|
|
109
82
|
orphanedRows: Array<{
|
|
110
83
|
table: string;
|
|
@@ -113,4 +86,4 @@ type OrphanedRuntimeRowsResult = {
|
|
|
113
86
|
}>;
|
|
114
87
|
};
|
|
115
88
|
//#endregion
|
|
116
|
-
export { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult,
|
|
89
|
+
export { AppliedEffect, AuditContext, AuditReport, EntityAuditEntry, EntityDiff, EntityEffectHandlers, EntityEffectRegistry, EntityOperation, EntityRowByTable, FailedEffect, OrphanedRuntimeRowsResult, ReconcileContext, ReconcileResult, SkippedDiff, defineHandlers };
|