veryfront 0.1.1202 → 0.1.1204
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/esm/cli/shared/deployment/deploy-project.d.ts.map +1 -1
- package/esm/cli/shared/deployment/deploy-project.js +17 -4
- package/esm/deno.js +1 -1
- package/esm/src/agent/factory.d.ts.map +1 -1
- package/esm/src/agent/factory.js +217 -133
- package/esm/src/config/declarative-evaluator.d.ts.map +1 -1
- package/esm/src/config/declarative-evaluator.js +8 -0
- package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
- package/esm/src/html/styles-builder/css-import-extraction.d.ts +15 -1
- package/esm/src/html/styles-builder/css-import-extraction.d.ts.map +1 -1
- package/esm/src/html/styles-builder/css-import-extraction.js +29 -4
- package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
- package/esm/src/release-assets/build-executor.d.ts.map +1 -1
- package/esm/src/release-assets/build-executor.js +30 -22
- package/esm/src/release-assets/index.d.ts +1 -1
- package/esm/src/release-assets/index.d.ts.map +1 -1
- package/esm/src/release-assets/index.js +1 -1
- package/esm/src/release-assets/manifest-schema.d.ts +14 -0
- package/esm/src/release-assets/manifest-schema.d.ts.map +1 -1
- package/esm/src/release-assets/manifest-schema.js +41 -0
- package/esm/src/server/runtime-handler/adapter-factory.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/adapter-factory.js +72 -13
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-project.d.ts","sourceRoot":"","sources":["../../../../src/cli/shared/deployment/deploy-project.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy-project.d.ts","sourceRoot":"","sources":["../../../../src/cli/shared/deployment/deploy-project.ts"],"names":[],"mappings":"AAKA,OAAO,EAKL,KAAK,iCAAiC,EAGvC,MAAM,sCAAsC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, relative, resolve } from "../../../src/platform/compat/path/index.js";
|
|
4
4
|
import { isWithinDirectory, normalizePath } from "../../../src/utils/index.js";
|
|
5
5
|
import { parseProjectDomain } from "../../../src/server/index.js";
|
|
6
|
-
import { isSafeBoundedText, parseReadyReleaseAssetManifestResponse, readUntrustedOwnDataProperty, routeForPage, } from "../../../src/release-assets/index.js";
|
|
6
|
+
import { describeReadyReleaseAssetManifestRejection, isSafeBoundedText, parseReadyReleaseAssetManifestResponse, readUntrustedOwnDataProperty, routeForPage, } from "../../../src/release-assets/index.js";
|
|
7
7
|
import { DEPLOYMENT_ERROR, ENVIRONMENT_NOT_FOUND, RELEASE_MISSING_VERSION, SOURCE_DIGEST_MISMATCH, VeryfrontError, } from "../../../src/errors/index.js";
|
|
8
8
|
import { computeSourceDigest, PUSH_RECEIPT_RELATIVE_PATH, readPushReceipt, resolveGitSource, validatePushReceipt, } from "../deployment-provenance.js";
|
|
9
9
|
import { normalizeProjectSlug } from "../slug.js";
|
|
@@ -375,16 +375,29 @@ export async function waitForReleaseAssetManifest(controlPlane, projectSlug, rel
|
|
|
375
375
|
if (state === "ready") {
|
|
376
376
|
const result = parseReadyReleaseAssetManifestResponse(raw, releaseId);
|
|
377
377
|
if (!result) {
|
|
378
|
-
|
|
378
|
+
// Naming the failing check matters: a schema mismatch is fixed by
|
|
379
|
+
// deploying a matching framework build, while "rebuild the assets"
|
|
380
|
+
// sends the operator to rebuild against the same mismatched builder.
|
|
381
|
+
const reason = describeReadyReleaseAssetManifestRejection(raw, releaseId);
|
|
382
|
+
throw DEPLOYMENT_ERROR.create({
|
|
383
|
+
detail: `Release assets for ${releaseId} could not be read: ${reason}.`,
|
|
384
|
+
context: { releaseId },
|
|
385
|
+
});
|
|
379
386
|
}
|
|
380
387
|
assertReadyManifestCoversPageRoutes(releaseId, result, expectedRoutes);
|
|
381
388
|
return result;
|
|
382
389
|
}
|
|
383
390
|
if (state === "partial") {
|
|
384
|
-
throw
|
|
391
|
+
throw DEPLOYMENT_ERROR.create({
|
|
392
|
+
detail: `Release asset build produced an unsupported partial manifest for release ${releaseId}.`,
|
|
393
|
+
context: { releaseId },
|
|
394
|
+
});
|
|
385
395
|
}
|
|
386
396
|
if (state === "failed") {
|
|
387
|
-
throw
|
|
397
|
+
throw DEPLOYMENT_ERROR.create({
|
|
398
|
+
detail: `Release asset build failed for release ${releaseId}.`,
|
|
399
|
+
context: { releaseId },
|
|
400
|
+
});
|
|
388
401
|
}
|
|
389
402
|
if (state === "superseded") {
|
|
390
403
|
throw new Error(`Release assets for ${releaseId} were superseded by a newer build. Run deploy again.`);
|
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,eAAe,EAKhB,MAAM,YAAY,CAAC;AAqXpB,oBAAoB;AACpB,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAyEhD;AAcD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC,GACnD,eAAe,EAAE,CAanB"}
|
package/esm/src/agent/factory.js
CHANGED
|
@@ -88,142 +88,22 @@ function createAgentStreamResult(stream) {
|
|
|
88
88
|
},
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const resolveSkillSnapshot = () => skillRegistryInternal.resolveSelectorForAgent(skillsConfig, { agentId: id });
|
|
104
|
-
if (Array.isArray(skillsConfig) && skillsConfig.length > 0) {
|
|
105
|
-
resolveSkillSnapshot();
|
|
106
|
-
}
|
|
107
|
-
const publicConfig = {
|
|
108
|
-
...config,
|
|
109
|
-
...(delegates === undefined ? {} : { delegates }),
|
|
110
|
-
model: resolveConfiguredAgentModel(config.model),
|
|
111
|
-
};
|
|
112
|
-
if (config.tools && config.tools !== true) {
|
|
113
|
-
for (const [name, entry] of Object.entries(config.tools)) {
|
|
114
|
-
if (!entry || typeof entry !== "object")
|
|
115
|
-
continue;
|
|
116
|
-
assertLocalToolId(name);
|
|
117
|
-
assertLocalToolId(entry.id);
|
|
118
|
-
if (isRuntimeLocalTool(entry))
|
|
119
|
-
continue;
|
|
120
|
-
const normalizedTool = entry.id === name ? entry : { ...entry, id: name };
|
|
121
|
-
registerTool(normalizedTool.id, normalizedTool);
|
|
122
|
-
config.tools[name] = normalizedTool;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// Skill tools are framework infrastructure shared by skill-enabled agents.
|
|
126
|
-
// Project skills remain project-scoped and owner-aware at resolution time.
|
|
127
|
-
let mergedToolsConfig = config.tools;
|
|
128
|
-
const shouldExposeSkillTools = !isExplicitNoneSkillSelector(config.skills);
|
|
129
|
-
ensureBuiltinSchemaValidator();
|
|
130
|
-
for (const registration of SKILL_TOOL_REGISTRATIONS) {
|
|
131
|
-
if (!toolRegistry.has(registration.id)) {
|
|
132
|
-
toolRegistryInternal.registerShared(registration.id, registration.create());
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (config.tools !== true) {
|
|
136
|
-
const configuredTools = { ...(config.tools ?? {}) };
|
|
137
|
-
for (const registration of SKILL_TOOL_REGISTRATIONS) {
|
|
138
|
-
if (!shouldExposeSkillTools) {
|
|
139
|
-
delete configuredTools[registration.id];
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
const configuredTool = configuredTools[registration.id];
|
|
143
|
-
if (typeof configuredTool === "object" && configuredTool !== null) {
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
configuredTools[registration.id] = registration.create({
|
|
147
|
-
resolveAllowedSkillIds: () => resolveSkillSnapshot().allowedSkillIds,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
const hasConfiguredTools = Object.keys(configuredTools).length > 0;
|
|
151
|
-
mergedToolsConfig = hasConfiguredTools || config.tools !== undefined
|
|
152
|
-
? configuredTools
|
|
153
|
-
: undefined;
|
|
154
|
-
}
|
|
155
|
-
if (delegates?.length) {
|
|
156
|
-
if (mergedToolsConfig === true) {
|
|
157
|
-
throw INVALID_ARGUMENT.create({
|
|
158
|
-
detail: `Agent "${id}" cannot combine delegates with tools: true. ` +
|
|
159
|
-
"Declare the required tools by name so delegate capabilities remain explicit.",
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
mergedToolsConfig = {
|
|
163
|
-
...(mergedToolsConfig ?? {}),
|
|
164
|
-
...buildAgentDelegateTools({ delegates, selfId: id }),
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
// Call context assembled at invocation time so registry-backed skills pick up
|
|
168
|
-
// HMR changes and host-supplied project/environment facts stay current.
|
|
169
|
-
const originalSystem = config.system;
|
|
170
|
-
const configuredToolNames = mergedToolsConfig === true
|
|
171
|
-
? [
|
|
172
|
-
"form_input",
|
|
173
|
-
...(shouldExposeSkillTools ? ["load_skill"] : []),
|
|
174
|
-
"tool_search",
|
|
175
|
-
...(config.providerTools ?? []),
|
|
176
|
-
].sort()
|
|
177
|
-
: mergedToolsConfig === undefined
|
|
178
|
-
? undefined
|
|
179
|
-
: Object.entries(mergedToolsConfig)
|
|
180
|
-
.filter(([, entry]) => entry !== false)
|
|
181
|
-
.map(([name]) => name)
|
|
182
|
-
.sort();
|
|
183
|
-
const augmentedSystem = async () => {
|
|
184
|
-
// Owner-aware: omitted selectors advertise every skill visible to this
|
|
185
|
-
// agent (unowned project skills plus its own). Explicit lists, including
|
|
186
|
-
// an empty list, retain their authored catalog selection.
|
|
187
|
-
const snapshot = resolveSkillSnapshot();
|
|
188
|
-
const basePrompt = (typeof originalSystem === "function" ? await originalSystem() : originalSystem) ??
|
|
189
|
-
"You are a helpful assistant.";
|
|
190
|
-
return flattenSystemInstructions(buildAgentCallContext({
|
|
191
|
-
instructions: basePrompt,
|
|
192
|
-
skills: snapshot.definitions.map(toRuntimeSkillDefinition),
|
|
193
|
-
includeSkillToolUsage: true,
|
|
194
|
-
...(configuredToolNames === undefined ? {} : { availableToolNames: configuredToolNames }),
|
|
195
|
-
...(config.projectContext ? { projectContext: config.projectContext } : {}),
|
|
196
|
-
...(config.environmentContext ? { environmentContext: config.environmentContext } : {}),
|
|
197
|
-
}));
|
|
198
|
-
};
|
|
199
|
-
const resolvedMiddleware = resolveSecurityMiddleware(config);
|
|
200
|
-
const platform = detectPlatform();
|
|
201
|
-
const compatibility = validatePlatformCompatibility({
|
|
202
|
-
maxSteps: config.maxSteps,
|
|
203
|
-
streaming: config.streaming,
|
|
204
|
-
requiresFileSystem: false,
|
|
205
|
-
requiresMCP: false,
|
|
206
|
-
}, platform);
|
|
207
|
-
if (!compatibility.compatible) {
|
|
208
|
-
throw toError(createError({
|
|
209
|
-
type: "agent",
|
|
210
|
-
message: `Agent "${id}" is not compatible with current platform:\n${compatibility.errors.join("\n")}`,
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
if (compatibility.warnings.length) {
|
|
214
|
-
agentLogger.warn(`Agent "${id}" warnings:\n${compatibility.warnings.join("\n")}`);
|
|
215
|
-
}
|
|
216
|
-
const runtime = new AgentRuntime(id, {
|
|
217
|
-
...publicConfig,
|
|
218
|
-
tools: mergedToolsConfig,
|
|
219
|
-
system: augmentedSystem,
|
|
220
|
-
middleware: resolvedMiddleware,
|
|
221
|
-
});
|
|
222
|
-
const agentInstance = {
|
|
91
|
+
/**
|
|
92
|
+
* Build the public agent surface over a constructed runtime.
|
|
93
|
+
*
|
|
94
|
+
* Separated from `agent()` so the three request paths can be read without the
|
|
95
|
+
* construction that precedes them. Each resolves the skill snapshot per call
|
|
96
|
+
* rather than capturing it, so registry changes during a long-lived process are
|
|
97
|
+
* picked up on the next invocation instead of being frozen at creation.
|
|
98
|
+
*/
|
|
99
|
+
function createAgentInstance(deps) {
|
|
100
|
+
const { id, publicConfig, toolsConfig, runtime, shouldAttachAllowedSkillIds } = deps;
|
|
101
|
+
const resolveSkillSnapshot = deps.resolveSkillSnapshot;
|
|
102
|
+
return {
|
|
223
103
|
id,
|
|
224
104
|
config: {
|
|
225
105
|
...publicConfig,
|
|
226
|
-
tools:
|
|
106
|
+
tools: toolsConfig,
|
|
227
107
|
},
|
|
228
108
|
generate(input) {
|
|
229
109
|
return withSpan("agent.factory.generate", () => {
|
|
@@ -284,6 +164,142 @@ export function agent(config) {
|
|
|
284
164
|
return runtime.clearMemory();
|
|
285
165
|
},
|
|
286
166
|
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Merge skill tooling and delegate tooling into the authored tool selection.
|
|
170
|
+
*
|
|
171
|
+
* Skill tools are framework infrastructure shared by every skill-enabled agent,
|
|
172
|
+
* so they are registered once in the shared registry and then added to this
|
|
173
|
+
* agent's selection. Project skills stay project-scoped and owner-aware, which
|
|
174
|
+
* is why the allowed ids are resolved per call rather than captured here.
|
|
175
|
+
*
|
|
176
|
+
* `tools: true` is left as-is: it authorizes the whole catalog, so there is
|
|
177
|
+
* nothing to merge into. That is also why it cannot be combined with delegates,
|
|
178
|
+
* whose capabilities have to stay individually declared.
|
|
179
|
+
*/
|
|
180
|
+
function resolveToolsConfiguration(input) {
|
|
181
|
+
const { config, id, delegates, exposeSkillTools, resolveSkillSnapshot } = input;
|
|
182
|
+
let merged = config.tools;
|
|
183
|
+
ensureBuiltinSchemaValidator();
|
|
184
|
+
for (const registration of SKILL_TOOL_REGISTRATIONS) {
|
|
185
|
+
if (!toolRegistry.has(registration.id)) {
|
|
186
|
+
toolRegistryInternal.registerShared(registration.id, registration.create());
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (config.tools !== true) {
|
|
190
|
+
const configuredTools = { ...(config.tools ?? {}) };
|
|
191
|
+
for (const registration of SKILL_TOOL_REGISTRATIONS) {
|
|
192
|
+
if (!exposeSkillTools) {
|
|
193
|
+
delete configuredTools[registration.id];
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const configuredTool = configuredTools[registration.id];
|
|
197
|
+
if (typeof configuredTool === "object" && configuredTool !== null) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
configuredTools[registration.id] = registration.create({
|
|
201
|
+
resolveAllowedSkillIds: () => resolveSkillSnapshot().allowedSkillIds,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
const hasConfiguredTools = Object.keys(configuredTools).length > 0;
|
|
205
|
+
merged = hasConfiguredTools || config.tools !== undefined ? configuredTools : undefined;
|
|
206
|
+
}
|
|
207
|
+
if (delegates?.length) {
|
|
208
|
+
if (merged === true) {
|
|
209
|
+
throw INVALID_ARGUMENT.create({
|
|
210
|
+
detail: `Agent "${id}" cannot combine delegates with tools: true. ` +
|
|
211
|
+
"Declare the required tools by name so delegate capabilities remain explicit.",
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
merged = {
|
|
215
|
+
...(merged ?? {}),
|
|
216
|
+
...buildAgentDelegateTools({ delegates, selfId: id }),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
return merged;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Build the system prompt lazily, per invocation.
|
|
223
|
+
*
|
|
224
|
+
* Assembled at call time rather than construction time so registry-backed
|
|
225
|
+
* skills pick up HMR changes and host-supplied project and environment facts
|
|
226
|
+
* stay current across a long-lived process.
|
|
227
|
+
*/
|
|
228
|
+
function createAugmentedSystem(input) {
|
|
229
|
+
const { config, configuredToolNames, resolveSkillSnapshot } = input;
|
|
230
|
+
const originalSystem = config.system;
|
|
231
|
+
return async () => {
|
|
232
|
+
// Owner-aware: omitted selectors advertise every skill visible to this
|
|
233
|
+
// agent (unowned project skills plus its own). Explicit lists, including
|
|
234
|
+
// an empty list, retain their authored catalog selection.
|
|
235
|
+
const snapshot = resolveSkillSnapshot();
|
|
236
|
+
const basePrompt = (typeof originalSystem === "function" ? await originalSystem() : originalSystem) ??
|
|
237
|
+
"You are a helpful assistant.";
|
|
238
|
+
return flattenSystemInstructions(buildAgentCallContext({
|
|
239
|
+
instructions: basePrompt,
|
|
240
|
+
skills: snapshot.definitions.map(toRuntimeSkillDefinition),
|
|
241
|
+
includeSkillToolUsage: true,
|
|
242
|
+
...(configuredToolNames === undefined ? {} : { availableToolNames: configuredToolNames }),
|
|
243
|
+
...(config.projectContext ? { projectContext: config.projectContext } : {}),
|
|
244
|
+
...(config.environmentContext ? { environmentContext: config.environmentContext } : {}),
|
|
245
|
+
}));
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
/** Agent helper. */
|
|
249
|
+
export function agent(config) {
|
|
250
|
+
if (typeof config.id === "string" && config.id.trim().length === 0) {
|
|
251
|
+
throw toError(createError({
|
|
252
|
+
type: "agent",
|
|
253
|
+
message: "Agent id cannot be empty.",
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
256
|
+
const id = config.id ?? generateAgentId();
|
|
257
|
+
const delegates = normalizeAgentDelegateIds(id, config.delegates);
|
|
258
|
+
const skillsConfig = config.skills === false ? [] : config.skills;
|
|
259
|
+
const shouldAttachAllowedSkillIds = skillsConfig !== undefined;
|
|
260
|
+
const resolveSkillSnapshot = () => skillRegistryInternal.resolveSelectorForAgent(skillsConfig, { agentId: id });
|
|
261
|
+
if (Array.isArray(skillsConfig) && skillsConfig.length > 0) {
|
|
262
|
+
resolveSkillSnapshot();
|
|
263
|
+
}
|
|
264
|
+
const publicConfig = {
|
|
265
|
+
...config,
|
|
266
|
+
...(delegates === undefined ? {} : { delegates }),
|
|
267
|
+
model: resolveConfiguredAgentModel(config.model),
|
|
268
|
+
};
|
|
269
|
+
registerConfiguredLocalTools(config);
|
|
270
|
+
const shouldExposeSkillTools = !isExplicitNoneSkillSelector(config.skills);
|
|
271
|
+
const mergedToolsConfig = resolveToolsConfiguration({
|
|
272
|
+
config,
|
|
273
|
+
id,
|
|
274
|
+
delegates,
|
|
275
|
+
exposeSkillTools: shouldExposeSkillTools,
|
|
276
|
+
resolveSkillSnapshot,
|
|
277
|
+
});
|
|
278
|
+
const configuredToolNames = resolveConfiguredToolNames(mergedToolsConfig, {
|
|
279
|
+
exposeSkillTools: shouldExposeSkillTools,
|
|
280
|
+
providerTools: config.providerTools,
|
|
281
|
+
});
|
|
282
|
+
const augmentedSystem = createAugmentedSystem({
|
|
283
|
+
config,
|
|
284
|
+
configuredToolNames,
|
|
285
|
+
resolveSkillSnapshot,
|
|
286
|
+
});
|
|
287
|
+
const resolvedMiddleware = resolveSecurityMiddleware(config);
|
|
288
|
+
assertPlatformCompatible(config, id);
|
|
289
|
+
const runtime = new AgentRuntime(id, {
|
|
290
|
+
...publicConfig,
|
|
291
|
+
tools: mergedToolsConfig,
|
|
292
|
+
system: augmentedSystem,
|
|
293
|
+
middleware: resolvedMiddleware,
|
|
294
|
+
});
|
|
295
|
+
const agentInstance = createAgentInstance({
|
|
296
|
+
id,
|
|
297
|
+
publicConfig,
|
|
298
|
+
toolsConfig: mergedToolsConfig,
|
|
299
|
+
runtime,
|
|
300
|
+
resolveSkillSnapshot,
|
|
301
|
+
shouldAttachAllowedSkillIds,
|
|
302
|
+
});
|
|
287
303
|
setEffectiveAgentSystem(agentInstance, augmentedSystem);
|
|
288
304
|
agentRegistry.register(id, agentInstance);
|
|
289
305
|
return agentInstance;
|
|
@@ -324,6 +340,74 @@ export function resolveSecurityMiddleware(config) {
|
|
|
324
340
|
];
|
|
325
341
|
}
|
|
326
342
|
let agentIdCounter = 0;
|
|
343
|
+
/**
|
|
344
|
+
* Names advertised to the model in the system-prompt tool inventory.
|
|
345
|
+
*
|
|
346
|
+
* `tools: true` authorizes the whole catalog but sends only the tools that make
|
|
347
|
+
* the deferred catalog reachable: `tool_search` finds schemas, `load_skill`
|
|
348
|
+
* loads instructions, and `form_input` asks the user. Project tools are
|
|
349
|
+
* deferred and are named by the runtime inventory instead.
|
|
350
|
+
*
|
|
351
|
+
* An explicit map advertises exactly what it authorizes, minus entries switched
|
|
352
|
+
* off with `false`. `undefined` advertises nothing, which is distinct from an
|
|
353
|
+
* empty list: the caller renders no inventory at all.
|
|
354
|
+
*/
|
|
355
|
+
function resolveConfiguredToolNames(toolsConfig, options) {
|
|
356
|
+
if (toolsConfig === true) {
|
|
357
|
+
return [
|
|
358
|
+
"form_input",
|
|
359
|
+
...(options.exposeSkillTools ? ["load_skill"] : []),
|
|
360
|
+
"tool_search",
|
|
361
|
+
...(options.providerTools ?? []),
|
|
362
|
+
].sort();
|
|
363
|
+
}
|
|
364
|
+
if (toolsConfig === undefined)
|
|
365
|
+
return undefined;
|
|
366
|
+
return Object.entries(toolsConfig)
|
|
367
|
+
.filter(([, entry]) => entry !== false)
|
|
368
|
+
.map(([name]) => name)
|
|
369
|
+
.sort();
|
|
370
|
+
}
|
|
371
|
+
/** Reject a platform that cannot run this configuration, and warn about the rest. */
|
|
372
|
+
function assertPlatformCompatible(config, id) {
|
|
373
|
+
const compatibility = validatePlatformCompatibility({
|
|
374
|
+
maxSteps: config.maxSteps,
|
|
375
|
+
streaming: config.streaming,
|
|
376
|
+
requiresFileSystem: false,
|
|
377
|
+
requiresMCP: false,
|
|
378
|
+
}, detectPlatform());
|
|
379
|
+
if (!compatibility.compatible) {
|
|
380
|
+
throw toError(createError({
|
|
381
|
+
type: "agent",
|
|
382
|
+
message: `Agent "${id}" is not compatible with current platform:\n${compatibility.errors.join("\n")}`,
|
|
383
|
+
}));
|
|
384
|
+
}
|
|
385
|
+
if (compatibility.warnings.length) {
|
|
386
|
+
agentLogger.warn(`Agent "${id}" warnings:\n${compatibility.warnings.join("\n")}`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Register inline tool objects so the runtime can resolve them by id later.
|
|
391
|
+
*
|
|
392
|
+
* Authored entries are normalized in place: an entry whose `id` disagrees with
|
|
393
|
+
* its key is rewritten to match the key, because the key is what the model
|
|
394
|
+
* calls.
|
|
395
|
+
*/
|
|
396
|
+
function registerConfiguredLocalTools(config) {
|
|
397
|
+
if (!config.tools || config.tools === true)
|
|
398
|
+
return;
|
|
399
|
+
for (const [name, entry] of Object.entries(config.tools)) {
|
|
400
|
+
if (!entry || typeof entry !== "object")
|
|
401
|
+
continue;
|
|
402
|
+
assertLocalToolId(name);
|
|
403
|
+
assertLocalToolId(entry.id);
|
|
404
|
+
if (isRuntimeLocalTool(entry))
|
|
405
|
+
continue;
|
|
406
|
+
const normalizedTool = entry.id === name ? entry : { ...entry, id: name };
|
|
407
|
+
registerTool(normalizedTool.id, normalizedTool);
|
|
408
|
+
config.tools[name] = normalizedTool;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
327
411
|
function generateAgentId() {
|
|
328
412
|
return `agent_${Date.now()}_${agentIdCounter++}`;
|
|
329
413
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarative-evaluator.d.ts","sourceRoot":"","sources":["../../../src/src/config/declarative-evaluator.ts"],"names":[],"mappings":"AAcA,OAAO,EAIL,KAAK,oBAAoB,EAE1B,MAAM,eAAe,CAAC;AA2CvB,qEAAqE;AACrE,MAAM,MAAM,yBAAyB,GACjC,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,CAAC;AAC3B,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,EAAE,yBAAiD,CAAC;AAE7F,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,yBAAyB,CAIpC;AAkBD;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAA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kC,GAC1C,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
|
|
@@ -2009,6 +2009,14 @@ async function evaluateCapturedInput(input, parser) {
|
|
|
2009
2009
|
const { source, fileName, preparedState } = input;
|
|
2010
2010
|
let parsedAst;
|
|
2011
2011
|
try {
|
|
2012
|
+
// The name is not reliably the file we are holding: VERYFRONT_CONFIG_FILES
|
|
2013
|
+
// is ordered `.js, .ts, .mjs`, and in production a project's
|
|
2014
|
+
// veryfront.config.ts was evaluated under the `.js` name. pickPlugins now
|
|
2015
|
+
// enables TypeScript regardless of extension, so the name only selects JSX.
|
|
2016
|
+
//
|
|
2017
|
+
// The mislabeling itself is a separate defect and is still unfixed:
|
|
2018
|
+
// readHostedConfigSource returns the candidate it actually loaded, so the
|
|
2019
|
+
// substitution happens downstream of it on the API-backed path.
|
|
2012
2020
|
parsedAst = await parser.parse({
|
|
2013
2021
|
code: source,
|
|
2014
2022
|
filePath: fileName,
|