@inkeep/agents-core 0.18.1 → 0.19.1
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/README.md +4 -4
- package/dist/{chunk-JTHQYGCX.js → chunk-4FMDWUE4.js} +34 -34
- package/dist/{chunk-ID4CFGVF.js → chunk-B6F3RF4T.js} +87 -120
- package/dist/chunk-E6R6PML7.js +19 -0
- package/dist/chunk-HYS7HUYJ.js +27 -0
- package/dist/{chunk-H6PMWHNV.js → chunk-SLL6V3AE.js} +12 -12
- package/dist/{chunk-E4SFK6AI.js → chunk-VICWT3WO.js} +281 -142
- package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
- package/dist/client-exports.cjs +390 -283
- package/dist/client-exports.d.cts +13 -14
- package/dist/client-exports.d.ts +13 -14
- package/dist/client-exports.js +10 -10
- package/dist/constants/models.cjs +31 -0
- package/dist/constants/models.d.cts +33 -0
- package/dist/constants/models.d.ts +33 -0
- package/dist/constants/models.js +1 -0
- package/dist/db/schema.cjs +85 -118
- package/dist/db/schema.d.cts +2 -3
- package/dist/db/schema.d.ts +2 -3
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +214164 -1095
- package/dist/index.d.cts +215 -214
- package/dist/index.d.ts +215 -214
- package/dist/index.js +213657 -767
- package/dist/{schema-ULFEZCOL.d.cts → schema-CcSN2XcZ.d.cts} +54 -52
- package/dist/{schema-wbZXiVWb.d.ts → schema-D8h85qdU.d.ts} +54 -52
- package/dist/{signoz-queries-BuiipZTk.d.cts → signoz-queries-CuWMQh1H.d.cts} +10 -10
- package/dist/{signoz-queries-BuiipZTk.d.ts → signoz-queries-CuWMQh1H.d.ts} +10 -10
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/dist/{utility-CyPQ1tC_.d.cts → utility-HqRMF7sM.d.cts} +1775 -320
- package/dist/{utility-CyPQ1tC_.d.ts → utility-HqRMF7sM.d.ts} +1775 -320
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.cjs +445 -304
- package/dist/validation/index.d.cts +12 -13
- package/dist/validation/index.d.ts +12 -13
- package/dist/validation/index.js +2 -2
- package/drizzle/0007_mighty_typhoid_mary.sql +227 -0
- package/drizzle/meta/0007_snapshot.json +2766 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +6 -1
- package/dist/chunk-MKBO26DX.js +0 -9
package/README.md
CHANGED
|
@@ -245,10 +245,10 @@ Define any relationships with existing tables:
|
|
|
245
245
|
|
|
246
246
|
```typescript
|
|
247
247
|
export const workflowRelations = relations(workflows, ({ one, many }) => ({
|
|
248
|
-
// Example: A workflow belongs to an agent
|
|
249
|
-
|
|
250
|
-
fields: [workflows.
|
|
251
|
-
references: [
|
|
248
|
+
// Example: A workflow belongs to an agent
|
|
249
|
+
agent: one(agents, {
|
|
250
|
+
fields: [workflows.agentId],
|
|
251
|
+
references: [agents.id],
|
|
252
252
|
}),
|
|
253
253
|
// Example: A workflow can have many tasks
|
|
254
254
|
tasks: many(tasks),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-VICWT3WO.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
var TransferDataSchema = z.object({
|
|
@@ -39,24 +39,24 @@ var A2AMessageMetadataSchema = z.object({
|
|
|
39
39
|
a2aTaskId: z.string().optional().describe("A2A-specific task ID")
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
// src/validation/
|
|
42
|
+
// src/validation/agentFull.ts
|
|
43
43
|
function isInternalAgent(agent) {
|
|
44
44
|
return "prompt" in agent;
|
|
45
45
|
}
|
|
46
46
|
function isExternalAgent(agent) {
|
|
47
47
|
return "baseUrl" in agent;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
49
|
+
function validateAndTypeAgentData(data) {
|
|
50
|
+
return AgentWithinContextOfProjectSchema.parse(data);
|
|
51
51
|
}
|
|
52
|
-
function validateToolReferences(
|
|
52
|
+
function validateToolReferences(agentData, availableToolIds) {
|
|
53
53
|
if (!availableToolIds) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
const errors = [];
|
|
57
|
-
for (const [subAgentId,
|
|
58
|
-
if (isInternalAgent(
|
|
59
|
-
for (const canUseItem of
|
|
57
|
+
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
58
|
+
if (isInternalAgent(subAgent) && subAgent.canUse && Array.isArray(subAgent.canUse)) {
|
|
59
|
+
for (const canUseItem of subAgent.canUse) {
|
|
60
60
|
if (!availableToolIds.has(canUseItem.toolId)) {
|
|
61
61
|
errors.push(`Agent '${subAgentId}' references non-existent tool '${canUseItem.toolId}'`);
|
|
62
62
|
}
|
|
@@ -68,14 +68,14 @@ function validateToolReferences(graphData, availableToolIds) {
|
|
|
68
68
|
${errors.join("\n")}`);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function validateDataComponentReferences(
|
|
71
|
+
function validateDataComponentReferences(agentData, availableDataComponentIds) {
|
|
72
72
|
if (!availableDataComponentIds) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
const errors = [];
|
|
76
|
-
for (const [subAgentId,
|
|
77
|
-
if (isInternalAgent(
|
|
78
|
-
for (const dataComponentId of
|
|
76
|
+
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
77
|
+
if (isInternalAgent(subAgent) && subAgent.dataComponents) {
|
|
78
|
+
for (const dataComponentId of subAgent.dataComponents) {
|
|
79
79
|
if (!availableDataComponentIds.has(dataComponentId)) {
|
|
80
80
|
errors.push(
|
|
81
81
|
`Agent '${subAgentId}' references non-existent dataComponent '${dataComponentId}'`
|
|
@@ -89,14 +89,14 @@ function validateDataComponentReferences(graphData, availableDataComponentIds) {
|
|
|
89
89
|
${errors.join("\n")}`);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function validateArtifactComponentReferences(
|
|
92
|
+
function validateArtifactComponentReferences(agentData, availableArtifactComponentIds) {
|
|
93
93
|
if (!availableArtifactComponentIds) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
const errors = [];
|
|
97
|
-
for (const [subAgentId,
|
|
98
|
-
if (isInternalAgent(
|
|
99
|
-
for (const artifactComponentId of
|
|
97
|
+
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
98
|
+
if (isInternalAgent(subAgent) && subAgent.artifactComponents) {
|
|
99
|
+
for (const artifactComponentId of subAgent.artifactComponents) {
|
|
100
100
|
if (!availableArtifactComponentIds.has(artifactComponentId)) {
|
|
101
101
|
errors.push(
|
|
102
102
|
`Agent '${subAgentId}' references non-existent artifactComponent '${artifactComponentId}'`
|
|
@@ -110,25 +110,25 @@ function validateArtifactComponentReferences(graphData, availableArtifactCompone
|
|
|
110
110
|
${errors.join("\n")}`);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function validateAgentRelationships(
|
|
113
|
+
function validateAgentRelationships(agentData) {
|
|
114
114
|
const errors = [];
|
|
115
|
-
const availableAgentIds = new Set(Object.keys(
|
|
116
|
-
for (const [subAgentId,
|
|
117
|
-
if (isInternalAgent(
|
|
118
|
-
if (
|
|
119
|
-
for (const targetId of
|
|
115
|
+
const availableAgentIds = new Set(Object.keys(agentData.subAgents));
|
|
116
|
+
for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
|
|
117
|
+
if (isInternalAgent(subAgent)) {
|
|
118
|
+
if (subAgent.canTransferTo && Array.isArray(subAgent.canTransferTo)) {
|
|
119
|
+
for (const targetId of subAgent.canTransferTo) {
|
|
120
120
|
if (!availableAgentIds.has(targetId)) {
|
|
121
121
|
errors.push(
|
|
122
|
-
`Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in
|
|
122
|
+
`Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in agent`
|
|
123
123
|
);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
if (
|
|
128
|
-
for (const targetId of
|
|
127
|
+
if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo)) {
|
|
128
|
+
for (const targetId of subAgent.canDelegateTo) {
|
|
129
129
|
if (!availableAgentIds.has(targetId)) {
|
|
130
130
|
errors.push(
|
|
131
|
-
`Agent '${subAgentId}' has delegation target '${targetId}' that doesn't exist in
|
|
131
|
+
`Agent '${subAgentId}' has delegation target '${targetId}' that doesn't exist in agent`
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -140,16 +140,16 @@ function validateAgentRelationships(graphData) {
|
|
|
140
140
|
${errors.join("\n")}`);
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
if (
|
|
145
|
-
throw new Error(`Default agent '${
|
|
143
|
+
function validateAgentStructure(agentData, projectResources) {
|
|
144
|
+
if (agentData.defaultSubAgentId && !agentData.subAgents[agentData.defaultSubAgentId]) {
|
|
145
|
+
throw new Error(`Default agent '${agentData.defaultSubAgentId}' does not exist in agents`);
|
|
146
146
|
}
|
|
147
147
|
if (projectResources) {
|
|
148
|
-
validateToolReferences(
|
|
149
|
-
validateDataComponentReferences(
|
|
150
|
-
validateArtifactComponentReferences(
|
|
148
|
+
validateToolReferences(agentData, projectResources.toolIds);
|
|
149
|
+
validateDataComponentReferences(agentData, projectResources.dataComponentIds);
|
|
150
|
+
validateArtifactComponentReferences(agentData, projectResources.artifactComponentIds);
|
|
151
151
|
}
|
|
152
|
-
validateAgentRelationships(
|
|
152
|
+
validateAgentRelationships(agentData);
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// src/validation/id-validation.ts
|
|
@@ -170,4 +170,4 @@ function generateIdFromName(name) {
|
|
|
170
170
|
return truncatedId;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships,
|
|
173
|
+
export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateToolReferences };
|