@apo-ai/sdk 0.7.0 → 0.8.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.
@@ -1,4 +1,4 @@
1
- import { A as AgentTaskTraceContext } from '../../tracing-DVLUqD-i.js';
1
+ import { A as AgentTaskTraceContext } from '../../tracing-CevT0hQg.js';
2
2
 
3
3
  /**
4
4
  * Vercel AI SDK tracing integration for apo.
@@ -2,8 +2,8 @@
2
2
  // Do not edit by hand — edit the src/ originals and rebuild.
3
3
  import {
4
4
  createApoTracer
5
- } from "../../chunk-QHRWPVPZ.js";
6
- import "../../chunk-HWZVL6TS.js";
5
+ } from "../../chunk-CKB3SUDO.js";
6
+ import "../../chunk-HLRXQAZ5.js";
7
7
  export {
8
8
  createApoTracer
9
9
  };
@@ -1,4 +1,4 @@
1
- import { A as AgentTaskTraceContext } from '../../tracing-DVLUqD-i.js';
1
+ import { A as AgentTaskTraceContext } from '../../tracing-CevT0hQg.js';
2
2
 
3
3
  /**
4
4
  * Anthropic JS SDK tracing integration for apo.
@@ -2,8 +2,8 @@
2
2
  // Do not edit by hand — edit the src/ originals and rebuild.
3
3
  import {
4
4
  createApoAnthropic
5
- } from "../../chunk-SZDSIPXC.js";
6
- import "../../chunk-GDB6SDGN.js";
5
+ } from "../../chunk-43OI6GP7.js";
6
+ import "../../chunk-3OQ3JBFJ.js";
7
7
  export {
8
8
  createApoAnthropic
9
9
  };
@@ -1,4 +1,4 @@
1
- import { A as AgentTaskTraceContext } from '../../tracing-DVLUqD-i.js';
1
+ import { A as AgentTaskTraceContext } from '../../tracing-CevT0hQg.js';
2
2
 
3
3
  /**
4
4
  * OpenAI JS SDK tracing integration for apo.
@@ -22,7 +22,7 @@ import { A as AgentTaskTraceContext } from '../../tracing-DVLUqD-i.js';
22
22
  * { trace, parentSpanId, taskId: ctx.task.id, turnNumber }
23
23
  * );
24
24
  * const response = await client.chat.completions.create({
25
- * model: "google/gemini-2.5-flash-lite",
25
+ * model: "deepseek/deepseek-v4.1-flash",
26
26
  * messages: [{ role: "user", content: String(turn) }],
27
27
  * tools: [...],
28
28
  * });
@@ -2,8 +2,8 @@
2
2
  // Do not edit by hand — edit the src/ originals and rebuild.
3
3
  import {
4
4
  createApoOpenAI
5
- } from "../../chunk-6ZRW5IW6.js";
6
- import "../../chunk-GDB6SDGN.js";
5
+ } from "../../chunk-3B3L2H4Y.js";
6
+ import "../../chunk-3OQ3JBFJ.js";
7
7
  export {
8
8
  createApoOpenAI
9
9
  };
@@ -1,4 +1,4 @@
1
- import { A as AgentTaskTraceContext, a as AgentTaskTraceOptions } from '../tracing-DVLUqD-i.js';
1
+ import { A as AgentTaskTraceContext, a as AgentTaskTraceOptions } from '../tracing-CevT0hQg.js';
2
2
  export { CreateApoTracerOptions, createApoTracer } from './integrations/ai-sdk.js';
3
3
  export { CreateApoOpenAIOptions, createApoOpenAI } from './integrations/openai.js';
4
4
  export { CreateApoAnthropicOptions, createApoAnthropic } from './integrations/anthropic.js';
@@ -313,15 +313,18 @@ type TypedAdapterDefinition<TName extends string, TDeliverables extends Record<s
313
313
  * it must never silently pass. Value assertions (``t.check``) and LLM
314
314
  * assertions (``t.judge``) do not consult trace capabilities and retain
315
315
  * their existing pass/fail behavior.
316
+ * - ``"error"`` → ``pass=false``. An LLM judge produced no verdict: it was
317
+ * unreachable, returned an HTTP error, or sent an empty or truncated reply
318
+ * (after one retry). The check's quality is unknown, not failed.
316
319
  */
317
- type AssertionOutcome = "pass" | "fail" | "unsupported";
320
+ type AssertionOutcome = "pass" | "fail" | "unsupported" | "error";
318
321
  /**
319
322
  * Metadata about an LLM judge call. Populated by evaluators that use an
320
323
  * LLM to make their pass/fail decision. All fields optional so code-only
321
324
  * evaluators can leave this undefined.
322
325
  */
323
326
  type JudgeMetadata = {
324
- /** Model identifier, e.g. ``"google/gemini-2.5-flash-lite"``. */
327
+ /** Model identifier, e.g. ``"deepseek/deepseek-v4.1-flash"``. */
325
328
  model?: string;
326
329
  /**
327
330
  * Which response contract elicited this judgment (#163): reasoning-first
@@ -357,6 +360,15 @@ type JudgeMetadata = {
357
360
  * content-hashed evidence manifest (replay audit backbone).
358
361
  */
359
362
  session?: AgentJudgeSession;
363
+ /**
364
+ * Trace span id of this judgment itself (issue #288): the span the trace
365
+ * context opens around the judge call / agent session. Lets any surface
366
+ * holding this metadata deep-link into the judge's span in the trace view
367
+ * (`/traces/{trace_run_id}?observation={span_id}`) instead of re-finding
368
+ * it by name. Absent when the run is untraced or the span id can't be
369
+ * trusted (the noop trace context's sentinel).
370
+ */
371
+ span_id?: string;
360
372
  /**
361
373
  * Second-grader evidence: a typed-decision model (Jev via OpenRouter's
362
374
  * `/alpha/decisions`) graded the same deliverable + instruction alongside
@@ -508,6 +520,16 @@ type EvaluationItemResult = {
508
520
  id: string;
509
521
  pass: boolean;
510
522
  reasoning: string;
523
+ /**
524
+ * The outcome category, rolled up from this check's assertions. Set only
525
+ * when the check failed and *every* failing assertion failed for lack of
526
+ * a verdict: ``"error"`` — the judge never answered (unreachable, HTTP
527
+ * error, empty reply), so the check's quality is unknown, not failed;
528
+ * ``"unsupported"`` — the trace projection lacked the evidence. Absent
529
+ * when the check passed or genuinely failed on evidence, so a real FAIL
530
+ * is never masked by an incidental judge error alongside it (issue #323).
531
+ */
532
+ outcome?: AssertionOutcome;
511
533
  /** The rubric instruction from the task definition ("PASS if …"). */
512
534
  instruction?: string;
513
535
  /** Name of the deliverable this check was evaluated against. */
@@ -782,7 +804,7 @@ type ToolCallOptions = {
782
804
  * `judge` layer of its own; see {@link resolveJudgeConfig} for precedence.
783
805
  */
784
806
  type JudgeConfig = {
785
- /** Model id, e.g. ``"google/gemini-2.5-flash-lite"``. */
807
+ /** Model id, e.g. ``"deepseek/deepseek-v4.1-flash"``. */
786
808
  model: string;
787
809
  /** Override the OpenRouter/OpenAI-compatible base URL. */
788
810
  baseURL?: string;
@@ -1404,11 +1426,19 @@ interface RejudgeOptions {
1404
1426
  /** Progress sink for human-facing operators (CLI prints to stderr). */
1405
1427
  onProgress?: (message: string) => void;
1406
1428
  }
1407
- /** Per-check pass counts across samples — "fails 2 of 5", not "failed". */
1429
+ /**
1430
+ * Per-check pass counts across samples — "fails 2 of 5", not "failed".
1431
+ *
1432
+ * Samples where the check errored (judge produced no verdict) are tracked
1433
+ * in {@link errored} and count as neither pass nor fail: an unreachable
1434
+ * judge says nothing about stability, so it must not read as a flaky fail.
1435
+ */
1408
1436
  interface RejudgeCheckStability {
1409
1437
  check_id: string;
1410
1438
  passes: number;
1411
1439
  samples: number;
1440
+ /** Samples that produced no verdict (judge error) — issue #323. */
1441
+ errored?: number;
1412
1442
  }
1413
1443
  interface RejudgeOutcome {
1414
1444
  runId: string;