sequant 1.5.4 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,410 +1,185 @@
1
1
  # Sequant
2
2
 
3
- **Structured AI workflow for GitHub issues.**
3
+ **Workflow automation for [Claude Code](https://claude.ai/code).**
4
4
 
5
- Turn GitHub issues into working code through sequential AI-assisted phases with quality gates.
5
+ Solve GitHub issues with structured phases and quality gates from issue to merge-ready PR.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/sequant.svg)](https://www.npmjs.com/package/sequant)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
9
9
 
10
- ## Why Sequant?
11
-
12
- When using AI coding assistants, work can become scattered and quality inconsistent. Sequant solves this by:
13
-
14
- - **Consistent quality** — Every issue goes through the same review gates
15
- - **Traceable decisions** — Plans and progress documented in GitHub issues
16
- - **Isolated work** — Git worktrees prevent half-finished features from polluting main
17
- - **AI-assisted** — Claude Code handles implementation while you review and approve
18
-
19
- ## How It Works
20
-
21
- ```
22
- ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
23
- │ /spec │───▶│ /exec │───▶│ /test │───▶│ /qa │───▶ Merge
24
- └─────────┘ └─────────┘ └─────────┘ └─────────┘
25
- │ │ │ │
26
- ▼ ▼ ▼ ▼
27
- Plan Build Verify Review
28
- (drafts AC) (worktree) (optional) (vs criteria)
29
- ```
30
-
31
- 1. **`/spec`** — Reads issue, drafts implementation plan, posts to GitHub for your approval
32
- 2. **`/exec`** — Creates isolated git worktree, implements changes, runs tests
33
- 3. **`/test`** — Optional browser/CLI verification
34
- 4. **`/qa`** — Reviews code against acceptance criteria, suggests fixes
35
-
36
10
  ## Quick Start
37
11
 
38
- ### Prerequisites
39
-
40
- | Requirement | Check Command | Notes |
41
- |------------|---------------|-------|
42
- | [Claude Code](https://claude.ai/code) | `claude --version` | Required |
43
- | [GitHub CLI](https://cli.github.com/) | `gh auth status` | Required, must be authenticated |
44
- | Node.js 18+ | `node --version` | Required |
45
- | Git | `git --version` | Required |
46
- | [jq](https://jqlang.github.io/jq/) | `jq --version` | Optional, improves hook performance |
47
-
48
- > **Note:** Sequant currently requires GitHub for issue tracking. GitLab and Bitbucket support is planned for a future release. See [Platform Requirements](docs/platform-requirements.md) for workarounds if you use a different platform.
49
-
50
- ### Setup
51
-
52
12
  ```bash
53
- # Install and initialize in your project
13
+ # In your project directory
54
14
  npx sequant init
55
-
56
- # Verify installation and prerequisites
57
- npx sequant doctor
15
+ npx sequant doctor # Verify setup
58
16
  ```
59
17
 
60
- The `doctor` command checks all prerequisites including GitHub CLI authentication.
61
-
62
- ### First Workflow
18
+ Then in Claude Code:
63
19
 
64
- Open Claude Code in your project, then:
65
-
66
- ```bash
67
- /spec 123 # Plan implementation for GitHub issue #123
68
- /exec 123 # Implement the feature in a worktree
69
- /qa 123 # Quality review before merge
70
20
  ```
71
-
72
- > Replace `123` with an actual GitHub issue number from your repository.
73
-
74
- ## Installation
75
-
76
- ```bash
77
- npm install -g sequant
78
- # or use npx
79
- npx sequant init
21
+ /fullsolve 123 # Solve issue #123 end-to-end
80
22
  ```
81
23
 
82
- ## Features
83
-
84
- - **🔢 Quantized** - Each issue is an atomic unit of work
85
- - **🔄 Sequential** - Phases execute in order with gates
86
- - **🚦 Gated** - Quality checks before progression
87
- - **🌳 Isolated** - Git worktrees prevent cross-contamination
88
- - **📦 Stack Adapters** - Pre-configured for Next.js, Rust, Python, Go
89
- - **🔄 Update-Safe** - Customize without losing updates
24
+ Or step-by-step:
90
25
 
91
- ## Optional MCP Integrations
92
-
93
- Sequant works fully without any MCP servers, but these optional integrations enhance specific workflows. See the [MCP Integrations Guide](docs/mcp-integrations.md) for detailed setup and troubleshooting.
94
-
95
- | MCP Server | Skills | Purpose | Install |
96
- |------------|--------|---------|---------|
97
- | [Chrome DevTools](https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-chrome-devtools) | `/test`, `/testgen`, `/loop` | Browser automation for UI testing | See [setup guide](https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-chrome-devtools#setup) |
98
- | [Context7](https://github.com/upstash/context7) | `/exec`, `/fullsolve` | External library documentation lookup | `npx -y @anthropic/mcp-cli add upstash/context7` |
99
- | [Sequential Thinking](https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-sequential-thinking) | `/fullsolve` | Complex multi-step reasoning | See [setup guide](https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-sequential-thinking#setup) |
100
-
101
- **What happens without MCPs:**
102
- - `/test` and `/testgen` fall back to manual testing instructions
103
- - `/exec` uses codebase search instead of library docs lookup
104
- - `/fullsolve` uses standard reasoning (no extended thinking)
26
+ ```
27
+ /spec 123 # Plan implementation
28
+ /exec 123 # Build in isolated worktree
29
+ /qa 123 # Review before merge
30
+ ```
105
31
 
106
- Run `sequant doctor` to check which optional MCPs are configured.
32
+ ### Prerequisites
107
33
 
108
- ## Commands
34
+ - [Claude Code](https://claude.ai/code) — AI coding assistant
35
+ - [GitHub CLI](https://cli.github.com/) — run `gh auth login`
36
+ - Node.js 18+ and Git
109
37
 
110
- ### CLI Commands
38
+ ---
111
39
 
112
- ```bash
113
- npx sequant init # Initialize in your project
114
- npx sequant update # Update templates from package
115
- npx sequant doctor # Check installation health
116
- npx sequant status # Show version and config
117
- npx sequant run <issues...> # Execute workflow for issues
118
- ```
40
+ ## How It Works
119
41
 
120
- #### Run Command Options
42
+ Sequant adds slash commands to Claude Code that enforce a structured workflow:
121
43
 
122
- ```bash
123
- npx sequant run 123 # Single issue
124
- npx sequant run 1 2 3 # Multiple issues in parallel
125
- npx sequant run 1 2 3 --sequential # Run in order
126
- npx sequant run 123 --phases spec,qa # Custom phases
127
- npx sequant run 123 --quality-loop # Auto-retry on failures
128
- npx sequant run 123 --dry-run # Preview without execution
129
44
  ```
130
-
131
- #### Quality Loop
132
-
133
- Quality loop provides automatic fix iterations when phases fail:
134
-
135
- ```bash
136
- npx sequant run 123 --quality-loop # Enable for any issue
137
- npx sequant run 123 --quality-loop --max-iterations 5 # Custom limit
45
+ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
46
+ │ /spec │───▶│ /exec │───▶│ /test │───▶│ /qa │───▶ Merge
47
+ └─────────┘ └─────────┘ └─────────┘ └─────────┘
48
+ │ │ │ │
49
+ ▼ ▼ ▼ ▼
50
+ Plan Build Verify (UI) Review
138
51
  ```
139
52
 
140
- **How it works:**
141
- 1. Runs phases normally (spec → exec → qa)
142
- 2. If a phase fails, runs `/loop` to fix issues
143
- 3. Re-runs failed phases after fixes
144
- 4. Iterates up to 3 times (default)
145
-
146
- **Smart defaults:** Quality loop auto-enables for issues with `complex`, `refactor`, `breaking`, or `major` labels—no flag needed.
53
+ > `/test` is optional — used for UI features when Chrome DevTools MCP is available.
147
54
 
148
- #### Phase Detection
55
+ ### Quality Gates
149
56
 
150
- When you run `sequant run`, phases are determined automatically using a three-level detection system:
57
+ Every `/qa` runs automated checks:
151
58
 
152
- 1. **Explicit phases** — If you specify `--phases`, those are used
153
- 2. **Spec-driven** — Otherwise, `/spec` runs first and outputs a recommended workflow
154
- 3. **Label-based fallback** — If spec parsing fails, issue labels determine phases
59
+ - **AC Adherence** — Code verified against acceptance criteria
60
+ - **Type Safety** — Detects `any`, `as any`, missing types
61
+ - **Security Scans** — OWASP-style vulnerability detection
62
+ - **Scope Analysis** — Flags changes outside issue scope
155
63
 
156
- **Label-based detection:**
64
+ When checks fail, `/loop` automatically fixes and re-runs (up to 3x).
157
65
 
158
- | Labels | Phases | Notes |
159
- |--------|--------|-------|
160
- | `bug`, `fix`, `hotfix`, `patch` | `exec → qa` | Skip spec for simple fixes |
161
- | `docs`, `documentation`, `readme` | `exec → qa` | Skip spec for docs changes |
162
- | `ui`, `frontend`, `admin`, `web`, `browser` | `spec → exec → test → qa` | Add browser testing |
163
- | `complex`, `refactor`, `breaking`, `major` | (default phases) | Enable quality loop |
66
+ ---
164
67
 
165
- **Spec-driven detection:**
68
+ ## Two Ways to Use
166
69
 
167
- The `/spec` command outputs a recommended workflow that the CLI parses:
70
+ ### Interactive (Claude Code)
168
71
 
169
- ```markdown
170
- ## Recommended Workflow
72
+ Type commands directly in Claude Code chat:
171
73
 
172
- **Phases:** exec → test → qa
173
- **Quality Loop:** disabled
174
- **Reasoning:** UI changes detected, adding browser testing phase
74
+ ```
75
+ /fullsolve 123 # Complete pipeline
76
+ /spec 123 /exec /qa # Step by step
175
77
  ```
176
78
 
177
- **CLI examples:**
178
-
179
- ```bash
180
- # Phases auto-detected (default)
181
- npx sequant run 123
182
-
183
- # Explicit phases (skip auto-detection)
184
- npx sequant run 123 --phases exec,qa
79
+ ### Headless (CLI)
185
80
 
186
- # Disable logging for one run
187
- npx sequant run 123 --no-log
81
+ Run without Claude Code UI:
188
82
 
189
- # Enable quality loop for complex changes
83
+ ```bash
84
+ npx sequant run 123 # Single issue
85
+ npx sequant run 1 2 3 # Batch (parallel)
190
86
  npx sequant run 123 --quality-loop
191
87
  ```
192
88
 
193
- ### Workflow Commands (in Claude Code)
194
-
195
- | Command | Phase | Purpose |
196
- |---------|-------|---------|
197
- | `/assess` | 0 | Issue triage and status assessment |
198
- | `/spec` | 1 | Plan implementation vs acceptance criteria |
199
- | `/exec` | 2 | Implement in feature worktree |
200
- | `/test` | 2.5 | Browser-based UI testing (optional) |
201
- | `/verify` | 2.5 | CLI/script verification (optional) |
202
- | `/qa` | 3 | Code review and quality gate |
203
- | `/docs` | 4 | Generate feature documentation |
204
- | `/loop` | * | Fix iteration when tests fail |
205
- | `/fullsolve` | 1-4 | Complete pipeline in one command |
89
+ ---
206
90
 
207
- ## Platform Support
208
-
209
- | Platform | Status | Notes |
210
- |----------|--------|-------|
211
- | macOS | ✅ Tested | Full support with Claude Code, Cursor, VS Code |
212
- | Linux | ✅ Supported | Bash required for shell scripts |
213
- | Windows WSL | ✅ Supported | Use WSL2 with bash |
214
- | Windows Native | ⚠️ Limited | CLI works, but shell scripts require WSL |
215
-
216
- ### Windows Users
217
-
218
- **WSL is recommended** for the full Sequant experience on Windows. Here's why:
219
-
220
- | Feature | Native Windows | Windows + WSL |
221
- |---------|----------------|---------------|
222
- | CLI commands (`init`, `doctor`, `status`) | ✅ Works | ✅ Works |
223
- | Workflow hooks (pre-tool, post-tool) | ❌ Requires bash | ✅ Works |
224
- | Shell scripts (`new-feature.sh`, etc.) | ❌ Requires bash | ✅ Works |
225
- | Git worktree workflows | ✅ Works | ✅ Works |
226
-
227
- **Quick WSL Setup:**
228
-
229
- 1. Install WSL (run in PowerShell as Administrator): `wsl --install`
230
- 2. Restart your computer when prompted
231
- 3. Open Ubuntu from Start menu and complete setup
232
- 4. Install Node.js: See [NodeSource distributions](https://github.com/nodesource/distributions)
233
- 5. Install GitHub CLI: `apt install gh` then `gh auth login`
234
- 6. Use Sequant: `npx sequant init`
235
-
236
- For detailed instructions, see [Microsoft's WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/install).
91
+ ## Commands
237
92
 
238
- ### Requirements
93
+ ### Core Workflow
239
94
 
240
- - **Node.js** 18.0.0 or higher
241
- - **Git** for worktree support
242
- - **GitHub CLI** (`gh`) for issue integration must be authenticated via `gh auth login`
243
- - **Bash** for shell scripts (included in macOS/Linux, use WSL on Windows)
244
- - **jq** (optional) for faster JSON parsing in hooks — falls back to grep if not installed
95
+ | Command | Purpose |
96
+ |---------|---------|
97
+ | `/spec` | Plan implementation, draft acceptance criteria |
98
+ | `/exec` | Implement in isolated git worktree |
99
+ | `/test` | Browser-based UI testing (optional) |
100
+ | `/qa` | Code review and quality gate |
245
101
 
246
- ### IDE Compatibility
102
+ ### Automation
247
103
 
248
- | IDE | Status |
249
- |-----|--------|
250
- | Claude Code | Full support |
251
- | Cursor | Supported |
252
- | VS Code + Copilot | Supported |
104
+ | Command | Purpose |
105
+ |---------|---------|
106
+ | `/fullsolve` | Complete pipeline in one command |
107
+ | `/solve` | Recommend optimal workflow for issue |
108
+ | `/loop` | Fix iteration when checks fail |
253
109
 
254
- ## Stack Support
110
+ ### Integration
255
111
 
256
- Sequant auto-detects your project stack and configures appropriate commands:
112
+ | Command | Purpose |
113
+ |---------|---------|
114
+ | `/merger` | Multi-issue integration and merge |
115
+ | `/testgen` | Generate test stubs from spec |
116
+ | `/verify` | CLI/script execution verification |
257
117
 
258
- | Stack | Detection | Test | Build | Lint |
259
- |-------|-----------|------|-------|------|
260
- | Next.js | `next.config.*` | `npm test` | `npm run build` | `npm run lint` |
261
- | Rust | `Cargo.toml` | `cargo test` | `cargo build --release` | `cargo clippy` |
262
- | Python | `pyproject.toml` | `pytest` | `python -m build` | `ruff check .` |
263
- | Go | `go.mod` | `go test ./...` | `go build ./...` | `golangci-lint run` |
118
+ ### Utilities
264
119
 
265
- ## Customization
120
+ | Command | Purpose |
121
+ |---------|---------|
122
+ | `/assess` | Issue triage and status assessment |
123
+ | `/docs` | Generate feature documentation |
124
+ | `/release` | Automated release workflow |
125
+ | `/clean` | Repository cleanup |
126
+ | `/security-review` | Deep security analysis |
127
+ | `/reflect` | Workflow improvement analysis |
266
128
 
267
- ### Local Overrides
129
+ ---
268
130
 
269
- Create files in `.claude/.local/` to override templates without losing updates:
131
+ ## CLI Commands
270
132
 
133
+ ```bash
134
+ npx sequant init # Initialize in project
135
+ npx sequant update # Update skill templates
136
+ npx sequant doctor # Check installation
137
+ npx sequant status # Show version and config
138
+ npx sequant run <issues...> # Execute workflow
271
139
  ```
272
- .claude/
273
- ├── skills/ # Package-provided (updated by sequant update)
274
- ├── skills.local/ # Your overrides (never modified)
275
- ├── hooks/ # Package-provided
276
- ├── hooks.local/ # Your overrides
277
- └── memory/ # Your project context (never modified)
278
- ```
279
-
280
- ### Constitution
281
-
282
- Edit `.claude/memory/constitution.md` to define project-specific principles:
283
140
 
284
- ```markdown
285
- # My Project Constitution
286
-
287
- ## Core Principles
288
- 1. Always use TypeScript strict mode
289
- 2. Test coverage must exceed 80%
290
- 3. All PRs require security review
291
-
292
- ## Naming Conventions
293
- - Components: PascalCase
294
- - Utilities: camelCase
295
- - Constants: SCREAMING_SNAKE_CASE
296
- ```
141
+ See [Run Command Options](docs/run-command.md) for advanced usage.
297
142
 
298
- ### Settings
143
+ ---
299
144
 
300
- Configure `sequant run` defaults in `.sequant/settings.json`:
145
+ ## Configuration
301
146
 
302
147
  ```json
148
+ // .sequant/settings.json
303
149
  {
304
- "version": "1.0",
305
150
  "run": {
306
- "logJson": true,
307
- "logPath": ".sequant/logs",
308
- "autoDetectPhases": true,
309
- "timeout": 300,
310
- "sequential": false,
311
151
  "qualityLoop": false,
312
- "maxIterations": 3,
313
- "smartTests": true
314
- },
315
- "agents": {
316
- "parallel": false,
317
- "model": "haiku"
152
+ "maxIterations": 3
318
153
  }
319
154
  }
320
155
  ```
321
156
 
322
- #### Run Settings
323
-
324
- | Option | Default | Description |
325
- |--------|---------|-------------|
326
- | `logJson` | `true` | Enable JSON logging for run sessions |
327
- | `logPath` | `.sequant/logs` | Directory for log files |
328
- | `autoDetectPhases` | `true` | Auto-detect phases from labels/spec output |
329
- | `timeout` | `300` | Timeout per phase in seconds |
330
- | `sequential` | `false` | Run issues sequentially (vs parallel) |
331
- | `qualityLoop` | `false` | Enable quality loop by default |
332
- | `maxIterations` | `3` | Max quality loop iterations |
333
- | `smartTests` | `true` | Auto-detect test commands |
334
-
335
- #### Agent Settings
336
-
337
- | Option | Default | Description |
338
- |--------|---------|-------------|
339
- | `parallel` | `false` | Run sub-agents in parallel (faster but higher token usage) |
340
- | `model` | `"haiku"` | Default model for sub-agents (`haiku`, `sonnet`, or `opus`) |
341
-
342
- ##### Cost vs Speed Trade-offs
343
-
344
- Skills like `/qa`, `/merger`, and `/fullsolve` spawn sub-agents for quality checks. The `agents` settings control how these agents execute:
157
+ See [Customization Guide](docs/customization.md) for all options.
345
158
 
346
- | Mode | Token Usage | Speed | Best For |
347
- |------|-------------|-------|----------|
348
- | Sequential (`parallel: false`) | 1x (baseline) | Slower | Limited API plans, cost-conscious users |
349
- | Parallel (`parallel: true`) | ~2-3x | ~50% faster | Unlimited plans, batch operations |
159
+ ---
350
160
 
351
- **Override per invocation:**
352
-
353
- ```bash
354
- /qa 123 --parallel # Force parallel (faster)
355
- /qa 123 --sequential # Force sequential (cheaper)
356
- ```
357
-
358
- CLI flags override settings file values.
161
+ ## Platform Support
359
162
 
360
- ## Directory Structure
163
+ | Platform | Status |
164
+ |----------|--------|
165
+ | macOS | ✅ Full support |
166
+ | Linux | ✅ Full support |
167
+ | Windows WSL | ✅ Full support |
168
+ | Windows Native | ⚠️ CLI only |
361
169
 
362
- After `sequant init`:
363
-
364
- ```
365
- .claude/
366
- ├── skills/ # Workflow commands
367
- │ ├── spec/SKILL.md
368
- │ ├── exec/SKILL.md
369
- │ ├── qa/SKILL.md
370
- │ └── ...
371
- ├── hooks/ # Pre/post tool hooks
372
- │ ├── pre-tool.sh
373
- │ └── post-tool.sh
374
- ├── memory/ # Project context
375
- │ └── constitution.md
376
- └── settings.json # Hooks configuration
377
-
378
- .sequant-manifest.json # Version tracking
379
- ```
170
+ ---
380
171
 
381
172
  ## Documentation
382
173
 
383
- - [Run Command](docs/run-command.md) — Batch execution options
384
- - [Customization Guide](docs/customization.md) — Override templates safely
385
- - [MCP Integrations](docs/mcp-integrations.md) — Optional MCP server setup
386
- - [Platform Requirements](docs/platform-requirements.md) — GitHub dependency and workarounds
387
- - [Troubleshooting](docs/troubleshooting.md) — Common issues and solutions
388
- - [Testing Guide](docs/testing.md) — Cross-platform testing matrix
389
- - [Git Patterns](docs/git-patterns.md) — Worktree and merge workflows
390
- - [Release Checklist](docs/release-checklist.md) — Pre-release verification
391
- - Stack Guides: [Next.js](docs/stacks/nextjs.md) | [Rust](docs/stacks/rust.md) | [Python](docs/stacks/python.md) | [Go](docs/stacks/go.md)
392
-
393
- ## Philosophy
394
-
395
- Sequant is built on these principles:
396
-
397
- 1. **Explicit over implicit** — Every phase has clear inputs and outputs
398
- 2. **Quality gates** — No phase completes without validation
399
- 3. **Isolation** — Work happens in dedicated worktrees
400
- 4. **Traceability** — All decisions recorded in GitHub issues
401
- 5. **Composability** — Use phases individually or combine them
174
+ - [Getting Started](docs/getting-started/installation.md)
175
+ - [Workflow Concepts](docs/concepts/workflow-phases.md)
176
+ - [Run Command](docs/run-command.md)
177
+ - [Customization](docs/customization.md)
178
+ - [Troubleshooting](docs/troubleshooting.md)
402
179
 
403
- ## Acknowledgments
180
+ Stack guides: [Next.js](docs/stacks/nextjs.md) · [Rust](docs/stacks/rust.md) · [Python](docs/stacks/python.md) · [Go](docs/stacks/go.md)
404
181
 
405
- Built on ideas from:
406
- - [Agent Skills](https://agentskills.io) — Open standard for cross-platform skills
407
- - [BMAD Method](https://github.com/bmad-code-org/BMAD-METHOD) — Update-safe directories
182
+ ---
408
183
 
409
184
  ## License
410
185
 
package/dist/bin/cli.js CHANGED
File without changes
@@ -135,6 +135,16 @@ async function ensureWorktree(issueNumber, title, verbose, packageManager) {
135
135
  if (verbose) {
136
136
  console.log(chalk.gray(` 🌿 Creating worktree for #${issueNumber}...`));
137
137
  }
138
+ // Fetch latest main to ensure worktree starts from fresh baseline
139
+ if (verbose) {
140
+ console.log(chalk.gray(` 🔄 Fetching latest main...`));
141
+ }
142
+ const fetchResult = spawnSync("git", ["fetch", "origin", "main"], {
143
+ stdio: "pipe",
144
+ });
145
+ if (fetchResult.status !== 0 && verbose) {
146
+ console.log(chalk.yellow(` ⚠️ Could not fetch origin/main, using local state`));
147
+ }
138
148
  // Ensure worktrees directory exists
139
149
  if (!existsSync(worktreesDir)) {
140
150
  spawnSync("mkdir", ["-p", worktreesDir], { stdio: "pipe" });
@@ -148,8 +158,8 @@ async function ensureWorktree(issueNumber, title, verbose, packageManager) {
148
158
  });
149
159
  }
150
160
  else {
151
- // Create new branch from main
152
- createResult = spawnSync("git", ["worktree", "add", worktreePath, "-b", branch], { stdio: "pipe" });
161
+ // Create new branch from origin/main (fresh baseline)
162
+ createResult = spawnSync("git", ["worktree", "add", worktreePath, "-b", branch, "origin/main"], { stdio: "pipe" });
153
163
  }
154
164
  if (createResult.status !== 0) {
155
165
  const error = createResult.stderr.toString();
@@ -31,11 +31,24 @@ export function getCachePath() {
31
31
  */
32
32
  export function getCurrentVersion() {
33
33
  try {
34
- // Navigate from dist/lib to package.json
35
- const packagePath = path.resolve(__dirname, "..", "..", "package.json");
36
- const content = fs.readFileSync(packagePath, "utf8");
37
- const pkg = JSON.parse(content);
38
- return pkg.version || "0.0.0";
34
+ // Walk up from current directory until we find sequant's package.json
35
+ // Works from both source (src/lib/) and compiled (dist/src/lib/) locations
36
+ let dir = __dirname;
37
+ while (dir !== path.dirname(dir)) {
38
+ const candidate = path.resolve(dir, "package.json");
39
+ try {
40
+ const content = fs.readFileSync(candidate, "utf8");
41
+ const pkg = JSON.parse(content);
42
+ if (pkg.name === "sequant") {
43
+ return pkg.version || "0.0.0";
44
+ }
45
+ }
46
+ catch {
47
+ // Not found, continue searching
48
+ }
49
+ dir = path.dirname(dir);
50
+ }
51
+ return "0.0.0";
39
52
  }
40
53
  catch {
41
54
  return "0.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sequant",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "Quantize your development workflow - Sequential AI phases with quality gates",
5
5
  "type": "module",
6
6
  "bin": {