@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.
Files changed (66) hide show
  1. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  2. package/dist/auth/auth.d.ts +9 -9
  3. package/dist/auth/permissions.d.ts +13 -13
  4. package/dist/client-exports.d.ts +2 -2
  5. package/dist/client-exports.js +2 -2
  6. package/dist/data-access/index.d.ts +6 -6
  7. package/dist/data-access/index.js +6 -6
  8. package/dist/data-access/manage/agents.d.ts +15 -15
  9. package/dist/data-access/manage/artifactComponents.d.ts +4 -4
  10. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  11. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  12. package/dist/data-access/manage/evalConfig.d.ts +19 -2
  13. package/dist/data-access/manage/evalConfig.js +20 -2
  14. package/dist/data-access/manage/functionTools.d.ts +6 -6
  15. package/dist/data-access/manage/skills.d.ts +7 -7
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
  17. package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
  19. package/dist/data-access/manage/subAgents.d.ts +9 -9
  20. package/dist/data-access/manage/tools.d.ts +15 -15
  21. package/dist/data-access/manage/triggers.d.ts +3 -3
  22. package/dist/data-access/manage/webhookDestinations.d.ts +15 -3
  23. package/dist/data-access/manage/webhookDestinations.js +26 -8
  24. package/dist/data-access/runtime/apiKeys.d.ts +4 -4
  25. package/dist/data-access/runtime/apps.d.ts +7 -7
  26. package/dist/data-access/runtime/conversations.d.ts +12 -12
  27. package/dist/data-access/runtime/evalRuns.d.ts +47 -6
  28. package/dist/data-access/runtime/evalRuns.js +96 -6
  29. package/dist/data-access/runtime/events.d.ts +3 -3
  30. package/dist/data-access/runtime/feedback.d.ts +2 -2
  31. package/dist/data-access/runtime/messages.d.ts +15 -15
  32. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +39 -7
  33. package/dist/data-access/runtime/scheduledTriggerInvocations.js +16 -3
  34. package/dist/data-access/runtime/scheduledTriggers.d.ts +28 -6
  35. package/dist/data-access/runtime/scheduledTriggers.js +34 -7
  36. package/dist/data-access/runtime/tasks.d.ts +1 -1
  37. package/dist/db/manage/manage-schema.d.ts +686 -385
  38. package/dist/db/manage/manage-schema.js +120 -2
  39. package/dist/db/runtime/runtime-schema.d.ts +472 -453
  40. package/dist/db/runtime/runtime-schema.js +3 -1
  41. package/dist/evaluation/pass-criteria-evaluator.js +69 -29
  42. package/dist/index.d.ts +10 -10
  43. package/dist/index.js +9 -9
  44. package/dist/types/entities.d.ts +5 -2
  45. package/dist/types/index.d.ts +3 -3
  46. package/dist/types/index.js +2 -2
  47. package/dist/types/utility.d.ts +13 -5
  48. package/dist/types/utility.js +2 -1
  49. package/dist/utils/error.d.ts +51 -51
  50. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  51. package/dist/validation/index.d.ts +2 -2
  52. package/dist/validation/index.js +2 -2
  53. package/dist/validation/schemas/shared.d.ts +1 -0
  54. package/dist/validation/schemas/shared.js +2 -1
  55. package/dist/validation/schemas/skills.d.ts +33 -32
  56. package/dist/validation/schemas.d.ts +2330 -1958
  57. package/dist/validation/schemas.js +64 -10
  58. package/drizzle/manage/0022_last_nemesis.sql +15 -0
  59. package/drizzle/manage/0023_flimsy_patriot.sql +13 -0
  60. package/drizzle/manage/meta/0022_snapshot.json +4216 -0
  61. package/drizzle/manage/meta/0023_snapshot.json +4317 -0
  62. package/drizzle/manage/meta/_journal.json +14 -0
  63. package/drizzle/runtime/0043_normal_beyonder.sql +2 -0
  64. package/drizzle/runtime/meta/0043_snapshot.json +6304 -0
  65. package/drizzle/runtime/meta/_journal.json +7 -0
  66. 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
- ...agentScoped,
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 evaluateCondition(condition, result) {
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
- error: `Field '${condition.field}' does not exist in output`
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
- error: `Field '${condition.field}' is not a finite number (got ${typeof fieldValue === "number" ? String(fieldValue) : typeof fieldValue})`
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 (condition.operator) {
37
+ switch (op) {
16
38
  case ">":
17
- passed = fieldValue > condition.value;
39
+ passed = fieldValue > numericValue;
18
40
  break;
19
41
  case "<":
20
- passed = fieldValue < condition.value;
42
+ passed = fieldValue < numericValue;
21
43
  break;
22
44
  case ">=":
23
- passed = fieldValue >= condition.value;
45
+ passed = fieldValue >= numericValue;
24
46
  break;
25
47
  case "<=":
26
- passed = fieldValue <= condition.value;
48
+ passed = fieldValue <= numericValue;
27
49
  break;
28
50
  case "=":
29
- passed = fieldValue === condition.value;
51
+ passed = fieldValue === numericValue;
30
52
  break;
31
53
  case "!=":
32
- passed = fieldValue !== condition.value;
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
- condition,
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 conditionResults = criteria.conditions.map((condition) => evaluateCondition(condition, evaluationResult));
46
- const configurationErrors = conditionResults.map((result) => result.error).filter((error) => error !== void 0);
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: allFailed ? "failed" : "passed",
59
- failedConditions: allFailed ? failedConditions : void 0
98
+ status: nodeResult.passed ? "passed" : "failed",
99
+ failedConditions: nodeResult.failedLeaves.length > 0 ? nodeResult.failedLeaves : void 0
60
100
  };
61
101
  }
62
102