@agentv/core 3.10.2 → 3.10.3
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/dist/index.cjs +55 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7538,7 +7538,7 @@ ${basePrompt}` : basePrompt;
|
|
|
7538
7538
|
if (itemType === "command_execution") {
|
|
7539
7539
|
completedToolCalls.push({
|
|
7540
7540
|
tool: "command_execution",
|
|
7541
|
-
input: item.command,
|
|
7541
|
+
input: { command: item.command },
|
|
7542
7542
|
output: item.aggregated_output,
|
|
7543
7543
|
id: item.id
|
|
7544
7544
|
});
|
|
@@ -8398,11 +8398,22 @@ async function loadCopilotSdk() {
|
|
|
8398
8398
|
try {
|
|
8399
8399
|
copilotSdkModule = await import("@github/copilot-sdk");
|
|
8400
8400
|
} catch (error) {
|
|
8401
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8402
|
+
if (message.includes("vscode-jsonrpc")) {
|
|
8403
|
+
throw new Error(
|
|
8404
|
+
`Failed to load @github/copilot-sdk due to a known ESM compatibility issue with vscode-jsonrpc (https://github.com/github/copilot-sdk/issues/710).
|
|
8405
|
+
|
|
8406
|
+
Workarounds:
|
|
8407
|
+
- Use the copilot-cli target instead (recommended): set target type to "copilot-cli" in your eval YAML
|
|
8408
|
+
- If running under Node.js 24+: set NODE_OPTIONS="--experimental-specifier-resolution=node"
|
|
8409
|
+
- Wait for vscode-jsonrpc@9.0.0 stable to be released upstream`
|
|
8410
|
+
);
|
|
8411
|
+
}
|
|
8401
8412
|
throw new Error(
|
|
8402
8413
|
`Failed to load @github/copilot-sdk. Please install it:
|
|
8403
8414
|
npm install @github/copilot-sdk
|
|
8404
8415
|
|
|
8405
|
-
Original error: ${
|
|
8416
|
+
Original error: ${message}`
|
|
8406
8417
|
);
|
|
8407
8418
|
}
|
|
8408
8419
|
}
|
|
@@ -9625,6 +9636,13 @@ function extractToolCalls4(content) {
|
|
|
9625
9636
|
id: typeof p.id === "string" ? p.id : void 0
|
|
9626
9637
|
});
|
|
9627
9638
|
}
|
|
9639
|
+
if (p.type === "toolCall" && typeof p.name === "string") {
|
|
9640
|
+
toolCalls.push({
|
|
9641
|
+
tool: p.name,
|
|
9642
|
+
input: p.arguments,
|
|
9643
|
+
id: typeof p.id === "string" ? p.id : void 0
|
|
9644
|
+
});
|
|
9645
|
+
}
|
|
9628
9646
|
if (p.type === "tool_result" && typeof p.tool_use_id === "string") {
|
|
9629
9647
|
const existing = toolCalls.find((tc) => tc.id === p.tool_use_id);
|
|
9630
9648
|
if (existing) {
|
|
@@ -15169,12 +15187,31 @@ var COPILOT_MATCHER = {
|
|
|
15169
15187
|
readToolPrefixes: ["Viewing "],
|
|
15170
15188
|
readInputFields: ["file_path", "path"]
|
|
15171
15189
|
};
|
|
15190
|
+
var PI_CODING_AGENT_MATCHER = {
|
|
15191
|
+
skillTools: [],
|
|
15192
|
+
skillInputField: "skill",
|
|
15193
|
+
readTools: ["read"],
|
|
15194
|
+
readInputField: "path",
|
|
15195
|
+
readInputFields: ["path", "file_path", "filePath"]
|
|
15196
|
+
};
|
|
15197
|
+
var CODEX_MATCHER = {
|
|
15198
|
+
skillTools: [],
|
|
15199
|
+
skillInputField: "skill",
|
|
15200
|
+
readTools: ["command_execution"],
|
|
15201
|
+
readInputField: "command",
|
|
15202
|
+
skillToolPrefixes: ["mcp:"],
|
|
15203
|
+
readToolPrefixes: ["mcp:"],
|
|
15204
|
+
readInputFields: ["command", "path", "file_path", "filePath"]
|
|
15205
|
+
};
|
|
15172
15206
|
var PROVIDER_TOOL_SEMANTICS = {
|
|
15173
15207
|
claude: CLAUDE_MATCHER,
|
|
15174
15208
|
"claude-cli": CLAUDE_MATCHER,
|
|
15175
15209
|
"claude-sdk": CLAUDE_MATCHER,
|
|
15176
|
-
|
|
15177
|
-
"pi-agent
|
|
15210
|
+
codex: CODEX_MATCHER,
|
|
15211
|
+
"pi-coding-agent": PI_CODING_AGENT_MATCHER,
|
|
15212
|
+
// pi-agent-sdk has no tools, so skill detection is a no-op. Kept for completeness.
|
|
15213
|
+
// TODO: consider removing pi-agent-sdk provider entirely.
|
|
15214
|
+
"pi-agent-sdk": PI_CODING_AGENT_MATCHER,
|
|
15178
15215
|
"copilot-cli": COPILOT_MATCHER,
|
|
15179
15216
|
"copilot-sdk": COPILOT_MATCHER,
|
|
15180
15217
|
vscode: COPILOT_MATCHER,
|
|
@@ -15198,33 +15235,37 @@ var SkillTriggerEvaluator = class {
|
|
|
15198
15235
|
const shouldTrigger = this.config.should_trigger !== false;
|
|
15199
15236
|
const providerKind = context2.provider?.kind;
|
|
15200
15237
|
const matcher = this.resolveMatcher(providerKind);
|
|
15201
|
-
const
|
|
15238
|
+
const allToolCalls = (context2.output ?? []).flatMap((msg) => msg.toolCalls ?? []);
|
|
15202
15239
|
let triggered = false;
|
|
15203
15240
|
let evidence = "";
|
|
15204
|
-
|
|
15205
|
-
const input =
|
|
15206
|
-
if (matcher.skillTools.includes(
|
|
15241
|
+
for (const toolCall of allToolCalls) {
|
|
15242
|
+
const input = toolCall.input ?? {};
|
|
15243
|
+
if (matcher.skillTools.includes(toolCall.tool)) {
|
|
15207
15244
|
const skillArg = String(input[matcher.skillInputField] ?? "");
|
|
15208
15245
|
if (skillArg.includes(skillName)) {
|
|
15209
15246
|
triggered = true;
|
|
15210
15247
|
evidence = `Skill tool invoked with ${matcher.skillInputField}="${skillArg}"`;
|
|
15248
|
+
break;
|
|
15211
15249
|
}
|
|
15212
15250
|
} else if (matcher.skillToolPrefixes?.some(
|
|
15213
|
-
(prefix) =>
|
|
15251
|
+
(prefix) => toolCall.tool.startsWith(prefix) && toolCall.tool.includes(skillName)
|
|
15214
15252
|
)) {
|
|
15215
15253
|
triggered = true;
|
|
15216
|
-
evidence = `Skill tool invoked via tool name "${
|
|
15217
|
-
|
|
15254
|
+
evidence = `Skill tool invoked via tool name "${toolCall.tool}"`;
|
|
15255
|
+
break;
|
|
15256
|
+
} else if (matcher.readTools.includes(toolCall.tool)) {
|
|
15218
15257
|
const filePath = this.readPathFromInput(input, matcher);
|
|
15219
15258
|
if (filePath.includes(skillName)) {
|
|
15220
15259
|
triggered = true;
|
|
15221
15260
|
evidence = `Read tool loaded skill file: ${filePath}`;
|
|
15261
|
+
break;
|
|
15222
15262
|
}
|
|
15223
15263
|
} else if (matcher.readToolPrefixes?.some(
|
|
15224
|
-
(prefix) =>
|
|
15264
|
+
(prefix) => toolCall.tool.startsWith(prefix) && toolCall.tool.includes(skillName)
|
|
15225
15265
|
)) {
|
|
15226
15266
|
triggered = true;
|
|
15227
|
-
evidence = `Read tool loaded skill file via tool name "${
|
|
15267
|
+
evidence = `Read tool loaded skill file via tool name "${toolCall.tool}"`;
|
|
15268
|
+
break;
|
|
15228
15269
|
}
|
|
15229
15270
|
}
|
|
15230
15271
|
const pass = triggered === shouldTrigger;
|
|
@@ -15246,7 +15287,7 @@ var SkillTriggerEvaluator = class {
|
|
|
15246
15287
|
verdict: "fail",
|
|
15247
15288
|
assertions: [
|
|
15248
15289
|
{
|
|
15249
|
-
text: shouldTrigger ?
|
|
15290
|
+
text: shouldTrigger ? allToolCalls.length > 0 ? `Skill "${skillName}" not found in ${allToolCalls.length} tool call(s)` : "No tool calls recorded" : evidence || `Skill "${skillName}" triggered unexpectedly`,
|
|
15250
15291
|
passed: false
|
|
15251
15292
|
}
|
|
15252
15293
|
],
|