specpilot 2.4.0 → 2.6.0
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 +8 -6
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/backfill.js +21 -8
- package/dist/commands/backfill.js.map +1 -1
- package/dist/commands/serve.d.ts +2 -2
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +37 -8
- package/dist/commands/serve.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +28 -4
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +254 -13
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specArchiver.d.ts +6 -1
- package/dist/utils/specArchiver.d.ts.map +1 -1
- package/dist/utils/specArchiver.js +10 -10
- package/dist/utils/specArchiver.js.map +1 -1
- package/dist/utils/specBackfiller.d.ts +4 -4
- package/dist/utils/specBackfiller.d.ts.map +1 -1
- package/dist/utils/specBackfiller.js +59 -73
- package/dist/utils/specBackfiller.js.map +1 -1
- package/dist/utils/specServer.d.ts +4 -2
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +81 -42
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specValidator.d.ts +6 -2
- package/dist/utils/specValidator.d.ts.map +1 -1
- package/dist/utils/specValidator.js +15 -5
- package/dist/utils/specValidator.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.js +50 -21
- package/ui/route.js +15 -7
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ This AI-assisted approach ensures comprehensive, high-quality specifications tai
|
|
|
76
76
|
| `list` | Show available templates |
|
|
77
77
|
| `migrate` | Convert legacy `.project-spec` folder (rarely needed) |
|
|
78
78
|
| `refine [desc]` | Refine project specifications |
|
|
79
|
-
| `serve`
|
|
79
|
+
| `serve [folders...]` | Serve a local web UI over the `.specs/` of this project, or of each folder named (task moves unless `--read-only`) |
|
|
80
80
|
|
|
81
81
|
> **Tip — command aliases:** All commands have a short alias you can use instead of the full name.
|
|
82
82
|
> `init` → `i` · `validate` → `v` · `migrate` → `m` · `list` → `ls` · `refine` → `ref` · `archive` → `ar` · `add-specs` → `add` · `backfill` → `bf`
|
|
@@ -116,11 +116,12 @@ specpilot validate --fix
|
|
|
116
116
|
|
|
117
117
|
## specpilot serve
|
|
118
118
|
|
|
119
|
-
Serve a local web UI over
|
|
119
|
+
Serve a local web UI over a project's `.specs/`, where you can also move tasks between Backlog and Current Sprint. With no folders it serves the project you run it from (the folder that contains `.specs/`); name one or more folders to serve those instead, all from one server. Press Ctrl+C to stop.
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
|
-
specpilot serve # http://127.0.0.1:4321
|
|
122
|
+
specpilot serve # this project, at http://127.0.0.1:4321
|
|
123
123
|
specpilot serve --port 5000 --open
|
|
124
|
+
specpilot serve ../api ../web # two projects on one server; switch in the left rail
|
|
124
125
|
```
|
|
125
126
|
|
|
126
127
|
| Option | Default | Description |
|
|
@@ -130,8 +131,9 @@ specpilot serve --port 5000 --open
|
|
|
130
131
|
| `--read-only` | | No task moves: the UI only reads, with no drag handles and no write route |
|
|
131
132
|
| `--open` | | Open the UI in the default browser |
|
|
132
133
|
|
|
134
|
+
- **Several projects**: every folder you name must contain `.specs/`; one that does not stops startup with its name. They are numbered in command-line order from 0 (`../api` is project 0, `../web` is project 1), and that number is the `?project=<n>` on the server's `/api/` routes and the `#1/...` at the start of a page link for any project after the first (no number means project 0). Each project keeps its own tasks, files and live reload; a move changes only that project's `tasks.md`. The list is fixed when the server starts: the page cannot add a folder, and nothing is saved outside your projects.
|
|
133
135
|
- **Task moves**: drag a row, or use `Alt+Up/Down` to reorder and `Alt+Left/Right` to move between Backlog and Current Sprint. A move changes exactly one line of `.specs/planning/tasks.md` and nothing else, and offers Undo; Completed rows do not move. If the file changed on disk since the page loaded, the move is refused and the page redraws. Start with `--read-only` to turn moves off.
|
|
134
|
-
- **Nothing else is written**: `.specs/planning/tasks.md` is the only file the server can change; everything else is read on every request.
|
|
136
|
+
- **Nothing else is written**: each served project's `.specs/planning/tasks.md` is the only file the server can change; everything else is read on every request.
|
|
135
137
|
- **Loopback only**: binds 127.0.0.1 only; rejects any Host header other than `127.0.0.1:<port>` or `localhost:<port>` (403).
|
|
136
138
|
- **Live reload**: polls allowlisted files with `stat()` every `--poll` ms while a page is open, and pushes changed paths on `/api/events`; open pages update in place.
|
|
137
139
|
- **What it shows**: `.specs/`, `CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`, `.claude/commands/`, `.claude/skills/` and `.github/prompts/`, as the files' own text.
|
|
@@ -192,7 +194,7 @@ SpecPilot generates a `.specs/` folder with organized subdirectories:
|
|
|
192
194
|
│ ├── roadmap.md # Release milestones and objectives
|
|
193
195
|
│ └── tasks.md # Sprint tracker (backlog / current / completed)
|
|
194
196
|
├── project/
|
|
195
|
-
│ ├── project.yaml # Project config
|
|
197
|
+
│ ├── project.yaml # Project config and AI context (MANDATED)
|
|
196
198
|
│ └── requirements.md # Functional & non-functional requirements
|
|
197
199
|
├── quality/
|
|
198
200
|
│ └── tests.md # Test strategy, coverage targets, acceptance criteria
|
|
@@ -246,7 +248,7 @@ For desktop IDEs: `.vscode/settings.json` (or `.cursor/`, `.windsurf/`, etc.)
|
|
|
246
248
|
|
|
247
249
|
### Generated Slash Commands
|
|
248
250
|
|
|
249
|
-
Each IDE/Agent selection also generates 8 `specpilot-*` slash/workflow commands (`status`, `reanchor`, `report`, `sync`, `refine`, `validate`, `archive`, `backfill`) that mirror key CLI operations as in-editor commands — e.g. `.claude/commands/specpilot-status.md` for Claude Code, `.cursor/commands/` for Cursor, `.github/prompts/` for GitHub Copilot. Running `backfill` on an existing project fills in any commands missing for your already-configured IDE(s). See the [Full Guide](docs/GUIDE.md#generated-slash-commands) for the complete list and per-IDE paths.
|
|
251
|
+
Each IDE/Agent selection also generates 8 `specpilot-*` slash/workflow commands (`status`, `reanchor`, `report`, `sync`, `refine`, `validate`, `archive`, `backfill`) that mirror key CLI operations as in-editor commands — e.g. `.claude/commands/specpilot-status.md` for Claude Code, `.cursor/commands/` for Cursor, `.github/prompts/` for GitHub Copilot. Running `backfill` on an existing project fills in any commands missing for your already-configured IDE(s) and updates the ones you have not edited to the current version; edited files are kept and listed. Each command file is reported as added, updated (to the current version), or kept with its reason: `kept: modified` (you changed it; delete it and re-run `specpilot backfill` to get the latest version), `kept: CRLF line endings` (a known version saved with Windows line endings) or `kept: symbolic link` (links are never written through). See the [Full Guide](docs/GUIDE.md#generated-slash-commands) for the complete list and per-IDE paths.
|
|
250
252
|
|
|
251
253
|
The generated settings/instructions automatically configure your AI agent to:
|
|
252
254
|
|
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ const refine_1 = require("./commands/refine");
|
|
|
14
14
|
const add_specs_1 = require("./commands/add-specs");
|
|
15
15
|
const archive_1 = require("./commands/archive");
|
|
16
16
|
const backfill_1 = require("./commands/backfill");
|
|
17
|
+
const specArchiver_1 = require("./utils/specArchiver");
|
|
17
18
|
const serve_1 = require("./commands/serve");
|
|
18
19
|
const logger_1 = require("./utils/logger");
|
|
19
20
|
const packageJson = require('../package.json');
|
|
@@ -76,7 +77,7 @@ commander_1.program
|
|
|
76
77
|
commander_1.program
|
|
77
78
|
.command('archive')
|
|
78
79
|
.alias('ar')
|
|
79
|
-
.description(
|
|
80
|
+
.description(`Archive oversized .specs/ files (prompts.md > ${specArchiver_1.PROMPTS_LINE_LIMIT} lines, tasks.md Completed > ${specArchiver_1.COMPLETED_LINE_LIMIT} lines)`)
|
|
80
81
|
.option('--dry-run', 'Preview what would be archived without writing any files')
|
|
81
82
|
.option('--force', 'Skip branch warning and archive without confirmation')
|
|
82
83
|
.action(archive_1.archiveCommand);
|
|
@@ -104,7 +105,8 @@ commander_1.program
|
|
|
104
105
|
// Serve command
|
|
105
106
|
commander_1.program
|
|
106
107
|
.command('serve')
|
|
107
|
-
.description('Serve a local web UI over
|
|
108
|
+
.description('Serve a local web UI over the .specs/ of this project, or of each folder named (127.0.0.1 only; task moves unless --read-only)')
|
|
109
|
+
.argument('[folders...]', 'Project folders to serve, in this order (default: the current directory)')
|
|
108
110
|
.option('-p, --port <number>', 'Port to listen on', '4321')
|
|
109
111
|
.option('--poll <ms>', 'How often to check spec files for changes, in ms (minimum 250)', '1000')
|
|
110
112
|
.option('--read-only', 'Turn off task moves: the page only reads')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,0CAA8C;AAC9C,kDAAsD;AACtD,gDAAoD;AACpD,0CAA8C;AAC9C,8CAAkD;AAClD,oDAAuD;AACvD,gDAAoD;AACpD,kDAAsD;AACtD,4CAAgD;AAChD,2CAAwC;AAExC,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,mBAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAEhC,qBAAqB;AACrB,mBAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,KAAK,CAAC,GAAG,CAAC;KACV,WAAW,CAAC,8BAA8B,CAAC;KAC3C,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;KAC7C,MAAM,CAAC,uBAAuB,EAAE,2CAA2C,EAAE,YAAY,CAAC;KAC1F,MAAM,CAAC,6BAA6B,EAAE,kDAAkD,CAAC;KACzF,MAAM,CAAC,uBAAuB,EAAE,kBAAkB,EAAE,GAAG,CAAC;KACxD,MAAM,CAAC,qBAAqB,EAAE,uBAAuB,EAAE,QAAQ,CAAC;KAChE,MAAM,CAAC,cAAc,EAAE,0BAA0B,CAAC;KAClD,MAAM,CAAC,WAAW,EAAE,uDAAuD,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C;KAChB,WAAW,CAAC,gIAAgI,CAAC;KAC7I,QAAQ,CAAC,cAAc,EAAE,0EAA0E,CAAC;KACpG,MAAM,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,CAAC;KAC1D,MAAM,CAAC,aAAa,EAAE,gEAAgE,EAAE,MAAM,CAAC;KAC/F,MAAM,CAAC,aAAa,EAAE,0CAA0C,CAAC;KACjE,MAAM,CAAC,QAAQ,EAAE,qCAAqC,CAAC;KACvD,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,mBAAO,CAAC,WAAW,CAAC,OAAO,EAAE;;;;;;CAM5B,CAAC,CAAC;AAEH,+BAA+B;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,iDAAiD;AACjD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACtB,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;IAC5B,MAAM,CAAC,cAAc,EAAE,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,eAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC,CAAC;IAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -34,7 +34,7 @@ function fileResultLines(label, r, dryRun) {
|
|
|
34
34
|
lines.push(chalk_1.default.yellow(` ⚠️ Skipped — ${r.reason}`));
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
lines.push(chalk_1.default.green(` ✅ All ${r.total}
|
|
37
|
+
lines.push(chalk_1.default.green(` ✅ All ${r.total} item${r.total === 1 ? '' : 's'} already present — nothing to backfill`));
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
else if (r.action === 'created') {
|
|
@@ -76,14 +76,27 @@ function ideFileResultLines(r, dryRun) {
|
|
|
76
76
|
}
|
|
77
77
|
function slashCommandResultLines(r, dryRun) {
|
|
78
78
|
const lines = [chalk_1.default.cyan(`📄 ${r.ide} slash commands`)];
|
|
79
|
-
if (r.added.length === 0) {
|
|
80
|
-
lines.push(chalk_1.default.green(' ✅ All commands
|
|
79
|
+
if (r.added.length === 0 && r.updated.length === 0 && r.kept.length === 0) {
|
|
80
|
+
lines.push(chalk_1.default.green(' ✅ All commands up to date — nothing to backfill'));
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
lines.push(chalk_1.default.white(` ➕ ${verb} ${r.added.length} missing command(s):`));
|
|
82
|
+
if (r.added.length > 0) {
|
|
83
|
+
lines.push(chalk_1.default.white(` ➕ ${dryRun ? 'Would add' : 'Added'} ${r.added.length} missing command(s):`));
|
|
85
84
|
r.added.forEach((name) => lines.push(chalk_1.default.white(` • specpilot-${name}`)));
|
|
86
85
|
}
|
|
86
|
+
if (r.updated.length > 0) {
|
|
87
|
+
lines.push(chalk_1.default.white(` 🔄 ${dryRun ? 'Would update' : 'Updated'} ${r.updated.length} command(s) to the current version:`));
|
|
88
|
+
r.updated.forEach((name) => lines.push(chalk_1.default.white(` • specpilot-${name}`)));
|
|
89
|
+
}
|
|
90
|
+
for (const k of r.kept) {
|
|
91
|
+
lines.push(chalk_1.default.yellow(` ⚠️ kept: ${k.reason} ${k.path}`));
|
|
92
|
+
if (k.reason === 'modified') {
|
|
93
|
+
lines.push(chalk_1.default.yellow(' delete it and re-run specpilot backfill to get the latest version'));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (r.ide === 'codex' && (r.added.length > 0 || r.updated.length > 0)) {
|
|
97
|
+
lines.push(chalk_1.default.white(' ℹ️ Codex only reads ~/.codex/prompts/; copy them there manually:'));
|
|
98
|
+
lines.push(chalk_1.default.white(' cp .codex/prompts/specpilot-*.md ~/.codex/prompts/'));
|
|
99
|
+
}
|
|
87
100
|
return lines;
|
|
88
101
|
}
|
|
89
102
|
function displayResult(result, dryRun, logger) {
|
|
@@ -115,9 +128,9 @@ function displayResult(result, dryRun, logger) {
|
|
|
115
128
|
...slashLines,
|
|
116
129
|
];
|
|
117
130
|
const updatedCount = allResults.filter((r) => r.action === 'updated' || r.action === 'created').length +
|
|
118
|
-
result.slashCommands.filter((r) => r.added.length > 0).length;
|
|
131
|
+
result.slashCommands.filter((r) => r.added.length > 0 || r.updated.length > 0).length;
|
|
119
132
|
const skippedCount = allResults.filter((r) => r.action === 'skipped').length +
|
|
120
|
-
result.slashCommands.filter((r) => r.added.length === 0).length;
|
|
133
|
+
result.slashCommands.filter((r) => r.added.length === 0 && r.updated.length === 0).length;
|
|
121
134
|
const staleCount = allResults.filter((r) => r.action === 'stale').length;
|
|
122
135
|
if (updatedCount === 0 && staleCount === 0) {
|
|
123
136
|
content.push(chalk_1.default.green('✅ Everything is up to date — nothing to backfill.'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/commands/backfill.ts"],"names":[],"mappings":";;;;;AAkBA,0CAsBC;AAxCD,kDAA0B;AAC1B,+BAA+B;AAC/B,4DAMiC;AACjC,4CAAyC;AASlC,KAAK,UAAU,eAAe,CAAC,OAAwB;IAC5D,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;IAC5B,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAExC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,+BAAc,EAAE,CAAC;IAExC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CACtC,UAAU,EACV,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,MAAM,IAAI,KAAK,EACvB,OAAO,CAAC,SAAS,IAAI,KAAK,CAC3B,CAAC;QACF,aAAa,CAAC,MAAM,E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,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5F,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,MAAM,CAAC;IAEzE,IAAI,YAAY,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC,CAAC;IACjF,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,MAAM,CACV,OAAO,YAAY,8BAA8B,YAAY,wBAAwB,UAAU,yCAAyC,CACzI,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,KAAK,CACT,KAAK,YAAY,qBAAqB,YAAY,wBAAwB,UAAU,SAAS,CAC9F,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,eAAK,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/commands/serve.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export interface ServeOptions {
|
|
|
4
4
|
readOnly?: boolean;
|
|
5
5
|
open?: boolean;
|
|
6
6
|
}
|
|
7
|
-
/** Runs until Ctrl+C; exits the process with 1 on any startup error. */
|
|
8
|
-
export declare function serveCommand(options: ServeOptions): Promise<void>;
|
|
7
|
+
/** Runs until Ctrl+C; exits the process with 1 on any startup error. `folders` empty = the current directory (BL-054). */
|
|
8
|
+
export declare function serveCommand(folders: string[], options: ServeOptions): Promise<void>;
|
|
9
9
|
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiBD,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiBD,0HAA0H;AAC1H,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAyE1F"}
|
package/dist/commands/serve.js
CHANGED
|
@@ -23,13 +23,37 @@ function openBrowser(url, logger) {
|
|
|
23
23
|
child.on('error', () => logger.warn(`Could not open a browser. Open ${url} yourself.`));
|
|
24
24
|
child.unref();
|
|
25
25
|
}
|
|
26
|
-
/** Runs until Ctrl+C; exits the process with 1 on any startup error. */
|
|
27
|
-
async function serveCommand(options) {
|
|
26
|
+
/** Runs until Ctrl+C; exits the process with 1 on any startup error. `folders` empty = the current directory (BL-054). */
|
|
27
|
+
async function serveCommand(folders, options) {
|
|
28
28
|
const logger = new logger_1.Logger();
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const roots = [];
|
|
30
|
+
if (!folders.length) {
|
|
31
|
+
const root = process.cwd();
|
|
32
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(root, '.specs'))) {
|
|
33
|
+
logger.error('No .specs/ folder in this directory. Run `specpilot serve` from a project root, or `specpilot init` first.');
|
|
34
|
+
return process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
roots.push(root);
|
|
37
|
+
}
|
|
38
|
+
for (const folder of folders) {
|
|
39
|
+
let root;
|
|
40
|
+
try {
|
|
41
|
+
root = (0, fs_1.realpathSync)((0, path_1.resolve)(folder));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
logger.error(`Folder not found: ${folder}`);
|
|
45
|
+
return process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
if (!(0, fs_1.statSync)(root).isDirectory()) {
|
|
48
|
+
logger.error(`Not a folder: ${folder}`);
|
|
49
|
+
return process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(root, '.specs'))) {
|
|
52
|
+
logger.error(`No .specs/ folder in ${folder}. Run \`specpilot init\` there first, or leave it out.`);
|
|
53
|
+
return process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
if (!roots.includes(root))
|
|
56
|
+
roots.push(root); // the same folder named twice is served once
|
|
33
57
|
}
|
|
34
58
|
const port = options.port === undefined ? DEFAULT_PORT : Number(options.port);
|
|
35
59
|
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
@@ -43,7 +67,7 @@ async function serveCommand(options) {
|
|
|
43
67
|
}
|
|
44
68
|
let handle;
|
|
45
69
|
try {
|
|
46
|
-
handle = await (0, specServer_1.startSpecServer)(
|
|
70
|
+
handle = await (0, specServer_1.startSpecServer)(roots, port, packageJson.version, { pollMs, readOnly: !!options.readOnly, log: m => logger.warn(m) });
|
|
47
71
|
}
|
|
48
72
|
catch (err) {
|
|
49
73
|
if (err.code === 'EADDRINUSE') {
|
|
@@ -55,7 +79,12 @@ async function serveCommand(options) {
|
|
|
55
79
|
return process.exit(1);
|
|
56
80
|
}
|
|
57
81
|
const url = `http://127.0.0.1:${port}`;
|
|
58
|
-
|
|
82
|
+
if (roots.length === 1)
|
|
83
|
+
console.log(chalk_1.default.green(`SpecPilot is serving ${roots[0]} at ${url}`));
|
|
84
|
+
else {
|
|
85
|
+
console.log(chalk_1.default.green(`SpecPilot is serving ${roots.length} projects at ${url}`));
|
|
86
|
+
roots.forEach((root, i) => console.log(` ${i} ${root}`));
|
|
87
|
+
}
|
|
59
88
|
console.log(chalk_1.default.gray(options.readOnly
|
|
60
89
|
? 'Read-only: nothing will be written. Open pages update when a spec file changes. Press Ctrl+C to stop.'
|
|
61
90
|
: 'Tasks can be moved in the page (only .specs/planning/tasks.md is written). Open pages update when a spec file changes. Press Ctrl+C to stop.'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;;;AAgCA,
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;;;AAgCA,oCAyEC;AAzGD,kDAA0B;AAC1B,iDAAsC;AACtC,2BAAwD;AACxD,+BAAqC;AACrC,oDAAkE;AAClE,4CAAyC;AAEzC,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AASlD,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,WAAW,GAAG,GAAG,CAAC;AAExB,wFAAwF;AACxF,SAAS,WAAW,CAAC,GAAW,EAAE,MAAc;IAC9C,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GACf,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;QAC/C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,E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OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CACR,OAAO,CAAC,QAAQ;QACd,CAAC,CAAC,uGAAuG;QACzG,CAAC,CAAC,8IAA8I,CACnJ,CACF,CAAC;IACF,IAAI,OAAO,CAAC,IAAI;QAAE,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAE3C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;QAC1B,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -6,11 +6,30 @@ export interface SlashCommand {
|
|
|
6
6
|
argumentHint?: string;
|
|
7
7
|
allowedTools?: string[];
|
|
8
8
|
}
|
|
9
|
+
/** A command file `refreshCommands()` left as it was, and why. */
|
|
10
|
+
export interface KeptCommand {
|
|
11
|
+
name: string;
|
|
12
|
+
path: string;
|
|
13
|
+
reason: 'modified' | 'CRLF line endings' | 'symbolic link' | 'not a regular file';
|
|
14
|
+
}
|
|
15
|
+
/** What `refreshCommands()` did (or, in dry-run, would do) for one IDE. */
|
|
16
|
+
export interface CommandRefresh {
|
|
17
|
+
added: string[];
|
|
18
|
+
updated: string[];
|
|
19
|
+
kept: KeptCommand[];
|
|
20
|
+
}
|
|
9
21
|
/**
|
|
10
22
|
* Commands to generate. Populated one command at a time by CS-080 through
|
|
11
23
|
* CS-087.
|
|
12
24
|
*/
|
|
13
25
|
export declare const SLASH_COMMANDS: SlashCommand[];
|
|
26
|
+
/**
|
|
27
|
+
* SHA-256 of every command file a released SpecPilot generated, per target path, oldest first.
|
|
28
|
+
* v2.2.0 was the first release to write command files. `refreshCommands()` replaces a file only when
|
|
29
|
+
* its bytes hash to one of these (BL-058). Regenerate with `node scripts/command-hashes.js` whenever
|
|
30
|
+
* a command changes; a test fails if the current content of any target is missing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const KNOWN_COMMAND_HASHES: Record<string, string[]>;
|
|
14
33
|
/**
|
|
15
34
|
* Generates per-IDE slash/workflow command files from SLASH_COMMANDS.
|
|
16
35
|
* Parallel to IdeConfigGenerator — each IDE gets its own directory, file
|
|
@@ -19,11 +38,16 @@ export declare const SLASH_COMMANDS: SlashCommand[];
|
|
|
19
38
|
export declare class SlashCommandGenerator {
|
|
20
39
|
generate(projectDir: string, ide: string, commands?: SlashCommand[]): void;
|
|
21
40
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
41
|
+
* Brings an existing project's command files for the given IDE up to date (BL-058): adds missing
|
|
42
|
+
* files, replaces files whose bytes match a known SpecPilot version, and keeps everything else
|
|
43
|
+
* untouched. In dry-run, reports the same outcomes and writes nothing.
|
|
44
|
+
*/
|
|
45
|
+
refreshCommands(projectDir: string, ide: string, dryRun: boolean, commands?: SlashCommand[], known?: Record<string, string[]>): CommandRefresh;
|
|
46
|
+
/**
|
|
47
|
+
* Replaces `filePath` with `content`: temp file in the same folder, fsync, same mode, rename.
|
|
48
|
+
* Returns false, writing nothing, if the file no longer holds `before` (an editor saved meanwhile).
|
|
25
49
|
*/
|
|
26
|
-
|
|
50
|
+
private replace;
|
|
27
51
|
private resolveTarget;
|
|
28
52
|
private write;
|
|
29
53
|
private claudeFrontmatter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommandGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/slashCommandGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slashCommandGenerator.d.ts","sourceRoot":"","sources":["../../src/utils/slashCommandGenerator.ts"],"names":[],"mappings":"AAIA,0EAA0E;AAC1E,MAAM,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