@inkeep/agents-core 0.17.0 → 0.18.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.
Files changed (36) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-TO2HNKGP.js → chunk-E4SFK6AI.js} +143 -157
  3. package/dist/{chunk-VPJ6Z5QZ.js → chunk-ID4CFGVF.js} +202 -131
  4. package/dist/chunk-JTHQYGCX.js +173 -0
  5. package/dist/chunk-TCLX6C3C.js +271 -0
  6. package/dist/client-exports.cjs +622 -272
  7. package/dist/client-exports.d.cts +6 -5
  8. package/dist/client-exports.d.ts +6 -5
  9. package/dist/client-exports.js +5 -4
  10. package/dist/db/schema.cjs +201 -130
  11. package/dist/db/schema.d.cts +2 -2
  12. package/dist/db/schema.d.ts +2 -2
  13. package/dist/db/schema.js +1 -1
  14. package/dist/index.cjs +2734 -1831
  15. package/dist/index.d.cts +1664 -1544
  16. package/dist/index.d.ts +1664 -1544
  17. package/dist/index.js +1953 -1467
  18. package/dist/{schema-BQk_FMBV.d.ts → schema-Bjy5TkFv.d.cts} +473 -172
  19. package/dist/{schema-Ct2NlO81.d.cts → schema-CfWbqju2.d.ts} +473 -172
  20. package/dist/signoz-queries-CifqdbnO.d.cts +269 -0
  21. package/dist/signoz-queries-CifqdbnO.d.ts +269 -0
  22. package/dist/types/index.d.cts +2 -2
  23. package/dist/types/index.d.ts +2 -2
  24. package/dist/{utility-s9c5CVOe.d.cts → utility-Fxoh7s82.d.cts} +585 -384
  25. package/dist/{utility-s9c5CVOe.d.ts → utility-Fxoh7s82.d.ts} +585 -384
  26. package/dist/validation/index.cjs +429 -325
  27. package/dist/validation/index.d.cts +76 -4
  28. package/dist/validation/index.d.ts +76 -4
  29. package/dist/validation/index.js +2 -2
  30. package/drizzle/0005_wide_shriek.sql +127 -0
  31. package/drizzle/0006_damp_lenny_balinger.sql +52 -0
  32. package/drizzle/meta/0005_snapshot.json +2558 -0
  33. package/drizzle/meta/0006_snapshot.json +2751 -0
  34. package/drizzle/meta/_journal.json +14 -0
  35. package/package.json +1 -1
  36. package/dist/chunk-L53XWAYG.js +0 -134
@@ -36,6 +36,20 @@
36
36
  "when": 1759974668186,
37
37
  "tag": "0004_melted_omega_flight",
38
38
  "breakpoints": true
39
+ },
40
+ {
41
+ "idx": 5,
42
+ "version": "6",
43
+ "when": 1760028262290,
44
+ "tag": "0005_wide_shriek",
45
+ "breakpoints": true
46
+ },
47
+ {
48
+ "idx": 6,
49
+ "version": "6",
50
+ "when": 1760053343084,
51
+ "tag": "0006_damp_lenny_balinger",
52
+ "breakpoints": true
39
53
  }
40
54
  ]
41
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-core",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Agents Core contains the database schema, types, and validation schemas for Inkeep Agent Framework, along with core components.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -1,134 +0,0 @@
1
- import { FullGraphDefinitionSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-TO2HNKGP.js';
2
-
3
- // src/validation/graphFull.ts
4
- function isInternalAgent(agent) {
5
- return "prompt" in agent;
6
- }
7
- function isExternalAgent(agent) {
8
- return "baseUrl" in agent;
9
- }
10
- function validateAndTypeGraphData(data) {
11
- return FullGraphDefinitionSchema.parse(data);
12
- }
13
- function validateToolReferences(graphData, availableToolIds) {
14
- if (!availableToolIds) {
15
- return;
16
- }
17
- const errors = [];
18
- for (const [agentId, agentData] of Object.entries(graphData.agents)) {
19
- if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
20
- for (const canUseItem of agentData.canUse) {
21
- if (!availableToolIds.has(canUseItem.toolId)) {
22
- errors.push(`Agent '${agentId}' references non-existent tool '${canUseItem.toolId}'`);
23
- }
24
- }
25
- }
26
- }
27
- if (errors.length > 0) {
28
- throw new Error(`Tool reference validation failed:
29
- ${errors.join("\n")}`);
30
- }
31
- }
32
- function validateDataComponentReferences(graphData, availableDataComponentIds) {
33
- if (!availableDataComponentIds) {
34
- return;
35
- }
36
- const errors = [];
37
- for (const [agentId, agentData] of Object.entries(graphData.agents)) {
38
- if (isInternalAgent(agentData) && agentData.dataComponents) {
39
- for (const dataComponentId of agentData.dataComponents) {
40
- if (!availableDataComponentIds.has(dataComponentId)) {
41
- errors.push(
42
- `Agent '${agentId}' references non-existent dataComponent '${dataComponentId}'`
43
- );
44
- }
45
- }
46
- }
47
- }
48
- if (errors.length > 0) {
49
- throw new Error(`DataComponent reference validation failed:
50
- ${errors.join("\n")}`);
51
- }
52
- }
53
- function validateArtifactComponentReferences(graphData, availableArtifactComponentIds) {
54
- if (!availableArtifactComponentIds) {
55
- return;
56
- }
57
- const errors = [];
58
- for (const [agentId, agentData] of Object.entries(graphData.agents)) {
59
- if (isInternalAgent(agentData) && agentData.artifactComponents) {
60
- for (const artifactComponentId of agentData.artifactComponents) {
61
- if (!availableArtifactComponentIds.has(artifactComponentId)) {
62
- errors.push(
63
- `Agent '${agentId}' references non-existent artifactComponent '${artifactComponentId}'`
64
- );
65
- }
66
- }
67
- }
68
- }
69
- if (errors.length > 0) {
70
- throw new Error(`ArtifactComponent reference validation failed:
71
- ${errors.join("\n")}`);
72
- }
73
- }
74
- function validateAgentRelationships(graphData) {
75
- const errors = [];
76
- const availableAgentIds = new Set(Object.keys(graphData.agents));
77
- for (const [agentId, agentData] of Object.entries(graphData.agents)) {
78
- if (isInternalAgent(agentData)) {
79
- if (agentData.canTransferTo && Array.isArray(agentData.canTransferTo)) {
80
- for (const targetId of agentData.canTransferTo) {
81
- if (!availableAgentIds.has(targetId)) {
82
- errors.push(
83
- `Agent '${agentId}' has transfer target '${targetId}' that doesn't exist in graph`
84
- );
85
- }
86
- }
87
- }
88
- if (agentData.canDelegateTo && Array.isArray(agentData.canDelegateTo)) {
89
- for (const targetId of agentData.canDelegateTo) {
90
- if (!availableAgentIds.has(targetId)) {
91
- errors.push(
92
- `Agent '${agentId}' has delegation target '${targetId}' that doesn't exist in graph`
93
- );
94
- }
95
- }
96
- }
97
- }
98
- }
99
- if (errors.length > 0) {
100
- throw new Error(`Agent relationship validation failed:
101
- ${errors.join("\n")}`);
102
- }
103
- }
104
- function validateGraphStructure(graphData, projectResources) {
105
- if (graphData.defaultAgentId && !graphData.agents[graphData.defaultAgentId]) {
106
- throw new Error(`Default agent '${graphData.defaultAgentId}' does not exist in agents`);
107
- }
108
- if (projectResources) {
109
- validateToolReferences(graphData, projectResources.toolIds);
110
- validateDataComponentReferences(graphData, projectResources.dataComponentIds);
111
- validateArtifactComponentReferences(graphData, projectResources.artifactComponentIds);
112
- }
113
- validateAgentRelationships(graphData);
114
- }
115
-
116
- // src/validation/id-validation.ts
117
- function isValidResourceId(id) {
118
- const result = resourceIdSchema.safeParse(id);
119
- return result.success;
120
- }
121
- function generateIdFromName(name) {
122
- const id = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
123
- if (!id) {
124
- throw new Error("Cannot generate valid ID from provided name");
125
- }
126
- const truncatedId = id.substring(0, MAX_ID_LENGTH);
127
- const result = resourceIdSchema.safeParse(truncatedId);
128
- if (!result.success) {
129
- throw new Error(`Generated ID "${truncatedId}" is not valid: ${result.error.message}`);
130
- }
131
- return truncatedId;
132
- }
133
-
134
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences };