@plune-ai/cli 0.34.6 → 0.35.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/README.md +1 -0
- package/dist/cli.cjs +10557 -7368
- package/dist/index.cjs +2407 -128
- package/dist/index.d.cts +447 -1
- package/dist/index.d.ts +447 -1
- package/dist/index.js +2428 -127
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,88 @@ interface RowResult {
|
|
|
125
125
|
* which is why `schemaVersion` stays 1.
|
|
126
126
|
*/
|
|
127
127
|
inconclusive?: RowInconclusive;
|
|
128
|
+
/**
|
|
129
|
+
* Every repeat of the row when its eval sets `runs` above 1. The row's own `output`,
|
|
130
|
+
* `assertions` and `error` are those of the first attempt whose state matches the row's verdict;
|
|
131
|
+
* its `usage`, `cache_saved` and `latency_ms` are sums over the attempts, and `cached` is true
|
|
132
|
+
* only when every attempt came from the cache. `pass_threshold` here is the eval's share of runs,
|
|
133
|
+
* not the llm-judge score floor. On a dry run `results` is empty: nothing ran, the cost is the
|
|
134
|
+
* estimate times `runs`. Optional and additive: absent without repeats, `schemaVersion` stays 1.
|
|
135
|
+
*/
|
|
136
|
+
attempts?: {
|
|
137
|
+
runs: number;
|
|
138
|
+
pass_threshold: number;
|
|
139
|
+
passed: number;
|
|
140
|
+
failed: number;
|
|
141
|
+
errored: number;
|
|
142
|
+
results: {
|
|
143
|
+
output: string | null;
|
|
144
|
+
cached: boolean;
|
|
145
|
+
usage?: Usage;
|
|
146
|
+
latency_ms?: number;
|
|
147
|
+
error?: RunError;
|
|
148
|
+
assertions: AssertionResultRecord[];
|
|
149
|
+
cache_saved?: {
|
|
150
|
+
input_tokens: number;
|
|
151
|
+
output_tokens: number;
|
|
152
|
+
cost_usd: number;
|
|
153
|
+
};
|
|
154
|
+
}[];
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* The tool loop of an eval with an `mcp` server: what the server listed, every model step and every call. Optional
|
|
158
|
+
* and additive: absent on a plain eval, `schemaVersion` stays 1. With `runs` above 1, the loop of the attempt the
|
|
159
|
+
* row shows.
|
|
160
|
+
*/
|
|
161
|
+
agent?: AgentTranscript;
|
|
162
|
+
}
|
|
163
|
+
/** One tool call the model asked for, under the name the server gave the tool. */
|
|
164
|
+
interface AgentCall {
|
|
165
|
+
id: string;
|
|
166
|
+
name: string;
|
|
167
|
+
args: unknown;
|
|
168
|
+
/** False when it never reached the server: a tool the model was not offered, arguments that are not an object, or the loop stopped first. */
|
|
169
|
+
executed: boolean;
|
|
170
|
+
is_error: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* `content`: the tool answered `isError: true`; `protocol`: a JSON-RPC error; `timeout`: no answer within
|
|
173
|
+
* `tool_timeout_ms`; `not-offered`: a tool the model was not given; `bad-arguments`: not a JSON object.
|
|
174
|
+
*/
|
|
175
|
+
error_kind?: 'content' | 'protocol' | 'timeout' | 'not-offered' | 'bad-arguments';
|
|
176
|
+
duration_ms?: number;
|
|
177
|
+
/** The answer as text: `bytes` is its size before `text` was cut to the stored excerpt. */
|
|
178
|
+
result?: {
|
|
179
|
+
text: string;
|
|
180
|
+
bytes: number;
|
|
181
|
+
truncated: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
interface AgentStep {
|
|
185
|
+
/** From 1. A call's result reaches the model in the next step. */
|
|
186
|
+
index: number;
|
|
187
|
+
text: string;
|
|
188
|
+
finish_reason?: string;
|
|
189
|
+
usage: Usage;
|
|
190
|
+
/** In the order the model asked for them; they run one after another. */
|
|
191
|
+
calls: AgentCall[];
|
|
192
|
+
}
|
|
193
|
+
interface AgentTranscript {
|
|
194
|
+
/** The name in `mcp.servers`. */
|
|
195
|
+
server: string;
|
|
196
|
+
/** Every tool the server listed, and whether the model was offered it (`allowed_tools`). */
|
|
197
|
+
tools: {
|
|
198
|
+
name: string;
|
|
199
|
+
offered: boolean;
|
|
200
|
+
annotations?: Record<string, unknown>;
|
|
201
|
+
}[];
|
|
202
|
+
steps: AgentStep[];
|
|
203
|
+
/** `complete`: the model gave its final answer; `limit`: a limit stopped the loop (`limit` names it); `error`: see the row's `error`. */
|
|
204
|
+
stop: {
|
|
205
|
+
reason: 'complete' | 'limit' | 'error';
|
|
206
|
+
limit?: 'max_steps' | 'max_tool_calls' | 'max_total_tokens' | 'timeout_ms' | 'tool_timeout_ms';
|
|
207
|
+
};
|
|
208
|
+
/** `partial` when the loop did not end on its own or a stored excerpt was cut: what is missing was not seen. */
|
|
209
|
+
collection: 'complete' | 'partial';
|
|
128
210
|
}
|
|
129
211
|
interface EvalResult {
|
|
130
212
|
id: string;
|
|
@@ -193,6 +275,7 @@ interface LlmJudgeAssertion {
|
|
|
193
275
|
type: 'llm-judge';
|
|
194
276
|
criteria: string;
|
|
195
277
|
provider?: Partial<ProviderConfig>;
|
|
278
|
+
/** The minimum judge score (0–1). Not the eval's `pass_threshold`, which is a share of runs. */
|
|
196
279
|
pass_threshold?: number;
|
|
197
280
|
}
|
|
198
281
|
interface SemanticSimilarityAssertion {
|
|
@@ -216,7 +299,79 @@ interface ContextPrecisionAssertion {
|
|
|
216
299
|
question: string;
|
|
217
300
|
threshold?: number;
|
|
218
301
|
}
|
|
219
|
-
|
|
302
|
+
interface ToolCalledAssertion {
|
|
303
|
+
type: 'tool-called';
|
|
304
|
+
tool: string;
|
|
305
|
+
/** Default 1. */
|
|
306
|
+
min_count?: number;
|
|
307
|
+
}
|
|
308
|
+
interface ToolNotCalledAssertion {
|
|
309
|
+
type: 'tool-not-called';
|
|
310
|
+
tool: string;
|
|
311
|
+
}
|
|
312
|
+
interface ToolArgsAssertion {
|
|
313
|
+
type: 'tool-args';
|
|
314
|
+
tool: string;
|
|
315
|
+
args: Record<string, unknown>;
|
|
316
|
+
/** `partial` (default): every expected key, deeply; `exact`: the same arguments; `ignore`: any arguments. */
|
|
317
|
+
match?: 'partial' | 'exact' | 'ignore';
|
|
318
|
+
/** Default 1. */
|
|
319
|
+
min_count?: number;
|
|
320
|
+
}
|
|
321
|
+
interface ToolOrderAssertion {
|
|
322
|
+
type: 'tool-order';
|
|
323
|
+
tools: string[];
|
|
324
|
+
/** Default false: other calls may come between. True: the calls are exactly `tools`. */
|
|
325
|
+
strict?: boolean;
|
|
326
|
+
}
|
|
327
|
+
interface OnlyToolsAssertion {
|
|
328
|
+
type: 'only-tools';
|
|
329
|
+
/** Empty: no call at all. */
|
|
330
|
+
tools: string[];
|
|
331
|
+
}
|
|
332
|
+
interface FirstToolAssertion {
|
|
333
|
+
type: 'first-tool';
|
|
334
|
+
tool: string;
|
|
335
|
+
}
|
|
336
|
+
interface NoToolErrorsAssertion {
|
|
337
|
+
type: 'no-tool-errors';
|
|
338
|
+
tool?: string;
|
|
339
|
+
}
|
|
340
|
+
/** At least one of `min` and `max`; both inclusive. */
|
|
341
|
+
interface ToolCallCountAssertion {
|
|
342
|
+
type: 'tool-call-count';
|
|
343
|
+
tool?: string;
|
|
344
|
+
min?: number;
|
|
345
|
+
max?: number;
|
|
346
|
+
}
|
|
347
|
+
interface NoRepeatedCallAssertion {
|
|
348
|
+
type: 'no-repeated-call';
|
|
349
|
+
tool?: string;
|
|
350
|
+
}
|
|
351
|
+
interface TokenBudgetAssertion {
|
|
352
|
+
type: 'token-budget';
|
|
353
|
+
max: number;
|
|
354
|
+
}
|
|
355
|
+
interface ToolLatencyAssertion {
|
|
356
|
+
type: 'tool-latency';
|
|
357
|
+
max_ms: number;
|
|
358
|
+
tool?: string;
|
|
359
|
+
}
|
|
360
|
+
interface ToolResultSizeAssertion {
|
|
361
|
+
type: 'tool-result-size';
|
|
362
|
+
max_bytes: number;
|
|
363
|
+
tool?: string;
|
|
364
|
+
}
|
|
365
|
+
interface ToolResultSchemaAssertion {
|
|
366
|
+
type: 'tool-result-schema';
|
|
367
|
+
schema: object;
|
|
368
|
+
tool?: string;
|
|
369
|
+
}
|
|
370
|
+
interface NoDestructiveToolAssertion {
|
|
371
|
+
type: 'no-destructive-tool';
|
|
372
|
+
}
|
|
373
|
+
type ToolCallAssertion = ToolCalledAssertion | ToolNotCalledAssertion | ToolArgsAssertion | ToolOrderAssertion | OnlyToolsAssertion | FirstToolAssertion | NoToolErrorsAssertion | ToolCallCountAssertion | NoRepeatedCallAssertion | TokenBudgetAssertion | ToolLatencyAssertion | ToolResultSizeAssertion | ToolResultSchemaAssertion | NoDestructiveToolAssertion;
|
|
374
|
+
type AssertionConfig = ExactMatchAssertion | ContainsAssertion | ContainsAnyAssertion | ContainsAllAssertion | JsonSchemaAssertion | LlmJudgeAssertion | SemanticSimilarityAssertion | FaithfulnessAssertion | AnswerRelevanceAssertion | ContextPrecisionAssertion | ToolCallAssertion;
|
|
220
375
|
interface EvalConfig {
|
|
221
376
|
id: string;
|
|
222
377
|
description?: string;
|
|
@@ -226,6 +381,42 @@ interface EvalConfig {
|
|
|
226
381
|
prompt_file?: string;
|
|
227
382
|
dataset: DatasetRef;
|
|
228
383
|
assertions: AssertionConfig[];
|
|
384
|
+
/** Times each row runs, one after another (1–100, default 1). Overrides the root `runs`. */
|
|
385
|
+
runs?: number;
|
|
386
|
+
/** Share of a row's runs that must pass, in (0, 1] (default 1). Overrides the root value. */
|
|
387
|
+
pass_threshold?: number;
|
|
388
|
+
/** The MCP server this eval's model may use, from the root `mcp.servers`. */
|
|
389
|
+
mcp?: EvalMcpConfig;
|
|
390
|
+
}
|
|
391
|
+
/** Every limit is a whole number above 0; one left out takes its default (`MCP_LIMIT_DEFAULTS`). */
|
|
392
|
+
interface McpLimits {
|
|
393
|
+
max_steps?: number;
|
|
394
|
+
max_tool_calls?: number;
|
|
395
|
+
max_total_tokens?: number;
|
|
396
|
+
/** For one dataset row. */
|
|
397
|
+
timeout_ms?: number;
|
|
398
|
+
/** For one tool call. */
|
|
399
|
+
tool_timeout_ms?: number;
|
|
400
|
+
}
|
|
401
|
+
/** Exactly one of `command` (stdio, with `args`, `env`, `cwd`) or `url` (HTTP, with `headers`). Values may hold `${VAR}`. */
|
|
402
|
+
interface McpServerConfig {
|
|
403
|
+
command?: string;
|
|
404
|
+
args?: string[];
|
|
405
|
+
env?: Record<string, string>;
|
|
406
|
+
cwd?: string;
|
|
407
|
+
url?: string;
|
|
408
|
+
headers?: Record<string, string>;
|
|
409
|
+
}
|
|
410
|
+
interface McpConfig {
|
|
411
|
+
servers: Record<string, McpServerConfig>;
|
|
412
|
+
/** Defaults for every eval's `mcp.limits`. */
|
|
413
|
+
limits?: McpLimits;
|
|
414
|
+
}
|
|
415
|
+
interface EvalMcpConfig {
|
|
416
|
+
server: string;
|
|
417
|
+
/** At least one name; left out, every tool the server lists. */
|
|
418
|
+
allowed_tools?: string[];
|
|
419
|
+
limits?: McpLimits;
|
|
229
420
|
}
|
|
230
421
|
interface Config {
|
|
231
422
|
version: 1;
|
|
@@ -234,6 +425,12 @@ interface Config {
|
|
|
234
425
|
assertions?: AssertionConfig[];
|
|
235
426
|
};
|
|
236
427
|
pricing?: PricingMap;
|
|
428
|
+
/** Default `runs` for every eval. */
|
|
429
|
+
runs?: number;
|
|
430
|
+
/** Default `pass_threshold` (share of runs) for every eval. */
|
|
431
|
+
pass_threshold?: number;
|
|
432
|
+
/** MCP servers for agentic evals, and their default limits. */
|
|
433
|
+
mcp?: McpConfig;
|
|
237
434
|
evals: EvalConfig[];
|
|
238
435
|
}
|
|
239
436
|
|
|
@@ -272,8 +469,64 @@ interface CostEstimate {
|
|
|
272
469
|
/** Whether `cost_usd` is a known price (zero included) rather than the 0 of an unpriced model. Optional and additive. */
|
|
273
470
|
priced?: boolean;
|
|
274
471
|
}
|
|
472
|
+
/** A tool as the model is offered it: a name the provider accepts, and the JSON Schema of its arguments. */
|
|
473
|
+
interface ToolSpec {
|
|
474
|
+
name: string;
|
|
475
|
+
description?: string;
|
|
476
|
+
input_schema: Record<string, unknown>;
|
|
477
|
+
}
|
|
478
|
+
/** A call the model asked for. `args` is what it sent; `args_invalid` when that was not a JSON object. */
|
|
479
|
+
interface ToolCall {
|
|
480
|
+
id: string;
|
|
481
|
+
name: string;
|
|
482
|
+
args: unknown;
|
|
483
|
+
args_invalid?: boolean;
|
|
484
|
+
}
|
|
485
|
+
/** One turn of a conversation with tools, in a form every provider maps to its own wire. */
|
|
486
|
+
type AgentMessage = {
|
|
487
|
+
role: 'user';
|
|
488
|
+
content: string;
|
|
489
|
+
} | {
|
|
490
|
+
role: 'assistant';
|
|
491
|
+
text: string;
|
|
492
|
+
tool_calls: ToolCall[];
|
|
493
|
+
}
|
|
494
|
+
/** The answers to the calls of the turn before, in the order they were asked for. */
|
|
495
|
+
| {
|
|
496
|
+
role: 'tool';
|
|
497
|
+
results: {
|
|
498
|
+
id: string;
|
|
499
|
+
content: string;
|
|
500
|
+
is_error: boolean;
|
|
501
|
+
}[];
|
|
502
|
+
};
|
|
503
|
+
interface StepRequest {
|
|
504
|
+
provider: string;
|
|
505
|
+
model: string;
|
|
506
|
+
temperature?: number;
|
|
507
|
+
max_tokens: number;
|
|
508
|
+
messages: AgentMessage[];
|
|
509
|
+
tools: ToolSpec[];
|
|
510
|
+
}
|
|
511
|
+
interface StepResponse {
|
|
512
|
+
text: string;
|
|
513
|
+
tool_calls: ToolCall[];
|
|
514
|
+
usage: {
|
|
515
|
+
input_tokens: number;
|
|
516
|
+
output_tokens: number;
|
|
517
|
+
};
|
|
518
|
+
/** As on `CompletionResponse`. */
|
|
519
|
+
cost_usd?: number;
|
|
520
|
+
/** Normalised: `tool_calls`, `stop`, `length`, `error`, or what the provider said. */
|
|
521
|
+
finish_reason?: string;
|
|
522
|
+
}
|
|
275
523
|
interface Provider<_TConfig extends ProviderConfig = ProviderConfig> {
|
|
276
524
|
complete(req: CompletionRequest): Promise<CompletionResponse>;
|
|
525
|
+
/**
|
|
526
|
+
* One step of a conversation with tools: the history and the tools in, the model's text and the calls it asks for
|
|
527
|
+
* out. Optional: a provider without it cannot run an eval with an `mcp` server.
|
|
528
|
+
*/
|
|
529
|
+
respond?(req: StepRequest): Promise<StepResponse>;
|
|
277
530
|
/**
|
|
278
531
|
* Resolve the USD cost for a call's usage. `reportedCostUsd` (optional) is the provider's actual
|
|
279
532
|
* reported cost from `complete()` — when passed it is preferred over the table estimate, unless a
|
|
@@ -305,6 +558,39 @@ interface Cache {
|
|
|
305
558
|
close(): void;
|
|
306
559
|
}
|
|
307
560
|
|
|
561
|
+
interface Redactor {
|
|
562
|
+
/** The text with every known secret value replaced. */
|
|
563
|
+
text(text: string): string;
|
|
564
|
+
/** A masked copy: every string and every key goes through `text`. */
|
|
565
|
+
value(value: unknown): unknown;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/** What one call came to: an answer, a JSON-RPC error, no answer in time, or a server that is gone. */
|
|
569
|
+
type CallAnswer = {
|
|
570
|
+
kind: 'result';
|
|
571
|
+
result: unknown;
|
|
572
|
+
} | {
|
|
573
|
+
kind: 'error';
|
|
574
|
+
message: string;
|
|
575
|
+
} | {
|
|
576
|
+
kind: 'timeout';
|
|
577
|
+
} | {
|
|
578
|
+
kind: 'lost';
|
|
579
|
+
message: string;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
/** One session with the server, for one row. */
|
|
583
|
+
interface AgentServer {
|
|
584
|
+
/** The masking of this server's values (headers, env): every text kept of the loop goes through it. */
|
|
585
|
+
readonly redact: Redactor;
|
|
586
|
+
/** `tools/list` to its last page, as the server sent it. */
|
|
587
|
+
listTools(timeoutMs: number): Promise<unknown[]>;
|
|
588
|
+
callTool(name: string, args: Record<string, unknown>, timeoutMs: number): Promise<CallAnswer>;
|
|
589
|
+
close(): Promise<void>;
|
|
590
|
+
}
|
|
591
|
+
/** Opens a session with the server named in `mcp.servers`; a failure rejects with a message already masked. */
|
|
592
|
+
type AgentConnect = (server: string, timeoutMs: number) => Promise<AgentServer>;
|
|
593
|
+
|
|
308
594
|
interface RunDeps {
|
|
309
595
|
resolveProvider(cfg: ProviderConfig): Provider;
|
|
310
596
|
embedder: Embedder;
|
|
@@ -312,6 +598,8 @@ interface RunDeps {
|
|
|
312
598
|
now: () => number;
|
|
313
599
|
loadDataset(ref: DatasetRef, baseDir: string): DatasetRow[];
|
|
314
600
|
baseDir: string;
|
|
601
|
+
/** Opens a session with an `mcp.servers` entry, one per agentic row. Needed only by an eval with `mcp`. */
|
|
602
|
+
connectMcp?: AgentConnect;
|
|
315
603
|
}
|
|
316
604
|
|
|
317
605
|
interface RunOptions {
|
|
@@ -324,6 +612,8 @@ interface RunOptions {
|
|
|
324
612
|
cacheStrict?: boolean;
|
|
325
613
|
/** Milliseconds; parsed from `--cache-max-age` by the caller. */
|
|
326
614
|
cacheMaxAgeMs?: number;
|
|
615
|
+
/** `--runs`: every row runs this many times (1–100), over `runs` in the config. */
|
|
616
|
+
runs?: number;
|
|
327
617
|
}
|
|
328
618
|
declare function handleRun(options: RunOptions, depsFactory?: (config: Config, baseDir: string) => RunDeps): Promise<RunResult>;
|
|
329
619
|
|
|
@@ -445,6 +735,61 @@ declare const assertionConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
445
735
|
context: z.ZodString;
|
|
446
736
|
question: z.ZodString;
|
|
447
737
|
threshold: z.ZodOptional<z.ZodNumber>;
|
|
738
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
739
|
+
type: z.ZodLiteral<"tool-called">;
|
|
740
|
+
tool: z.ZodString;
|
|
741
|
+
min_count: z.ZodOptional<z.ZodNumber>;
|
|
742
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
743
|
+
type: z.ZodLiteral<"tool-not-called">;
|
|
744
|
+
tool: z.ZodString;
|
|
745
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
746
|
+
type: z.ZodLiteral<"tool-args">;
|
|
747
|
+
tool: z.ZodString;
|
|
748
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
749
|
+
match: z.ZodOptional<z.ZodEnum<{
|
|
750
|
+
partial: "partial";
|
|
751
|
+
exact: "exact";
|
|
752
|
+
ignore: "ignore";
|
|
753
|
+
}>>;
|
|
754
|
+
min_count: z.ZodOptional<z.ZodNumber>;
|
|
755
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
756
|
+
type: z.ZodLiteral<"tool-order">;
|
|
757
|
+
tools: z.ZodArray<z.ZodString>;
|
|
758
|
+
strict: z.ZodOptional<z.ZodBoolean>;
|
|
759
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
760
|
+
type: z.ZodLiteral<"only-tools">;
|
|
761
|
+
tools: z.ZodArray<z.ZodString>;
|
|
762
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
763
|
+
type: z.ZodLiteral<"first-tool">;
|
|
764
|
+
tool: z.ZodString;
|
|
765
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
766
|
+
type: z.ZodLiteral<"no-tool-errors">;
|
|
767
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
768
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
769
|
+
type: z.ZodLiteral<"tool-call-count">;
|
|
770
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
771
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
773
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
774
|
+
type: z.ZodLiteral<"no-repeated-call">;
|
|
775
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
776
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
777
|
+
type: z.ZodLiteral<"token-budget">;
|
|
778
|
+
max: z.ZodNumber;
|
|
779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
780
|
+
type: z.ZodLiteral<"tool-latency">;
|
|
781
|
+
max_ms: z.ZodNumber;
|
|
782
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
783
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
784
|
+
type: z.ZodLiteral<"tool-result-size">;
|
|
785
|
+
max_bytes: z.ZodNumber;
|
|
786
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
787
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
788
|
+
type: z.ZodLiteral<"tool-result-schema">;
|
|
789
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
790
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
791
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
792
|
+
type: z.ZodLiteral<"no-destructive-tool">;
|
|
448
793
|
}, z.core.$strip>], "type">;
|
|
449
794
|
|
|
450
795
|
/**
|
|
@@ -459,6 +804,9 @@ declare const assertionConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
459
804
|
* Superset: an assertion record may carry an optional `binaryVerdicts[]` — the per-question breakdown
|
|
460
805
|
* of an llm-judge verdict `{ question, passed }`. The runner does not emit the field; plain output
|
|
461
806
|
* validates unchanged, and a consumer that enriches a result stays valid. Purely additive.
|
|
807
|
+
*
|
|
808
|
+
* Superset too: an agentic row's `agent` may carry `advice[]` `{ type, reason }`, the findings of the heuristic
|
|
809
|
+
* assertions (`AgentRecord`), which never change the row's status.
|
|
462
810
|
*/
|
|
463
811
|
/**
|
|
464
812
|
* Version marker for the RunResult contract, type-pinned to the frozen `RunResult['schemaVersion']`
|
|
@@ -544,6 +892,104 @@ declare const runResultSchema: z.ZodObject<{
|
|
|
544
892
|
blocked: "blocked";
|
|
545
893
|
skipped: "skipped";
|
|
546
894
|
}>>;
|
|
895
|
+
attempts: z.ZodOptional<z.ZodObject<{
|
|
896
|
+
runs: z.ZodNumber;
|
|
897
|
+
pass_threshold: z.ZodNumber;
|
|
898
|
+
passed: z.ZodNumber;
|
|
899
|
+
failed: z.ZodNumber;
|
|
900
|
+
errored: z.ZodNumber;
|
|
901
|
+
results: z.ZodArray<z.ZodObject<{
|
|
902
|
+
output: z.ZodNullable<z.ZodString>;
|
|
903
|
+
cached: z.ZodBoolean;
|
|
904
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
905
|
+
input_tokens: z.ZodNumber;
|
|
906
|
+
output_tokens: z.ZodNumber;
|
|
907
|
+
cost_usd: z.ZodNumber;
|
|
908
|
+
priced: z.ZodOptional<z.ZodBoolean>;
|
|
909
|
+
}, z.core.$strip>>;
|
|
910
|
+
latency_ms: z.ZodOptional<z.ZodNumber>;
|
|
911
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
912
|
+
code: z.ZodString;
|
|
913
|
+
message: z.ZodString;
|
|
914
|
+
}, z.core.$strip>>;
|
|
915
|
+
assertions: z.ZodArray<z.ZodObject<{
|
|
916
|
+
type: z.ZodString;
|
|
917
|
+
passed: z.ZodBoolean;
|
|
918
|
+
score: z.ZodOptional<z.ZodNumber>;
|
|
919
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
920
|
+
binaryVerdicts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
921
|
+
question: z.ZodString;
|
|
922
|
+
passed: z.ZodBoolean;
|
|
923
|
+
}, z.core.$strip>>>;
|
|
924
|
+
}, z.core.$strip>>;
|
|
925
|
+
cache_saved: z.ZodOptional<z.ZodObject<{
|
|
926
|
+
input_tokens: z.ZodNumber;
|
|
927
|
+
output_tokens: z.ZodNumber;
|
|
928
|
+
cost_usd: z.ZodNumber;
|
|
929
|
+
}, z.core.$strip>>;
|
|
930
|
+
}, z.core.$strip>>;
|
|
931
|
+
}, z.core.$strip>>;
|
|
932
|
+
agent: z.ZodOptional<z.ZodObject<{
|
|
933
|
+
server: z.ZodString;
|
|
934
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
935
|
+
name: z.ZodString;
|
|
936
|
+
offered: z.ZodBoolean;
|
|
937
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
938
|
+
}, z.core.$strip>>;
|
|
939
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
940
|
+
index: z.ZodNumber;
|
|
941
|
+
text: z.ZodString;
|
|
942
|
+
finish_reason: z.ZodOptional<z.ZodString>;
|
|
943
|
+
usage: z.ZodObject<{
|
|
944
|
+
input_tokens: z.ZodNumber;
|
|
945
|
+
output_tokens: z.ZodNumber;
|
|
946
|
+
cost_usd: z.ZodNumber;
|
|
947
|
+
priced: z.ZodOptional<z.ZodBoolean>;
|
|
948
|
+
}, z.core.$strip>;
|
|
949
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
950
|
+
id: z.ZodString;
|
|
951
|
+
name: z.ZodString;
|
|
952
|
+
args: z.ZodUnknown;
|
|
953
|
+
executed: z.ZodBoolean;
|
|
954
|
+
is_error: z.ZodBoolean;
|
|
955
|
+
error_kind: z.ZodOptional<z.ZodEnum<{
|
|
956
|
+
timeout: "timeout";
|
|
957
|
+
content: "content";
|
|
958
|
+
protocol: "protocol";
|
|
959
|
+
"not-offered": "not-offered";
|
|
960
|
+
"bad-arguments": "bad-arguments";
|
|
961
|
+
}>>;
|
|
962
|
+
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
963
|
+
result: z.ZodOptional<z.ZodObject<{
|
|
964
|
+
text: z.ZodString;
|
|
965
|
+
bytes: z.ZodNumber;
|
|
966
|
+
truncated: z.ZodBoolean;
|
|
967
|
+
}, z.core.$strip>>;
|
|
968
|
+
}, z.core.$strip>>;
|
|
969
|
+
}, z.core.$strip>>;
|
|
970
|
+
stop: z.ZodObject<{
|
|
971
|
+
reason: z.ZodEnum<{
|
|
972
|
+
error: "error";
|
|
973
|
+
complete: "complete";
|
|
974
|
+
limit: "limit";
|
|
975
|
+
}>;
|
|
976
|
+
limit: z.ZodOptional<z.ZodEnum<{
|
|
977
|
+
max_steps: "max_steps";
|
|
978
|
+
max_tool_calls: "max_tool_calls";
|
|
979
|
+
max_total_tokens: "max_total_tokens";
|
|
980
|
+
timeout_ms: "timeout_ms";
|
|
981
|
+
tool_timeout_ms: "tool_timeout_ms";
|
|
982
|
+
}>>;
|
|
983
|
+
}, z.core.$strip>;
|
|
984
|
+
collection: z.ZodEnum<{
|
|
985
|
+
partial: "partial";
|
|
986
|
+
complete: "complete";
|
|
987
|
+
}>;
|
|
988
|
+
advice: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
989
|
+
type: z.ZodString;
|
|
990
|
+
reason: z.ZodString;
|
|
991
|
+
}, z.core.$strip>>>;
|
|
992
|
+
}, z.core.$strip>>;
|
|
547
993
|
}, z.core.$strip>>;
|
|
548
994
|
passed: z.ZodBoolean;
|
|
549
995
|
}, z.core.$strip>>;
|