POC: runnable VS Code extension on @cline/sdk (Feature #2) #3

Merged
benstull merged 5 commits from poc/cline-sdk-extension into main 2026-06-10 06:56:34 +00:00
Owner

Scaffolds the #2 POC: a runnable, non-shippable standalone VS Code extension on @cline/sdk — validating Approach A (own coauthoring UI on the Cline SDK, no fork). Per issue #2 (epic #1) and ben.stull/rfc-app#48.

What's here

  • Extension entry (src/extension.ts) registering Cowriting: Show Cline SDK Info.
  • vscode-free SDK driver (src/cline.ts) — fetchSdkSummary() drives @cline/sdk (pure, key-free getCoreBuiltinToolCatalog() + CORE_BUILD_VERSION).
  • esbuild CJS bundle (3.3kb) keeping vscode + @cline/sdk external.
  • F5 launch config, unit test, README, and the implementation plan.

Key design call

@cline/sdk is ESM-only (Node ≥22) and uses createRequire(import.meta.url), so it cannot be bundled into a CJS extension (verified: import.meta.url → undefined → throw). It is kept external and loaded at runtime via dynamic import(). Empirically de-risked before coding.

Verification (green)

  • npm run typecheck clean · npm test passes (fetchSdkSummary() returns 0.0.46 + the 9 builtin tools incl. read_files) · npm run buildout/extension.cjs.
  • Bundle loaded with a stubbed vscode; activate() runs and registers its disposables.
  • Operator step (GUI): press F5, run the command — notification shows Cline SDK 0.0.46 loaded — 9 builtin tools.

🤖 Generated with Claude Code

Scaffolds the **#2 POC**: a runnable, non-shippable standalone VS Code extension on `@cline/sdk` — validating Approach A (own coauthoring UI on the Cline SDK, no fork). Per issue #2 (epic #1) and `ben.stull/rfc-app#48`. ## What's here - **Extension entry** (`src/extension.ts`) registering `Cowriting: Show Cline SDK Info`. - **vscode-free SDK driver** (`src/cline.ts`) — `fetchSdkSummary()` drives `@cline/sdk` (pure, key-free `getCoreBuiltinToolCatalog()` + `CORE_BUILD_VERSION`). - **esbuild** CJS bundle (3.3kb) keeping `vscode` + `@cline/sdk` external. - **F5 launch config**, unit test, README, and the implementation plan. ## Key design call `@cline/sdk` is ESM-only (Node ≥22) and uses `createRequire(import.meta.url)`, so it **cannot** be bundled into a CJS extension (verified: `import.meta.url` → undefined → throw). It is kept external and loaded at runtime via dynamic `import()`. Empirically de-risked before coding. ## Verification (green) - `npm run typecheck` clean · `npm test` passes (`fetchSdkSummary()` returns `0.0.46` + the 9 builtin tools incl. `read_files`) · `npm run build` → `out/extension.cjs`. - Bundle loaded with a stubbed `vscode`; `activate()` runs and registers its disposables. - **Operator step (GUI):** press **F5**, run the command — notification shows `Cline SDK 0.0.46 loaded — 9 builtin tools`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 5 commits 2026-06-10 06:56:22 +00:00
Add CLAUDE.md importing ~/.claude/wiggleverse.md (planning-and-executing
init Step 5) plus repo-specific orientation for the Cline-SDK plugin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Manifest declares the cowriting.showClineSdkInfo command; esbuild + vitest +
tsc tooling. @cline/sdk@0.0.46 as a runtime dependency. Per issue #2 (epic #1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fetchSdkSummary() dynamic-imports the ESM-only SDK and returns its build
version + builtin tool catalog (pure, key-free). Kept vscode-free so it is
unit-testable in Node; test asserts a semver version and the read_files tool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
activate() registers showClineSdkInfo, which renders the SDK summary to a
notification and output channel. esbuild bundles to CJS, keeping vscode and
@cline/sdk external (the ESM SDK loads via runtime dynamic import).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
.vscode launch/tasks wire F5 -> Run Extension (preLaunchTask: npm build).
README documents run/dev. Plan archived under docs/superpowers/plans/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benstull merged commit cff62f5481 into main 2026-06-10 06:56:34 +00:00
benstull deleted branch poc/cline-sdk-extension 2026-06-10 06:56:34 +00:00
Sign in to join this conversation.