@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.js
CHANGED
|
@@ -5583,7 +5583,7 @@ ${basePrompt}` : basePrompt;
|
|
|
5583
5583
|
if (itemType === "command_execution") {
|
|
5584
5584
|
completedToolCalls.push({
|
|
5585
5585
|
tool: "command_execution",
|
|
5586
|
-
input: item.command,
|
|
5586
|
+
input: { command: item.command },
|
|
5587
5587
|
output: item.aggregated_output,
|
|
5588
5588
|
id: item.id
|
|
5589
5589
|
});
|
|
@@ -6442,11 +6442,22 @@ async function loadCopilotSdk() {
|
|
|
6442
6442
|
try {
|
|
6443
6443
|
copilotSdkModule = await import("@github/copilot-sdk");
|
|
6444
6444
|
} catch (error) {
|
|
6445
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
6446
|
+
if (message.includes("vscode-jsonrpc")) {
|
|
6447
|
+
throw new Error(
|
|
6448
|
+
`Failed to load @github/copilot-sdk due to a known ESM compatibility issue with vscode-jsonrpc (https://github.com/github/copilot-sdk/issues/710).
|
|
6449
|
+
|
|
6450
|
+
Workarounds:
|
|
6451
|
+
- Use the copilot-cli target instead (recommended): set target type to "copilot-cli" in your eval YAML
|
|
6452
|
+
- If running under Node.js 24+: set NODE_OPTIONS="--experimental-specifier-resolution=node"
|
|
6453
|
+
- Wait for vscode-jsonrpc@9.0.0 stable to be released upstream`
|
|
6454
|
+
);
|
|
6455
|
+
}
|
|
6445
6456
|
throw new Error(
|
|
6446
6457
|
`Failed to load @github/copilot-sdk. Please install it:
|
|
6447
6458
|
npm install @github/copilot-sdk
|
|
6448
6459
|
|
|
6449
|
-
Original error: ${
|
|
6460
|
+
Original error: ${message}`
|
|
6450
6461
|
);
|
|
6451
6462
|
}
|
|
6452
6463
|
}
|
|
@@ -7669,6 +7680,13 @@ function extractToolCalls4(content) {
|
|
|
7669
7680
|
id: typeof p.id === "string" ? p.id : void 0
|
|
7670
7681
|
});
|
|
7671
7682
|
}
|
|
7683
|
+
if (p.type === "toolCall" && typeof p.name === "string") {
|
|
7684
|
+
toolCalls.push({
|
|
7685
|
+
tool: p.name,
|
|
7686
|
+
input: p.arguments,
|
|
7687
|
+
id: typeof p.id === "string" ? p.id : void 0
|
|
7688
|
+
});
|
|
7689
|
+
}
|
|
7672
7690
|
if (p.type === "tool_result" && typeof p.tool_use_id === "string") {
|
|
7673
7691
|
const existing = toolCalls.find((tc) => tc.id === p.tool_use_id);
|
|
7674
7692
|
if (existing) {
|
|
@@ -11979,12 +11997,31 @@ var COPILOT_MATCHER = {
|
|
|
11979
11997
|
readToolPrefixes: ["Viewing "],
|
|
11980
11998
|
readInputFields: ["file_path", "path"]
|
|
11981
11999
|
};
|
|
12000
|
+
var PI_CODING_AGENT_MATCHER = {
|
|
12001
|
+
skillTools: [],
|
|
12002
|
+
skillInputField: "skill",
|
|
12003
|
+
readTools: ["read"],
|
|
12004
|
+
readInputField: "path",
|
|
12005
|
+
readInputFields: ["path", "file_path", "filePath"]
|
|
12006
|
+
};
|
|
12007
|
+
var CODEX_MATCHER = {
|
|
12008
|
+
skillTools: [],
|
|
12009
|
+
skillInputField: "skill",
|
|
12010
|
+
readTools: ["command_execution"],
|
|
12011
|
+
readInputField: "command",
|
|
12012
|
+
skillToolPrefixes: ["mcp:"],
|
|
12013
|
+
readToolPrefixes: ["mcp:"],
|
|
12014
|
+
readInputFields: ["command", "path", "file_path", "filePath"]
|
|
12015
|
+
};
|
|
11982
12016
|
var PROVIDER_TOOL_SEMANTICS = {
|
|
11983
12017
|
claude: CLAUDE_MATCHER,
|
|
11984
12018
|
"claude-cli": CLAUDE_MATCHER,
|
|
11985
12019
|
"claude-sdk": CLAUDE_MATCHER,
|
|
11986
|
-
|
|
11987
|
-
"pi-agent
|
|
12020
|
+
codex: CODEX_MATCHER,
|
|
12021
|
+
"pi-coding-agent": PI_CODING_AGENT_MATCHER,
|
|
12022
|
+
// pi-agent-sdk has no tools, so skill detection is a no-op. Kept for completeness.
|
|
12023
|
+
// TODO: consider removing pi-agent-sdk provider entirely.
|
|
12024
|
+
"pi-agent-sdk": PI_CODING_AGENT_MATCHER,
|
|
11988
12025
|
"copilot-cli": COPILOT_MATCHER,
|
|
11989
12026
|
"copilot-sdk": COPILOT_MATCHER,
|
|
11990
12027
|
vscode: COPILOT_MATCHER,
|
|
@@ -12008,33 +12045,37 @@ var SkillTriggerEvaluator = class {
|
|
|
12008
12045
|
const shouldTrigger = this.config.should_trigger !== false;
|
|
12009
12046
|
const providerKind = context.provider?.kind;
|
|
12010
12047
|
const matcher = this.resolveMatcher(providerKind);
|
|
12011
|
-
const
|
|
12048
|
+
const allToolCalls = (context.output ?? []).flatMap((msg) => msg.toolCalls ?? []);
|
|
12012
12049
|
let triggered = false;
|
|
12013
12050
|
let evidence = "";
|
|
12014
|
-
|
|
12015
|
-
const input =
|
|
12016
|
-
if (matcher.skillTools.includes(
|
|
12051
|
+
for (const toolCall of allToolCalls) {
|
|
12052
|
+
const input = toolCall.input ?? {};
|
|
12053
|
+
if (matcher.skillTools.includes(toolCall.tool)) {
|
|
12017
12054
|
const skillArg = String(input[matcher.skillInputField] ?? "");
|
|
12018
12055
|
if (skillArg.includes(skillName)) {
|
|
12019
12056
|
triggered = true;
|
|
12020
12057
|
evidence = `Skill tool invoked with ${matcher.skillInputField}="${skillArg}"`;
|
|
12058
|
+
break;
|
|
12021
12059
|
}
|
|
12022
12060
|
} else if (matcher.skillToolPrefixes?.some(
|
|
12023
|
-
(prefix) =>
|
|
12061
|
+
(prefix) => toolCall.tool.startsWith(prefix) && toolCall.tool.includes(skillName)
|
|
12024
12062
|
)) {
|
|
12025
12063
|
triggered = true;
|
|
12026
|
-
evidence = `Skill tool invoked via tool name "${
|
|
12027
|
-
|
|
12064
|
+
evidence = `Skill tool invoked via tool name "${toolCall.tool}"`;
|
|
12065
|
+
break;
|
|
12066
|
+
} else if (matcher.readTools.includes(toolCall.tool)) {
|
|
12028
12067
|
const filePath = this.readPathFromInput(input, matcher);
|
|
12029
12068
|
if (filePath.includes(skillName)) {
|
|
12030
12069
|
triggered = true;
|
|
12031
12070
|
evidence = `Read tool loaded skill file: ${filePath}`;
|
|
12071
|
+
break;
|
|
12032
12072
|
}
|
|
12033
12073
|
} else if (matcher.readToolPrefixes?.some(
|
|
12034
|
-
(prefix) =>
|
|
12074
|
+
(prefix) => toolCall.tool.startsWith(prefix) && toolCall.tool.includes(skillName)
|
|
12035
12075
|
)) {
|
|
12036
12076
|
triggered = true;
|
|
12037
|
-
evidence = `Read tool loaded skill file via tool name "${
|
|
12077
|
+
evidence = `Read tool loaded skill file via tool name "${toolCall.tool}"`;
|
|
12078
|
+
break;
|
|
12038
12079
|
}
|
|
12039
12080
|
}
|
|
12040
12081
|
const pass = triggered === shouldTrigger;
|
|
@@ -12056,7 +12097,7 @@ var SkillTriggerEvaluator = class {
|
|
|
12056
12097
|
verdict: "fail",
|
|
12057
12098
|
assertions: [
|
|
12058
12099
|
{
|
|
12059
|
-
text: shouldTrigger ?
|
|
12100
|
+
text: shouldTrigger ? allToolCalls.length > 0 ? `Skill "${skillName}" not found in ${allToolCalls.length} tool call(s)` : "No tool calls recorded" : evidence || `Skill "${skillName}" triggered unexpectedly`,
|
|
12060
12101
|
passed: false
|
|
12061
12102
|
}
|
|
12062
12103
|
],
|