specpilot 2.13.0 → 2.14.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 +12 -7
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/backfill.d.ts.map +1 -1
- package/dist/commands/backfill.js +24 -13
- package/dist/commands/backfill.js.map +1 -1
- package/dist/commands/serve.d.ts +3 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +71 -2
- package/dist/commands/serve.js.map +1 -1
- package/dist/core/agentConfig.d.ts +10 -0
- package/dist/core/agentConfig.d.ts.map +1 -1
- package/dist/core/agentConfig.js +47 -3
- package/dist/core/agentConfig.js.map +1 -1
- package/dist/core/slashCommands.d.ts.map +1 -1
- package/dist/core/slashCommands.js +25 -16
- package/dist/core/slashCommands.js.map +1 -1
- package/dist/core/specFiles.js +3 -0
- package/dist/core/specFiles.js.map +1 -1
- package/dist/core/templateEngine.d.ts +5 -0
- package/dist/core/templateEngine.d.ts.map +1 -1
- package/dist/core/templateEngine.js +13 -1
- package/dist/core/templateEngine.js.map +1 -1
- package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
- package/dist/utils/addSpecsQuestions.js +2 -0
- package/dist/utils/addSpecsQuestions.js.map +1 -1
- package/dist/utils/folderPicker.d.ts +28 -0
- package/dist/utils/folderPicker.d.ts.map +1 -0
- package/dist/utils/folderPicker.js +96 -0
- package/dist/utils/folderPicker.js.map +1 -0
- package/dist/utils/projectDetector.d.ts +11 -0
- package/dist/utils/projectDetector.d.ts.map +1 -1
- package/dist/utils/projectDetector.js +86 -0
- package/dist/utils/projectDetector.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +21 -0
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +166 -0
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specArchiver.d.ts.map +1 -1
- package/dist/utils/specArchiver.js +2 -1
- package/dist/utils/specArchiver.js.map +1 -1
- package/dist/utils/specBackfiller.d.ts +9 -3
- package/dist/utils/specBackfiller.d.ts.map +1 -1
- package/dist/utils/specBackfiller.js +52 -48
- package/dist/utils/specBackfiller.js.map +1 -1
- package/dist/utils/specServer.d.ts +8 -3
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +76 -8
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specSetup.d.ts.map +1 -1
- package/dist/utils/specSetup.js +6 -1
- package/dist/utils/specSetup.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.css +4 -0
- package/ui/app.js +46 -5
- package/ui/index.html +4 -2
- package/dist/__tests__/fixtures/allFields.d.ts +0 -3
- package/dist/__tests__/fixtures/allFields.d.ts.map +0 -1
- package/dist/__tests__/fixtures/allFields.js +0 -31
- package/dist/__tests__/fixtures/allFields.js.map +0 -1
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ This AI-assisted approach ensures comprehensive, high-quality specifications tai
|
|
|
74
74
|
| `add-specs` | Add specs to existing project |
|
|
75
75
|
| `validate` | Validate specification files |
|
|
76
76
|
| `archive` | Archive oversized `prompts.md` / `tasks.md` entries |
|
|
77
|
-
| `backfill` | Backfill missing mandates
|
|
77
|
+
| `backfill` | Backfill missing mandates, slash commands & the Claude Code skill |
|
|
78
78
|
| `list` | Show available templates |
|
|
79
79
|
| `migrate` | Convert legacy `.project-spec` folder (rarely needed) |
|
|
80
80
|
| `refine [desc]` | Refine project specifications |
|
|
@@ -96,7 +96,7 @@ This AI-assisted approach ensures comprehensive, high-quality specifications tai
|
|
|
96
96
|
| `archive` | `--dry-run` · `--force` |
|
|
97
97
|
| `add-specs` | `--no-analysis` · `--deep-analysis` · `--no-prompts` |
|
|
98
98
|
| `backfill` | `--dir` · `--specs-name` · `--dry-run` · `--no-prompts` |
|
|
99
|
-
| `serve` | `--port` · `--poll` · `--read-only` · `--open` · `--mcp`
|
|
99
|
+
| `serve` | `--port` · `--poll` · `--read-only` · `--open` · `--mcp` · `--stop` |
|
|
100
100
|
|
|
101
101
|
> Run `specpilot <command> --help` for full flag descriptions and default values.
|
|
102
102
|
|
|
@@ -125,6 +125,7 @@ specpilot serve # this project, at http://127.0.0.1:4321
|
|
|
125
125
|
specpilot serve --port 5000 --open
|
|
126
126
|
specpilot serve ../api ../web # two projects on one server; switch in the left rail
|
|
127
127
|
specpilot serve ../new-project # no .specs/ there yet: the page sets it up (or `specpilot serve .`)
|
|
128
|
+
specpilot serve --stop # stop the server on port 4321 from another terminal (--port for another)
|
|
128
129
|
```
|
|
129
130
|
|
|
130
131
|
| Option | Default | Description |
|
|
@@ -134,19 +135,21 @@ specpilot serve ../new-project # no .specs/ there yet: the page sets it up (or
|
|
|
134
135
|
| `--read-only` | | No task moves, no new tasks, no guided setup, no opening folders and no registry: the UI only reads, with no drag handles, no New Task button and no write routes |
|
|
135
136
|
| `--open` | | Open the UI in the default browser |
|
|
136
137
|
| `--mcp` | | Also serve a local MCP endpoint at `/mcp` for your AI IDE, and show the Connect Your AI IDE card on Home (below) |
|
|
138
|
+
| `--stop` | | Stop the SpecPilot server running on this machine on `--port` (default 4321), as Ctrl+C would; takes no other option. A `--read-only` server cannot be stopped this way: press Ctrl+C in its terminal |
|
|
137
139
|
|
|
138
140
|
- **Several projects**: name any folders; one without `.specs/` is served too and offers guided setup (below). 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`. Folders opened from the page (below) get the next numbers; a number never changes while the server runs, and one server holds at most 20 projects.
|
|
141
|
+
- **Quit**: the power button at the foot of the left rail stops the server after you confirm, as Ctrl+C or `specpilot serve --stop` would (a running clone is stopped and cleaned up first). The page then says SpecPilot has stopped; other open pages simply stop updating. Not shown with `--read-only`.
|
|
139
142
|
- **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.
|
|
140
|
-
- **Commands and Skills**: each view lists its files in two groups. Under From SpecPilot are the `specpilot-*` commands whose bytes match a version SpecPilot released (in `.claude/commands/` and `.github/prompts/`) and the `specpilot-project` skill
|
|
143
|
+
- **Commands and Skills**: each view lists its files in two groups. Under From SpecPilot are the `specpilot-*` commands whose bytes match a version SpecPilot released (in `.claude/commands/` and `.github/prompts/`) and the `specpilot-project` skill while it is still SpecPilot's own render of your `project.yaml`; everything else is under Yours, including a `specpilot-*` command you edited. Regenerate All, in the From SpecPilot header of Commands, runs what `specpilot backfill` runs for command files, and nothing else: for each IDE whose instruction file is in the project it adds the missing `specpilot-*` commands and updates the unedited ones to the current version, in every IDE's command folder, also the ones the page does not list (`.cursor/commands/`, `.windsurf/workflows/`, `.agent/workflows/`, `.codex/prompts/`). It also refreshes `.claude/skills/specpilot-project/SKILL.md` from `.specs/project/project.yaml` (name, language, framework, platforms, package manager, test framework, repository URL, license) when the skill is still SpecPilot's own, and adds it when missing; a skill you edited, or one rendered from values `project.yaml` no longer holds, is kept with the reason `does not match SpecPilot's render of project.yaml`. Edited files, links, files under a linked folder, your own commands and skills, instruction files and `.specs/` are never written. What it did is shown above the groups as it happened: updated, added, kept with the reason, and the folders the page does not list.
|
|
141
144
|
- **New Task**: the New Task button on the Tasks view opens a small form: a description and a section (Backlog by default, or Current Sprint). SpecPilot adds one row, `| <ID> | <description> |`, at the end of that section's table in `.specs/planning/tasks.md` and changes nothing else in the file. The ID is the next free one: `BL-###` for Backlog, `CS-###` for Current Sprint, one past the highest in use in `tasks.md` and `tasks-archive.md` (only IDs in ID columns and leading tags count, not IDs mentioned in a description; gaps are never filled). The description is written exactly as you typed it, markdown included, with no label or date added; one with a line break, a control character, a `|` or a trailing `\`, or over 4000 characters, is refused with the reason, and what you typed stays in the form. The new row is selected and opened in the details panel. If the file changed on disk since the page loaded, nothing is added and the page redraws. Protected like a task move; off with `--read-only`.
|
|
142
|
-
- **Guided setup**: a folder you name that has no `.specs/` shows, instead of the views, a Start Guided Setup button. It starts a chat that asks the questions `specpilot add-specs` asks (project type, language and framework when they are not detected, API paradigm, handle, IDE) one at a time: a friendly line per question with the CLI's own question under it, chips or a field with Continue and Skip, step dividers and a progress bar, then a recap of your answers by step with the files that will be written folded inside, before anything is created. What SpecPilot detected in the folder is already answered and marked `detected`: the language, the framework and the project name, which `add-specs` takes from your files without asking, so they cannot be changed here, and a platform it can see directly (React Native, Next.js, React or Vue / Nuxt from `package.json`, iOS Native from an Xcode project, also a macOS one), which you can change; the chat starts at the first question it still needs. Tap any other answer, in the thread or the recap, to change it; you come straight back. It then creates exactly what `add-specs` creates for those answers. A handle that would be refused is caught where you type it. Your answers stay in the page while it is open; they are not saved anywhere. Files outside `.specs/` that already exist (your own `.gitattributes`, `CLAUDE.md`, `.vscode/settings.json`, a command file) are never changed: the recap's file list marks them (`Already here, will be kept`) and the page lists them again afterwards, and `specpilot backfill` adds missing SpecPilot sections to kept instruction and command files (a kept `.gitattributes` does not get the `merge=union` lines). Setup is offered only for folders named on the command line, not for the current-directory default, which still needs `.specs/` (`specpilot serve .` names it). The request is protected like a task move. While it runs, the files are generated into a `.specpilot-setup-<id>/` folder inside the project, which is removed when done; if a run is interrupted, the next `specpilot serve` removes that folder (and only that folder, recognised by its marker file).
|
|
145
|
+
- **Guided setup**: a folder you name that has no `.specs/` shows, instead of the views, a Start Guided Setup button. It starts a chat that asks the questions `specpilot add-specs` asks (project type, language and framework when they are not detected, API paradigm, handle, IDE) one at a time: a friendly line per question with the CLI's own question under it, chips or a field with Continue and Skip, step dividers and a progress bar, then a recap of your answers by step with the files that will be written folded inside, before anything is created. What SpecPilot detected in the folder is already answered and marked `detected`: the language, the framework and the project name (and, when found, the package manager, test framework, repository URL and license, which are written to `project.yaml` and `quality/tests.md` by `add-specs` too), which `add-specs` takes from your files without asking, so they cannot be changed here, and a platform it can see directly (React Native, Next.js, React or Vue / Nuxt from `package.json`, iOS Native from an Xcode project, also a macOS one), which you can change; the chat starts at the first question it still needs. Tap any other answer, in the thread or the recap, to change it; you come straight back. It then creates exactly what `add-specs` creates for those answers. A handle that would be refused is caught where you type it. Your answers stay in the page while it is open; they are not saved anywhere. Files outside `.specs/` that already exist (your own `.gitattributes`, `CLAUDE.md`, `.vscode/settings.json`, a command file) are never changed: the recap's file list marks them (`Already here, will be kept`) and the page lists them again afterwards, and `specpilot backfill` adds missing SpecPilot sections to kept instruction and command files (a kept `.gitattributes` does not get the `merge=union` lines). Setup is offered only for folders named on the command line, not for the current-directory default, which still needs `.specs/` (`specpilot serve .` names it). The request is protected like a task move. While it runs, the files are generated into a `.specpilot-setup-<id>/` folder inside the project, which is removed when done; if a run is interrupted, the next `specpilot serve` removes that folder (and only that folder, recognised by its marker file).
|
|
143
146
|
- **Home**: the logo at the top of the left rail, the `+` tile below the projects (or the `h` key, or `#home`) shows "Your specs, as a board.", an Open a Project Folder button and your Recent projects (path, last-opened time and, for projects already open, the git branch); click one to open it, or Remove from list to forget it (the folder is not touched). `specpilot serve` still starts on the first project's Tasks view, and `--read-only` has no Home.
|
|
144
|
-
- **Open a project from the page**: Open a Project Folder on Home opens a sheet (Clone a Repository opens it on its Clone tab); type a folder path (`/Users/you/project` or `~/project`) and Open, and the folder is served alongside the others, with guided setup if it has no `.specs/`. Folders you open this way are listed under Recent projects next time, remembered in `~/.specpilot/projects.json` (path, last-opened time and a pinned flag, at most 50; the file is created the first time you open a folder from the page, and folders named on the command line are added to it only once it exists). Remove from list forgets a folder without touching it. The home folder, the root of a drive and folders already open are refused; a `projects.json` that cannot be read is left exactly as it is, and the page and the terminal say so. The request is protected like a task move.
|
|
147
|
+
- **Open a project from the page**: Open a Project Folder on Home opens a sheet (Clone a Repository opens it on its Clone tab); type a folder path (`/Users/you/project` or `~/project`), or click Browse… to pick it in your system's folder dialog (macOS; Linux with `zenity` or `kdialog`; Windows), and Open, and the folder is served alongside the others, with guided setup if it has no `.specs/`. Folders you open this way are listed under Recent projects next time, remembered in `~/.specpilot/projects.json` (path, last-opened time and a pinned flag, at most 50; the file is created the first time you open a folder from the page, and folders named on the command line are added to it only once it exists). Remove from list forgets a folder without touching it. Browse… only fills in the path; nothing is opened until you click Open. The Clone tab's Parent folder and the New Project chat's parent-folder question have the same Browse… button, which likewise only fills in the field. Checked on macOS: picking a folder fills the field and Open opens it, and no privacy prompt appears at Browse… or at Open, also for a folder inside `~/Documents`; the Linux and Windows dialogs are not yet checked by hand. The home folder, the root of a drive and folders already open are refused; a `projects.json` that cannot be read is left exactly as it is, and the page and the terminal say so. The request is protected like a task move.
|
|
145
148
|
- **Start a new project from the page**: Start a New Project on Home opens the same chat: name the project to start, then it asks for the parent folder (`/Users/you/dev` or `~/dev`) and the questions `specpilot init` asks, one at a time, then shows your answers and the files that will be written, and creates `<parent>/<name>`, writes the files `init` writes there and opens it on its onboarding prompt. An existing folder is used only if it is empty; one with content is refused (open it from the Folder tab to add `.specs/` to it). The parent must already exist and cannot be your home folder itself, the root of a drive, or a `.specs/` folder or anything under one. A project name that would be refused is caught where you type it. For a Brownfield project the four project-context questions are not asked, because `init` writes those answers only for Greenfield. Nothing that exists is changed, a run that fails removes what it created, and no `git init` is run. Not offered here: `--specs-name` and `--dry-run`.
|
|
146
149
|
- **Clone a repository from the page**: Clone a Repository on Home (or the Clone tab of the same sheet) asks for a repository URL, a parent folder and a folder name (leave it empty for the repository's name), runs your installed `git clone` and opens the result: on Tasks when the repository has `.specs/`, in guided setup when it has none. Accepted URLs: `https://host/path`, `git@host:path` and `ssh://host/path`; an https URL must not contain a user name or password (git uses your credential helper and ssh keys, as in a terminal), so for Azure DevOps drop the `org@` part. Submodules are not cloned, and there is no branch or depth option. The target folder must not exist or must be empty; the parent follows the rules of Start a New Project. As you type or paste the URL, Folder name is filled with the repository's name until you type one yourself. While the clone runs the sheet shows the elapsed time and, once git reports it, git's stage and percentage (`Receiving objects 42% · 0:13`, then `Resolving deltas` and `Updating files`); until then, or when git reports none, a moving bar. git is never asked a question it would wait on: a repository that needs a login it cannot get fails with git's own message, its last `fatal:` line with the line before it, for example `Host key verification failed. fatal: Could not read from remote repository.`, and a clone is stopped after 10 minutes. The page cannot accept an ssh host key for you: for a host you have never connected to, run `ssh -T git@host` once in a terminal, then clone again. Your ssh setup is used as it is; SpecPilot sets no ssh option on macOS and Linux. One clone runs at a time. A clone that fails, is stopped, or is cancelled (Cancel, Escape, closing the tab, Ctrl+C) removes what it downloaded; on Ctrl+C the server waits at most 5 seconds for that. Needs `git` on your `PATH`. This is the only time SpecPilot starts another program for the page and the only time it uses the network. On Windows ssh is put in batch mode (unless you have set `GIT_SSH_COMMAND`, `GIT_SSH` or `core.sshCommand`), and a stopped clone can leave git's helper process running until it ends by itself, and the clean-up can then fail on a file that helper still holds; the message says so.
|
|
147
150
|
- **Open in VS Code**: the icon at the top right of every project view (and beside each Recent project on Home whose folder still exists) is a `vscode://file/` link to that project's folder. Your browser hands it to VS Code, which asks before opening it; SpecPilot starts nothing itself. Nothing happens if VS Code is not installed. A task's details panel has Open tasks.md in VS Code, which opens `.specs/planning/tasks.md` at that task's line; VS Code puts a file in the window it picks (by default the last one you used), which may not be this project's. It opens VS Code only, not Insiders or another editor. The file view of every `.specs/` file and the details panel of every Instructions, Commands and Skills file also have Open in VS Code, which opens that file.
|
|
148
151
|
- **Open in AI IDE**: the sparkle icon beside Open in VS Code shows a short menu when it has something to offer. Open in Cursor (`cursor://file/`) appears when the project has `.cursor/rules/specpilot.mdc`, the file SpecPilot writes for Cursor. While `.specs/development/onboarding.md` exists, Send onboarding prompt to Cursor puts the prompt into Cursor's chat through Cursor's own link (it stays on this machine; Cursor waits for you to confirm, and uses the window it has in front, so open the project in Cursor first), and Copy onboarding prompt copies it for Claude Code, which has no link to open, or any other IDE. A prompt too long for a Cursor link (10,000 characters) is copied instead. It is on project views only, not on Home's rows.
|
|
149
|
-
- **Nothing else is written**: in a project with `.specs/`, its `.specs/planning/tasks.md` and, through Regenerate All, its `specpilot-*` command files are the only files the server can change; in a named folder without `.specs/`, setup creates new files and changes none; a new project is one new folder (or an empty one) with new files; a clone is one new folder (or an empty one) filled by `git clone`; `~/.specpilot/projects.json` is the one file written outside your projects; everything else is read on every request.
|
|
152
|
+
- **Nothing else is written**: in a project with `.specs/`, its `.specs/planning/tasks.md` and, through Regenerate All, its `specpilot-*` command files and its `specpilot-project` skill are the only files the server can change; in a named folder without `.specs/`, setup creates new files and changes none; a new project is one new folder (or an empty one) with new files; a clone is one new folder (or an empty one) filled by `git clone`; `~/.specpilot/projects.json` is the one file written outside your projects; everything else is read on every request.
|
|
150
153
|
- **Loopback only**: binds 127.0.0.1 only; rejects any Host header other than `127.0.0.1:<port>` or `localhost:<port>` (403).
|
|
151
154
|
- **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.
|
|
152
155
|
- **What it shows**: `.specs/`, `CLAUDE.md`, `AGENTS.md`, `.github/copilot-instructions.md`, `.claude/commands/`, `.claude/skills/` and `.github/prompts/`, as the files' own text.
|
|
@@ -382,7 +385,7 @@ npx playwright-core install chromium-headless-shell # once, if Playwright's Chr
|
|
|
382
385
|
npm run test:browser # builds, then runs src/__browser__/ (about 10 s)
|
|
383
386
|
```
|
|
384
387
|
|
|
385
|
-
The suite starts the built server on scratch copies of `.specs/` under a temporary `HOME`, so it writes nothing in the repo or in `~/.specpilot/`. A failing test prints the paths of its error message and stack, a screenshot and the page's HTML, kept in a temp folder.
|
|
388
|
+
The suite starts the built server on scratch copies of a fixture project (`src/__browser__/fixture/`, never this repo's own `.specs/`) under a temporary `HOME`, so it writes nothing in the repo or in `~/.specpilot/`. A failing test prints the paths of its error message and stack, a screenshot and the page's HTML, kept in a temp folder.
|
|
386
389
|
|
|
387
390
|
### Quick Contribution Guide
|
|
388
391
|
|
|
@@ -391,6 +394,8 @@ The suite starts the built server on scratch copies of `.specs/` under a tempora
|
|
|
391
394
|
3. Update specs when making changes
|
|
392
395
|
4. Run `specpilot validate` before committing
|
|
393
396
|
|
|
397
|
+
Releases follow the checklist in [`docs/RELEASING.md`](docs/RELEASING.md).
|
|
398
|
+
|
|
394
399
|
## Documentation
|
|
395
400
|
|
|
396
401
|
- **[Full Guide](docs/GUIDE.md)**: Comprehensive documentation
|
package/dist/cli.js
CHANGED
|
@@ -112,6 +112,7 @@ commander_1.program
|
|
|
112
112
|
.option('--read-only', 'Turn off task moves and guided setup: the page only reads')
|
|
113
113
|
.option('--open', 'Open the UI in your default browser')
|
|
114
114
|
.option('--mcp', 'Also serve a local MCP endpoint at /mcp for your AI IDE (SPECPILOT_MCP_TOKEN sets its token)')
|
|
115
|
+
.option('--stop', 'Stop the SpecPilot server running on this machine (on --port; a --read-only one stops with Ctrl+C)')
|
|
115
116
|
.action(serve_1.serveCommand);
|
|
116
117
|
commander_1.program.addHelpText('after', `
|
|
117
118
|
Aliases:
|
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,uDAAgF;AAChF,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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a,EAAE,2DAA2D,CAAC;KAClF,MAAM,CAAC,QAAQ,EAAE,qCAAqC,CAAC;KACvD,MAAM,CAAC,OAAO,EAAE,8FAA8F,CAAC;KAC/G,MAAM,CAAC,QAAQ,EAAE,oGAAoG,CAAC;KACtH,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/commands/backfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../src/commands/backfill.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB7E"}
|
|
@@ -55,13 +55,6 @@ function ideFileResultLines(r, dryRun) {
|
|
|
55
55
|
if (r.action === 'warn') {
|
|
56
56
|
lines.push(chalk_1.default.yellow(` ⚠️ ${r.reason}`));
|
|
57
57
|
}
|
|
58
|
-
else if (r.action === 'stale') {
|
|
59
|
-
lines.push(chalk_1.default.yellow(` ⚠️ Stale — ${r.found}/${r.total} structural fingerprints found`));
|
|
60
|
-
r.added.forEach((label) => lines.push(chalk_1.default.white(` • Missing: ${label}`)));
|
|
61
|
-
if (r.reason) {
|
|
62
|
-
lines.push(chalk_1.default.white(` ${r.reason}`));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
58
|
else {
|
|
66
59
|
const fileResult = {
|
|
67
60
|
action: r.action,
|
|
@@ -74,6 +67,21 @@ function ideFileResultLines(r, dryRun) {
|
|
|
74
67
|
}
|
|
75
68
|
return lines;
|
|
76
69
|
}
|
|
70
|
+
/** The Claude Code skill's line (BL-PM-012): refreshed from project.yaml, or kept with the reason. */
|
|
71
|
+
function skillResultLines(r, dryRun) {
|
|
72
|
+
const done = {
|
|
73
|
+
added: dryRun ? 'Would add it from project.yaml' : 'Added from project.yaml',
|
|
74
|
+
updated: dryRun ? "Would update it from project.yaml (it is SpecPilot's own render)" : "Updated from project.yaml (it was SpecPilot's own render)",
|
|
75
|
+
current: 'Current — nothing to do',
|
|
76
|
+
};
|
|
77
|
+
return [
|
|
78
|
+
chalk_1.default.blue.bold('Claude Code skill'),
|
|
79
|
+
'',
|
|
80
|
+
chalk_1.default.cyan(`📄 ${r.path}`),
|
|
81
|
+
r.action === 'kept' ? chalk_1.default.yellow(` ⚠️ Kept as it was (${r.reason})`) : chalk_1.default.green(` ✅ ${done[r.action]}`),
|
|
82
|
+
'',
|
|
83
|
+
];
|
|
84
|
+
}
|
|
77
85
|
function slashCommandResultLines(r, dryRun) {
|
|
78
86
|
const lines = [chalk_1.default.cyan(`📄 ${r.ide} slash commands`)];
|
|
79
87
|
if (r.added.length === 0 && r.updated.length === 0 && r.kept.length === 0) {
|
|
@@ -126,20 +134,23 @@ function displayResult(result, dryRun, logger) {
|
|
|
126
134
|
'',
|
|
127
135
|
...ideLines,
|
|
128
136
|
...slashLines,
|
|
137
|
+
...(result.skill ? skillResultLines(result.skill, dryRun) : []),
|
|
129
138
|
];
|
|
130
139
|
const updatedCount = allResults.filter((r) => r.action === 'updated' || r.action === 'created').length +
|
|
131
|
-
result.slashCommands.filter((r) => r.added.length > 0 || r.updated.length > 0).length
|
|
140
|
+
result.slashCommands.filter((r) => r.added.length > 0 || r.updated.length > 0).length +
|
|
141
|
+
(result.skill?.action === 'added' || result.skill?.action === 'updated' ? 1 : 0);
|
|
132
142
|
const skippedCount = allResults.filter((r) => r.action === 'skipped').length +
|
|
133
|
-
result.slashCommands.filter((r) => r.added.length === 0 && r.updated.length === 0).length
|
|
134
|
-
|
|
135
|
-
|
|
143
|
+
result.slashCommands.filter((r) => r.added.length === 0 && r.updated.length === 0).length +
|
|
144
|
+
(result.skill?.action === 'current' ? 1 : 0);
|
|
145
|
+
const keptCount = result.skill?.action === 'kept' ? 1 : 0;
|
|
146
|
+
if (updatedCount === 0 && keptCount === 0) {
|
|
136
147
|
content.push(chalk_1.default.green('✅ Everything is up to date — nothing to backfill.'));
|
|
137
148
|
}
|
|
138
149
|
else if (dryRun) {
|
|
139
|
-
content.push(chalk_1.default.yellow(`ℹ️ ${updatedCount} file(s) would be updated, ${skippedCount} already up to date, ${
|
|
150
|
+
content.push(chalk_1.default.yellow(`ℹ️ ${updatedCount} file(s) would be updated, ${skippedCount} already up to date, ${keptCount} kept. Run without --dry-run to apply.`));
|
|
140
151
|
}
|
|
141
152
|
else {
|
|
142
|
-
content.push(chalk_1.default.green(`✅ ${updatedCount} file(s) updated, ${skippedCount} already up to date, ${
|
|
153
|
+
content.push(chalk_1.default.green(`✅ ${updatedCount} file(s) updated, ${skippedCount} already up to date, ${keptCount} kept.`));
|
|
143
154
|
content.push('');
|
|
144
155
|
content.push(chalk_1.default.cyan('📖 Next steps:'));
|
|
145
156
|
content.push(chalk_1.default.white(' specpilot validate # Verify your specs are complete'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/commands/backfill.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"backfill.js","sourceRoot":"","sources":["../../src/commands/backfill.ts"],"names":[],"mappings":";;;;;AAmBA,0CAsBC;AAzCD,kDAA0B;AAC1B,+BAA+B;AAC/B,4DAMiC;AAEjC,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,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,KAAa,EAAE,CAAqB,EAAE,MAAe;IAC5E,MAAM,KAAK,GAAa,CAAC,eAAK,CAAC,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC;IAEpD,IA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AO,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,SAAS,wCAAwC,CACvI,CACF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CACV,eAAK,CAAC,KAAK,CACT,KAAK,YAAY,qBAAqB,YAAY,wBAAwB,SAAS,QAAQ,CAC5F,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
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
1
2
|
export interface ServeOptions {
|
|
2
3
|
port?: string;
|
|
3
4
|
poll?: string;
|
|
4
5
|
readOnly?: boolean;
|
|
5
6
|
open?: boolean;
|
|
6
7
|
mcp?: boolean;
|
|
8
|
+
stop?: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** Longest a stop signal waits for a running clone to be killed and cleaned up. */
|
|
9
11
|
export declare const STOP_CLONE_MS = 5000;
|
|
@@ -16,5 +18,5 @@ export declare function mcpConfigLine(host: string, token: string): string;
|
|
|
16
18
|
* directory (BL-054), which must contain `.specs/`; a named folder without one is served for guided
|
|
17
19
|
* setup (BL-055). More folders can be opened from the page and are remembered in the registry (BL-067).
|
|
18
20
|
*/
|
|
19
|
-
export declare function serveCommand(folders: string[], options: ServeOptions): Promise<void>;
|
|
21
|
+
export declare function serveCommand(folders: string[], options: ServeOptions, command?: Command): Promise<void>;
|
|
20
22
|
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,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;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,mFAAmF;AACnF,eAAO,MAAM,aAAa,OAAO,CAAC;AAGlC,4HAA4H;AAC5H,eAAO,MAAM,iBAAiB,QAAuB,CAAC;AAEtD,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjE;AAsED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA+I7G"}
|
package/dist/commands/serve.js
CHANGED
|
@@ -9,6 +9,8 @@ exports.serveCommand = serveCommand;
|
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const child_process_1 = require("child_process");
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
|
+
const http_1 = require("http");
|
|
13
|
+
const net_1 = require("net");
|
|
12
14
|
const path_1 = require("path");
|
|
13
15
|
const specServer_1 = require("../utils/specServer");
|
|
14
16
|
const specSetup_1 = require("../utils/specSetup");
|
|
@@ -35,13 +37,80 @@ function openBrowser(url, logger) {
|
|
|
35
37
|
child.on('error', () => logger.warn(`Could not open a browser. Open ${url} yourself.`));
|
|
36
38
|
child.unref();
|
|
37
39
|
}
|
|
40
|
+
/** The most of `GET /` that `--stop` reads (BL-098). */
|
|
41
|
+
const MAX_PAGE_BYTES = 1024 * 1024;
|
|
42
|
+
/** One request to 127.0.0.1:<port>: status and body (at most MAX_PAGE_BYTES), no redirect followed. */
|
|
43
|
+
function loopback(port, method, path, headers = {}, body) {
|
|
44
|
+
return new Promise((resolveRequest, reject) => {
|
|
45
|
+
const req = (0, http_1.request)({ host: '127.0.0.1', port, method, path, headers, timeout: 5000, agent: false }, res => {
|
|
46
|
+
let text = '';
|
|
47
|
+
res.setEncoding('utf8');
|
|
48
|
+
res.on('data', (chunk) => {
|
|
49
|
+
text += chunk;
|
|
50
|
+
if (text.length > MAX_PAGE_BYTES)
|
|
51
|
+
req.destroy(new Error('too large'));
|
|
52
|
+
});
|
|
53
|
+
res.on('end', () => resolveRequest({ status: res.statusCode ?? 0, body: text }));
|
|
54
|
+
res.on('error', reject);
|
|
55
|
+
});
|
|
56
|
+
req.on('timeout', () => req.destroy(new Error('timeout')));
|
|
57
|
+
req.on('error', reject);
|
|
58
|
+
req.end(body);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Whether something accepts connections on 127.0.0.1:<port>. */
|
|
62
|
+
function listening(port) {
|
|
63
|
+
return new Promise(resolveCheck => {
|
|
64
|
+
const socket = (0, net_1.connect)(port, '127.0.0.1');
|
|
65
|
+
socket.once('connect', () => (socket.destroy(), resolveCheck(true)));
|
|
66
|
+
socket.once('error', () => resolveCheck(false));
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* `specpilot serve --stop` (BL-098): the page's own Quit, sent from here. Reads the page token from `GET /`
|
|
71
|
+
* as any page on this machine can, posts `/api/quit` with it, then waits for the port to close. Never
|
|
72
|
+
* prints the token, signals no process and writes nothing.
|
|
73
|
+
*/
|
|
74
|
+
async function stopRunningServer(port, logger) {
|
|
75
|
+
const page = await loopback(port, 'GET', '/').catch(() => null);
|
|
76
|
+
const token = page?.status === 200 ? /<meta name="specpilot-token" content="([0-9a-f]{64})">/.exec(page.body)?.[1] : undefined;
|
|
77
|
+
if (!token) {
|
|
78
|
+
logger.error(`No SpecPilot server that --stop can reach is running on port ${port}. A --read-only server stops with Ctrl+C in its terminal.`);
|
|
79
|
+
return process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
const headers = { Origin: `http://127.0.0.1:${port}`, 'X-SpecPilot-Token': token, 'Content-Type': 'application/json' };
|
|
82
|
+
const quit = await loopback(port, 'POST', '/api/quit', headers, '{}').catch(() => null);
|
|
83
|
+
const deadline = Date.now() + exports.STOP_CLONE_MS + 2000;
|
|
84
|
+
while (quit?.status === 202 && Date.now() < deadline) {
|
|
85
|
+
if (!(await listening(port))) {
|
|
86
|
+
console.log(`Stopped the SpecPilot server on port ${port}.`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
await new Promise(r => setTimeout(r, 100));
|
|
90
|
+
}
|
|
91
|
+
logger.error(`Asked the server on port ${port} to stop; it is still running.`);
|
|
92
|
+
return process.exit(1);
|
|
93
|
+
}
|
|
38
94
|
/**
|
|
39
95
|
* Runs until Ctrl+C; exits the process with 1 on any startup error. `folders` empty = the current
|
|
40
96
|
* directory (BL-054), which must contain `.specs/`; a named folder without one is served for guided
|
|
41
97
|
* setup (BL-055). More folders can be opened from the page and are remembered in the registry (BL-067).
|
|
42
98
|
*/
|
|
43
|
-
async function serveCommand(folders, options) {
|
|
99
|
+
async function serveCommand(folders, options, command) {
|
|
44
100
|
const logger = new logger_1.Logger();
|
|
101
|
+
if (options.stop) {
|
|
102
|
+
const pollGiven = command ? command.getOptionValueSource('poll') === 'cli' : options.poll !== undefined;
|
|
103
|
+
if (folders.length || options.readOnly || options.open || options.mcp || pollGiven) {
|
|
104
|
+
logger.error('--stop takes only --port. Run `specpilot serve --stop` or `specpilot serve --stop --port <n>`.');
|
|
105
|
+
return process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
const port = options.port === undefined ? DEFAULT_PORT : Number(options.port);
|
|
108
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) {
|
|
109
|
+
logger.error(`Invalid --port "${options.port}". Use a whole number from 1 to 65535.`);
|
|
110
|
+
return process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
return stopRunningServer(port, logger);
|
|
113
|
+
}
|
|
45
114
|
const roots = [];
|
|
46
115
|
if (!folders.length) {
|
|
47
116
|
const root = (0, fs_1.realpathSync)(process.cwd()); // like a named folder, so "already served" compares like for like (BL-067)
|
|
@@ -110,7 +179,7 @@ async function serveCommand(folders, options) {
|
|
|
110
179
|
}
|
|
111
180
|
let handle;
|
|
112
181
|
try {
|
|
113
|
-
handle = await (0, specServer_1.startSpecServer)(roots, port, packageJson.version, { pollMs, readOnly: !!options.readOnly, named, registry, mcp: !!options.mcp, mcpToken: envToken, log: m => logger.warn(m) });
|
|
182
|
+
handle = await (0, specServer_1.startSpecServer)(roots, port, packageJson.version, { pollMs, readOnly: !!options.readOnly, named, registry, mcp: !!options.mcp, mcpToken: envToken, log: m => logger.warn(m), onQuit: () => stop() });
|
|
114
183
|
}
|
|
115
184
|
catch (err) {
|
|
116
185
|
if (err.code === 'EADDRINUSE') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;;;;AA6BA,sCAEC;AAkBD,oCAiIC;AAlLD,kDAA0B;AAC1B,iDAAsC;AACtC,2BAAwD;AACxD,+BAAqC;AACrC,oDAA+E;AAC/E,kDAAsE;AACtE,8DAA2G;AAC3G,4CAAyC;AAEzC,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAUlD,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,eAA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AC;YAClB,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACnE,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,IAAI,CAAC,4CAA4C,qBAAa,GAAG,IAAI,0CAA0C,CAAC,CAAC;gBACxH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACzB,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC,CAAC;aACD,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -6,4 +6,14 @@ export declare function agentFile(engine: TemplateEngine, context: TemplateConte
|
|
|
6
6
|
path: string;
|
|
7
7
|
content: string;
|
|
8
8
|
} | null;
|
|
9
|
+
/** The two skill templates SpecPilot released, oldest first (REQ-002.H.40); `fillReleasedSkill()` fills them. */
|
|
10
|
+
export declare const KNOWN_SKILL_TEMPLATES: string[];
|
|
11
|
+
/** A released template filled the way that version did, `.replace` patterns such as `$&` included: the bytes it wrote. */
|
|
12
|
+
export declare function fillReleasedSkill(template: string, context: {
|
|
13
|
+
projectName: string;
|
|
14
|
+
language: string;
|
|
15
|
+
framework?: string;
|
|
16
|
+
}): string;
|
|
17
|
+
/** A value the skill can hold on one line: a non-blank string with no control character (REQ-002.H.40). */
|
|
18
|
+
export declare function skillValue(value: unknown): string | undefined;
|
|
9
19
|
//# sourceMappingURL=agentConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentConfig.d.ts","sourceRoot":"","sources":["../../src/core/agentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWnE,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAGpD;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAInI"}
|
|
1
|
+
{"version":3,"file":"agentConfig.d.ts","sourceRoot":"","sources":["../../src/core/agentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWnE,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAGpD;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAInI;AA+FD,iHAAiH;AACjH,eAAO,MAAM,qBAAqB,UAAuB,CAAC;AAE1D,0HAA0H;AAC1H,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAMlI;AAED,2GAA2G;AAC3G,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI7D"}
|
package/dist/core/agentConfig.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KNOWN_SKILL_TEMPLATES = void 0;
|
|
3
4
|
exports.agentTargets = agentTargets;
|
|
4
5
|
exports.agentFile = agentFile;
|
|
6
|
+
exports.fillReleasedSkill = fillReleasedSkill;
|
|
7
|
+
exports.skillValue = skillValue;
|
|
5
8
|
// The one file each AI agent gets (BL-032, phase 1: the content of src/utils/agentConfigGenerator.ts,
|
|
6
9
|
// which is gone; the writer is SpecGenerator).
|
|
7
10
|
/** The one file each agent gets, project-relative; `agentFile()` and `agentTargets()` both read it (BL-055). */
|
|
@@ -21,8 +24,11 @@ function agentFile(engine, context, agent) {
|
|
|
21
24
|
return null;
|
|
22
25
|
return { path: AGENT_FILES[key], content: key === 'claude-code' ? claudeCodeSkill(context) : codexInstructions(engine, context) };
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The skill template v2.1.0 to v2.13.0 shipped, frozen (BL-PM-012, ARCH-004.55): the base of today's render
|
|
29
|
+
* and, without its Code Philosophy and Code Rules sections, the template v1.5.0 to v2.0.1 shipped.
|
|
30
|
+
*/
|
|
31
|
+
const SKILL_V2 = `---
|
|
26
32
|
name: specpilot-project
|
|
27
33
|
description: SpecPilot project context, specifications, and development guidelines. Use to understand project architecture, requirements, and AI interaction history.
|
|
28
34
|
---
|
|
@@ -109,12 +115,50 @@ All spec files link to each other for easy navigation. Follow the links in relat
|
|
|
109
115
|
- ../architecture/architecture.md
|
|
110
116
|
- ../planning/tasks.md
|
|
111
117
|
`;
|
|
112
|
-
|
|
118
|
+
const SKILL_V1 = SKILL_V2.slice(0, SKILL_V2.indexOf('## Code Philosophy')) + SKILL_V2.slice(SKILL_V2.indexOf('## Cross-References'));
|
|
119
|
+
/** The two skill templates SpecPilot released, oldest first (REQ-002.H.40); `fillReleasedSkill()` fills them. */
|
|
120
|
+
exports.KNOWN_SKILL_TEMPLATES = [SKILL_V1, SKILL_V2];
|
|
121
|
+
/** A released template filled the way that version did, `.replace` patterns such as `$&` included: the bytes it wrote. */
|
|
122
|
+
function fillReleasedSkill(template, context) {
|
|
123
|
+
return template
|
|
113
124
|
.replace(/\{\{projectName\}\}/g, context.projectName)
|
|
114
125
|
.replace(/\{\{language\}\}/g, context.language)
|
|
115
126
|
.replace(/{{#if framework}}/g, context.framework ? '' : '<!-- ')
|
|
116
127
|
.replace(/{{\/if}}/g, context.framework ? '' : ' -->');
|
|
117
128
|
}
|
|
129
|
+
/** A value the skill can hold on one line: a non-blank string with no control character (REQ-002.H.40). */
|
|
130
|
+
function skillValue(value) {
|
|
131
|
+
if (typeof value !== 'string' || value.trim() === '')
|
|
132
|
+
return undefined;
|
|
133
|
+
for (let i = 0; i < value.length; i++)
|
|
134
|
+
if (value.charCodeAt(i) < 0x20 || value.charCodeAt(i) === 0x7f)
|
|
135
|
+
return undefined;
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
const PROJECT_BLOCK = 'Project: {{projectName}}\nLanguage: {{language}}\n{{#if framework}}\nFramework: {{framework}}\n{{/if}}\n';
|
|
139
|
+
/** The skill from the project context (BL-PM-012): one line per present value, written as typed, no `.replace` patterns. */
|
|
140
|
+
function claudeCodeSkill(context) {
|
|
141
|
+
const lines = [`Project: ${context.projectName}`, `Language: ${context.language}`];
|
|
142
|
+
const add = (label, value) => {
|
|
143
|
+
const v = skillValue(value);
|
|
144
|
+
if (v)
|
|
145
|
+
lines.push(`${label}: ${v}`);
|
|
146
|
+
};
|
|
147
|
+
add('Framework', context.framework);
|
|
148
|
+
const platforms = (context.platforms ?? []).map(skillValue);
|
|
149
|
+
if (platforms.length && platforms.every(Boolean))
|
|
150
|
+
lines.push(`Platforms: ${platforms.join(', ')}`);
|
|
151
|
+
add('Package manager', context.packageManager);
|
|
152
|
+
add('Test framework', context.testFramework);
|
|
153
|
+
add('Repository', context.repository);
|
|
154
|
+
add('License', context.license);
|
|
155
|
+
if (!SKILL_V2.includes(PROJECT_BLOCK))
|
|
156
|
+
throw new Error('the skill template lost its project block');
|
|
157
|
+
// The template's own placeholders are filled around the value lines, so a value is never rewritten.
|
|
158
|
+
const [head, tail] = SKILL_V2.split(PROJECT_BLOCK);
|
|
159
|
+
const fill = (text) => text.split('{{projectName}}').join(context.projectName);
|
|
160
|
+
return fill(head) + lines.join('\n') + '\n' + fill(tail);
|
|
161
|
+
}
|
|
118
162
|
function codexInstructions(engine, context) {
|
|
119
163
|
const codexInstructions = `# OpenAI Codex Instructions for {{projectName}}
|
|
120
164
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentConfig.js","sourceRoot":"","sources":["../../src/core/agentConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentConfig.js","sourceRoot":"","sources":["../../src/core/agentConfig.ts"],"names":[],"mappings":";;;AAYA,oCAGC;AAGD,8BAIC;AAmGD,8CAMC;AAGD,gCAIC;AApID,sGAAsG;AACtG,+CAA+C;AAE/C,gHAAgH;AAChH,MAAM,WAAW,GAA2B;IAC1C,aAAa,EAAE,2CAA2C;IAC1D,KAAK,EAAE,uBAAuB;CAC/B,CAAC;AAEF,2DAA2D;AAC3D,SAAgB,YAAY,CAAC,KAAa;IACxC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5B,CAAC;AAED,4DAA4D;AAC5D,SAAgB,SAAS,CAAC,MAAsB,EAAE,OAAwB,EAAE,KAAa;IACvF,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB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IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACvF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAsB,EAAE,OAAwB;IACvE,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiJ7B,CAAC;IAEA,OAAO,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["../../src/core/slashCommands.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"slashCommands.d.ts","sourceRoot":"","sources":["../../src/core/slashCommands.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EAiexC,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAY,EAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAMxH;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgBlH"}
|