@inkeep/agents-core 0.1.4 → 0.1.7

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 (278) hide show
  1. package/README.md +2 -2
  2. package/SUPPLEMENTAL_TERMS.md +40 -0
  3. package/dist/chunk-BMKWVKI2.js +126 -0
  4. package/dist/chunk-H2F72PDA.js +15 -0
  5. package/dist/chunk-MKBO26DX.js +9 -0
  6. package/dist/chunk-MXQKLGQK.js +925 -0
  7. package/dist/chunk-R3VVJXX7.js +575 -0
  8. package/dist/chunk-SVGQSPW4.js +24 -0
  9. package/dist/client-exports.cjs +1702 -0
  10. package/dist/client-exports.js +202 -246
  11. package/dist/db/schema.cjs +922 -0
  12. package/dist/db/schema.js +1 -696
  13. package/dist/index.cjs +10122 -0
  14. package/dist/index.js +7989 -13
  15. package/dist/types/index.cjs +45 -0
  16. package/dist/types/index.js +2 -6
  17. package/dist/validation/index.cjs +1772 -0
  18. package/dist/validation/index.js +2 -5
  19. package/package.json +11 -6
  20. package/dist/__tests__/integration/helpers.d.ts +0 -5
  21. package/dist/__tests__/integration/helpers.d.ts.map +0 -1
  22. package/dist/__tests__/integration/helpers.js +0 -37
  23. package/dist/__tests__/integration/helpers.js.map +0 -1
  24. package/dist/__tests__/setup.d.ts +0 -3
  25. package/dist/__tests__/setup.d.ts.map +0 -1
  26. package/dist/__tests__/setup.js +0 -29
  27. package/dist/__tests__/setup.js.map +0 -1
  28. package/dist/client-exports.d.ts +0 -300
  29. package/dist/client-exports.d.ts.map +0 -1
  30. package/dist/client-exports.js.map +0 -1
  31. package/dist/context/ContextConfig.d.ts +0 -54
  32. package/dist/context/ContextConfig.d.ts.map +0 -1
  33. package/dist/context/ContextConfig.js +0 -302
  34. package/dist/context/ContextConfig.js.map +0 -1
  35. package/dist/context/ContextFetcher.d.ts +0 -64
  36. package/dist/context/ContextFetcher.d.ts.map +0 -1
  37. package/dist/context/ContextFetcher.js +0 -325
  38. package/dist/context/ContextFetcher.js.map +0 -1
  39. package/dist/context/ContextResolver.d.ts +0 -52
  40. package/dist/context/ContextResolver.d.ts.map +0 -1
  41. package/dist/context/ContextResolver.js +0 -298
  42. package/dist/context/ContextResolver.js.map +0 -1
  43. package/dist/context/TemplateEngine.d.ts +0 -46
  44. package/dist/context/TemplateEngine.d.ts.map +0 -1
  45. package/dist/context/TemplateEngine.js +0 -175
  46. package/dist/context/TemplateEngine.js.map +0 -1
  47. package/dist/context/context.d.ts +0 -8
  48. package/dist/context/context.d.ts.map +0 -1
  49. package/dist/context/context.js +0 -157
  50. package/dist/context/context.js.map +0 -1
  51. package/dist/context/contextCache.d.ts +0 -50
  52. package/dist/context/contextCache.d.ts.map +0 -1
  53. package/dist/context/contextCache.js +0 -175
  54. package/dist/context/contextCache.js.map +0 -1
  55. package/dist/context/index.d.ts +0 -11
  56. package/dist/context/index.d.ts.map +0 -1
  57. package/dist/context/index.js +0 -8
  58. package/dist/context/index.js.map +0 -1
  59. package/dist/credential-stores/CredentialStoreRegistry.d.ts +0 -39
  60. package/dist/credential-stores/CredentialStoreRegistry.d.ts.map +0 -1
  61. package/dist/credential-stores/CredentialStoreRegistry.js +0 -65
  62. package/dist/credential-stores/CredentialStoreRegistry.js.map +0 -1
  63. package/dist/credential-stores/defaults.d.ts +0 -6
  64. package/dist/credential-stores/defaults.d.ts.map +0 -1
  65. package/dist/credential-stores/defaults.js +0 -22
  66. package/dist/credential-stores/defaults.js.map +0 -1
  67. package/dist/credential-stores/index.d.ts +0 -6
  68. package/dist/credential-stores/index.d.ts.map +0 -1
  69. package/dist/credential-stores/index.js +0 -6
  70. package/dist/credential-stores/index.js.map +0 -1
  71. package/dist/credential-stores/keychain-store.d.ts +0 -100
  72. package/dist/credential-stores/keychain-store.d.ts.map +0 -1
  73. package/dist/credential-stores/keychain-store.js +0 -225
  74. package/dist/credential-stores/keychain-store.js.map +0 -1
  75. package/dist/credential-stores/memory-store.d.ts +0 -39
  76. package/dist/credential-stores/memory-store.d.ts.map +0 -1
  77. package/dist/credential-stores/memory-store.js +0 -58
  78. package/dist/credential-stores/memory-store.js.map +0 -1
  79. package/dist/credential-stores/nango-store.d.ts +0 -59
  80. package/dist/credential-stores/nango-store.d.ts.map +0 -1
  81. package/dist/credential-stores/nango-store.js +0 -264
  82. package/dist/credential-stores/nango-store.js.map +0 -1
  83. package/dist/credential-stuffer/CredentialStuffer.d.ts +0 -80
  84. package/dist/credential-stuffer/CredentialStuffer.d.ts.map +0 -1
  85. package/dist/credential-stuffer/CredentialStuffer.js +0 -186
  86. package/dist/credential-stuffer/CredentialStuffer.js.map +0 -1
  87. package/dist/credential-stuffer/index.d.ts +0 -2
  88. package/dist/credential-stuffer/index.d.ts.map +0 -1
  89. package/dist/credential-stuffer/index.js +0 -2
  90. package/dist/credential-stuffer/index.js.map +0 -1
  91. package/dist/data-access/agentDataComponents.d.ts +0 -1
  92. package/dist/data-access/agentDataComponents.d.ts.map +0 -1
  93. package/dist/data-access/agentDataComponents.js +0 -2
  94. package/dist/data-access/agentDataComponents.js.map +0 -1
  95. package/dist/data-access/agentGraphs.d.ts +0 -406
  96. package/dist/data-access/agentGraphs.d.ts.map +0 -1
  97. package/dist/data-access/agentGraphs.js +0 -551
  98. package/dist/data-access/agentGraphs.js.map +0 -1
  99. package/dist/data-access/agentRelations.d.ts +0 -456
  100. package/dist/data-access/agentRelations.d.ts.map +0 -1
  101. package/dist/data-access/agentRelations.js +0 -471
  102. package/dist/data-access/agentRelations.js.map +0 -1
  103. package/dist/data-access/agents.d.ts +0 -218
  104. package/dist/data-access/agents.d.ts.map +0 -1
  105. package/dist/data-access/agents.js +0 -130
  106. package/dist/data-access/agents.js.map +0 -1
  107. package/dist/data-access/apiKeys.d.ts +0 -114
  108. package/dist/data-access/apiKeys.d.ts.map +0 -1
  109. package/dist/data-access/apiKeys.js +0 -185
  110. package/dist/data-access/apiKeys.js.map +0 -1
  111. package/dist/data-access/artifactComponents.d.ts +0 -152
  112. package/dist/data-access/artifactComponents.d.ts.map +0 -1
  113. package/dist/data-access/artifactComponents.js +0 -214
  114. package/dist/data-access/artifactComponents.js.map +0 -1
  115. package/dist/data-access/contextCache.d.ts +0 -68
  116. package/dist/data-access/contextCache.d.ts.map +0 -1
  117. package/dist/data-access/contextCache.js +0 -160
  118. package/dist/data-access/contextCache.js.map +0 -1
  119. package/dist/data-access/contextConfigs.d.ts +0 -110
  120. package/dist/data-access/contextConfigs.d.ts.map +0 -1
  121. package/dist/data-access/contextConfigs.js +0 -156
  122. package/dist/data-access/contextConfigs.js.map +0 -1
  123. package/dist/data-access/conversations.d.ts +0 -125
  124. package/dist/data-access/conversations.d.ts.map +0 -1
  125. package/dist/data-access/conversations.js +0 -244
  126. package/dist/data-access/conversations.js.map +0 -1
  127. package/dist/data-access/credentialReferences.d.ts +0 -86
  128. package/dist/data-access/credentialReferences.d.ts.map +0 -1
  129. package/dist/data-access/credentialReferences.js +0 -175
  130. package/dist/data-access/credentialReferences.js.map +0 -1
  131. package/dist/data-access/dataComponents.d.ts +0 -129
  132. package/dist/data-access/dataComponents.d.ts.map +0 -1
  133. package/dist/data-access/dataComponents.js +0 -213
  134. package/dist/data-access/dataComponents.js.map +0 -1
  135. package/dist/data-access/externalAgents.d.ts +0 -83
  136. package/dist/data-access/externalAgents.d.ts.map +0 -1
  137. package/dist/data-access/externalAgents.js +0 -163
  138. package/dist/data-access/externalAgents.js.map +0 -1
  139. package/dist/data-access/graphFull.d.ts +0 -32
  140. package/dist/data-access/graphFull.d.ts.map +0 -1
  141. package/dist/data-access/graphFull.js +0 -996
  142. package/dist/data-access/graphFull.js.map +0 -1
  143. package/dist/data-access/index.d.ts +0 -21
  144. package/dist/data-access/index.d.ts.map +0 -1
  145. package/dist/data-access/index.js +0 -22
  146. package/dist/data-access/index.js.map +0 -1
  147. package/dist/data-access/ledgerArtifacts.d.ts +0 -49
  148. package/dist/data-access/ledgerArtifacts.d.ts.map +0 -1
  149. package/dist/data-access/ledgerArtifacts.js +0 -112
  150. package/dist/data-access/ledgerArtifacts.js.map +0 -1
  151. package/dist/data-access/messages.d.ts +0 -209
  152. package/dist/data-access/messages.d.ts.map +0 -1
  153. package/dist/data-access/messages.js +0 -100
  154. package/dist/data-access/messages.js.map +0 -1
  155. package/dist/data-access/projects.d.ts +0 -67
  156. package/dist/data-access/projects.d.ts.map +0 -1
  157. package/dist/data-access/projects.js +0 -337
  158. package/dist/data-access/projects.js.map +0 -1
  159. package/dist/data-access/tasks.d.ts +0 -37
  160. package/dist/data-access/tasks.d.ts.map +0 -1
  161. package/dist/data-access/tasks.js +0 -40
  162. package/dist/data-access/tasks.js.map +0 -1
  163. package/dist/data-access/tools.d.ts +0 -277
  164. package/dist/data-access/tools.d.ts.map +0 -1
  165. package/dist/data-access/tools.js +0 -183
  166. package/dist/data-access/tools.js.map +0 -1
  167. package/dist/data-access/validation.d.ts +0 -17
  168. package/dist/data-access/validation.d.ts.map +0 -1
  169. package/dist/data-access/validation.js +0 -52
  170. package/dist/data-access/validation.js.map +0 -1
  171. package/dist/db/clean.d.ts +0 -6
  172. package/dist/db/clean.d.ts.map +0 -1
  173. package/dist/db/clean.js +0 -81
  174. package/dist/db/clean.js.map +0 -1
  175. package/dist/db/client.d.ts +0 -19
  176. package/dist/db/client.d.ts.map +0 -1
  177. package/dist/db/client.js +0 -24
  178. package/dist/db/client.js.map +0 -1
  179. package/dist/db/schema.d.ts +0 -4337
  180. package/dist/db/schema.d.ts.map +0 -1
  181. package/dist/db/schema.js.map +0 -1
  182. package/dist/db/test-client.d.ts +0 -25
  183. package/dist/db/test-client.d.ts.map +0 -1
  184. package/dist/db/test-client.js +0 -136
  185. package/dist/db/test-client.js.map +0 -1
  186. package/dist/env.d.ts +0 -19
  187. package/dist/env.d.ts.map +0 -1
  188. package/dist/env.js +0 -49
  189. package/dist/env.js.map +0 -1
  190. package/dist/index.d.ts +0 -12
  191. package/dist/index.d.ts.map +0 -1
  192. package/dist/index.js.map +0 -1
  193. package/dist/middleware/contextValidation.d.ts +0 -49
  194. package/dist/middleware/contextValidation.d.ts.map +0 -1
  195. package/dist/middleware/contextValidation.js +0 -473
  196. package/dist/middleware/contextValidation.js.map +0 -1
  197. package/dist/middleware/index.d.ts +0 -2
  198. package/dist/middleware/index.d.ts.map +0 -1
  199. package/dist/middleware/index.js +0 -2
  200. package/dist/middleware/index.js.map +0 -1
  201. package/dist/server/BaseServer.d.ts +0 -83
  202. package/dist/server/BaseServer.d.ts.map +0 -1
  203. package/dist/server/BaseServer.js +0 -218
  204. package/dist/server/BaseServer.js.map +0 -1
  205. package/dist/types/a2a.d.ts +0 -373
  206. package/dist/types/a2a.d.ts.map +0 -1
  207. package/dist/types/a2a.js +0 -14
  208. package/dist/types/a2a.js.map +0 -1
  209. package/dist/types/entities.d.ts +0 -147
  210. package/dist/types/entities.d.ts.map +0 -1
  211. package/dist/types/entities.js +0 -2
  212. package/dist/types/entities.js.map +0 -1
  213. package/dist/types/index.d.ts +0 -5
  214. package/dist/types/index.d.ts.map +0 -1
  215. package/dist/types/index.js.map +0 -1
  216. package/dist/types/server.d.ts +0 -116
  217. package/dist/types/server.d.ts.map +0 -1
  218. package/dist/types/server.js +0 -2
  219. package/dist/types/server.js.map +0 -1
  220. package/dist/types/utility.d.ts +0 -213
  221. package/dist/types/utility.d.ts.map +0 -1
  222. package/dist/types/utility.js +0 -9
  223. package/dist/types/utility.js.map +0 -1
  224. package/dist/utils/apiKeys.d.ts +0 -32
  225. package/dist/utils/apiKeys.d.ts.map +0 -1
  226. package/dist/utils/apiKeys.js +0 -117
  227. package/dist/utils/apiKeys.js.map +0 -1
  228. package/dist/utils/auth-detection.d.ts +0 -23
  229. package/dist/utils/auth-detection.d.ts.map +0 -1
  230. package/dist/utils/auth-detection.js +0 -148
  231. package/dist/utils/auth-detection.js.map +0 -1
  232. package/dist/utils/credential-store-utils.d.ts +0 -11
  233. package/dist/utils/credential-store-utils.d.ts.map +0 -1
  234. package/dist/utils/credential-store-utils.js +0 -19
  235. package/dist/utils/credential-store-utils.js.map +0 -1
  236. package/dist/utils/error.d.ts +0 -526
  237. package/dist/utils/error.d.ts.map +0 -1
  238. package/dist/utils/error.js +0 -282
  239. package/dist/utils/error.js.map +0 -1
  240. package/dist/utils/execution.d.ts +0 -18
  241. package/dist/utils/execution.d.ts.map +0 -1
  242. package/dist/utils/execution.js +0 -25
  243. package/dist/utils/execution.js.map +0 -1
  244. package/dist/utils/index.d.ts +0 -9
  245. package/dist/utils/index.d.ts.map +0 -1
  246. package/dist/utils/index.js +0 -9
  247. package/dist/utils/index.js.map +0 -1
  248. package/dist/utils/logger.d.ts +0 -79
  249. package/dist/utils/logger.d.ts.map +0 -1
  250. package/dist/utils/logger.js +0 -102
  251. package/dist/utils/logger.js.map +0 -1
  252. package/dist/utils/logging.d.ts +0 -11
  253. package/dist/utils/logging.d.ts.map +0 -1
  254. package/dist/utils/logging.js +0 -6
  255. package/dist/utils/logging.js.map +0 -1
  256. package/dist/utils/mcp-client.d.ts +0 -48
  257. package/dist/utils/mcp-client.d.ts.map +0 -1
  258. package/dist/utils/mcp-client.js +0 -174
  259. package/dist/utils/mcp-client.js.map +0 -1
  260. package/dist/utils/tracer.d.ts +0 -24
  261. package/dist/utils/tracer.d.ts.map +0 -1
  262. package/dist/utils/tracer.js +0 -110
  263. package/dist/utils/tracer.js.map +0 -1
  264. package/dist/validation/graphFull.d.ts +0 -36
  265. package/dist/validation/graphFull.d.ts.map +0 -1
  266. package/dist/validation/graphFull.js +0 -128
  267. package/dist/validation/graphFull.js.map +0 -1
  268. package/dist/validation/id-validation.d.ts +0 -38
  269. package/dist/validation/id-validation.d.ts.map +0 -1
  270. package/dist/validation/id-validation.js +0 -60
  271. package/dist/validation/id-validation.js.map +0 -1
  272. package/dist/validation/index.d.ts +0 -4
  273. package/dist/validation/index.d.ts.map +0 -1
  274. package/dist/validation/index.js.map +0 -1
  275. package/dist/validation/schemas.d.ts +0 -7238
  276. package/dist/validation/schemas.d.ts.map +0 -1
  277. package/dist/validation/schemas.js +0 -575
  278. package/dist/validation/schemas.js.map +0 -1
package/README.md CHANGED
@@ -170,14 +170,14 @@ Tests use in-memory SQLite databases for isolation and speed.
170
170
 
171
171
  This package is designed to support a multi-service architecture:
172
172
 
173
- ### Management API
173
+ ### Agents Manage API
174
174
  Handles CRUD operations and entity management:
175
175
  - Creating/updating agents
176
176
  - Managing agent relationships
177
177
  - Configuring tools
178
178
  - Database migrations
179
179
 
180
- ### Execution API
180
+ ### Agents Run API
181
181
  Handles runtime operations:
182
182
  - Processing conversations
183
183
  - Executing tasks
@@ -0,0 +1,40 @@
1
+ <!--
2
+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
3
+ Source: ./SUPPLEMENTAL_TERMS.md
4
+ This file is automatically copied from the root SUPPLEMENTAL_TERMS.md during build.
5
+ Any changes should be made to the root SUPPLEMENTAL_TERMS.md file.
6
+ -->
7
+
8
+ # Inkeep SDK – Elastic License 2.0 with Supplemental Terms
9
+
10
+ The Inkeep [SDK] (the "Software") is licensed under the Elastic License 2.0 ("ELv2"), available at [https://www.elastic.co/licensing/elastic-license](https://www.elastic.co/licensing/elastic-license), subject to the supplemental terms below. By using the Software, you, your company, and your licensees agree to both ELv2 and these Supplemental Terms – for purposes of these Supplemental Terms, references to "you" have the same meaning as in ELv2 and include your company and contractors acting on your behalf. In the event of conflict, these Supplemental Terms control.
11
+
12
+ Any copy or redistribution of the Software must include both the ELv2 license reference and these Supplemental Terms.
13
+
14
+ ## 1. Restrictions
15
+
16
+ ### 1.1
17
+ You may not use the Software, directly or indirectly, to offer, enable, operate, or provide any Agent Builder.
18
+
19
+ ### 1.2
20
+ You may not repackage, rebrand, or otherwise expose the Software's agent-creation or orchestration functionality for third-party use, including in specialized or verticalized offerings that present substantially similar functionality to the Software.
21
+
22
+ ### 1.3
23
+ For clarity, the foregoing restrictions do not prohibit your use of the Software as Embedded Assistants or Professional Services, provided neither allow third parties to create, configure, train, orchestrate, deploy, or manage their own agents or agent workflows.
24
+
25
+ ## 2. Definitions
26
+
27
+ ### 2.1 Inkeep
28
+ **"Inkeep"** means Inkeep, Inc., a Delaware corporation with principal offices at 169 Madison Ave, Ste 2544, New York, NY, 10016, the licensor (as defined in ELv2) of the Software.
29
+
30
+ ### 2.2 Agent Builder
31
+ **"Agent Builder"** means any hosted or on-premise product, platform, UI or API that allows third parties (e.g., customers, developers, or community users other than your personnel) to create, configure, compose, train, orchestrate, deploy, or manage their own Agents using the Software, or that otherwise exposes a substantial set of the Agent-creation and orchestration functionality of the Software.
32
+
33
+ ### 2.3 Agents
34
+ **"Agents"** means autonomous, semi-autonomous, or automated systems — including assistants, copilots, workflows, orchestrations, or other systems powered by or incorporating artificial intelligence, machine learning, large language models, or related technologies.
35
+
36
+ ### 2.4 Embedded Assistant
37
+ **"Embedded Assistant"** means embedding the Software in your own products or services to power a specific assistant/copilot/agent experience for you or your end users (e.g., a support bot in your app or an internal helpdesk agent), where end users do not receive access to any substantial set of the Software's agent-creation or orchestration features.
38
+
39
+ ### 2.5 Professional Services
40
+ **"Professional Services"** means using the Software to deliver a bespoke solution to a single client where only your personnel operate the Software, the client receives access solely to the resulting assistant within the client's environment and not to the agent-creation/orchestration features of the Software, and no multi-tenant or self-service builder is provided.
@@ -0,0 +1,126 @@
1
+ import { FullGraphDefinitionSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-R3VVJXX7.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) {
14
+ const errors = [];
15
+ const availableToolIds = new Set(Object.keys(graphData.tools || {}));
16
+ for (const [agentId, agentData] of Object.entries(graphData.agents)) {
17
+ if (isInternalAgent(agentData) && agentData.tools && Array.isArray(agentData.tools)) {
18
+ for (const toolId of agentData.tools) {
19
+ if (!availableToolIds.has(toolId)) {
20
+ errors.push(`Agent '${agentId}' references non-existent tool '${toolId}'`);
21
+ }
22
+ }
23
+ }
24
+ }
25
+ if (errors.length > 0) {
26
+ throw new Error(`Tool reference validation failed:
27
+ ${errors.join("\n")}`);
28
+ }
29
+ }
30
+ function validateDataComponentReferences(graphData) {
31
+ const errors = [];
32
+ const availableDataComponentIds = new Set(Object.keys(graphData.dataComponents || {}));
33
+ for (const [agentId, agentData] of Object.entries(graphData.agents)) {
34
+ if (isInternalAgent(agentData) && agentData.dataComponents) {
35
+ for (const dataComponentId of agentData.dataComponents) {
36
+ if (!availableDataComponentIds.has(dataComponentId)) {
37
+ errors.push(
38
+ `Agent '${agentId}' references non-existent dataComponent '${dataComponentId}'`
39
+ );
40
+ }
41
+ }
42
+ }
43
+ }
44
+ if (errors.length > 0) {
45
+ throw new Error(`DataComponent reference validation failed:
46
+ ${errors.join("\n")}`);
47
+ }
48
+ }
49
+ function validateArtifactComponentReferences(graphData) {
50
+ const errors = [];
51
+ const availableArtifactComponentIds = new Set(Object.keys(graphData.artifactComponents || {}));
52
+ for (const [agentId, agentData] of Object.entries(graphData.agents)) {
53
+ if (isInternalAgent(agentData) && agentData.artifactComponents) {
54
+ for (const artifactComponentId of agentData.artifactComponents) {
55
+ if (!availableArtifactComponentIds.has(artifactComponentId)) {
56
+ errors.push(
57
+ `Agent '${agentId}' references non-existent artifactComponent '${artifactComponentId}'`
58
+ );
59
+ }
60
+ }
61
+ }
62
+ }
63
+ if (errors.length > 0) {
64
+ throw new Error(`ArtifactComponent reference validation failed:
65
+ ${errors.join("\n")}`);
66
+ }
67
+ }
68
+ function validateAgentRelationships(graphData) {
69
+ const errors = [];
70
+ const availableAgentIds = new Set(Object.keys(graphData.agents));
71
+ for (const [agentId, agentData] of Object.entries(graphData.agents)) {
72
+ if (isInternalAgent(agentData)) {
73
+ if (agentData.canTransferTo && Array.isArray(agentData.canTransferTo)) {
74
+ for (const targetId of agentData.canTransferTo) {
75
+ if (!availableAgentIds.has(targetId)) {
76
+ errors.push(
77
+ `Agent '${agentId}' has transfer target '${targetId}' that doesn't exist in graph`
78
+ );
79
+ }
80
+ }
81
+ }
82
+ if (agentData.canDelegateTo && Array.isArray(agentData.canDelegateTo)) {
83
+ for (const targetId of agentData.canDelegateTo) {
84
+ if (!availableAgentIds.has(targetId)) {
85
+ errors.push(
86
+ `Agent '${agentId}' has delegation target '${targetId}' that doesn't exist in graph`
87
+ );
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ if (errors.length > 0) {
94
+ throw new Error(`Agent relationship validation failed:
95
+ ${errors.join("\n")}`);
96
+ }
97
+ }
98
+ function validateGraphStructure(graphData) {
99
+ if (!graphData.agents[graphData.defaultAgentId]) {
100
+ throw new Error(`Default agent '${graphData.defaultAgentId}' does not exist in agents`);
101
+ }
102
+ validateToolReferences(graphData);
103
+ validateDataComponentReferences(graphData);
104
+ validateArtifactComponentReferences(graphData);
105
+ validateAgentRelationships(graphData);
106
+ }
107
+
108
+ // src/validation/id-validation.ts
109
+ function isValidResourceId(id) {
110
+ const result = resourceIdSchema.safeParse(id);
111
+ return result.success;
112
+ }
113
+ function generateIdFromName(name) {
114
+ const id = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").replace(/-{2,}/g, "-");
115
+ if (!id) {
116
+ throw new Error("Cannot generate valid ID from provided name");
117
+ }
118
+ const truncatedId = id.substring(0, MAX_ID_LENGTH);
119
+ const result = resourceIdSchema.safeParse(truncatedId);
120
+ if (!result.success) {
121
+ throw new Error(`Generated ID "${truncatedId}" is not valid: ${result.error.message}`);
122
+ }
123
+ return truncatedId;
124
+ }
125
+
126
+ export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences };
@@ -0,0 +1,15 @@
1
+ // src/types/a2a.ts
2
+ var TaskState = /* @__PURE__ */ ((TaskState2) => {
3
+ TaskState2["Submitted"] = "submitted";
4
+ TaskState2["Working"] = "working";
5
+ TaskState2["InputRequired"] = "input-required";
6
+ TaskState2["Completed"] = "completed";
7
+ TaskState2["Canceled"] = "canceled";
8
+ TaskState2["Failed"] = "failed";
9
+ TaskState2["Rejected"] = "rejected";
10
+ TaskState2["AuthRequired"] = "auth-required";
11
+ TaskState2["Unknown"] = "unknown";
12
+ return TaskState2;
13
+ })(TaskState || {});
14
+
15
+ export { TaskState };
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
+
9
+ export { __export, __publicField };