@williambeto/ai-workflow 2.8.2 → 2.9.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/core/index.d.ts CHANGED
@@ -168,8 +168,10 @@ declare class EvidenceLedger {
168
168
  verifyRoleConfinement(): Promise<RoleConfinementResult>;
169
169
  }
170
170
 
171
- interface InspectResult {
171
+ type RuntimeName = "opencode" | "codex";
172
+ interface RuntimeInspection {
172
173
  available: boolean;
174
+ projectTrusted?: boolean;
173
175
  supports: {
174
176
  run: boolean;
175
177
  server: boolean;
@@ -178,7 +180,7 @@ interface InspectResult {
178
180
  model: boolean;
179
181
  };
180
182
  }
181
- interface ExecuteOptions {
183
+ interface RuntimeExecuteOptions {
182
184
  agent?: string | null;
183
185
  model?: string | null;
184
186
  readOnly?: boolean;
@@ -193,7 +195,7 @@ interface ObservedCommand {
193
195
  exitCode: number | null;
194
196
  source: "sdk" | "json-event" | "text-output";
195
197
  }
196
- interface ExecuteResult {
198
+ interface RuntimeExecuteResult {
197
199
  success: boolean;
198
200
  status?: string;
199
201
  commandsRun: string[];
@@ -208,27 +210,20 @@ interface ExecuteResult {
208
210
  output?: string;
209
211
  }
210
212
  /**
211
- * OpenCodeAdapter - Real runtime integration with the OpenCode CLI.
213
+ * Runtime boundary used by the execution controller. Adapters must report
214
+ * only commands and actors observed from the runtime, never agent claims.
212
215
  */
213
- declare class OpenCodeAdapter {
214
- cwd: string;
215
- constructor({ cwd }?: {
216
- cwd?: string;
217
- });
218
- /**
219
- * Inspects the availability and capability of the OpenCode CLI.
220
- */
221
- inspect(): Promise<InspectResult>;
222
- /**
223
- * Runs opencode with a prompt and options.
224
- */
225
- execute(message: string, { agent, model, readOnly, fastTrack, requireActorConfirmation, orchestratedChild }?: ExecuteOptions): Promise<ExecuteResult>;
216
+ interface RuntimeAdapter {
217
+ readonly runtime: RuntimeName;
218
+ readonly provenance: string;
219
+ inspect(): Promise<RuntimeInspection>;
220
+ execute(message: string, options?: RuntimeExecuteOptions): Promise<RuntimeExecuteResult>;
226
221
  }
227
222
 
228
223
  interface DelegationControllerOptions {
229
224
  cwd?: string;
230
225
  ledger?: EvidenceLedger;
231
- adapter?: OpenCodeAdapter;
226
+ adapter?: RuntimeAdapter;
232
227
  }
233
228
  interface PhaseArtifactResult {
234
229
  artifactPath?: string;
@@ -243,7 +238,7 @@ interface DelegationPhaseOptions {
243
238
  requireExplicitActor?: boolean;
244
239
  onOutput?: (output: string) => Promise<PhaseArtifactResult | void>;
245
240
  }
246
- interface DelegationPhaseResult extends ExecuteResult {
241
+ interface DelegationPhaseResult extends RuntimeExecuteResult {
247
242
  artifact?: PhaseArtifactResult;
248
243
  }
249
244
  /**
@@ -252,7 +247,7 @@ interface DelegationPhaseResult extends ExecuteResult {
252
247
  declare class DelegationController {
253
248
  cwd: string;
254
249
  ledger?: EvidenceLedger;
255
- adapter: OpenCodeAdapter;
250
+ adapter: RuntimeAdapter;
256
251
  lastRoutingDecision: RoutingDecision | null;
257
252
  constructor({ cwd, ledger, adapter }?: DelegationControllerOptions);
258
253
  /**
@@ -487,4 +482,53 @@ declare class SpecValidator {
487
482
  validate(filePath: string): Promise<SpecValidationResult>;
488
483
  }
489
484
 
490
- export { BranchGate, DelegationController, EvidenceLedger, ExecutionPlanner, Finalizer, HandoffEngine, HealerEngine, MergeGate, OpenCodeAdapter, RequestClassifier, SpecValidator, WorkflowStateMachine };
485
+ /**
486
+ * OpenCodeAdapter - Real runtime integration with the OpenCode CLI.
487
+ */
488
+ declare class OpenCodeAdapter implements RuntimeAdapter {
489
+ readonly runtime: "opencode";
490
+ readonly provenance = "opencode-adapter";
491
+ cwd: string;
492
+ constructor({ cwd }?: {
493
+ cwd?: string;
494
+ });
495
+ /**
496
+ * Inspects the availability and capability of the OpenCode CLI.
497
+ */
498
+ inspect(): Promise<RuntimeInspection>;
499
+ /**
500
+ * Runs opencode with a prompt and options.
501
+ */
502
+ execute(message: string, { agent, model, readOnly, fastTrack, requireActorConfirmation, orchestratedChild }?: RuntimeExecuteOptions): Promise<RuntimeExecuteResult>;
503
+ }
504
+
505
+ /**
506
+ * Codex capability boundary. Native Codex assets support interactive sessions;
507
+ * non-interactive `codex exec` is blocked until an app-server adapter can
508
+ * observe custom-agent ownership reliably.
509
+ */
510
+ declare class CodexRuntimeAdapter implements RuntimeAdapter {
511
+ readonly runtime: "codex";
512
+ readonly provenance = "codex-cli-jsonl";
513
+ cwd: string;
514
+ constructor({ cwd }?: {
515
+ cwd?: string;
516
+ });
517
+ private isProjectTrusted;
518
+ inspect(): Promise<RuntimeInspection>;
519
+ execute(_message: string, { agent, readOnly }?: RuntimeExecuteOptions): Promise<RuntimeExecuteResult>;
520
+ }
521
+
522
+ interface CreateRuntimeAdapterOptions {
523
+ cwd: string;
524
+ runtime?: RuntimeName | string;
525
+ }
526
+ /**
527
+ * Resolves an explicitly requested runtime first. A dual-runtime installation
528
+ * keeps OpenCode as its default so existing consumers do not change behavior
529
+ * until they opt into `--runtime=codex`.
530
+ */
531
+ declare function resolveRuntime({ cwd, runtime }: CreateRuntimeAdapterOptions): Promise<RuntimeName>;
532
+ declare function createRuntimeAdapter(options: CreateRuntimeAdapterOptions): Promise<RuntimeAdapter>;
533
+
534
+ export { BranchGate, CodexRuntimeAdapter, DelegationController, EvidenceLedger, ExecutionPlanner, Finalizer, HandoffEngine, HealerEngine, MergeGate, OpenCodeAdapter, RequestClassifier, type RuntimeAdapter, type RuntimeExecuteOptions, type RuntimeExecuteResult, type RuntimeInspection, type RuntimeName, SpecValidator, WorkflowStateMachine, createRuntimeAdapter, resolveRuntime };
package/core/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ CodexRuntimeAdapter,
2
3
  DelegationController,
3
4
  EvidenceLedger,
4
5
  ExecutionPlanner,
@@ -8,8 +9,10 @@ import {
8
9
  OpenCodeAdapter,
9
10
  RequestClassifier,
10
11
  SpecValidator,
11
- WorkflowStateMachine
12
- } from "../chunk-4FI5ODAM.js";
12
+ WorkflowStateMachine,
13
+ createRuntimeAdapter,
14
+ resolveRuntime
15
+ } from "../chunk-JDSEOEYW.js";
13
16
  import {
14
17
  MergeGate
15
18
  } from "../chunk-H7GIKXFO.js";
@@ -19,6 +22,7 @@ import {
19
22
  import "../chunk-5WRI5ZAA.js";
20
23
  export {
21
24
  BranchGate,
25
+ CodexRuntimeAdapter,
22
26
  DelegationController,
23
27
  EvidenceLedger,
24
28
  ExecutionPlanner,
@@ -29,6 +33,8 @@ export {
29
33
  OpenCodeAdapter,
30
34
  RequestClassifier,
31
35
  SpecValidator,
32
- WorkflowStateMachine
36
+ WorkflowStateMachine,
37
+ createRuntimeAdapter,
38
+ resolveRuntime
33
39
  };
34
40
  //# sourceMappingURL=index.js.map
@@ -49,7 +49,7 @@ Orchestrates execution of a natural language request through the workflow state
49
49
 
50
50
  **Synopsis:**
51
51
  ```bash
52
- ai-workflow execute "<request>" [--task=<slug>] [--request="<request>"]
52
+ ai-workflow execute "<request>" [--task=<slug>] [--request="<request>"] [--runtime=<opencode|codex>]
53
53
  ```
54
54
 
55
55
  **Description:**
@@ -60,6 +60,7 @@ Accepts a natural language request, classifies intent, selects the appropriate p
60
60
  | `"<request>"` | Positional argument: the natural language request |
61
61
  | `--request="<request>"` | Named alternative for the request string |
62
62
  | `--task=<slug>` | Optional custom task slug for the workflow execution |
63
+ | `--runtime=<runtime>` | Runtime override: `opencode` or `codex`; Codex CLI delivery blocks until an app-server adapter can prove native-agent ownership |
63
64
 
64
65
  **Example:**
65
66
  ```bash
@@ -75,7 +76,7 @@ Runs formal orchestration for an approved specification with branch safety, obse
75
76
 
76
77
  **Synopsis:**
77
78
  ```bash
78
- ai-workflow run --spec-path=<path> [--approval-path=<path>]
79
+ ai-workflow run --spec-path=<path> [--approval-path=<path>] [--runtime=<opencode|codex>]
79
80
  ```
80
81
 
81
82
  **Description:**
@@ -85,6 +86,7 @@ Reads an approved specification file and orchestrates the full implementation wo
85
86
  | --- | --- |
86
87
  | `--spec-path=<path>` | Path to the approved specification file (required) |
87
88
  | `--approval-path=<path>` | Path to the approval receipt required for DEEP specifications |
89
+ | `--runtime=<runtime>` | Runtime override: `opencode` or `codex` for DEEP workflow delegation; Codex blocks until app-server-based ownership evidence exists |
88
90
 
89
91
  **Example:**
90
92
  ```bash
@@ -15,7 +15,7 @@ For CLI-enforced branch, delivery, validation, and evidence gates, use:
15
15
  npx @williambeto/ai-workflow execute "<natural-language request>"
16
16
  ```
17
17
 
18
- Direct Atlas sessions depend on the selected provider model following the installed agent contract. GPT-5.6 Sol is the validated direct-session model for this release. GPT-5.3 Codex Spark in medium mode is experimental because observed sessions delegated correctly but did not consistently produce a runnable, validated workspace delivery. The finalizer still blocks false success, but it cannot make an incompatible model complete the implementation.
18
+ Direct Atlas sessions depend on the selected provider model following the installed agent contract. GPT-5.6 Sol Medium is the validated direct-session model for this release. GPT-5.3 Codex Spark is unsupported for workspace-write delivery: repeated clean-repository tests with the same local tarball returned source code in chat without observed branch gating, Astra delegation, file changes, or validation. The finalizer can block false success, but it cannot make an incompatible model complete the implementation.
19
19
 
20
20
  ## Codex
21
21
 
@@ -23,7 +23,18 @@ Direct Atlas sessions depend on the selected provider model following the instal
23
23
  npx @williambeto/ai-workflow init --yes --codex
24
24
  ```
25
25
 
26
- Review generated `AGENTS.md`, `CODEX.md`, `.codex/skills/`, `.codex/prompts/`, and `.codex/docs/policies/`. The root `AGENTS.md` provides the primary project-level instruction contract. The `ai-workflow doctor` command will automatically validate these assets.
26
+ Review generated `AGENTS.md`, `.codex/agents/`, `.codex/skills/`, and `.codex/docs/policies/`. The root `AGENTS.md` provides the primary project-level instruction contract, native role definitions are TOML files under `.codex/agents/`, and AIWK commands are installed as `aiwk-command-*` skills rather than prompt files.
27
+
28
+ Use a trusted interactive Codex session only for experimental evaluation. `ai-workflow execute --runtime=codex` intentionally returns `BLOCKED`: current non-interactive `codex exec` cannot select and prove the custom agent that made the change, so AIWK will not claim Astra ownership without evidence.
29
+
30
+ `ai-workflow doctor` validates generated structure and local CLI capabilities without spending model tokens. Codex remains experimental until an app-server-based release E2E proves native delegation, a workspace delivery, and observed validation.
31
+
32
+ Codex loads project-local agent configuration only after the repository is trusted. Trust the consumer repository in Codex before running a delegated workflow; `ai-workflow doctor` fails closed while that trust gate is absent. The equivalent user-level Codex configuration is:
33
+
34
+ ```toml
35
+ [projects."/absolute/path/to/project"]
36
+ trust_level = "trusted"
37
+ ```
27
38
 
28
39
  ## Claude Code
29
40
 
@@ -10,7 +10,7 @@
10
10
  | Runtime | Level | Generated integration | Current evidence | Known limitations |
11
11
  | --- | --- | --- | --- | --- |
12
12
  | OpenCode | Primary | `opencode.jsonc`, OpenCode agents, commands, and skills | init, doctor, package smoke, generated-file checks, real GPT-5.6 Sol delivery | Direct-agent behavior depends on a validated model; use `ai-workflow execute` for CLI-enforced gates |
13
- | Codex | Supported | `AGENTS.md`, `CODEX.md`, `.codex/skills/`, `.codex/prompts/` | full `ai-workflow doctor` runtime validation, e2e smoke checks | `.codex/` output requires `--codex` flag |
13
+ | Codex | Experimental | `AGENTS.md`, `.codex/agents/`, `.codex/skills/`, `.codex/docs/policies/` | native-asset unit tests, consumer init/doctor smoke, and real discovery of AGENTS.md plus skills | The consumer must be trusted by Codex; `codex exec` cannot prove custom-agent ownership, so CLI delivery blocks pending an app-server E2E |
14
14
  | Claude Code | Supported with limitations | `CLAUDE.md`, `.claude/rules/` | adapter/unit/structural checks and generated asset inspection | Rule loading and tool permissions depend on Claude Code configuration |
15
15
  | Antigravity | Supported | `ANTIGRAVITY.md`, `.agents/agents/`, `.agents/skills/`, `.agents/commands/` | unit tests, validation suite, and WSL/Desktop consumer validation | Agents are only listed under `/agents` when actively running (instantiated via `invoke_subagent`) |
16
16
 
@@ -24,10 +24,10 @@ OpenCode runtime compatibility does not imply that every provider model follows
24
24
 
25
25
  | Model and mode | Direct Atlas status | Observed behavior |
26
26
  | --- | --- | --- |
27
- | GPT-5.6 Sol | Supported | Completed branch gate, one Astra delegation, workspace implementation, proportional validation, browser inspection, and finalization |
28
- | GPT-5.3 Codex Spark, medium | Experimental | Delegated to Astra, but produced an incomplete scaffold, failed required validation, and repeated source code in the handoff; the finalizer correctly blocked false success |
27
+ | GPT-5.6 Sol, medium | Supported | Completed branch gate, one Astra delegation, workspace implementation, proportional validation, browser inspection, and finalization in a clean repository installed from the local release tarball |
28
+ | GPT-5.3 Codex Spark | Unsupported for workspace-write delivery | Repeated clean-repository tests with the same tarball returned source code in chat without observed branch gating, Astra delegation, workspace changes, or validation |
29
29
 
30
- The canonical enforcement path is `ai-workflow execute`. Direct Atlas sessions are supported only for model configurations that pass the release smoke suite. Experimental models may inspect or generate partial work, but their direct-session behavior is not a supported delivery guarantee.
30
+ The canonical enforcement path is `ai-workflow execute`. Direct Atlas sessions are supported only for model configurations that pass the release smoke suite. Unsupported write models may still be used for read-only analysis, but their output must not be accepted as workspace delivery.
31
31
 
32
32
  ## Promotion requirements
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williambeto/ai-workflow",
3
- "version": "2.8.2",
3
+ "version": "2.9.0",
4
4
  "description": "AI Workflow Kit — OpenCode-first software delivery workflow with agents, commands, skills, validation, and evidence",
5
5
  "license": "MIT",
6
6
  "author": "José Willams",