@agentv/core 2.7.1-next.4 → 2.7.1-next.6

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.d.cts CHANGED
@@ -466,16 +466,18 @@ type TargetAccessConfig = {
466
466
  readonly max_calls?: number;
467
467
  };
468
468
  /**
469
- * Configuration for workspace lifecycle scripts (before_all, after_all, before_each, after_each).
470
- * Scripts are executed with workspace context passed via stdin.
469
+ * Configuration for workspace lifecycle commands (before_all, after_all, before_each, after_each).
470
+ * Commands are executed with workspace context passed via stdin.
471
471
  */
472
472
  type WorkspaceScriptConfig = {
473
473
  /** Command array to execute (e.g., ["bun", "run", "setup.ts"]) */
474
- readonly script: readonly string[];
474
+ readonly command: readonly string[];
475
+ /** @deprecated Use `command` instead */
476
+ readonly script?: readonly string[];
475
477
  /** Optional timeout in milliseconds (default: 60000 for setup, 30000 for teardown) */
476
478
  readonly timeout_ms?: number;
477
479
  readonly timeoutMs?: number;
478
- /** Optional working directory for script execution */
480
+ /** Optional working directory for command execution */
479
481
  readonly cwd?: string;
480
482
  };
481
483
  /**
@@ -493,19 +495,21 @@ type WorkspaceConfig = {
493
495
  /** Template directory or .code-workspace file. Directories are copied to temp workspace.
494
496
  * .code-workspace files are used by VS Code providers; CLI providers use the parent directory. */
495
497
  readonly template?: string;
496
- /** Script to run once before first test (after workspace creation, before git baseline) */
498
+ /** Command to run once before first test (after workspace creation, before git baseline) */
497
499
  readonly before_all?: WorkspaceScriptConfig;
498
- /** Script to run once after last test (before workspace cleanup) */
500
+ /** Command to run once after last test (before workspace cleanup) */
499
501
  readonly after_all?: WorkspaceScriptConfig;
500
- /** Script to run before each test */
502
+ /** Command to run before each test */
501
503
  readonly before_each?: WorkspaceScriptConfig;
502
- /** Script to run after each test (e.g., git reset for workspace reuse) */
504
+ /** Command to run after each test (e.g., git reset for workspace reuse) */
503
505
  readonly after_each?: WorkspaceScriptConfig;
504
506
  };
505
507
  type CodeEvaluatorConfig = {
506
508
  readonly name: string;
507
509
  readonly type: 'code';
508
- readonly script: readonly string[];
510
+ readonly command: readonly string[];
511
+ /** @deprecated Use `command` instead */
512
+ readonly script?: readonly string[];
509
513
  readonly resolvedScriptPath?: string;
510
514
  readonly cwd?: string;
511
515
  readonly resolvedCwd?: string;
@@ -513,9 +517,9 @@ type CodeEvaluatorConfig = {
513
517
  readonly required?: boolean | number;
514
518
  /** When true, inverts the evaluator score (1 - score) and swaps pass/fail verdict */
515
519
  readonly negate?: boolean;
516
- /** Pass-through configuration for the code_judge script (any unrecognized YAML properties) */
520
+ /** Pass-through configuration for the code_judge (any unrecognized YAML properties) */
517
521
  readonly config?: JsonObject;
518
- /** When present, enables target access for the script via local proxy */
522
+ /** When present, enables target access via local proxy */
519
523
  readonly target?: TargetAccessConfig;
520
524
  };
521
525
  /**
@@ -524,7 +528,9 @@ type CodeEvaluatorConfig = {
524
528
  */
525
529
  type PromptScriptConfig = {
526
530
  /** Command array to execute (e.g., ["bun", "run", "template.ts"]) */
527
- readonly script: readonly string[];
531
+ readonly command: readonly string[];
532
+ /** @deprecated Use `command` instead */
533
+ readonly script?: readonly string[];
528
534
  /** Pass-through configuration for the prompt template */
529
535
  readonly config?: Record<string, unknown>;
530
536
  };
@@ -1178,7 +1184,7 @@ declare function resolveFileReference(rawValue: string, searchRoots: readonly st
1178
1184
  * @example
1179
1185
  * ```typescript
1180
1186
  * const config: CliNormalizedConfig = {
1181
- * commandTemplate: 'agent run {PROMPT}',
1187
+ * command: 'agent run {PROMPT}',
1182
1188
  * timeoutMs: 120000,
1183
1189
  * verbose: true,
1184
1190
  * };
@@ -1186,72 +1192,62 @@ declare function resolveFileReference(rawValue: string, searchRoots: readonly st
1186
1192
  * ```
1187
1193
  */
1188
1194
  declare const CliTargetConfigSchema: z.ZodObject<{
1189
- commandTemplate: z.ZodString;
1195
+ command: z.ZodString;
1190
1196
  filesFormat: z.ZodOptional<z.ZodString>;
1191
1197
  cwd: z.ZodOptional<z.ZodString>;
1192
1198
  workspaceTemplate: z.ZodOptional<z.ZodString>;
1193
1199
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1194
- healthcheck: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1195
- type: z.ZodLiteral<"http">;
1200
+ healthcheck: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1196
1201
  url: z.ZodString;
1197
1202
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1198
1203
  }, "strict", z.ZodTypeAny, {
1199
- type: "http";
1200
1204
  url: string;
1201
1205
  timeoutMs?: number | undefined;
1202
1206
  }, {
1203
- type: "http";
1204
1207
  url: string;
1205
1208
  timeoutMs?: number | undefined;
1206
1209
  }>, z.ZodObject<{
1207
- type: z.ZodLiteral<"command">;
1208
- commandTemplate: z.ZodString;
1210
+ command: z.ZodString;
1209
1211
  cwd: z.ZodOptional<z.ZodString>;
1210
1212
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1211
1213
  }, "strict", z.ZodTypeAny, {
1212
- type: "command";
1213
- commandTemplate: string;
1214
+ command: string;
1214
1215
  cwd?: string | undefined;
1215
1216
  timeoutMs?: number | undefined;
1216
1217
  }, {
1217
- type: "command";
1218
- commandTemplate: string;
1218
+ command: string;
1219
1219
  cwd?: string | undefined;
1220
1220
  timeoutMs?: number | undefined;
1221
1221
  }>]>>;
1222
1222
  verbose: z.ZodOptional<z.ZodBoolean>;
1223
1223
  keepTempFiles: z.ZodOptional<z.ZodBoolean>;
1224
1224
  }, "strict", z.ZodTypeAny, {
1225
- commandTemplate: string;
1225
+ command: string;
1226
1226
  cwd?: string | undefined;
1227
1227
  verbose?: boolean | undefined;
1228
1228
  filesFormat?: string | undefined;
1229
1229
  workspaceTemplate?: string | undefined;
1230
1230
  healthcheck?: {
1231
- type: "http";
1232
1231
  url: string;
1233
1232
  timeoutMs?: number | undefined;
1234
1233
  } | {
1235
- type: "command";
1236
- commandTemplate: string;
1234
+ command: string;
1237
1235
  cwd?: string | undefined;
1238
1236
  timeoutMs?: number | undefined;
1239
1237
  } | undefined;
1240
1238
  keepTempFiles?: boolean | undefined;
1241
1239
  timeoutMs?: number | undefined;
1242
1240
  }, {
1243
- commandTemplate: string;
1241
+ command: string;
1244
1242
  cwd?: string | undefined;
1245
1243
  verbose?: boolean | undefined;
1246
1244
  filesFormat?: string | undefined;
1247
1245
  workspaceTemplate?: string | undefined;
1248
1246
  healthcheck?: {
1249
- type: "http";
1250
1247
  url: string;
1251
1248
  timeoutMs?: number | undefined;
1252
1249
  } | {
1253
- type: "command";
1254
- commandTemplate: string;
1250
+ command: string;
1255
1251
  cwd?: string | undefined;
1256
1252
  timeoutMs?: number | undefined;
1257
1253
  } | undefined;
@@ -1698,17 +1694,19 @@ declare function deepEqual(a: unknown, b: unknown): boolean;
1698
1694
  declare function negateScore(score: EvaluationScore): EvaluationScore;
1699
1695
 
1700
1696
  interface CodeEvaluatorOptions {
1701
- readonly script: readonly string[];
1697
+ readonly command: readonly string[];
1698
+ /** @deprecated Use `command` instead */
1699
+ readonly script?: readonly string[];
1702
1700
  readonly cwd?: string;
1703
1701
  readonly agentTimeoutMs?: number;
1704
1702
  /** Pass-through configuration from YAML (any unrecognized properties) */
1705
1703
  readonly config?: Record<string, unknown>;
1706
- /** Target access config - when present, enables target invocation for the script */
1704
+ /** Target access config - when present, enables target invocation */
1707
1705
  readonly target?: TargetAccessConfig;
1708
1706
  }
1709
1707
  declare class CodeEvaluator implements Evaluator {
1710
1708
  readonly kind = "code";
1711
- private readonly script;
1709
+ private readonly command;
1712
1710
  private readonly cwd?;
1713
1711
  private readonly agentTimeoutMs?;
1714
1712
  private readonly config?;
@@ -2634,13 +2632,13 @@ interface ScriptExecutionContext {
2634
2632
  }
2635
2633
  type ScriptFailureMode = 'fatal' | 'warn';
2636
2634
  /**
2637
- * Executes a workspace lifecycle script (before_all, after_all, before_each, after_each).
2635
+ * Executes a workspace lifecycle command (before_all, after_all, before_each, after_each).
2638
2636
  *
2639
- * @param config - Workspace script configuration (script, timeout_ms, cwd)
2640
- * @param context - Context passed to script via stdin (JSON)
2637
+ * @param config - Workspace command configuration (command, timeout_ms, cwd)
2638
+ * @param context - Context passed to command via stdin (JSON)
2641
2639
  * @param failureMode - 'fatal' throws on non-zero exit; 'warn' logs warning
2642
- * @returns Captured stdout from the script
2643
- * @throws Error if script exits with non-zero code (fatal mode) or times out
2640
+ * @returns Captured stdout from the command
2641
+ * @throws Error if command exits with non-zero code (fatal mode) or times out
2644
2642
  */
2645
2643
  declare function executeWorkspaceScript(config: WorkspaceScriptConfig, context: ScriptExecutionContext, failureMode?: ScriptFailureMode): Promise<string>;
2646
2644
 
package/dist/index.d.ts CHANGED
@@ -466,16 +466,18 @@ type TargetAccessConfig = {
466
466
  readonly max_calls?: number;
467
467
  };
468
468
  /**
469
- * Configuration for workspace lifecycle scripts (before_all, after_all, before_each, after_each).
470
- * Scripts are executed with workspace context passed via stdin.
469
+ * Configuration for workspace lifecycle commands (before_all, after_all, before_each, after_each).
470
+ * Commands are executed with workspace context passed via stdin.
471
471
  */
472
472
  type WorkspaceScriptConfig = {
473
473
  /** Command array to execute (e.g., ["bun", "run", "setup.ts"]) */
474
- readonly script: readonly string[];
474
+ readonly command: readonly string[];
475
+ /** @deprecated Use `command` instead */
476
+ readonly script?: readonly string[];
475
477
  /** Optional timeout in milliseconds (default: 60000 for setup, 30000 for teardown) */
476
478
  readonly timeout_ms?: number;
477
479
  readonly timeoutMs?: number;
478
- /** Optional working directory for script execution */
480
+ /** Optional working directory for command execution */
479
481
  readonly cwd?: string;
480
482
  };
481
483
  /**
@@ -493,19 +495,21 @@ type WorkspaceConfig = {
493
495
  /** Template directory or .code-workspace file. Directories are copied to temp workspace.
494
496
  * .code-workspace files are used by VS Code providers; CLI providers use the parent directory. */
495
497
  readonly template?: string;
496
- /** Script to run once before first test (after workspace creation, before git baseline) */
498
+ /** Command to run once before first test (after workspace creation, before git baseline) */
497
499
  readonly before_all?: WorkspaceScriptConfig;
498
- /** Script to run once after last test (before workspace cleanup) */
500
+ /** Command to run once after last test (before workspace cleanup) */
499
501
  readonly after_all?: WorkspaceScriptConfig;
500
- /** Script to run before each test */
502
+ /** Command to run before each test */
501
503
  readonly before_each?: WorkspaceScriptConfig;
502
- /** Script to run after each test (e.g., git reset for workspace reuse) */
504
+ /** Command to run after each test (e.g., git reset for workspace reuse) */
503
505
  readonly after_each?: WorkspaceScriptConfig;
504
506
  };
505
507
  type CodeEvaluatorConfig = {
506
508
  readonly name: string;
507
509
  readonly type: 'code';
508
- readonly script: readonly string[];
510
+ readonly command: readonly string[];
511
+ /** @deprecated Use `command` instead */
512
+ readonly script?: readonly string[];
509
513
  readonly resolvedScriptPath?: string;
510
514
  readonly cwd?: string;
511
515
  readonly resolvedCwd?: string;
@@ -513,9 +517,9 @@ type CodeEvaluatorConfig = {
513
517
  readonly required?: boolean | number;
514
518
  /** When true, inverts the evaluator score (1 - score) and swaps pass/fail verdict */
515
519
  readonly negate?: boolean;
516
- /** Pass-through configuration for the code_judge script (any unrecognized YAML properties) */
520
+ /** Pass-through configuration for the code_judge (any unrecognized YAML properties) */
517
521
  readonly config?: JsonObject;
518
- /** When present, enables target access for the script via local proxy */
522
+ /** When present, enables target access via local proxy */
519
523
  readonly target?: TargetAccessConfig;
520
524
  };
521
525
  /**
@@ -524,7 +528,9 @@ type CodeEvaluatorConfig = {
524
528
  */
525
529
  type PromptScriptConfig = {
526
530
  /** Command array to execute (e.g., ["bun", "run", "template.ts"]) */
527
- readonly script: readonly string[];
531
+ readonly command: readonly string[];
532
+ /** @deprecated Use `command` instead */
533
+ readonly script?: readonly string[];
528
534
  /** Pass-through configuration for the prompt template */
529
535
  readonly config?: Record<string, unknown>;
530
536
  };
@@ -1178,7 +1184,7 @@ declare function resolveFileReference(rawValue: string, searchRoots: readonly st
1178
1184
  * @example
1179
1185
  * ```typescript
1180
1186
  * const config: CliNormalizedConfig = {
1181
- * commandTemplate: 'agent run {PROMPT}',
1187
+ * command: 'agent run {PROMPT}',
1182
1188
  * timeoutMs: 120000,
1183
1189
  * verbose: true,
1184
1190
  * };
@@ -1186,72 +1192,62 @@ declare function resolveFileReference(rawValue: string, searchRoots: readonly st
1186
1192
  * ```
1187
1193
  */
1188
1194
  declare const CliTargetConfigSchema: z.ZodObject<{
1189
- commandTemplate: z.ZodString;
1195
+ command: z.ZodString;
1190
1196
  filesFormat: z.ZodOptional<z.ZodString>;
1191
1197
  cwd: z.ZodOptional<z.ZodString>;
1192
1198
  workspaceTemplate: z.ZodOptional<z.ZodString>;
1193
1199
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1194
- healthcheck: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1195
- type: z.ZodLiteral<"http">;
1200
+ healthcheck: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1196
1201
  url: z.ZodString;
1197
1202
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1198
1203
  }, "strict", z.ZodTypeAny, {
1199
- type: "http";
1200
1204
  url: string;
1201
1205
  timeoutMs?: number | undefined;
1202
1206
  }, {
1203
- type: "http";
1204
1207
  url: string;
1205
1208
  timeoutMs?: number | undefined;
1206
1209
  }>, z.ZodObject<{
1207
- type: z.ZodLiteral<"command">;
1208
- commandTemplate: z.ZodString;
1210
+ command: z.ZodString;
1209
1211
  cwd: z.ZodOptional<z.ZodString>;
1210
1212
  timeoutMs: z.ZodOptional<z.ZodNumber>;
1211
1213
  }, "strict", z.ZodTypeAny, {
1212
- type: "command";
1213
- commandTemplate: string;
1214
+ command: string;
1214
1215
  cwd?: string | undefined;
1215
1216
  timeoutMs?: number | undefined;
1216
1217
  }, {
1217
- type: "command";
1218
- commandTemplate: string;
1218
+ command: string;
1219
1219
  cwd?: string | undefined;
1220
1220
  timeoutMs?: number | undefined;
1221
1221
  }>]>>;
1222
1222
  verbose: z.ZodOptional<z.ZodBoolean>;
1223
1223
  keepTempFiles: z.ZodOptional<z.ZodBoolean>;
1224
1224
  }, "strict", z.ZodTypeAny, {
1225
- commandTemplate: string;
1225
+ command: string;
1226
1226
  cwd?: string | undefined;
1227
1227
  verbose?: boolean | undefined;
1228
1228
  filesFormat?: string | undefined;
1229
1229
  workspaceTemplate?: string | undefined;
1230
1230
  healthcheck?: {
1231
- type: "http";
1232
1231
  url: string;
1233
1232
  timeoutMs?: number | undefined;
1234
1233
  } | {
1235
- type: "command";
1236
- commandTemplate: string;
1234
+ command: string;
1237
1235
  cwd?: string | undefined;
1238
1236
  timeoutMs?: number | undefined;
1239
1237
  } | undefined;
1240
1238
  keepTempFiles?: boolean | undefined;
1241
1239
  timeoutMs?: number | undefined;
1242
1240
  }, {
1243
- commandTemplate: string;
1241
+ command: string;
1244
1242
  cwd?: string | undefined;
1245
1243
  verbose?: boolean | undefined;
1246
1244
  filesFormat?: string | undefined;
1247
1245
  workspaceTemplate?: string | undefined;
1248
1246
  healthcheck?: {
1249
- type: "http";
1250
1247
  url: string;
1251
1248
  timeoutMs?: number | undefined;
1252
1249
  } | {
1253
- type: "command";
1254
- commandTemplate: string;
1250
+ command: string;
1255
1251
  cwd?: string | undefined;
1256
1252
  timeoutMs?: number | undefined;
1257
1253
  } | undefined;
@@ -1698,17 +1694,19 @@ declare function deepEqual(a: unknown, b: unknown): boolean;
1698
1694
  declare function negateScore(score: EvaluationScore): EvaluationScore;
1699
1695
 
1700
1696
  interface CodeEvaluatorOptions {
1701
- readonly script: readonly string[];
1697
+ readonly command: readonly string[];
1698
+ /** @deprecated Use `command` instead */
1699
+ readonly script?: readonly string[];
1702
1700
  readonly cwd?: string;
1703
1701
  readonly agentTimeoutMs?: number;
1704
1702
  /** Pass-through configuration from YAML (any unrecognized properties) */
1705
1703
  readonly config?: Record<string, unknown>;
1706
- /** Target access config - when present, enables target invocation for the script */
1704
+ /** Target access config - when present, enables target invocation */
1707
1705
  readonly target?: TargetAccessConfig;
1708
1706
  }
1709
1707
  declare class CodeEvaluator implements Evaluator {
1710
1708
  readonly kind = "code";
1711
- private readonly script;
1709
+ private readonly command;
1712
1710
  private readonly cwd?;
1713
1711
  private readonly agentTimeoutMs?;
1714
1712
  private readonly config?;
@@ -2634,13 +2632,13 @@ interface ScriptExecutionContext {
2634
2632
  }
2635
2633
  type ScriptFailureMode = 'fatal' | 'warn';
2636
2634
  /**
2637
- * Executes a workspace lifecycle script (before_all, after_all, before_each, after_each).
2635
+ * Executes a workspace lifecycle command (before_all, after_all, before_each, after_each).
2638
2636
  *
2639
- * @param config - Workspace script configuration (script, timeout_ms, cwd)
2640
- * @param context - Context passed to script via stdin (JSON)
2637
+ * @param config - Workspace command configuration (command, timeout_ms, cwd)
2638
+ * @param context - Context passed to command via stdin (JSON)
2641
2639
  * @param failureMode - 'fatal' throws on non-zero exit; 'warn' logs warning
2642
- * @returns Captured stdout from the script
2643
- * @throws Error if script exits with non-zero code (fatal mode) or times out
2640
+ * @returns Captured stdout from the command
2641
+ * @throws Error if command exits with non-zero code (fatal mode) or times out
2644
2642
  */
2645
2643
  declare function executeWorkspaceScript(config: WorkspaceScriptConfig, context: ScriptExecutionContext, failureMode?: ScriptFailureMode): Promise<string>;
2646
2644