specpilot 2.2.4 → 2.4.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.
Files changed (48) hide show
  1. package/README.md +25 -0
  2. package/dist/cli.js +10 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/archive.d.ts.map +1 -1
  5. package/dist/commands/archive.js +5 -1
  6. package/dist/commands/archive.js.map +1 -1
  7. package/dist/commands/serve.d.ts +9 -0
  8. package/dist/commands/serve.d.ts.map +1 -0
  9. package/dist/commands/serve.js +68 -0
  10. package/dist/commands/serve.js.map +1 -0
  11. package/dist/utils/slashCommandGenerator.d.ts.map +1 -1
  12. package/dist/utils/slashCommandGenerator.js +117 -26
  13. package/dist/utils/slashCommandGenerator.js.map +1 -1
  14. package/dist/utils/specArchiver.d.ts +22 -0
  15. package/dist/utils/specArchiver.d.ts.map +1 -1
  16. package/dist/utils/specArchiver.js +121 -26
  17. package/dist/utils/specArchiver.js.map +1 -1
  18. package/dist/utils/specPaths.d.ts +26 -0
  19. package/dist/utils/specPaths.d.ts.map +1 -0
  20. package/dist/utils/specPaths.js +92 -0
  21. package/dist/utils/specPaths.js.map +1 -0
  22. package/dist/utils/specPoller.d.ts +22 -0
  23. package/dist/utils/specPoller.d.ts.map +1 -0
  24. package/dist/utils/specPoller.js +119 -0
  25. package/dist/utils/specPoller.js.map +1 -0
  26. package/dist/utils/specReader.d.ts +21 -0
  27. package/dist/utils/specReader.d.ts.map +1 -1
  28. package/dist/utils/specReader.js +26 -3
  29. package/dist/utils/specReader.js.map +1 -1
  30. package/dist/utils/specServer.d.ts +65 -0
  31. package/dist/utils/specServer.d.ts.map +1 -0
  32. package/dist/utils/specServer.js +345 -0
  33. package/dist/utils/specServer.js.map +1 -0
  34. package/dist/utils/specValidator.d.ts +3 -1
  35. package/dist/utils/specValidator.d.ts.map +1 -1
  36. package/dist/utils/specValidator.js +44 -11
  37. package/dist/utils/specValidator.js.map +1 -1
  38. package/dist/utils/taskMover.d.ts +50 -0
  39. package/dist/utils/taskMover.d.ts.map +1 -0
  40. package/dist/utils/taskMover.js +131 -0
  41. package/dist/utils/taskMover.js.map +1 -0
  42. package/package.json +2 -3
  43. package/ui/app.css +306 -0
  44. package/ui/app.js +408 -0
  45. package/ui/favicon.svg +25 -0
  46. package/ui/index.html +172 -0
  47. package/ui/md.js +81 -0
  48. package/ui/route.js +25 -0
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STALE_ERROR = exports.sha256 = exports.SECTION_HEADINGS = exports.WRITABLE_TASKS_FILE = void 0;
4
+ exports.moveShapeError = moveShapeError;
5
+ exports.planMove = planMove;
6
+ exports.moveTask = moveTask;
7
+ const fs_1 = require("fs");
8
+ const crypto_1 = require("crypto");
9
+ const path_1 = require("path");
10
+ const specReader_1 = require("./specReader");
11
+ const specValidator_1 = require("./specValidator");
12
+ // The one writer behind `specpilot serve` (BL-053, ARCH-003.18, ARCH-004.36). A move removes one
13
+ // line of tasks.md and inserts the identical line elsewhere; every other byte stays as it was.
14
+ /** The write allowlist: exactly one file, separate from what the server may read. */
15
+ exports.WRITABLE_TASKS_FILE = '.specs/planning/tasks.md';
16
+ /** The section headings as tasks.md writes them (what readSpecs() matches). */
17
+ exports.SECTION_HEADINGS = { backlog: 'Backlog', currentSprint: 'Current Sprint', completed: 'Completed' };
18
+ const sha256 = (data) => (0, crypto_1.createHash)('sha256').update(data).digest('hex');
19
+ exports.sha256 = sha256;
20
+ /** Check a request body's shape; returns a plain-words problem or null. */
21
+ function moveShapeError(body) {
22
+ const b = body;
23
+ if (!b || typeof b !== 'object')
24
+ return 'The request must be a JSON object with id, toSection and toIndex.';
25
+ if (typeof b.id !== 'string' || !b.id)
26
+ return 'The request has no task ID.';
27
+ if (b.toSection !== 'backlog' && b.toSection !== 'currentSprint')
28
+ return 'Tasks can only be moved to Backlog or Current Sprint.';
29
+ if (!Number.isInteger(b.toIndex) || b.toIndex < 0)
30
+ return 'The position must be a whole number, 0 or more.';
31
+ return null;
32
+ }
33
+ /** Work out a move on tasks.md content in memory: the new content, or why it cannot be done. */
34
+ function planMove(content, move) {
35
+ const lines = content.split('\n');
36
+ const where = (0, specReader_1.taskRowLines)(content);
37
+ const hits = ['backlog', 'currentSprint', 'completed'].flatMap(sec => (where[sec]?.rows ?? []).map((r, i) => ({ sec, i, line: r.line })).filter((_, i) => where[sec].rows[i].id === move.id));
38
+ if (!hits.length)
39
+ return { ok: false, error: `No task row in planning/tasks.md has the ID ${move.id}.` };
40
+ if (hits.length > 1)
41
+ return { ok: false, error: `${move.id} is on more than one row in planning/tasks.md, so SpecPilot cannot tell which to move.` };
42
+ const hit = hits[0];
43
+ if (hit.sec === 'completed')
44
+ return { ok: false, error: 'Completed rows cannot be moved.' };
45
+ const from = hit.sec;
46
+ const target = where[move.toSection];
47
+ if (!target)
48
+ return { ok: false, error: `planning/tasks.md has no ## ${exports.SECTION_HEADINGS[move.toSection]} section.` };
49
+ if (target.separator === null)
50
+ return { ok: false, error: `${exports.SECTION_HEADINGS[move.toSection]} has no table yet.` };
51
+ const others = target.rows.filter(r => r.line !== hit.line);
52
+ if (move.toIndex > others.length) {
53
+ return { ok: false, error: `Position ${move.toIndex} is past the end of ${exports.SECTION_HEADINGS[move.toSection]}, which would have ${others.length + 1} rows.` };
54
+ }
55
+ if (from === move.toSection && move.toIndex === hit.i)
56
+ return { ok: true, content, from, fromIndex: hit.i, noop: true };
57
+ // Insert before the row now at toIndex, or right after the last row (or the separator).
58
+ const at = move.toIndex < others.length ? others[move.toIndex].line : (others.length ? others[others.length - 1].line : target.separator) + 1;
59
+ const last = lines.length - 1; // with a trailing newline, lines[last] is '' and never a row
60
+ if (hit.line === last || at > last) {
61
+ return { ok: false, error: `This move would change which line ends the file, because planning/tasks.md has no line break after its last line. Add one and try again.` };
62
+ }
63
+ const out = lines.slice();
64
+ const [row] = out.splice(hit.line, 1);
65
+ out.splice(at > hit.line ? at - 1 : at, 0, row);
66
+ return { ok: true, content: out.join('\n'), from, fromIndex: hit.i, noop: false };
67
+ }
68
+ exports.STALE_ERROR = 'planning/tasks.md changed on disk since this page loaded. The move was not made.';
69
+ /**
70
+ * Apply a move to tasks.md on disk if `ifMatch` is its current sha256. Synchronous from the first
71
+ * read to the rename, so nothing else in this process runs in between; the caller's lock queues
72
+ * requests. Writes a temp file in the same folder, fsyncs it, keeps the mode, renames it over.
73
+ */
74
+ function moveTask(root, move, ifMatch) {
75
+ const file = (0, path_1.join)(root, exports.WRITABLE_TASKS_FILE);
76
+ let st;
77
+ try {
78
+ st = (0, fs_1.lstatSync)(file);
79
+ }
80
+ catch {
81
+ return { status: 422, error: 'planning/tasks.md does not exist.' };
82
+ }
83
+ if (st.isSymbolicLink())
84
+ return { status: 422, error: 'planning/tasks.md is a symbolic link, and SpecPilot will not replace it with a regular file.' };
85
+ const before = (0, fs_1.readFileSync)(file);
86
+ if ((0, exports.sha256)(before) !== ifMatch)
87
+ return { status: 409, error: exports.STALE_ERROR };
88
+ const content = before.toString('utf-8');
89
+ // Decoding and re-encoding must give back the same bytes, or the write would alter lines it never moved.
90
+ if (!Buffer.from(content, 'utf-8').equals(before)) {
91
+ return { status: 422, error: 'planning/tasks.md contains bytes that are not valid UTF-8, so SpecPilot cannot move a line without changing others.' };
92
+ }
93
+ const plan = planMove(content, move);
94
+ if (!plan.ok)
95
+ return { status: 422, error: plan.error };
96
+ if (plan.noop)
97
+ return { status: 200, sha256: ifMatch, from: plan.from, fromIndex: plan.fromIndex };
98
+ const was = new Set((0, specValidator_1.tasksChecks)(content));
99
+ const introduced = (0, specValidator_1.tasksChecks)(plan.content).filter(m => !was.has(m));
100
+ if (introduced.length)
101
+ return { status: 422, error: `The move was not made, because \`specpilot validate\` would then report: ${introduced.join(' ')}` };
102
+ const tmp = (0, path_1.join)((0, path_1.dirname)(file), `.tasks.md.${(0, crypto_1.randomBytes)(6).toString('hex')}.tmp`);
103
+ try {
104
+ const fd = (0, fs_1.openSync)(tmp, 'wx', st.mode & 0o777);
105
+ try {
106
+ (0, fs_1.writeSync)(fd, plan.content);
107
+ (0, fs_1.fsyncSync)(fd);
108
+ }
109
+ finally {
110
+ (0, fs_1.closeSync)(fd);
111
+ }
112
+ (0, fs_1.chmodSync)(tmp, st.mode & 0o7777);
113
+ // Last look: an editor may have saved while we were writing.
114
+ if ((0, exports.sha256)((0, fs_1.readFileSync)(file)) !== ifMatch) {
115
+ (0, fs_1.unlinkSync)(tmp);
116
+ return { status: 409, error: exports.STALE_ERROR };
117
+ }
118
+ (0, fs_1.renameSync)(tmp, file);
119
+ }
120
+ catch (err) {
121
+ try {
122
+ (0, fs_1.unlinkSync)(tmp);
123
+ }
124
+ catch {
125
+ /* never created, or already renamed */
126
+ }
127
+ throw err;
128
+ }
129
+ return { status: 200, sha256: (0, exports.sha256)(plan.content), from: plan.from, fromIndex: plan.fromIndex };
130
+ }
131
+ //# sourceMappingURL=taskMover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taskMover.js","sourceRoot":"","sources":["../../src/utils/taskMover.ts"],"names":[],"mappings":";;;AA+BA,wCAOC;AAGD,4BA+BC;AAcD,4BAkDC;AAxID,2BAA2H;AAC3H,mCAAiD;AACjD,+BAAqC;AACrC,6CAA4C;AAC5C,mDAA8C;AAE9C,iGAAiG;AACjG,+FAA+F;AAE/F,qFAAqF;AACxE,QAAA,mBAAmB,GAAG,0BAA0B,CAAC;AAI9D,+EAA+E;AAClE,QAAA,gBAAgB,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAW,CAAC;AAalH,MAAM,MAAM,GAAG,CAAC,IAAqB,EAAU,EAAE,CAAC,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAA5F,QAAA,MAAM,UAAsF;AAEzG,2EAA2E;AAC3E,SAAgB,cAA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AC3C,IAAA,eAAU,EAAC,GAAG,CAAC,CAAC;YAChB,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAW,EAAE,CAAC;QAC7C,CAAC;QACD,IAAA,eAAU,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC;YACH,IAAA,eAAU,EAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,uCAAuC;QACzC,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;AACnG,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specpilot",
3
- "version": "2.2.4",
3
+ "version": "2.4.0",
4
4
  "description": "A CLI tool for initializing specification-driven development projects with flexible, production-ready structures.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "type": "commonjs",
51
51
  "files": [
52
52
  "dist/**/*",
53
+ "ui/**/*",
53
54
  "cli.js",
54
55
  "README.md",
55
56
  "LICENSE"
@@ -61,14 +62,12 @@
61
62
  "dependencies": {
62
63
  "chalk": "^4.1.2",
63
64
  "commander": "^14.0.1",
64
- "fs-extra": "^11.3.2",
65
65
  "handlebars": "^4.7.8",
66
66
  "inquirer": "^12.9.6",
67
67
  "js-yaml": "^4.1.0"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@eslint/js": "^10.0.1",
71
- "@types/fs-extra": "^11.0.4",
72
71
  "@types/inquirer": "^9.0.9",
73
72
  "@types/jest": "^30.0.0",
74
73
  "@types/js-yaml": "^4.0.9",
package/ui/app.css ADDED
@@ -0,0 +1,306 @@
1
+ /* Design system: SpecPilot Local · Developer Tool / IDE · Dark Mode + Minimalism & Swiss (design-system/specpilot-local/MASTER.md) */
2
+ :root{
3
+ --ground:#0f172a;--group:#1b2336;--side:#0b1222;--muted:#272f42;
4
+ --sep:rgba(148,163,184,.16);--sep-2:#475569;
5
+ --label:#f8fafc;--label-2:#cbd5e1;--label-3:#94a3b8;
6
+ --accent:#22c55e;--accent-fill:#22c55e;--accent-soft:rgba(34,197,94,.14);--on-accent:#0f172a;
7
+ --focus:#60a5fa;
8
+ --green:#22c55e;--green-soft:rgba(34,197,94,.14);--green-ink:#4ade80;
9
+ --orange:#f59e0b;--orange-soft:rgba(245,158,11,.14);--orange-ink:#fbbf24;
10
+ --red:#ef4444;--red-soft:rgba(239,68,68,.14);--red-ink:#f87171;
11
+ --violet:#8b5cf6;--violet-soft:rgba(139,92,246,.16);--violet-ink:#c4b5fd;
12
+ --blue:#3b82f6;--blue-soft:rgba(59,130,246,.16);--blue-ink:#93c5fd;
13
+ --hover:rgba(148,163,184,.08);--press:rgba(148,163,184,.14);--sel:rgba(96,165,250,.14);--sel-line:#60a5fa;
14
+ --shadow:none;
15
+ --sans:"IBM Plex Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
16
+ --mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
17
+ --r:4px;--rs:3px;
18
+ --t:200ms;
19
+ color-scheme:dark;
20
+ }
21
+ :root[data-theme="light"]{
22
+ --ground:#f8fafc;--group:#ffffff;--side:#f1f5f9;--muted:#e2e8f0;
23
+ --sep:rgba(15,23,42,.12);--sep-2:#cbd5e1;
24
+ --label:#0f172a;--label-2:#334155;--label-3:#64748b;
25
+ --accent:#15803d;--accent-fill:#15803d;--accent-soft:rgba(21,128,61,.12);--on-accent:#ffffff;
26
+ --focus:#2563eb;
27
+ --green:#16a34a;--green-soft:rgba(22,163,74,.12);--green-ink:#15803d;
28
+ --orange:#d97706;--orange-soft:rgba(217,119,6,.12);--orange-ink:#b45309;
29
+ --red:#dc2626;--red-soft:rgba(220,38,38,.12);--red-ink:#b91c1c;
30
+ --violet:#7c3aed;--violet-soft:rgba(124,58,237,.12);--violet-ink:#6d28d9;
31
+ --blue:#2563eb;--blue-soft:rgba(37,99,235,.12);--blue-ink:#1d4ed8;
32
+ --hover:rgba(15,23,42,.05);--press:rgba(15,23,42,.09);--sel:rgba(37,99,235,.12);--sel-line:#2563eb;
33
+ color-scheme:light;
34
+ }
35
+ *{box-sizing:border-box}
36
+ [hidden]{display:none!important}
37
+ html,body{height:100%}
38
+ body{margin:0;background:var(--ground);color:var(--label);font:14px/1.5 var(--sans);-webkit-font-smoothing:antialiased;overflow:hidden}
39
+ button,input,select{font:inherit;color:inherit}
40
+ button{cursor:pointer;background:none;border:0;padding:0;text-align:left;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color var(--t),color var(--t),border-color var(--t)}
41
+ a,.row,.opt{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
42
+ .skip{position:absolute;left:8px;top:-40px;z-index:100;background:var(--accent-fill);color:var(--on-accent);padding:6px 10px;border-radius:var(--r);font-weight:600}
43
+ .skip:focus{top:8px}
44
+ a{color:var(--accent);text-decoration:none}
45
+ ::selection{background:var(--sel)}
46
+ :focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:var(--rs)}
47
+ *{scrollbar-width:thin;scrollbar-color:var(--sep-2) transparent}
48
+ *::-webkit-scrollbar{width:8px;height:8px}*::-webkit-scrollbar-thumb{background:var(--sep-2);border-radius:8px}*::-webkit-scrollbar-track{background:transparent}
49
+ .mono{font-family:var(--mono);font-size:12.5px;letter-spacing:0}
50
+ .num{font-variant-numeric:tabular-nums}
51
+ .ico{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex:none}
52
+ @media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
53
+
54
+
55
+ /* ---------- window ---------- */
56
+ .win{display:grid;grid-template-columns:60px 252px minmax(0,1fr);height:100%}
57
+ /* ---------- project rail ---------- */
58
+ .rail{background:var(--side);border-right:1px solid var(--sep);display:flex;flex-direction:column;align-items:center;gap:6px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;padding:calc(10px + env(safe-area-inset-top,0px)) 8px calc(10px + env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px))}
59
+ .rail::-webkit-scrollbar{display:none}
60
+ .rail .logo{width:26px;height:26px;border-radius:var(--r);flex:none;margin-bottom:2px}
61
+ .rlist{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%}
62
+ .rsep{width:22px;height:1px;background:var(--sep);flex:none;margin:2px 0}
63
+ .rfoot{margin-top:auto;display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;padding-top:8px}
64
+ .tile{position:relative;width:44px;height:44px;flex:none;border-radius:var(--r);display:grid;place-items:center;background:var(--muted);color:var(--label-2);font-size:13.5px;font-weight:600;font-family:var(--sans);transition:background var(--t),color var(--t)}
65
+ .tile:hover{background:var(--press);color:var(--label)}
66
+ .tile.blue{color:var(--blue-ink)}.tile.green{color:var(--green-ink)}.tile.orange{color:var(--orange-ink)}.tile.violet{color:var(--violet-ink)}
67
+ .tile.cur{background:var(--press);color:var(--label)}
68
+ .tile.cur::before{content:"";position:absolute;left:-8px;top:50%;transform:translateY(-50%);width:3px;height:26px;background:var(--accent);border-radius:0 var(--rs) var(--rs) 0}
69
+ .tile.ghost{background:transparent;color:var(--label-3)}
70
+ .tile.ghost:hover{background:var(--hover);color:var(--label-2)}
71
+ .tile.ghost svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8}
72
+ .tip{position:fixed;z-index:90;background:var(--group);border:1px solid var(--sep-2);border-radius:var(--r);padding:6px 9px;color:var(--label);font-size:12.5px;line-height:1.35;pointer-events:none;opacity:0;transform:translateX(-4px);transition:opacity 140ms ease-out,transform 140ms ease-out;white-space:nowrap;max-width:300px}
73
+ .tip.on{opacity:1;transform:none}
74
+ .tip .k{color:var(--label-3);font-family:var(--mono);font-size:11px;margin-left:8px}
75
+ .tip .p{display:block;color:var(--label-3);font-family:var(--mono);font-size:11px;margin-top:3px;max-width:280px;overflow:hidden;text-overflow:ellipsis}
76
+ .scrim{display:none;position:fixed;inset:0;background:rgba(2,6,23,.55);z-index:29;opacity:0;transition:opacity .22s}
77
+ .src{background:var(--side);border-right:1px solid var(--sep);display:flex;flex-direction:column;min-height:0;padding:calc(10px + env(safe-area-inset-top,0px)) 8px calc(10px + env(safe-area-inset-bottom,0px)) calc(8px + env(safe-area-inset-left,0px));overscroll-behavior:contain}
78
+ .src .top{display:flex;align-items:center;gap:9px;min-width:0;margin:2px 0 12px;padding:9px 11px;border:1px solid var(--sep);border-radius:var(--r);background:var(--group)}
79
+ .src .top b{font-size:14.5px;font-weight:600;letter-spacing:-.01em;color:var(--label);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
80
+ .src .top .br{margin-left:auto;font-family:var(--mono);font-size:11.5px;color:var(--label-3);flex:none;max-width:88px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
81
+ .logo{width:22px;height:22px;border-radius:6px;flex:none}
82
+ .search{display:flex;align-items:center;gap:6px;background:var(--muted);border:1px solid transparent;border-radius:var(--r);padding:6px 9px;color:var(--label-3);margin:0 0 4px;width:100%}
83
+ .search:hover{border-color:var(--sep)}
84
+ .search kbd{margin-left:auto;font-family:var(--mono);font-size:11px;color:var(--label-3)}
85
+ .snav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
86
+ .snav::-webkit-scrollbar{display:none}
87
+ .grp{margin:13px 0 3px;padding:0 10px;font-size:11.5px;font-weight:600;color:var(--label-3);letter-spacing:.08em;text-transform:uppercase}
88
+ .srow{display:flex;align-items:center;gap:10px;padding:0 10px;min-height:34px;border-radius:var(--r);color:var(--label-2);width:100%;font-size:14px}
89
+ .srow:hover{background:var(--hover);color:var(--label)}
90
+ .srow:hover>svg{stroke:var(--label-2)}
91
+ .srow.on{background:var(--accent-fill);color:var(--on-accent);font-weight:500}
92
+ .srow.on>svg{stroke:var(--on-accent)}
93
+ .srow>svg{width:16px;height:16px;stroke:var(--label-3);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none;transition:stroke var(--t)}
94
+ .srow .t{flex:none;white-space:nowrap}
95
+ .srow .meta{flex:1 1 0;min-width:0;padding-left:10px;text-align:right;font-family:var(--mono);font-size:11.5px;color:var(--label-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
96
+ .srow.on .meta{color:var(--on-accent);opacity:.7}
97
+
98
+ .src .foot{margin-top:auto;padding:10px 11px 2px;border-top:1px solid var(--sep);display:flex;align-items:center;gap:7px;color:var(--label-3);font-size:11.5px;font-family:var(--mono);flex:none}
99
+ .src .foot .v{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
100
+
101
+ .pane{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;overflow:hidden}
102
+ .tb{display:flex;align-items:center;gap:10px;padding:14px 22px 8px;flex:none}
103
+ .tb h1{font-size:22px;font-weight:600;margin:0;letter-spacing:-.01em;line-height:1.2}
104
+ .tb .sub{color:var(--label-2);font-size:13px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
105
+ .tb .sub .mono{color:var(--label-3)}
106
+ .tb .right{margin-left:auto;display:flex;gap:8px;align-items:center}
107
+ .seg{display:inline-flex;background:var(--muted);border-radius:var(--r);padding:2px}
108
+ .seg button{padding:4px 12px;border-radius:var(--rs);color:var(--label-2);font-weight:500;font-size:13px}
109
+ .seg button:hover{color:var(--label)}
110
+ .seg button.on{background:var(--group);color:var(--label);box-shadow:inset 0 0 0 1px var(--sep-2)}
111
+ .ib{width:30px;height:30px;border-radius:var(--r);display:grid;place-items:center;color:var(--label-2)}
112
+ .ib:hover{background:var(--hover);color:var(--label)}
113
+ .content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:6px calc(22px + env(safe-area-inset-right,0px)) calc(40px + env(safe-area-inset-bottom,0px)) 22px}
114
+ .content>.view{display:none;flex-direction:column;gap:18px;max-width:880px}
115
+ #v-file{max-width:1060px}
116
+ .content>.view.on{display:flex}
117
+ #specBody{display:flex;flex-direction:column;gap:18px}
118
+
119
+ /* ---------- grouped list ---------- */
120
+ .gl{display:flex;flex-direction:column;gap:6px;min-width:0}
121
+ .gl .gh{display:flex;align-items:center;gap:8px;padding:0 2px;color:var(--label-3);font-size:11.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
122
+ .gl .gh .cnt{color:var(--label-3);font-weight:500;font-variant-numeric:tabular-nums;text-transform:none;letter-spacing:0}
123
+ .gl .gh .more{margin-left:auto;color:var(--green-ink);font-weight:500;font-size:12.5px;text-transform:none;letter-spacing:0}
124
+ .gl .gh .more:hover{text-decoration:underline}
125
+ .gl .gh .disc{width:20px;height:20px;display:grid;place-items:center;color:var(--label-3);transition:transform .18s;transform-origin:center}
126
+ .gl.closed .gh .disc{transform:rotate(-90deg)}
127
+ .gl.closed .box{display:none}
128
+ .box{background:var(--group);border-radius:var(--r);border:1px solid var(--sep-2);overflow:hidden}
129
+ .row{display:flex;align-items:center;gap:12px;padding:0 14px;min-height:48px;border-top:1px solid var(--sep);width:100%;color:var(--label);position:relative;transition:background-color var(--t)}
130
+ .row:first-child{border-top:0}
131
+ .row.act{cursor:pointer}
132
+ .row.act:hover{background:var(--hover)}
133
+ .row.act:active{background:var(--press)}
134
+ .row.sel{background:var(--sel)}
135
+ .row .lead{flex:none;width:18px;height:18px;display:grid;place-items:center}
136
+ button.row{font:inherit;text-align:left}
137
+ body.dragging{user-select:none;-webkit-user-select:none}
138
+ .row .st{width:9px;height:9px;border-radius:50%;flex:none}
139
+ .st.blue{background:var(--accent)}.st.green{background:var(--green)}.st.orange{background:var(--orange)}.st.red{background:var(--red)}.st.violet{background:var(--violet)}.st.gray{background:var(--label-3)}.st.hollow{background:transparent;box-shadow:inset 0 0 0 1.5px var(--label-3)}
140
+ .row .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;padding:8px 0}
141
+ .row .ttl{font-size:14px;font-weight:500;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
142
+ .row .ttl .id{font-family:var(--mono);font-size:12.5px;color:var(--label-3);margin-right:8px;font-weight:400}
143
+ .row .det{font-size:13px;color:var(--label-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
144
+ .row .trail{margin-left:auto;display:flex;align-items:center;gap:8px;flex:none}
145
+ .row .chev{color:var(--label-3);width:14px;height:14px}
146
+ .pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:var(--rs);font-size:12px;font-weight:600;white-space:nowrap;background:var(--muted)}
147
+ .pill.blue{color:var(--blue-ink)}.pill.green{color:var(--green-ink)}.pill.orange{color:var(--orange-ink)}.pill.red{color:var(--red-ink)}.pill.violet{color:var(--violet-ink)}.pill.gray{color:var(--label-2)}
148
+ .pill i{width:6px;height:6px;border-radius:50%;background:currentColor}
149
+ .pill.green i{background:var(--green)}.pill.orange i{background:var(--orange)}.pill.red i{background:var(--red)}.pill.blue i{background:var(--accent)}
150
+ .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border-radius:var(--r);background:var(--muted);color:var(--label);font-weight:500;font-size:13px;border:1px solid transparent;white-space:nowrap;min-height:32px}
151
+ .btn:hover{background:var(--press)}
152
+ .btn.pri{background:var(--accent-fill);color:var(--on-accent)}
153
+ .btn.pri:hover{filter:brightness(1.06)}
154
+ .btn.tint{background:var(--blue-soft);color:var(--blue-ink)}
155
+ .btn.tint:hover{filter:brightness(.97)}
156
+ .btn.line{background:transparent;border-color:var(--sep-2);color:var(--label-2)}
157
+ .btn.line:hover{color:var(--label);background:var(--hover)}
158
+ .btn.quiet{background:transparent;color:var(--label-2)}
159
+ .btn.quiet:hover{background:var(--hover);color:var(--label)}
160
+ .btn.sm{padding:4px 10px;font-size:12.5px;min-height:28px}
161
+ .btn svg{width:13px;height:13px}
162
+ .kv .row .body{flex-direction:row;align-items:center;gap:12px}
163
+ .kv .row .k{color:var(--label);min-width:150px;font-size:14px}
164
+ .kv .row .v{color:var(--label-2);font-size:14px;flex:1;min-width:0}
165
+ .kv .row .v.mono{color:var(--label-3)}
166
+ .note{color:var(--label-3);font-size:13px;line-height:1.5;padding:0 2px}
167
+ .err{color:var(--red-ink);font-size:12px;padding:2px 4px 0}
168
+ input.txt{width:100%}
169
+ .empty{padding:26px 14px;text-align:center;color:var(--label-3);font-size:13.5px}
170
+ .bar{height:6px;border-radius:var(--rs);background:var(--muted);overflow:hidden;min-width:70px}
171
+ .bar i{display:block;height:100%;background:var(--green);border-radius:var(--rs)}
172
+ .bar i.orange{background:var(--orange)}.bar i.blue{background:var(--accent)}
173
+
174
+
175
+ .opt-rb{width:18px;height:18px;border-radius:50%;border:1.5px solid var(--sep-2);display:grid;place-items:center}
176
+ .opt-rb.on{background:var(--accent-fill);border-color:var(--accent-fill)}
177
+ .opt-rb.on::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--on-accent)}
178
+ .md{color:var(--label-2);font-size:14px;line-height:1.6;min-width:0}
179
+ .md.doc{background:var(--group);border:1px solid var(--sep-2);border-radius:var(--r);padding:18px 20px}
180
+ .md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
181
+ .md h2{font-size:18px;font-weight:600;color:var(--label);margin:26px 0 8px;letter-spacing:-.01em;line-height:1.3}
182
+ .md h3{font-size:15px;font-weight:600;color:var(--label);margin:20px 0 6px}
183
+ .md h4{font-size:14px;font-weight:600;color:var(--label);margin:16px 0 4px}
184
+ .md h5,.md h6{font-size:13px;font-weight:600;color:var(--label-2);margin:14px 0 4px}
185
+ .md p{margin:8px 0}
186
+ .md ul,.md ol{margin:8px 0;padding-left:20px}
187
+ .md li{margin:4px 0}
188
+ .md li::marker{color:var(--label-3)}
189
+ .md li.cb{list-style:none;margin-left:-20px;padding-left:24px;position:relative}
190
+ .md li.cb::before{content:"";position:absolute;left:0;top:.35em;width:13px;height:13px;border-radius:var(--rs);border:1.5px solid var(--sep-2)}
191
+ .md li.cb.on::before{background:var(--green);border-color:var(--green)}
192
+ .md li.cb.on::after{content:"";position:absolute;left:3px;top:calc(.35em + 3px);width:7px;height:3.5px;border-left:1.5px solid var(--ground);border-bottom:1.5px solid var(--ground);transform:rotate(-45deg)}
193
+ .md code{font-family:var(--mono);font-size:12.5px;background:var(--muted);padding:1px 5px;border-radius:var(--rs);color:var(--green-ink);white-space:nowrap}
194
+ .md pre{font-family:var(--mono);font-size:12.5px;line-height:1.6;background:var(--side);border:1px solid var(--sep-2);border-radius:var(--r);padding:12px 14px;overflow:auto;color:var(--label-2);margin:10px 0;white-space:pre}
195
+ .md blockquote{margin:10px 0;padding:2px 0 2px 14px;border-left:1px solid var(--sep-2);color:var(--label-3)}
196
+ .md blockquote p{margin:4px 0}
197
+ .md hr{border:0;border-top:1px solid var(--sep);margin:20px 0}
198
+ .md strong{color:var(--label);font-weight:600}
199
+ .md .ref{font-family:var(--mono);font-size:12px;color:var(--label-3);white-space:nowrap}
200
+ .md .lk{color:var(--green-ink)}
201
+ .md .tw{overflow-x:auto;margin:10px 0;border:1px solid var(--sep-2);border-radius:var(--r)}
202
+ .md table{border-collapse:collapse;font-size:13px;width:100%;min-width:420px}
203
+ .md td,.md th{padding:7px 10px;border-top:1px solid var(--sep);text-align:left;vertical-align:top;line-height:1.5}
204
+ .md thead th{color:var(--label-3);font-weight:600;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;border-top:0;background:var(--muted)}
205
+ .md tbody tr:first-child td{border-top:0}
206
+ .desc.md{padding:12px 14px}
207
+ .desc.md code{white-space:normal}
208
+
209
+ /* board mode */
210
+ .board{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;align-items:start}
211
+ .board .gl{min-width:0}
212
+ .board .row{min-height:0;padding:10px 12px;align-items:flex-start}
213
+ .board .row .ttl{white-space:normal}
214
+ .board .row .det{white-space:normal}
215
+ .board .row{flex-wrap:wrap;row-gap:0}
216
+ .board .row .body{flex:1 1 calc(100% - 60px);padding-bottom:4px}
217
+ .board .row .trail{width:100%;margin-left:21px;padding-bottom:10px;justify-content:flex-start}
218
+ .board .row .chev{margin-left:auto}
219
+ @media (prefers-reduced-motion:reduce){.row.moved{animation:none;background:var(--accent-soft)}}
220
+
221
+ /* ---------- inspector ---------- */
222
+ .insp{position:absolute;top:0;right:0;bottom:0;width:min(400px,100%);background:var(--ground);border-left:1px solid var(--sep);border-left:1px solid var(--sep-2);transform:translateX(102%);visibility:hidden;transition:transform .26s cubic-bezier(.2,.8,.2,1),visibility .26s;display:flex;flex-direction:column;z-index:20}
223
+ .insp.open{visibility:visible}
224
+ .insp.open{transform:none}
225
+ .insp .ih{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--sep);background:var(--group)}
226
+ .insp .ih .id{font-family:var(--mono);font-size:12px;color:var(--label-3)}
227
+ .insp .ih .x{margin-left:auto}
228
+ .insp .ib2{overflow:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:16px}
229
+ .insp h2{font-size:17px;font-weight:600;margin:0;line-height:1.35;text-wrap:balance;padding:0 2px}
230
+ .insp .gl .gh{font-size:12px}
231
+ .insp .row{min-height:40px;padding:0 12px}
232
+ .insp .row .k{min-width:96px;color:var(--label-2)}
233
+ .insp .row .v{color:var(--label)}
234
+ .insp .desc{padding:10px 12px;color:var(--label-2);line-height:1.55;font-size:14px}
235
+ .insp .actions{display:flex;gap:8px;flex-wrap:wrap;padding:2px}
236
+ .report li{display:flex;gap:10px;padding:9px 12px;border-top:1px solid var(--sep);font-size:13px;line-height:1.45}
237
+ .report li:first-child{border-top:0}
238
+ .report .f{font-family:var(--mono);font-size:12px;color:var(--green-ink);flex:none;min-width:150px;padding-top:2px}
239
+ .report .w{color:var(--label-2)}
240
+ .chk{display:flex;align-items:center;gap:10px;padding:0 12px;min-height:40px;border-top:1px solid var(--sep);font-size:14px;color:var(--label)}
241
+ .chk:first-child{border-top:0}
242
+ .chk .m{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;flex:none;font-size:11px;font-weight:700}
243
+ .chk.ok .m{background:var(--green-soft);color:var(--green-ink)}.chk.no .m{background:var(--red-soft);color:var(--red-ink)}
244
+ .chk .m svg{width:11px;height:11px;stroke-width:2.4}
245
+ .skip{background:var(--accent-fill);color:var(--on-accent)}.chk.na .m{background:var(--hover);color:var(--label-3)}
246
+ .chk .ev{margin-left:auto;font-family:var(--mono);font-size:12px;color:var(--label-3)}
247
+ .term{background:var(--side);color:var(--label-2);border:1px solid var(--sep-2);border-radius:var(--r);padding:10px 12px;font-family:var(--mono);font-size:12.5px;line-height:1.6;white-space:pre-wrap;max-height:200px;overflow:auto}
248
+ .term .g{color:var(--green-ink)}.term .r{color:var(--red-ink)}.term .y{color:var(--orange-ink)}.term .b{color:var(--blue-ink)}.term .d{color:var(--label-3)}
249
+
250
+ .veil{position:fixed;inset:0;background:rgba(2,6,23,.6);display:none;align-items:flex-start;justify-content:center;padding:8vh 16px 16px;z-index:40;overflow:auto}
251
+ .veil.open{display:flex}
252
+
253
+
254
+ /* palette */
255
+ .pal{width:min(560px,100%);background:var(--group);border:1px solid var(--sep-2);border-radius:6px;overflow:hidden}
256
+ .pal input{width:100%;padding:13px 16px;background:transparent;border:0;border-bottom:1px solid var(--sep);font-size:16px;outline:none}
257
+ .pal ul{list-style:none;margin:0;padding:6px;max-height:320px;overflow:auto;overscroll-behavior:contain}
258
+ .pal li{padding:8px 10px;border-radius:var(--rs);display:flex;gap:10px;align-items:center;cursor:pointer;color:var(--label);min-width:0}
259
+ .pal li .lbl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
260
+ .pal li:hover,.pal li.on{background:var(--sel)}
261
+ .pal li .k{font-family:var(--mono);font-size:11.5px;color:var(--label-3);margin-left:auto;flex:none}
262
+
263
+ .toast{position:fixed;bottom:calc(18px + env(safe-area-inset-bottom,0px));left:50%;transform:translate(-50%,16px);background:var(--label);color:var(--ground);padding:9px 14px;border-radius:var(--r);border:1px solid var(--sep-2);opacity:0;transition:opacity .22s,transform .22s;pointer-events:none;z-index:60;font-size:12.5px;font-weight:500}
264
+ .toast.show{opacity:1;transform:translate(-50%,0)}
265
+ .menu{display:none}
266
+
267
+ @media (max-width:900px){
268
+ .win{grid-template-columns:1fr}
269
+ .rail{position:fixed;left:0;top:0;bottom:0;width:60px;transform:translateX(-312px);transition:transform .24s ease-out;z-index:31;border-right:1px solid var(--sep)}
270
+ .src{position:fixed;left:60px;top:0;bottom:0;width:252px;transform:translateX(-312px);transition:transform .24s ease-out;z-index:30;border-right:1px solid var(--sep-2)}
271
+ .win.nav .rail,.win.nav .src{transform:none}
272
+ .win.nav .scrim{display:block;opacity:1}
273
+ .menu{display:grid}
274
+ .board{grid-template-columns:1fr}
275
+ .tb{padding:12px 16px 6px;flex-wrap:wrap}
276
+ .content{padding:6px 16px 40px}
277
+ .kv .row .body{flex-direction:column;align-items:flex-start;gap:2px}
278
+ .kv .row .k{min-width:0}
279
+ .row .ttl{white-space:normal}
280
+ .tb .sub .mono{display:none}
281
+ .content>.view{gap:16px}
282
+ }
283
+
284
+ /* ---------- specpilot serve ---------- */
285
+ /* The CSP (default-src 'self') forbids inline style attributes; these replace the mockup's. */
286
+ .sprite{position:absolute;width:0;height:0}
287
+ .ico-13{width:13px;height:13px}
288
+ .mt18{margin-top:18px}
289
+ .mb18{margin-bottom:18px}
290
+ .doc-gap{margin:6px 0 22px}
291
+ .pal-veil{padding-top:14vh}
292
+ .ml-auto{margin-left:auto}
293
+ /* Task rows show the whole description, clamped by CSS; the inspector shows it unclamped. */
294
+ .row .ttl.clamp{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}
295
+ .row .ttl .num{font-family:var(--mono);font-size:12.5px;color:var(--label-3);margin-right:8px;font-weight:400}
296
+ .raw{font-family:var(--mono);font-size:12.5px;white-space:pre-wrap;word-break:break-word;color:var(--label-2);padding:10px 14px;margin:0}
297
+ /* Group headers in the content and inspector carry file text (section headings, paths):
298
+ show it as written instead of uppercasing it. Sidebar group labels stay uppercase. */
299
+ .content .gl .gh,.insp .gl .gh{text-transform:none;letter-spacing:.02em}
300
+ /* Task moves (BL-053): drag state, drop target, and the toast's Undo. */
301
+ .row[draggable="true"]{cursor:grab}
302
+ .row[draggable="true"]:active{cursor:grabbing}
303
+ .row.drag{opacity:.4}
304
+ .gl.drop .box{border-color:var(--focus);box-shadow:inset 0 0 0 1px var(--focus)}
305
+ .toast.has-action.show{pointer-events:auto}
306
+ .toast .tact{margin-left:12px;color:var(--ground);font-weight:600;text-decoration:underline;text-underline-offset:2px}