eve 0.45.0 → 0.45.2

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 (141) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/src/chunks/{use-eve-agent-OtHRoxIS.js → use-eve-agent-BH7Z6SDu.js} +13 -1
  3. package/dist/src/chunks/{use-eve-agent-C46Kan_I.js → use-eve-agent-DI2j5XK8.js} +13 -1
  4. package/dist/src/cli/commands/integration-connect.d.ts +2 -0
  5. package/dist/src/cli/commands/integration-connect.js +1 -1
  6. package/dist/src/cli/commands/register-integration-commands.js +1 -1
  7. package/dist/src/client/agent-info-schema.d.ts +191 -2
  8. package/dist/src/client/agent-info-schema.js +1 -1
  9. package/dist/src/client/types.d.ts +1 -1
  10. package/dist/src/compiled/.vendor-stamp.json +2 -1
  11. package/dist/src/compiled/@vercel/blob/client.d.ts +487 -0
  12. package/dist/src/compiled/@vercel/blob/create-folder-BM6BTlko.d.ts +471 -0
  13. package/dist/src/compiled/@vercel/blob/index.d.ts +573 -0
  14. package/dist/src/compiled/@vercel/blob/index.js +43 -0
  15. package/dist/src/compiled/@vercel/blob/license.md +201 -0
  16. package/dist/src/compiler/extension-compatibility.d.ts +4 -4
  17. package/dist/src/compiler/extension-compatibility.js +1 -1
  18. package/dist/src/compiler/load-binding-namespace.js +1 -1
  19. package/dist/src/compiler/manifest.d.ts +10 -0
  20. package/dist/src/compiler/manifest.js +1 -1
  21. package/dist/src/compiler/model-catalog.d.ts +1 -1
  22. package/dist/src/compiler/model-catalog.js +1 -1
  23. package/dist/src/compiler/module-map.js +1 -1
  24. package/dist/src/compiler/normalize-helpers.d.ts +2 -1
  25. package/dist/src/compiler/normalize-manifest.js +1 -1
  26. package/dist/src/compiler/normalize-memory.d.ts +5 -0
  27. package/dist/src/compiler/normalize-memory.js +1 -0
  28. package/dist/src/compiler/normalize-tool.js +1 -1
  29. package/dist/src/compiler/project-sources.d.ts +3 -4
  30. package/dist/src/compiler/project-sources.js +1 -1
  31. package/dist/src/compiler/source-graph.d.ts +2 -0
  32. package/dist/src/compiler/source-graph.js +1 -1
  33. package/dist/src/compiler/validate-artifact.js +1 -1
  34. package/dist/src/context/dynamic-tool-lifecycle.d.ts +8 -1
  35. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  36. package/dist/src/context/keys.d.ts +25 -0
  37. package/dist/src/context/keys.js +1 -1
  38. package/dist/src/context/memory-event-lifecycle.d.ts +13 -0
  39. package/dist/src/context/memory-event-lifecycle.js +1 -0
  40. package/dist/src/context/memory-lifecycle.d.ts +52 -0
  41. package/dist/src/context/memory-lifecycle.js +1 -0
  42. package/dist/src/context/memory-tools.d.ts +12 -0
  43. package/dist/src/context/memory-tools.js +1 -0
  44. package/dist/src/discover/discover-agent.js +1 -1
  45. package/dist/src/discover/discover-subagent.js +1 -1
  46. package/dist/src/discover/extensions.d.ts +6 -0
  47. package/dist/src/discover/extensions.js +1 -1
  48. package/dist/src/discover/filesystem.d.ts +2 -2
  49. package/dist/src/discover/filesystem.js +1 -1
  50. package/dist/src/discover/manifest.d.ts +6 -1
  51. package/dist/src/discover/manifest.js +1 -1
  52. package/dist/src/discover/memory.d.ts +14 -0
  53. package/dist/src/discover/memory.js +1 -0
  54. package/dist/src/discover/project.js +1 -1
  55. package/dist/src/evals/cli/eval.js +1 -1
  56. package/dist/src/evals/target.js +1 -1
  57. package/dist/src/execution/history-view.d.ts +2 -2
  58. package/dist/src/execution/history-view.js +1 -1
  59. package/dist/src/execution/tools/connection-search.js +2 -2
  60. package/dist/src/execution/workflow-steps.d.ts +1 -3
  61. package/dist/src/execution/workflow-steps.js +1 -1
  62. package/dist/src/framework/sources/modules/memory-wrapper.d.ts +2 -0
  63. package/dist/src/framework/sources/modules/memory-wrapper.js +1 -0
  64. package/dist/src/framework/sources/registry.d.ts +1 -0
  65. package/dist/src/framework/sources/registry.js +1 -1
  66. package/dist/src/harness/emission.d.ts +1 -1
  67. package/dist/src/harness/emission.js +1 -1
  68. package/dist/src/harness/hitl/approval-prompt.d.ts +2 -0
  69. package/dist/src/harness/hitl/approval-prompt.js +3 -2
  70. package/dist/src/harness/tool-loop.js +2 -2
  71. package/dist/src/harness/tools.js +1 -1
  72. package/dist/src/internal/application/compiled-artifacts.js +4 -2
  73. package/dist/src/internal/application/package.js +1 -1
  74. package/dist/src/internal/authored-definition/memory.d.ts +2 -0
  75. package/dist/src/internal/authored-definition/memory.js +1 -0
  76. package/dist/src/internal/authored-definition/schema-backed.d.ts +1 -0
  77. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  78. package/dist/src/internal/authored-module-map-loader.js +1 -1
  79. package/dist/src/internal/dynamic-tool-rebind.d.ts +3 -0
  80. package/dist/src/internal/dynamic-tool-rebind.js +1 -0
  81. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +1 -1
  82. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
  83. package/dist/src/internal/nitro/routes/index.js +1 -0
  84. package/dist/src/internal/programmatic-source-loader.d.ts +1 -0
  85. package/dist/src/internal/programmatic-source-loader.js +1 -1
  86. package/dist/src/internal/workflow/development-world-server.js +1 -1
  87. package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +7 -0
  88. package/dist/src/internal/workflow/local-world-delivery-timeouts.js +1 -0
  89. package/dist/src/public/memory/file/backend.d.ts +37 -0
  90. package/dist/src/public/memory/file/backend.js +1 -0
  91. package/dist/src/public/memory/file/backends/default.d.ts +7 -0
  92. package/dist/src/public/memory/file/backends/default.js +1 -0
  93. package/dist/src/public/memory/file/backends/in-memory.d.ts +6 -0
  94. package/dist/src/public/memory/file/backends/in-memory.js +1 -0
  95. package/dist/src/public/memory/file/backends/lazy.d.ts +3 -0
  96. package/dist/src/public/memory/file/backends/lazy.js +1 -0
  97. package/dist/src/public/memory/file/backends/vercel-blob.d.ts +14 -0
  98. package/dist/src/public/memory/file/backends/vercel-blob.js +1 -0
  99. package/dist/src/public/memory/file/index.d.ts +3 -0
  100. package/dist/src/public/memory/file/index.js +1 -0
  101. package/dist/src/public/memory/file/provider.d.ts +14 -0
  102. package/dist/src/public/memory/file/provider.js +6 -0
  103. package/dist/src/public/memory/file/vercel.d.ts +1 -0
  104. package/dist/src/public/memory/file/vercel.js +1 -0
  105. package/dist/src/public/memory/index.d.ts +117 -0
  106. package/dist/src/public/memory/index.js +1 -0
  107. package/dist/src/public/memory/scope.d.ts +2 -0
  108. package/dist/src/public/memory/scope.js +1 -0
  109. package/dist/src/runtime/resolve-agent.js +1 -1
  110. package/dist/src/runtime/resolve-dynamic-tool.d.ts +1 -0
  111. package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
  112. package/dist/src/runtime/resolve-memory.d.ts +4 -0
  113. package/dist/src/runtime/resolve-memory.js +1 -0
  114. package/dist/src/runtime/types.d.ts +7 -0
  115. package/dist/src/setup/connection-connector.d.ts +2 -0
  116. package/dist/src/setup/connection-connector.js +1 -1
  117. package/dist/src/setup/integrations/linq/connect.js +1 -1
  118. package/dist/src/setup/scaffold/create/project.js +1 -1
  119. package/dist/src/setup/scaffold/create/web-template.d.ts +2 -0
  120. package/dist/src/setup/scaffold/create/web-template.js +28 -0
  121. package/dist/src/shared/memory-definition.d.ts +2 -0
  122. package/dist/src/shared/memory-definition.js +1 -0
  123. package/dist/src/shared/memory-state.d.ts +55 -0
  124. package/dist/src/shared/memory-state.js +1 -0
  125. package/dist/src/svelte/index.js +1 -1
  126. package/dist/src/svelte/use-eve-agent.js +1 -1
  127. package/dist/src/vue/index.js +1 -1
  128. package/dist/src/vue/use-eve-agent.js +1 -1
  129. package/docs/channels/eve.mdx +1 -1
  130. package/docs/concepts/context-control.md +7 -0
  131. package/docs/concepts/default-harness.md +8 -0
  132. package/docs/concepts/sessions-runs-and-streaming.md +3 -3
  133. package/docs/concepts/state.md +8 -1
  134. package/docs/extensions.md +6 -2
  135. package/docs/guides/client/overview.mdx +2 -2
  136. package/docs/guides/dynamic-capabilities.md +3 -2
  137. package/docs/memory.md +320 -0
  138. package/docs/meta.json +1 -0
  139. package/docs/patterns/multi-tenant-memory.md +108 -136
  140. package/docs/reference/typescript-api.md +5 -0
  141. package/package.json +22 -1
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2023 Vercel, Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -11,8 +11,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
11
11
  readonly dropped: {};
12
12
  };
13
13
  readonly tool: {
14
- readonly current: 18;
15
- readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18];
14
+ readonly current: 19;
15
+ readonly supported: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19];
16
16
  readonly dropped: {
17
17
  readonly 15: "TaskExec replaces stageEffect with send";
18
18
  };
@@ -33,8 +33,8 @@ declare const EXTENSION_CAPABILITY_CONTRACTS: {
33
33
  readonly dropped: {};
34
34
  };
35
35
  readonly subagent: {
36
- readonly current: 3;
37
- readonly supported: readonly [3];
36
+ readonly current: 4;
37
+ readonly supported: readonly [3, 4];
38
38
  readonly dropped: {
39
39
  readonly 1: "Persistent subagent sessions are now the default and the experimental opt-in was removed";
40
40
  readonly 2: "Persistent subagent sessions are now the default and the experimental opt-in was removed";
@@ -1 +1 @@
1
- import{readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{formatValidationError}from"#runtime/validation.js";const EXTENSION_COMPATIBILITY_MANIFEST_KIND=`eve-extension`,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION=2,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME=`_manifest.json`,EXTENSION_CAPABILITY_CONTRACTS={extension:{current:1,supported:[1],dropped:{}},tool:{current:18,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18],dropped:{15:`TaskExec replaces stageEffect with send`}},dynamicTool:{current:19,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],dropped:{}},channel:{current:9,supported:[1,2,3,4,5,6,7,8,9],dropped:{}},schedule:{current:3,supported:[1,2,3],dropped:{}},subagent:{current:3,supported:[3],dropped:{1:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,2:`Persistent subagent sessions are now the default and the experimental opt-in was removed`}},connection:{current:6,supported:[1,2,3,4,5,6],dropped:{}},hook:{current:14,supported:[10,11,12,13,14],dropped:{1:`Model identity moved from session.started runtime metadata to step.started call attribution.`,2:`Model identity moved from session.started runtime metadata to step.started call attribution.`,3:`Model identity moved from session.started runtime metadata to step.started call attribution.`,4:`Model identity moved from session.started runtime metadata to step.started call attribution.`,5:`Model identity moved from session.started runtime metadata to step.started call attribution.`,6:`Model identity moved from session.started runtime metadata to step.started call attribution.`,7:`Model identity moved from session.started runtime metadata to step.started call attribution.`,8:`Model identity moved from session.started runtime metadata to step.started call attribution.`,9:`Model identity moved from session.started runtime metadata to step.started call attribution.`}},skill:{current:1,supported:[1],dropped:{}},dynamicSkill:{current:12,supported:[1,2,3,4,5,6,7,8,9,10,11,12],dropped:{}},instructions:{current:2,supported:[1,2],dropped:{}},dynamicInstructions:{current:13,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13],dropped:{}},config:{current:1,supported:[1],dropped:{}},state:{current:3,supported:[1,2,3],dropped:{}}},EXTENSION_CAPABILITY_VERSIONS=Object.fromEntries(Object.entries(EXTENSION_CAPABILITY_CONTRACTS).map(([e,t])=>[e,t.current])),EXTENSION_CAPABILITY_SUPPORT=Object.keys(EXTENSION_CAPABILITY_CONTRACTS).reduce((e,t)=>(e[t]=EXTENSION_CAPABILITY_CONTRACTS[t].supported,e),{}),extensionCompatibilityManifestV1Schema=z.object({kind:z.literal(EXTENSION_COMPATIBILITY_MANIFEST_KIND),formatVersion:z.literal(1),builtWithEve:z.string().min(1),requires:z.record(z.string(),z.number().int().positive())}).strict(),extensionCompatibilityManifestV2Schema=extensionCompatibilityManifestV1Schema.extend({formatVersion:z.literal(2),build:z.object({externalDependencies:z.array(z.string().min(1)).readonly()}).strict().optional()}),extensionCompatibilityManifestSchema=z.union([extensionCompatibilityManifestV1Schema,extensionCompatibilityManifestV2Schema]);function serializeExtensionCompatibilityManifest(e){return`${JSON.stringify(e,null,2)}\n`}function parseExtensionCompatibilityManifest(e,t){let n;try{n=JSON.parse(e)}catch(e){throw Error(`Extension compatibility manifest "${t}" is not valid JSON: ${e instanceof Error?e.message:String(e)}`)}let r=extensionCompatibilityManifestSchema.safeParse(n);if(!r.success)throw Error(`Extension compatibility manifest "${t}" is invalid. ${formatValidationError(r.error)}`);return r.data}async function readExtensionCompatibilityManifest(t){return parseExtensionCompatibilityManifest(await readFile(t,`utf8`),t)}async function writeExtensionCompatibilityManifest(e,n){await writeFile(join(e,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME),serializeExtensionCompatibilityManifest(n),`utf8`)}function findUnsupportedExtensionCapabilities(e,t=EXTENSION_CAPABILITY_SUPPORT){return Object.entries(e.requires).flatMap(([e,n])=>{let r=Object.hasOwn(t,e)?t[e]??[]:[];return r.includes(n)?[]:[{capability:e,requiredVersion:n,supportedVersions:r}]}).sort((e,t)=>e.capability.localeCompare(t.capability))}export{EXTENSION_CAPABILITY_SUPPORT,EXTENSION_CAPABILITY_VERSIONS,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION,EXTENSION_COMPATIBILITY_MANIFEST_KIND,findUnsupportedExtensionCapabilities,parseExtensionCompatibilityManifest,readExtensionCompatibilityManifest,serializeExtensionCompatibilityManifest,writeExtensionCompatibilityManifest};
1
+ import{readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{formatValidationError}from"#runtime/validation.js";const EXTENSION_COMPATIBILITY_MANIFEST_KIND=`eve-extension`,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION=2,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME=`_manifest.json`,EXTENSION_CAPABILITY_CONTRACTS={extension:{current:1,supported:[1],dropped:{}},tool:{current:19,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19],dropped:{15:`TaskExec replaces stageEffect with send`}},dynamicTool:{current:19,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],dropped:{}},channel:{current:9,supported:[1,2,3,4,5,6,7,8,9],dropped:{}},schedule:{current:3,supported:[1,2,3],dropped:{}},subagent:{current:4,supported:[3,4],dropped:{1:`Persistent subagent sessions are now the default and the experimental opt-in was removed`,2:`Persistent subagent sessions are now the default and the experimental opt-in was removed`}},connection:{current:6,supported:[1,2,3,4,5,6],dropped:{}},hook:{current:14,supported:[10,11,12,13,14],dropped:{1:`Model identity moved from session.started runtime metadata to step.started call attribution.`,2:`Model identity moved from session.started runtime metadata to step.started call attribution.`,3:`Model identity moved from session.started runtime metadata to step.started call attribution.`,4:`Model identity moved from session.started runtime metadata to step.started call attribution.`,5:`Model identity moved from session.started runtime metadata to step.started call attribution.`,6:`Model identity moved from session.started runtime metadata to step.started call attribution.`,7:`Model identity moved from session.started runtime metadata to step.started call attribution.`,8:`Model identity moved from session.started runtime metadata to step.started call attribution.`,9:`Model identity moved from session.started runtime metadata to step.started call attribution.`}},skill:{current:1,supported:[1],dropped:{}},dynamicSkill:{current:12,supported:[1,2,3,4,5,6,7,8,9,10,11,12],dropped:{}},instructions:{current:2,supported:[1,2],dropped:{}},dynamicInstructions:{current:13,supported:[1,2,3,4,5,6,7,8,9,10,11,12,13],dropped:{}},config:{current:1,supported:[1],dropped:{}},state:{current:3,supported:[1,2,3],dropped:{}}},EXTENSION_CAPABILITY_VERSIONS=Object.fromEntries(Object.entries(EXTENSION_CAPABILITY_CONTRACTS).map(([e,t])=>[e,t.current])),EXTENSION_CAPABILITY_SUPPORT=Object.keys(EXTENSION_CAPABILITY_CONTRACTS).reduce((e,t)=>(e[t]=EXTENSION_CAPABILITY_CONTRACTS[t].supported,e),{}),extensionCompatibilityManifestV1Schema=z.object({kind:z.literal(EXTENSION_COMPATIBILITY_MANIFEST_KIND),formatVersion:z.literal(1),builtWithEve:z.string().min(1),requires:z.record(z.string(),z.number().int().positive())}).strict(),extensionCompatibilityManifestV2Schema=extensionCompatibilityManifestV1Schema.extend({formatVersion:z.literal(2),build:z.object({externalDependencies:z.array(z.string().min(1)).readonly()}).strict().optional()}),extensionCompatibilityManifestSchema=z.union([extensionCompatibilityManifestV1Schema,extensionCompatibilityManifestV2Schema]);function serializeExtensionCompatibilityManifest(e){return`${JSON.stringify(e,null,2)}\n`}function parseExtensionCompatibilityManifest(e,t){let n;try{n=JSON.parse(e)}catch(e){throw Error(`Extension compatibility manifest "${t}" is not valid JSON: ${e instanceof Error?e.message:String(e)}`)}let r=extensionCompatibilityManifestSchema.safeParse(n);if(!r.success)throw Error(`Extension compatibility manifest "${t}" is invalid. ${formatValidationError(r.error)}`);return r.data}async function readExtensionCompatibilityManifest(t){return parseExtensionCompatibilityManifest(await readFile(t,`utf8`),t)}async function writeExtensionCompatibilityManifest(e,n){await writeFile(join(e,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME),serializeExtensionCompatibilityManifest(n),`utf8`)}function findUnsupportedExtensionCapabilities(e,t=EXTENSION_CAPABILITY_SUPPORT){return Object.entries(e.requires).flatMap(([e,n])=>{let r=Object.hasOwn(t,e)?t[e]??[]:[];return r.includes(n)?[]:[{capability:e,requiredVersion:n,supportedVersions:r}]}).sort((e,t)=>e.capability.localeCompare(t.capability))}export{EXTENSION_CAPABILITY_SUPPORT,EXTENSION_CAPABILITY_VERSIONS,EXTENSION_COMPATIBILITY_MANIFEST_FILENAME,EXTENSION_COMPATIBILITY_MANIFEST_FORMAT_VERSION,EXTENSION_COMPATIBILITY_MANIFEST_KIND,findUnsupportedExtensionCapabilities,parseExtensionCompatibilityManifest,readExtensionCompatibilityManifest,serializeExtensionCompatibilityManifest,writeExtensionCompatibilityManifest};
@@ -1 +1 @@
1
- import{loadProgrammaticModuleNamespace}from"#compiler/source-graph.js";import{packageStateNamespace}from"#discover/extensions.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";function createCompiledBindingNamespaceLoader(e){let t=new Map,load=(n,r=new Set)=>{if(r.has(n))throw Error(`Compiled binding dependency cycle includes "${n}".`);let i=t.get(n);if(i!==void 0)return i;let a=e.bindings[n];if(a===void 0)throw Error(`Compiled binding dependency "${n}" is missing.`);let o=new Set(r).add(n),s=loadCompiledBindingNamespace({binding:a,loadDependency:e=>load(e,o),registries:e.registries});return t.set(n,s),s};return load}async function loadCompiledBindingNamespace(t){if(t.binding.backing.kind===`filesystem`)return await loadAuthoredModuleNamespace(t.binding.backing.sourcePath,{externalDependencies:t.binding.backing.externalDependencies,extensionScopeNamespace:resolveCompiledModuleExtensionScopeNamespace(t.binding)});let r=Object.fromEntries(await Promise.all(Object.entries(t.binding.backing.dependencies??{}).map(async([e,n])=>[e,await t.loadDependency(n)])));return await loadProgrammaticModuleNamespace({backing:t.binding.backing,dependencyNamespaces:r,registries:t.registries})}function resolveCompiledModuleExtensionScopeNamespace(e){return e.owner.kind===`extension`?packageStateNamespace(e.owner.packageName):void 0}export{createCompiledBindingNamespaceLoader,resolveCompiledModuleExtensionScopeNamespace};
1
+ import{loadProgrammaticModuleNamespace,memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";import{packageStateNamespace}from"#discover/extensions.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";function createCompiledBindingNamespaceLoader(e){let n=new Map,load=(r,i=new Set)=>{if(i.has(r))throw Error(`Compiled binding dependency cycle includes "${r}".`);let a=n.get(r);if(a!==void 0)return a;let o=e.bindings[r];if(o===void 0)throw Error(`Compiled binding dependency "${r}" is missing.`);let s=new Set(i).add(r),c=loadCompiledBindingNamespace({binding:o,loadDependency:e=>load(e,s),registries:e.registries}).then(memoizeModuleNamespaceFactories);return n.set(r,c),c};return load}async function loadCompiledBindingNamespace(t){if(t.binding.backing.kind===`filesystem`)return await loadAuthoredModuleNamespace(t.binding.backing.sourcePath,{externalDependencies:t.binding.backing.externalDependencies,extensionScopeNamespace:resolveCompiledModuleExtensionScopeNamespace(t.binding)});let n=Object.fromEntries(await Promise.all(Object.entries(t.binding.backing.dependencies??{}).map(async([e,n])=>[e,await t.loadDependency(n)])));return await loadProgrammaticModuleNamespace({backing:t.binding.backing,dependencyNamespaces:n,registries:t.registries})}function resolveCompiledModuleExtensionScopeNamespace(e){return e.owner.kind===`extension`?packageStateNamespace(e.owner.packageName):void 0}export{createCompiledBindingNamespaceLoader,resolveCompiledModuleExtensionScopeNamespace};
@@ -176,6 +176,7 @@ export interface CompiledWorkflowToolDefinition extends ModuleSourceRef {
176
176
  export interface CompiledDynamicToolDefinition extends ModuleSourceRef {
177
177
  readonly slug: string;
178
178
  readonly eventNames: readonly string[];
179
+ readonly rebindMissingCallbacks?: boolean;
179
180
  /**
180
181
  * Mount namespace when this resolver comes from an extension. The runtime
181
182
  * prefixes the names of tools the resolver produces (`forecast` →
@@ -184,6 +185,11 @@ export interface CompiledDynamicToolDefinition extends ModuleSourceRef {
184
185
  */
185
186
  readonly extensionNamespace?: string;
186
187
  }
188
+ export interface CompiledMemoryDefinition extends ModuleSourceRef {
189
+ readonly description?: string;
190
+ readonly slot: string;
191
+ readonly visibility: "scope" | "session";
192
+ }
187
193
  /**
188
194
  * Compiled dynamic skill resolver entry. Mirrors
189
195
  * {@link CompiledDynamicToolDefinition} — the resolver produces skill
@@ -344,6 +350,7 @@ declare const compiledAgentResourcesSchema: z.ZodObject<{
344
350
  dynamicTools: z.ZodDefault<z.ZodArray<z.ZodType<CompiledDynamicToolDefinition, unknown, z.core.$ZodTypeInternals<CompiledDynamicToolDefinition, unknown>>>>;
345
351
  extensionMounts: z.ZodDefault<z.ZodArray<z.ZodType<CompiledExtensionMount, unknown, z.core.$ZodTypeInternals<CompiledExtensionMount, unknown>>>>;
346
352
  hooks: z.ZodArray<z.ZodType<CompiledHookDefinition, unknown, z.core.$ZodTypeInternals<CompiledHookDefinition, unknown>>>;
353
+ memories: z.ZodDefault<z.ZodArray<z.ZodType<CompiledMemoryDefinition, unknown, z.core.$ZodTypeInternals<CompiledMemoryDefinition, unknown>>>>;
347
354
  sandbox: z.ZodObject<{
348
355
  backendName: z.ZodOptional<z.ZodString>;
349
356
  description: z.ZodOptional<z.ZodString>;
@@ -469,6 +476,7 @@ declare const compiledAgentNodeManifestSchema: z.ZodObject<{
469
476
  dynamicTools: z.ZodDefault<z.ZodArray<z.ZodType<CompiledDynamicToolDefinition, unknown, z.core.$ZodTypeInternals<CompiledDynamicToolDefinition, unknown>>>>;
470
477
  extensionMounts: z.ZodDefault<z.ZodArray<z.ZodType<CompiledExtensionMount, unknown, z.core.$ZodTypeInternals<CompiledExtensionMount, unknown>>>>;
471
478
  hooks: z.ZodArray<z.ZodType<CompiledHookDefinition, unknown, z.core.$ZodTypeInternals<CompiledHookDefinition, unknown>>>;
479
+ memories: z.ZodDefault<z.ZodArray<z.ZodType<CompiledMemoryDefinition, unknown, z.core.$ZodTypeInternals<CompiledMemoryDefinition, unknown>>>>;
472
480
  sandbox: z.ZodObject<{
473
481
  backendName: z.ZodOptional<z.ZodString>;
474
482
  description: z.ZodOptional<z.ZodString>;
@@ -625,6 +633,7 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
625
633
  dynamicSkills: z.ZodDefault<z.ZodArray<z.ZodType<CompiledDynamicSkillDefinition, unknown, z.core.$ZodTypeInternals<CompiledDynamicSkillDefinition, unknown>>>>;
626
634
  dynamicTools: z.ZodDefault<z.ZodArray<z.ZodType<CompiledDynamicToolDefinition, unknown, z.core.$ZodTypeInternals<CompiledDynamicToolDefinition, unknown>>>>;
627
635
  hooks: z.ZodArray<z.ZodType<CompiledHookDefinition, unknown, z.core.$ZodTypeInternals<CompiledHookDefinition, unknown>>>;
636
+ memories: z.ZodDefault<z.ZodArray<z.ZodType<CompiledMemoryDefinition, unknown, z.core.$ZodTypeInternals<CompiledMemoryDefinition, unknown>>>>;
628
637
  kind: z.ZodLiteral<"eve-agent-compiled-manifest">;
629
638
  remoteAgents: z.ZodArray<z.ZodType<Readonly<ModuleSourceRef & Node & {
630
639
  description: string;
@@ -732,6 +741,7 @@ export interface CreateCompiledAgentResourcesInput {
732
741
  readonly dynamicTools?: readonly CompiledDynamicToolDefinition[];
733
742
  readonly extensionMounts?: readonly CompiledExtensionMount[];
734
743
  readonly hooks?: readonly CompiledHookDefinition[];
744
+ readonly memories?: readonly CompiledMemoryDefinition[];
735
745
  readonly remoteAgents?: readonly CompiledRemoteAgentNode[];
736
746
  readonly sandbox: CompiledSandboxDefinition;
737
747
  readonly sandboxWorkspaces?: readonly CompiledSandboxWorkspace[];
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{discoverDiagnosticsSummarySchema}from"#discover/diagnostics.js";import{compiledRemoteAgentNodeSchema}from"#compiler/remote-agent-node.js";import{jsonObjectSchema}from"#shared/json-schemas.js";import{validateCompiledAgentManifest,validateCompiledAgentResources}from"#compiler/validate-artifact.js";const COMPILED_AGENT_MANIFEST_KIND=`eve-agent-compiled-manifest`,ROOT_COMPILED_AGENT_NODE_ID=`__root__`,COMPILED_AGENT_MANIFEST_VERSION=43,agentSourceOwnerSchema=z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string().min(1),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string().min(1),packageName:z.string().min(1)}).strict()]),moduleSourceRefSchema=z.object({exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),filesystemModuleBackingSchema=z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),programmaticModuleBackingSchema=z.object({dependencies:z.record(z.string(),z.string()).readonly().optional(),kind:z.literal(`programmatic`),moduleId:z.string(),parameters:jsonObjectSchema.optional(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict(),resourceSourceBackingSchema=z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),agentModuleBackingSchema=z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema]),compiledModuleBindingSchema=z.object({backing:agentModuleBackingSchema,logicalPath:z.string(),owner:agentSourceOwnerSchema}).strict(),agentSourceDescriptorSchema=z.object({backing:z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema,resourceSourceBackingSchema]),form:z.enum([`derived`,`direct`]),layer:z.enum([`framework-default`,`extension-package`,`extension-override`,`application`]),logicalPath:z.string(),owner:agentSourceOwnerSchema,sourceId:z.string()}).strict(),agentSourceCompositionSchema=z.object({entries:z.array(z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`shadowed`),source:agentSourceDescriptorSchema,winnerSourceId:z.string()}).strict(),z.object({kind:z.literal(`disabled`),source:agentSourceDescriptorSchema}).strict()])).readonly()}).strict(),compiledDynamicModelDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),channelMethodSchema=z.union([z.literal(`GET`),z.literal(`HEAD`),z.literal(`POST`),z.literal(`PUT`),z.literal(`PATCH`),z.literal(`DELETE`),z.literal(`OPTIONS`),z.literal(`WEBSOCKET`)]),compiledChannelCorsSchema=z.object({origin:z.union([z.literal(`*`),z.literal(`null`),z.array(z.string())]).optional(),methods:z.union([z.literal(`*`),z.array(z.string())]).optional(),allowHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),exposeHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),credentials:z.boolean().optional(),maxAge:z.union([z.string(),z.literal(!1)]).optional(),preflight:z.object({statusCode:z.number().int().min(100).max(599).optional()}).strict().optional()}).strict(),compiledChannelDefinitionSchema=z.object({kind:z.literal(`channel`),name:z.string(),logicalPath:z.string(),method:channelMethodSchema,urlPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional(),adapterKind:z.string().optional(),cors:compiledChannelCorsSchema.optional()}).strict(),compiledChannelPreflightDefinitionSchema=z.object({cors:compiledChannelCorsSchema,method:z.literal(`OPTIONS`),sourceIds:z.array(z.string()).readonly(),urlPath:z.string()}).strict(),compiledShadowedChannelRouteSchema=z.object({method:channelMethodSchema,source:agentSourceDescriptorSchema,urlPath:z.string(),winnerSourceId:z.string()}).strict(),compiledChannelRoutePlanSchema=z.object({effective:z.array(compiledChannelDefinitionSchema).readonly(),preflight:z.array(compiledChannelPreflightDefinitionSchema).readonly(),shadowed:z.array(compiledShadowedChannelRouteSchema).readonly()}).strict(),modelRoutingSchema=z.union([z.object({kind:z.literal(`gateway`),target:z.string(),byok:z.string().optional()}).strict(),z.object({kind:z.literal(`external`),provider:z.string()}).strict()]),compiledRuntimeModelReferenceSchema=z.object({contextWindowTokens:z.number().int().positive().optional(),id:z.string(),maxOutputTokens:z.number().int().positive().optional(),source:moduleSourceRefSchema.optional(),providerOptions:z.record(z.string(),jsonObjectSchema).optional(),routing:modelRoutingSchema}).strict(),compiledAgentBuildDefinitionSchema=z.object({externalDependencies:z.array(z.string()).optional()}).strict(),compiledAgentWorkflowWorldDefinitionSchema=z.string(),compiledAgentWorkflowDefinitionSchema=z.object({world:compiledAgentWorkflowWorldDefinitionSchema.optional()}).strict(),compiledAgentCompactionDefinitionSchema=z.object({model:compiledRuntimeModelReferenceSchema.optional(),thresholdPercent:z.number().finite().min(0).max(1).optional()}).strict(),sessionTokenLimitSchema=z.union([z.number().int().positive(),z.literal(!1)]),sessionTimeoutSchema=z.union([z.number().int().positive(),z.literal(!1)]),compiledAgentLimitsDefinitionSchema=z.object({maxInputTokensPerSession:sessionTokenLimitSchema.optional(),maxOutputTokensPerSession:sessionTokenLimitSchema.optional(),sessionTimeoutMs:sessionTimeoutSchema.optional()}).strict(),compiledWorkflowToolDefinitionSchema=z.object({exportName:z.string().optional(),logicalPath:z.string(),maxSubagents:z.number().int().positive().optional(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledAgentConfigBaseFields={build:compiledAgentBuildDefinitionSchema.optional(),compaction:compiledAgentCompactionDefinitionSchema.optional(),description:z.string().optional(),experimental:z.object({instrumentationProviders:z.boolean().optional(),tasks:z.boolean().optional(),workflow:compiledAgentWorkflowDefinitionSchema.optional()}).strict().optional(),name:z.string(),outputSchema:jsonObjectSchema.optional(),reasoning:z.enum([`provider-default`,`none`,`minimal`,`low`,`medium`,`high`,`xhigh`]).optional(),source:moduleSourceRefSchema,limits:compiledAgentLimitsDefinitionSchema.optional()},compiledAgentConfigSchema=z.union([z.object({...compiledAgentConfigBaseFields,model:compiledRuntimeModelReferenceSchema}).strict(),z.object({...compiledAgentConfigBaseFields,dynamicModel:compiledDynamicModelDefinitionSchema}).strict()]),compiledInstructionsBaseFields={content:z.string(),name:z.string(),logicalPath:z.string(),role:z.enum([`system`,`user`]),sourceId:z.string()},compiledInstructionsSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledInstructionsBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledInstructionsBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSkillBaseFields={name:z.string(),description:z.string(),license:z.string().optional(),markdown:z.string(),metadata:z.record(z.string(),z.string()).optional(),sourceId:z.string(),logicalPath:z.string()},compiledSkillSourceSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledSkillBaseFields,sourceKind:z.literal(`module`),exportName:z.string().optional()}).strict(),z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`skill-package`),skillId:z.string(),skillFilePath:z.string(),rootPath:z.string(),assetsPath:z.string().optional(),referencesPath:z.string().optional(),scriptsPath:z.string().optional()}).strict()]),compiledScheduleBaseFields={cron:z.string(),hasRun:z.boolean(),name:z.string(),logicalPath:z.string(),markdown:z.string().optional(),sourceId:z.string()},compiledScheduleDefinitionSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledScheduleBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledScheduleBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSandboxDefinitionSchema=z.object({backendName:z.string().optional(),description:z.string().optional(),inheritsParent:z.boolean().optional(),exportName:z.string().optional(),logicalPath:z.string(),revalidationKey:z.string().optional(),sourceHash:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSandboxWorkspaceSchema=z.object({logicalPath:z.string(),rootEntries:z.array(z.string()).readonly(),sourceId:z.string(),sourcePath:z.string()}).strict(),compiledWorkspaceResourceRootSchema=z.object({contentHash:z.string().optional(),logicalPath:z.string(),rootEntries:z.array(z.string()).readonly()}).strict(),compiledConnectionDefinitionSchema=z.object({connectionName:z.string(),description:z.string(),exportName:z.string().optional(),logicalPath:z.string(),protocol:z.enum([`mcp`,`openapi`]).default(`mcp`),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string(),vercelConnect:z.object({connector:z.string()}).strict().optional()}).strict(),compiledToolDefinitionSchema=z.object({description:z.string(),execution:z.literal(`background`).optional(),exportName:z.string().optional(),hasExecute:z.boolean(),hasModelOutputProjection:z.boolean(),inputSchema:jsonObjectSchema.nullable(),logicalPath:z.string(),name:z.string(),outputSchema:jsonObjectSchema.optional(),requiresApproval:z.boolean(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicToolDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicSkillDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicInstructionsDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledHookDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledExtensionMountSchema=z.object({externalDependencies:z.array(z.string()).readonly(),namespace:z.string(),packageName:z.string(),packageNamespace:z.string(),sourceRoot:z.string(),mountSourceId:z.string(),mountLogicalPath:z.string()}).strict(),compiledAgentResourceFields={agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),channelRoutes:compiledChannelRoutePlanSchema,connections:z.array(compiledConnectionDefinitionSchema),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,workflowTool:compiledWorkflowToolDefinitionSchema.optional(),webSearchProvider:z.enum([`exa`,`parallel`]).optional(),dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),extensionMounts:z.array(compiledExtensionMountSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),remoteAgents:z.array(compiledRemoteAgentNodeSchema),skills:z.array(compiledSkillSourceSchema).readonly(),instructions:z.array(compiledInstructionsSchema).readonly().default([]),instrumentation:moduleSourceRefSchema.optional(),tools:z.array(compiledToolDefinitionSchema),workspaceResourceRoot:compiledWorkspaceResourceRootSchema},compiledAgentResourcesSchema=z.object(compiledAgentResourceFields).strict(),compiledAgentNodeManifestSchema=z.object({...compiledAgentResourceFields,config:compiledAgentConfigSchema}).strict(),compiledSubagentNodeBaseFields={backing:resourceSourceBackingSchema,entryPath:z.string(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:agentSourceOwnerSchema,parentNodeId:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional()},compiledDynamicSubagentDefinitionSchema=z.object({build:compiledAgentBuildDefinitionSchema.optional(),eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSubagentNodeSchema=z.union([z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentNodeManifestSchema,description:z.string()}).strict(),z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentResourcesSchema,configResolver:compiledDynamicSubagentDefinitionSchema}).strict()]),compiledAgentManifestSchema=z.object({agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),extensionMounts:z.array(compiledExtensionMountSchema).default([]),channelRoutes:compiledChannelRoutePlanSchema,config:compiledAgentConfigSchema,connections:z.array(compiledConnectionDefinitionSchema),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,workflowTool:compiledWorkflowToolDefinitionSchema.optional(),webSearchProvider:z.enum([`exa`,`parallel`]).optional(),dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),kind:z.literal(COMPILED_AGENT_MANIFEST_KIND),remoteAgents:z.array(compiledRemoteAgentNodeSchema),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),skills:z.array(compiledSkillSourceSchema).readonly(),subagents:z.array(compiledSubagentNodeSchema),instructions:z.array(compiledInstructionsSchema).readonly().default([]),instrumentation:moduleSourceRefSchema.optional(),tools:z.array(compiledToolDefinitionSchema),version:z.literal(43),workspaceResourceRoot:compiledWorkspaceResourceRootSchema}).strict();function createCompiledAgentResources(e){return{agentRoot:e.agentRoot,appRoot:e.appRoot,bindings:{...e.bindings},channelRoutes:{effective:[...e.channelRoutes.effective],preflight:[...e.channelRoutes.preflight],shadowed:[...e.channelRoutes.shadowed]},connections:[...e.connections??[]],diagnosticsSummary:e.diagnosticsSummary??{errors:0,warnings:0},sourceComposition:{entries:[...e.sourceComposition.entries]},workflowTool:e.workflowTool===void 0?void 0:{...e.workflowTool},webSearchProvider:e.webSearchProvider,dynamicInstructions:[...e.dynamicInstructions??[]],dynamicSkills:[...e.dynamicSkills??[]],dynamicTools:[...e.dynamicTools??[]],extensionMounts:[...e.extensionMounts??[]],hooks:[...e.hooks??[]],instructions:[...e.instructions??[]],instrumentation:e.instrumentation===void 0?void 0:{...e.instrumentation},remoteAgents:[...e.remoteAgents??[]],sandbox:e.sandbox,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],workspaceResourceRoot:e.workspaceResourceRoot??{logicalPath:``,rootEntries:deriveResourceRootEntries({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}}function createCompiledAgentNodeManifest(e){let t={...createCompiledAgentResources(e),config:cloneCompiledAgentDefinition(e.config)};return validateCompiledAgentResources(t,{allowUnknownResourceWinners:!0}),t}function cloneCompiledAgentDefinition(e){let t={build:e.build===void 0?void 0:{externalDependencies:e.build.externalDependencies===void 0?void 0:[...e.build.externalDependencies]},compaction:{model:e.compaction?.model===void 0?void 0:cloneCompiledRuntimeModelReference(e.compaction.model),thresholdPercent:e.compaction?.thresholdPercent},description:e.description,experimental:e.experimental===void 0?void 0:{instrumentationProviders:e.experimental.instrumentationProviders,tasks:e.experimental.tasks,workflow:e.experimental.workflow===void 0?void 0:{world:e.experimental.workflow.world}},name:e.name,outputSchema:e.outputSchema,reasoning:e.reasoning,limits:e.limits===void 0?void 0:{maxInputTokensPerSession:e.limits.maxInputTokensPerSession,maxOutputTokensPerSession:e.limits.maxOutputTokensPerSession,sessionTimeoutMs:e.limits.sessionTimeoutMs},source:{...e.source}};return e.dynamicModel===void 0?{...t,model:cloneCompiledRuntimeModelReference(e.model)}:{...t,dynamicModel:{...e.dynamicModel}}}function deriveResourceRootEntries(e){let t=new Set;for(let n of e.sandboxWorkspaces??[])for(let e of n.rootEntries)t.add(e);return[...t].sort((e,t)=>e.localeCompare(t))}function createCompiledSubagentNodeId(e,t){return e===`__root__`?t:`${e}::${t}`}function createCompiledAgentManifest(e){let t={...createCompiledAgentNodeManifest(e),kind:COMPILED_AGENT_MANIFEST_KIND,extensionMounts:[...e.extensionMounts??[]],subagents:[...e.subagents??[]],version:43};return validateCompiledAgentManifest(t),t}function cloneCompiledRuntimeModelReference(e){let t={id:e.id,routing:cloneModelRouting(e.routing)};return e.contextWindowTokens!==void 0&&(t.contextWindowTokens=e.contextWindowTokens),e.maxOutputTokens!==void 0&&(t.maxOutputTokens=e.maxOutputTokens),e.providerOptions!==void 0&&(t.providerOptions={...e.providerOptions}),e.source!==void 0&&(t.source={...e.source}),t}function cloneModelRouting(e){return e.kind===`external`?{kind:`external`,provider:e.provider}:e.byok===void 0?{kind:`gateway`,target:e.target}:{kind:`gateway`,target:e.target,byok:e.byok}}export{COMPILED_AGENT_MANIFEST_KIND,COMPILED_AGENT_MANIFEST_VERSION,ROOT_COMPILED_AGENT_NODE_ID,compiledAgentManifestSchema,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId,deriveResourceRootEntries};
1
+ import{z}from"#compiled/zod/index.js";import{discoverDiagnosticsSummarySchema}from"#discover/diagnostics.js";import{compiledRemoteAgentNodeSchema}from"#compiler/remote-agent-node.js";import{jsonObjectSchema}from"#shared/json-schemas.js";import{validateCompiledAgentManifest,validateCompiledAgentResources}from"#compiler/validate-artifact.js";const COMPILED_AGENT_MANIFEST_KIND=`eve-agent-compiled-manifest`,ROOT_COMPILED_AGENT_NODE_ID=`__root__`,COMPILED_AGENT_MANIFEST_VERSION=43,agentSourceOwnerSchema=z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`application`)}).strict(),z.object({feature:z.string().min(1),kind:z.literal(`framework`)}).strict(),z.object({kind:z.literal(`extension`),namespace:z.string().min(1),packageName:z.string().min(1)}).strict()]),moduleSourceRefSchema=z.object({exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),filesystemModuleBackingSchema=z.object({externalDependencies:z.array(z.string()).readonly(),extensionScope:z.object({namespace:z.string(),sourceRoot:z.string()}).strict().optional(),kind:z.literal(`filesystem`),sourcePath:z.string()}).strict(),programmaticModuleBackingSchema=z.object({dependencies:z.record(z.string(),z.string()).readonly().optional(),kind:z.literal(`programmatic`),moduleId:z.string(),parameters:jsonObjectSchema.optional(),registryId:z.string(),revision:z.string(),semanticRevision:z.string().optional()}).strict(),resourceSourceBackingSchema=z.object({kind:z.literal(`resource`),sourcePath:z.string()}).strict(),agentModuleBackingSchema=z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema]),compiledModuleBindingSchema=z.object({backing:agentModuleBackingSchema,logicalPath:z.string(),owner:agentSourceOwnerSchema}).strict(),agentSourceDescriptorSchema=z.object({backing:z.discriminatedUnion(`kind`,[filesystemModuleBackingSchema,programmaticModuleBackingSchema,resourceSourceBackingSchema]),form:z.enum([`derived`,`direct`]),layer:z.enum([`framework-default`,`extension-package`,`extension-override`,`application`]),logicalPath:z.string(),owner:agentSourceOwnerSchema,sourceId:z.string()}).strict(),agentSourceCompositionSchema=z.object({entries:z.array(z.discriminatedUnion(`kind`,[z.object({kind:z.literal(`shadowed`),source:agentSourceDescriptorSchema,winnerSourceId:z.string()}).strict(),z.object({kind:z.literal(`disabled`),source:agentSourceDescriptorSchema}).strict()])).readonly()}).strict(),compiledDynamicModelDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),sourceKind:z.literal(`module`),logicalPath:z.string(),sourceId:z.string()}).strict(),channelMethodSchema=z.union([z.literal(`GET`),z.literal(`HEAD`),z.literal(`POST`),z.literal(`PUT`),z.literal(`PATCH`),z.literal(`DELETE`),z.literal(`OPTIONS`),z.literal(`WEBSOCKET`)]),compiledChannelCorsSchema=z.object({origin:z.union([z.literal(`*`),z.literal(`null`),z.array(z.string())]).optional(),methods:z.union([z.literal(`*`),z.array(z.string())]).optional(),allowHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),exposeHeaders:z.union([z.literal(`*`),z.array(z.string())]).optional(),credentials:z.boolean().optional(),maxAge:z.union([z.string(),z.literal(!1)]).optional(),preflight:z.object({statusCode:z.number().int().min(100).max(599).optional()}).strict().optional()}).strict(),compiledChannelDefinitionSchema=z.object({kind:z.literal(`channel`),name:z.string(),logicalPath:z.string(),method:channelMethodSchema,urlPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional(),adapterKind:z.string().optional(),cors:compiledChannelCorsSchema.optional()}).strict(),compiledChannelPreflightDefinitionSchema=z.object({cors:compiledChannelCorsSchema,method:z.literal(`OPTIONS`),sourceIds:z.array(z.string()).readonly(),urlPath:z.string()}).strict(),compiledShadowedChannelRouteSchema=z.object({method:channelMethodSchema,source:agentSourceDescriptorSchema,urlPath:z.string(),winnerSourceId:z.string()}).strict(),compiledChannelRoutePlanSchema=z.object({effective:z.array(compiledChannelDefinitionSchema).readonly(),preflight:z.array(compiledChannelPreflightDefinitionSchema).readonly(),shadowed:z.array(compiledShadowedChannelRouteSchema).readonly()}).strict(),modelRoutingSchema=z.union([z.object({kind:z.literal(`gateway`),target:z.string(),byok:z.string().optional()}).strict(),z.object({kind:z.literal(`external`),provider:z.string()}).strict()]),compiledRuntimeModelReferenceSchema=z.object({contextWindowTokens:z.number().int().positive().optional(),id:z.string(),maxOutputTokens:z.number().int().positive().optional(),source:moduleSourceRefSchema.optional(),providerOptions:z.record(z.string(),jsonObjectSchema).optional(),routing:modelRoutingSchema}).strict(),compiledAgentBuildDefinitionSchema=z.object({externalDependencies:z.array(z.string()).optional()}).strict(),compiledAgentWorkflowWorldDefinitionSchema=z.string(),compiledAgentWorkflowDefinitionSchema=z.object({world:compiledAgentWorkflowWorldDefinitionSchema.optional()}).strict(),compiledAgentCompactionDefinitionSchema=z.object({model:compiledRuntimeModelReferenceSchema.optional(),thresholdPercent:z.number().finite().min(0).max(1).optional()}).strict(),sessionTokenLimitSchema=z.union([z.number().int().positive(),z.literal(!1)]),sessionTimeoutSchema=z.union([z.number().int().positive(),z.literal(!1)]),compiledAgentLimitsDefinitionSchema=z.object({maxInputTokensPerSession:sessionTokenLimitSchema.optional(),maxOutputTokensPerSession:sessionTokenLimitSchema.optional(),sessionTimeoutMs:sessionTimeoutSchema.optional()}).strict(),compiledWorkflowToolDefinitionSchema=z.object({exportName:z.string().optional(),logicalPath:z.string(),maxSubagents:z.number().int().positive().optional(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledAgentConfigBaseFields={build:compiledAgentBuildDefinitionSchema.optional(),compaction:compiledAgentCompactionDefinitionSchema.optional(),description:z.string().optional(),experimental:z.object({instrumentationProviders:z.boolean().optional(),tasks:z.boolean().optional(),workflow:compiledAgentWorkflowDefinitionSchema.optional()}).strict().optional(),name:z.string(),outputSchema:jsonObjectSchema.optional(),reasoning:z.enum([`provider-default`,`none`,`minimal`,`low`,`medium`,`high`,`xhigh`]).optional(),source:moduleSourceRefSchema,limits:compiledAgentLimitsDefinitionSchema.optional()},compiledAgentConfigSchema=z.union([z.object({...compiledAgentConfigBaseFields,model:compiledRuntimeModelReferenceSchema}).strict(),z.object({...compiledAgentConfigBaseFields,dynamicModel:compiledDynamicModelDefinitionSchema}).strict()]),compiledInstructionsBaseFields={content:z.string(),name:z.string(),logicalPath:z.string(),role:z.enum([`system`,`user`]),sourceId:z.string()},compiledInstructionsSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledInstructionsBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledInstructionsBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSkillBaseFields={name:z.string(),description:z.string(),license:z.string().optional(),markdown:z.string(),metadata:z.record(z.string(),z.string()).optional(),sourceId:z.string(),logicalPath:z.string()},compiledSkillSourceSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledSkillBaseFields,sourceKind:z.literal(`module`),exportName:z.string().optional()}).strict(),z.object({...compiledSkillBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`skill-package`),skillId:z.string(),skillFilePath:z.string(),rootPath:z.string(),assetsPath:z.string().optional(),referencesPath:z.string().optional(),scriptsPath:z.string().optional()}).strict()]),compiledScheduleBaseFields={cron:z.string(),hasRun:z.boolean(),name:z.string(),logicalPath:z.string(),markdown:z.string().optional(),sourceId:z.string()},compiledScheduleDefinitionSchema=z.discriminatedUnion(`sourceKind`,[z.object({...compiledScheduleBaseFields,owner:agentSourceOwnerSchema,sourceKind:z.literal(`markdown`)}).strict(),z.object({...compiledScheduleBaseFields,sourceKind:z.literal(`module`)}).strict()]),compiledSandboxDefinitionSchema=z.object({backendName:z.string().optional(),description:z.string().optional(),inheritsParent:z.boolean().optional(),exportName:z.string().optional(),logicalPath:z.string(),revalidationKey:z.string().optional(),sourceHash:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSandboxWorkspaceSchema=z.object({logicalPath:z.string(),rootEntries:z.array(z.string()).readonly(),sourceId:z.string(),sourcePath:z.string()}).strict(),compiledWorkspaceResourceRootSchema=z.object({contentHash:z.string().optional(),logicalPath:z.string(),rootEntries:z.array(z.string()).readonly()}).strict(),compiledConnectionDefinitionSchema=z.object({connectionName:z.string(),description:z.string(),exportName:z.string().optional(),logicalPath:z.string(),protocol:z.enum([`mcp`,`openapi`]).default(`mcp`),sourceId:z.string(),sourceKind:z.literal(`module`),url:z.string(),vercelConnect:z.object({connector:z.string()}).strict().optional()}).strict(),compiledToolDefinitionSchema=z.object({description:z.string(),execution:z.literal(`background`).optional(),exportName:z.string().optional(),hasExecute:z.boolean(),hasModelOutputProjection:z.boolean(),inputSchema:jsonObjectSchema.nullable(),logicalPath:z.string(),name:z.string(),outputSchema:jsonObjectSchema.optional(),requiresApproval:z.boolean(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicToolDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),rebindMissingCallbacks:z.boolean().optional(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledMemoryDefinitionSchema=z.object({description:z.string().optional(),exportName:z.string().optional(),logicalPath:z.string(),slot:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),visibility:z.enum([`scope`,`session`])}).strict(),compiledDynamicSkillDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),extensionNamespace:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledDynamicInstructionsDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledHookDefinitionSchema=z.object({eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),slug:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledExtensionMountSchema=z.object({externalDependencies:z.array(z.string()).readonly(),namespace:z.string(),packageName:z.string(),packageNamespace:z.string(),sourceRoot:z.string(),mountSourceId:z.string(),mountLogicalPath:z.string()}).strict(),compiledAgentResourceFields={agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),channelRoutes:compiledChannelRoutePlanSchema,connections:z.array(compiledConnectionDefinitionSchema),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,workflowTool:compiledWorkflowToolDefinitionSchema.optional(),webSearchProvider:z.enum([`exa`,`parallel`]).optional(),dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),extensionMounts:z.array(compiledExtensionMountSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),remoteAgents:z.array(compiledRemoteAgentNodeSchema),skills:z.array(compiledSkillSourceSchema).readonly(),instructions:z.array(compiledInstructionsSchema).readonly().default([]),instrumentation:moduleSourceRefSchema.optional(),tools:z.array(compiledToolDefinitionSchema),workspaceResourceRoot:compiledWorkspaceResourceRootSchema},compiledAgentResourcesSchema=z.object(compiledAgentResourceFields).strict(),compiledAgentNodeManifestSchema=z.object({...compiledAgentResourceFields,config:compiledAgentConfigSchema}).strict(),compiledSubagentNodeBaseFields={backing:resourceSourceBackingSchema,entryPath:z.string(),logicalPath:z.string(),name:z.string(),nodeId:z.string(),owner:agentSourceOwnerSchema,parentNodeId:z.string(),rootPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`),exportName:z.string().optional()},compiledDynamicSubagentDefinitionSchema=z.object({build:compiledAgentBuildDefinitionSchema.optional(),eventNames:z.array(z.string()).readonly(),exportName:z.string().optional(),logicalPath:z.string(),sourceId:z.string(),sourceKind:z.literal(`module`)}).strict(),compiledSubagentNodeSchema=z.union([z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentNodeManifestSchema,description:z.string()}).strict(),z.object({...compiledSubagentNodeBaseFields,agent:compiledAgentResourcesSchema,configResolver:compiledDynamicSubagentDefinitionSchema}).strict()]),compiledAgentManifestSchema=z.object({agentRoot:z.string(),appRoot:z.string(),bindings:z.record(z.string(),compiledModuleBindingSchema),extensionMounts:z.array(compiledExtensionMountSchema).default([]),channelRoutes:compiledChannelRoutePlanSchema,config:compiledAgentConfigSchema,connections:z.array(compiledConnectionDefinitionSchema),diagnosticsSummary:discoverDiagnosticsSummarySchema,sourceComposition:agentSourceCompositionSchema,workflowTool:compiledWorkflowToolDefinitionSchema.optional(),webSearchProvider:z.enum([`exa`,`parallel`]).optional(),dynamicInstructions:z.array(compiledDynamicInstructionsDefinitionSchema).default([]),dynamicSkills:z.array(compiledDynamicSkillDefinitionSchema).default([]),dynamicTools:z.array(compiledDynamicToolDefinitionSchema).default([]),hooks:z.array(compiledHookDefinitionSchema),memories:z.array(compiledMemoryDefinitionSchema).default([]),kind:z.literal(COMPILED_AGENT_MANIFEST_KIND),remoteAgents:z.array(compiledRemoteAgentNodeSchema),sandbox:compiledSandboxDefinitionSchema,sandboxWorkspaces:z.array(compiledSandboxWorkspaceSchema),schedules:z.array(compiledScheduleDefinitionSchema),skills:z.array(compiledSkillSourceSchema).readonly(),subagents:z.array(compiledSubagentNodeSchema),instructions:z.array(compiledInstructionsSchema).readonly().default([]),instrumentation:moduleSourceRefSchema.optional(),tools:z.array(compiledToolDefinitionSchema),version:z.literal(43),workspaceResourceRoot:compiledWorkspaceResourceRootSchema}).strict();function createCompiledAgentResources(e){return{agentRoot:e.agentRoot,appRoot:e.appRoot,bindings:{...e.bindings},channelRoutes:{effective:[...e.channelRoutes.effective],preflight:[...e.channelRoutes.preflight],shadowed:[...e.channelRoutes.shadowed]},connections:[...e.connections??[]],diagnosticsSummary:e.diagnosticsSummary??{errors:0,warnings:0},sourceComposition:{entries:[...e.sourceComposition.entries]},workflowTool:e.workflowTool===void 0?void 0:{...e.workflowTool},webSearchProvider:e.webSearchProvider,dynamicInstructions:[...e.dynamicInstructions??[]],dynamicSkills:[...e.dynamicSkills??[]],dynamicTools:[...e.dynamicTools??[]],extensionMounts:[...e.extensionMounts??[]],hooks:[...e.hooks??[]],memories:[...e.memories??[]],instructions:[...e.instructions??[]],instrumentation:e.instrumentation===void 0?void 0:{...e.instrumentation},remoteAgents:[...e.remoteAgents??[]],sandbox:e.sandbox,sandboxWorkspaces:[...e.sandboxWorkspaces??[]],schedules:[...e.schedules??[]],skills:[...e.skills??[]],tools:[...e.tools??[]],workspaceResourceRoot:e.workspaceResourceRoot??{logicalPath:``,rootEntries:deriveResourceRootEntries({sandboxWorkspaces:e.sandboxWorkspaces,skills:e.skills})}}}function createCompiledAgentNodeManifest(e){let t={...createCompiledAgentResources(e),config:cloneCompiledAgentDefinition(e.config)};return validateCompiledAgentResources(t,{allowUnknownResourceWinners:!0}),t}function cloneCompiledAgentDefinition(e){let t={build:e.build===void 0?void 0:{externalDependencies:e.build.externalDependencies===void 0?void 0:[...e.build.externalDependencies]},compaction:{model:e.compaction?.model===void 0?void 0:cloneCompiledRuntimeModelReference(e.compaction.model),thresholdPercent:e.compaction?.thresholdPercent},description:e.description,experimental:e.experimental===void 0?void 0:{instrumentationProviders:e.experimental.instrumentationProviders,tasks:e.experimental.tasks,workflow:e.experimental.workflow===void 0?void 0:{world:e.experimental.workflow.world}},name:e.name,outputSchema:e.outputSchema,reasoning:e.reasoning,limits:e.limits===void 0?void 0:{maxInputTokensPerSession:e.limits.maxInputTokensPerSession,maxOutputTokensPerSession:e.limits.maxOutputTokensPerSession,sessionTimeoutMs:e.limits.sessionTimeoutMs},source:{...e.source}};return e.dynamicModel===void 0?{...t,model:cloneCompiledRuntimeModelReference(e.model)}:{...t,dynamicModel:{...e.dynamicModel}}}function deriveResourceRootEntries(e){let t=new Set;for(let n of e.sandboxWorkspaces??[])for(let e of n.rootEntries)t.add(e);return[...t].sort((e,t)=>e.localeCompare(t))}function createCompiledSubagentNodeId(e,t){return e===`__root__`?t:`${e}::${t}`}function createCompiledAgentManifest(e){let t={...createCompiledAgentNodeManifest(e),kind:COMPILED_AGENT_MANIFEST_KIND,extensionMounts:[...e.extensionMounts??[]],subagents:[...e.subagents??[]],version:43};return validateCompiledAgentManifest(t),t}function cloneCompiledRuntimeModelReference(e){let t={id:e.id,routing:cloneModelRouting(e.routing)};return e.contextWindowTokens!==void 0&&(t.contextWindowTokens=e.contextWindowTokens),e.maxOutputTokens!==void 0&&(t.maxOutputTokens=e.maxOutputTokens),e.providerOptions!==void 0&&(t.providerOptions={...e.providerOptions}),e.source!==void 0&&(t.source={...e.source}),t}function cloneModelRouting(e){return e.kind===`external`?{kind:`external`,provider:e.provider}:e.byok===void 0?{kind:`gateway`,target:e.target}:{kind:`gateway`,target:e.target,byok:e.byok}}export{COMPILED_AGENT_MANIFEST_KIND,COMPILED_AGENT_MANIFEST_VERSION,ROOT_COMPILED_AGENT_NODE_ID,compiledAgentManifestSchema,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId,deriveResourceRootEntries};
@@ -27,6 +27,6 @@ export interface CompiledRuntimeModelCatalogLoader {
27
27
  export declare function resolveCompiledRuntimeModelCatalogCachePath(appRoot: string): string;
28
28
  /**
29
29
  * Creates a per-build loader that caches the AI Gateway model catalog in
30
- * memory and on disk.
30
+ * memory and on disk, with stale-on-error fallback.
31
31
  */
32
32
  export declare function createCompiledRuntimeModelCatalogLoader(appRoot: string): CompiledRuntimeModelCatalogLoader;
@@ -1 +1 @@
1
- import{mkdir,readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{AI_GATEWAY_MODELS_CATALOG_URL,vercelGatewayFetch}from"#internal/gateway.js";import{catalogModelProviderSchema,catalogModelSchema,catalogModelSchema as catalogModelSchema$1,findCatalogModelByProviderModelId,findCatalogModelBySlug,modelCatalogLimitsFromProvider,modelCatalogResponseSchema,modelCatalogResponseSchema as modelCatalogResponseSchema$1,normalizeCatalogModelId}from"#internal/model-catalog.js";const COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND=`eve-model-catalog-cache`;z.object({contextWindowTokens:z.number().int().positive(),maxOutputTokens:z.number().int().positive().optional()}).strict();const compiledRuntimeModelCatalogCacheSchema=z.object({fetchedAt:z.string(),kind:z.literal(COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND),models:z.array(catalogModelSchema$1),providerAliases:z.record(z.string(),z.string()),version:z.literal(2)}).strict(),builtInCompiledRuntimeModelLimitsById=new Map([[`anthropic/claude-opus-4.7`,{contextWindowTokens:2e5,maxOutputTokens:32e3}],[`openai/gpt-5.4`,{contextWindowTokens:4e5,maxOutputTokens:128e3}],[`openai/gpt-5.4-mini`,{contextWindowTokens:4e5,maxOutputTokens:128e3}]]);function resolveCompiledRuntimeModelCatalogCachePath(e){return join(e,`.eve`,`cache`,`model-catalog.json`)}function createCompiledRuntimeModelCatalogLoader(e){let t=null,n=null,r=null,getCachedCatalog=async()=>(t??=readModelCatalogCache(e),await t),getFetchedCatalog=async()=>{if(n!==null)throw n;if(r!==null)return await r;r=fetchAndPersistModelCatalog(e).then(e=>(t=Promise.resolve(e),e));try{return await r}catch(e){throw n=e,e}},resolveModelsFromCacheOrFetch=async()=>{let e=await getCachedCatalog();if(e!==null&&isCacheFresh(e))return e;try{return await getFetchedCatalog()}catch(t){if(e!==null)return e;throw t}};return{async getModelLimits(e){let t=normalizeCatalogModelId(e),n=builtInCompiledRuntimeModelLimitsById.get(t);if(n!==void 0)return n;let r=await resolveModelsFromCacheOrFetch();if(r!==null){let e=findCatalogModelBySlug(r.models,t);if(e)for(let t of e.providers){let e=modelCatalogLimitsFromProvider(t);if(e!==null)return e}}return null},async getByProviderModelId(e,t){let n=await resolveModelsFromCacheOrFetch();if(n===null)return null;let r=findCatalogModelByProviderModelId({models:n.models,provider:e,providerAliases:n.providerAliases,providerModelId:t});if(r!==null){let e=modelCatalogLimitsFromProvider(r.provider);if(e!==null)return{slug:r.model.slug,limits:e}}return null}}}async function fetchAndPersistModelCatalog(t){let r=await vercelGatewayFetch(AI_GATEWAY_MODELS_CATALOG_URL);if(!r.ok)throw Error(`AI Gateway model catalog request failed with HTTP ${r.status} ${r.statusText}.`);let i=modelCatalogResponseSchema$1.safeParse(await r.json());if(!i.success)throw Error(`AI Gateway model catalog response did not match the expected schema.`);let a={fetchedAt:new Date().toISOString(),kind:COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND,models:i.data.models,providerAliases:i.data.providerAliases,version:2};try{let r=resolveCompiledRuntimeModelCatalogCachePath(t);await mkdir(join(t,`.eve`,`cache`),{recursive:!0}),await writeFile(r,`${JSON.stringify(a,null,2)}\n`,`utf8`)}catch{}return a}async function readModelCatalogCache(e){try{let n=await readFile(resolveCompiledRuntimeModelCatalogCachePath(e),`utf8`),r=compiledRuntimeModelCatalogCacheSchema.safeParse(JSON.parse(n));return r.success?r.data:null}catch(e){return e instanceof Error&&`code`in e&&typeof e.code==`string`&&e.code,null}}function isCacheFresh(e){let t=Date.parse(e.fetchedAt);return Number.isFinite(t)?Date.now()-t<=864e5:!1}export{catalogModelProviderSchema,catalogModelSchema,createCompiledRuntimeModelCatalogLoader,modelCatalogResponseSchema,resolveCompiledRuntimeModelCatalogCachePath};
1
+ import{mkdir,readFile,writeFile}from"node:fs/promises";import{z}from"#compiled/zod/index.js";import{join}from"node:path";import{AI_GATEWAY_MODELS_CATALOG_URL,vercelGatewayFetch}from"#internal/gateway.js";import{catalogModelProviderSchema,catalogModelSchema,catalogModelSchema as catalogModelSchema$1,findCatalogModelByProviderModelId,findCatalogModelBySlug,modelCatalogLimitsFromProvider,modelCatalogResponseSchema,modelCatalogResponseSchema as modelCatalogResponseSchema$1,normalizeCatalogModelId}from"#internal/model-catalog.js";const COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND=`eve-model-catalog-cache`;z.object({contextWindowTokens:z.number().int().positive(),maxOutputTokens:z.number().int().positive().optional()}).strict();const compiledRuntimeModelCatalogCacheSchema=z.object({fetchedAt:z.string(),kind:z.literal(COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND),models:z.array(catalogModelSchema$1),providerAliases:z.record(z.string(),z.string()),version:z.literal(2)}).strict(),builtInCompiledRuntimeModelLimitsById=new Map([[`anthropic/claude-opus-4.7`,{contextWindowTokens:2e5,maxOutputTokens:32e3}],[`openai/gpt-5.4`,{contextWindowTokens:4e5,maxOutputTokens:128e3}],[`openai/gpt-5.4-mini`,{contextWindowTokens:4e5,maxOutputTokens:128e3}]]);function resolveCompiledRuntimeModelCatalogCachePath(e){return join(e,`.eve`,`cache`,`model-catalog.json`)}function createCompiledRuntimeModelCatalogLoader(e){let t=null,n=null,r=null,getCachedCatalog=async()=>(t??=readModelCatalogCache(e),await t),getFetchedCatalog=async()=>{if(n!==null)throw n;if(r!==null)return await r;r=fetchAndPersistModelCatalog(e).then(e=>(t=Promise.resolve(e),e));try{return await r}catch(e){throw n=e,e}},resolveModelsFromCacheOrFetch=async e=>{let t=await getCachedCatalog();if(e?.forceRefresh!==!0&&t!==null&&isCacheFresh(t))return t;try{return await getFetchedCatalog()}catch(e){if(t!==null)return t;throw e}};return{async getModelLimits(e){let t=normalizeCatalogModelId(e),n=builtInCompiledRuntimeModelLimitsById.get(t);if(n!==void 0)return n;let r=await resolveModelsFromCacheOrFetch();if(r===null)return null;let i=findCatalogModelBySlug(r.models,t);if(i===void 0){if(r=await resolveModelsFromCacheOrFetch({forceRefresh:!0}),r===null)return null;i=findCatalogModelBySlug(r.models,t)}if(i!==void 0)for(let e of i.providers){let t=modelCatalogLimitsFromProvider(e);if(t!==null)return t}return null},async getByProviderModelId(e,t){let n=await resolveModelsFromCacheOrFetch();if(n===null)return null;let r=findCatalogModelByProviderModelId({models:n.models,provider:e,providerAliases:n.providerAliases,providerModelId:t});if(r===null){if(n=await resolveModelsFromCacheOrFetch({forceRefresh:!0}),n===null)return null;r=findCatalogModelByProviderModelId({models:n.models,provider:e,providerAliases:n.providerAliases,providerModelId:t})}if(r!==null){let e=modelCatalogLimitsFromProvider(r.provider);if(e!==null)return{slug:r.model.slug,limits:e}}return null}}}async function fetchAndPersistModelCatalog(t){let r=await vercelGatewayFetch(AI_GATEWAY_MODELS_CATALOG_URL);if(!r.ok)throw Error(`AI Gateway model catalog request failed with HTTP ${r.status} ${r.statusText}.`);let a=modelCatalogResponseSchema$1.safeParse(await r.json());if(!a.success)throw Error(`AI Gateway model catalog response did not match the expected schema.`);let o={fetchedAt:new Date().toISOString(),kind:COMPILED_RUNTIME_MODEL_CATALOG_CACHE_KIND,models:a.data.models,providerAliases:a.data.providerAliases,version:2};try{let r=resolveCompiledRuntimeModelCatalogCachePath(t);await mkdir(join(t,`.eve`,`cache`),{recursive:!0}),await writeFile(r,`${JSON.stringify(o,null,2)}\n`,`utf8`)}catch{}return o}async function readModelCatalogCache(e){try{let n=await readFile(resolveCompiledRuntimeModelCatalogCachePath(e),`utf8`),r=compiledRuntimeModelCatalogCacheSchema.safeParse(JSON.parse(n));return r.success?r.data:null}catch(e){return e instanceof Error&&`code`in e&&typeof e.code==`string`&&e.code,null}}function isCacheFresh(e){let t=Date.parse(e.fetchedAt);return Number.isFinite(t)?Date.now()-t<=3e5:!1}export{catalogModelProviderSchema,catalogModelSchema,createCompiledRuntimeModelCatalogLoader,modelCatalogResponseSchema,resolveCompiledRuntimeModelCatalogCachePath};
@@ -1,4 +1,4 @@
1
- import{z}from"#compiled/zod/index.js";import{createCompiledBindingNamespaceLoader,resolveCompiledModuleExtensionScopeNamespace}from"#compiler/load-binding-namespace.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const compiledModuleNodeScopeSchema=z.object({modules:z.record(z.string(),z.object({}).passthrough())}).strict(),compiledModuleMapSchema=z.object({nodes:z.record(z.string(),compiledModuleNodeScopeSchema)}).strict();function createCompiledModuleMapSource(e){let t=dirnameFilesystemPath(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,a=!1,o=collectBoundNodeScopes(e.manifest).map(e=>{let i=new Map(e.modules.map(e=>[e.sourceId,`module_${r++}`]));return{modules:e.modules.map(({binding:e,sourceId:r})=>{let o=i.get(r);return e.backing.kind===`filesystem`?{bindingName:o,importSpecifier:createImportSpecifier({fromDirectory:t,importSpecifierStyle:n,targetPath:e.backing.sourcePath}),sourceId:r}:(a=!0,{bindingName:o,initializer:`await loadProgrammaticModule(${JSON.stringify(e.backing)}, ${renderProgrammaticDependencies(e.backing.dependencies,i)})`,sourceId:r})}),nodeId:e.nodeId}}),s=o.flatMap(e=>e.modules),c=s.flatMap(e=>e.importSpecifier===void 0?[]:[`import * as ${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`]),l=s.flatMap(e=>e.initializer===void 0?[]:[`const ${e.bindingName} = ${e.initializer};`]);return[`// Generated by eve. Do not edit by hand.`,...a?[`import { loadFrameworkProgrammaticModule as loadProgrammaticModule } from ${JSON.stringify(normalizeEsmImportSpecifier(e.programmaticLoaderImportSpecifier??`eve/internal/programmatic-source-loader`))};`]:[],...c,...a||c.length>0?[``]:[],...l,...l.length>0?[``]:[],`export const moduleMap = ${renderModuleMap(o)};`,``,`export default moduleMap;`,``].join(`
1
+ import{z}from"#compiled/zod/index.js";import{createCompiledBindingNamespaceLoader,resolveCompiledModuleExtensionScopeNamespace}from"#compiler/load-binding-namespace.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import"#compiler/source-graph.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const compiledModuleNodeScopeSchema=z.object({modules:z.record(z.string(),z.object({}).passthrough())}).strict(),compiledModuleMapSchema=z.object({nodes:z.record(z.string(),compiledModuleNodeScopeSchema)}).strict();function createCompiledModuleMapSource(e){let t=dirnameFilesystemPath(e.moduleMapPath),n=e.importSpecifierStyle??`relative`,r=0,a=!1,o=collectBoundNodeScopes(e.manifest).map(e=>{let i=new Map(e.modules.map(e=>[e.sourceId,`module_${r++}`]));return{modules:e.modules.map(({binding:e,sourceId:r})=>{let o=i.get(r);return e.backing.kind===`filesystem`?{bindingName:o,importSpecifier:createImportSpecifier({fromDirectory:t,importSpecifierStyle:n,targetPath:e.backing.sourcePath}),initializer:`memoizeModuleNamespaceFactories(imported_${o})`,sourceId:r}:(a=!0,{bindingName:o,initializer:`await loadProgrammaticModule(${JSON.stringify(e.backing)}, ${renderProgrammaticDependencies(e.backing.dependencies,i)})`,sourceId:r})}),nodeId:e.nodeId}}),s=o.flatMap(e=>e.modules),c=s.flatMap(e=>e.importSpecifier===void 0?[]:[`import * as imported_${e.bindingName} from ${JSON.stringify(e.importSpecifier)};`]),l=s.flatMap(e=>e.initializer===void 0?[]:[`const ${e.bindingName} = ${e.initializer};`]);return[`// Generated by eve. Do not edit by hand.`,...a||c.length>0?[`import { loadFrameworkProgrammaticModule as loadProgrammaticModule, memoizeModuleNamespaceFactories } from ${JSON.stringify(normalizeEsmImportSpecifier(e.programmaticLoaderImportSpecifier??`eve/internal/programmatic-source-loader`))};`]:[],...c,...a||c.length>0?[``]:[],...l,...l.length>0?[``]:[],`export const moduleMap = ${renderModuleMap(o)};`,``,`export default moduleMap;`,``].join(`
2
2
  `)}async function createProgrammaticCompiledModuleMap(e,n){let r={};for(let i of collectBoundNodeScopes(e)){let e={},a=createCompiledBindingNamespaceLoader({bindings:Object.fromEntries(i.modules.map(({binding:e,sourceId:t})=>[t,e])),registries:n});for(let{sourceId:t}of i.modules)e[t]=await a(t);r[i.nodeId]={modules:e}}return{nodes:r}}function collectModuleBindingsForManifest(e){let t=new Map(Object.entries(e.bindings));for(let n of e.remoteAgents){if(t.has(n.sourceId))throw Error(`Remote agent binding "${n.sourceId}" collides with a node binding.`);t.set(n.sourceId,n.binding)}return orderBoundModules([...t].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({binding:t,sourceId:e})))}function orderBoundModules(e){let t=new Map(e.map(e=>[e.sourceId,e])),n=[],r=new Set,i=new Set,visit=e=>{if(!i.has(e.sourceId)){if(r.has(e.sourceId))throw Error(`Compiled module dependency cycle includes "${e.sourceId}".`);if(r.add(e.sourceId),e.binding.backing.kind===`programmatic`)for(let n of Object.values(e.binding.backing.dependencies??{})){let r=t.get(n);if(r===void 0)throw Error(`Programmatic binding "${e.sourceId}" depends on missing binding "${n}".`);visit(r)}r.delete(e.sourceId),i.add(e.sourceId),n.push(e)}};for(let t of e)visit(t);return n}function renderProgrammaticDependencies(e,t){let n=Object.entries(e??{});return n.length===0?`Object.freeze({})`:`Object.freeze({ ${n.map(([e,n])=>`${JSON.stringify(e)}: ${t.get(n)}`).join(`, `)} })`}function collectBoundNodeScopes(e){return[{modules:collectModuleBindingsForManifest(e),nodeId:ROOT_COMPILED_AGENT_NODE_ID},...[...e.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>({modules:collectModuleBindingsForManifest(e.agent),nodeId:e.nodeId}))]}function renderModuleMap(e){return renderFrozenObject([{key:`nodes`,value:renderFrozenObject(e.map(e=>({key:e.nodeId,value:renderFrozenObject([{key:`modules`,value:renderFrozenObject(e.modules.map(e=>({key:e.sourceId,value:e.bindingName})))}],3)})))}],0)}function renderFrozenObject(e,t=1){if(e.length===0)return`Object.freeze({})`;let n=` `.repeat(t),r=` `.repeat(t+1);return[`Object.freeze({`,e.map(e=>`${r}${JSON.stringify(e.key)}: ${e.value.replaceAll(`
3
3
  `,`\n${r}`)}`).join(`,
4
4
  `),`${n}})`].join(`
@@ -1,6 +1,6 @@
1
1
  import type { ModuleSourceRef } from "#shared/source-ref.js";
2
2
  import type { CompiledRuntimeModelCatalogLoader } from "#compiler/model-catalog.js";
3
- import { type AgentSourceRegistry, type CompiledModuleBinding, type AgentSourceOwner } from "#compiler/source-graph.js";
3
+ import { type AgentSourceRegistry, type CompiledModuleBinding, type AgentSourceOwner, type ProgrammaticModuleNamespace } from "#compiler/source-graph.js";
4
4
  import type { CompiledBindingNamespaceLoader } from "#compiler/load-binding-namespace.js";
5
5
  /**
6
6
  * Shared compile-time context threaded through every per-primitive
@@ -35,6 +35,7 @@ export declare function requireModuleBackedDefinitionLoadOptions(options: Source
35
35
  */
36
36
  export declare function loadModuleBackedDefinition(input: {
37
37
  readonly binding: CompiledModuleBinding;
38
+ readonly dependencyNamespaces?: Readonly<Record<string, ProgrammaticModuleNamespace>>;
38
39
  readonly displayPath?: string;
39
40
  readonly kind: string;
40
41
  readonly loadNamespace: CompiledBindingNamespaceLoader;
@@ -1 +1 @@
1
- import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{composeAgentModuleCandidates,createCompiledModuleBinding,createProgrammaticModuleCandidates,describeAgentSourceCandidate,disableComposedCandidate}from"#compiler/source-graph.js";import{frameworkAgentSourceRegistry}from"#framework/sources/registry.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,t={}){let i=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(i);let a={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:i},o=t.diagnostics??[],c=await new AgentGraphCompiler(a,i,o).compileStaticNode({inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,owner:{kind:`application`}}),l=[c.manifest,...c.descendants.map(e=>e.agent)].flatMap(e=>e.tools).find(e=>e.execution===`background`);if(l!==void 0&&c.manifest.config.experimental?.tasks!==!0)throw Error(`Background tool "${l.name}" requires experimental.tasks: true in the root agent config.`);let u=summarizeCompilerDiagnostics(o),d=c.descendants.map(e=>(e.configResolver,{...e,agent:{...e.agent,diagnosticsSummary:u}}));return createCompiledAgentManifest({...c.manifest,diagnosticsSummary:u,subagents:d})}var AgentGraphCompiler=class{context;registries;diagnostics;constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let a=finalizeNodeSourceState(t,r);assertInstrumentationLayoutConfig(n,a);let o=await this.compileResources(e,a),s=await this.compileChildren(e,a,r),c=createCompiledAgentNodeManifest({...o,config:n,remoteAgents:s.remoteAgents});return{descendants:s.nodes,manifest:c}}async compileChildren(e,t,n){let r=[],s=[],c=collectSelectedSourceIds(t.composed),l=t.projected.subagents.filter(e=>c.has(e.candidate.sourceId));for(let t of l){let c=t.source,l=createCompiledSubagentNodeId(e.nodeId,c.sourceId),u={extensionScope:t.extensionScope??e.extensionScope,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:c.manifest,nodeId:l,owner:t.owner,parentNodeId:e.nodeId},d=await this.createPhaseOneNodeSourceState(u,n),f=normalizeSubagentConfig(d.selectedConfig.definition,`Expected the subagent config export "${d.selectedConfig.source.exportName??`default`}" from "${c.entryPath}" to match the public eve shape.`);if(f.kind===`remote`){assertRemoteAgentDefinitionHasNoLocalPackageEntries(c),s.push(createCompiledRemoteAgent({binding:d.selectedConfig.binding,definition:f,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,source:c,sourceRef:d.selectedConfig.source}));continue}let p,m;f.kind===`local`?(p=await compileAgentConfig(c.manifest,this.context,{binding:d.selectedConfig.binding,definition:f.definition,source:d.selectedConfig.source}),assertRootOnlyConfig(p,!1,c.manifest.agentId)):m=f.build?.externalDependencies;let h=mergeExternalDependencies(n,p?.build?.externalDependencies,m,c.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));p!==void 0&&h.length>0&&(p={...p,build:{...p.build,externalDependencies:h}});let _=finalizeNodeSourceState(d,h);p!==void 0&&assertInstrumentationLayoutConfig(p,_);let v=await this.compileResources(u,_),y=await this.compileChildren(u,_,h),b={backing:t.candidate.backing,entryPath:c.entryPath,logicalPath:c.logicalPath,name:c.subagentId,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,rootPath:c.rootPath,sourceId:c.sourceId,sourceKind:`module`},x;x=p===void 0?{...b,agent:createCompiledAgentResources({...v,remoteAgents:y.remoteAgents}),configResolver:{build:f.kind===`dynamic`?f.build:void 0,eventNames:f.kind===`dynamic`?f.eventNames:[],exportName:d.selectedConfig.source.exportName,logicalPath:d.selectedConfig.source.logicalPath,sourceId:d.selectedConfig.source.sourceId,sourceKind:`module`}}:{...b,agent:createCompiledAgentNodeManifest({...v,config:p,remoteAgents:y.remoteAgents}),description:expectSubagentDescription(p,c)},r.push(x,...y.nodes)}return{nodes:r,remoteAgents:s}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...r,...n.candidates,...i],o=composeAgentModuleCandidates(a),s=projectSelectedSources({candidates:o.selected.values(),resources:n.resources});return{composed:o,orderedCandidates:a,projected:n,sourcesBySourceId:new Map(s.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t);return{graph:n,selectedConfig:await this.loadSelectedConfig(n)}}async loadSelectedConfig(e){let n=e.composed.selected.get(`agent`);if(n===void 0||!isModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createCompiledModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:createCompiledBindingNamespaceLoader({bindings:{[n.sourceId]:r},registries:this.registries}),source:a}),source:a}}async compileResources(n,r){let i=[],o=[],c=[],l=[],u=[],p=[],m=[],g=[],y=[],S=[],C,w,T,E,D=collectSelectedSourceIds(r.composed),O=createCompiledBindingNamespaceLoader({bindings:r.bindings,registries:this.registries});for(let t of r.orderedCandidates){if(!D.has(t.sourceId))continue;let a=r.sourcesBySourceId.get(t.sourceId);if(a===void 0)continue;let s=r.bindings[t.sourceId],d={binding:s,loadNamespace:O,owner:t.owner};switch(a.kind){case`config`:case`extension`:break;case`channel`:{let i=await compileChannelDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:O});i.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],D.delete(t.sourceId)):S.push(...i.definitions);break}case`connection`:m.push(await compileConnectionDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:O}));break;case`hook`:g.push(await compileHookEntry(a.source,{binding:s,loadNamespace:O}));break;case`instructions`:{let e=await compileInstructionsEntry(n.manifest.agentRoot,a.source,d);e.kind===`instructions`?u.push(e.definition):p.push(e.definition);break}case`instrumentation`:w=a.source;break;case`sandbox`:C=await compileSandboxDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:O});break;case`schedule`:y.push(await compileScheduleDefinition(n.manifest.agentRoot,a.source,d));break;case`skill`:{let e=await compileSkillSource(n.manifest.agentRoot,a.source,d);e.kind===`skill`?c.push(e.definition):l.push(withExtensionNamespace(e.definition,t.owner));break}case`tool`:{let e=await compileToolEntry(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:O});e.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],D.delete(t.sourceId)):e.kind===`tool`?i.push(e.definition):e.kind===`dynamic-tool`?o.push(withExtensionNamespace(e.definition,t.owner)):e.kind===`workflow-tool`?(assertRootOwnedSpecialTool(t,`Workflow`),T={...a.source,maxSubagents:e.maxSubagents}):(assertNonExtensionSpecialTool(t,`Web search`),i.push(e.definition),E=e.provider);break}}}if(C===void 0)throw Error(`Agent node "${n.nodeId}" has no selected sandbox source.`);assertUniqueBy(i,e=>e.name,`tool name`),assertUniqueBy(o,e=>e.slug,`dynamic tool slug`),assertUniqueBy(m,e=>e.connectionName,`connection name`),assertUniqueBy(c,e=>e.name,`skill name`);let k=createCompiledChannelRoutePlan({bindings:r.bindings,channels:S,diagnostics:this.diagnostics,nodeId:n.nodeId,sources:Object.fromEntries(r.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});return createCompiledAgentResources({agentRoot:n.manifest.agentRoot,appRoot:n.manifest.appRoot,bindings:r.bindings,channelRoutes:k,connections:m,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicInstructions:p,dynamicSkills:l,dynamicTools:o,extensionMounts:compileExtensionMounts(n.manifest,r.composed),hooks:g,instructions:u,instrumentation:w,sandbox:C,sandboxWorkspaces:n.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:y,skills:c,sourceComposition:r.composed.composition,tools:i,webSearchProvider:E,workflowTool:T})}};function isModuleCandidate(e){return e.backing.kind!==`resource`}function assertInstrumentationLayoutConfig(e,t){if(e.experimental?.instrumentationProviders===!0&&t.composed.selected.has(`instrumentation`))throw Error(`A selected instrumentation.ts source cannot be used with experimental.instrumentationProviders. Move the declaration into the instrumentation/ provider directory.`)}export{compileAgentManifest};
1
+ import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{ROOT_COMPILED_AGENT_NODE_ID,createCompiledAgentManifest,createCompiledAgentNodeManifest,createCompiledAgentResources,createCompiledSubagentNodeId}from"#compiler/manifest.js";import{summarizeCompilerDiagnostics}from"#compiler/diagnostics.js";import{canonicalSourceSlot,composeAgentModuleCandidates,createCompiledModuleBinding,createProgrammaticModuleCandidates,describeAgentSourceCandidate,disableComposedCandidate,instantiateProgrammaticTemplate}from"#compiler/source-graph.js";import{frameworkAgentSourceRegistry,memoryWrapperTemplate}from"#framework/sources/registry.js";import{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace}from"#compiler/normalize-manifest-helpers.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{assertRemoteAgentDefinitionHasNoLocalPackageEntries,normalizeSubagentConfig}from"#compiler/normalize-subagent.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{compileAgentConfig}from"#compiler/normalize-agent-config.js";import{compileConnectionDefinition}from"#compiler/normalize-connection.js";import{compileHookEntry}from"#compiler/normalize-hook.js";import{compileInstructionsEntry}from"#compiler/normalize-instructions.js";import{compileMemoryDefinition,deriveMemorySlot}from"#compiler/normalize-memory.js";import{compileSandboxDefinition}from"#compiler/normalize-sandbox.js";import{compileScheduleDefinition}from"#compiler/normalize-schedule.js";import{compileSkillSource}from"#compiler/normalize-skill.js";import{compileToolEntry}from"#compiler/normalize-tool.js";import{createCompiledChannelRoutePlan}from"#compiler/channel-route-plan.js";import{finalizeNodeSourceState}from"#compiler/node-source-state.js";import{projectAgentSources,projectSelectedSources}from"#compiler/project-sources.js";async function compileAgentManifest(e,t={}){let i=[frameworkAgentSourceRegistry,...t.sourceRegistries??[]];assertUniqueRegistryIds(i);let a={modelCatalog:createCompiledRuntimeModelCatalogLoader(e.appRoot),registries:i},o=t.diagnostics??[],c=await new AgentGraphCompiler(a,i,o).compileStaticNode({inheritedExternalDependencies:[],isRoot:!0,layer:`application`,manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID,owner:{kind:`application`}}),l=[c.manifest,...c.descendants.map(e=>e.agent)].flatMap(e=>e.tools).find(e=>e.execution===`background`);if(l!==void 0&&c.manifest.config.experimental?.tasks!==!0)throw Error(`Background tool "${l.name}" requires experimental.tasks: true in the root agent config.`);let u=summarizeCompilerDiagnostics(o),d=c.descendants.map(e=>(e.configResolver,{...e,agent:{...e.agent,diagnosticsSummary:u}}));return createCompiledAgentManifest({...c.manifest,diagnosticsSummary:u,subagents:d})}var AgentGraphCompiler=class{context;registries;diagnostics;constructor(e,t,n){this.context=e,this.registries=t,this.diagnostics=n}async compileStaticNode(e){let t=await this.createPhaseOneNodeSourceState(e,e.inheritedExternalDependencies),n=await compileAgentConfig(e.manifest,this.context,{binding:t.selectedConfig.binding,definition:t.selectedConfig.definition,source:t.selectedConfig.source});assertRootOnlyConfig(n,e.isRoot,e.manifest.agentId);let r=mergeExternalDependencies(e.inheritedExternalDependencies,n.build?.externalDependencies,e.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));r.length>0&&(n={...n,build:{...n.build,externalDependencies:r}});let a=finalizeNodeSourceState(t,r);assertInstrumentationLayoutConfig(n,a);let o=await this.compileResources(e,a),s=await this.compileChildren(e,a,r),c=createCompiledAgentNodeManifest({...o,config:n,remoteAgents:s.remoteAgents});return{descendants:s.nodes,manifest:c}}async compileChildren(e,t,n){let r=[],s=[],c=collectSelectedSourceIds(t.composed),l=t.projected.subagents.filter(e=>c.has(e.candidate.sourceId));for(let t of l){let c=t.source,l=createCompiledSubagentNodeId(e.nodeId,c.sourceId),u={extensionScope:t.extensionScope??e.extensionScope,inheritedExternalDependencies:n,isRoot:!1,layer:t.candidate.layer,manifest:c.manifest,nodeId:l,owner:t.owner,parentNodeId:e.nodeId},d=await this.createPhaseOneNodeSourceState(u,n),f=normalizeSubagentConfig(d.selectedConfig.definition,`Expected the subagent config export "${d.selectedConfig.source.exportName??`default`}" from "${c.entryPath}" to match the public eve shape.`);if(f.kind===`remote`){assertRemoteAgentDefinitionHasNoLocalPackageEntries(c),s.push(createCompiledRemoteAgent({binding:d.selectedConfig.binding,definition:f,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,source:c,sourceRef:d.selectedConfig.source}));continue}let p,m;f.kind===`local`?(p=await compileAgentConfig(c.manifest,this.context,{binding:d.selectedConfig.binding,definition:f.definition,source:d.selectedConfig.source}),assertRootOnlyConfig(p,!1,c.manifest.agentId)):m=f.build?.externalDependencies;let h=mergeExternalDependencies(n,p?.build?.externalDependencies,m,c.manifest.resolvedExtensions.flatMap(e=>e.externalDependencies));p!==void 0&&h.length>0&&(p={...p,build:{...p.build,externalDependencies:h}});let g=finalizeNodeSourceState(d,h);p!==void 0&&assertInstrumentationLayoutConfig(p,g);let _=await this.compileResources(u,g),v=await this.compileChildren(u,g,h),b={backing:t.candidate.backing,entryPath:c.entryPath,logicalPath:c.logicalPath,name:c.subagentId,nodeId:l,owner:t.owner,parentNodeId:e.nodeId,rootPath:c.rootPath,sourceId:c.sourceId,sourceKind:`module`},x;x=p===void 0?{...b,agent:createCompiledAgentResources({..._,remoteAgents:v.remoteAgents}),configResolver:{build:f.kind===`dynamic`?f.build:void 0,eventNames:f.kind===`dynamic`?f.eventNames:[],exportName:d.selectedConfig.source.exportName,logicalPath:d.selectedConfig.source.logicalPath,sourceId:d.selectedConfig.source.sourceId,sourceKind:`module`}}:{...b,agent:createCompiledAgentNodeManifest({..._,config:p,remoteAgents:v.remoteAgents}),description:expectSubagentDescription(p,c)},r.push(x,...v.nodes)}return{nodes:r,remoteAgents:s}}composeNodeSources(e,t){let n=projectAgentSources({externalDependencies:t,extensionScope:e.extensionScope,layer:e.layer,manifest:e.manifest,nodeId:e.nodeId,owner:e.owner}),r=[],i=[];for(let t of this.registries){let n=t===frameworkAgentSourceRegistry;for(let a of t.registrations){if(a.applyTo===`root`&&!e.isRoot)continue;!n&&a.applyTo===`all-local-nodes`&&assertApplicationOverlayCanApplyToAllNodes(a.source.modules.map(e=>e.logicalPath));let t=createProgrammaticModuleCandidates({layer:n?`framework-default`:`application`,nodeId:e.nodeId,owner:n?{feature:a.source.id,kind:`framework`}:{kind:`application`},registration:a});(n?r:i).push(...t)}}let a=[...n.candidates,...i].filter(e=>e.backing.kind!==`resource`&&(canonicalSourceSlot(e.logicalPath)===`memory`||canonicalSourceSlot(e.logicalPath).startsWith(`memory/`))).map(e=>{let t=deriveMemorySlot(e.logicalPath);return instantiateProgrammaticTemplate({anchor:e,dependencies:{memory:e},logicalPath:`tools/${t}.ts`,owner:{feature:`memory`,kind:`framework`},parameters:{memoryExportName:e.exportName??`default`,memoryLogicalPath:e.logicalPath,slot:t},template:memoryWrapperTemplate})}),o=[...r,...n.candidates,...a,...i],s=composeAgentModuleCandidates(o),u=projectSelectedSources({candidates:s.selected.values(),resources:n.resources});return{composed:s,orderedCandidates:o,projected:n,sourcesBySourceId:new Map(u.map(e=>[e.candidate.sourceId,e])),subagentsBySourceId:new Map(n.subagents.map(e=>[e.candidate.sourceId,e]))}}async createPhaseOneNodeSourceState(e,t){let n=this.composeNodeSources(e,t);return{graph:n,selectedConfig:await this.loadSelectedConfig(n)}}async loadSelectedConfig(e){let n=e.composed.selected.get(`agent`);if(n===void 0||!isModuleCandidate(n))throw Error(`Every local agent node requires a selected module-backed agent.ts source.`);let r=createCompiledModuleBinding(n),i=e.sourcesBySourceId.get(n.sourceId);if(i?.source.sourceKind!==`module`)throw Error(`Selected agent config source "${n.sourceId}" was not projected.`);let a=i.source;return{binding:r,candidate:n,definition:await loadModuleBackedDefinition({binding:r,kind:`agent config`,loadNamespace:createCompiledBindingNamespaceLoader({bindings:{[n.sourceId]:r},registries:this.registries}),source:a}),source:a}}async compileResources(n,r){let i=[],o=[],c=[],l=[],u=[],d=[],m=[],h=[],g=[],_=[],y=[],S,C,w,T,E=collectSelectedSourceIds(r.composed),D=createCompiledBindingNamespaceLoader({bindings:r.bindings,registries:this.registries});for(let t of r.orderedCandidates){if(!E.has(t.sourceId))continue;let a=r.sourcesBySourceId.get(t.sourceId);if(a===void 0)continue;let s=r.bindings[t.sourceId],f={binding:s,loadNamespace:D,owner:t.owner};switch(a.kind){case`config`:case`extension`:break;case`channel`:{let i=await compileChannelDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});i.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],E.delete(t.sourceId)):y.push(...i.definitions);break}case`connection`:m.push(await compileConnectionDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D}));break;case`hook`:g.push(await compileHookEntry(a.source,{binding:s,loadNamespace:D}));break;case`instructions`:{let e=await compileInstructionsEntry(n.manifest.agentRoot,a.source,f);e.kind===`instructions`?u.push(e.definition):d.push(e.definition);break}case`instrumentation`:C=a.source;break;case`memory`:h.push(await compileMemoryDefinition(a.source,{binding:s,loadNamespace:D}));break;case`sandbox`:S=await compileSandboxDefinition(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});break;case`schedule`:_.push(await compileScheduleDefinition(n.manifest.agentRoot,a.source,f));break;case`skill`:{let e=await compileSkillSource(n.manifest.agentRoot,a.source,f);e.kind===`skill`?c.push(e.definition):l.push(withExtensionNamespace(e.definition,t.owner));break}case`tool`:{let e=await compileToolEntry(n.manifest.agentRoot,a.source,{binding:s,loadNamespace:D});e.kind===`disabled`?(r.composed=disableComposedCandidate({candidate:t,composed:r.composed}),delete r.bindings[t.sourceId],E.delete(t.sourceId)):e.kind===`tool`?i.push(e.definition):e.kind===`dynamic-tool`?o.push(withExtensionNamespace(e.definition,t.owner)):e.kind===`workflow-tool`?(assertRootOwnedSpecialTool(t,`Workflow`),w={...a.source,maxSubagents:e.maxSubagents}):(assertNonExtensionSpecialTool(t,`Web search`),i.push(e.definition),T=e.provider);break}}}if(S===void 0)throw Error(`Agent node "${n.nodeId}" has no selected sandbox source.`);assertUniqueBy(i,e=>e.name,`tool name`),assertUniqueBy(o,e=>e.slug,`dynamic tool slug`),assertUniqueBy(m,e=>e.connectionName,`connection name`),assertUniqueBy(c,e=>e.name,`skill name`);let O=createCompiledChannelRoutePlan({bindings:r.bindings,channels:y,diagnostics:this.diagnostics,nodeId:n.nodeId,sources:Object.fromEntries(r.orderedCandidates.map(e=>[e.sourceId,describeAgentSourceCandidate(e)]))});return createCompiledAgentResources({agentRoot:n.manifest.agentRoot,appRoot:n.manifest.appRoot,bindings:r.bindings,channelRoutes:O,connections:m,diagnosticsSummary:summarizeCompilerDiagnostics(this.diagnostics),dynamicInstructions:d,dynamicSkills:l,dynamicTools:o,extensionMounts:compileExtensionMounts(n.manifest,r.composed),hooks:g,memories:h,instructions:u,instrumentation:C,sandbox:S,sandboxWorkspaces:n.manifest.sandboxWorkspaces.map(e=>({logicalPath:e.logicalPath,rootEntries:[...e.rootEntries],sourceId:e.sourceId,sourcePath:e.sourcePath})),schedules:_,skills:c,sourceComposition:r.composed.composition,tools:i,webSearchProvider:T,workflowTool:w})}};function isModuleCandidate(e){return e.backing.kind!==`resource`}function assertInstrumentationLayoutConfig(e,t){if(e.experimental?.instrumentationProviders===!0&&t.composed.selected.has(`instrumentation`))throw Error(`A selected instrumentation.ts source cannot be used with experimental.instrumentationProviders. Move the declaration into the instrumentation/ provider directory.`)}export{compileAgentManifest};
@@ -0,0 +1,5 @@
1
+ import type { ModuleSourceRef } from "#shared/source-ref.js";
2
+ import type { CompiledMemoryDefinition } from "#compiler/manifest.js";
3
+ import { type ModuleBackedDefinitionLoadOptions } from "#compiler/normalize-helpers.js";
4
+ export declare function compileMemoryDefinition(source: ModuleSourceRef, options: ModuleBackedDefinitionLoadOptions): Promise<CompiledMemoryDefinition>;
5
+ export declare function deriveMemorySlot(logicalPath: string): string;
@@ -0,0 +1 @@
1
+ import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeMemoryDefinition}from"#internal/authored-definition/memory.js";async function compileMemoryDefinition(e,r){let i=normalizeMemoryDefinition(await loadModuleBackedDefinition({binding:r.binding,kind:`memory`,loadNamespace:r.loadNamespace,source:e}),`Expected the memory export "${e.exportName??`default`}" from "${e.logicalPath}" to be created with defineMemory().`);return{description:i.description,exportName:e.exportName,logicalPath:e.logicalPath,slot:deriveMemorySlot(e.logicalPath),sourceId:e.sourceId,sourceKind:`module`,visibility:i.visibility??`scope`}}function deriveMemorySlot(t){let n=stripLogicalPathExtension(t);return n===`memory`?`memory`:n.slice(7)}export{compileMemoryDefinition,deriveMemorySlot};
@@ -1 +1 @@
1
- import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeToolDefinition}from"#internal/authored-definition/schema-backed.js";async function compileToolEntry(e,t,n){let r=normalizeToolDefinition(await loadModuleBackedDefinition({binding:n.binding,kind:`tool`,loadNamespace:n.loadNamespace,source:t}),`Expected the tool export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`),i=stripLogicalPathExtension(t.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`);if(r.kind===`disabled`)return{kind:`disabled`,name:i};if(r.kind===`workflow-tool`)return{kind:`workflow-tool`,maxSubagents:r.maxSubagents};if(r.kind===`web-search-tool`){if(i!==`web_search`)throw Error(`The webSearch() definition must be exported from "tools/web_search.ts", not "${t.logicalPath}".`);return{definition:{description:`Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`,exportName:t.exportName,hasExecute:!1,hasModelOutputProjection:!1,inputSchema:null,logicalPath:t.logicalPath,name:i,sourceId:t.sourceId,sourceKind:`module`,requiresApproval:!1},kind:`web-search-tool`,provider:r.provider}}return r.kind===`dynamic-tool`?{kind:`dynamic-tool`,definition:{eventNames:[...r.eventNames],exportName:t.exportName,logicalPath:t.logicalPath,slug:i,sourceId:t.sourceId,sourceKind:`module`}}:{kind:`tool`,definition:{description:r.definition.description,execution:r.definition.execution,exportName:t.exportName,hasExecute:!0,hasModelOutputProjection:r.definition.hasModelOutputProjection,inputSchema:r.definition.inputSchema??null,logicalPath:t.logicalPath,name:i,outputSchema:r.definition.outputSchema,requiresApproval:r.definition.hasApproval,sourceId:t.sourceId,sourceKind:`module`}}}export{compileToolEntry};
1
+ import{stripLogicalPathExtension}from"#discover/filesystem.js";import{loadModuleBackedDefinition}from"#compiler/normalize-helpers.js";import{normalizeToolDefinition}from"#internal/authored-definition/schema-backed.js";async function compileToolEntry(e,t,n){let r=normalizeToolDefinition(await loadModuleBackedDefinition({binding:n.binding,kind:`tool`,loadNamespace:n.loadNamespace,source:t}),`Expected the tool export "${t.exportName??`default`}" from "${t.logicalPath}" to match the public eve shape.`),i=stripLogicalPathExtension(t.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`);if(r.kind===`disabled`)return{kind:`disabled`,name:i};if(r.kind===`workflow-tool`)return{kind:`workflow-tool`,maxSubagents:r.maxSubagents};if(r.kind===`web-search-tool`){if(i!==`web_search`)throw Error(`The webSearch() definition must be exported from "tools/web_search.ts", not "${t.logicalPath}".`);return{definition:{description:`Search the web for real-time information. Use this to find up-to-date information about current events, recent developments, or topics that may have changed since the knowledge cutoff.`,exportName:t.exportName,hasExecute:!1,hasModelOutputProjection:!1,inputSchema:null,logicalPath:t.logicalPath,name:i,sourceId:t.sourceId,sourceKind:`module`,requiresApproval:!1},kind:`web-search-tool`,provider:r.provider}}return r.kind===`dynamic-tool`?{kind:`dynamic-tool`,definition:{eventNames:[...r.eventNames],exportName:t.exportName,logicalPath:t.logicalPath,rebindMissingCallbacks:r.rebindMissingCallbacks||void 0,slug:i,sourceId:t.sourceId,sourceKind:`module`}}:{kind:`tool`,definition:{description:r.definition.description,execution:r.definition.execution,exportName:t.exportName,hasExecute:!0,hasModelOutputProjection:r.definition.hasModelOutputProjection,inputSchema:r.definition.inputSchema??null,logicalPath:t.logicalPath,name:i,outputSchema:r.definition.outputSchema,requiresApproval:r.definition.hasApproval,sourceId:t.sourceId,sourceKind:`module`}}}export{compileToolEntry};
@@ -1,4 +1,4 @@
1
- import type { AgentSourceManifest, ConnectionSourceRef, InstructionsSourceRef, LocalSubagentSourceRef, ResolvedExtensionMount, ScheduleSourceRef, SkillSourceRef } from "#discover/manifest.js";
1
+ import type { AgentSourceManifest, ConnectionSourceRef, InstructionsSourceRef, LocalSubagentSourceRef, ScheduleSourceRef, SkillSourceRef } from "#discover/manifest.js";
2
2
  import type { ModuleSourceRef } from "#shared/source-ref.js";
3
3
  import type { AgentModuleCandidate, AgentResourceCandidate, AgentSourceCandidate, AgentSourceLayer, AgentSourceOwner } from "#compiler/source-graph.js";
4
4
  export type ProjectedModuleSource = {
@@ -7,7 +7,7 @@ export type ProjectedModuleSource = {
7
7
  readonly source: ConnectionSourceRef;
8
8
  } | {
9
9
  readonly candidate: AgentModuleCandidate;
10
- readonly kind: "channel" | "config" | "extension" | "hook" | "instructions" | "instrumentation" | "sandbox" | "schedule" | "skill" | "tool";
10
+ readonly kind: "channel" | "config" | "extension" | "hook" | "instructions" | "instrumentation" | "memory" | "sandbox" | "schedule" | "skill" | "tool";
11
11
  readonly source: ModuleSourceRef;
12
12
  };
13
13
  export type ProjectedResourceSource = {
@@ -55,7 +55,6 @@ export declare function projectSelectedSources(input: {
55
55
  }): readonly ProjectedSource[];
56
56
  export declare function createFilesystemModuleCandidate(input: {
57
57
  readonly externalDependencies: readonly string[];
58
- readonly extension?: ResolvedExtensionMount;
59
58
  readonly extensionScope?: {
60
59
  readonly namespace: string;
61
60
  readonly sourceRoot: string;
@@ -68,4 +67,4 @@ export declare function createFilesystemModuleCandidate(input: {
68
67
  readonly sourceId?: string;
69
68
  readonly sourceRoot: string;
70
69
  }): AgentModuleCandidate;
71
- export declare function qualifyExtensionLogicalPath(logicalPath: string, namespace: string): string;
70
+ export declare function qualifyExtensionContributionLogicalPath(logicalPath: string, namespace: string): string;