[Spec 0602] VS Code Extension for Codev Agent Farm — V1#672
Merged
waleedkadous merged 29 commits intomainfrom Apr 16, 2026
Merged
[Spec 0602] VS Code Extension for Codev Agent Farm — V1#672waleedkadous merged 29 commits intomainfrom
waleedkadous merged 29 commits intomainfrom
Conversation
Extract @cluesmith/codev-shared from existing tower-client.ts and dashboard EscapeBuffer instead of duplicating logic in the extension. Phase 2a now wraps TowerClient with VS Code concerns instead of reimplementing REST/auth/encoding. Spec: move codev-shared from post-V1 to before V1. Plan: add Phase 1b with full deliverables, update dependency map.
- Subpath exports for codev-shared (not barrel, prevents Node builtins leaking into dashboard Vite build) - TowerClient accepts injectable auth (getAuthKey option) - Split getLocalKey into readLocalKey + ensureLocalKey - Pin exact versions, add release protocol to deliverables - Fix Phase 3 stale EscapeBuffer refs (import from shared) - Fix /api/health → /health (matches actual Tower route)
Replace npm commands with pnpm equivalents. Update monorepo prerequisite note to reference pnpm-workspace.yaml and current package folder names.
Core runtime package signals foundational dependency, not optional shared utilities. Makes publishing order obvious.
Create @cluesmith/codev-core with subpath exports: - tower-client: TowerClient class with injectable auth - auth: readLocalKey (read-only) + ensureLocalKey (CLI-only) - workspace: encodeWorkspacePath / decodeWorkspacePath - constants: DEFAULT_TOWER_PORT, AGENT_FARM_DIR - escape-buffer: EscapeBuffer (browser-safe) Original tower-client.ts replaced with thin re-exports. Constructor accepts both number (backward compat) and options object (injectable getAuthKey for VS Code extension).
Replace local copy with re-export from @cluesmith/codev-core/escape-buffer. Subpath exports isolate browser-safe code from Node builtins.
Replace duplicate type definitions in api.ts with imports from @cluesmith/codev-types. Move codev-types to devDependency (types erased at build time by Vite). Dashboard-specific types stay local.
Root scripts use pnpm --filter to build core then codev in order. local-install installs both tarballs in a single npm install -g. Update CLAUDE.md local build testing section for multi-package flow.
Wraps TowerClient from @cluesmith/codev-core with VS Code concerns: - ConnectionManager: state machine, reconnection, Output Channel logging - AuthWrapper: SecretStorage caching over readLocalKey(), 401 re-read - WorkspaceDetector: traverses up to .codev/ or codev/ project root - Status bar showing connection state (Connected/Offline/Reconnecting) - All 7 extension settings registered - Activation on workspaceContains .codev or codev - esbuild externals for ws native bindings
- SSEClient: fetch-based SSE for /api/events, heartbeat filtering, rate-limited dispatch (max 1/second) - Tower auto-start: spawn afx tower start as detached process, poll health with backoff (max 10 attempts) - ConnectionManager: starts SSE on connect, reconnects on SSE drop, auto-starts Tower when disconnected
- CodevPseudoterminal: binary protocol adapter (0x00/0x01 framing), EscapeBuffer from codev-core, backpressure (16KB chunks, 1MB disconnect), resize deferral during replay, reconnection banner - TerminalManager: WebSocket pool (max 10), editor layout (architect left group, builders right group), terminal lifecycle - Commands: Open Architect Terminal, Open Builder Terminal, New Shell
Encode workspace path for /api/state and /api/tabs/shell requests. These are workspace-scoped Tower routes requiring the base64url encoded path prefix.
Move workspace-scoped API calls into TowerClient (codev-core) instead of manual encoding in the extension. Extension commands now use client.getWorkspaceState() and client.createShellTab() directly.
ConnectionManager calls client.activateWorkspace() after successful health check to ensure architect terminal exists before user tries to open it.
Create terminals directly in editor area via createTerminal location option. Architect in ViewColumn.One, builders in ViewColumn.Two. VS Code auto-creates the split when ViewColumn.Two is first used.
Replace moveIntoEditor references with stable TerminalLocation.Editor + ViewColumn API. Update layout descriptions, risks, and deliverables.
Register Codev view container with 7 TreeView sections: Needs Attention, Builders, Pull Requests, Backlog, Recently Closed, Team, and Status. Overview data refreshes on SSE events. Team section conditional on teamEnabled. Status shows Tower connection, tunnel, and cron state.
Overview cache now calls client.getOverview(workspacePath) instead of raw /api/overview request. TowerClient handles the workspace query parameter internally.
Rename overview-cache.ts to overview-data.ts. Update all view imports. Set codev.teamEnabled VS Code context from workspace state so Team section shows/hides based on actual team configuration.
… metadata Move icon to icons/ (src/ is excluded by .vscodeignore), bump to 0.2.0, add repository field, license, and replace template README with real docs.
All four CI jobs need codev-core dist/ built before running tests or building codev. Without it, imports from @cluesmith/codev-core fail with ERR_MODULE_NOT_FOUND.
Commands: spawn, send, approve, cleanup, refresh, tunnel, cron. Chord keybindings: Cmd+K A (architect), Cmd+K D (send), Cmd+K G (approve). Status bar shows builder count + blocked gate count. Update README with full command list.
The e2e.yml and dashboard-e2e.yml workflows were missing the "Build core package" step before building codev. Dashboard imports from @cluesmith/codev-core which requires core's dist/ to exist.
- Snippet: rev + Tab in markdown files inserts REVIEW(@architect): - Command: Add Review Comment with language-aware comment syntax - Decorations: highlight existing REVIEW(...) lines with colored background - Update README with review comments section
- Point core exports types to dist/*.d.ts instead of src/*.ts - Remove src from core files field (only ship dist) - Update verify-install.mjs to accept multiple tarballs - Pack core tarball in CI and pass both to verify script
Spec compliance, deviations from plan, lessons learned, technical debt, and follow-up items for Phases 1-7.
arch.md: Add monorepo structure, VS Code extension architecture, update diagram for dual clients, fix stale references (dashboard location, af→afx, tower-client re-export, workspace-scoped routes). Team profile: Update role and contributions for amrmelsayed.
Contributor
Architect ReviewApproved. Excellent work on this — the thin client architecture is clean, the terminal adapter handles all the hard edge cases from the spec (escape buffering, backpressure, resize deferral), and the monorepo restructuring is solid. Notes for the record:
Please merge when ready (regular merge, no squash). |
waleedkadous
approved these changes
Apr 16, 2026
Contributor
waleedkadous
left a comment
There was a problem hiding this comment.
PR looks good! Only issue is testing looks thin, but we can improve that in a followup PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VS Code extension for Codev Agent Farm — thin client over Tower's existing API. Includes monorepo restructuring, shared packages, and all V1 implementation phases.
Infrastructure
packages/config)packages/dashboard/as standalone workspace member, imports from shared packagesExtension (packages/vscode)
What works
Deferred
Breaking changes
@cluesmith/codev-coreis a new runtime dependency of@cluesmith/codev— must be published to npm before codevpackages/codev/dashboard/topackages/dashboard/pnpm buildbuilds core then codevpnpm local-installRef #602