@inkeep/agents-core 0.78.3 → 0.78.5
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/auth.d.ts +9 -9
- 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 +6 -6
- package/dist/data-access/index.js +6 -6
- package/dist/data-access/manage/agents.d.ts +15 -15
- package/dist/data-access/manage/artifactComponents.d.ts +4 -4
- 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/evalConfig.d.ts +19 -2
- package/dist/data-access/manage/evalConfig.js +20 -2
- package/dist/data-access/manage/functionTools.d.ts +6 -6
- package/dist/data-access/manage/skills.d.ts +7 -7
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
- package/dist/data-access/manage/subAgents.d.ts +9 -9
- package/dist/data-access/manage/tools.d.ts +15 -15
- package/dist/data-access/manage/triggers.d.ts +3 -3
- package/dist/data-access/manage/webhookDestinations.d.ts +15 -3
- package/dist/data-access/manage/webhookDestinations.js +26 -8
- package/dist/data-access/runtime/apiKeys.d.ts +4 -4
- package/dist/data-access/runtime/apps.d.ts +7 -7
- package/dist/data-access/runtime/conversations.d.ts +12 -12
- package/dist/data-access/runtime/evalRuns.d.ts +47 -6
- package/dist/data-access/runtime/evalRuns.js +96 -6
- package/dist/data-access/runtime/events.d.ts +3 -3
- package/dist/data-access/runtime/feedback.d.ts +2 -2
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +39 -7
- package/dist/data-access/runtime/scheduledTriggerInvocations.js +16 -3
- package/dist/data-access/runtime/scheduledTriggers.d.ts +28 -6
- package/dist/data-access/runtime/scheduledTriggers.js +34 -7
- package/dist/data-access/runtime/tasks.d.ts +1 -1
- package/dist/db/manage/manage-schema.d.ts +686 -385
- package/dist/db/manage/manage-schema.js +120 -2
- package/dist/db/runtime/runtime-schema.d.ts +472 -453
- package/dist/db/runtime/runtime-schema.js +3 -1
- package/dist/evaluation/pass-criteria-evaluator.js +69 -29
- package/dist/index.d.ts +10 -10
- package/dist/index.js +9 -9
- package/dist/types/entities.d.ts +5 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +2 -2
- package/dist/types/utility.d.ts +13 -5
- package/dist/types/utility.js +2 -1
- package/dist/utils/error.d.ts +51 -51
- 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/shared.d.ts +1 -0
- package/dist/validation/schemas/shared.js +2 -1
- package/dist/validation/schemas/skills.d.ts +33 -32
- package/dist/validation/schemas.d.ts +2330 -1958
- package/dist/validation/schemas.js +64 -10
- package/drizzle/manage/0022_last_nemesis.sql +15 -0
- package/drizzle/manage/0023_flimsy_patriot.sql +13 -0
- package/drizzle/manage/meta/0022_snapshot.json +4216 -0
- package/drizzle/manage/meta/0023_snapshot.json +4317 -0
- package/drizzle/manage/meta/_journal.json +14 -0
- package/drizzle/runtime/0043_normal_beyonder.sql +2 -0
- package/drizzle/runtime/meta/0043_snapshot.json +6304 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -320,7 +320,8 @@ const workAppSlackChannelAgentConfigs = pgTable("work_app_slack_channel_agent_co
|
|
|
320
320
|
index("work_app_slack_channel_agent_configs_project_idx").on(table.tenantId, table.projectId)
|
|
321
321
|
]);
|
|
322
322
|
const scheduledTriggers = pgTable("scheduled_triggers", {
|
|
323
|
-
...
|
|
323
|
+
...projectScoped,
|
|
324
|
+
agentId: varchar("agent_id", { length: 256 }),
|
|
324
325
|
name: varchar("name", { length: 256 }).notNull(),
|
|
325
326
|
description: text("description"),
|
|
326
327
|
enabled: boolean("enabled").notNull().default(true),
|
|
@@ -343,6 +344,7 @@ const scheduledTriggers = pgTable("scheduled_triggers", {
|
|
|
343
344
|
}),
|
|
344
345
|
ref: varchar("ref", { length: 256 }).notNull().default("main"),
|
|
345
346
|
dispatchDelayMs: integer("dispatch_delay_ms"),
|
|
347
|
+
datasetRunConfigId: varchar("dataset_run_config_id", { length: 256 }),
|
|
346
348
|
...timestamps
|
|
347
349
|
}, (table) => [
|
|
348
350
|
primaryKey({ columns: [table.tenantId, table.id] }),
|
|
@@ -1,62 +1,102 @@
|
|
|
1
|
+
import { MAX_PASS_CRITERIA_DEPTH } from "../types/utility.js";
|
|
2
|
+
|
|
1
3
|
//#region src/evaluation/pass-criteria-evaluator.ts
|
|
2
|
-
function
|
|
4
|
+
function isGroup(node) {
|
|
5
|
+
return "conditions" in node && Array.isArray(node.conditions);
|
|
6
|
+
}
|
|
7
|
+
function evaluateLeaf(condition, result) {
|
|
3
8
|
const fieldValue = result[condition.field];
|
|
4
9
|
if (!(condition.field in result)) return {
|
|
5
|
-
condition,
|
|
6
10
|
passed: false,
|
|
7
|
-
|
|
11
|
+
failedLeaves: [],
|
|
12
|
+
errors: [`Field '${condition.field}' does not exist in output`]
|
|
8
13
|
};
|
|
14
|
+
if (typeof condition.value === "boolean") {
|
|
15
|
+
if (typeof fieldValue !== "boolean") return {
|
|
16
|
+
passed: false,
|
|
17
|
+
failedLeaves: [],
|
|
18
|
+
errors: [`Field '${condition.field}' is not a boolean (got ${typeof fieldValue})`]
|
|
19
|
+
};
|
|
20
|
+
let passed$1 = false;
|
|
21
|
+
if (condition.operator === "=") passed$1 = fieldValue === condition.value;
|
|
22
|
+
else passed$1 = fieldValue !== condition.value;
|
|
23
|
+
return {
|
|
24
|
+
passed: passed$1,
|
|
25
|
+
failedLeaves: passed$1 ? [] : [condition],
|
|
26
|
+
errors: []
|
|
27
|
+
};
|
|
28
|
+
}
|
|
9
29
|
if (typeof fieldValue !== "number" || !Number.isFinite(fieldValue)) return {
|
|
10
|
-
condition,
|
|
11
30
|
passed: false,
|
|
12
|
-
|
|
31
|
+
failedLeaves: [],
|
|
32
|
+
errors: [`Field '${condition.field}' is not a finite number (got ${typeof fieldValue === "number" ? String(fieldValue) : typeof fieldValue})`]
|
|
13
33
|
};
|
|
34
|
+
const numericValue = condition.value;
|
|
35
|
+
const op = condition.operator;
|
|
14
36
|
let passed = false;
|
|
15
|
-
switch (
|
|
37
|
+
switch (op) {
|
|
16
38
|
case ">":
|
|
17
|
-
passed = fieldValue >
|
|
39
|
+
passed = fieldValue > numericValue;
|
|
18
40
|
break;
|
|
19
41
|
case "<":
|
|
20
|
-
passed = fieldValue <
|
|
42
|
+
passed = fieldValue < numericValue;
|
|
21
43
|
break;
|
|
22
44
|
case ">=":
|
|
23
|
-
passed = fieldValue >=
|
|
45
|
+
passed = fieldValue >= numericValue;
|
|
24
46
|
break;
|
|
25
47
|
case "<=":
|
|
26
|
-
passed = fieldValue <=
|
|
48
|
+
passed = fieldValue <= numericValue;
|
|
27
49
|
break;
|
|
28
50
|
case "=":
|
|
29
|
-
passed = fieldValue ===
|
|
51
|
+
passed = fieldValue === numericValue;
|
|
30
52
|
break;
|
|
31
53
|
case "!=":
|
|
32
|
-
passed = fieldValue !==
|
|
54
|
+
passed = fieldValue !== numericValue;
|
|
33
55
|
break;
|
|
34
|
-
default:
|
|
35
|
-
condition.operator;
|
|
36
|
-
passed = false;
|
|
56
|
+
default: passed = false;
|
|
37
57
|
}
|
|
38
58
|
return {
|
|
39
|
-
|
|
40
|
-
passed
|
|
59
|
+
passed,
|
|
60
|
+
failedLeaves: passed ? [] : [condition],
|
|
61
|
+
errors: []
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function evaluateNode(node, result, depth) {
|
|
65
|
+
if (!isGroup(node)) return evaluateLeaf(node, result);
|
|
66
|
+
if (depth > MAX_PASS_CRITERIA_DEPTH) return {
|
|
67
|
+
passed: false,
|
|
68
|
+
failedLeaves: [],
|
|
69
|
+
errors: [`Pass criteria exceeds maximum nesting depth of ${MAX_PASS_CRITERIA_DEPTH}`]
|
|
70
|
+
};
|
|
71
|
+
if (node.conditions.length === 0) return {
|
|
72
|
+
passed: true,
|
|
73
|
+
failedLeaves: [],
|
|
74
|
+
errors: []
|
|
75
|
+
};
|
|
76
|
+
const childResults = node.conditions.map((child) => evaluateNode(child, result, isGroup(child) ? depth + 1 : depth));
|
|
77
|
+
const allErrors = childResults.flatMap((r) => r.errors);
|
|
78
|
+
if (node.operator === "and") return {
|
|
79
|
+
passed: childResults.every((r) => r.passed),
|
|
80
|
+
failedLeaves: childResults.flatMap((r) => r.failedLeaves),
|
|
81
|
+
errors: allErrors
|
|
82
|
+
};
|
|
83
|
+
const passed = childResults.some((r) => r.passed);
|
|
84
|
+
return {
|
|
85
|
+
passed,
|
|
86
|
+
failedLeaves: passed ? [] : childResults.flatMap((r) => r.failedLeaves),
|
|
87
|
+
errors: allErrors
|
|
41
88
|
};
|
|
42
89
|
}
|
|
43
90
|
function evaluatePassCriteria(criteria, evaluationResult) {
|
|
44
91
|
if (!criteria || !criteria.conditions || criteria.conditions.length === 0) return { status: "no_criteria" };
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
if (configurationErrors.length > 0) return {
|
|
92
|
+
const nodeResult = evaluateNode(criteria, evaluationResult, 0);
|
|
93
|
+
if (nodeResult.errors.length > 0) return {
|
|
48
94
|
status: "no_criteria",
|
|
49
|
-
configurationErrors
|
|
50
|
-
};
|
|
51
|
-
const failedConditions = conditionResults.filter((result) => !result.passed).map((result) => result.condition);
|
|
52
|
-
if (criteria.operator === "and") return {
|
|
53
|
-
status: failedConditions.length === 0 ? "passed" : "failed",
|
|
54
|
-
failedConditions: failedConditions.length > 0 ? failedConditions : void 0
|
|
95
|
+
configurationErrors: nodeResult.errors
|
|
55
96
|
};
|
|
56
|
-
const allFailed = failedConditions.length === criteria.conditions.length;
|
|
57
97
|
return {
|
|
58
|
-
status:
|
|
59
|
-
failedConditions:
|
|
98
|
+
status: nodeResult.passed ? "passed" : "failed",
|
|
99
|
+
failedConditions: nodeResult.failedLeaves.length > 0 ? nodeResult.failedLeaves : void 0
|
|
60
100
|
};
|
|
61
101
|
}
|
|
62
102
|
|