@automatalabs/workflows 0.52.1 → 0.53.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
@@ -654,31 +654,32 @@ expressions), then a **dry run** — the script executes in the real engine real
654
654
  `agent()` call is served by an in-process mock `AgentRunner` that fabricates schema-conforming
655
655
  results. The dry run catches what a parse can't: thunk-vs-promise mistakes, reference errors,
656
656
  broken plumbing between calls. Finally, validation opens one no-prompt session for every distinct
657
- routed `{ backend, model }` pair, selects that call's model verbatim when one was authored, surfaces
658
- the echoed model-specific config-option catalog, and checks every authored `configOptions` bag
659
- against it. This probe uses zero tokens. A pair that cannot spawn, authenticate, select its model,
660
- or open a session contributes one warning and `probed:false`; only that pair's option checks are
661
- skipped, so probe failure alone never invalidates the script. There is no cached catalog or opt-out
662
- flag.
657
+ routed backend/model target, selects that call's model verbatim when one was authored, surfaces
658
+ the echoed model-specific ACP modes and config-option catalog, and checks every authored `mode`
659
+ and `configOptions` bag against it. Only exact ids in `modes.availableModes` pass; `modes:null`
660
+ means omit `mode`, never infer `"default"`. This probe uses zero tokens. A target that cannot spawn,
661
+ authenticate, select its model, or open a session contributes one warning and `probed:false`; only
662
+ that target's configuration checks are skipped, so probe failure alone never invalidates the script.
663
+ There is no cached catalog or opt-out flag.
663
664
  A mock live confirm answers checkpoints with `default ?? true`, so `headless: "pause"`
664
665
  dry-runs cleanly; `headless: "abort"` warns because a truly unattended run would abort.
665
666
  Script-declared `meta.backends` are treated as approved (with a warning that real runs require
666
- approval). The report lists every agent call with its backend attribution and `configOptions`
667
- echo, every checkpoint, the full option table for every routed backend/model pair (even when no call authors
668
- options), and warnings. Unknown ids, invalid select values, non-boolean boolean values, and the
669
- reserved `"model"` id make the report invalid with exit code `2`; each diagnostic names the call,
667
+ approval). The report lists every agent call with its backend attribution, `mode`, and `configOptions`
668
+ echo, every checkpoint, the full mode/option table for every routed backend/model target (even when no call authors
669
+ options), and warnings. An unadvertised mode, unknown config id, invalid select value, non-boolean
670
+ boolean value, or reserved `"model"` id makes the report invalid with exit code `2`; each diagnostic names the call,
670
671
  authored value, and advertised alternatives. For select options carrying
671
672
  `_meta["@automatalabs/agentprism"].recognizedValues`, a supported value passes, an unsupported but
672
673
  recognized value passes with a warning naming the effective clamp target, and an unrecognized value
673
674
  is invalid. Pi's `thinkingLevel` option publishes this metadata from Pi's own ordered domain and
674
675
  therefore needs no extra probes. For an ordered built-in that omits the metadata (Claude or Codex),
675
676
  validation reads its advertised model picker, probes each selectable model through the same
676
- per-`{ backend, model }` cache, merges consistent per-model thought-level orders, and applies the
677
+ per-target probe cache, merges consistent per-model thought-level orders, and applies the
677
678
  same recognized-value/clamp path. Claude models that omit `effort` do not inherit another model's
678
679
  option, and its `default` sentinel is recognized but excluded from ceiling ordering. Enumeration is
679
680
  skipped, with a warning, when a picker advertises more than 32 models or the orders cannot be merged.
680
681
  OpenCode and custom/unknown backends are exact-set: an unadvertised thought-level value is invalid
681
- instead of clamping. Exit codes are `0` valid, `1` parse failure, `2` dry-run or config-option failure,
682
+ instead of clamping. Exit codes are `0` valid, `1` parse failure, `2` dry-run or agent-configuration failure,
682
683
  `3` usage error.
683
684
 
684
685
  Flags: `--args <json>` / `--args-file <path>`, `--workflows-dir <dir>` (repeatable — validate by
@@ -732,7 +733,7 @@ const report = await validateWorkflowScript(script, { args: { target: "src/" },
732
733
  report.ok; // parse ok AND dry run completed
733
734
  report.dryRun?.agentCalls; // calls include mockAnswer: { glob, sequenceIndex?, sequenceLength? }
734
735
  report.dryRun?.harnessOptions;
735
- // [{ backendId, model?, probed, options?: SessionConfigOption[], error?: string }]
736
+ // [{ backendId, model?, probed, modes?: SessionModeState | null, options?: SessionConfigOption[], error?: string }]
736
737
  report.dryRun?.mockAnswers;// normalized rule counters + item-level unused records
737
738
  report.warnings; // approval reminders, phase mismatches, headless-abort checkpoints, …
738
739
  ```
@@ -754,8 +755,10 @@ npx @automatalabs/workflows config claude --json # machine-readable report
754
755
  Harness names are the routing names: built-in `claude` / `codex` / `opencode` / `pi` plus any custom
755
756
  backend registered via `AGENTPRISM_BACKENDS` (registered customs also join the no-argument
756
757
  default set). Each harness opens one session without a prompt — zero tokens — and reports its
757
- advertised config-option catalog: model ids (including bracket variants), effort
758
- levels, modes, boolean knobs. A harness that cannot spawn or authenticate reports
758
+ advertised ACP modes plus its config-option catalog: model ids (including bracket variants), effort
759
+ levels, and boolean knobs. A non-null `modes` object contains `currentModeId` and `availableModes`;
760
+ only exact listed ids may be authored. `modes: null` means omit `mode`, never infer `"default"`.
761
+ A harness that cannot spawn or authenticate reports
759
762
  `probed: false` with the reason and never blocks the others. Flags: `--cwd <dir>` (probe
760
763
  session cwd; default the current directory), `--timeout-ms <n>` (per-harness bound, default
761
764
  60000), `--models[=<filter>]`, `--json`. Exit codes: `0` all probed, `1` at least one probe
@@ -776,7 +779,7 @@ import { probeHarnessConfig, formatHarnessConfigReport } from "@automatalabs/wor
776
779
  const report = await probeHarnessConfig({ harnesses: ["codex"] });
777
780
  const exact = await probeHarnessConfig({ modelSpecs: ["codex/gpt-5.6-sol"] }); // selects it first
778
781
  report.ok; // every requested harness probed
779
- report.harnessOptions; // [{ backendId, model?, probed, options?: SessionConfigOption[], error?: string }]
782
+ report.harnessOptions; // [{ backendId, model?, probed, modes?: SessionModeState | null, options?: SessionConfigOption[], error?: string }]
780
783
  formatHarnessConfigReport(report); // the CLI's human table
781
784
  ```
782
785
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAM7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG/E,MAAM,WAAW,yBAAyB;IACxC;;4EAEwE;IACxE,SAAS,CAAC,E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;2FAE2F;AAC3F,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,cAAc,EAAE,OAAO,CAAC;IACxB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAYD;;yFAEyF;AACzF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAY3E;AAED,kFAAkF;AAClF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,MAAM,GACd,iBAAiB,EAAE,CAmBrB;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,MAAM,CA2B/E"}
package/dist/config.js CHANGED
@@ -2,8 +2,9 @@
2
2
  // (see ./cli.ts), validate's sibling. Where validate probes only the harnesses a script
3
3
  // routes to, this probes any requested (or every routable) harness WITHOUT a script:
4
4
  // one no-prompt ACP session per harness, returning the agent-advertised session
5
- // config-option catalog verbatim model ids (including bracket variants), effort
6
- // levels, modes, and every other negotiable option. Zero tokens. Authoring flows run
5
+ // config-option catalog plus the effective ACP session-mode catalog model ids
6
+ // (including bracket variants), effort levels, modes, and every other negotiable option.
7
+ // Zero tokens. Authoring flows run
7
8
  // this FIRST so `model` / `configOptions` values come from the live catalog, not memory.
8
9
  import { redactText } from "@automatalabs/workflow-engine";
9
10
  import { BUILTIN_BACKEND_IDS, resolveBackendRegistry, } from "@automatalabs/acp-agents";
@@ -46,6 +47,7 @@ export async function probeHarnessConfig(options = {}) {
46
47
  backendId: result.backendId,
47
48
  ...(target.selectModel ? { model: target.spec } : {}),
48
49
  probed: true,
50
+ modes: result.modes ?? null,
49
51
  options: result.options,
50
52
  });
51
53
  }
@@ -74,7 +76,7 @@ export async function probeHarnessConfig(options = {}) {
74
76
  }
75
77
  /** Render a HarnessConfigReport as the human-readable CLI output (validate's table format). */
76
78
  export function formatHarnessConfigReport(report) {
77
- const lines = ["advertised config options:"];
79
+ const lines = ["advertised modes and config options:"];
78
80
  if (report.harnessOptions.length === 0) {
79
81
  lines.push(" (no harnesses requested)");
80
82
  }