Skip to content

V0.1.3/m2/extension skeleton#4

Open
Vedansi18 wants to merge 48 commits into
hi0001234d:mainfrom
Vedansi18:v0.1.3/m2/extension-skeleton
Open

V0.1.3/m2/extension skeleton#4
Vedansi18 wants to merge 48 commits into
hi0001234d:mainfrom
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.

hi0001234d and others added 30 commits May 5, 2026 20:43
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nt sets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ofile

Adds selectAbsenceMap helper (hardcore_pro → formal, else → casual) and
updates resolveDecisionContent to use it for non-vibe profiles. Updates
6 no-profile tests and 2 priority-override tests to assert casual variants,
consistent with selectNonBeginnerVariant's undefined → casual behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 3 hardcore_pro routing tests for remaining formal absence variants,
add all 8 non-beginner absence sets to allContent and per-set count tests,
add 4 beginner absence sets to C-02 structural validation block with
missing imports for ABSENCE_REGRESSION_CHECK_BEGINNER and
ABSENCE_SPEC_ACCEPTANCE_BEGINNER.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three changes to buildMjsScript() in TtySelectFn.ts:
- Fix _lineCount to split labels by \n and compute per-line visual rows
  instead of treating the whole label as one long string; this correctly
  estimates height for multi-line (numbered-steps) option labels
- Add wrapping guard: when all options fit within budget (no-overflow) but
  their total visual lines exceed the option count, recompute _maxItems
  using the option count as a tight budget ceiling so visually dense
  option sets always get a viewport rather than a flat list
- Pass maxItems to select() so @clack/prompts k() uses _maxItems as the
  viewport window instead of rows-4; without this, maxItems computation
  had no effect on the actual rendered UI

Applies to Mac, Windows, and Linux new-window paths (all share buildMjsScript).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…word lists

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ded vibeKeyword sets

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds formal, casual, and beginner DecisionContent objects for
idea_scoping, idea_constraint_check, and idea_user_definition.
Includes content existence tests covering shape and non-empty strings.
Map wiring deferred to Phase 4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds formal, casual, and beginner DecisionContent objects for
task_ordering, task_sizing, and task_definition_of_done.
Includes content existence tests covering shape and non-empty strings.
Map wiring deferred to Phase 4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hi0001234d and others added 18 commits May 7, 2026 18:03
Adds formal, casual, and beginner DecisionContent objects for
user_feedback_review and iteration_planning. Wires all 8 new signal
keys (Groups A, B, C) into ABSENCE_CONTENT, ABSENCE_CONTENT_CASUAL,
and ABSENCE_CONTENT_BEGINNER. Adds 24 routing tests covering all
3 registers for all 8 signals, plus Group C content existence tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…INNER

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cture test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… map

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…NG_CASUAL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 8 new absence signal definitions in signals.ts (scope_creep, context_loss, api_design_review, accessibility, environment_and_secrets, data_validation, ci_pipeline, rate_limiting)
- 24 new content set constants across 3 registers (formal, casual, beginner) in options.ts and options-beginner.ts
- All 8 keys added to ABSENCE_CONTENT, ABSENCE_CONTENT_CASUAL, ABSENCE_CONTENT_BEGINNER maps
- relevantProjectTypes filter on api_design_review, accessibility, rate_limiting signals
- AbsenceDetector.ts: Gate 3 now uses per-signal absenceThreshold with profile multiplier; project-type gate added
- types.ts: relevantProjectTypes field added to SignalDefinition
- auto.ts: projectType extracted from getProject() and passed to detectAbsenceFlags
- Tests: routing, content existence, structure, and buildOptionList coverage for all 8 new signals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
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.

2 participants