veryfront 0.1.862 → 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.js
CHANGED
|
@@ -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;
|
|
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;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAehD,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,GAAG;IACzC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,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tC,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,IAAI,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,CAiE7D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineSchema, lazySchema } from "../../schemas/index.js";
|
|
2
|
-
import {
|
|
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";
|
|
@@ -227,43 +227,57 @@ async function loadRuntimeSkillBody(options, skillId) {
|
|
|
227
227
|
/** Create runtime load skill tool. */
|
|
228
228
|
export function createRuntimeLoadSkillTool(options) {
|
|
229
229
|
const builtinStore = getBuiltinStore(options);
|
|
230
|
-
|
|
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 {
|
|
231
274
|
id: "load_skill",
|
|
275
|
+
type: "function",
|
|
232
276
|
description: buildRuntimeLoadSkillDescription(options),
|
|
233
|
-
inputSchema:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return await loadRuntimeSkillReferenceFile(options, skillId, file);
|
|
237
|
-
}
|
|
238
|
-
const loadedSkillResponses = options.context.loadedSkillResponses ??= {};
|
|
239
|
-
const loadedSkillKey = buildRuntimeSkillCacheKey(options.context, skillId);
|
|
240
|
-
const loadedResponse = loadedSkillResponses[loadedSkillKey];
|
|
241
|
-
if (loadedResponse) {
|
|
242
|
-
return buildAlreadyLoadedSkillResponse(skillId, loadedResponse);
|
|
243
|
-
}
|
|
244
|
-
const projectSkill = await loadRuntimeSkillBody(options, skillId);
|
|
245
|
-
if (projectSkill) {
|
|
246
|
-
const response = buildLoadedSkillResponse({
|
|
247
|
-
options,
|
|
248
|
-
skillId,
|
|
249
|
-
instructions: projectSkill.instructions,
|
|
250
|
-
references: projectSkill.references,
|
|
251
|
-
});
|
|
252
|
-
loadedSkillResponses[loadedSkillKey] = response;
|
|
253
|
-
return response;
|
|
254
|
-
}
|
|
255
|
-
const localContent = builtinStore.readSkill(options.skillsDir, skillId);
|
|
256
|
-
if (localContent) {
|
|
257
|
-
const response = buildLoadedSkillResponse({
|
|
258
|
-
options,
|
|
259
|
-
skillId,
|
|
260
|
-
instructions: localContent,
|
|
261
|
-
references: builtinStore.listReferences(options.skillsDir, skillId),
|
|
262
|
-
});
|
|
263
|
-
loadedSkillResponses[loadedSkillKey] = response;
|
|
264
|
-
return response;
|
|
265
|
-
}
|
|
266
|
-
return buildMissingSkillError(options, skillId);
|
|
277
|
+
inputSchema: runtimeLoadSkillToolInputSchema,
|
|
278
|
+
get inputSchemaJson() {
|
|
279
|
+
return zodToJsonSchema(buildRuntimeLoadSkillInputSchema(options));
|
|
267
280
|
},
|
|
268
|
-
|
|
281
|
+
execute,
|
|
282
|
+
};
|
|
269
283
|
}
|