eve 0.45.1 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/src/channel/types.d.ts +2 -0
- package/dist/src/cli/dev/tui/agent-header.d.ts +5 -14
- package/dist/src/cli/dev/tui/agent-header.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +4 -5
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -3
- package/dist/src/cli/run.js +3 -3
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/@vercel/blob/client.d.ts +487 -0
- package/dist/src/compiled/@vercel/blob/create-folder-BM6BTlko.d.ts +471 -0
- package/dist/src/compiled/@vercel/blob/index.d.ts +573 -0
- package/dist/src/compiled/@vercel/blob/index.js +43 -0
- package/dist/src/compiled/@vercel/blob/license.md +201 -0
- package/dist/src/compiler/channel-route-plan.d.ts +2 -2
- package/dist/src/compiler/instrumentation-layout-config.d.ts +3 -0
- package/dist/src/compiler/instrumentation-layout-config.js +1 -0
- package/dist/src/compiler/load-binding-namespace.d.ts +5 -3
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +1 -1
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/compiler/module-lifecycle.d.ts +14 -0
- package/dist/src/compiler/module-lifecycle.js +1 -0
- package/dist/src/compiler/module-map.d.ts +2 -2
- package/dist/src/compiler/module-map.js +2 -2
- package/dist/src/compiler/node-source-state.d.ts +6 -3
- package/dist/src/compiler/node-source-state.js +1 -1
- package/dist/src/compiler/normalize-agent-config.d.ts +2 -2
- package/dist/src/compiler/normalize-helpers.d.ts +4 -4
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +12 -2
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/hitl/approval-prompt.d.ts +2 -0
- package/dist/src/harness/hitl/approval-prompt.js +3 -2
- package/dist/src/harness/instrumentation/content-policy.d.ts +3 -2
- package/dist/src/harness/instrumentation/content-policy.js +1 -1
- package/dist/src/harness/instrumentation/content.d.ts +11 -0
- package/dist/src/harness/instrumentation/content.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/internal/application/compiled-artifacts.d.ts +7 -7
- package/dist/src/internal/application/compiled-artifacts.js +6 -5
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-asset-import-plugin.d.ts +6 -2
- package/dist/src/internal/authored-asset-import-plugin.js +1 -1
- package/dist/src/internal/authored-module-loader.js +3 -3
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +15 -0
- package/dist/src/internal/authored-runtime-modules.js +1 -0
- package/dist/src/internal/materialized-authored-modules.d.ts +2 -18
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-timeouts.d.ts +7 -0
- package/dist/src/internal/workflow/local-world-delivery-timeouts.js +1 -0
- package/dist/src/public/channels/slack/inbound-content.js +2 -2
- package/dist/src/public/instrumentation/otel.d.ts +1 -1
- package/dist/src/public/memory/file/backend.d.ts +37 -0
- package/dist/src/public/memory/file/backend.js +1 -0
- package/dist/src/public/memory/file/backends/default.d.ts +7 -0
- package/dist/src/public/memory/file/backends/default.js +1 -0
- package/dist/src/public/memory/file/backends/in-memory.d.ts +6 -0
- package/dist/src/public/memory/file/backends/in-memory.js +1 -0
- package/dist/src/public/memory/file/backends/lazy.d.ts +3 -0
- package/dist/src/public/memory/file/backends/lazy.js +1 -0
- package/dist/src/public/memory/file/backends/vercel-blob.d.ts +14 -0
- package/dist/src/public/memory/file/backends/vercel-blob.js +1 -0
- package/dist/src/public/memory/file/index.d.ts +3 -0
- package/dist/src/public/memory/file/index.js +1 -0
- package/dist/src/public/memory/file/provider.d.ts +14 -0
- package/dist/src/public/memory/file/provider.js +6 -0
- package/dist/src/public/memory/file/vercel.d.ts +1 -0
- package/dist/src/public/memory/file/vercel.js +1 -0
- package/dist/src/setup/integrations/linq/connect.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/instrumentation-content.d.ts +6 -0
- package/dist/src/shared/instrumentation-content.js +1 -0
- package/dist/src/shared/instrumentation-decision.d.ts +8 -0
- package/dist/src/shared/instrumentation-decision.js +1 -0
- package/dist/src/tracing/agent-trace-context-store.d.ts +3 -3
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +14 -3
- package/dist/src/tracing/sampled-trace.d.ts +8 -1
- package/dist/src/tracing/sampled-trace.js +1 -1
- package/docs/agent-config.md +2 -0
- package/docs/channels/slack.mdx +2 -0
- package/docs/guides/dynamic-capabilities.md +2 -0
- package/docs/instructions.mdx +3 -1
- package/docs/memory.md +69 -4
- package/docs/reference/typescript-api.md +30 -0
- package/docs/schedules.mdx +2 -0
- package/docs/skills.mdx +2 -0
- package/package.json +12 -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.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CompiledChannelDefinition, CompiledChannelRoutePlan } from "#compiler/manifest.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentModuleBinding, AgentSourceDescriptor } from "#compiler/source-graph.js";
|
|
3
3
|
import { type CompilerDiagnostic } from "#compiler/diagnostics.js";
|
|
4
4
|
export declare function createCompiledChannelRoutePlan(input: {
|
|
5
|
-
readonly bindings: Readonly<Record<string,
|
|
5
|
+
readonly bindings: Readonly<Record<string, AgentModuleBinding>>;
|
|
6
6
|
readonly channels: readonly CompiledChannelDefinition[];
|
|
7
7
|
readonly diagnostics?: CompilerDiagnostic[];
|
|
8
8
|
readonly nodeId: string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompiledAgentDefinition } from "#compiler/manifest.js";
|
|
2
|
+
import type { FinalizedNodeSourceState } from "#compiler/node-source-state.js";
|
|
3
|
+
export declare function assertInstrumentationLayoutConfig(config: CompiledAgentDefinition, state: FinalizedNodeSourceState): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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{assertInstrumentationLayoutConfig};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AgentModuleBinding, type AgentSourceRegistry, type ProgrammaticModuleNamespace } from "#compiler/source-graph.js";
|
|
2
2
|
export type CompiledBindingNamespaceLoader = (sourceId: string) => Promise<ProgrammaticModuleNamespace>;
|
|
3
3
|
/** Loads one node's selected bindings with dependency ordering and per-phase caching. */
|
|
4
4
|
export declare function createCompiledBindingNamespaceLoader(input: {
|
|
5
|
-
readonly bindings
|
|
5
|
+
readonly bindings?: Readonly<Record<string, AgentModuleBinding>>;
|
|
6
|
+
readonly onLoad?: (sourceId: string) => void;
|
|
6
7
|
readonly registries: readonly AgentSourceRegistry[];
|
|
8
|
+
readonly resolveBinding?: (sourceId: string) => AgentModuleBinding | undefined;
|
|
7
9
|
}): CompiledBindingNamespaceLoader;
|
|
8
10
|
/** Derives the stable package-owned scope used while loading an extension module. */
|
|
9
|
-
export declare function resolveCompiledModuleExtensionScopeNamespace(binding:
|
|
11
|
+
export declare function resolveCompiledModuleExtensionScopeNamespace(binding: AgentModuleBinding): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
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};
|
|
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){if(e.bindings===void 0&&e.resolveBinding===void 0)throw Error(`Compiled binding namespace loader requires a binding source.`);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.resolveBinding?.(r)??e.bindings?.[r];if(o===void 0)throw Error(`Compiled binding dependency "${r}" is missing.`);e.onLoad?.(r);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};
|
|
@@ -22,7 +22,7 @@ export declare const ROOT_COMPILED_AGENT_NODE_ID = "__root__";
|
|
|
22
22
|
/**
|
|
23
23
|
* Current compiled manifest schema version.
|
|
24
24
|
*/
|
|
25
|
-
export declare const COMPILED_AGENT_MANIFEST_VERSION =
|
|
25
|
+
export declare const COMPILED_AGENT_MANIFEST_VERSION = 44;
|
|
26
26
|
/**
|
|
27
27
|
* Compiled channel entry preserved in the compiled manifest.
|
|
28
28
|
*/
|
|
@@ -719,7 +719,7 @@ export declare const compiledAgentManifestSchema: z.ZodObject<{
|
|
|
719
719
|
sourceId: z.ZodString;
|
|
720
720
|
sourceKind: z.ZodLiteral<"module">;
|
|
721
721
|
}, z.core.$strict>>;
|
|
722
|
-
version: z.ZodLiteral<
|
|
722
|
+
version: z.ZodLiteral<44>;
|
|
723
723
|
workspaceResourceRoot: z.ZodObject<{
|
|
724
724
|
contentHash: z.ZodOptional<z.ZodString>;
|
|
725
725
|
logicalPath: z.ZodString;
|
|
@@ -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(),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};
|
|
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=44,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,usage:z.object({compile:z.boolean(),runtimeEntry:z.boolean()}).strict()}).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(44),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:44};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
|
|
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};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentModuleBinding, AgentSourceRegistry, CompiledModuleBinding } from "#compiler/source-graph.js";
|
|
2
|
+
import type { CompiledAgentDefinition } from "#compiler/manifest.js";
|
|
3
|
+
import { type CompiledBindingNamespaceLoader } from "#compiler/load-binding-namespace.js";
|
|
4
|
+
/** Owns namespace loading and lifecycle decisions for one node compilation. */
|
|
5
|
+
export declare class NodeModuleEvaluationContext {
|
|
6
|
+
#private;
|
|
7
|
+
readonly loadNamespace: CompiledBindingNamespaceLoader;
|
|
8
|
+
constructor(registries: readonly AgentSourceRegistry[]);
|
|
9
|
+
setBindings(bindings: Readonly<Record<string, AgentModuleBinding>>): void;
|
|
10
|
+
requireRuntimeEntry(sourceId: string): void;
|
|
11
|
+
finalizeBindings(): Record<string, CompiledModuleBinding>;
|
|
12
|
+
}
|
|
13
|
+
/** Marks authored config namespaces whose values must be resolved by the runtime. */
|
|
14
|
+
export declare function markConfigRuntimeEntries(config: CompiledAgentDefinition, evaluation: NodeModuleEvaluationContext): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";var NodeModuleEvaluationContext=class{#e={};#t=new NodeModuleLifecycle;loadNamespace;constructor(t){this.loadNamespace=createCompiledBindingNamespaceLoader({onLoad:e=>this.#t.recordCompileLoad(e),registries:t,resolveBinding:e=>this.#e[e]})}setBindings(e){this.#e=e}requireRuntimeEntry(e){this.#t.requireRuntimeEntry(e)}finalizeBindings(){return this.#t.finalize(this.#e)}};function markConfigRuntimeEntries(e,t){let n=[e.dynamicModel,e.model?.source,e.compaction?.model?.source];for(let e of n)e!==void 0&&t.requireRuntimeEntry(e.sourceId)}var NodeModuleLifecycle=class{#e=new Set;#t=new Set;recordCompileLoad(e){this.#e.add(e)}requireRuntimeEntry(e){this.#t.add(e)}finalize(e){let t=collectRuntimeEntryClosure(e,this.#t),n={};for(let[r,i]of Object.entries(e)){let e={compile:this.#e.has(r),runtimeEntry:t.has(r)};if(!e.compile&&!e.runtimeEntry)throw Error(`Selected module binding "${r}" has no compile or runtime usage.`);n[r]=Object.freeze({...i,usage:Object.freeze(e)})}return n}};function collectRuntimeEntryClosure(e,t){let n=new Set,r=new Set,visit=t=>{if(n.has(t))return;if(r.has(t))throw Error(`Compiled module dependency cycle includes "${t}".`);let i=e[t];if(i===void 0)throw Error(`Runtime module entry "${t}" has no selected binding.`);if(r.add(t),i.backing.kind===`programmatic`)for(let e of Object.values(i.backing.dependencies??{}))visit(e);r.delete(t),n.add(t)};for(let e of t)visit(e);return n}export{NodeModuleEvaluationContext,markConfigRuntimeEntries};
|
|
@@ -26,5 +26,5 @@ interface BoundModule {
|
|
|
26
26
|
export declare function createCompiledModuleMapSource(input: CreateCompiledModuleMapSourceInput): string;
|
|
27
27
|
/** Loads the same binding set used by generated maps without fabricating descriptors. */
|
|
28
28
|
export declare function createProgrammaticCompiledModuleMap(manifest: CompiledAgentManifest, registries: readonly AgentSourceRegistry[]): Promise<CompiledModuleMap>;
|
|
29
|
-
/** Returns
|
|
30
|
-
export declare function
|
|
29
|
+
/** Returns one compiled node's finalized runtime entries, including remote config modules. */
|
|
30
|
+
export declare function collectRuntimeModuleBindingsForManifest(manifest: CompiledAgentNodeManifest | CompiledAgentResources): readonly BoundModule[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
`)}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
|
|
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 collectRuntimeModuleBindingsForManifest(e){let t=new Map(Object.entries(e.bindings).filter(([,e])=>e.usage.runtimeEntry));for(let n of e.remoteAgents)if(n.binding.usage.runtimeEntry){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:collectRuntimeModuleBindingsForManifest(e),nodeId:ROOT_COMPILED_AGENT_NODE_ID},...[...e.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>({modules:collectRuntimeModuleBindingsForManifest(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(`
|
|
5
|
-
`)}function createImportSpecifier(e){if(e.importSpecifierStyle===`absolute`)return normalizeEsmImportSpecifier(normalizeFilesystemPath(e.targetPath));let t=relativeFilesystemPath(e.fromDirectory,e.targetPath);return t.startsWith(`.`)?t:`./${t}`}function dirnameFilesystemPath(e){let t=splitFilesystemPath(e);return t.segments.length===0?t.root.length===0?`.`:t.root:createFilesystemPath(t.root,t.segments.slice(0,-1))}function relativeFilesystemPath(e,t){let n=splitFilesystemPath(e),r=splitFilesystemPath(t);if(n.root!==r.root)return normalizeFilesystemPath(t);let i=0;for(;i<n.segments.length&&i<r.segments.length&&n.segments[i]===r.segments[i];)i+=1;return[...Array.from({length:n.segments.length-i},()=>`..`),...r.segments.slice(i)].join(`/`)||`.`}function normalizeFilesystemPath(e){let t=splitFilesystemPath(e);return createFilesystemPath(t.root,t.segments)}function splitFilesystemPath(e){let t=e.replaceAll(`\\`,`/`),n=``,r=t,i=t.match(/^[A-Za-z]:/);i===null?t.startsWith(`/`)&&(n=`/`,r=t.slice(1)):(n=i[0],r=t.slice(n.length),r.startsWith(`/`)&&(n+=`/`,r=r.slice(1)));let a=[];for(let e of r.split(`/`))e.length===0||e===`.`||(e===`..`?a.length>0&&a.at(-1)!==`..`?a.pop():n.length===0&&a.push(e):a.push(e));return{root:n,segments:a}}function createFilesystemPath(e,t){return e===`/`?t.length===0?`/`:`/${t.join(`/`)}`:e.endsWith(`/`)?t.length===0?e:`${e}${t.join(`/`)}`:e.length>0?t.length===0?e:`${e}/${t.join(`/`)}`:t.length===0?`.`:t.join(`/`)}export{
|
|
5
|
+
`)}function createImportSpecifier(e){if(e.importSpecifierStyle===`absolute`)return normalizeEsmImportSpecifier(normalizeFilesystemPath(e.targetPath));let t=relativeFilesystemPath(e.fromDirectory,e.targetPath);return t.startsWith(`.`)?t:`./${t}`}function dirnameFilesystemPath(e){let t=splitFilesystemPath(e);return t.segments.length===0?t.root.length===0?`.`:t.root:createFilesystemPath(t.root,t.segments.slice(0,-1))}function relativeFilesystemPath(e,t){let n=splitFilesystemPath(e),r=splitFilesystemPath(t);if(n.root!==r.root)return normalizeFilesystemPath(t);let i=0;for(;i<n.segments.length&&i<r.segments.length&&n.segments[i]===r.segments[i];)i+=1;return[...Array.from({length:n.segments.length-i},()=>`..`),...r.segments.slice(i)].join(`/`)||`.`}function normalizeFilesystemPath(e){let t=splitFilesystemPath(e);return createFilesystemPath(t.root,t.segments)}function splitFilesystemPath(e){let t=e.replaceAll(`\\`,`/`),n=``,r=t,i=t.match(/^[A-Za-z]:/);i===null?t.startsWith(`/`)&&(n=`/`,r=t.slice(1)):(n=i[0],r=t.slice(n.length),r.startsWith(`/`)&&(n+=`/`,r=r.slice(1)));let a=[];for(let e of r.split(`/`))e.length===0||e===`.`||(e===`..`?a.length>0&&a.at(-1)!==`..`?a.pop():n.length===0&&a.push(e):a.push(e));return{root:n,segments:a}}function createFilesystemPath(e,t){return e===`/`?t.length===0?`/`:`/${t.join(`/`)}`:e.endsWith(`/`)?t.length===0?e:`${e}${t.join(`/`)}`:e.length>0?t.length===0?e:`${e}/${t.join(`/`)}`:t.length===0?`.`:t.join(`/`)}export{collectRuntimeModuleBindingsForManifest,compiledModuleMapSchema,createCompiledModuleMapSource,createProgrammaticCompiledModuleMap,resolveCompiledModuleExtensionScopeNamespace};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
2
2
|
import type { ProjectedAgentSources, ProjectedSource, ProjectedSubagentSource } from "#compiler/project-sources.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type AgentModuleBinding, type AgentModuleCandidate, type AgentSourceCandidate, type ComposedAgentModuleCandidates } from "#compiler/source-graph.js";
|
|
4
|
+
import type { NodeModuleEvaluationContext } from "#compiler/module-lifecycle.js";
|
|
4
5
|
export interface ComposedNodeSourceGraph {
|
|
5
6
|
composed: ComposedAgentModuleCandidates;
|
|
6
7
|
readonly orderedCandidates: readonly AgentSourceCandidate[];
|
|
@@ -9,16 +10,18 @@ export interface ComposedNodeSourceGraph {
|
|
|
9
10
|
readonly subagentsBySourceId: ReadonlyMap<string, ProjectedSubagentSource>;
|
|
10
11
|
}
|
|
11
12
|
export interface SelectedNodeConfig {
|
|
12
|
-
readonly binding:
|
|
13
|
+
readonly binding: AgentModuleBinding;
|
|
13
14
|
readonly candidate: AgentModuleCandidate;
|
|
14
15
|
readonly definition: unknown;
|
|
15
16
|
readonly source: ModuleSourceRef;
|
|
16
17
|
}
|
|
17
18
|
export interface PhaseOneNodeSourceState {
|
|
19
|
+
readonly evaluation: NodeModuleEvaluationContext;
|
|
18
20
|
readonly graph: ComposedNodeSourceGraph;
|
|
19
21
|
readonly selectedConfig: SelectedNodeConfig;
|
|
20
22
|
}
|
|
21
23
|
export interface FinalizedNodeSourceState extends ComposedNodeSourceGraph {
|
|
22
|
-
readonly bindings: Record<string,
|
|
24
|
+
readonly bindings: Record<string, AgentModuleBinding>;
|
|
25
|
+
readonly evaluation: NodeModuleEvaluationContext;
|
|
23
26
|
}
|
|
24
27
|
export declare function finalizeNodeSourceState(phaseOne: PhaseOneNodeSourceState, externalDependencies: readonly string[]): FinalizedNodeSourceState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createAgentModuleBinding}from"#compiler/source-graph.js";import{collectSelectedSourceIds,mergeExternalDependencies}from"#compiler/normalize-manifest-helpers.js";function finalizeNodeSourceState(n,r){let i=n.graph,a=new Map(i.orderedCandidates.map(e=>{let t=finalizeCandidateExternalDependencies(e,r);return[e.sourceId,t]})),candidateFor=e=>{let t=a.get(e.sourceId);if(t===void 0)throw Error(`Agent source candidate "${e.sourceId}" is missing from its node.`);return t},o={candidates:i.projected.candidates.map(candidateFor),resources:i.projected.resources.map(e=>({...e,candidate:candidateFor(e.candidate)})),subagents:i.projected.subagents.map(e=>({...e,candidate:candidateFor(e.candidate)}))},s={composition:{entries:i.composed.composition.entries.map(e=>({...e,source:finalizeDescriptorExternalDependencies(e.source,r)}))},selected:new Map([...i.composed.selected].map(([e,t])=>[e,candidateFor(t)]))},c=collectSelectedSourceIds(s),l=Object.fromEntries([...a.values()].filter(e=>c.has(e.sourceId)&&e.backing.kind!==`resource`).map(t=>[t.sourceId,createAgentModuleBinding(t)]));return n.evaluation.setBindings(l),{bindings:l,composed:s,orderedCandidates:i.orderedCandidates.map(candidateFor),projected:o,sourcesBySourceId:new Map([...i.sourcesBySourceId].map(([e,t])=>[e,{...t,candidate:candidateFor(t.candidate)}])),subagentsBySourceId:new Map(o.subagents.map(e=>[e.candidate.sourceId,e])),evaluation:n.evaluation}}function finalizeCandidateExternalDependencies(e,t){return e.backing.kind===`filesystem`?{...e,backing:finalizeBackingExternalDependencies(e.backing,t)}:e}function finalizeDescriptorExternalDependencies(e,t){return e.backing.kind===`filesystem`?{...e,backing:finalizeBackingExternalDependencies(e.backing,t)}:e}function finalizeBackingExternalDependencies(e,t){return{...e,externalDependencies:mergeExternalDependencies(t,e.externalDependencies)}}export{finalizeNodeSourceState};
|
|
@@ -2,13 +2,13 @@ import type { AgentSourceManifest } from "#discover/manifest.js";
|
|
|
2
2
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
3
3
|
import type { CompiledAgentDefinition } from "#compiler/manifest.js";
|
|
4
4
|
import { type ManifestCompileContext } from "#compiler/normalize-helpers.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { AgentModuleBinding } from "#compiler/source-graph.js";
|
|
6
6
|
/**
|
|
7
7
|
* Compiles the agent-level configuration (model, compaction, build,
|
|
8
8
|
* workspace) for one authored agent node.
|
|
9
9
|
*/
|
|
10
10
|
export declare function compileAgentConfig(manifest: AgentSourceManifest, context: ManifestCompileContext, options: {
|
|
11
|
-
readonly binding:
|
|
11
|
+
readonly binding: AgentModuleBinding;
|
|
12
12
|
readonly definition?: unknown;
|
|
13
13
|
readonly source: ModuleSourceRef;
|
|
14
14
|
}): Promise<CompiledAgentDefinition>;
|
|
@@ -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
|
|
3
|
+
import { type AgentModuleBinding, type AgentSourceRegistry, 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
|
|
@@ -15,11 +15,11 @@ export interface ManifestCompileContext {
|
|
|
15
15
|
readonly registries: readonly AgentSourceRegistry[];
|
|
16
16
|
}
|
|
17
17
|
export interface ModuleBackedDefinitionLoadOptions {
|
|
18
|
-
readonly binding:
|
|
18
|
+
readonly binding: AgentModuleBinding;
|
|
19
19
|
readonly loadNamespace: CompiledBindingNamespaceLoader;
|
|
20
20
|
}
|
|
21
21
|
export interface SourceDefinitionCompileOptions {
|
|
22
|
-
readonly binding?:
|
|
22
|
+
readonly binding?: AgentModuleBinding;
|
|
23
23
|
readonly loadNamespace?: CompiledBindingNamespaceLoader;
|
|
24
24
|
readonly owner: AgentSourceOwner;
|
|
25
25
|
}
|
|
@@ -34,7 +34,7 @@ export declare function requireModuleBackedDefinitionLoadOptions(options: Source
|
|
|
34
34
|
* authored file failed.
|
|
35
35
|
*/
|
|
36
36
|
export declare function loadModuleBackedDefinition(input: {
|
|
37
|
-
readonly binding:
|
|
37
|
+
readonly binding: AgentModuleBinding;
|
|
38
38
|
readonly dependencyNamespaces?: Readonly<Record<string, ProgrammaticModuleNamespace>>;
|
|
39
39
|
readonly displayPath?: string;
|
|
40
40
|
readonly kind: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{posix}from"node:path";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{canonicalSourceSlot}from"#compiler/source-graph.js";import{mountRefNamespace,packageStateNamespace}from"#discover/extensions.js";import"#compiler/normalize-subagent.js";function collectSelectedSourceIds(e){return new Set([...e.selected.values()].map(e=>e.sourceId))}function assertRootOnlyConfig(e,t,n){if(!t){if(e.experimental?.workflow!==void 0)throw Error(`Workflow runtime configuration is only supported on the root agent config. Remove "experimental.workflow" from "${n}".`);if(e.experimental?.tasks!==void 0)throw Error(`Background tasks are only supported on the root agent config. Remove "experimental.tasks" from "${n}".`)}}function assertApplicationOverlayCanApplyToAllNodes(e){let t=e.find(e=>{let t=canonicalSourceSlot(e);return t===`agent`||t.startsWith(`channels/`)||t.startsWith(`schedules/`)||t.startsWith(`subagents/`)||t.startsWith(`extensions/`)});if(t!==void 0)throw Error(`Application programmatic source registered for all local nodes cannot declare "${t}".`)}function assertUniqueRegistryIds(e){let t=new Set;for(let n of e)for(let e of n.sources.keys()){if(t.has(e))throw Error(`Programmatic agent source id "${e}" is registered more than once.`);t.add(e)}}function assertRootOwnedSpecialTool(e,n){if(e.nodeId!==ROOT_COMPILED_AGENT_NODE_ID)throw Error(`${n} can only be enabled on the root agent.`);assertNonExtensionSpecialTool(e,n)}function assertNonExtensionSpecialTool(e,t){if(e.owner.kind===`extension`)throw Error(`${t} cannot be configured by an extension source.`)}function withExtensionNamespace(e,t){return t.kind===`extension`?{...e,extensionNamespace:t.namespace}:e}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw Error(`Compiled ${n} "${e}" is declared more than once.`);r.add(e)}}function expectSubagentDescription(e,t){if(e.description===void 0||e.description.trim().length===0)throw Error(`Subagent "${t.logicalPath}" must define a non-empty description.`);return e.description}function createCompiledRemoteAgent(t){let n=t.source.logicalPath.endsWith(`.ts`)||t.source.logicalPath.endsWith(`.js`)?t.source.logicalPath:posix.join(t.source.logicalPath,`agent.ts`),r=t.source.sourceId,i={backing:t.binding.backing,logicalPath:n,owner:t.owner},a={backing:{kind:`resource`,sourcePath:t.source.entryPath},binding:i,description:t.definition.description,entryPath:t.source.entryPath,logicalPath:n,name:t.source.subagentId,nodeId:t.nodeId,owner:t.owner,parentNodeId:t.parentNodeId,path:t.definition.path,rootPath:t.source.rootPath,sourceId:r,sourceKind:`module`};return t.sourceRef.exportName!==void 0&&Object.assign(a,{exportName:t.sourceRef.exportName}),t.definition.outputSchema!==void 0&&Object.assign(a,{outputSchema:t.definition.outputSchema}),t.definition.url!==void 0&&Object.assign(a,{url:t.definition.url}),a}function compileExtensionMounts(e,t){let n=collectSelectedSourceIds(t);return e.resolvedExtensions.flatMap(t=>{let a=e.extensions.find(e=>mountRefNamespace(e.logicalPath)===t.namespace);return a===void 0||!n.has(a.sourceId)?[]:[{externalDependencies:[...t.externalDependencies],mountLogicalPath:a.logicalPath,mountSourceId:a.sourceId,namespace:t.namespace,packageName:t.packageName,packageNamespace:packageStateNamespace(t.packageName),sourceRoot:t.sourceRoot}]})}function mergeExternalDependencies(...e){return[...new Set(e.flatMap(e=>e??[]))]}export{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace};
|
|
1
|
+
import{posix}from"node:path";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{canonicalSourceSlot}from"#compiler/source-graph.js";import{mountRefNamespace,packageStateNamespace}from"#discover/extensions.js";import"#compiler/normalize-subagent.js";function collectSelectedSourceIds(e){return new Set([...e.selected.values()].map(e=>e.sourceId))}function assertRootOnlyConfig(e,t,n){if(!t){if(e.experimental?.workflow!==void 0)throw Error(`Workflow runtime configuration is only supported on the root agent config. Remove "experimental.workflow" from "${n}".`);if(e.experimental?.tasks!==void 0)throw Error(`Background tasks are only supported on the root agent config. Remove "experimental.tasks" from "${n}".`)}}function assertApplicationOverlayCanApplyToAllNodes(e){let t=e.find(e=>{let t=canonicalSourceSlot(e);return t===`agent`||t.startsWith(`channels/`)||t.startsWith(`schedules/`)||t.startsWith(`subagents/`)||t.startsWith(`extensions/`)});if(t!==void 0)throw Error(`Application programmatic source registered for all local nodes cannot declare "${t}".`)}function assertUniqueRegistryIds(e){let t=new Set;for(let n of e)for(let e of n.sources.keys()){if(t.has(e))throw Error(`Programmatic agent source id "${e}" is registered more than once.`);t.add(e)}}function assertRootOwnedSpecialTool(e,n){if(e.nodeId!==ROOT_COMPILED_AGENT_NODE_ID)throw Error(`${n} can only be enabled on the root agent.`);assertNonExtensionSpecialTool(e,n)}function assertNonExtensionSpecialTool(e,t){if(e.owner.kind===`extension`)throw Error(`${t} cannot be configured by an extension source.`)}function withExtensionNamespace(e,t){return t.kind===`extension`?{...e,extensionNamespace:t.namespace}:e}function assertUniqueBy(e,t,n){let r=new Set;for(let i of e){let e=t(i);if(r.has(e))throw Error(`Compiled ${n} "${e}" is declared more than once.`);r.add(e)}}function expectSubagentDescription(e,t){if(e.description===void 0||e.description.trim().length===0)throw Error(`Subagent "${t.logicalPath}" must define a non-empty description.`);return e.description}function createCompiledRemoteAgent(t){let n=t.source.logicalPath.endsWith(`.ts`)||t.source.logicalPath.endsWith(`.js`)?t.source.logicalPath:posix.join(t.source.logicalPath,`agent.ts`),r=t.source.sourceId,i={backing:t.binding.backing,logicalPath:n,owner:t.owner,usage:t.binding.usage},a={backing:{kind:`resource`,sourcePath:t.source.entryPath},binding:i,description:t.definition.description,entryPath:t.source.entryPath,logicalPath:n,name:t.source.subagentId,nodeId:t.nodeId,owner:t.owner,parentNodeId:t.parentNodeId,path:t.definition.path,rootPath:t.source.rootPath,sourceId:r,sourceKind:`module`};return t.sourceRef.exportName!==void 0&&Object.assign(a,{exportName:t.sourceRef.exportName}),t.definition.outputSchema!==void 0&&Object.assign(a,{outputSchema:t.definition.outputSchema}),t.definition.url!==void 0&&Object.assign(a,{url:t.definition.url}),a}function compileExtensionMounts(e,t){let n=collectSelectedSourceIds(t);return e.resolvedExtensions.flatMap(t=>{let a=e.extensions.find(e=>mountRefNamespace(e.logicalPath)===t.namespace);return a===void 0||!n.has(a.sourceId)?[]:[{externalDependencies:[...t.externalDependencies],mountLogicalPath:a.logicalPath,mountSourceId:a.sourceId,namespace:t.namespace,packageName:t.packageName,packageNamespace:packageStateNamespace(t.packageName),sourceRoot:t.sourceRoot}]})}function mergeExternalDependencies(...e){return[...new Set(e.flatMap(e=>e??[]))]}export{assertApplicationOverlayCanApplyToAllNodes,assertNonExtensionSpecialTool,assertRootOnlyConfig,assertRootOwnedSpecialTool,assertUniqueBy,assertUniqueRegistryIds,collectSelectedSourceIds,compileExtensionMounts,createCompiledRemoteAgent,expectSubagentDescription,mergeExternalDependencies,withExtensionNamespace};
|