Skip to content

refactor: capabilities module cleanup#24

Merged
TimBeyer merged 7 commits intomainfrom
refactor/capabilities-module-cleanup
Mar 16, 2026
Merged

refactor: capabilities module cleanup#24
TimBeyer merged 7 commits intomainfrom
refactor/capabilities-module-cleanup

Conversation

@TimBeyer
Copy link
Copy Markdown
Owner

Summary

  • Move runtime infra out of @clawctl/capabilities: Runner, state tracking, and utility functions relocated to vm-cli/src/capabilities/ — the capabilities package now exports only the 6 declarative capability definitions
  • Remove dead pre-capability code: Delete provision(), provisionEnvVars(), provisionNpmGlobalPath(), provisionGatewayStub() from openclaw.ts, provisionLinger() from systemd.ts, and the now-unused types.ts
  • Fix bugs: Eliminate double commandExists calls in 6 doctor checks; fix runner result tracking to use index-based slicing instead of fragile name-based filtering
  • Normalize homebrew capability: Move provisionShellProfile to install.ts, fix hardcoded indentation in log message

Net: -94 lines across 17 files.

Test plan

  • bun test — 265 pass, 0 fail
  • bun run lint — clean
  • bun run format:check — clean
  • bun run build:claw — guest binary builds
  • Verify packages/capabilities/src/index.ts only exports the 6 capability defs

🤖 Generated with Claude Code

TimBeyer and others added 7 commits March 16, 2026 17:27
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The capabilities package now contains only declarative capability
definitions. Runner, state tracking, and utility functions move to
vm-cli where they are actually consumed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete provision(), provisionEnvVars(), provisionNpmGlobalPath(),
provisionGatewayStub() from openclaw.ts and provisionLinger() from
systemd.ts — all replaced by capability definitions. Delete the now-
unused types.ts (ProvisionResult moved to @clawctl/types).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each doctor check was calling commandExists twice — once for the
passed field and again for the error field. Cache the result in a
local variable instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move provisionShellProfile() from index.ts to install.ts alongside
provisionHomebrew(). Fix hardcoded indentation in log message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace name-based filtering (which could match results from other
capabilities with same step names) with index-based slicing that is
correct by construction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TimBeyer TimBeyer merged commit 03a4427 into main Mar 16, 2026
4 checks passed
@TimBeyer TimBeyer deleted the refactor/capabilities-module-cleanup branch March 16, 2026 16:46
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