Skip to content

feat(cli): add Zoo automation client - #1159

Open
taltas wants to merge 8 commits into
fm/zoo-cli-host-securityfrom
fm/zoo-cli-automation
Open

feat(cli): add Zoo automation client#1159
taltas wants to merge 8 commits into
fm/zoo-cli-host-securityfrom
fm/zoo-cli-automation

Conversation

@taltas

@taltas taltas commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Stack

Position 4 of 6 in the Zoo CLI stack.

  • Parent/base: fm/zoo-cli-host-security (PR feat(cli): add secure supervised Zoo host #1158)
  • Child: fm/zoo-cli-interactive (planned)
  • Native local ancestry remains (main) <- contracts <- headless-api <- host-security <- automation.
  • Native submit evidence: gh stack submit --auto --open --remote origin returned Stacked PRs are not enabled for this repository, so GitHub uses the approved classic base-branch fallback without flattening or retargeting local ancestry.

Scope

  • Adds the fresh public @zoo-code/cli application and zoo executable in apps/zoo; inherited apps/cli remains untouched.
  • Implements explicit run, formatted resume, and workspace-scoped sessions list grammar with non-persisting overrides and safe unattended approval defaults.
  • Supervises the private host over dedicated Node IPC with capability negotiation, readiness gating, ACK-before-DONE enforcement, heartbeat liveness, crash settlement, bounded shutdown, and redacted diagnostics.
  • Adds one pure session reducer consumed by text, final JSON, and versioned NDJSON renderers.
  • Handles whole-task deadlines, canonical cancellation, SIGINT/SIGTERM exit mapping, output closure, ephemeral roots, and exactly one accepted root result.
  • Bridges canonical headless events and workspace history without interpreting webview messages.

Acceptance Evidence

  • pnpm --dir apps/zoo test (9 unit and packaged subprocess tests)
  • pnpm --dir apps/zoo check-types
  • pnpm --dir packages/zoo-host test (5 tests) and typecheck
  • pnpm --dir packages/zoo-protocol exec vitest run src/__tests__/contracts.test.ts (60 tests)
  • pnpm --dir src exec vitest run extension/__tests__/api-headless.spec.ts (6 tests)
  • Targeted suppression-pruning ESLint passed; repository pre-commit lint passed.

Risk

This layer establishes automation semantics before release artifact assembly. The principal risk is lifecycle drift between extension events and normalized events; strict negotiation, subprocess crash/timeout/signal tests, and one authoritative parent settlement limit that risk. Interactive Ink behavior and installed cross-platform artifact layout intentionally remain in later stack layers.

sequenceDiagram
    participant U as User or CI
    participant Z as zoo parent
    participant H as zoo-host
    participant E as Production extension
    U->>Z: zoo run / resume
    Z->>H: hello.select + task command
    H->>E: direct headless API
    E-->>H: typed ordered events
    H-->>Z: IPC ACK, DONE, normalized events
    alt completion
        Z-->>U: text / one JSON / NDJSON result
    else timeout, signal, crash, or EPIPE
        Z->>H: bounded canonical cancel and shutdown
        Z-->>U: deterministic outcome and exit code
    end
Loading

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 14c3e7aa-2880-47ca-bf6d-8b50a5539929

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.43478% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/webview/ClineProvider.ts 75.00% 2 Missing and 3 partials ⚠️
src/core/task/Task.ts 84.61% 1 Missing and 1 partial ⚠️
src/extension/api.ts 75.00% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@taltas
taltas force-pushed the fm/zoo-cli-automation branch from dc868c1 to 270bd8f Compare August 5, 2026 18:01
@taltas
taltas force-pushed the fm/zoo-cli-host-security branch 2 times, most recently from 4274a2f to d692b18 Compare August 5, 2026 18:09
@taltas
taltas force-pushed the fm/zoo-cli-automation branch 2 times, most recently from c6511df to cb131fc Compare August 5, 2026 18:20
@taltas
taltas force-pushed the fm/zoo-cli-host-security branch from d692b18 to a957c99 Compare August 5, 2026 18:20
@taltas
taltas force-pushed the fm/zoo-cli-automation branch 2 times, most recently from 04e2307 to 7f0cd10 Compare August 5, 2026 19:06
@taltas
taltas force-pushed the fm/zoo-cli-host-security branch from 8391c2b to 0aa818f Compare August 5, 2026 19:06
@taltas
taltas force-pushed the fm/zoo-cli-automation branch 2 times, most recently from 3325a7a to eb180c7 Compare August 5, 2026 19:51
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 5, 2026
@taltas
taltas force-pushed the fm/zoo-cli-automation branch from 1fc922e to c47d0c5 Compare August 5, 2026 21:33
@github-actions github-actions Bot removed the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 5, 2026
@taltas
taltas force-pushed the fm/zoo-cli-automation branch from c47d0c5 to e122a32 Compare August 5, 2026 21:37
@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant