veryfront 0.1.1117 → 0.1.1118

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.1117",
3
+ "version": "0.1.1118",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -1 +1 @@
1
- {"version":3,"file":"load-skill-tool.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/load-skill-tool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,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,yFAAyF;AACzF,eAAO,MAAM,oCAAoC,2mBACiU,CAAC;AAEnX,mDAAmD;AACnD,eAAO,MAAM,8BAA8B,4lBAC2d,CAAC;AAqEvgB,2CAA2C;AAC3C,MAAM,MAAM,2BAA2B,GAAG,0BAA0B,GAAG;IACrE,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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,GAAG;IACzC,SAAS,EAAE,CAAC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6 +184,14 @@ function getLoadedRuntimeSkillIds(options) {
184
184
  .filter((skillId) => typeof skillId === "string" && skillId.length > 0)),
185
185
  ].sort();
186
186
  }
187
+ function getReferenceableLoadedRuntimeSkillIds(options) {
188
+ return [
189
+ ...new Set(Object.values(options.context.loadedSkillResponses ?? {})
190
+ .filter((response) => (response.references?.length ?? 0) > 0)
191
+ .map((response) => response.skillId)
192
+ .filter((skillId) => typeof skillId === "string" && skillId.length > 0)),
193
+ ].sort();
194
+ }
187
195
  function buildRuntimeLoadSkillInputSchema(options) {
188
196
  const knownIds = getKnownRuntimeSkillIds(options);
189
197
  if (!knownIds || knownIds.length === 0) {
@@ -192,19 +200,28 @@ function buildRuntimeLoadSkillInputSchema(options) {
192
200
  const knownIdSet = new Set(knownIds);
193
201
  const loadedIds = getLoadedRuntimeSkillIds(options).filter((skillId) => knownIdSet.has(skillId));
194
202
  const loadedIdSet = new Set(loadedIds);
203
+ const referenceableLoadedIds = getReferenceableLoadedRuntimeSkillIds(options)
204
+ .filter((skillId) => knownIdSet.has(skillId));
195
205
  const unloadedIds = knownIds.filter((skillId) => !loadedIdSet.has(skillId));
196
- if (loadedIds.length > 0 && unloadedIds.length === 0) {
206
+ if (loadedIds.length > 0 && unloadedIds.length === 0 && referenceableLoadedIds.length === 0) {
197
207
  const [firstLoaded, ...restLoaded] = loadedIds;
198
208
  const loadedEnumValues = [firstLoaded, ...restLoaded];
199
209
  return defineSchema((v) => v.object({
200
- 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(", ")}`),
210
+ skillId: v.enum(loadedEnumValues).describe(`Already-loaded skill ID with no advertised reference files. Calling load_skill again is a no-op. Loaded skill IDs: ${loadedIds.join(", ")}`),
211
+ }).strict())();
212
+ }
213
+ if (referenceableLoadedIds.length > 0 && unloadedIds.length === 0) {
214
+ const [firstLoaded, ...restLoaded] = referenceableLoadedIds;
215
+ const loadedEnumValues = [firstLoaded, ...restLoaded];
216
+ return defineSchema((v) => v.object({
217
+ 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: ${referenceableLoadedIds.join(", ")}`),
201
218
  file: v.string().describe("Required reference file to load from an already-loaded skill. Do not call load_skill again for the skill body."),
202
219
  }))();
203
220
  }
204
- if (loadedIds.length > 0) {
221
+ if (referenceableLoadedIds.length > 0) {
205
222
  const [firstUnloaded, ...restUnloaded] = unloadedIds;
206
223
  const unloadedEnumValues = [firstUnloaded, ...restUnloaded];
207
- const [firstLoaded, ...restLoaded] = loadedIds;
224
+ const [firstLoaded, ...restLoaded] = referenceableLoadedIds;
208
225
  const loadedEnumValues = [firstLoaded, ...restLoaded];
209
226
  return defineSchema((v) => v.union([
210
227
  v.object({
@@ -212,15 +229,15 @@ function buildRuntimeLoadSkillInputSchema(options) {
212
229
  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."),
213
230
  }),
214
231
  v.object({
215
- 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(", ")}`),
232
+ 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: ${referenceableLoadedIds.join(", ")}`),
216
233
  file: v.string().describe("Required reference file to load from an already-loaded skill. Do not call load_skill again for the skill body."),
217
234
  }),
218
235
  ]))();
219
236
  }
220
- const [first, ...rest] = knownIds;
237
+ const [first, ...rest] = unloadedIds;
221
238
  const enumValues = [first, ...rest];
222
239
  return defineSchema((v) => v.object({
223
- skillId: v.enum(enumValues).describe(`The skill ID to load. Available skill IDs: ${knownIds.join(", ")}`),
240
+ skillId: v.enum(enumValues).describe(`Unloaded skill ID to load. Available unloaded skill IDs: ${unloadedIds.join(", ")}`),
224
241
  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."),
225
242
  }))();
226
243
  }
@@ -275,7 +292,7 @@ export function createRuntimeLoadSkillTool(options) {
275
292
  async function execute({ skillId, file }) {
276
293
  let parsed;
277
294
  try {
278
- parsed = buildRuntimeLoadSkillInputSchema(options).parse({ skillId, file });
295
+ parsed = buildRuntimeLoadSkillInputSchema(options).parse(file === undefined ? { skillId } : { skillId, file });
279
296
  }
280
297
  catch (error) {
281
298
  throw INPUT_VALIDATION_FAILED.create({
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.1117";
2
+ export declare const VERSION = "0.1.1118";
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.1117";
4
+ export const VERSION = "0.1.1118";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.1117",
3
+ "version": "0.1.1118",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -332,10 +332,10 @@
332
332
  "@types/react": "19.2.14",
333
333
  "@types/react-dom": "19.2.3",
334
334
  "ws": "8.21.0",
335
- "@veryfront/ext-bundler-esbuild": "0.1.1117",
336
- "@veryfront/ext-content-mdx": "0.1.1117",
337
- "@veryfront/ext-css-tailwind": "0.1.1117",
338
- "@veryfront/ext-parser-babel": "0.1.1117"
335
+ "@veryfront/ext-bundler-esbuild": "0.1.1118",
336
+ "@veryfront/ext-content-mdx": "0.1.1118",
337
+ "@veryfront/ext-css-tailwind": "0.1.1118",
338
+ "@veryfront/ext-parser-babel": "0.1.1118"
339
339
  },
340
340
  "devDependencies": {
341
341
  "@types/node": "20.9.0"