specpilot 2.8.0 → 2.10.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 +4 -2
- package/dist/commands/add-specs.d.ts.map +1 -1
- package/dist/commands/add-specs.js +1 -3
- package/dist/commands/add-specs.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +32 -95
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/refine.d.ts.map +1 -1
- package/dist/commands/refine.js +1 -3
- package/dist/commands/refine.js.map +1 -1
- package/dist/commands/serve.d.ts +2 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +29 -3
- package/dist/commands/serve.js.map +1 -1
- package/dist/core/agentConfig.d.ts +9 -0
- package/dist/core/agentConfig.d.ts.map +1 -0
- package/dist/{utils/agentConfigGenerator.js → core/agentConfig.js} +29 -44
- package/dist/core/agentConfig.js.map +1 -0
- package/dist/core/ideConfig.d.ts +35 -0
- package/dist/core/ideConfig.d.ts.map +1 -0
- package/dist/core/ideConfig.js +287 -0
- package/dist/core/ideConfig.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +22 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/render.d.ts +73 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +99 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/slashCommands.d.ts +23 -0
- package/dist/core/slashCommands.d.ts.map +1 -0
- package/dist/core/slashCommands.js +524 -0
- package/dist/core/slashCommands.js.map +1 -0
- package/dist/core/specFiles.d.ts +18 -0
- package/dist/core/specFiles.d.ts.map +1 -0
- package/dist/{utils/specFileGenerator.js → core/specFiles.js} +223 -127
- package/dist/core/specFiles.js.map +1 -0
- package/dist/core/templateEngine.d.ts +69 -0
- package/dist/core/templateEngine.d.ts.map +1 -0
- package/dist/{utils → core}/templateEngine.js +108 -6
- package/dist/core/templateEngine.js.map +1 -0
- package/dist/utils/addSpecsQuestions.d.ts +16 -0
- package/dist/utils/addSpecsQuestions.d.ts.map +1 -1
- package/dist/utils/addSpecsQuestions.js +28 -1
- package/dist/utils/addSpecsQuestions.js.map +1 -1
- package/dist/utils/gitClone.d.ts +62 -0
- package/dist/utils/gitClone.d.ts.map +1 -0
- package/dist/utils/gitClone.js +222 -0
- package/dist/utils/gitClone.js.map +1 -0
- package/dist/utils/ideConfigGenerator.d.ts +5 -29
- package/dist/utils/ideConfigGenerator.d.ts.map +1 -1
- package/dist/utils/ideConfigGenerator.js +9 -282
- package/dist/utils/ideConfigGenerator.js.map +1 -1
- package/dist/utils/initQuestions.d.ts +57 -0
- package/dist/utils/initQuestions.d.ts.map +1 -0
- package/dist/utils/initQuestions.js +49 -0
- package/dist/utils/initQuestions.js.map +1 -0
- package/dist/utils/projectRegistry.d.ts +2 -0
- package/dist/utils/projectRegistry.d.ts.map +1 -1
- package/dist/utils/projectRegistry.js +4 -2
- package/dist/utils/projectRegistry.js.map +1 -1
- package/dist/utils/slashCommandGenerator.d.ts +3 -17
- package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
- package/dist/utils/slashCommandGenerator.js +8 -514
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specGenerator.d.ts +16 -46
- package/dist/utils/specGenerator.d.ts.map +1 -1
- package/dist/utils/specGenerator.js +36 -62
- package/dist/utils/specGenerator.js.map +1 -1
- package/dist/utils/specServer.d.ts +5 -1
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +179 -27
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specSetup.d.ts +69 -4
- package/dist/utils/specSetup.d.ts.map +1 -1
- package/dist/utils/specSetup.js +228 -21
- package/dist/utils/specSetup.js.map +1 -1
- package/package.json +1 -1
- package/ui/app.css +94 -11
- package/ui/app.js +232 -74
- package/ui/index.html +39 -12
- package/ui/route.js +144 -11
- package/dist/utils/agentConfigGenerator.d.ts +0 -17
- package/dist/utils/agentConfigGenerator.d.ts.map +0 -1
- package/dist/utils/agentConfigGenerator.js.map +0 -1
- package/dist/utils/specFileGenerator.d.ts +0 -29
- package/dist/utils/specFileGenerator.d.ts.map +0 -1
- package/dist/utils/specFileGenerator.js.map +0 -1
- package/dist/utils/templateEngine.d.ts +0 -35
- package/dist/utils/templateEngine.d.ts.map +0 -1
- package/dist/utils/templateEngine.js.map +0 -1
|
@@ -4,47 +4,8 @@ exports.IdeConfigGenerator = exports.GITATTRIBUTES_FILE = void 0;
|
|
|
4
4
|
exports.writeNew = writeNew;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* official documentation. Unknown keys are silently ignored, but they are
|
|
10
|
-
* included here as hints for IDEs that may adopt spec-aware settings in future.
|
|
11
|
-
* Remove any keys that cause warnings in your specific IDE version.
|
|
12
|
-
*/
|
|
13
|
-
const IDE_OVERRIDES = {
|
|
14
|
-
cursor: {
|
|
15
|
-
// ASPIRATIONAL — not in official Cursor docs
|
|
16
|
-
'cursor.aiAccess': true,
|
|
17
|
-
'cursor.enableAIContext': true,
|
|
18
|
-
},
|
|
19
|
-
windsurf: {
|
|
20
|
-
// ASPIRATIONAL — not in official Windsurf docs
|
|
21
|
-
'windsurf.aiContext.enabled': true,
|
|
22
|
-
'windsurf.specs.integration': true,
|
|
23
|
-
'windsurf.codeCompletion.contextAware': true,
|
|
24
|
-
},
|
|
25
|
-
antigravity: {
|
|
26
|
-
// ASPIRATIONAL — not in official Antigravity docs
|
|
27
|
-
'antigravity.ai.enabled': true,
|
|
28
|
-
'antigravity.contextual': true,
|
|
29
|
-
'antigravity.specs.integration': true,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
/** IDE directory names used for settings files. */
|
|
33
|
-
const IDE_DIRS = {
|
|
34
|
-
vscode: '.vscode',
|
|
35
|
-
cursor: '.cursor',
|
|
36
|
-
windsurf: '.windsurf',
|
|
37
|
-
antigravity: '.antigravity',
|
|
38
|
-
};
|
|
39
|
-
/** The IDE-native AI context file per IDE; anything else gets copilot-instructions.md (ARCH-004.11). */
|
|
40
|
-
const AI_CONTEXT_FILES = {
|
|
41
|
-
cursor: '.cursor/rules/specpilot.mdc',
|
|
42
|
-
windsurf: '.windsurfrules',
|
|
43
|
-
antigravity: '.antigravity/rules.md',
|
|
44
|
-
'claude-code': 'CLAUDE.md',
|
|
45
|
-
};
|
|
46
|
-
const COPILOT_INSTRUCTIONS = '.github/copilot-instructions.md';
|
|
47
|
-
exports.GITATTRIBUTES_FILE = '.gitattributes';
|
|
7
|
+
const ideConfig_1 = require("../core/ideConfig");
|
|
8
|
+
Object.defineProperty(exports, "GITATTRIBUTES_FILE", { enumerable: true, get: function () { return ideConfig_1.GITATTRIBUTES_FILE; } });
|
|
48
9
|
/** Project-relative path of a project file, joined for this platform. */
|
|
49
10
|
const at = (projectDir, rel) => (0, path_1.join)(projectDir, ...rel.split('/'));
|
|
50
11
|
/**
|
|
@@ -63,247 +24,18 @@ function writeNew(path, content) {
|
|
|
63
24
|
}
|
|
64
25
|
}
|
|
65
26
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* plus per-IDE overlay keys.
|
|
27
|
+
* The Node side of the IDE files (BL-032): what `specpilot backfill` creates and what the writer
|
|
28
|
+
* merges. The content of every IDE file is in `src/core/ideConfig.ts`.
|
|
69
29
|
*/
|
|
70
30
|
class IdeConfigGenerator {
|
|
71
|
-
/** Entry point — routes to the correct IDE settings generator. Returns the kept (existing) files. */
|
|
72
|
-
async generate(projectDir, context, ide) {
|
|
73
|
-
return this.generateIDESettings(projectDir, context, ide);
|
|
74
|
-
}
|
|
75
|
-
/** The files `generate()` writes, project-relative (BL-055); read from the same table as the writes. */
|
|
76
|
-
settingsTargets(ide) {
|
|
77
|
-
const dir = IDE_DIRS[ide.toLowerCase()] ?? '.vscode';
|
|
78
|
-
return [`${dir}/settings.json`, `${dir}/extensions.json`];
|
|
79
|
-
}
|
|
80
|
-
/** The file `generateAiContextFile()` writes, project-relative (BL-055). */
|
|
81
|
-
aiContextTarget(ide) {
|
|
82
|
-
return AI_CONTEXT_FILES[ide.toLowerCase()] ?? COPILOT_INSTRUCTIONS;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Routes to the correct IDE-native AI context file based on the selected IDE.
|
|
86
|
-
* - vscode / codex → .github/copilot-instructions.md
|
|
87
|
-
* - cursor → .cursor/rules/specpilot.mdc
|
|
88
|
-
* - windsurf → .windsurfrules
|
|
89
|
-
* - antigravity → .antigravity/rules.md
|
|
90
|
-
* - claude-code → CLAUDE.md
|
|
91
|
-
* An existing file is kept (BL-073); returns it as kept, else [].
|
|
92
|
-
*/
|
|
93
|
-
generateAiContextFile(projectDir, context, ide) {
|
|
94
|
-
const key = ide.toLowerCase();
|
|
95
|
-
const rel = this.aiContextTarget(key);
|
|
96
|
-
const filePath = at(projectDir, rel);
|
|
97
|
-
(0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
|
|
98
|
-
const content = key === 'claude-code'
|
|
99
|
-
? this.buildClaudeMd(context)
|
|
100
|
-
: key === 'cursor'
|
|
101
|
-
? `---\ndescription: Project mandates and AI coding rules\nglobs:\nalwaysApply: true\n---\n\n` + this.buildCopilotInstructions(context)
|
|
102
|
-
: this.buildCopilotInstructions(context);
|
|
103
|
-
return writeNew(filePath, content) ? [] : [rel];
|
|
104
|
-
}
|
|
105
|
-
buildClaudeMd(context) {
|
|
106
|
-
const stack = context.framework
|
|
107
|
-
? `${context.language} / ${context.framework}`
|
|
108
|
-
: context.language;
|
|
109
|
-
return `# CLAUDE.md \u2014 ${context.projectName}
|
|
110
|
-
|
|
111
|
-
> This file is the primary instructions file for Claude Code.
|
|
112
|
-
> Keep it lean \u2014 use it as a router to your \`.specs/\` files, not a dumping ground.
|
|
113
|
-
> Full project context is in \`.specs/project/project.yaml\`.
|
|
114
|
-
|
|
115
|
-
## Project
|
|
116
|
-
|
|
117
|
-
- **Name:** ${context.projectName}
|
|
118
|
-
- **Stack:** ${stack}
|
|
119
|
-
- **Specs location:** \`.specs/\`
|
|
120
|
-
|
|
121
|
-
## \ud83d\udd34 Critical Mandates \u2014 Never violate, no exceptions
|
|
122
|
-
|
|
123
|
-
${this.buildCriticalMandatesMarkdown()}
|
|
124
|
-
|
|
125
|
-
## \ud83d\udfe1 Process Mandates
|
|
126
|
-
|
|
127
|
-
${this.buildProcessMandatesMarkdown()}
|
|
128
|
-
|
|
129
|
-
${this.buildContextRoutingTable()}
|
|
130
|
-
|
|
131
|
-
${this.buildCodePhilosophyMarkdown()}
|
|
132
|
-
|
|
133
|
-
## Re-Anchor
|
|
134
|
-
|
|
135
|
-
If you lose context mid-session, read \`.specs/project/project.yaml\` to restore full project context.
|
|
136
|
-
For a ready-made re-anchor prompt, see \`.specs/development/prompts.md \u2192 ## Re-Anchor Prompt\`.
|
|
137
|
-
`;
|
|
138
|
-
}
|
|
139
31
|
/**
|
|
140
32
|
* Generates .github/copilot-instructions.md with critical mandates (`specpilot backfill`, when it is
|
|
141
33
|
* missing). Read automatically by GitHub Copilot, Cursor, and other AI tools on every request.
|
|
142
34
|
*/
|
|
143
35
|
generateCopilotInstructions(projectDir, context) {
|
|
144
|
-
const filePath = at(projectDir,
|
|
36
|
+
const filePath = at(projectDir, ideConfig_1.COPILOT_INSTRUCTIONS_FILE);
|
|
145
37
|
(0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
|
|
146
|
-
writeNew(filePath,
|
|
147
|
-
}
|
|
148
|
-
buildCopilotInstructions(context) {
|
|
149
|
-
const stack = context.framework
|
|
150
|
-
? `${context.language} / ${context.framework}`
|
|
151
|
-
: context.language;
|
|
152
|
-
return `# AI Coding Instructions — ${context.projectName}
|
|
153
|
-
|
|
154
|
-
> This file is automatically read by GitHub Copilot, Cursor, and other AI tools on every request.
|
|
155
|
-
> Keep this file short — only critical mandates. Full context is in \`.specs/project/project.yaml\`.
|
|
156
|
-
|
|
157
|
-
## Project
|
|
158
|
-
|
|
159
|
-
- **Name:** ${context.projectName}
|
|
160
|
-
- **Stack:** ${stack}
|
|
161
|
-
- **Specs location:** \`.specs/\`
|
|
162
|
-
|
|
163
|
-
## 🔴 Critical Mandates — Never violate, no exceptions
|
|
164
|
-
|
|
165
|
-
${this.buildCriticalMandatesMarkdown()}
|
|
166
|
-
|
|
167
|
-
## 🟡 Process Mandates
|
|
168
|
-
|
|
169
|
-
${this.buildProcessMandatesMarkdown()}
|
|
170
|
-
|
|
171
|
-
${this.buildContextRoutingTable()}
|
|
172
|
-
|
|
173
|
-
${this.buildCodePhilosophyMarkdown()}
|
|
174
|
-
|
|
175
|
-
## Re-Anchor
|
|
176
|
-
|
|
177
|
-
If you lose context mid-session, read \`.specs/project/project.yaml\` to restore full project context.\nFor a ready-made re-anchor prompt, see \`.specs/development/prompts.md → ## Re-Anchor Prompt\`.
|
|
178
|
-
`;
|
|
179
|
-
}
|
|
180
|
-
buildCriticalMandatesMarkdown() {
|
|
181
|
-
return `1. No commit unless asked.
|
|
182
|
-
2. No push unless asked.
|
|
183
|
-
3. No deploy/publish/release unless asked.
|
|
184
|
-
4. No \`.specs/\` structure changes — content only.
|
|
185
|
-
5. Update specs after change:
|
|
186
|
-
- Trivial → \`planning/tasks.md\`
|
|
187
|
-
- Feature → \`project/requirements.md\` + \`planning/tasks.md\`
|
|
188
|
-
- Architectural → all affected files + \`CHANGELOG.md\`
|
|
189
|
-
6. Never reference file contents without reading first. If unread, say so.
|
|
190
|
-
7. Never write code or change files unless asked. Ask first.
|
|
191
|
-
8. Spec-first gate (scale to task size):
|
|
192
|
-
- Trivial → no gate
|
|
193
|
-
- Feature → read 1–2 relevant \`.specs/\` files before coding
|
|
194
|
-
- Architectural → update all affected specs, present Spec Report, wait for \`yes, proceed\``;
|
|
195
|
-
}
|
|
196
|
-
buildContextRoutingTable() {
|
|
197
|
-
return `## Context — read on demand by task type
|
|
198
|
-
|
|
199
|
-
| Task type | Read |
|
|
200
|
-
|---|---|
|
|
201
|
-
| Session start | \`.specs/project/project.yaml\` |
|
|
202
|
-
| Feature / bug | + \`project/requirements.md\`, \`planning/tasks.md\` |
|
|
203
|
-
| Architecture | + \`architecture/architecture.md\` |
|
|
204
|
-
| Tests | + \`quality/tests.md\` |
|
|
205
|
-
| Security | + \`security/threat-model.md\`, \`security/security-decisions.md\` |
|
|
206
|
-
| Planning | + \`planning/tasks.md\`, \`planning/roadmap.md\` |`;
|
|
207
|
-
}
|
|
208
|
-
buildProcessMandatesMarkdown() {
|
|
209
|
-
return `- **Spec-First:** Update \`.specs/\` before writing code.
|
|
210
|
-
- **Log all AI interactions** in \`.specs/development/prompts.md\` with timestamps.
|
|
211
|
-
- **Document decisions** in \`.specs/development/context.md\`.`;
|
|
212
|
-
}
|
|
213
|
-
buildCodePhilosophyMarkdown() {
|
|
214
|
-
return `## Code Philosophy — Write Only What Needed
|
|
215
|
-
|
|
216
|
-
1. Need exist? No → skip. Say why.
|
|
217
|
-
2. Already in codebase? → reuse. Not rewrite.
|
|
218
|
-
3. Stdlib do it? → use it.
|
|
219
|
-
4. Native or installed dep cover it? → use. No new deps.
|
|
220
|
-
5. One line do it? → write that.
|
|
221
|
-
6. Only then: minimum code that work.
|
|
222
|
-
7. Never cut: validation, error handling, security, explicit requirement.
|
|
223
|
-
|
|
224
|
-
## Code Rules
|
|
225
|
-
|
|
226
|
-
1. No abstraction, interface, factory, or pattern unless asked.
|
|
227
|
-
2. No scaffold "for later". Later scaffold itself.
|
|
228
|
-
3. Delete before add.
|
|
229
|
-
4. Shortest correct diff win.
|
|
230
|
-
5. Fix cause, not symptom. One guard in shared function beat guard in every caller.
|
|
231
|
-
6. Boring over clever. Clever = 3am bug.
|
|
232
|
-
7. Read before write. Never reference code you haven't read.`;
|
|
233
|
-
}
|
|
234
|
-
async generateIDESettings(projectDir, context, ide) {
|
|
235
|
-
const key = ide.toLowerCase();
|
|
236
|
-
const overrides = IDE_OVERRIDES[key] ?? {};
|
|
237
|
-
const [settingsRel, extensionsRel] = this.settingsTargets(key);
|
|
238
|
-
(0, fs_1.mkdirSync)((0, path_1.dirname)(at(projectDir, settingsRel)), { recursive: true });
|
|
239
|
-
const kept = [];
|
|
240
|
-
const settingsWithComment = this.buildSettingsJson(ide, context, overrides);
|
|
241
|
-
if (!writeNew(at(projectDir, settingsRel), settingsWithComment))
|
|
242
|
-
kept.push(settingsRel);
|
|
243
|
-
const extensions = {
|
|
244
|
-
recommendations: [
|
|
245
|
-
'esbenp.prettier-vscode',
|
|
246
|
-
'redhat.vscode-yaml',
|
|
247
|
-
'github.copilot',
|
|
248
|
-
'ms-vscode.vscode-typescript-next',
|
|
249
|
-
],
|
|
250
|
-
unwantedRecommendations: [],
|
|
251
|
-
};
|
|
252
|
-
if (!writeNew(at(projectDir, extensionsRel), JSON.stringify(extensions, null, 2)))
|
|
253
|
-
kept.push(extensionsRel);
|
|
254
|
-
return kept;
|
|
255
|
-
}
|
|
256
|
-
buildSettingsJson(ide, context, overrides) {
|
|
257
|
-
const displayName = ide === 'vscode' ? 'VS Code' : ide.charAt(0).toUpperCase() + ide.slice(1);
|
|
258
|
-
const noteComment = ide === 'vscode'
|
|
259
|
-
? '// Copy the "First-Use Onboarding Prompt" and paste into your AI agent to populate specs'
|
|
260
|
-
: `// Copy the "First-Use Onboarding Prompt" and paste into ${displayName}'s AI chat to populate specs`;
|
|
261
|
-
// Build override lines
|
|
262
|
-
const overrideLines = Object.entries(overrides)
|
|
263
|
-
.map(([k, v]) => ` "${k}": ${JSON.stringify(v)},`)
|
|
264
|
-
.join('\n');
|
|
265
|
-
const overrideBlock = overrideLines
|
|
266
|
-
? `\n // ${displayName}-specific AI settings (ASPIRATIONAL — not confirmed in official docs; unknown keys are silently ignored)\n${overrideLines}\n`
|
|
267
|
-
: '';
|
|
268
|
-
return `{
|
|
269
|
-
// SpecPilot AI IDE Configuration${ide !== 'vscode' ? ` for ${displayName}` : ''}
|
|
270
|
-
// This file configures ${displayName} to work effectively with SpecPilot specs
|
|
271
|
-
|
|
272
|
-
// AI CONTEXT: The recommended way to give AI agents access to your .specs files
|
|
273
|
-
// is via .github/copilot-instructions.md (VS Code Copilot) or your IDE's equivalent
|
|
274
|
-
// custom instructions file. See .specs/development/prompts.md for guidelines.
|
|
275
|
-
${noteComment}
|
|
276
|
-
|
|
277
|
-
// Ensure .specs folder is included in workspace search (not excluded)
|
|
278
|
-
"search.exclude": {
|
|
279
|
-
"**/.specs/*": false
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
// Markdown formatting for spec files
|
|
283
|
-
"[markdown]": {
|
|
284
|
-
"editor.wordWrap": "on",
|
|
285
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
// YAML formatting for spec files (project.yaml, api.yaml)
|
|
289
|
-
"[yaml]": {
|
|
290
|
-
"editor.insertSpaces": true,
|
|
291
|
-
"editor.tabSize": 2
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
// YAML validation (requires redhat.vscode-yaml extension)
|
|
295
|
-
"yaml.validate": true,
|
|
296
|
-
"yaml.schemas": {
|
|
297
|
-
"https://json.schemastore.org/github-workflow.json": ".github/workflows/*.{yml,yaml}"
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
// General file exclusions
|
|
301
|
-
"files.exclude": {
|
|
302
|
-
"**/.git": true,
|
|
303
|
-
"**/node_modules": true,
|
|
304
|
-
"**/__pycache__": true
|
|
305
|
-
}${overrideBlock}
|
|
306
|
-
}`;
|
|
38
|
+
writeNew(filePath, (0, ideConfig_1.buildCopilotInstructions)(context));
|
|
307
39
|
}
|
|
308
40
|
/**
|
|
309
41
|
* Generates (or updates) .gitattributes at project root with merge=union rules
|
|
@@ -311,18 +43,13 @@ If you lose context mid-session, read \`.specs/project/project.yaml\` to restore
|
|
|
311
43
|
* If the file already exists, only missing lines are appended. Returns how many were appended.
|
|
312
44
|
*/
|
|
313
45
|
generateGitAttributes(projectDir) {
|
|
314
|
-
const
|
|
315
|
-
'.specs/development/prompts*.md merge=union',
|
|
316
|
-
'.specs/planning/tasks.md merge=union',
|
|
317
|
-
'CHANGELOG.md merge=union',
|
|
318
|
-
];
|
|
319
|
-
const filePath = (0, path_1.join)(projectDir, exports.GITATTRIBUTES_FILE);
|
|
46
|
+
const filePath = (0, path_1.join)(projectDir, ideConfig_1.GITATTRIBUTES_FILE);
|
|
320
47
|
if (!(0, fs_1.existsSync)(filePath)) {
|
|
321
|
-
(0, fs_1.writeFileSync)(filePath, GITATTRIBUTES_LINES.join('\n') + '\n');
|
|
48
|
+
(0, fs_1.writeFileSync)(filePath, ideConfig_1.GITATTRIBUTES_LINES.join('\n') + '\n');
|
|
322
49
|
return 0;
|
|
323
50
|
}
|
|
324
51
|
const existing = (0, fs_1.readFileSync)(filePath, 'utf8');
|
|
325
|
-
const missing = GITATTRIBUTES_LINES.filter(line => !existing.includes(line));
|
|
52
|
+
const missing = ideConfig_1.GITATTRIBUTES_LINES.filter(line => !existing.includes(line));
|
|
326
53
|
if (missing.length > 0) {
|
|
327
54
|
const suffix = existing.endsWith('\n') ? '' : '\n';
|
|
328
55
|
(0, fs_1.appendFileSync)(filePath, suffix + missing.join('\n') + '\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ideConfigGenerator.js","sourceRoot":"","sources":["../../src/utils/ideConfigGenerator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ideConfigGenerator.js","sourceRoot":"","sources":["../../src/utils/ideConfigGenerator.ts"],"names":[],"mappings":";;;AAcA,4BAQC;AAtBD,+BAAqC;AACrC,2BAAwF;AAExF,iDAAiI;AAExH,mGAFqD,8BAAkB,OAErD;AAE3B,yEAAyE;AACzE,MAAM,EAAE,GAAG,CAAC,UAAkB,EAAE,GAAW,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,UAAU,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,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C,CAAC,CAAC;QAC7E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACnD,IAAA,mBAAc,EAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC;IACxB,CAAC;CACF;AAhCD,gDAgCC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AddSpecsAnswers } from './addSpecsQuestions';
|
|
2
|
+
import { SpecGeneratorOptions } from './specGenerator';
|
|
3
|
+
/** `init` lists Greenfield first. */
|
|
4
|
+
export declare const INIT_PROJECT_TYPE_CHOICES: {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
/**
|
|
9
|
+
* What is wrong with a project name, in `init`'s words (`hint` is the terminal's extra line), or null.
|
|
10
|
+
* The allowlist prevents filesystem issues and Handlebars template injection (SEC-004.1). The rule lives
|
|
11
|
+
* in the page's `ui/route.js`, which checks the name as it is typed in, so there is one copy (BL-PM-004).
|
|
12
|
+
*/
|
|
13
|
+
export declare const projectNameError: (name: string) => {
|
|
14
|
+
message: string;
|
|
15
|
+
hint?: string;
|
|
16
|
+
} | null;
|
|
17
|
+
/** The four project-context questions, in order; only the first is required. */
|
|
18
|
+
export declare const CONTEXT_QUESTIONS: readonly [{
|
|
19
|
+
readonly key: "whatItDoes";
|
|
20
|
+
readonly message: "What does your project do? (required):";
|
|
21
|
+
readonly required: true;
|
|
22
|
+
readonly when: {
|
|
23
|
+
projectType: string;
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
readonly key: "targetUsers";
|
|
27
|
+
readonly message: "Who are the target users? (Enter to skip):";
|
|
28
|
+
readonly required: false;
|
|
29
|
+
readonly when: {
|
|
30
|
+
projectType: string;
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
readonly key: "expectedScale";
|
|
34
|
+
readonly message: "What's the expected scale? (Enter to skip):";
|
|
35
|
+
readonly required: false;
|
|
36
|
+
readonly when: {
|
|
37
|
+
projectType: string;
|
|
38
|
+
};
|
|
39
|
+
}, {
|
|
40
|
+
readonly key: "constraints";
|
|
41
|
+
readonly message: "Any key constraints or requirements? (Enter to skip):";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly when: {
|
|
44
|
+
projectType: string;
|
|
45
|
+
};
|
|
46
|
+
}];
|
|
47
|
+
export declare const NOT_SPECIFIED = "Not specified \u2014 use your judgment and mark as [ASSUMPTION]";
|
|
48
|
+
/** `init`'s answers; a context answer left empty becomes NOT_SPECIFIED. */
|
|
49
|
+
export interface InitAnswers extends AddSpecsAnswers {
|
|
50
|
+
whatItDoes: string;
|
|
51
|
+
targetUsers: string;
|
|
52
|
+
expectedScale: string;
|
|
53
|
+
constraints: string;
|
|
54
|
+
}
|
|
55
|
+
/** The `generateSpecs()` options `init` builds from the project name and the answers. */
|
|
56
|
+
export declare function initOptions(targetDir: string, projectName: string, answers: InitAnswers, specsName?: string): SpecGeneratorOptions;
|
|
57
|
+
//# sourceMappingURL=initQuestions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initQuestions.d.ts","sourceRoot":"","sources":["../../src/utils/initQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAwB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMvD,qCAAqC;AACrC,eAAO,MAAM,yBAAyB;;;GAAqD,CAAC;AAE5F;;;;GAIG;AAEH,eAAO,MAAQ,gBAAgB,SAAgE,MAAM,KAAK;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAM,CAAC;AAItJ,gFAAgF;AAChF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKpB,CAAC;AAEX,eAAO,MAAM,aAAa,oEAA+D,CAAC;AAE1F,2EAA2E;AAC3E,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,SAAW,GAAG,oBAAoB,CAmBpI"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NOT_SPECIFIED = exports.CONTEXT_QUESTIONS = exports.projectNameError = exports.INIT_PROJECT_TYPE_CHOICES = void 0;
|
|
4
|
+
exports.initOptions = initOptions;
|
|
5
|
+
const addSpecsQuestions_1 = require("./addSpecsQuestions");
|
|
6
|
+
// What only `specpilot init` asks, and how its answers become generator options: one copy, used by the
|
|
7
|
+
// command's inquirer prompts and by `specpilot serve`'s new-project route (BL-075, BL-PM-003,
|
|
8
|
+
// ARCH-003.22). The lists `init` shares with `add-specs` are in addSpecsQuestions.ts.
|
|
9
|
+
/** `init` lists Greenfield first. */
|
|
10
|
+
exports.INIT_PROJECT_TYPE_CHOICES = [addSpecsQuestions_1.PROJECT_TYPE_CHOICES[1], addSpecsQuestions_1.PROJECT_TYPE_CHOICES[0]];
|
|
11
|
+
/**
|
|
12
|
+
* What is wrong with a project name, in `init`'s words (`hint` is the terminal's extra line), or null.
|
|
13
|
+
* The allowlist prevents filesystem issues and Handlebars template injection (SEC-004.1). The rule lives
|
|
14
|
+
* in the page's `ui/route.js`, which checks the name as it is typed in, so there is one copy (BL-PM-004).
|
|
15
|
+
*/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
17
|
+
exports.projectNameError = require('../../ui/route.js').projectNameError;
|
|
18
|
+
/** `specpilot serve` asks the context questions only for Greenfield: `init` writes them nowhere for Brownfield (BL-082). */
|
|
19
|
+
const GREENFIELD_ONLY = { projectType: 'greenfield' };
|
|
20
|
+
/** The four project-context questions, in order; only the first is required. */
|
|
21
|
+
exports.CONTEXT_QUESTIONS = [
|
|
22
|
+
{ key: 'whatItDoes', message: 'What does your project do? (required):', required: true, when: GREENFIELD_ONLY },
|
|
23
|
+
{ key: 'targetUsers', message: 'Who are the target users? (Enter to skip):', required: false, when: GREENFIELD_ONLY },
|
|
24
|
+
{ key: 'expectedScale', message: 'What\'s the expected scale? (Enter to skip):', required: false, when: GREENFIELD_ONLY },
|
|
25
|
+
{ key: 'constraints', message: 'Any key constraints or requirements? (Enter to skip):', required: false, when: GREENFIELD_ONLY },
|
|
26
|
+
];
|
|
27
|
+
exports.NOT_SPECIFIED = 'Not specified — use your judgment and mark as [ASSUMPTION]';
|
|
28
|
+
/** The `generateSpecs()` options `init` builds from the project name and the answers. */
|
|
29
|
+
function initOptions(targetDir, projectName, answers, specsName = '.specs') {
|
|
30
|
+
return {
|
|
31
|
+
projectName,
|
|
32
|
+
language: answers.language,
|
|
33
|
+
framework: answers.framework,
|
|
34
|
+
targetDir,
|
|
35
|
+
specsName,
|
|
36
|
+
author: answers.handle,
|
|
37
|
+
ide: answers.ide,
|
|
38
|
+
mode: 'new',
|
|
39
|
+
projectType: answers.projectType,
|
|
40
|
+
apiParadigm: answers.apiParadigm,
|
|
41
|
+
projectContext: {
|
|
42
|
+
whatItDoes: answers.whatItDoes || exports.NOT_SPECIFIED,
|
|
43
|
+
targetUsers: answers.targetUsers || exports.NOT_SPECIFIED,
|
|
44
|
+
expectedScale: answers.expectedScale || exports.NOT_SPECIFIED,
|
|
45
|
+
constraints: answers.constraints || exports.NOT_SPECIFIED,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=initQuestions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initQuestions.js","sourceRoot":"","sources":["../../src/utils/initQuestions.ts"],"names":[],"mappings":";;;AAuCA,kCAmBC;AA1DD,2DAA4E;AAG5E,uGAAuG;AACvG,8FAA8F;AAC9F,sFAAsF;AAEtF,qCAAqC;AACxB,QAAA,yBAAyB,GAAG,CAAC,wCAAoB,CAAC,CAAC,CAAC,EAAE,wCAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5F;;;;GAIG;AACH,8DAA8D;AAC/C,wBAAgB,GAAK,OAAO,CAAC,mBAAmB,CAAsF,kBAAC;AAEtJ,4HAA4H;AAC5H,MAAM,eAAe,GAAG,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACtD,gFAAgF;AACnE,QAAA,iBAAiB,GAAG;IAC/B,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,wCAAwC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE;IAC/G,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,4CAA4C,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE;IACrH,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,8CAA8C,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE;IACzH,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,uDAAuD,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE;CACxH,CAAC;AAEE,QAAA,aAAa,GAAG,4DAA4D,CAAC;AAU1F,yFAAyF;AACzF,SAAgB,WAAW,CAAC,SAAiB,EAAE,WAAmB,EAAE,OAAoB,EAAE,SAAS,GAAG,QAAQ;IAC5G,OAAO;QACL,WAAW;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS;QACT,SAAS;QACT,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE;YACd,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,qBAAa;YAC/C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,qBAAa;YACjD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,qBAAa;YACrD,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,qBAAa;SAClD;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -47,6 +47,8 @@ export declare function removeEntry(entries: RegistryEntry[], path: string): Reg
|
|
|
47
47
|
export declare const MAX_PATH_LENGTH = 4096;
|
|
48
48
|
/** Shape of a `{path}` body, checked before the lock. Null when fine. */
|
|
49
49
|
export declare function pathShapeError(body: unknown): string | null;
|
|
50
|
+
/** `checkOpenPath()`'s refusal of the home folder and of a file-system root. */
|
|
51
|
+
export declare const HOME_OR_ROOT_ERROR = "SpecPilot does not open your home folder or the root of a drive.";
|
|
50
52
|
export type OpenCheck = {
|
|
51
53
|
root: string;
|
|
52
54
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectRegistry.d.ts","sourceRoot":"","sources":["../../src/utils/projectRegistry.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,aAAa;IAC5B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,8GAA8G;AAC9G,eAAO,MAAM,Y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,EAAE,GAAG,EAAE,IAAI,GAAG,aAAa,EAAE,CAW9F;AAED,6GAA6G;AAC7G,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,IAAI,CAG1F;AAED,uCAAuC;AACvC,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAS3D;AAED,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,qEAAqE,CAAC;AAErG,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElG;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAgCrF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_PATH_LENGTH = exports.MAX_PROJECTS = exports.MAX_REGISTRY_ENTRIES = void 0;
|
|
3
|
+
exports.HOME_OR_ROOT_ERROR = exports.MAX_PATH_LENGTH = exports.MAX_PROJECTS = exports.MAX_REGISTRY_ENTRIES = void 0;
|
|
4
4
|
exports.homeDir = homeDir;
|
|
5
5
|
exports.registryPath = registryPath;
|
|
6
6
|
exports.readRegistry = readRegistry;
|
|
@@ -191,6 +191,8 @@ function pathShapeError(body) {
|
|
|
191
191
|
return '"path" must not contain a NUL character.';
|
|
192
192
|
return null;
|
|
193
193
|
}
|
|
194
|
+
/** `checkOpenPath()`'s refusal of the home folder and of a file-system root. */
|
|
195
|
+
exports.HOME_OR_ROOT_ERROR = 'SpecPilot does not open your home folder or the root of a drive.';
|
|
194
196
|
/**
|
|
195
197
|
* The add route's path rule, in one place: `~` expanded against `home`, absolute, realpath-resolved,
|
|
196
198
|
* a directory, not the home folder, not a file-system root, not a served root. Makes no call on the
|
|
@@ -224,7 +226,7 @@ function checkOpenPath(input, roots, home) {
|
|
|
224
226
|
realHome = home;
|
|
225
227
|
}
|
|
226
228
|
if (root === realHome || (0, path_1.parse)(root).root === root)
|
|
227
|
-
return { status: 422, error:
|
|
229
|
+
return { status: 422, error: exports.HOME_OR_ROOT_ERROR };
|
|
228
230
|
const served = roots.findIndex(r => {
|
|
229
231
|
try {
|
|
230
232
|
return (0, fs_1.realpathSync)(r) === root;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectRegistry.js","sourceRoot":"","sources":["../../src/utils/projectRegistry.ts"],"names":[],"mappings":";;;AA8BA,0BAEC;AAGD,oCAEC;AAoDD,oCAmBC;AAOD,sCAqBC;AAGD,kCAEC;AAGD,kCAWC;AAGD,kCAGC;AAMD,wCASC;
|
|
1
|
+
{"version":3,"file":"projectRegistry.js","sourceRoot":"","sources":["../../src/utils/projectRegistry.ts"],"names":[],"mappings":";;;AA8BA,0BAEC;AAGD,oCAEC;AAoDD,oCAmBC;AAOD,sCAqBC;AAGD,kCAEC;AAGD,kCAWC;AAGD,kCAGC;AAMD,wCASC;AAYD,sCAgCC;AA5ND,2BAAmJ;AACnJ,mCAAqC;AACrC,+BAAwD;AACxD,2BAA6B;AAc7B,2EAA2E;AAC9D,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAEvC,8GAA8G;AACjG,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B,MAAM,OAAO,GAAG,CAAC,CAAC;AAElB;;;;GAIG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAA,YAAO,GAAE,CAA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C;IACpE,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,0BAAkB,EAAE,CAAC;IACtG,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;QACjC,IAAI,CAAC;YACH,OAAO,IAAA,iBAAY,EAAC,CAAC,CAAC,KAAK,IAAI,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,IAAI,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,+BAA+B,MAAM,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACjH,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
description: string;
|
|
5
|
-
body: string;
|
|
6
|
-
argumentHint?: string;
|
|
7
|
-
allowedTools?: string[];
|
|
8
|
-
}
|
|
1
|
+
import { SlashCommand, SLASH_COMMANDS } from '../core/slashCommands';
|
|
2
|
+
export { SLASH_COMMANDS };
|
|
3
|
+
export type { SlashCommand };
|
|
9
4
|
/** A command file `refreshCommands()` left as it was, and why. */
|
|
10
5
|
export interface KeptCommand {
|
|
11
6
|
name: string;
|
|
@@ -18,11 +13,6 @@ export interface CommandRefresh {
|
|
|
18
13
|
updated: string[];
|
|
19
14
|
kept: KeptCommand[];
|
|
20
15
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Commands to generate. Populated one command at a time by CS-080 through
|
|
23
|
-
* CS-087.
|
|
24
|
-
*/
|
|
25
|
-
export declare const SLASH_COMMANDS: SlashCommand[];
|
|
26
16
|
/**
|
|
27
17
|
* SHA-256 of every command file a released SpecPilot generated, per target path, oldest first.
|
|
28
18
|
* v2.2.0 was the first release to write command files. `refreshCommands()` replaces a file only when
|
|
@@ -56,10 +46,6 @@ export declare class SlashCommandGenerator {
|
|
|
56
46
|
* Returns false, writing nothing, if the file no longer holds `before` (an editor saved meanwhile).
|
|
57
47
|
*/
|
|
58
48
|
private replace;
|
|
59
|
-
private resolveTarget;
|
|
60
49
|
private write;
|
|
61
|
-
private claudeFrontmatter;
|
|
62
|
-
private simpleFrontmatter;
|
|
63
|
-
private copilotFrontmatter;
|
|
64
50
|
}
|
|
65
51
|
//# sourceMappingURL=slashCommandGenerator.d.ts.map
|
|
@@ -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,OAAO,EAAE,YAAY,EAAE,cAAc,EAAiB,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,CAAC;AAG7B,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,mBAAmB,GAAG,eAAe,GAAG,oBAAoB,CAAC;CACnF;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,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