specpilot 2.3.0 → 2.5.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 +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +5 -1
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/backfill.js +20 -7
- package/dist/commands/backfill.js.map +1 -1
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +5 -3
- 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 +363 -37
- package/dist/utils/slashCommandGenerator.js.map +1 -1
- package/dist/utils/specArchiver.d.ts +22 -0
- package/dist/utils/specArchiver.d.ts.map +1 -1
- package/dist/utils/specArchiver.js +121 -26
- 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 +4 -4
- package/dist/utils/specBackfiller.js.map +1 -1
- package/dist/utils/specReader.d.ts +21 -0
- package/dist/utils/specReader.d.ts.map +1 -1
- package/dist/utils/specReader.js +26 -3
- package/dist/utils/specReader.js.map +1 -1
- package/dist/utils/specServer.d.ts +5 -0
- package/dist/utils/specServer.d.ts.map +1 -1
- package/dist/utils/specServer.js +89 -3
- package/dist/utils/specServer.js.map +1 -1
- package/dist/utils/specValidator.d.ts +3 -1
- package/dist/utils/specValidator.d.ts.map +1 -1
- package/dist/utils/specValidator.js +44 -11
- package/dist/utils/specValidator.js.map +1 -1
- package/dist/utils/taskMover.d.ts +50 -0
- package/dist/utils/taskMover.d.ts.map +1 -0
- package/dist/utils/taskMover.js +131 -0
- package/dist/utils/taskMover.js.map +1 -0
- package/package.json +1 -1
- package/ui/app.css +7 -0
- package/ui/app.js +70 -2
- package/ui/index.html +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SlashCommandGenerator = exports.SLASH_COMMANDS = void 0;
|
|
3
|
+
exports.SlashCommandGenerator = exports.KNOWN_COMMAND_HASHES = exports.SLASH_COMMANDS = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
4
5
|
const path_1 = require("path");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
/**
|
|
@@ -178,34 +179,125 @@ archive_prompts() {
|
|
|
178
179
|
local file=".specs/development/prompts.md"
|
|
179
180
|
local archive=".specs/development/prompts-archive.md"
|
|
180
181
|
[ -f "$file" ] || return 0
|
|
181
|
-
local total
|
|
182
|
-
total=$(wc -l < "$file")
|
|
183
|
-
if [ "$total" -le "$PROMPTS_LINE_LIMIT" ]; then return 0; fi
|
|
184
|
-
|
|
185
|
-
# Anchor on "## Latest Entries" so boilerplate (Re-Anchor Prompt, etc.) is never
|
|
186
|
-
# mistaken for archivable log content; fall back to front-matter close, then line 0.
|
|
187
|
-
local anchor_line
|
|
188
|
-
anchor_line=$(grep -n '^## Latest Entries' "$file" | head -1 | cut -d: -f1)
|
|
189
|
-
if [ -z "$anchor_line" ]; then
|
|
190
|
-
if [ "$(sed -n '1p' "$file")" = "---" ]; then
|
|
191
|
-
anchor_line=$(awk 'NR>1 && $0=="---" {print NR; exit}' "$file")
|
|
192
|
-
else
|
|
193
|
-
anchor_line=0
|
|
194
|
-
fi
|
|
195
|
-
fi
|
|
196
|
-
local body_start=$((anchor_line + 1))
|
|
197
|
-
local body_lines=$((total - anchor_line))
|
|
198
|
-
local keep=$((PROMPTS_KEEP_LINES - anchor_line))
|
|
199
|
-
if [ "$keep" -lt 50 ]; then keep=50; fi
|
|
200
|
-
if [ "$body_lines" -le "$keep" ]; then return 0; fi
|
|
201
|
-
|
|
202
|
-
local archive_count=$((body_lines - keep))
|
|
203
|
-
local archive_end=$((body_start + archive_count - 1))
|
|
204
182
|
|
|
205
|
-
|
|
206
|
-
|
|
183
|
+
# Mirrors the CLI's planPromptsArchive() line for line. The log is the list under
|
|
184
|
+
# "## Latest Entries", else the table under "## Prompt History". Each entry's date is the
|
|
185
|
+
# last "Month D, YYYY", "Mon. D, YYYY" or "YYYY-MM-DD" in it (a table row: its Date cell).
|
|
186
|
+
# All dated entries must run one way; the oldest whole entries then move until the file
|
|
187
|
+
# is within PROMPTS_KEEP_LINES, keeping at least one. Line counts use the CLI's arithmetic
|
|
188
|
+
# (wc -l + 1). Prints "MOVE <first> <last> <header>" (1-based lines; header 0 for a list),
|
|
189
|
+
# "REFUSE <reason>", or nothing.
|
|
190
|
+
local plan
|
|
191
|
+
plan=$(LC_ALL=C awk -v total="$(wc -l < "$file")" -v limit="$PROMPTS_LINE_LIMIT" -v keep="$PROMPTS_KEEP_LINES" '
|
|
192
|
+
function trim(s) { sub(/^[ \\t\\r]+/, "", s); sub(/[ \\t\\r]+$/, "", s); return s }
|
|
193
|
+
function word(c) { return c ~ /[A-Za-z0-9_]/ }
|
|
194
|
+
function iso(k) { return sprintf("%04d-%02d-%02d", int(k / 10000), int(k / 100) % 100, k % 100) }
|
|
195
|
+
function lastdate(s, key, pos, a, b, t, p, m, y, mo, d) {
|
|
196
|
+
key = 0; pos = 0
|
|
197
|
+
while (match(substr(s, pos + 1), /(January|February|March|April|May|June|July|August|September|October|November|December|Sept|Jan|Feb|Mar|Apr|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\.? [0-9][0-9]?, [0-9][0-9][0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/)) {
|
|
198
|
+
a = pos + RSTART; b = a + RLENGTH; t = substr(s, a, RLENGTH)
|
|
199
|
+
# a > 1 guard: on macOS awk substr(s, 0, 1) returns the first character, not ""
|
|
200
|
+
if ((a > 1 && word(substr(s, a - 1, 1))) || word(substr(s, b, 1))) { pos = a; continue }
|
|
201
|
+
if (t ~ /^[0-9]/) { y = substr(t, 1, 4) + 0; mo = substr(t, 6, 2) + 0; d = substr(t, 9, 2) + 0 }
|
|
202
|
+
else { split(t, p, " "); m = p[1]; sub(/\\.$/, "", m); mo = MON[tolower(m)]; d = p[2] + 0; y = p[3] + 0 }
|
|
203
|
+
if (mo >= 1 && mo <= 12 && d >= 1 && d <= 31) key = y * 10000 + mo * 100 + d
|
|
204
|
+
pos = b - 1
|
|
205
|
+
}
|
|
206
|
+
return key
|
|
207
|
+
}
|
|
208
|
+
function excerpt(s, t, i, c, n, out) {
|
|
209
|
+
t = trim(s); n = 0; out = ""
|
|
210
|
+
for (i = 1; i <= length(t); i++) {
|
|
211
|
+
c = substr(t, i, 1)
|
|
212
|
+
if (ORD[c] < 128 || ORD[c] >= 192) n++
|
|
213
|
+
if (n > 60) return "\\"" out "…\\""
|
|
214
|
+
out = out c
|
|
215
|
+
}
|
|
216
|
+
return "\\"" t "\\""
|
|
217
|
+
}
|
|
218
|
+
BEGIN {
|
|
219
|
+
split("january jan february feb march mar april apr may june jun july jul august aug september sept sep october oct november nov december dec", nm, " ")
|
|
220
|
+
split("1 1 2 2 3 3 4 4 5 6 6 7 7 8 8 9 9 9 10 10 11 11 12 12", nv, " ")
|
|
221
|
+
for (i = 1; i <= 24; i++) MON[nm[i]] = nv[i] + 0
|
|
222
|
+
for (i = 1; i < 256; i++) ORD[sprintf("%c", i)] = i
|
|
223
|
+
}
|
|
224
|
+
{ line[NR] = $0; tl[NR] = trim($0) }
|
|
225
|
+
END {
|
|
226
|
+
L = total + 1
|
|
227
|
+
if (L <= limit) exit
|
|
228
|
+
n = 0; hdr = 0; s = 0
|
|
229
|
+
for (i = 1; i <= NR; i++) if (index(tl[i], "## Latest Entries") == 1) { s = i; break }
|
|
230
|
+
if (s) {
|
|
231
|
+
e = L + 1; for (i = s + 1; i <= NR; i++) if (tl[i] ~ /^## /) { e = i; break }
|
|
232
|
+
cur = 0
|
|
233
|
+
for (i = s + 1; i < e && i <= NR; i++) {
|
|
234
|
+
if (line[i] ~ /^[-*+] /) { n++; st[n] = i; en[n] = i; cur = 1 }
|
|
235
|
+
else if (cur && line[i] ~ /^[ \\t\\r]+[^ \\t\\r]/) en[n] = i
|
|
236
|
+
else cur = 0
|
|
237
|
+
}
|
|
238
|
+
for (k = 1; k <= n; k++) { txt = line[st[k]]; for (i = st[k] + 1; i <= en[k]; i++) txt = txt "\\n" line[i]; dt[k] = lastdate(txt) }
|
|
239
|
+
} else {
|
|
240
|
+
for (i = 1; i <= NR; i++) if (index(tl[i], "## Prompt History") == 1) { s = i; break }
|
|
241
|
+
if (!s) { print "REFUSE development/prompts.md has no \\"## Latest Entries\\" list or \\"## Prompt History\\" table, so there is nothing SpecPilot can archive safely."; exit }
|
|
242
|
+
e = L + 1; for (i = s + 1; i <= NR; i++) if (tl[i] ~ /^## /) { e = i; break }
|
|
243
|
+
for (i = s + 1; i < e - 1 && i < NR; i++) if (tl[i] ~ /^\\|/ && tl[i + 1] ~ /^\\|[ \\t:|-]+$/) { hdr = i; break }
|
|
244
|
+
if (hdr) {
|
|
245
|
+
col = 0; h = tl[hdr]; sub(/^\\|/, "", h); sub(/\\|$/, "", h); m = split(h, hc, "|")
|
|
246
|
+
for (j = 1; j <= m; j++) if (tolower(trim(hc[j])) == "date") { col = j; break }
|
|
247
|
+
for (i = hdr + 2; i < e && i <= NR && tl[i] ~ /^\\|/; i++) {
|
|
248
|
+
n++; st[n] = i; en[n] = i
|
|
249
|
+
if (col) { r = tl[i]; sub(/^\\|/, "", r); sub(/\\|$/, "", r); split(r, rc, "|"); dt[n] = lastdate(trim(rc[col])) }
|
|
250
|
+
else dt[n] = lastdate(line[i])
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (n < 2) exit
|
|
255
|
+
dir = 0; ps = 0; pd = 0
|
|
256
|
+
for (k = 1; k <= n; k++) {
|
|
257
|
+
if (!dt[k]) continue
|
|
258
|
+
if (ps && dt[k] != pd) {
|
|
259
|
+
step = dt[k] > pd ? 1 : -1
|
|
260
|
+
if (!dir) dir = step
|
|
261
|
+
else if (step != dir) {
|
|
262
|
+
print "REFUSE SpecPilot cannot tell which development/prompts.md entries are oldest, because their dates run both ways: " excerpt(line[ps]) " (" iso(pd) ") comes right before " excerpt(line[st[k]]) " (" iso(dt[k]) ") in a log that otherwise runs " (dir < 0 ? "newest first" : "oldest first") ". Put those entries in order and run it again."
|
|
263
|
+
exit
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
ps = st[k]; pd = dt[k]
|
|
267
|
+
}
|
|
268
|
+
if (!dir) { print "REFUSE SpecPilot cannot tell which development/prompts.md entries are oldest: fewer than two entries carry different dates."; exit }
|
|
269
|
+
for (k = 1; k < n; k++) {
|
|
270
|
+
if (dir < 0) { a = st[n - k + 1]; b = en[n] } else { a = st[1]; b = en[k] }
|
|
271
|
+
if (L - (b - a + 1) <= keep) break
|
|
272
|
+
}
|
|
273
|
+
print "MOVE", a, b, hdr
|
|
274
|
+
}' "$file")
|
|
275
|
+
[ -n "$plan" ] || return 0
|
|
276
|
+
case "$plan" in
|
|
277
|
+
REFUSE\\ *) echo "Not archived: \${plan#REFUSE }"; return 0 ;;
|
|
278
|
+
esac
|
|
279
|
+
local kind first last header
|
|
280
|
+
read -r kind first last header <<< "$plan"
|
|
281
|
+
|
|
282
|
+
# A file with no line break after its last line, whose moved block reaches that line: the
|
|
283
|
+
# CLI joins lines with "\\n", so the block still ends with a blank line in the archive and the
|
|
284
|
+
# kept file ends, still without a line break, at the line before the block.
|
|
285
|
+
local at_end=0
|
|
286
|
+
if [ -n "$(tail -c 1 "$file")" ] && [ "$last" -eq $(( $(wc -l < "$file") + 1 )) ]; then at_end=1; fi
|
|
287
|
+
{
|
|
288
|
+
echo "## Archived on $(timestamp)"; echo
|
|
289
|
+
if [ "$header" -gt 0 ]; then sed -n "\${header},$((header + 1))p" "$file"; fi
|
|
290
|
+
sed -n "\${first},\${last}p" "$file"
|
|
291
|
+
if [ "$at_end" = 1 ]; then echo; fi
|
|
292
|
+
echo; echo "---"; echo
|
|
293
|
+
} >> "$archive"
|
|
294
|
+
if [ "$at_end" = 1 ]; then
|
|
295
|
+
awk -v n=$((first - 1)) 'NR <= n { printf "%s%s", (NR > 1 ? "\\n" : ""), $0 }' "$file" > "$file.tmp"
|
|
296
|
+
else
|
|
297
|
+
{ sed -n "1,$((first - 1))p" "$file"; sed -n "$((last + 1)),\\$p" "$file"; } > "$file.tmp"
|
|
298
|
+
fi
|
|
207
299
|
mv "$file.tmp" "$file"
|
|
208
|
-
echo "Moved $
|
|
300
|
+
echo "Moved $((last - first + 1)) lines from $file -> $archive"
|
|
209
301
|
}
|
|
210
302
|
|
|
211
303
|
archive_tasks() {
|
|
@@ -389,6 +481,176 @@ After running it:
|
|
|
389
481
|
**Maintenance cost**: unlike the CLI's \`specBackfiller.ts\`, this command has no shared source-of-truth constant to import — its four fingerprint blocks above are a literal copy and must be manually kept in sync whenever \`CLAUDE.md\`/\`copilot-instructions.md\` generation changes (\`buildCriticalMandatesMarkdown()\`, \`buildCodePhilosophyMarkdown()\` in \`ideConfigGenerator.ts\`). If this command's output ever looks stale, check those functions first.`,
|
|
390
482
|
},
|
|
391
483
|
];
|
|
484
|
+
/**
|
|
485
|
+
* SHA-256 of every command file a released SpecPilot generated, per target path, oldest first.
|
|
486
|
+
* v2.2.0 was the first release to write command files. `refreshCommands()` replaces a file only when
|
|
487
|
+
* its bytes hash to one of these (BL-058). Regenerate with `node scripts/command-hashes.js` whenever
|
|
488
|
+
* a command changes; a test fails if the current content of any target is missing.
|
|
489
|
+
*/
|
|
490
|
+
exports.KNOWN_COMMAND_HASHES = {
|
|
491
|
+
'.agent/workflows/specpilot-archive.md': [
|
|
492
|
+
'dea17f5a6cc488bc95be76413f9ce602082a112835e9395be4aee1e8e463164b',
|
|
493
|
+
'c4ebcf051279e98525351ecb08452f71e28eef173311605908939a0b993fc726',
|
|
494
|
+
'50beaa5de3eaf5a9960ee775e5b9e694998902886d488c30bbdcd252e189214a',
|
|
495
|
+
'4828517e26559b39ec143269a1ddcdd2909eeb2044a97824396a6b91d8ad23c1',
|
|
496
|
+
],
|
|
497
|
+
'.agent/workflows/specpilot-backfill.md': [
|
|
498
|
+
'1ea360060ab8356bc58e5cde5415ddbf0e3825162f58d1f7c7b7476d894a8737',
|
|
499
|
+
],
|
|
500
|
+
'.agent/workflows/specpilot-reanchor.md': [
|
|
501
|
+
'd1f606a725e98f320735b6fa87991a9b2c8cad7ecca750b44e054f079f746b49',
|
|
502
|
+
],
|
|
503
|
+
'.agent/workflows/specpilot-refine.md': [
|
|
504
|
+
'08d7e7a6491f7928b6511322039e05d4d1b594075753f1e9046518dfa5b20596',
|
|
505
|
+
],
|
|
506
|
+
'.agent/workflows/specpilot-report.md': [
|
|
507
|
+
'ba699b927c96fc7b4e9714a4021837a8bdb39cf5fdeb38c03749ae7ee92a4af1',
|
|
508
|
+
],
|
|
509
|
+
'.agent/workflows/specpilot-status.md': [
|
|
510
|
+
'5e5b17110956ad9b061910450ed10337dc82032fbf319e90c63a0884f1d89102',
|
|
511
|
+
],
|
|
512
|
+
'.agent/workflows/specpilot-sync.md': [
|
|
513
|
+
'1da5cdd9a0ec55d48c675434751bd60a874627c5954e9708925a388d9b5fe366',
|
|
514
|
+
],
|
|
515
|
+
'.agent/workflows/specpilot-validate.md': [
|
|
516
|
+
'13094f8c85dfa06fdcc12ee1ae0ee795a1145f2d4aa8e7bff3ba289c0f6b2721',
|
|
517
|
+
],
|
|
518
|
+
'.claude/commands/specpilot-archive.md': [
|
|
519
|
+
'37bfbac4c2632512de5d0e3e3a68e0904d8cce8cdd9925f53432cdb3066dbe51',
|
|
520
|
+
'3f3e121a9da5cda256f0fcbf3bbd92590cc211d3e67ee59a834c58d6abb589ef',
|
|
521
|
+
'82fa25d0986ba33c240a8817670d5733b353cdc19c0a102b4b29245c348634e0',
|
|
522
|
+
'4ece400213565ec40fdce7e4767f984ee352ddb08cafac35cdaf4731edffcbe7',
|
|
523
|
+
],
|
|
524
|
+
'.claude/commands/specpilot-backfill.md': [
|
|
525
|
+
'16c9c26b3e63b6e77067dab0037cb49d51d344e9bf392a431f09f7918ee3c813',
|
|
526
|
+
],
|
|
527
|
+
'.claude/commands/specpilot-reanchor.md': [
|
|
528
|
+
'd1f606a725e98f320735b6fa87991a9b2c8cad7ecca750b44e054f079f746b49',
|
|
529
|
+
],
|
|
530
|
+
'.claude/commands/specpilot-refine.md': [
|
|
531
|
+
'acd266d3c551a42b8a68ab90cef561de58b3ec0fe3a37ebbbd734298d320b471',
|
|
532
|
+
],
|
|
533
|
+
'.claude/commands/specpilot-report.md': [
|
|
534
|
+
'ba699b927c96fc7b4e9714a4021837a8bdb39cf5fdeb38c03749ae7ee92a4af1',
|
|
535
|
+
],
|
|
536
|
+
'.claude/commands/specpilot-status.md': [
|
|
537
|
+
'5e5b17110956ad9b061910450ed10337dc82032fbf319e90c63a0884f1d89102',
|
|
538
|
+
],
|
|
539
|
+
'.claude/commands/specpilot-sync.md': [
|
|
540
|
+
'1da5cdd9a0ec55d48c675434751bd60a874627c5954e9708925a388d9b5fe366',
|
|
541
|
+
],
|
|
542
|
+
'.claude/commands/specpilot-validate.md': [
|
|
543
|
+
'c4bc7798f2eef780257a6b91652c4222db3e6b4566da85fc1c2d4552032db269',
|
|
544
|
+
],
|
|
545
|
+
'.codex/prompts/specpilot-archive.md': [
|
|
546
|
+
'dea17f5a6cc488bc95be76413f9ce602082a112835e9395be4aee1e8e463164b',
|
|
547
|
+
'c4ebcf051279e98525351ecb08452f71e28eef173311605908939a0b993fc726',
|
|
548
|
+
'50beaa5de3eaf5a9960ee775e5b9e694998902886d488c30bbdcd252e189214a',
|
|
549
|
+
'4828517e26559b39ec143269a1ddcdd2909eeb2044a97824396a6b91d8ad23c1',
|
|
550
|
+
],
|
|
551
|
+
'.codex/prompts/specpilot-backfill.md': [
|
|
552
|
+
'1ea360060ab8356bc58e5cde5415ddbf0e3825162f58d1f7c7b7476d894a8737',
|
|
553
|
+
],
|
|
554
|
+
'.codex/prompts/specpilot-reanchor.md': [
|
|
555
|
+
'd1f606a725e98f320735b6fa87991a9b2c8cad7ecca750b44e054f079f746b49',
|
|
556
|
+
],
|
|
557
|
+
'.codex/prompts/specpilot-refine.md': [
|
|
558
|
+
'08d7e7a6491f7928b6511322039e05d4d1b594075753f1e9046518dfa5b20596',
|
|
559
|
+
],
|
|
560
|
+
'.codex/prompts/specpilot-report.md': [
|
|
561
|
+
'ba699b927c96fc7b4e9714a4021837a8bdb39cf5fdeb38c03749ae7ee92a4af1',
|
|
562
|
+
],
|
|
563
|
+
'.codex/prompts/specpilot-status.md': [
|
|
564
|
+
'5e5b17110956ad9b061910450ed10337dc82032fbf319e90c63a0884f1d89102',
|
|
565
|
+
],
|
|
566
|
+
'.codex/prompts/specpilot-sync.md': [
|
|
567
|
+
'1da5cdd9a0ec55d48c675434751bd60a874627c5954e9708925a388d9b5fe366',
|
|
568
|
+
],
|
|
569
|
+
'.codex/prompts/specpilot-validate.md': [
|
|
570
|
+
'13094f8c85dfa06fdcc12ee1ae0ee795a1145f2d4aa8e7bff3ba289c0f6b2721',
|
|
571
|
+
],
|
|
572
|
+
'.cursor/commands/specpilot-archive.md': [
|
|
573
|
+
'dea17f5a6cc488bc95be76413f9ce602082a112835e9395be4aee1e8e463164b',
|
|
574
|
+
'c4ebcf051279e98525351ecb08452f71e28eef173311605908939a0b993fc726',
|
|
575
|
+
'50beaa5de3eaf5a9960ee775e5b9e694998902886d488c30bbdcd252e189214a',
|
|
576
|
+
'4828517e26559b39ec143269a1ddcdd2909eeb2044a97824396a6b91d8ad23c1',
|
|
577
|
+
],
|
|
578
|
+
'.cursor/commands/specpilot-backfill.md': [
|
|
579
|
+
'1ea360060ab8356bc58e5cde5415ddbf0e3825162f58d1f7c7b7476d894a8737',
|
|
580
|
+
],
|
|
581
|
+
'.cursor/commands/specpilot-reanchor.md': [
|
|
582
|
+
'd1f606a725e98f320735b6fa87991a9b2c8cad7ecca750b44e054f079f746b49',
|
|
583
|
+
],
|
|
584
|
+
'.cursor/commands/specpilot-refine.md': [
|
|
585
|
+
'08d7e7a6491f7928b6511322039e05d4d1b594075753f1e9046518dfa5b20596',
|
|
586
|
+
],
|
|
587
|
+
'.cursor/commands/specpilot-report.md': [
|
|
588
|
+
'ba699b927c96fc7b4e9714a4021837a8bdb39cf5fdeb38c03749ae7ee92a4af1',
|
|
589
|
+
],
|
|
590
|
+
'.cursor/commands/specpilot-status.md': [
|
|
591
|
+
'5e5b17110956ad9b061910450ed10337dc82032fbf319e90c63a0884f1d89102',
|
|
592
|
+
],
|
|
593
|
+
'.cursor/commands/specpilot-sync.md': [
|
|
594
|
+
'1da5cdd9a0ec55d48c675434751bd60a874627c5954e9708925a388d9b5fe366',
|
|
595
|
+
],
|
|
596
|
+
'.cursor/commands/specpilot-validate.md': [
|
|
597
|
+
'13094f8c85dfa06fdcc12ee1ae0ee795a1145f2d4aa8e7bff3ba289c0f6b2721',
|
|
598
|
+
],
|
|
599
|
+
'.github/prompts/specpilot-archive.prompt.md': [
|
|
600
|
+
'3b669bfe482b6e36bde07eee44d018ba1f66a5996a6069df4180ff8d367c2046',
|
|
601
|
+
'9e75008c25a6820a7be150732e59ab2fa207594a50e98c5dfcaa8c03dc087094',
|
|
602
|
+
'12345bb6d2367a65bc9f2547b85403e781f3f81af664aa51743e96ca6894bac7',
|
|
603
|
+
'6dc00a9bce104395f819bde397978154aadc8716a8258ad3f5bf23559f94f834',
|
|
604
|
+
],
|
|
605
|
+
'.github/prompts/specpilot-backfill.prompt.md': [
|
|
606
|
+
'df986c946846ce107888b4b21e197fb2c8498c6a32925d2d79e92d3dd39298dc',
|
|
607
|
+
],
|
|
608
|
+
'.github/prompts/specpilot-reanchor.prompt.md': [
|
|
609
|
+
'30f915e1a37a02fe01650a99fd214401d035ad2544207766762b90ab8ede70cf',
|
|
610
|
+
],
|
|
611
|
+
'.github/prompts/specpilot-refine.prompt.md': [
|
|
612
|
+
'2489f0176dbbb452163e2588f5ef7ce8ce397b5032c8989731837f24f1955cb6',
|
|
613
|
+
],
|
|
614
|
+
'.github/prompts/specpilot-report.prompt.md': [
|
|
615
|
+
'6e72be94c576ac7000896d68e1509d21f4218e1a917ce90b1debd252fdfaddd5',
|
|
616
|
+
],
|
|
617
|
+
'.github/prompts/specpilot-status.prompt.md': [
|
|
618
|
+
'4620467bfeb8ee2cd31b0b2f45564c41290746332804a2b6de6daa1b25519a1d',
|
|
619
|
+
],
|
|
620
|
+
'.github/prompts/specpilot-sync.prompt.md': [
|
|
621
|
+
'ef134e6db6cdfb1adcde442c2f4221503e73fbdd2d48172f5ee0f7e3929eee83',
|
|
622
|
+
],
|
|
623
|
+
'.github/prompts/specpilot-validate.prompt.md': [
|
|
624
|
+
'265ac29d8c2cdf8688dfbfac6b67c266ef1a477ffb608e5222679595bff8d32a',
|
|
625
|
+
],
|
|
626
|
+
'.windsurf/workflows/specpilot-archive.md': [
|
|
627
|
+
'dea17f5a6cc488bc95be76413f9ce602082a112835e9395be4aee1e8e463164b',
|
|
628
|
+
'c4ebcf051279e98525351ecb08452f71e28eef173311605908939a0b993fc726',
|
|
629
|
+
'50beaa5de3eaf5a9960ee775e5b9e694998902886d488c30bbdcd252e189214a',
|
|
630
|
+
'4828517e26559b39ec143269a1ddcdd2909eeb2044a97824396a6b91d8ad23c1',
|
|
631
|
+
],
|
|
632
|
+
'.windsurf/workflows/specpilot-backfill.md': [
|
|
633
|
+
'1ea360060ab8356bc58e5cde5415ddbf0e3825162f58d1f7c7b7476d894a8737',
|
|
634
|
+
],
|
|
635
|
+
'.windsurf/workflows/specpilot-reanchor.md': [
|
|
636
|
+
'd1f606a725e98f320735b6fa87991a9b2c8cad7ecca750b44e054f079f746b49',
|
|
637
|
+
],
|
|
638
|
+
'.windsurf/workflows/specpilot-refine.md': [
|
|
639
|
+
'08d7e7a6491f7928b6511322039e05d4d1b594075753f1e9046518dfa5b20596',
|
|
640
|
+
],
|
|
641
|
+
'.windsurf/workflows/specpilot-report.md': [
|
|
642
|
+
'ba699b927c96fc7b4e9714a4021837a8bdb39cf5fdeb38c03749ae7ee92a4af1',
|
|
643
|
+
],
|
|
644
|
+
'.windsurf/workflows/specpilot-status.md': [
|
|
645
|
+
'5e5b17110956ad9b061910450ed10337dc82032fbf319e90c63a0884f1d89102',
|
|
646
|
+
],
|
|
647
|
+
'.windsurf/workflows/specpilot-sync.md': [
|
|
648
|
+
'1da5cdd9a0ec55d48c675434751bd60a874627c5954e9708925a388d9b5fe366',
|
|
649
|
+
],
|
|
650
|
+
'.windsurf/workflows/specpilot-validate.md': [
|
|
651
|
+
'13094f8c85dfa06fdcc12ee1ae0ee795a1145f2d4aa8e7bff3ba289c0f6b2721',
|
|
652
|
+
],
|
|
653
|
+
};
|
|
392
654
|
/**
|
|
393
655
|
* Generates per-IDE slash/workflow command files from SLASH_COMMANDS.
|
|
394
656
|
* Parallel to IdeConfigGenerator — each IDE gets its own directory, file
|
|
@@ -410,24 +672,85 @@ class SlashCommandGenerator {
|
|
|
410
672
|
}
|
|
411
673
|
}
|
|
412
674
|
/**
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
675
|
+
* Brings an existing project's command files for the given IDE up to date (BL-058): adds missing
|
|
676
|
+
* files, replaces files whose bytes match a known SpecPilot version, and keeps everything else
|
|
677
|
+
* untouched. In dry-run, reports the same outcomes and writes nothing.
|
|
416
678
|
*/
|
|
417
|
-
|
|
679
|
+
refreshCommands(projectDir, ide, dryRun, commands = exports.SLASH_COMMANDS, known = exports.KNOWN_COMMAND_HASHES) {
|
|
418
680
|
const key = ide.toLowerCase();
|
|
419
|
-
const
|
|
681
|
+
const result = { added: [], updated: [], kept: [] };
|
|
420
682
|
for (const command of commands) {
|
|
421
683
|
const target = this.resolveTarget(key, command);
|
|
684
|
+
const path = `${target.dir}/${target.fileName}`;
|
|
422
685
|
const filePath = (0, path_1.join)(projectDir, ...target.dir.split('/'), target.fileName);
|
|
423
|
-
|
|
686
|
+
let st;
|
|
687
|
+
try {
|
|
688
|
+
st = (0, fs_1.lstatSync)(filePath);
|
|
689
|
+
}
|
|
690
|
+
catch {
|
|
691
|
+
result.added.push(command.name);
|
|
692
|
+
if (!dryRun) {
|
|
693
|
+
(0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
|
|
694
|
+
(0, fs_1.writeFileSync)(filePath, target.content, { flag: 'wx' });
|
|
695
|
+
}
|
|
696
|
+
continue;
|
|
697
|
+
}
|
|
698
|
+
if (!st.isFile()) {
|
|
699
|
+
result.kept.push({ name: command.name, path, reason: st.isSymbolicLink() ? 'symbolic link' : 'not a regular file' });
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
const bytes = (0, fs_1.readFileSync)(filePath);
|
|
703
|
+
if (bytes.equals(Buffer.from(target.content, 'utf-8')))
|
|
704
|
+
continue;
|
|
705
|
+
const hashes = known[path] ?? [];
|
|
706
|
+
if (hashes.includes(sha256(bytes))) {
|
|
707
|
+
if (dryRun || this.replace(filePath, st.mode, bytes, target.content)) {
|
|
708
|
+
result.updated.push(command.name);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
result.kept.push({ name: command.name, path, reason: 'modified' });
|
|
712
|
+
}
|
|
424
713
|
continue;
|
|
425
|
-
added.push(command.name);
|
|
426
|
-
if (!dryRun) {
|
|
427
|
-
this.write(projectDir, target.dir, target.fileName, target.content);
|
|
428
714
|
}
|
|
715
|
+
// latin1 maps each byte to one char, so only CR LF pairs change
|
|
716
|
+
const lf = Buffer.from(bytes.toString('latin1').replace(/\r\n/g, '\n'), 'latin1');
|
|
717
|
+
const crlf = !lf.equals(bytes) && hashes.includes(sha256(lf));
|
|
718
|
+
result.kept.push({ name: command.name, path, reason: crlf ? 'CRLF line endings' : 'modified' });
|
|
719
|
+
}
|
|
720
|
+
return result;
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Replaces `filePath` with `content`: temp file in the same folder, fsync, same mode, rename.
|
|
724
|
+
* Returns false, writing nothing, if the file no longer holds `before` (an editor saved meanwhile).
|
|
725
|
+
*/
|
|
726
|
+
replace(filePath, mode, before, content) {
|
|
727
|
+
const tmp = (0, path_1.join)((0, path_1.dirname)(filePath), `.${(0, path_1.basename)(filePath)}.${(0, crypto_1.randomBytes)(6).toString('hex')}.tmp`);
|
|
728
|
+
try {
|
|
729
|
+
const fd = (0, fs_1.openSync)(tmp, 'wx', mode & 0o777);
|
|
730
|
+
try {
|
|
731
|
+
(0, fs_1.writeSync)(fd, content);
|
|
732
|
+
(0, fs_1.fsyncSync)(fd);
|
|
733
|
+
}
|
|
734
|
+
finally {
|
|
735
|
+
(0, fs_1.closeSync)(fd);
|
|
736
|
+
}
|
|
737
|
+
(0, fs_1.chmodSync)(tmp, mode & 0o7777);
|
|
738
|
+
if (!(0, fs_1.readFileSync)(filePath).equals(before)) {
|
|
739
|
+
(0, fs_1.unlinkSync)(tmp);
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
(0, fs_1.renameSync)(tmp, filePath);
|
|
743
|
+
return true;
|
|
744
|
+
}
|
|
745
|
+
catch (err) {
|
|
746
|
+
try {
|
|
747
|
+
(0, fs_1.unlinkSync)(tmp);
|
|
748
|
+
}
|
|
749
|
+
catch {
|
|
750
|
+
/* never created, or already renamed */
|
|
751
|
+
}
|
|
752
|
+
throw err;
|
|
429
753
|
}
|
|
430
|
-
return added;
|
|
431
754
|
}
|
|
432
755
|
resolveTarget(ide, command) {
|
|
433
756
|
switch (ide) {
|
|
@@ -467,4 +790,7 @@ class SlashCommandGenerator {
|
|
|
467
790
|
}
|
|
468
791
|
}
|
|
469
792
|
exports.SlashCommandGenerator = SlashCommandGenerator;
|
|
793
|
+
function sha256(bytes) {
|
|
794
|
+
return (0, crypto_1.createHash)('sha256').update(bytes).digest('hex');
|
|
795
|
+
}
|
|
470
796
|
//# sourceMappingURL=slashCommandGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommandGenerator.js","sourceRoot":"","sources":["../../src/utils/slashCommandGenerator.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"slashCommandGenerator.js","sourceRoot":"","sources":["../../src/utils/slashCommandGenerator.ts"],"names":[],"mappings":";;;AAAA,mCAAiD;AACjD,+BAA+C;AAC/C,2BAAqJ;AAyBrJ;;;GAGG;AACU,QAAA,cAAc,GAAmB;IAC5C;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2DAA2D;QACxE,IAAI,EAAE;;;;;;;;8FAQoF;KAC3F;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE;;;;;;wIAM8H;KACrI;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6GAA6G;QAC1H,IAAI,EAAE;;;;;;;;;sOAS4N;KACnO;IACD;QACE,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,0EAA0E;QACvF,IAAI,EAAE;;;;;;;;+HAQqH;KAC5H;IACD;QACE,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,oGAAoG;QACjH,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE;;;;;;;;;;4IAUkI;KACzI;IACD;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,qGAAqG;QAClH,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QAC9B,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ySAiE+R;KACtS;IACD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,qGAAqG;QAClH,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;QACtC,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,CAAC;QACxC,IAAA,kBAAa,EAAC,IAAA,WAAI,EAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAEO,iBAAiB,CAAC,OAAqB;QAC7C,MAAM,KAAK,GAAG,CAAC,gBAAgB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,IAAI,OAAO,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;QAC/E,IAAI,OAAO,CAAC,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1F,OAAO,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;IAC7C,CAAC;IAEO,iBAAiB,CAAC,OAAqB;QAC7C,OAAO,qBAAqB,OAAO,CAAC,WAAW,WAAW,CAAC;IAC7D,CAAC;IAEO,kBAAkB,CAAC,OAAqB;QAC9C,OAAO,kCAAkC,OAAO,CAAC,WAAW,WAAW,CAAC;IAC1E,CAAC;CACF;AA5ID,sDA4IC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -5,8 +5,30 @@ export interface ArchiveEntry {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ArchiveResult {
|
|
7
7
|
entries: ArchiveEntry[];
|
|
8
|
+
/** Files over their limit that archive would not touch, and why (BL-061). */
|
|
9
|
+
refused: {
|
|
10
|
+
file: string;
|
|
11
|
+
reason: string;
|
|
12
|
+
}[];
|
|
8
13
|
dryRun: boolean;
|
|
9
14
|
}
|
|
15
|
+
/** Trim prompts.md to this many total lines after archiving. */
|
|
16
|
+
export declare const PROMPTS_LINE_LIMIT = 100;
|
|
17
|
+
/** The last calendar date in the text as yyyymmdd, or null. No Date objects: no time zone can shift a day. */
|
|
18
|
+
export declare function lastDate(text: string): number | null;
|
|
19
|
+
export type PromptsArchivePlan = {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
tableHeader: string[];
|
|
23
|
+
} | {
|
|
24
|
+
refuse: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/**
|
|
27
|
+
* Decide what \`specpilot archive\` moves out of prompts.md: the contiguous block of oldest entries
|
|
28
|
+
* that brings the file within PROMPTS_KEEP_LINES, a refusal with a plain reason, or null.
|
|
29
|
+
* The validator reports exactly this, so "validate warns" and "archive acts" cannot disagree.
|
|
30
|
+
*/
|
|
31
|
+
export declare function planPromptsArchive(lines: string[]): PromptsArchivePlan;
|
|
10
32
|
export interface CompletedArchivePlan {
|
|
11
33
|
/** Line indices [start, end) moved out of tasks.md. */
|
|
12
34
|
start: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specArchiver.d.ts","sourceRoot":"","sources":["../../src/utils/specArchiver.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"specArchiver.d.ts","sourceRoot":"","sources":["../../src/utils/specArchiver.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,6EAA6E;IAC7E,OAAO,EAAE;QAAE,IA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