@automatalabs/workflows 0.31.0 → 0.32.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 CHANGED
@@ -164,7 +164,7 @@ try {
164
164
  }
165
165
  ```
166
166
 
167
- `run(prompt, options?)` accepts the seam's `RunOptions`: `schema`, `maxSchemaRetries`, `model`, `mode`, `tier`, `cwd`,
167
+ `run(prompt, options?)` accepts the seam's `RunOptions`: `schema`, `maxSchemaRetries`, `model`, `mode`, `configOptions`, `tier`, `cwd`,
168
168
  `instructions`, `label`, `toolNames` / `disallowedToolNames`, `signal`, `mcpServers`, `images`,
169
169
  `backends`, `meta` / `promptMeta` (generic ACP `_meta` passthroughs merged into `session/new` /
170
170
  `session/prompt`), `baseInstructions` / `developerInstructions` (Codex-only), `keepSession`, and
@@ -488,23 +488,30 @@ promises — `parallel([() => agent("a"), () => agent("b")])`, not `parallel([ag
488
488
 
489
489
  ## Validating scripts — `agentprism-workflows validate`
490
490
 
491
- The package ships a bin that validates a workflow script **without spending tokens or spawning
492
- any agent process** — no backend auth needed:
491
+ The package ships a bin that validates a workflow script **without spending tokens**:
493
492
 
494
493
  ```bash
495
494
  npx @automatalabs/workflows validate my-workflow.js --args '{"target":"src/"}'
496
495
  ```
497
496
 
498
- Two passes: a **static parse** (the `meta` literal, syntax, the determinism blocklist), then a
497
+ Three passes: a **static parse** (the `meta` literal, syntax, the determinism blocklist), then a
499
498
  **dry run** — the script executes in the real engine realm while every `agent()` call is served
500
499
  by an in-process mock `AgentRunner` that fabricates schema-conforming results. The dry run
501
500
  catches what a parse can't: thunk-vs-promise mistakes, reference errors, broken plumbing between
502
- calls. A mock live confirm answers checkpoints with `default ?? true`, so `headless: "pause"`
501
+ calls. Finally, validation opens one no-prompt session on every distinct routed ACP harness,
502
+ surfaces the complete advertised config-option catalog, and checks every authored `configOptions`
503
+ bag against it. This probe uses zero tokens. A harness that cannot spawn, authenticate, or open a
504
+ session contributes one warning and `probed:false`; only that harness's option checks are skipped,
505
+ so probe failure alone never invalidates the script. There is no cached catalog or opt-out flag.
506
+ A mock live confirm answers checkpoints with `default ?? true`, so `headless: "pause"`
503
507
  dry-runs cleanly; `headless: "abort"` warns because a truly unattended run would abort.
504
508
  Script-declared `meta.backends` are treated as approved (with a warning that real runs require
505
- approval). The report lists every agent call with
506
- its backend attribution, every checkpoint, and warnings; exit codes are `0` valid, `1` parse
507
- failure, `2` dry-run failure, `3` usage error.
509
+ approval). The report lists every agent call with its backend attribution and `configOptions`
510
+ echo, every checkpoint, the full option table for every routed harness (even when no call authors
511
+ options), and warnings. Unknown ids, invalid select values, non-boolean boolean values, and the
512
+ reserved `"model"` id make the report invalid with exit code `2`; each diagnostic names the call,
513
+ authored value, and advertised alternatives. Exit codes are `0` valid, `1` parse failure, `2`
514
+ dry-run or config-option failure, `3` usage error.
508
515
 
509
516
  Flags: `--args <json>` / `--args-file <path>`, `--workflows-dir <dir>` (repeatable — validate by
510
517
  NAME and resolve nested `workflow("<name>")` calls from your folder), `--parse-only`,
@@ -558,6 +565,8 @@ const mockAnswers: MockAnswers = {
558
565
  const report = await validateWorkflowScript(script, { args: { target: "src/" }, mockAnswers });
559
566
  report.ok; // parse ok AND dry run completed
560
567
  report.dryRun?.agentCalls; // calls include mockAnswer: { glob, sequenceIndex?, sequenceLength? }
568
+ report.dryRun?.harnessOptions;
569
+ // [{ backendId, probed, options?: SessionConfigOption[], error?: string }]
561
570
  report.dryRun?.mockAnswers;// normalized rule counters + item-level unused records
562
571
  report.warnings; // approval reminders, phase mismatches, headless-abort checkpoints, …
563
572
  ```
@@ -626,6 +635,14 @@ retry, echo verification, or fallback. Brackets, dots, slashes, and provider-sty
626
635
  ordinary id characters. A harness error follows the existing agent-error path. Per-backend pool
627
636
  size is `AGENTPRISM_ACP_POOL_SIZE` (or `AcpPoolOptions.size`).
628
637
 
638
+ `agent({ configOptions })` applies the rest of that selected harness's ACP option surface with the
639
+ same verbatim philosophy. Exact ids and string/boolean values are sent in ascending option-id
640
+ order, after model selection and before the prompt; there are no aliases, coercion, defaults,
641
+ catalog matching, or client-side option vocabulary. The `"model"` key is rejected before a session
642
+ opens because the dedicated `model` field is its only channel. Run `validate` and read the routed
643
+ harness's advertised-options table before choosing ids or select values. A live harness rejection
644
+ otherwise follows the existing agent-error path.
645
+
629
646
  ---
630
647
 
631
648
  ## Exports
@@ -637,7 +654,7 @@ runIsolation, // ACP-defaulted single-target substitution over a
637
654
  createReplayRunner, // backend-neutral in-memory replay composition primitive
638
655
  runWorkflow, // the bare engine run (no status trio)
639
656
  parseWorkflowScript, // parse a script's meta + body
640
- validateWorkflowScript, // token-free parse + mock-runner dry run (the `validate` CLI's core)
657
+ validateWorkflowScript, // token-free parse + mock dry run + no-prompt harness option probes
641
658
  fabricateFromSchema, // the dry run's JSON-Schema value fabricator
642
659
  formatValidateReport, // render a ValidateWorkflowReport as CLI text
643
660
  openWorkflowDir, // read-only view over folders of workflow scripts (name = filename stem)
@@ -668,13 +685,15 @@ ReplayCallReport, ReplayDivergenceEvent, ResolvedIsolationTarget,
668
685
  WorkflowRunOptions, AgentOptions, ExecOptions, CheckpointCallContext,
669
686
  MockAnswerJson, MockAnswerSequence, MockAnswerRule, MockAnswers,
670
687
  ValidatedMockAnswerUse, ValidatedMockAnswerRule, UnusedMockAnswer, ValidatedMockAnswers,
671
- ValidateWorkflowOptions, ValidateWorkflowReport, ValidatedAgentCall, ValidatedCheckpoint,
688
+ ValidateWorkflowOptions, ValidateWorkflowReport, ValidateHarnessOptions,
689
+ ValidatedAgentCall, ValidatedCheckpoint,
672
690
  WorkflowManagerOptions, CheckpointOptions, WorkflowRunResult, WorkflowRunFallback,
673
691
  WorkflowCheckpointTaken, WorkflowCheckpointSource, WorkflowSnapshot,
674
692
  WorkflowPathOptions, RunPersistence, RunPersistenceOptions,
675
693
  AcpPoolOptions, AcpRunnerOptions, AgentRunner, RunOptions, AgentResult, AgentUsage, JournalEntry,
676
694
  AgentSessionRef, AgentSessionRecord, WorkflowBackendConfig, WorkflowCallRecord, WorkflowRecordedError,
677
- InteractiveSessionOptions, InteractiveTurn, PermissionResolver,
695
+ InteractiveSessionOptions, InteractiveTurn, ProbedConfigOptions, SessionConfigOption,
696
+ PermissionResolver,
678
697
  AuthResolver, AuthContext, AuthResolution, AuthMethodDescriptor, AuthCapableRunner,
679
698
  ProviderCapableRunner, // duck-type gate for the MCP provider tools (providers/list|set|disable)
680
699
  ClientHandlers, FsHandlers, TerminalHandlers, McpHandlers, AcpSessionContext, NegotiatedCapabilities,
package/dist/cli.js CHANGED
@@ -5,7 +5,8 @@
5
5
  //
6
6
  // Validates a workflow script without spending tokens: static parse (meta literal,
7
7
  // syntax, determinism blocklist), then a dry run over an in-process mock AgentRunner
8
- // that fabricates schema-conforming results no ACP process is spawned. See
8
+ // that fabricates schema-conforming results, then one no-prompt option probe per routed
9
+ // ACP harness. See
9
10
  // ./validate.ts for the programmatic API (`validateWorkflowScript`).
10
11
  import { existsSync, readFileSync, statSync, writeFileSync } from "node:fs";
11
12
  import { resolve } from "node:path";
@@ -16,8 +17,11 @@ const USAGE = `Usage: agentprism-workflows validate <workflow-file-or-name> [opt
16
17
  Validates an AgentPrism workflow script without spending tokens:
17
18
  1. static parse — the meta literal, syntax, and the determinism blocklist
18
19
  2. dry run — the script executes against a mock agent backend that fabricates
19
- schema-conforming results; no ACP process is spawned, no tokens are spent,
20
- and a mock live confirm resolves checkpoints to their declared defaults
20
+ schema-conforming results; no tokens are spent, and a mock live confirm
21
+ resolves checkpoints to their declared defaults
22
+ 3. config probe — each routed ACP harness opens once with no prompt; advertised
23
+ options are reported and authored configOptions are checked. Probe failures warn
24
+ and skip that harness's checks without making validation fail
21
25
 
22
26
  Options:
23
27
  --args <json> the script's \`args\` global for the dry run (a JSON value)
package/dist/index.d.ts CHANGED
@@ -8,11 +8,11 @@ export { runIsolation, createReplayRunner, type RunIsolationSdkOptions } from ".
8
8
  export type { RunIsolationOptions, IsolationRunResult, ReplayRunnerOptions, ResolvedIsolationTarget, IsolationTarget, ReplayRunner, ReplayObservation, ReplayReport, ReplayCallReport, ReplayDivergenceEvent, CheckpointCallContext, WorkflowCallRecord, WorkflowRecordedError, } from "./isolation.js";
9
9
  export { openWorkflowDir, type WorkflowDir, type WorkflowDirEntry, type OpenWorkflowDirOptions, } from "@automatalabs/workflow-engine";
10
10
  export { validateWorkflowScript, fabricateFromSchema, formatValidateReport, MOCK_TOKENS_PER_AGENT } from "./validate.js";
11
- export type { MockAnswerJson, MockAnswerRule, MockAnswers, MockAnswerSequence, UnusedMockAnswer, ValidateWorkflowOptions, ValidateWorkflowReport, ValidatedAgentCall, ValidatedCheckpoint, ValidatedMockAnswerRule, ValidatedMockAnswers, ValidatedMockAnswerUse, } from "./validate.js";
11
+ export type { MockAnswerJson, MockAnswerRule, MockAnswers, MockAnswerSequence, UnusedMockAnswer, ValidateWorkflowOptions, ValidateWorkflowReport, ValidateHarnessOptions, ValidatedAgentCall, ValidatedCheckpoint, ValidatedMockAnswerRule, ValidatedMockAnswers, ValidatedMockAnswerUse, } from "./validate.js";
12
12
  export type { WorkflowRunOptions, AgentOptions, ExecOptions, WorkflowManagerOptions, CheckpointOptions, WorkflowRunResult, WorkflowSnapshot, WorkflowPathOptions, RunPersistence, RunPersistenceOptions, PersistedRunState, PersistedAgentState, WorkflowLogTail, WorkflowRunCallStatus, WorkflowRunInspectionOptions, WorkflowRunStatus, WorkflowRunStatusTruncation, WorkflowRunFallback, WorkflowCheckpointSource, WorkflowCheckpointTaken, } from "@automatalabs/workflow-engine";
13
13
  export { AGENTPRISM_PERSISTENCE_ROOT_ENV, WorkflowError, WorkflowErrorCode, isWorkflowError, isProviderUsageLimit, isAuthRequired, } from "@automatalabs/workflow-engine";
14
14
  export { createAcpRunner, AcpAgentRunner, InteractiveSession, selectBackend, ClaudeBackend, CodexBackend, CustomAcpBackend, AGENT_METHODS, CLIENT_METHODS, AGENT_METHOD_COVERAGE, CLIENT_METHOD_COVERAGE, ACP_AUTH_REQUIRED_ERROR_CODE, clientCapabilitiesFor, adaptPromptContent, resolveBackendRegistry, BACKENDS_ENV, toJsonSchema, toStrictJsonSchema, } from "@automatalabs/acp-agents";
15
- export type { AcpPoolOptions, AcpRunnerOptions, AuthenticateOptions, AuthMethodsOptions, DisableProviderOptions, DeleteSessionOptions, InteractiveSessionOptions, InteractiveTurn, ListProvidersOptions, ListSessionsOptions, LogoutOptions, ReattachSessionOptions, SetProviderOptions, BackendRegistry, CustomBackendConfig, RegisteredBackend, ClientCapabilityOptions, ClientHandlers, FsHandlers, McpHandlers, TerminalHandlers, AcpSessionContext, NegotiatedCapabilities, PermissionResolver, AgentAuthCapabilities, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, AuthCapabilities, AuthEnvVar, AuthenticateRequest, AuthenticateResponse, AuthMethod, AuthMethodAgent, AuthMethodEnvVar, AuthMethodId, AuthMethodTerminal, ConnectMcpRequest, ConnectMcpResponse, DeleteSessionRequest, DeleteSessionResponse, DisableProviderRequest, DisableProviderResponse, DisconnectMcpRequest, DisconnectMcpResponse, ListProvidersRequest, ListProvidersResponse, ListSessionsRequest, ListSessionsResponse, LlmProtocol, LoadSessionRequest, LoadSessionResponse, LogoutCapabilities, LogoutRequest, LogoutResponse, McpConnectionId, McpServerAcp, McpServerAcpId, MessageMcpNotification, MessageMcpRequest, MessageMcpResponse, ProviderCurrentConfig, ProviderId, ProviderInfo, ProvidersCapabilities, ResumeSessionRequest, ResumeSessionResponse, SetProviderRequest, SetProviderResponse, AgentNotificationMethod, AgentNotificationParamsByMethod, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, ElicitationAcceptAction, ElicitationCapabilities, ElicitationContentValue, ElicitationFormCapabilities, ElicitationFormMode, ElicitationId, ElicitationPropertySchema, ElicitationRequestScope, ElicitationResolver, ElicitationSchema, ElicitationSchemaType, ElicitationSessionScope, ElicitationUrlCapabilities, ElicitationUrlMode, SessionMode, SessionModeState, SessionInfo, SendRequestOptions, AgentMethodCoverage, ClientMethodCoverage, } from "@automatalabs/acp-agents";
15
+ export type { AcpPoolOptions, AcpRunnerOptions, AuthenticateOptions, AuthMethodsOptions, DisableProviderOptions, DeleteSessionOptions, InteractiveSessionOptions, InteractiveTurn, ListProvidersOptions, ListSessionsOptions, LogoutOptions, ProbedConfigOptions, ReattachSessionOptions, SetProviderOptions, BackendRegistry, CustomBackendConfig, RegisteredBackend, ClientCapabilityOptions, ClientHandlers, FsHandlers, McpHandlers, TerminalHandlers, AcpSessionContext, NegotiatedCapabilities, PermissionResolver, AgentAuthCapabilities, AgentRequestMethod, AgentRequestParamsByMethod, AgentRequestResponsesByMethod, AuthCapabilities, AuthEnvVar, AuthenticateRequest, AuthenticateResponse, AuthMethod, AuthMethodAgent, AuthMethodEnvVar, AuthMethodId, AuthMethodTerminal, ConnectMcpRequest, ConnectMcpResponse, DeleteSessionRequest, DeleteSessionResponse, DisableProviderRequest, DisableProviderResponse, DisconnectMcpRequest, DisconnectMcpResponse, ListProvidersRequest, ListProvidersResponse, ListSessionsRequest, ListSessionsResponse, LlmProtocol, LoadSessionRequest, LoadSessionResponse, LogoutCapabilities, LogoutRequest, LogoutResponse, McpConnectionId, McpServerAcp, McpServerAcpId, MessageMcpNotification, MessageMcpRequest, MessageMcpResponse, ProviderCurrentConfig, ProviderId, ProviderInfo, ProvidersCapabilities, ResumeSessionRequest, ResumeSessionResponse, SetProviderRequest, SetProviderResponse, AgentNotificationMethod, AgentNotificationParamsByMethod, CompleteElicitationNotification, CreateElicitationRequest, CreateElicitationResponse, ElicitationAcceptAction, ElicitationCapabilities, ElicitationContentValue, ElicitationFormCapabilities, ElicitationFormMode, ElicitationId, ElicitationPropertySchema, ElicitationRequestScope, ElicitationResolver, ElicitationSchema, ElicitationSchemaType, ElicitationSessionScope, ElicitationUrlCapabilities, ElicitationUrlMode, SessionMode, SessionModeState, SessionConfigOption, SessionInfo, SendRequestOptions, AgentMethodCoverage, ClientMethodCoverage, } from "@automatalabs/acp-agents";
16
16
  export type { AuthResolver, AuthContext, AuthResolution, AuthMethodDescriptor, CompleteAuthOptions, AuthOutcome, AuthController, AuthStatusSnapshot, AuthCapableRunner, ProviderCapableRunner, } from "@automatalabs/acp-agents";
17
17
  export type { AuthErrorContext, CheckpointContext } from "@automatalabs/shared-types";
18
18
  export { TypedEventEmitter } from "@automatalabs/acp-agents";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAKL,eAAe,IAAI,qBAAqB,EACzC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAoB,YAAY,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAC;AACjH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,KAAK,EAAE,WAAW,EAAyB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAMzF,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAI3G,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBA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AC;QAAC,OAAO,CAAC,EAAE,SAAS,CAAA;KAAE,GACxC;QAAE,QAAQ,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;KAAE,CAC1D;IAgBc,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAK9E;8FAC0F;IAC1F,OAAO,IAAI,IAAI;IAOf,8EAA8E;IAC9E,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,sBAAsB;CAiC/B;AAoCD;;;;;;;;GAQG;AACH,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kGAAkG;IAClG,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,qBAAqB,CAAC;IAC5C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,yBAA8B,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAsC5B"}
@@ -0,0 +1,12 @@
1
+ import { type CustomBackendConfig, type ProbedConfigOptions } from "@automatalabs/acp-agents";
2
+ export interface ValidateProbeRunner {
3
+ probeConfigOptions(spec?: string, opts?: {
4
+ cwd?: string;
5
+ }): Promise<ProbedConfigOptions>;
6
+ dispose(): Promise<void>;
7
+ }
8
+ export type ValidateProbeFactory = (backends: Record<string, CustomBackendConfig> | undefined) => ValidateProbeRunner;
9
+ export declare function createValidateProbeRunner(backends: Record<string, CustomBackendConfig> | undefined): ValidateProbeRunner;
10
+ /** Package-internal hermetic test seam. Deliberately absent from the public index export. */
11
+ export declare function setValidateProbeFactoryForTests(factory: ValidateProbeFactory): () => void;
12
+ //# sourceMappingURL=validate-internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-internal.d.ts","sourceRoot":"","sources":["../src/validate-internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS,KACtD,mBAAmB,CAAC;AAIzB,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS,GACxD,mBAAmB,CAErB;AAED,6FAA6F;AAC7F,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAMzF"}
@@ -0,0 +1,13 @@
1
+ import { AcpAgentRunner, } from "@automatalabs/acp-agents";
2
+ let probeFactory = (backends) => new AcpAgentRunner({ backends });
3
+ export function createValidateProbeRunner(backends) {
4
+ return probeFactory(backends);
5
+ }
6
+ /** Package-internal hermetic test seam. Deliberately absent from the public index export. */
7
+ export function setValidateProbeFactoryForTests(factory) {
8
+ const previous = probeFactory;
9
+ probeFactory = factory;
10
+ return () => {
11
+ probeFactory = previous;
12
+ };
13
+ }
@@ -1,3 +1,4 @@
1
+ import type { SessionConfigOption } from "@automatalabs/acp-agents";
1
2
  import type { WorkflowDir } from "@automatalabs/workflow-engine";
2
3
  import type { WorkflowMeta } from "@automatalabs/shared-types";
3
4
  export type MockAnswerJson = null | boolean | number | string | MockAnswerJson[] | {
@@ -64,13 +65,22 @@ export interface ValidatedAgentCall {
64
65
  model?: string;
65
66
  tier?: string;
66
67
  mode?: string;
67
- /** Which backend the spec routes to: "claude" | "codex" | "opencode" | a custom backend
68
- * name (suffixed " (script-declared)" when it comes from meta.backends) | "default". */
68
+ /** The verbatim session config options authored for this call. */
69
+ configOptions?: Record<string, string | boolean>;
70
+ /** Which concrete backend the spec routes to: "claude" | "codex" | "opencode" | a custom
71
+ * backend name (suffixed " (script-declared)" when it comes from meta.backends). */
69
72
  backend: string;
70
73
  /** True when the call requested structured output. */
71
74
  schema: boolean;
72
75
  mockAnswer?: ValidatedMockAnswerUse;
73
76
  }
77
+ export interface ValidateHarnessOptions {
78
+ backendId: string;
79
+ probed: boolean;
80
+ /** Present when probed=false: the harness's spawn/auth/session error. */
81
+ error?: string;
82
+ options?: SessionConfigOption[];
83
+ }
74
84
  export interface ValidatedCheckpoint {
75
85
  prompt: string;
76
86
  kind: string;
@@ -78,9 +88,9 @@ export interface ValidatedCheckpoint {
78
88
  reply: unknown;
79
89
  }
80
90
  export interface ValidateWorkflowReport {
81
- /** True when the parse succeeded AND the dry run (if performed) completed. */
91
+ /** True when parse, dry run, and all checks against successfully probed catalogs pass. */
82
92
  ok: boolean;
83
- /** 0 = valid; 1 = parse/static failure; 2 = dry-run failure. */
93
+ /** 0 = valid; 1 = parse/static failure; 2 = dry-run or config-option failure. */
84
94
  exitCode: 0 | 1 | 2;
85
95
  parse: {
86
96
  ok: boolean;
@@ -98,6 +108,8 @@ export interface ValidateWorkflowReport {
98
108
  phasesVisited: string[];
99
109
  logs: string[];
100
110
  durationMs: number;
111
+ /** Fresh, per-run advertised config-option catalogs for every routed harness. */
112
+ harnessOptions?: ValidateHarnessOptions[];
101
113
  /** The script's return value, composed from fabricated agent results. */
102
114
  result?: unknown;
103
115
  mockAnswers?: ValidatedMockAnswers;
@@ -114,8 +126,9 @@ export declare function fabricateFromSchema(schema: unknown, hint?: string, dept
114
126
  * budget-guarded script paths deterministically. */
115
127
  export declare const MOCK_TOKENS_PER_AGENT = 1000;
116
128
  /**
117
- * Validate a workflow script: parse it, then (by default) dry-run it against a mock
118
- * AgentRunner. Never throws for an invalid script — read `report.ok` / `report.exitCode`.
129
+ * Validate a workflow script: parse it, dry-run against a mock AgentRunner, then probe
130
+ * each routed harness's advertised config options. Never throws for an invalid script —
131
+ * read `report.ok` / `report.exitCode`.
119
132
  */
120
133
  export declare function validateWorkflowScript(script: string, options?: ValidateWorkflowOptions): Promise<ValidateWorkflowReport>;
121
134
  /** Render a ValidateWorkflowReport as the human-readable CLI output. */
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAA2B,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGxF,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,cAAc,EAAE,GAChB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAC;AAEtC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,kBAAkB,CAAC;AAEjE,uEAAuE;AACvE,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;2FACuF;IACvF,SAAS,CAAC,EAAE,MAA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AAO,MAAM,qBAAqB,OAAO,CAAC;AAwK1C;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,sBAAsB,CAAC,CA4QjC;AAMD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CA0D3E"}
package/dist/validate.js CHANGED
@@ -1,17 +1,19 @@
1
1
  // Token-free validation for workflow scripts: a static parse (meta literal, syntax,
2
2
  // determinism blocklist) followed by an optional DRY RUN — the script executes for real
3
3
  // in the engine's deterministic realm, but every agent() call is served by an in-process
4
- // mock AgentRunner that fabricates schema-conforming results. No ACP process is spawned,
5
- // no tokens are spent, a mock live confirm resolves checkpoints to their declared defaults, and run state is
6
- // journaled nowhere (journaling off + a throwaway persistence root for the run lease).
4
+ // mock AgentRunner that fabricates schema-conforming results. Afterward, each routed ACP harness
5
+ // is opened once without a prompt to read its advertised config options. No tokens are spent, a
6
+ // mock live confirm resolves checkpoints to their declared defaults, and run state is journaled
7
+ // nowhere (journaling off + a throwaway persistence root for the run lease).
7
8
  //
8
9
  // This is the programmatic core behind `agentprism-workflows validate` (see ./cli.ts).
9
10
  import { mkdtempSync, rmSync } from "node:fs";
10
11
  import { tmpdir } from "node:os";
11
12
  import { join } from "node:path";
12
13
  import { openWorkflowDir, WorkflowError, WorkflowErrorCode, WorkflowManager, parseWorkflowScript, redactText, } from "@automatalabs/workflow-engine";
13
- import { resolveBackendRegistry, selectBackend } from "@automatalabs/acp-agents";
14
+ import { registryWithRunBackends, resolveBackendRegistry, selectBackend, } from "@automatalabs/acp-agents";
14
15
  import { Check, Errors } from "typebox/value";
16
+ import { createValidateProbeRunner } from "./validate-internal.js";
15
17
  const MAX_MOCK_ANSWERS_BYTES = 256 * 1024;
16
18
  const MAX_MOCK_ANSWER_RULES = 256;
17
19
  const MAX_MOCK_ANSWER_GLOB_LENGTH = 256;
@@ -550,25 +552,126 @@ export function fabricateFromSchema(schema, hint = "value", depth = 0) {
550
552
  /** Tokens the mock runner reports per agent call, so `--token-budget` exercises
551
553
  * budget-guarded script paths deterministically. */
552
554
  export const MOCK_TOKENS_PER_AGENT = 1000;
553
- function attributeBackend(model, tier, declared) {
554
- const spec = model ?? tier;
555
- if (!spec)
556
- return "default";
557
- const head = spec.split("/")[0].replace(/\[[^\]]*\]\s*$/, "").trim().toLowerCase();
558
- if (declared && Object.keys(declared).some((name) => name.toLowerCase() === head)) {
559
- return `${head} (script-declared)`;
555
+ function routeBackend(model, tier, registry, hostRegistry, declared) {
556
+ const backendId = selectBackend({ model, tier }, registry).id;
557
+ const scriptDeclared = !hostRegistry.has(backendId) &&
558
+ Object.keys(declared ?? {}).some((name) => name.toLowerCase() === backendId.toLowerCase());
559
+ return {
560
+ backendId,
561
+ display: scriptDeclared ? `${backendId} (script-declared)` : backendId,
562
+ };
563
+ }
564
+ function registryOptions(registry) {
565
+ if (registry.size === 0)
566
+ return undefined;
567
+ return Object.fromEntries([...registry].map(([name, entry]) => {
568
+ const { name: _name, ...config } = entry;
569
+ return [name, config];
570
+ }));
571
+ }
572
+ async function probeHarnessConfigOptions(calls, cwd, registry, hostRegistry, declared, warnings) {
573
+ const backendIds = [
574
+ ...new Set(calls.map((call) => routeBackend(call.model, call.tier, registry, hostRegistry, declared).backendId)),
575
+ ].sort();
576
+ const harnessOptions = [];
577
+ const catalogs = new Map();
578
+ if (backendIds.length === 0)
579
+ return { harnessOptions, catalogs };
580
+ let runner;
581
+ try {
582
+ runner = createValidateProbeRunner(registryOptions(registry));
583
+ }
584
+ catch (error) {
585
+ const reason = errorMessage(error);
586
+ for (const backendId of backendIds) {
587
+ warnings.push(`could not probe ${backendId} — configOptions on its calls are unverified: ${reason}`);
588
+ harnessOptions.push({ backendId, probed: false, error: reason });
589
+ }
590
+ return { harnessOptions, catalogs };
560
591
  }
561
592
  try {
562
- const registry = resolveBackendRegistry(declared);
563
- return selectBackend({ model, tier }, registry).id;
593
+ for (const backendId of backendIds) {
594
+ try {
595
+ const result = await runner.probeConfigOptions(backendId, { cwd });
596
+ catalogs.set(backendId, result.options);
597
+ harnessOptions.push({
598
+ backendId: result.backendId,
599
+ probed: true,
600
+ options: result.options,
601
+ });
602
+ }
603
+ catch (error) {
604
+ const reason = errorMessage(error);
605
+ warnings.push(`could not probe ${backendId} — configOptions on its calls are unverified: ${reason}`);
606
+ harnessOptions.push({ backendId, probed: false, error: reason });
607
+ }
608
+ }
564
609
  }
565
- catch {
566
- return "default";
610
+ finally {
611
+ try {
612
+ await runner.dispose();
613
+ }
614
+ catch {
615
+ // Probe results are complete; process cleanup must not change validation semantics.
616
+ }
617
+ }
618
+ return { harnessOptions, catalogs };
619
+ }
620
+ function errorMessage(error) {
621
+ return redactText(error instanceof Error ? error.message : String(error)).value;
622
+ }
623
+ function configOptionErrors(calls, catalogs, registry, hostRegistry, declared) {
624
+ const errors = [];
625
+ for (const call of calls) {
626
+ if (!call.configOptions || Object.keys(call.configOptions).length === 0)
627
+ continue;
628
+ const backendId = routeBackend(call.model, call.tier, registry, hostRegistry, declared).backendId;
629
+ const advertised = catalogs.get(backendId);
630
+ if (!advertised)
631
+ continue;
632
+ const optionIds = advertised.map((option) => option.id);
633
+ for (const [id, value] of Object.entries(call.configOptions)) {
634
+ const authored = displayValue(value);
635
+ if (id === "model") {
636
+ errors.push(`agent "${call.label}" configOptions option "model" authored value ${authored} is reserved; ` +
637
+ `advertised alternatives: use the call's model field; option ids ${displayAlternatives(optionIds)}`);
638
+ continue;
639
+ }
640
+ const option = advertised.find((candidate) => candidate.id === id);
641
+ if (!option) {
642
+ errors.push(`agent "${call.label}" configOptions option ${JSON.stringify(id)} authored value ${authored} is unknown; ` +
643
+ `advertised alternatives: option ids ${displayAlternatives(optionIds)}`);
644
+ continue;
645
+ }
646
+ if (option.type === "select") {
647
+ const choices = selectChoiceValues(option);
648
+ if (typeof value !== "string" || !choices.includes(value)) {
649
+ errors.push(`agent "${call.label}" configOptions option ${JSON.stringify(id)} authored value ${authored} is not an advertised select value; ` +
650
+ `advertised alternatives: ${displayAlternatives(choices)}`);
651
+ }
652
+ continue;
653
+ }
654
+ if (typeof value !== "boolean") {
655
+ errors.push(`agent "${call.label}" configOptions option ${JSON.stringify(id)} authored value ${authored} must be boolean; ` +
656
+ "advertised alternatives: true, false");
657
+ }
658
+ }
567
659
  }
660
+ return errors;
661
+ }
662
+ function selectChoiceValues(option) {
663
+ return option.options.flatMap((entry) => ("options" in entry ? entry.options : [entry])).map((entry) => entry.value);
664
+ }
665
+ function displayValue(value) {
666
+ return JSON.stringify(value) ?? String(value);
667
+ }
668
+ function displayAlternatives(values) {
669
+ return values.length > 0 ? values.map((value) => JSON.stringify(value)).join(", ") : "(none advertised)";
568
670
  }
569
671
  /**
570
- * Validate a workflow script: parse it, then (by default) dry-run it against a mock
571
- * AgentRunner. Never throws for an invalid script — read `report.ok` / `report.exitCode`.
672
+ * Validate a workflow script: parse it, dry-run against a mock AgentRunner, then probe
673
+ * each routed harness's advertised config options. Never throws for an invalid script —
674
+ * read `report.ok` / `report.exitCode`.
572
675
  */
573
676
  export async function validateWorkflowScript(script, options = {}) {
574
677
  const mockAnswerState = options.mockAnswers === undefined ? undefined : normalizeMockAnswers(options.mockAnswers);
@@ -585,7 +688,11 @@ export async function validateWorkflowScript(script, options = {}) {
585
688
  warnings,
586
689
  };
587
690
  }
588
- const declaredBackends = meta.backends && Object.keys(meta.backends).length > 0 ? meta.backends : undefined;
691
+ const declaredBackends = meta.backends && Object.keys(meta.backends).length > 0
692
+ ? meta.backends
693
+ : undefined;
694
+ const hostRegistry = resolveBackendRegistry();
695
+ const backendRegistry = registryWithRunBackends(hostRegistry, declaredBackends);
589
696
  if (declaredBackends) {
590
697
  warnings.push(`script declares custom backends (${Object.keys(declaredBackends).join(", ")}) — real runs must approve them ` +
591
698
  `(allowScriptBackends / exec.scriptBackends / AGENTPRISM_ALLOW_SCRIPT_BACKENDS=1); the dry run treats them as approved`);
@@ -608,6 +715,7 @@ export async function validateWorkflowScript(script, options = {}) {
608
715
  const metadata = {
609
716
  tier: runOptions.tier,
610
717
  mode: runOptions.mode,
718
+ configOptions: runOptions.configOptions,
611
719
  schema: runOptions.schema !== undefined,
612
720
  };
613
721
  mockMeta.set(label, metadata);
@@ -615,8 +723,9 @@ export async function validateWorkflowScript(script, options = {}) {
615
723
  if (pendingCall) {
616
724
  pendingCall.tier = metadata.tier;
617
725
  pendingCall.mode = metadata.mode;
726
+ pendingCall.configOptions = metadata.configOptions;
618
727
  pendingCall.schema = metadata.schema;
619
- pendingCall.backend = attributeBackend(pendingCall.model, metadata.tier, declaredBackends);
728
+ pendingCall.backend = routeBackend(pendingCall.model, metadata.tier, backendRegistry, hostRegistry, declaredBackends).display;
620
729
  }
621
730
  const base = runOptions.schema === undefined ? undefined : fabricateFromSchema(runOptions.schema);
622
731
  const reservation = mockAnswerState ? reserveMockAnswer(mockAnswerState, label) : undefined;
@@ -669,7 +778,8 @@ export async function validateWorkflowScript(script, options = {}) {
669
778
  model: event.model,
670
779
  tier: extra.tier,
671
780
  mode: extra.mode,
672
- backend: attributeBackend(event.model, extra.tier, declaredBackends),
781
+ configOptions: event.configOptions ?? extra.configOptions,
782
+ backend: routeBackend(event.model, extra.tier, backendRegistry, hostRegistry, declaredBackends).display,
673
783
  schema: extra.schema,
674
784
  };
675
785
  agentCalls.push(call);
@@ -702,17 +812,18 @@ export async function validateWorkflowScript(script, options = {}) {
702
812
  if (extra) {
703
813
  call.tier = extra.tier;
704
814
  call.mode = extra.mode;
815
+ call.configOptions = extra.configOptions;
705
816
  call.schema = extra.schema;
706
- call.backend = attributeBackend(call.model, extra.tier, declaredBackends);
817
+ call.backend = routeBackend(call.model, extra.tier, backendRegistry, hostRegistry, declaredBackends).display;
707
818
  }
708
819
  }
709
820
  }
710
- const ok = run.status === "completed";
711
- if (!ok && flows === undefined && run.reason?.includes("must be the first statement") && /\bworkflow\s*\(/.test(script)) {
821
+ const runOk = run.status === "completed";
822
+ if (!runOk && flows === undefined && run.reason?.includes("must be the first statement") && /\bworkflow\s*\(/.test(script)) {
712
823
  warnings.push('the failure looks like a nested workflow("<name>") call on a bare name — provide workflow dirs ' +
713
824
  "(ValidateWorkflowOptions.workflows / --workflows-dir) so names resolve during the dry run");
714
825
  }
715
- if (ok) {
826
+ if (runOk) {
716
827
  if (agentCalls.length === 0 && checkpoints.length === 0) {
717
828
  warnings.push("the script completed without a single agent() or checkpoint() call");
718
829
  }
@@ -733,6 +844,15 @@ export async function validateWorkflowScript(script, options = {}) {
733
844
  const mockAnswers = mockAnswerState ? buildMockAnswersReport(mockAnswerState) : undefined;
734
845
  if (mockAnswerState && mockAnswers)
735
846
  appendMockAnswerWarnings(mockAnswerState, mockAnswers, warnings);
847
+ const probed = await probeHarnessConfigOptions(agentCalls, baseCwd, backendRegistry, hostRegistry, declaredBackends, warnings);
848
+ const optionErrors = configOptionErrors(agentCalls, probed.catalogs, backendRegistry, hostRegistry, declaredBackends);
849
+ const ok = runOk && optionErrors.length === 0;
850
+ const runReason = timedOut ? `dry run exceeded ${timeoutMs}ms and was aborted` : run.reason;
851
+ const reason = optionErrors.length === 0
852
+ ? runReason
853
+ : [runReason, "configOptions validation failed:", ...optionErrors.map((error) => `- ${error}`)]
854
+ .filter(Boolean)
855
+ .join("\n");
736
856
  return {
737
857
  ok,
738
858
  exitCode: ok ? 0 : 2,
@@ -740,13 +860,14 @@ export async function validateWorkflowScript(script, options = {}) {
740
860
  dryRun: {
741
861
  ok,
742
862
  status: run.status,
743
- reason: timedOut ? `dry run exceeded ${timeoutMs}ms and was aborted` : run.reason,
863
+ reason,
744
864
  timedOut,
745
865
  agentCalls,
746
866
  checkpoints,
747
867
  phasesVisited: run.phases ?? [],
748
868
  logs: run.logs ?? [],
749
869
  durationMs: run.durationMs,
870
+ harnessOptions: probed.harnessOptions,
750
871
  result: run.result,
751
872
  ...(mockAnswers ? { mockAnswers } : {}),
752
873
  },
@@ -803,6 +924,25 @@ export function formatValidateReport(report) {
803
924
  .join(" ");
804
925
  lines.push(` • ${call.label} ${bits}`);
805
926
  }
927
+ lines.push(" advertised config options:");
928
+ for (const harness of dry.harnessOptions ?? []) {
929
+ if (!harness.probed) {
930
+ lines.push(` ${harness.backendId}: probe failed — ${harness.error ?? "unknown error"}`);
931
+ continue;
932
+ }
933
+ lines.push(` ${harness.backendId}:`);
934
+ lines.push(" id | type | current | choices");
935
+ if ((harness.options ?? []).length === 0) {
936
+ lines.push(" (none advertised)");
937
+ continue;
938
+ }
939
+ for (const option of harness.options ?? []) {
940
+ const choices = option.type === "select" ? displayAlternatives(selectChoiceValues(option)) : "true, false";
941
+ lines.push(` ${option.id} | ${option.type} | ${displayValue(option.currentValue)} | ${choices}`);
942
+ }
943
+ }
944
+ if ((dry.harnessOptions ?? []).length === 0)
945
+ lines.push(" (no routed harnesses)");
806
946
  for (const cp of dry.checkpoints) {
807
947
  lines.push(` ◆ checkpoint [${cp.kind}] "${truncate(cp.prompt, 60)}" → ${JSON.stringify(cp.reply)}`);
808
948
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automatalabs/workflows",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "typebox": "1.3.2",
34
- "@automatalabs/shared-types": "0.19.0",
35
- "@automatalabs/workflow-engine": "0.20.0",
36
- "@automatalabs/acp-agents": "0.25.1"
34
+ "@automatalabs/shared-types": "0.20.0",
35
+ "@automatalabs/workflow-engine": "0.21.0",
36
+ "@automatalabs/acp-agents": "0.26.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsc -b",