Skip to content

✨ Add distributable chat2shell CLI - #6

Merged
nbsp1221 merged 5 commits into
mainfrom
feat/npm-cli-release
Sep 4, 2026
Merged

✨ Add distributable chat2shell CLI#6
nbsp1221 merged 5 commits into
mainfrom
feat/npm-cli-release

Conversation

@nbsp1221

@nbsp1221 nbsp1221 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace repository-local runtime scripts with an installable chat2shell CLI for setup, foreground serving, status checks, workspace registration, and approvals.
  • Add a release-triggered npm publishing workflow and package the public license, usage guide, notices, and roadmap.
  • Let Docker Sandboxes own network policy, route MCP discovery negotiation through the SDK, and document the current unauthenticated transport boundary.

Verification

  • pnpm check — passed formatting, linting, typechecking, 36 unit and integration tests, and the production bundle.
  • pnpm test:e2e — passed the real Docker Sandbox lifecycle test.
  • npm pack --dry-run --json — produced the expected seven-file public package.

Risks and rollout

  • Existing repository-local setup, run, status, and stop scripts are removed in favor of the package CLI.
  • chat2shell serve remains a foreground process; service supervision and restart policy remain external to the product.
  • The MCP server currently has no authentication. Secure MCP Tunnel is the recommended transport, and alternate exposure must provide its own access control.

Replace the shell-script runtime with one foreground cac command.
Bundle the npm executable with tsdown and publish releases through
GitHub Actions using npm trusted publishing.
Remove transient release and roadmap context from public documentation.
Fix the exported environment example, drop an unapproved dependency
override, and remove a timing-sensitive test assertion.
Let Docker Sandboxes own network policy and route discovery negotiation
through the MCP SDK's protocol-standard legacy fallback. Document
unauthenticated exposure responsibility and publish the OAuth and web
interface roadmap.
@leverframe

leverframe Bot commented Sep 4, 2026

Copy link
Copy Markdown

Leverframe review

🟡 Incremental review completed in 357s

  • 1 new finding
  • 3 existing findings were verified fixed
  • 6 of 6 changed files reviewed
  • Verification: 6 passed, 1 failed

Changes e365a19..10dcb49 · Commit 10dcb49 · Open review · View check run

@leverframe leverframe Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leverframe review

Found three actionable CLI/runtime defects. Verification used the repository-pinned pnpm 11.23.0 on Node v24.20.0, matching CI's Node 24 environment. The normal quality gate and package build passed, but installed-artifact checks reproduced the management-command failures.

Findings

3 findings were published inline.

Checks

5 passed · 4 failed · 0 not run

Show 9 checks
Status Check Evidence
🟢 passed node --version; pnpm --version; npm --version Selected environment reported Node v24.20.0, pnpm 11.23.0, and npm 11.19.0; package.json pins pnpm 11.23.0 and CI selects Node 24.
🟢 passed pnpm install --frozen-lockfile Installed the exact lockfile successfully with pnpm 11.23.0.
🟢 passed pnpm check Formatting, oxlint/eslint, TypeScript 5.9.3 typecheck, all 36 unit/integration tests, and the tsdown 0.22.14 production build passed.
🟢 passed npm pack --dry-run --json The package contained seven expected files, including executable mode-0755 dist/cli.mjs.
🔴 failed npm pack; npm install --prefix <temporary-directory> chat2shell-0.2.0.tgz; <installed-bin> workspace list The installed executable reported version 0.2.0, but workspace list exited 0 without output or state creation, reproducing the primary finding from the distributable artifact.
🔴 failed node dist/cli.mjs does-not-exist Exited 0 with empty stdout and stderr.
🔴 failed Focused `serve` permission check with pre-created 0755 state directory and fake sbx responses The service reached /healthz, but the configured state directory remained mode 0755 instead of owner-only 0700.
🔴 failed pnpm test:e2e Could not start the suite because the documented Docker Sandboxes prerequisite is unavailable: spawnSync sbx ENOENT. This environment failure is not reported as a code defect.
🟢 passed git diff --check 2e4d0852d1e4e5f5cf1dcce41096aaa1e759e943...e365a190b47b8a6d0881e6045d771d75cf01fa6d No whitespace errors were reported.

Limitations

  • Real Docker Sandbox template creation, lifecycle, and changed network-policy behavior could not be exercised because the required sbx executable and template are unavailable; therefore coverage is marked incomplete.

Comment thread src/cli/program.ts Outdated
Comment thread src/cli/program.ts
Comment thread src/runtime/serve.ts
Dispatch workspace and approval actions through CAC's actual command
matching model, reject unknown commands, and restore owner-only state
directory permissions. Add regression coverage for each reported runtime
failure.

@leverframe leverframe Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leverframe review

Reviewed the complete six-file incremental diff using the repository-declared pnpm 11.23.0 toolchain on Node 24.20.0 (npm 11.19.0). All prior findings are fixed and the full repository check passed. One new release-workflow security defect remains.

Findings

1 finding was published inline.

Checks

6 passed · 1 failed · 0 not run

Show 7 checks
Status Check Evidence
🟢 passed node --version && pnpm --version && npm --version Reported Node v24.20.0, pnpm 11.23.0, and npm 11.19.0.
🟢 passed pnpm install --frozen-lockfile The declared lockfile and pnpm version installed 329 packages successfully.
🟢 passed pnpm exec vitest run --project unit test/unit/cli.test.ts --project integration test/integration/cli.test.ts test/integration/serve.test.ts All 3 changed test files passed: 5 tests total.
🟢 passed pnpm check Formatting, oxlint/eslint, TypeScript, all 40 unit/integration tests, and the Node 24 build passed.
🟢 passed pnpm pack followed by installation and packed-CLI workspace/unknown-command smoke tests The tarball installed successfully; workspace list/add/list persisted the workspace, while an unknown command exited 1 with the expected diagnostic.
🔴 failed uvx zizmor --offline --pedantic --format plain .github/workflows/release.yml The audit completed and exited 14 after detecting high-confidence unpinned-action findings on all three changed uses lines.
🟢 passed git show e365a190b47b8a6d0881e6045d771d75cf01fa6d:.github/workflows/release.yml | uvx zizmor --offline --pedantic --format plain - The base comparison contained no unpinned-uses findings; unrelated pre-existing audit diagnostics were excluded from review findings.

Limitations

  • Zizmor's online ref-confusion audit could not query the public GitHub API because the environment returned HTTP 401; its offline immutable-pin audit completed normally.

  • The repository's real sbx E2E suite was not run because the incremental changes do not alter the sandbox boundary, and repository guidance requires a specially provisioned trusted host.


steps:
- name: Check out repository
uses: actions/checkout@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [MEDIUM] Release actions are no longer pinned to immutable revisions

The release job has id-token: write and ultimately publishes to npm. Replacing the exact commit pins for checkout, pnpm setup, and Node setup with mutable major-version tags allows code introduced by a moved or compromised tag to execute before publication. Such code can alter the checked-out or built package, which the final trusted npm publish step would then release under this project's identity.

Evidence: Offline zizmor 1.30.0 reported high-confidence unpinned-uses findings at lines 21, 24, and 30. Auditing the review-base workflow reported no unpinned-uses findings, and the unchanged CI workflow still pins these same actions to full commit SHAs.

Suggested action: Restore full commit-SHA pins for all three actions, retaining version comments for readability, and update the pins through reviewed dependency-update PRs.

Confidence: high

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applying this suggestion. This repository intentionally uses upstream major-version tags for GitHub Actions rather than immutable commit SHAs. The associated supply-chain tradeoff is accepted as a project maintenance policy, so these references are deliberate rather than accidental unpinning.

@nbsp1221
nbsp1221 merged commit 3169bd9 into main Sep 4, 2026
2 checks passed
@nbsp1221
nbsp1221 deleted the feat/npm-cli-release branch September 4, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant