Skip to content

V0.1.3/m2/extension skeleton#4

Open
Vedansi18 wants to merge 1 commit into
hi0001234d:user-experience-improvements-sub-7from
Vedansi18:v0.1.3/m2/extension-skeleton
Open

V0.1.3/m2/extension skeleton#4
Vedansi18 wants to merge 1 commit into
hi0001234d:user-experience-improvements-sub-7from
Vedansi18:v0.1.3/m2/extension-skeleton

Conversation

@Vedansi18
Copy link
Copy Markdown
Collaborator

Summary

Establishes the src/ext-vscode/ sub-package — the companion VS Code
extension that wires Cursor and Windsurf into the existing nexpath
prompt-guidance pipeline. This is Branch 1 of Milestone M2; it lays the
foundation that subsequent branches (chat-history capture, webview UI,
adapters, smoke test, publish + cross-OS verify) build on. No Layer C
code is touched
nexpath-serve, auto, stop, the SQLite store,
the classifier, and the decision-session generator are all untouched.

Modules covered (per dev plan §3 M2 §2.2)

Module File(s) What it does
M1 — Skeleton package.json, tsconfig.json, esbuild.config.mjs, src/extension.ts Sub-package boots on onStartupFinished; esbuild bundles ESM source → CJS for the VS Code host.
Activity-bar container registered with a placeholder view + viewsWelcome so the icon actually renders in Cursor.
M5 — IPC stub src/ipc.ts spawnAuto(prompt, sessionId) + spawnStop(sessionId) spawn the nexpath CLI and parse the decision-session JSON payload from stdout. Typed errors
(NexpathBinaryNotFoundError, NexpathMalformedPayloadError) + binary-path resolution chain (opts.binaryPathNEXPATH_BIN env → 'nexpath' on PATH). Stub-level — Branch 4 finalises the Layer C
input contract.
M11 — Onboarding src/onboarding.ts First-launch consent toast (persists to globalState). On macOS, additionally shows a Full-Disk-Access guidance toast that deep-links to System Settings →
Privacy & Security → Full Disk Access. Both flags persist so users aren't re-asked.
M12 — Icon media/icon.svg Y-fork (branching path) representing "next path" decision points. Monochrome currentColor, all straight lines + circles, scalable to 16×16.

Branch 1 of Milestone M2 (v0.1.3/m2/extension-skeleton). Establishes the
src/ext-vscode/ sub-package with an esbuild-driven build pipeline
(ESM source -> CJS bundle for the VS Code host), activates on
onStartupFinished, and ships the four scoped modules:

  M1 - Skeleton: package.json (activationEvents, activity-bar container +
       placeholder view backed by viewsWelcome so the icon actually renders),
       tsconfig.json, esbuild.config.mjs, src/extension.ts entrypoint.
  M5 - IPC stub: src/ipc.ts. spawnAuto(prompt, sessionId) and
       spawnStop(sessionId) spawn the nexpath CLI as subprocesses and parse
       the decision-session JSON payload from stdout, with typed errors
       (NexpathBinaryNotFoundError, NexpathMalformedPayloadError) and
       configurable binary-path resolution
       (opts.binaryPath -> NEXPATH_BIN env -> 'nexpath' on PATH).
       The exact stdin envelope vs. Layer C input contract is intentionally
       a stub here; Branch 4 (cursor-windsurf-adapters) finalises it.
  M11 - Onboarding: src/onboarding.ts. First-launch consent toast persists
        the user's choice to globalState; on macOS, additionally shows a
        Full-Disk-Access guidance toast that deep-links to the System
        Settings privacy pane.
  M12 - Icon: media/icon.svg. Y-fork (branching path) representing
        "next path" decision points; monochrome currentColor, scalable.

25 unit tests co-located alongside source (8 onboarding, 11 ipc, 6 extension),
runnable via root vitest with vi.mock('vscode') stubs. Sub-package has its
own tsconfig + package-lock; root tsconfig now excludes src/ext-vscode/ so
each side owns its TS build. Both root and sub-package tsc --noEmit are
clean. Full root test suite: 1851 passing + 18 pre-existing unrelated
TtySelectFn Windows-sim failures (carried forward from dev plan §3.0).

Deferred (flagged for follow-up, not blockers for this branch):
- 5 moderate npm-audit warnings in the esbuild -> vite -> vitest dev chain
  (dev-only; will be addressed during M5 hardening).
- IPC stdin envelope contract: real wiring lands in Branch 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Vedansi18 Vedansi18 changed the base branch from main to user-experience-improvements-sub-7 May 29, 2026 05:24
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