@agentv/core 2.5.6 → 2.6.0
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/{chunk-LGQ5OPJD.js → chunk-SSPAANFZ.js} +1 -1
- package/dist/chunk-SSPAANFZ.js.map +1 -0
- package/dist/evaluation/validation/index.cjs.map +1 -1
- package/dist/evaluation/validation/index.js +1 -1
- package/dist/index.cjs +9 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -13
- package/dist/index.js.map +1 -1
- package/package.json +5 -8
- package/dist/chunk-LGQ5OPJD.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -5326,13 +5326,13 @@ async function loadPiModules() {
|
|
|
5326
5326
|
if (!piAgentModule || !piAiModule) {
|
|
5327
5327
|
try {
|
|
5328
5328
|
[piAgentModule, piAiModule] = await Promise.all([
|
|
5329
|
-
import("@mariozechner/pi-agent"),
|
|
5329
|
+
import("@mariozechner/pi-agent-core"),
|
|
5330
5330
|
import("@mariozechner/pi-ai")
|
|
5331
5331
|
]);
|
|
5332
5332
|
} catch (error) {
|
|
5333
5333
|
throw new Error(
|
|
5334
5334
|
`Failed to load pi-agent-sdk dependencies. Please install them:
|
|
5335
|
-
npm install @mariozechner/pi-agent @mariozechner/pi-ai
|
|
5335
|
+
npm install @mariozechner/pi-agent-core @mariozechner/pi-ai
|
|
5336
5336
|
|
|
5337
5337
|
Original error: ${error instanceof Error ? error.message : String(error)}`
|
|
5338
5338
|
);
|
|
@@ -5340,7 +5340,6 @@ Original error: ${error instanceof Error ? error.message : String(error)}`
|
|
|
5340
5340
|
}
|
|
5341
5341
|
return {
|
|
5342
5342
|
Agent: piAgentModule.Agent,
|
|
5343
|
-
ProviderTransport: piAgentModule.ProviderTransport,
|
|
5344
5343
|
getModel: piAiModule.getModel,
|
|
5345
5344
|
getEnvApiKey: piAiModule.getEnvApiKey
|
|
5346
5345
|
};
|
|
@@ -5360,17 +5359,12 @@ var PiAgentSdkProvider = class {
|
|
|
5360
5359
|
if (request.signal?.aborted) {
|
|
5361
5360
|
throw new Error("Pi agent SDK request was aborted before execution");
|
|
5362
5361
|
}
|
|
5363
|
-
const { Agent,
|
|
5362
|
+
const { Agent, getModel, getEnvApiKey } = await loadPiModules();
|
|
5364
5363
|
const startTime = Date.now();
|
|
5365
5364
|
const providerName = this.config.provider ?? "anthropic";
|
|
5366
5365
|
const modelId = this.config.model ?? "claude-sonnet-4-20250514";
|
|
5367
5366
|
const model = getModel(providerName, modelId);
|
|
5368
5367
|
const systemPrompt = this.config.systemPrompt ?? "Answer directly and concisely.";
|
|
5369
|
-
const transport = new ProviderTransport({
|
|
5370
|
-
getApiKey: async (provider) => {
|
|
5371
|
-
return this.config.apiKey ?? getEnvApiKey(provider) ?? void 0;
|
|
5372
|
-
}
|
|
5373
|
-
});
|
|
5374
5368
|
const agent = new Agent({
|
|
5375
5369
|
initialState: {
|
|
5376
5370
|
systemPrompt,
|
|
@@ -5379,7 +5373,9 @@ var PiAgentSdkProvider = class {
|
|
|
5379
5373
|
// No tools for simple Q&A
|
|
5380
5374
|
messages: []
|
|
5381
5375
|
},
|
|
5382
|
-
|
|
5376
|
+
getApiKey: async (provider) => {
|
|
5377
|
+
return this.config.apiKey ?? getEnvApiKey(provider) ?? void 0;
|
|
5378
|
+
}
|
|
5383
5379
|
});
|
|
5384
5380
|
const outputMessages = [];
|
|
5385
5381
|
let finalAssistantContent = "";
|
|
@@ -5469,10 +5465,10 @@ function extractToolCalls2(content) {
|
|
|
5469
5465
|
continue;
|
|
5470
5466
|
}
|
|
5471
5467
|
const p = part;
|
|
5472
|
-
if (p.type === "
|
|
5468
|
+
if (p.type === "toolCall" && typeof p.name === "string") {
|
|
5473
5469
|
toolCalls.push({
|
|
5474
5470
|
tool: p.name,
|
|
5475
|
-
input: p.
|
|
5471
|
+
input: p.arguments,
|
|
5476
5472
|
id: typeof p.id === "string" ? p.id : void 0
|
|
5477
5473
|
});
|
|
5478
5474
|
}
|
|
@@ -10078,6 +10074,7 @@ var FieldAccuracyEvaluator = class {
|
|
|
10078
10074
|
score: clampScore(score),
|
|
10079
10075
|
verdict: scoreToVerdict(score),
|
|
10080
10076
|
hits: hits.slice(0, 4),
|
|
10077
|
+
// Cap at 4 to keep output concise
|
|
10081
10078
|
misses: misses.slice(0, 4),
|
|
10082
10079
|
expectedAspectCount: results.length,
|
|
10083
10080
|
reasoning
|