veryfront 0.1.770 → 0.1.771
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 +1 -1
- package/esm/src/agent/runtime/load-skill-tool.d.ts +1 -0
- package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
- package/esm/src/agent/runtime/load-skill-tool.js +20 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
package/esm/deno.js
CHANGED
|
@@ -10,6 +10,7 @@ export declare const RUNTIME_LOAD_SKILL_DESCRIPTION = "Load the full instruction
|
|
|
10
10
|
export type RuntimeLoadSkillToolContext = RuntimeProjectSkillContext & {
|
|
11
11
|
availableSkillIds?: readonly string[];
|
|
12
12
|
availableToolNames?: readonly string[];
|
|
13
|
+
loadedSkillResponses?: Record<string, RuntimeLoadedSkillResponse>;
|
|
13
14
|
};
|
|
14
15
|
/** Public API contract for runtime load skill builtin store. */
|
|
15
16
|
export type RuntimeLoadSkillBuiltinStore = {
|
|
@@ -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;AAE7B,yDAAyD;AACzD,eAAO,MAAM,oCAAoC,2mBACqP,CAAC;AAEvS,mDAAmD;AACnD,eAAO,MAAM,8BAA8B,unBAC0a,CAAC;AAatd,2CAA2C;AAC3C,MAAM,MAAM,2BAA2B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AClE,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAEvF,mDAAmD;AACnD,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,2BAA2B,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,yBAAyB,CAAC;IAC9C,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,4BAA4B,CAAC;IACxC,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;GAS9C,CAAC;AAKF,iDAAiD;AACjD,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,UAAU,CAAC,OAAO,kCAAkC,CAAC,CACtD,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,mCAAmC,GAAG;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,0BAA0B,GAClC,0BAA0B,GAC1B,mCAAmC,GACnC,2BAA2B,CAAC;AAoKhC,sCAAsC;AACtC,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,2BAA2B,GACnC,IAAI,CAAC,yBAAyB,EAAE,0BAA0B,CAAC,CA6C7D"}
|
|
@@ -55,6 +55,15 @@ function buildLoadedSkillResponse(input) {
|
|
|
55
55
|
logger: input.options.logger,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
+
function buildAlreadyLoadedSkillResponse(skillId, response) {
|
|
59
|
+
return {
|
|
60
|
+
...response,
|
|
61
|
+
instructions: `Skill "${skillId}" is already loaded in this turn. Do not call load_skill for "${skillId}" again. ` +
|
|
62
|
+
"Continue from the existing user request and any submitted tool results, then produce the next useful response now.",
|
|
63
|
+
nextStep: "Continue now. Do not reload this skill or restart intake; use the existing context and finish the current turn.",
|
|
64
|
+
references: response.references,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
58
67
|
function buildMissingSkillError(options, skillId) {
|
|
59
68
|
const knownIds = new Set([
|
|
60
69
|
...(options.context.availableSkillIds ?? []),
|
|
@@ -131,23 +140,32 @@ export function createRuntimeLoadSkillTool(options) {
|
|
|
131
140
|
if (file) {
|
|
132
141
|
return await loadRuntimeSkillReferenceFile(options, skillId, file);
|
|
133
142
|
}
|
|
143
|
+
const loadedSkillResponses = options.context.loadedSkillResponses ??= {};
|
|
144
|
+
const loadedResponse = loadedSkillResponses[skillId];
|
|
145
|
+
if (loadedResponse) {
|
|
146
|
+
return buildAlreadyLoadedSkillResponse(skillId, loadedResponse);
|
|
147
|
+
}
|
|
134
148
|
const projectSkill = await loadRuntimeSkillBody(options, skillId);
|
|
135
149
|
if (projectSkill) {
|
|
136
|
-
|
|
150
|
+
const response = buildLoadedSkillResponse({
|
|
137
151
|
options,
|
|
138
152
|
skillId,
|
|
139
153
|
instructions: projectSkill.instructions,
|
|
140
154
|
references: projectSkill.references,
|
|
141
155
|
});
|
|
156
|
+
loadedSkillResponses[skillId] = response;
|
|
157
|
+
return response;
|
|
142
158
|
}
|
|
143
159
|
const localContent = builtinStore.readSkill(options.skillsDir, skillId);
|
|
144
160
|
if (localContent) {
|
|
145
|
-
|
|
161
|
+
const response = buildLoadedSkillResponse({
|
|
146
162
|
options,
|
|
147
163
|
skillId,
|
|
148
164
|
instructions: localContent,
|
|
149
165
|
references: builtinStore.listReferences(options.skillsDir, skillId),
|
|
150
166
|
});
|
|
167
|
+
loadedSkillResponses[skillId] = response;
|
|
168
|
+
return response;
|
|
151
169
|
}
|
|
152
170
|
return buildMissingSkillError(options, skillId);
|
|
153
171
|
},
|