veryfront 0.1.861 → 0.1.863

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/deno.d.ts CHANGED
@@ -303,6 +303,8 @@ declare namespace _default {
303
303
  "test:coverage:integration": string;
304
304
  "coverage:report": string;
305
305
  "coverage:gate": string;
306
+ "coverage:ci:shard": string;
307
+ "coverage:ci:merge": string;
306
308
  "coverage:ci": string;
307
309
  "coverage:html": string;
308
310
  bench: string;
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.861",
3
+ "version": "0.1.863",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -364,6 +364,8 @@ export default {
364
364
  "test:coverage:integration": "rm -rf coverage && deno task generate && VF_DISABLE_LRU_INTERVAL=1 SSR_TRANSFORM_PER_PROJECT_LIMIT=0 REVALIDATION_PER_PROJECT_LIMIT=0 NODE_ENV=production LOG_FORMAT=text deno test --preload=src/schemas/_test-setup.ts --no-check --parallel --fail-fast --allow-all --v8-flags=--max-old-space-size=8192 --coverage=coverage '--ignore=tests/e2e,tests/integration/compiled-binary-e2e.test.ts' tests --unstable-worker-options --unstable-net || exit 1",
365
365
  "coverage:report": "deno coverage coverage --include=src/ --exclude=tests '--exclude=src/**/*_test.ts' '--exclude=src/**/*_test.tsx' '--exclude=src/**/*.test.ts' '--exclude=src/**/*.test.tsx' --lcov > coverage/lcov.info && deno run --allow-read scripts/lint/check-coverage.ts 80",
366
366
  "coverage:gate": "deno coverage coverage --include=src/ --exclude=tests '--exclude=src/**/*_test.ts' '--exclude=src/**/*_test.tsx' '--exclude=src/**/*.test.ts' '--exclude=src/**/*.test.tsx' --lcov > coverage/lcov.info && deno run --allow-read scripts/lint/check-coverage.ts 68",
367
+ "coverage:ci:shard": "deno run --allow-read --allow-write --allow-run --allow-env scripts/test/coverage-ci.ts shard",
368
+ "coverage:ci:merge": "deno run --allow-read --allow-write --allow-run --allow-env scripts/test/coverage-ci.ts merge",
367
369
  "coverage:ci": "deno task test:coverage:unit && deno task coverage:gate",
368
370
  "coverage:html": "deno coverage coverage --include=src/ --exclude=tests '--exclude=src/**/*_test.ts' '--exclude=src/**/*_test.tsx' '--exclude=src/**/*.test.ts' '--exclude=src/**/*.test.tsx' --html",
369
371
  "bench": "VF_DISABLE_LRU_INTERVAL=1 NODE_ENV=production LOG_FORMAT=text deno bench --no-check --allow-all --unstable-worker-options --unstable-net $(find src -name '*.bench.ts')",
@@ -1 +1 @@
1
- {"version":3,"file":"load-skill-tool.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/load-skill-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAchD,OAAO,KAAK,EAEV,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAChC,MAAM,qBAAqB,CAAC;AAG7B,yDAAyD;AACzD,eAAO,MAAM,oCAAoC,2mBACqP,CAAC;AAEvS,mDAAmD;AACnD,eAAO,MAAM,8BAA8B,wsBAC2f,CAAC;AAcviB,2CAA2C;AAC3C,MAAM,MAAM,2BAA2B,GAAG,0BAA0B,GAAG;IACrE,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAClE,6BAA6B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mCAAmC,CAAC,CAAC;CACrF,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,4BAA4B,GA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lazySchema } from "../../schemas/index.js";
2
- import { tool } from "../../tool/index.js";
2
+ import { zodToJsonSchema } from "../../tool/schema/zod-json-schema.js";
3
3
  import { LOAD_SKILL_CONTINUE_SAME_TURN, LOAD_SKILL_DELEGATION_THRESHOLD, LOAD_SKILL_OVERRIDE_FORWARDING, LOAD_SKILL_ROOT_OWNERSHIP, LOAD_SKILL_TOOL_INTERSECTION, LOAD_SKILL_USE_ALLOWED_TOOLS, } from "../conversation/delegation-policy.js";
4
4
  import { listRuntimeBuiltinSkillReferences, readRuntimeBuiltinSkill, readRuntimeBuiltinSkillReferenceFile, } from "./builtin-skill-files.js";
5
5
  import { buildRuntimeLoadedSkillResponse, normalizeRuntimeSkillReferencePath, } from "./skill-metadata.js";
@@ -132,11 +132,46 @@ function getKnownRuntimeSkillIds(options) {
132
132
  ]),
133
133
  ].sort();
134
134
  }
135
+ function getLoadedRuntimeSkillIds(options) {
136
+ return [
137
+ ...new Set(Object.values(options.context.loadedSkillResponses ?? {})
138
+ .map((response) => response.skillId)
139
+ .filter((skillId) => typeof skillId === "string" && skillId.length > 0)),
140
+ ].sort();
141
+ }
135
142
  function buildRuntimeLoadSkillInputSchema(options) {
136
143
  const knownIds = getKnownRuntimeSkillIds(options);
137
144
  if (!knownIds || knownIds.length === 0) {
138
145
  return runtimeLoadSkillToolInputSchema;
139
146
  }
147
+ const knownIdSet = new Set(knownIds);
148
+ const loadedIds = getLoadedRuntimeSkillIds(options).filter((skillId) => knownIdSet.has(skillId));
149
+ const loadedIdSet = new Set(loadedIds);
150
+ const unloadedIds = knownIds.filter((skillId) => !loadedIdSet.has(skillId));
151
+ if (loadedIds.length > 0 && unloadedIds.length === 0) {
152
+ const [firstLoaded, ...restLoaded] = loadedIds;
153
+ const loadedEnumValues = [firstLoaded, ...restLoaded];
154
+ return defineSchema((v) => v.object({
155
+ skillId: v.enum(loadedEnumValues).describe(`Already-loaded skill ID. Body reloads are not allowed; use this only with file for listed references. Loaded skill IDs: ${loadedIds.join(", ")}`),
156
+ file: v.string().describe("Required reference file to load from an already-loaded skill. Do not call load_skill again for the skill body."),
157
+ }))();
158
+ }
159
+ if (loadedIds.length > 0) {
160
+ const [firstUnloaded, ...restUnloaded] = unloadedIds;
161
+ const unloadedEnumValues = [firstUnloaded, ...restUnloaded];
162
+ const [firstLoaded, ...restLoaded] = loadedIds;
163
+ const loadedEnumValues = [firstLoaded, ...restLoaded];
164
+ return defineSchema((v) => v.union([
165
+ v.object({
166
+ skillId: v.enum(unloadedEnumValues).describe(`Unloaded skill ID to load. Available unloaded skill IDs: ${unloadedIds.join(", ")}`),
167
+ file: v.string().optional().describe("Optional reference file to load. First load the skill with only skillId, then use file only for a reference path listed by that loaded skill."),
168
+ }),
169
+ v.object({
170
+ skillId: v.enum(loadedEnumValues).describe(`Already-loaded skill ID. Body reloads are not allowed; use this only with file for listed references. Loaded skill IDs: ${loadedIds.join(", ")}`),
171
+ file: v.string().describe("Required reference file to load from an already-loaded skill. Do not call load_skill again for the skill body."),
172
+ }),
173
+ ]))();
174
+ }
140
175
  const [first, ...rest] = knownIds;
141
176
  const enumValues = [first, ...rest];
142
177
  return defineSchema((v) => v.object({
@@ -192,43 +227,57 @@ async function loadRuntimeSkillBody(options, skillId) {
192
227
  /** Create runtime load skill tool. */
193
228
  export function createRuntimeLoadSkillTool(options) {
194
229
  const builtinStore = getBuiltinStore(options);
195
- return tool({
230
+ async function execute({ skillId, file }) {
231
+ let parsed;
232
+ try {
233
+ parsed = buildRuntimeLoadSkillInputSchema(options).parse({ skillId, file });
234
+ }
235
+ catch (error) {
236
+ throw new Error(`Tool "load_skill" input validation failed: ${error instanceof Error ? error.message : String(error)}`);
237
+ }
238
+ skillId = parsed.skillId;
239
+ file = parsed.file;
240
+ if (file) {
241
+ return await loadRuntimeSkillReferenceFile(options, skillId, file);
242
+ }
243
+ const loadedSkillResponses = options.context.loadedSkillResponses ??= {};
244
+ const loadedSkillKey = buildRuntimeSkillCacheKey(options.context, skillId);
245
+ const loadedResponse = loadedSkillResponses[loadedSkillKey];
246
+ if (loadedResponse) {
247
+ return buildAlreadyLoadedSkillResponse(skillId, loadedResponse);
248
+ }
249
+ const projectSkill = await loadRuntimeSkillBody(options, skillId);
250
+ if (projectSkill) {
251
+ const response = buildLoadedSkillResponse({
252
+ options,
253
+ skillId,
254
+ instructions: projectSkill.instructions,
255
+ references: projectSkill.references,
256
+ });
257
+ loadedSkillResponses[loadedSkillKey] = response;
258
+ return response;
259
+ }
260
+ const localContent = builtinStore.readSkill(options.skillsDir, skillId);
261
+ if (localContent) {
262
+ const response = buildLoadedSkillResponse({
263
+ options,
264
+ skillId,
265
+ instructions: localContent,
266
+ references: builtinStore.listReferences(options.skillsDir, skillId),
267
+ });
268
+ loadedSkillResponses[loadedSkillKey] = response;
269
+ return response;
270
+ }
271
+ return buildMissingSkillError(options, skillId);
272
+ }
273
+ return {
196
274
  id: "load_skill",
275
+ type: "function",
197
276
  description: buildRuntimeLoadSkillDescription(options),
198
- inputSchema: buildRuntimeLoadSkillInputSchema(options),
199
- execute: async ({ skillId, file }) => {
200
- if (file) {
201
- return await loadRuntimeSkillReferenceFile(options, skillId, file);
202
- }
203
- const loadedSkillResponses = options.context.loadedSkillResponses ??= {};
204
- const loadedSkillKey = buildRuntimeSkillCacheKey(options.context, skillId);
205
- const loadedResponse = loadedSkillResponses[loadedSkillKey];
206
- if (loadedResponse) {
207
- return buildAlreadyLoadedSkillResponse(skillId, loadedResponse);
208
- }
209
- const projectSkill = await loadRuntimeSkillBody(options, skillId);
210
- if (projectSkill) {
211
- const response = buildLoadedSkillResponse({
212
- options,
213
- skillId,
214
- instructions: projectSkill.instructions,
215
- references: projectSkill.references,
216
- });
217
- loadedSkillResponses[loadedSkillKey] = response;
218
- return response;
219
- }
220
- const localContent = builtinStore.readSkill(options.skillsDir, skillId);
221
- if (localContent) {
222
- const response = buildLoadedSkillResponse({
223
- options,
224
- skillId,
225
- instructions: localContent,
226
- references: builtinStore.listReferences(options.skillsDir, skillId),
227
- });
228
- loadedSkillResponses[loadedSkillKey] = response;
229
- return response;
230
- }
231
- return buildMissingSkillError(options, skillId);
277
+ inputSchema: runtimeLoadSkillToolInputSchema,
278
+ get inputSchemaJson() {
279
+ return zodToJsonSchema(buildRuntimeLoadSkillInputSchema(options));
232
280
  },
233
- });
281
+ execute,
282
+ };
234
283
  }
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.861";
2
+ export declare const VERSION = "0.1.863";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.861";
4
+ export const VERSION = "0.1.863";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.861",
3
+ "version": "0.1.863",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",