@agentv/core 2.5.8 → 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/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  readTextFile,
11
11
  resolveFileReference,
12
12
  resolveTargetDefinition
13
- } from "./chunk-LGQ5OPJD.js";
13
+ } from "./chunk-SSPAANFZ.js";
14
14
 
15
15
  // src/evaluation/types.ts
16
16
  var TEST_MESSAGE_ROLE_VALUES = ["system", "user", "assistant", "tool"];
@@ -5128,13 +5128,13 @@ async function loadPiModules() {
5128
5128
  if (!piAgentModule || !piAiModule) {
5129
5129
  try {
5130
5130
  [piAgentModule, piAiModule] = await Promise.all([
5131
- import("@mariozechner/pi-agent"),
5131
+ import("@mariozechner/pi-agent-core"),
5132
5132
  import("@mariozechner/pi-ai")
5133
5133
  ]);
5134
5134
  } catch (error) {
5135
5135
  throw new Error(
5136
5136
  `Failed to load pi-agent-sdk dependencies. Please install them:
5137
- npm install @mariozechner/pi-agent @mariozechner/pi-ai
5137
+ npm install @mariozechner/pi-agent-core @mariozechner/pi-ai
5138
5138
 
5139
5139
  Original error: ${error instanceof Error ? error.message : String(error)}`
5140
5140
  );
@@ -5142,7 +5142,6 @@ Original error: ${error instanceof Error ? error.message : String(error)}`
5142
5142
  }
5143
5143
  return {
5144
5144
  Agent: piAgentModule.Agent,
5145
- ProviderTransport: piAgentModule.ProviderTransport,
5146
5145
  getModel: piAiModule.getModel,
5147
5146
  getEnvApiKey: piAiModule.getEnvApiKey
5148
5147
  };
@@ -5162,17 +5161,12 @@ var PiAgentSdkProvider = class {
5162
5161
  if (request.signal?.aborted) {
5163
5162
  throw new Error("Pi agent SDK request was aborted before execution");
5164
5163
  }
5165
- const { Agent, ProviderTransport, getModel, getEnvApiKey } = await loadPiModules();
5164
+ const { Agent, getModel, getEnvApiKey } = await loadPiModules();
5166
5165
  const startTime = Date.now();
5167
5166
  const providerName = this.config.provider ?? "anthropic";
5168
5167
  const modelId = this.config.model ?? "claude-sonnet-4-20250514";
5169
5168
  const model = getModel(providerName, modelId);
5170
5169
  const systemPrompt = this.config.systemPrompt ?? "Answer directly and concisely.";
5171
- const transport = new ProviderTransport({
5172
- getApiKey: async (provider) => {
5173
- return this.config.apiKey ?? getEnvApiKey(provider) ?? void 0;
5174
- }
5175
- });
5176
5170
  const agent = new Agent({
5177
5171
  initialState: {
5178
5172
  systemPrompt,
@@ -5181,7 +5175,9 @@ var PiAgentSdkProvider = class {
5181
5175
  // No tools for simple Q&A
5182
5176
  messages: []
5183
5177
  },
5184
- transport
5178
+ getApiKey: async (provider) => {
5179
+ return this.config.apiKey ?? getEnvApiKey(provider) ?? void 0;
5180
+ }
5185
5181
  });
5186
5182
  const outputMessages = [];
5187
5183
  let finalAssistantContent = "";
@@ -5271,10 +5267,10 @@ function extractToolCalls2(content) {
5271
5267
  continue;
5272
5268
  }
5273
5269
  const p = part;
5274
- if (p.type === "tool_use" && typeof p.name === "string") {
5270
+ if (p.type === "toolCall" && typeof p.name === "string") {
5275
5271
  toolCalls.push({
5276
5272
  tool: p.name,
5277
- input: p.input,
5273
+ input: p.arguments,
5278
5274
  id: typeof p.id === "string" ? p.id : void 0
5279
5275
  });
5280
5276
  }
@@ -8970,6 +8966,7 @@ var FieldAccuracyEvaluator = class {
8970
8966
  score: clampScore(score),
8971
8967
  verdict: scoreToVerdict(score),
8972
8968
  hits: hits.slice(0, 4),
8969
+ // Cap at 4 to keep output concise
8973
8970
  misses: misses.slice(0, 4),
8974
8971
  expectedAspectCount: results.length,
8975
8972
  reasoning