@andares/pi-toolkits 1.0.0 → 1.0.2
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/CHANGELOG.md +17 -0
- package/README.md +26 -25
- package/README.zh-CN.md +28 -27
- package/package.json +8 -7
- package/src/features/ask/index.test.ts +2 -2
- package/src/features/ask/index.ts +1 -1
- package/src/features/autostart/autostart.ts +1 -1
- package/src/features/autostart/index.ts +3 -2
- package/src/features/compact/index.ts +1 -1
- package/src/features/compact/prompt.ts +3 -3
- package/src/features/favorites/patch-selector.ts +5 -1
- package/src/features/init/index.test.ts +2 -2
- package/src/features/init/templates/workflow-block.md +2 -2
- package/src/features/permission/index.ts +1 -1
- package/src/features/permission/panel.ts +3 -1
- package/src/features/quit-guard/index.ts +4 -3
- package/src/features/review/index.ts +3 -3
- package/src/features/review/review.test.ts +2 -2
- package/src/features/spec/assets/index-CdTerMvN.css +1 -0
- package/src/features/spec/assets/index-Dv52AIjX.js +1 -0
- package/src/features/{plan → spec}/assets/index.html +3 -3
- package/src/features/{plan → spec}/assets.test.ts +5 -5
- package/src/features/{plan → spec}/blocks.ts +1 -1
- package/src/features/{plan → spec}/feedback.test.ts +26 -26
- package/src/features/{plan → spec}/feedback.ts +14 -14
- package/src/features/{plan → spec}/index.test.ts +100 -66
- package/src/features/{plan → spec}/index.ts +117 -106
- package/src/features/{plan → spec}/prompt.test.ts +20 -20
- package/src/features/{plan → spec}/prompt.ts +25 -25
- package/src/features/{plan → spec}/render.test.ts +2 -2
- package/src/features/{plan → spec}/server.test.ts +21 -21
- package/src/features/{plan → spec}/server.ts +22 -22
- package/src/features/{plan → spec}/store.test.ts +77 -35
- package/src/features/{plan → spec}/store.ts +80 -52
- package/src/features/uat/index.test.ts +5 -5
- package/src/features/uat/index.ts +8 -8
- package/src/features/uat/record-tool.ts +3 -3
- package/src/features/uat/records.test.ts +5 -5
- package/src/index.ts +6 -6
- package/src/lib/ask-control.ts +2 -2
- package/src/lib/permission-control.ts +4 -4
- package/src/lib/phases.ts +20 -7
- package/src/lib/web-review.ts +1 -1
- package/src/features/plan/assets/index-C1YLIi4I.js +0 -1
- package/src/features/plan/assets/index-DMEpYC3V.css +0 -1
- /package/src/features/{plan → spec}/blocks.test.ts +0 -0
- /package/src/features/{plan → spec}/diff.test.ts +0 -0
- /package/src/features/{plan → spec}/diff.ts +0 -0
- /package/src/features/{plan → spec}/render.ts +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* spec store — every submitted revision, on disk.
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
4
|
+
* A spec review is a series of revisions, and the operator needs to look back
|
|
5
5
|
* at any of them ("what did v2 say before I asked for the split?"). So each
|
|
6
|
-
* submit snapshots the file into `<agent-dir>/ask-
|
|
6
|
+
* submit snapshots the file into `<agent-dir>/ask-spec/<slug>/vNNN.md` and
|
|
7
7
|
* `state.json` keeps the metadata: blocks, the block-level diff against the
|
|
8
8
|
* previous revision, the annotations attached to it, and the decision.
|
|
9
9
|
*
|
|
10
10
|
* Deliberately outside the project tree: a review generates many revisions and
|
|
11
|
-
* polluting `git status` with them would be noise. The approved
|
|
11
|
+
* polluting `git status` with them would be noise. The approved spec itself
|
|
12
12
|
* stays where the agent wrote it (`specs/<slug>.md`) — the store never rewrites
|
|
13
13
|
* that file, so "approved bytes == committed bytes" holds.
|
|
14
14
|
*/
|
|
@@ -26,17 +26,17 @@ import { parseBlocks, type Block } from "./blocks.js";
|
|
|
26
26
|
import { diffBlocks, type DiffEntry } from "./diff.js";
|
|
27
27
|
import type { Annotation, BlockAnnotations } from "./feedback.js";
|
|
28
28
|
|
|
29
|
-
export interface
|
|
29
|
+
export interface SpecAnnotations {
|
|
30
30
|
global: Annotation[];
|
|
31
31
|
blocks: BlockAnnotations[];
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export interface
|
|
34
|
+
export interface SpecDecision {
|
|
35
35
|
action: "approve" | "deny";
|
|
36
36
|
at: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export interface
|
|
39
|
+
export interface SpecVersionMeta {
|
|
40
40
|
/** 1-based revision number. */
|
|
41
41
|
n: number;
|
|
42
42
|
at: string;
|
|
@@ -45,32 +45,32 @@ export interface PlanVersionMeta {
|
|
|
45
45
|
blocks: Block[];
|
|
46
46
|
/** Diff against revision n-1 ([] for the first). */
|
|
47
47
|
diff: DiffEntry[];
|
|
48
|
-
annotations:
|
|
49
|
-
decision?:
|
|
48
|
+
annotations: SpecAnnotations;
|
|
49
|
+
decision?: SpecDecision;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export interface
|
|
52
|
+
export interface SpecSession {
|
|
53
53
|
slug: string;
|
|
54
54
|
dir: string;
|
|
55
55
|
createdAt: string;
|
|
56
|
-
versions:
|
|
56
|
+
versions: SpecVersionMeta[];
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Keep at most this many revisions; the oldest undecided ones go first. */
|
|
60
60
|
const MAX_VERSIONS = 50;
|
|
61
61
|
|
|
62
|
-
export function emptyAnnotations():
|
|
62
|
+
export function emptyAnnotations(): SpecAnnotations {
|
|
63
63
|
return { global: [], blocks: [] };
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** Slug for a directory name: ascii-ish, lowercase, bounded. */
|
|
67
|
-
export function
|
|
67
|
+
export function specSlug(raw: string): string {
|
|
68
68
|
const slug = raw
|
|
69
69
|
.toLowerCase()
|
|
70
70
|
.replace(/[^a-z0-9\u4e00-\u9fff]+/g, "-")
|
|
71
71
|
.replace(/^-+|-+$/g, "")
|
|
72
72
|
.slice(0, 40);
|
|
73
|
-
return slug || "
|
|
73
|
+
return slug || "spec";
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function versionFile(dir: string, n: number): string {
|
|
@@ -94,17 +94,17 @@ function allocateDir(root: string, slug: string): { dir: string; slug: string }
|
|
|
94
94
|
return { dir, slug: candidate };
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
throw new Error(`cannot allocate a directory for
|
|
97
|
+
throw new Error(`cannot allocate a directory for spec slug "${slug}" in ${root}`);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
function saveState(session:
|
|
100
|
+
function saveState(session: SpecSession): void {
|
|
101
101
|
writeAtomic(join(session.dir, "state.json"), `${JSON.stringify(session, null, 2)}\n`);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/** Trim old revisions: never drop the latest, never drop a decided one. */
|
|
105
|
-
function pruneVersions(session:
|
|
105
|
+
function pruneVersions(session: SpecSession): void {
|
|
106
106
|
if (session.versions.length <= MAX_VERSIONS) return;
|
|
107
|
-
const keep:
|
|
107
|
+
const keep: SpecVersionMeta[] = [];
|
|
108
108
|
const latest = session.versions.at(-1);
|
|
109
109
|
// Iterate oldest → newest, dropping undecided revisions while over budget.
|
|
110
110
|
for (const version of session.versions) {
|
|
@@ -120,8 +120,8 @@ function pruneVersions(session: PlanSession): void {
|
|
|
120
120
|
session.versions = keep;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
export interface
|
|
124
|
-
/** `<agent-dir>` — the store lives at `<agentDir>/ask-
|
|
123
|
+
export interface CreateSpecSessionOptions {
|
|
124
|
+
/** `<agent-dir>` — the store lives at `<agentDir>/ask-spec/`. */
|
|
125
125
|
agentDir: string;
|
|
126
126
|
slug: string;
|
|
127
127
|
text: string;
|
|
@@ -129,17 +129,38 @@ export interface CreatePlanSessionOptions {
|
|
|
129
129
|
now?: Date;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
const STORE_DIR = "ask-spec";
|
|
133
|
+
const LEGACY_STORE_DIR = "ask-plan";
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Store root, migrating the pre-rename `ask-plan` directory when it is the only
|
|
137
|
+
* one present. If the rename fails (read-only agent dir), the legacy directory
|
|
138
|
+
* keeps working instead of silently starting a second history.
|
|
139
|
+
*/
|
|
140
|
+
function storeRoot(agentDir: string): string {
|
|
141
|
+
const root = join(agentDir, STORE_DIR);
|
|
142
|
+
const legacy = join(agentDir, LEGACY_STORE_DIR);
|
|
143
|
+
if (!existsSync(root) && existsSync(legacy)) {
|
|
144
|
+
try {
|
|
145
|
+
renameSync(legacy, root);
|
|
146
|
+
} catch {
|
|
147
|
+
return legacy;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return root;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function createSpecSession(options: CreateSpecSessionOptions): SpecSession {
|
|
133
154
|
const now = options.now ?? new Date();
|
|
134
|
-
const root =
|
|
135
|
-
const { dir, slug } = allocateDir(root,
|
|
136
|
-
const session:
|
|
155
|
+
const root = storeRoot(options.agentDir);
|
|
156
|
+
const { dir, slug } = allocateDir(root, specSlug(options.slug));
|
|
157
|
+
const session: SpecSession = {
|
|
137
158
|
slug,
|
|
138
159
|
dir,
|
|
139
160
|
createdAt: now.toISOString(),
|
|
140
161
|
versions: [],
|
|
141
162
|
};
|
|
142
|
-
|
|
163
|
+
appendSpecVersion(session, {
|
|
143
164
|
text: options.text,
|
|
144
165
|
source: options.source,
|
|
145
166
|
now,
|
|
@@ -154,17 +175,17 @@ export interface AppendVersionOptions {
|
|
|
154
175
|
}
|
|
155
176
|
|
|
156
177
|
/** Snapshot a new revision, diffing it against the previous one. */
|
|
157
|
-
export function
|
|
158
|
-
session:
|
|
178
|
+
export function appendSpecVersion(
|
|
179
|
+
session: SpecSession,
|
|
159
180
|
options: AppendVersionOptions,
|
|
160
|
-
):
|
|
181
|
+
): SpecVersionMeta {
|
|
161
182
|
const now = options.now ?? new Date();
|
|
162
183
|
const previous = session.versions.at(-1);
|
|
163
184
|
const blocks = parseBlocks(options.text);
|
|
164
185
|
// Revision numbers are identities, not positions. Pruning old revisions must
|
|
165
186
|
// never make the next submission reuse an existing number (and overwrite its
|
|
166
187
|
// snapshot or merge its annotations into the wrong review round).
|
|
167
|
-
const version:
|
|
188
|
+
const version: SpecVersionMeta = {
|
|
168
189
|
n: (previous?.n ?? 0) + 1,
|
|
169
190
|
at: now.toISOString(),
|
|
170
191
|
source: options.source,
|
|
@@ -179,66 +200,73 @@ export function appendPlanVersion(
|
|
|
179
200
|
return version;
|
|
180
201
|
}
|
|
181
202
|
|
|
182
|
-
export function
|
|
183
|
-
session:
|
|
203
|
+
export function setSpecAnnotations(
|
|
204
|
+
session: SpecSession,
|
|
184
205
|
n: number,
|
|
185
|
-
annotations:
|
|
206
|
+
annotations: SpecAnnotations,
|
|
186
207
|
): void {
|
|
187
208
|
const version = session.versions.find((candidate) => candidate.n === n);
|
|
188
|
-
if (!version) throw new Error(`no
|
|
209
|
+
if (!version) throw new Error(`no spec revision ${n} in ${session.dir}`);
|
|
189
210
|
version.annotations = annotations;
|
|
190
211
|
saveState(session);
|
|
191
212
|
}
|
|
192
213
|
|
|
193
|
-
export function
|
|
194
|
-
session:
|
|
214
|
+
export function recordSpecDecision(
|
|
215
|
+
session: SpecSession,
|
|
195
216
|
n: number,
|
|
196
217
|
action: "approve" | "deny",
|
|
197
218
|
now: Date = new Date(),
|
|
198
219
|
): void {
|
|
199
220
|
const version = session.versions.find((candidate) => candidate.n === n);
|
|
200
|
-
if (!version) throw new Error(`no
|
|
221
|
+
if (!version) throw new Error(`no spec revision ${n} in ${session.dir}`);
|
|
201
222
|
version.decision = { action, at: now.toISOString() };
|
|
202
223
|
saveState(session);
|
|
203
224
|
}
|
|
204
225
|
|
|
205
|
-
export function latestVersion(session:
|
|
226
|
+
export function latestVersion(session: SpecSession): SpecVersionMeta {
|
|
206
227
|
const version = session.versions.at(-1);
|
|
207
|
-
if (!version) throw new Error(`
|
|
228
|
+
if (!version) throw new Error(`spec session ${session.dir} has no revisions`);
|
|
208
229
|
return version;
|
|
209
230
|
}
|
|
210
231
|
|
|
211
|
-
export function readVersionText(session:
|
|
232
|
+
export function readVersionText(session: SpecSession, n: number): string {
|
|
212
233
|
return readFileSync(versionFile(session.dir, n), "utf8");
|
|
213
234
|
}
|
|
214
235
|
|
|
215
236
|
/**
|
|
216
|
-
* Load a session from disk (used by tests and by `/ask-
|
|
237
|
+
* Load a session from disk (used by tests and by `/ask-spec open` after a reload).
|
|
217
238
|
* A corrupt state file is reported with the path — a raw SyntaxError from
|
|
218
239
|
* JSON.parse would leave the operator guessing which file is broken.
|
|
219
240
|
*/
|
|
220
|
-
export function
|
|
241
|
+
export function loadSpecSession(dir: string): SpecSession {
|
|
221
242
|
const path = join(dir, "state.json");
|
|
222
243
|
let parsed: unknown;
|
|
223
244
|
try {
|
|
224
245
|
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
225
246
|
} catch (error) {
|
|
226
247
|
const reason = error instanceof Error ? error.message : String(error);
|
|
227
|
-
throw new Error(`cannot read
|
|
248
|
+
throw new Error(`cannot read spec state at ${path}: ${reason}`);
|
|
228
249
|
}
|
|
229
250
|
if (!parsed || typeof parsed !== "object") {
|
|
230
|
-
throw new Error(`
|
|
251
|
+
throw new Error(`spec state at ${path} is not an object`);
|
|
231
252
|
}
|
|
232
|
-
return { ...(parsed as
|
|
253
|
+
return { ...(parsed as SpecSession), dir };
|
|
233
254
|
}
|
|
234
255
|
|
|
235
|
-
/** Directories under `<agentDir>/ask-
|
|
236
|
-
export function
|
|
237
|
-
const root =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
256
|
+
/** Directories under `<agentDir>/ask-spec/`, newest first. */
|
|
257
|
+
export function listSpecSessions(agentDir: string): string[] {
|
|
258
|
+
const root = storeRoot(agentDir);
|
|
259
|
+
const legacy = join(agentDir, LEGACY_STORE_DIR);
|
|
260
|
+
// A partially migrated agent dir can contain both. Keep every session
|
|
261
|
+
// readable instead of hiding the legacy half or merging directories.
|
|
262
|
+
const roots = legacy === root || !existsSync(legacy) ? [root] : [root, legacy];
|
|
263
|
+
return roots
|
|
264
|
+
.filter((candidate) => existsSync(candidate))
|
|
265
|
+
.flatMap((candidate) =>
|
|
266
|
+
readdirSync(candidate, { withFileTypes: true })
|
|
267
|
+
.filter((entry) => entry.isDirectory())
|
|
268
|
+
.map((entry) => join(candidate, entry.name))
|
|
269
|
+
.filter((dir) => existsSync(join(dir, "state.json"))),
|
|
270
|
+
)
|
|
243
271
|
.sort((a, b) => a.localeCompare(b));
|
|
244
272
|
}
|
|
@@ -240,7 +240,7 @@ describe("ask-uat command", () => {
|
|
|
240
240
|
h.shutdown();
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
-
it("exits consult mode deliberately and refuses to start during
|
|
243
|
+
it("exits consult mode deliberately and refuses to start during spec review", async () => {
|
|
244
244
|
let consulting = true;
|
|
245
245
|
setAskControl({ isActive: () => consulting, exit: () => { consulting = false; } });
|
|
246
246
|
const h = harness();
|
|
@@ -249,14 +249,14 @@ describe("ask-uat command", () => {
|
|
|
249
249
|
expect(h.openBrowser).toHaveBeenCalledTimes(1);
|
|
250
250
|
await h.commands.get(UAT_COMMAND)!.handler("off", h.ctx);
|
|
251
251
|
|
|
252
|
-
h.pi.setActiveTools([...h.activeTools(), "
|
|
252
|
+
h.pi.setActiveTools([...h.activeTools(), "spec_submit"]);
|
|
253
253
|
await h.commands.get(UAT_COMMAND)!.handler("", h.ctx);
|
|
254
|
-
expect(h.notify).toHaveBeenLastCalledWith(expect.stringContaining("finish or approve the
|
|
254
|
+
expect(h.notify).toHaveBeenLastCalledWith(expect.stringContaining("finish or approve the spec"), "warning");
|
|
255
255
|
expect(h.openBrowser).toHaveBeenCalledTimes(1);
|
|
256
256
|
h.shutdown();
|
|
257
257
|
});
|
|
258
258
|
|
|
259
|
-
it("keeps record_change out of read-only consult and
|
|
259
|
+
it("keeps record_change out of read-only consult and spec-review phases", async () => {
|
|
260
260
|
setAskControl({ isActive: () => true, exit: () => {} });
|
|
261
261
|
const h = harness();
|
|
262
262
|
for (const handler of h.handlers.before_agent_start ?? []) handler({ systemPrompt: "base" }, h.ctx);
|
|
@@ -272,7 +272,7 @@ describe("ask-uat command", () => {
|
|
|
272
272
|
expect(existsSync(join(root, ".agents/implementations/2026-11-13_2107_forbidden.md"))).toBe(false);
|
|
273
273
|
|
|
274
274
|
setAskControl(undefined);
|
|
275
|
-
h.pi.setActiveTools([...h.activeTools(), "
|
|
275
|
+
h.pi.setActiveTools([...h.activeTools(), "spec_submit"]);
|
|
276
276
|
for (const handler of h.handlers.before_agent_start ?? []) handler({ systemPrompt: "base" }, h.ctx);
|
|
277
277
|
expect(h.activeTools()).not.toContain(RECORD_CHANGE_TOOL);
|
|
278
278
|
h.shutdown();
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* items stream into the page while the agent works;
|
|
11
11
|
* - `uat_item` is the only writer of item identity, and it is active only in
|
|
12
12
|
* this phase; `record_change` is active in framework projects outside the
|
|
13
|
-
* read-only consult and
|
|
13
|
+
* read-only consult and spec-review phases;
|
|
14
14
|
* - nothing here edits code, and there is no submit: a checkbox appends one
|
|
15
15
|
* event to `.agents/uat/ledger.jsonl` and that is the whole decision.
|
|
16
16
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
21
21
|
import { getAskControl } from "../../lib/ask-control.js";
|
|
22
|
-
import {
|
|
22
|
+
import { SPEC_PHASE_TOOL, LEGACY_SPEC_PHASE_TOOL } from "../../lib/phases.js";
|
|
23
23
|
import { openInBrowser } from "../../lib/opener.js";
|
|
24
24
|
import {
|
|
25
25
|
MAX_CANDIDATES_PER_RUN,
|
|
@@ -74,13 +74,13 @@ export function registerUat(pi: ExtensionAPI, options: UatOptions = {}): void {
|
|
|
74
74
|
let lastActivity = Date.now();
|
|
75
75
|
let idleTimer: NodeJS.Timeout | undefined;
|
|
76
76
|
|
|
77
|
-
// `
|
|
77
|
+
// `spec_submit` is the owning feature's phase marker. Detecting the active
|
|
78
78
|
// tool avoids a second global control registry while still keeping the two
|
|
79
79
|
// phases' write surfaces disjoint.
|
|
80
|
-
const
|
|
80
|
+
const specTools = new Set([SPEC_PHASE_TOOL, LEGACY_SPEC_PHASE_TOOL]);
|
|
81
81
|
|
|
82
82
|
function recordChangeAllowed(tools: readonly string[] = pi.getActiveTools()): boolean {
|
|
83
|
-
return !getAskControl()?.isActive() && !tools.
|
|
83
|
+
return !getAskControl()?.isActive() && !tools.some((name) => specTools.has(name));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
function syncRecordTool(installed: boolean): void {
|
|
@@ -198,8 +198,8 @@ export function registerUat(pi: ExtensionAPI, options: UatOptions = {}): void {
|
|
|
198
198
|
root = projectRoot;
|
|
199
199
|
ctxRef = ctx;
|
|
200
200
|
|
|
201
|
-
if (pi.getActiveTools().
|
|
202
|
-
ctx.ui.notify("ask-uat: finish or approve the
|
|
201
|
+
if (pi.getActiveTools().some((name) => specTools.has(name))) {
|
|
202
|
+
ctx.ui.notify("ask-uat: finish or approve the spec before acceptance.", "warning");
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -219,7 +219,7 @@ export function registerUat(pi: ExtensionAPI, options: UatOptions = {}): void {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
// UAT legitimately writes ledger events, so it cannot run inside the
|
|
222
|
-
// read-only consult phase. Match /ask-
|
|
222
|
+
// read-only consult phase. Match /ask-spec: the explicit phase command
|
|
223
223
|
// exits consult mode through its owner, preserving its tool snapshot.
|
|
224
224
|
const ask = getAskControl();
|
|
225
225
|
if (ask?.isActive()) ask.exit(ctx);
|
|
@@ -43,7 +43,7 @@ const PARAMS = Type.Object({
|
|
|
43
43
|
}),
|
|
44
44
|
),
|
|
45
45
|
area: Type.Optional(
|
|
46
|
-
Type.String({ description: 'Short area label used for clustering, e.g. "ask-
|
|
46
|
+
Type.String({ description: 'Short area label used for clustering, e.g. "ask-spec", "auth".' }),
|
|
47
47
|
),
|
|
48
48
|
files: Type.Optional(
|
|
49
49
|
Type.Array(Type.String({ description: "File touched by this change." }), {
|
|
@@ -83,7 +83,7 @@ export interface RecordToolOptions {
|
|
|
83
83
|
/** Resolve the project root (main worktree). Injectable for tests. */
|
|
84
84
|
root?: (cwd: string) => string;
|
|
85
85
|
/**
|
|
86
|
-
* Phase guard, not just a registration guard: read-only consult and
|
|
86
|
+
* Phase guard, not just a registration guard: read-only consult and spec review
|
|
87
87
|
* must not acquire a project-writing tool merely because the framework exists.
|
|
88
88
|
*/
|
|
89
89
|
canRecord?: () => boolean;
|
|
@@ -104,7 +104,7 @@ export function registerRecordTool(pi: ExtensionAPI, options: RecordToolOptions
|
|
|
104
104
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx: ExtensionContext) {
|
|
105
105
|
if (options.canRecord && !options.canRecord()) {
|
|
106
106
|
return errorResult(
|
|
107
|
-
"record_change: disabled during read-only consult or
|
|
107
|
+
"record_change: disabled during read-only consult or spec review — exit /ask, or approve the spec and finish the implementation first.",
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
const root = rootOf(ctx.cwd || process.cwd());
|
|
@@ -55,10 +55,10 @@ describe("header and name shapes", () => {
|
|
|
55
55
|
hhmm: "2107",
|
|
56
56
|
slug: "ask-uat",
|
|
57
57
|
});
|
|
58
|
-
expect(parseRecordFileName("2026-11-11_ask-
|
|
58
|
+
expect(parseRecordFileName("2026-11-11_ask-spec.md")).toEqual({
|
|
59
59
|
date: "2026-11-11",
|
|
60
60
|
hhmm: undefined,
|
|
61
|
-
slug: "ask-
|
|
61
|
+
slug: "ask-spec",
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
|
|
@@ -71,10 +71,10 @@ describe("header and name shapes", () => {
|
|
|
71
71
|
|
|
72
72
|
describe("listRecords", () => {
|
|
73
73
|
it("accepts old records and marks them non-canonical", () => {
|
|
74
|
-
writeRaw("2026-11-11_ask-
|
|
74
|
+
writeRaw("2026-11-11_ask-spec.md", "# 2026-11-11T02:55:59+08:00 — spec review\n\nbody\n");
|
|
75
75
|
const [record] = listRecords(root);
|
|
76
|
-
expect(record.id).toBe("2026-11-11_ask-
|
|
77
|
-
expect(record.title).toBe("
|
|
76
|
+
expect(record.id).toBe("2026-11-11_ask-spec");
|
|
77
|
+
expect(record.title).toBe("spec review");
|
|
78
78
|
expect(record.canonical).toBe(false);
|
|
79
79
|
expect(record.epochMs).toBeGreaterThan(0);
|
|
80
80
|
});
|
package/src/index.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { registerCompact } from "./features/compact/index.js";
|
|
|
30
30
|
import { registerFavorites } from "./features/favorites/index.js";
|
|
31
31
|
import { registerInit } from "./features/init/index.js";
|
|
32
32
|
import { registerPermission } from "./features/permission/index.js";
|
|
33
|
-
import {
|
|
33
|
+
import { registerSpec } from "./features/spec/index.js";
|
|
34
34
|
import { registerQuitGuard } from "./features/quit-guard/index.js";
|
|
35
35
|
import { registerReview } from "./features/review/index.js";
|
|
36
36
|
import { registerStash } from "./features/stash/index.js";
|
|
@@ -47,9 +47,9 @@ export default function piToolkits(pi: ExtensionAPI): void {
|
|
|
47
47
|
// Permission registers its session_start reset before autostart, so a
|
|
48
48
|
// project-declared `/ask-perm ...` runs against a freshly reset mode.
|
|
49
49
|
registerPermission(pi, gates, { audit });
|
|
50
|
-
//
|
|
51
|
-
// published (it turns checks on while
|
|
52
|
-
|
|
50
|
+
// Spec mode drives the permission control that `registerPermission` just
|
|
51
|
+
// published (it turns checks on while reviewing and restores them after).
|
|
52
|
+
registerSpec(pi, gates);
|
|
53
53
|
registerAutostart(pi);
|
|
54
54
|
registerCompact(pi);
|
|
55
55
|
registerFavorites(pi);
|
|
@@ -57,8 +57,8 @@ export default function piToolkits(pi: ExtensionAPI): void {
|
|
|
57
57
|
registerQuitGuard(pi);
|
|
58
58
|
registerReview(pi);
|
|
59
59
|
registerStash(pi);
|
|
60
|
-
// UAT registers after
|
|
61
|
-
// and can add `record_change` to whatever tool set
|
|
60
|
+
// UAT registers after spec so its `before_agent_start` re-assertion runs last
|
|
61
|
+
// and can add `record_change` to whatever tool set spec installed.
|
|
62
62
|
registerUat(pi);
|
|
63
63
|
registerWhatsNew(pi);
|
|
64
64
|
|
package/src/lib/ask-control.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ask control — lets `/ask-
|
|
3
|
-
*
|
|
2
|
+
* ask control — lets `/ask-spec` leave consult mode before opening its broader
|
|
3
|
+
* spec-review phase.
|
|
4
4
|
*
|
|
5
5
|
* `/ask` owns its state and its tool-set snapshot, so another feature must not
|
|
6
6
|
* imitate the exit by manipulating tools itself. This small handle is the same
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* permission control — the handle `/ask-
|
|
3
|
-
* on for the
|
|
2
|
+
* permission control — the handle `/ask-spec` uses to turn the boundary checks
|
|
3
|
+
* on for the spec-review phase and put them back afterwards.
|
|
4
4
|
*
|
|
5
5
|
* Why a registry instead of an import: `/ask-perm` keeps its state in a closure
|
|
6
6
|
* inside `registerPermission()`, so there is no module-level setter to call.
|
|
7
7
|
* A tiny registry (same pattern as `src/lib/startup.ts` for the autostart
|
|
8
8
|
* handoff) lets the permission feature publish a control handle at registration
|
|
9
|
-
* time and the
|
|
10
|
-
* other's internals, and without the
|
|
9
|
+
* time and the spec feature look it up — without either feature importing the
|
|
10
|
+
* other's internals, and without the spec feature knowing anything about modes.
|
|
11
11
|
*/
|
|
12
12
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
13
13
|
import type { PermissionModes } from "../features/permission/constants.js";
|
package/src/lib/phases.ts
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phase helpers shared by the ask-family commands.
|
|
3
3
|
*
|
|
4
|
-
* `ask` is a mode; `ask-
|
|
4
|
+
* `ask` is a mode; `ask-spec` and `ask-uat` are phases whose owning feature
|
|
5
5
|
* publishes a marker tool for the duration. The markers are deliberately the
|
|
6
|
-
* tool names the host already tracks (`
|
|
6
|
+
* tool names the host already tracks (`spec_submit`, `uat_item`) so this helper
|
|
7
7
|
* does not need a second global control registry.
|
|
8
|
+
*
|
|
9
|
+
* `plan_submit` is the pre-rename marker: an in-flight session that started
|
|
10
|
+
* before the rename keeps the tool name in its snapshot, and refusing it would
|
|
11
|
+
* make the two phases look disjoint. Detection accepts both; only `spec_submit`
|
|
12
|
+
* is registered now.
|
|
8
13
|
*/
|
|
9
14
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
10
15
|
import { getAskControl } from "./ask-control.js";
|
|
11
16
|
|
|
12
|
-
/** Tool the
|
|
13
|
-
export const
|
|
17
|
+
/** Tool the spec feature activates for the whole spec-review phase. */
|
|
18
|
+
export const SPEC_PHASE_TOOL = "spec_submit";
|
|
19
|
+
/** The previous name of the same marker, kept for sessions that predate the rename. */
|
|
20
|
+
export const LEGACY_SPEC_PHASE_TOOL = "plan_submit";
|
|
14
21
|
/** Tool the UAT feature activates while its page/phase is open. */
|
|
15
22
|
export const UAT_PHASE_TOOL = "uat_item";
|
|
16
23
|
|
|
17
|
-
export type Phase = "ask" | "
|
|
24
|
+
export type Phase = "ask" | "spec" | "uat";
|
|
18
25
|
|
|
19
26
|
const PHASE_COMMAND: Record<Phase, string> = {
|
|
20
27
|
ask: "/ask",
|
|
21
|
-
|
|
28
|
+
spec: "/ask-spec",
|
|
22
29
|
uat: "/ask-uat",
|
|
23
30
|
};
|
|
24
31
|
|
|
@@ -26,7 +33,7 @@ export function activePhases(pi: ExtensionAPI): Phase[] {
|
|
|
26
33
|
const tools = new Set(pi.getActiveTools());
|
|
27
34
|
const phases: Phase[] = [];
|
|
28
35
|
if (getAskControl()?.isActive()) phases.push("ask");
|
|
29
|
-
if (tools.has(
|
|
36
|
+
if (tools.has(SPEC_PHASE_TOOL) || tools.has(LEGACY_SPEC_PHASE_TOOL)) phases.push("spec");
|
|
30
37
|
if (tools.has(UAT_PHASE_TOOL)) phases.push("uat");
|
|
31
38
|
return phases;
|
|
32
39
|
}
|
|
@@ -35,3 +42,9 @@ export function activePhases(pi: ExtensionAPI): Phase[] {
|
|
|
35
42
|
export function describePhases(phases: readonly Phase[]): string {
|
|
36
43
|
return phases.map((phase) => PHASE_COMMAND[phase]).join(" + ");
|
|
37
44
|
}
|
|
45
|
+
|
|
46
|
+
/** True when either the current or the pre-rename submit marker is active. */
|
|
47
|
+
export function specPhaseActive(pi: ExtensionAPI): boolean {
|
|
48
|
+
const tools = pi.getActiveTools?.() ?? [];
|
|
49
|
+
return tools.includes(SPEC_PHASE_TOOL) || tools.includes(LEGACY_SPEC_PHASE_TOOL);
|
|
50
|
+
}
|
package/src/lib/web-review.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared web-review server — the HTTP shell used by `/ask-
|
|
2
|
+
* Shared web-review server — the HTTP shell used by `/ask-spec` and `/ask-uat`.
|
|
3
3
|
*
|
|
4
4
|
* Both features do the same thing: serve a small Vite page from inside the pi
|
|
5
5
|
* process, hand it a token, and let it read/write state over HTTP + SSE. The
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-track`),a={equals:r},o=null,s=I,c=1,l=2,u={owned:null,cleanups:null,context:null,owner:null},d=null,f=null,p=null,m=null,h=null,g=0;function _(e,t){let n=p,r=d,i=e.length===0,a=t===void 0?r:t,o=i?u:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(v(o));d=o,p=null;try{return F(s,!0)}finally{p=n,d=r}}function v(e){return()=>C(()=>B(e))}function y(e,t){t=t?Object.assign({},a,t):a;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[A.bind(n),e=>(typeof e==`function`&&(e=f&&f.running&&f.sources.has(n)?e(n.tValue):e(n.value)),ee(n,e))]}function b(e,t,n){j(N(e,t,!1,c))}function x(e,t,n){s=L;let r=N(e,t,!1,c),i=k&&O(k);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),h?h.push(r):j(r)}function S(e,t,n){n=n?Object.assign({},a,n):a;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,j(r),A.bind(r)}function C(e){if(p===null)return e();let t=p;p=null;try{return e()}finally{p=t}}function w(e){x(()=>C(e))}function T(e){return d===null||(d.cleanups===null?d.cleanups=[e]:d.cleanups.push(e)),e}var[E,D]=y(!1);function O(e){let t;return d&&d.context&&(t=d.context[e.id])!==void 0?t:e.defaultValue}var k;function A(){let e=f&&f.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===c)j(this);else{let e=m;m=null,F(()=>R(this),!1),m=e}}if(p){let e=this.observers;if(!e||e[e.length-1]!==p){let t=e?e.length:0;p.sources?(p.sources.push(this),p.sourceSlots.push(t)):(p.sources=[this],p.sourceSlots=[t]),e?(e.push(p),this.observerSlots.push(p.sources.length-1)):(this.observers=[p],this.observerSlots=[p.sources.length-1])}}return e&&f.sources.has(this)?this.tValue:this.value}function ee(e,t,n){let r=f&&f.running&&f.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(f){let r=f.running;(r||!n&&f.sources.has(e))&&(f.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=f&&f.running;r&&f.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?m.push(n):h.push(n),n.observers&&z(n)),r?n.tState=c:n.state=c)}if(m.length>1e6)throw m=[],Error()},!1)}return t}function j(e){if(!e.fn)return;B(e);let t=g;M(e,f&&f.running&&f.sources.has(e)?e.tValue:e.value,t),f&&!f.running&&f.sources.has(e)&&queueMicrotask(()=>{F(()=>{f&&(f.running=!0),p=d=e,M(e,e.tValue,t),p=d=null},!1)})}function M(e,t,n){let r,i=d,a=p;p=d=e;try{r=e.fn(t)}catch(t){return e.pure&&(f&&f.running?(e.tState=c,e.tOwned&&e.tOwned.forEach(B),e.tOwned=void 0):(e.state=c,e.owned&&e.owned.forEach(B),e.owned=null)),e.updatedAt=n+1,U(t)}finally{p=a,d=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?ee(e,r,!0):f&&f.running&&e.pure?(f.sources.has(e)||(e.value=r),f.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=c,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:d,context:d?d.context:null,pure:n};return f&&f.running&&(a.state=0,a.tState=r),d===null||d!==u&&(f&&f.running&&d.pure?d.tOwned?d.tOwned.push(a):d.tOwned=[a]:d.owned?d.owned.push(a):d.owned=[a]),a}function P(e){let t=f&&f.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===l)return R(e);if(e.suspense&&C(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<g);){if(t&&f.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(f.disposed.has(t))return}if((t?e.tState:e.state)===c)j(e);else if((t?e.tState:e.state)===l){let t=m;m=null,F(()=>R(e,n[0]),!1),m=t}}}function F(e,t){if(m)return e();let n=!1;t||(m=[]),h?n=!0:h=[],g++;try{let t=e();return te(n),t}catch(e){n||(h=null),m=null,U(e)}}function te(e){if(m&&=(I(m),null),e)return;let t;if(f){if(!f.promises.size&&!f.queue.size){let e=f.sources,n=f.disposed;h.push.apply(h,f.effects),t=f.resolve;for(let e of h)`tState`in e&&(e.state=e.tState),delete e.tState;f=null,F(()=>{for(let e of n)B(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)B(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}D(!1)},!1)}else if(f.running){f.running=!1,f.effects.push.apply(f.effects,h),h=null,D(!0);return}}let n=h;h=null,n.length&&F(()=>s(n),!1),t&&t()}function I(e){for(let t=0;t<e.length;t++)P(e[t])}function L(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function R(e,t){let n=f&&f.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===c?i!==t&&(!i.updatedAt||i.updatedAt<g)&&P(i):e===l&&R(i,t)}}}function z(e){let t=f&&f.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=l:r.state=l,r.pure?m.push(r):h.push(r),r.observers&&z(r))}}function B(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)B(e.tOwned[t]);delete e.tOwned}if(f&&f.running&&e.pure)V(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)B(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}f&&f.running?e.tState=0:e.state=0}function V(e,t){if(t||(e.tState=0,f.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)V(e.owned[t])}function ne(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function H(e,t,n){try{for(let n of t)n(e)}catch(e){U(e,n&&n.owner||null)}}function U(e,t=d){let n=o&&t&&t.context&&t.context[o],r=ne(e);if(!n)throw r;h?h.push({fn(){H(r,n,t)},state:c}):H(r,n,t)}var W=Symbol(`fallback`);function G(e){for(let t=0;t<e.length;t++)e[t]()}function re(e,t,n={}){let r=[],a=[],o=[],s=0,c=t.length>1?[]:null;return T(()=>G(o)),()=>{let l=e()||[],u=l.length,d,f;return l[i],C(()=>{let e,t,i,m,h,g,v,y,b;if(u===0)s!==0&&(G(o),o=[],r=[],a=[],s=0,c&&=[]),n.fallback&&(r=[W],a[0]=_(e=>(o[0]=e,n.fallback())),s=1);else if(s===0){for(a=Array(u),f=0;f<u;f++)r[f]=l[f],a[f]=_(p);s=u}else{for(i=Array(u),m=Array(u),c&&(h=Array(u)),g=0,v=Math.min(s,u);g<v&&r[g]===l[g];g++);for(v=s-1,y=u-1;v>=g&&y>=g&&r[v]===l[y];v--,y--)i[y]=a[v],m[y]=o[v],c&&(h[y]=c[v]);for(e=new Map,t=Array(y+1),f=y;f>=g;f--)b=l[f],d=e.get(b),t[f]=d===void 0?-1:d,e.set(b,f);for(d=g;d<=v;d++)b=r[d],f=e.get(b),f!==void 0&&f!==-1?(i[f]=a[d],m[f]=o[d],c&&(h[f]=c[d]),f=t[f],e.set(b,f)):o[d]();for(f=g;f<u;f++)f in i?(a[f]=i[f],o[f]=m[f],c&&(c[f]=h[f],c[f](f))):a[f]=_(p);a=a.slice(0,s=u),r=l.slice(0)}return a});function p(e){if(o[f]=e,c){let[e,n]=y(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function K(e,t){return C(()=>e(t||{}))}var ie=e=>`Stale read from <${e}>.`;function q(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return S(re(()=>e.each,e.children,t||void 0))}function J(e){let t=e.keyed,n=S(()=>e.when,void 0,void 0),r=t?n:S(n,void 0,{equals:(e,t)=>!e==!t});return S(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?C(()=>a(t?i:()=>{if(!C(r))throw ie(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var Y=e=>S(()=>e());function ae(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var oe=`_$DX_DELEGATE`;function se(e,t,n,r={}){let i;return _(r=>{i=r,t===document?e():Z(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function X(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>C(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function ce(e,t=window.document){let n=t[oe]||(t[oe]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,he))}}function le(e,t,n){pe(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ue(e,t){pe(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function de(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function fe(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(me(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(me(e,i,!0),n[i]=o)}return n}function Z(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Q(e,t,r,n);b(r=>Q(e,t(),r,n),r)}function pe(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function me(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function he(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Q(e,t,n,r,i){let a=pe(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=$(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=$(e,n,r)}else if(o===`function`)return b(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Q(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ge(o,t,n,i))return b(()=>n=Q(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=$(e,n,r),s)return n}else c?n.length===0?_e(e,o,r):ae(e,n,o):(n&&$(e),_e(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=$(e,n,r,t);$(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ge(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ge(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ge(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function _e(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function $(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var ve=new URLSearchParams(window.location.search).get(`t`)??``;async function ye(e,t={}){let n=await fetch(e,{...t,headers:{...t.body?{"content-type":`application/json`}:{},"x-plan-token":ve,...t.headers??{}}});if(!n.ok)throw Error(`${t.method??`GET`} ${e} → HTTP ${n.status}`);return await n.json()}function be(e){return ye(e===void 0?`/api/state`:`/api/state?version=${e}`)}function xe(e,t){return ye(`/api/annotate`,{method:`POST`,body:JSON.stringify({version:e,annotations:t})})}function Se(e,t){return ye(`/api/decide`,{method:`POST`,body:JSON.stringify({action:e,version:t})})}function Ce(e){try{return JSON.parse(e.data)}catch{return}}function we(e){let t=new EventSource(`/api/events?t=${encodeURIComponent(ve)}`);return t.addEventListener(`revision`,t=>{let n=Ce(t);n&&e.onRevision(n.version)}),t.addEventListener(`annotations`,()=>e.onAnnotations()),t.addEventListener(`decided`,t=>{let n=Ce(t);n&&e.onDecided(n)}),()=>t.close()}var Te=`plan:lang`;function Ee(){let e=localStorage.getItem(Te);return e===`en`||e===`zh`?e:navigator.language.toLowerCase().startsWith(`zh`)?`zh`:`en`}function De(e){localStorage.setItem(Te,e)}var Oe={en:{title:`Plan review`,version:`v{version} of {total}`,changed:`{count} changed`,noChange:`no changes`,expanded:`collapsed unchanged`,showAll:`show unchanged`,onlyChanged:`only changed`,approve:`Approve`,deny:`Send feedback`,globalNotes:`Global notes`,notePlaceholder:`What should change here?`,addNote:`Add note`,save:`Save`,cancel:`Cancel`,remove:`Remove`,verdictChange:`must change`,verdictSuggest:`suggest`,verdictQuestion:`question`,history:`History`,back:`Back to latest`,viewingOld:`Read-only: you are viewing v{v}`,readOnly:`Read-only`,approved:`Approved`,denied:`Feedback sent`,closing:`Closing this tab…`,closeHint:`You can close this tab now.`,waiting:`Waiting for the agent…`,status_unchanged:`unchanged`,status_moved:`moved`,status_modified:`modified`,status_added:`new`,status_removed:`removed`,unchangedHidden:`{count} unchanged blocks hidden`,error:`Something went wrong: {message}`,emptyPlan:`This plan is empty.`,notesHint:`Notes are sent with either decision — approve just means “start implementing”.`,noteCount:`{count} notes`},zh:{title:`计划评审`,version:`第 {version} / {total} 版`,changed:`{count} 处改动`,noChange:`无改动`,expanded:`已折叠未变块`,showAll:`显示未变块`,onlyChanged:`只看改动`,approve:`批准`,deny:`提交意见`,globalNotes:`全局批注`,notePlaceholder:`这里应该怎么改?`,addNote:`添加批注`,save:`保存`,cancel:`取消`,remove:`删除`,verdictChange:`必须改`,verdictSuggest:`建议`,verdictQuestion:`疑问`,history:`历史`,back:`回到最新版`,viewingOld:`只读:正在查看第 {v} 版`,readOnly:`只读`,approved:`已批准`,denied:`意见已提交`,closing:`正在关闭标签页…`,closeHint:`现在可以关闭这个标签页了。`,waiting:`等待模型继续…`,status_unchanged:`未变`,status_moved:`位置移动`,status_modified:`已修改`,status_added:`新增`,status_removed:`已删除`,unchangedHidden:`隐藏了 {count} 个未变块`,error:`出错了:{message}`,emptyPlan:`计划是空的。`,notesHint:`批注无论批准还是提意见都会送达;批准只是让模型开始实施。`,noteCount:`{count} 条批注`}};function ke(e,t,n={}){return(Oe[e][t]??t).replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??`{${t}}`))}var Ae=X(`<span class=readonly>`),je=X(`<div class=error>`),Me=X(`<div class=banner><button class=link>`),Ne=X(`<div class=done><div class=done-title></div><div class=done-hint>`),Pe=X(`<p class=empty>`),Fe=X(`<div class=hidden-note><button class=link>`),Ie=X(`<div class=global-panel>`),Le=X(`<div class=page><header class=topbar><div class=topbar-left><span class=slug></span><span class=version></span><span class=changed></span></div><div class=topbar-right><button class=ghost></button><button class=ghost> (<!>)</button><button class=lang></button></div></header><div class=history><span class=history-label></span></div><main class=blocks></main><footer class=footer><div class=hint> · </div><div class=actions><button class=deny></button><button class=approve>`),Re=X(`<span class=chip-changed>+`),ze=X(`<button class=chip>v`),Be=X(`<button class=add>+ `),Ve=X(`<article class=block><div class=block-head><span></span><span class=block-id></span></div><div class=block-body>`),He=X(`<button class=remove>`),Ue=X(`<div class=note><span class=note-verdict></span><span class=note-text>`),We=X(`<div class=note><span class=note-verdict></span><span class=note-text></span><button class=remove>`),Ge=X(`<div class=editor><div class=verdicts></div><textarea></textarea><div class=editor-actions><button class=ghost></button><button class=primary>`),Ke=X(`<label><input type=radio name=verdict>`);function qe(){let[e,t]=y(Ee()),[n,r]=y(),[i,a]=y(),[o,s]=y(),[c,l]=y(),[u,d]=y(!1),[f,p]=y(),[m,h]=y(``),[g,_]=y(`change`),[v,x]=y(!1),C=(t,n)=>ke(e(),t,n);async function E(e){try{let t=await be(e);r(t),s(void 0),l(t.decided&&t.decision?t.decision.action:void 0)}catch(e){s(e instanceof Error?e.message:String(e))}}w(()=>{E(),T(we({onRevision:()=>{i()===void 0&&E()},onAnnotations:()=>{i()===void 0&&E()},onDecided:e=>l(e.action)}))});let D=S(()=>n()?.items??[]),O=S(()=>D().filter(e=>e.status!==`unchanged`).length),k=S(()=>!u()&&O()>0),A=S(()=>k()?D().filter(e=>e.status===`unchanged`).length:0),ee=S(()=>k()?D().filter(e=>e.status!==`unchanged`):D()),j=S(()=>n()?.history[0]?.n??n()?.version),M=S(()=>{let e=n();return e!==void 0&&e.version!==j()}),N=e=>n()?.annotations.blocks.find(t=>t.blockId===e)?.annotations??[],P=S(()=>{let e=n()?.annotations;if(!e)return 0;let t=e.blocks.reduce((e,t)=>e+t.annotations.length,0);return e.global.length+t});async function F(e){let t=n();if(!t)return;let i={...t,annotations:e};r(i);try{await xe(t.version,e)}catch(e){s(e instanceof Error?e.message:String(e)),await E(t.version)}}async function te(e){let t=m().trim();if(t===``)return;let r=n();if(!r)return;let i={verdict:g(),comment:t},a;if(e===void 0)a={...r.annotations,global:[...r.annotations.global,i]};else{let t=r.annotations.blocks.slice(),n=t.findIndex(t=>t.blockId===e);n===-1?t.push({blockId:e,annotations:[i]}):t[n]={...t[n],annotations:[...t[n].annotations,i]},a={...r.annotations,blocks:t}}p(void 0),h(``),await F(a)}async function I(e,t){let r=n();if(!r)return;let i;i=e===void 0?{...r.annotations,global:r.annotations.global.filter((e,n)=>n!==t)}:{...r.annotations,blocks:r.annotations.blocks.map(n=>n.blockId===e?{...n,annotations:n.annotations.filter((e,n)=>n!==t)}:n).filter(e=>e.annotations.length>0)},await F(i)}async function L(e){let t=n();if(t)try{await Se(e,t.version),l(e),window.close(),setTimeout(()=>x(!0),300)}catch(e){s(e instanceof Error?e.message:String(e))}}let R=e=>`badge badge-${e}`;return(()=>{var r=Le(),s=r.firstChild,l=s.firstChild,y=l.firstChild,x=y.nextSibling,S=x.nextSibling,w=l.nextSibling.firstChild,T=w.nextSibling,D=T.firstChild,k=D.nextSibling;k.nextSibling;var F=T.nextSibling,z=s.nextSibling,B=z.firstChild,V=z.nextSibling,ne=V.nextSibling,H=ne.firstChild,U=H.firstChild,W=H.nextSibling.firstChild,G=W.nextSibling;return Z(y,()=>n()?.slug),Z(x,()=>C(`version`,{version:n()?.version??0,total:n()?.totalVersions??0})),Z(S,(()=>{var e=Y(()=>O()>0);return()=>e()?C(`changed`,{count:O()}):C(`noChange`)})()),Z(l,K(J,{get when(){return M()},get children(){var e=Ae();return Z(e,()=>C(`readOnly`)),e}}),null),w.$$click=()=>d(!u()),Z(w,(()=>{var e=Y(()=>!!u());return()=>e()?C(`onlyChanged`):C(`showAll`)})()),T.$$click=()=>p({blockId:void 0}),Z(T,()=>C(`globalNotes`),D),Z(T,()=>n()?.annotations.global.length??0,k),F.$$click=()=>{let n=e()===`en`?`zh`:`en`;t(n),De(n)},Z(F,()=>e()===`en`?`中文`:`EN`),Z(r,K(J,{get when(){return o()},get children(){var e=je();return Z(e,()=>C(`error`,{message:o()??``})),e}}),z),Z(r,K(J,{get when(){return M()},get children(){var e=Me(),t=e.firstChild;return Z(e,()=>C(`viewingOld`,{v:i()??0}),t),t.$$click=()=>{a(void 0),E()},Z(t,()=>C(`back`)),e}}),z),Z(r,K(J,{get when(){return c()},get children(){var e=Ne(),t=e.firstChild,n=t.nextSibling;return Z(t,(()=>{var e=Y(()=>c()===`approve`);return()=>e()?C(`approved`):C(`denied`)})()),Z(n,(()=>{var e=Y(()=>!!v());return()=>e()?C(`closeHint`):C(`closing`)})()),e}}),z),Z(B,()=>C(`history`)),Z(z,K(q,{get each(){return n()?.history??[]},children:e=>(()=>{var t=ze();return t.firstChild,t.$$click=()=>{e.n===j()?(a(void 0),E()):(a(e.n),E(e.n))},Z(t,()=>e.n,null),Z(t,K(J,{get when(){return e.changed>0},get children(){var t=Re();return t.firstChild,Z(t,()=>e.changed,null),t}}),null),b(()=>t.classList.toggle(`active`,e.n===n()?.version)),t})()}),null),Z(r,K(J,{get when(){return Y(()=>!!n())()&&n().items.length===0},get children(){var e=Pe();return Z(e,()=>C(`emptyPlan`)),e}}),V),Z(V,K(J,{get when(){return A()>0},get children(){var e=Fe(),t=e.firstChild;return Z(e,()=>C(`unchangedHidden`,{count:A()}),t),t.$$click=()=>d(!0),Z(t,()=>C(`showAll`)),e}}),null),Z(V,K(q,{get each(){return ee()},children:e=>(()=>{var t=Ve(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return Z(r,()=>C(`status_${e.status}`)),Z(i,()=>e.id),Z(n,K(J,{get when(){return!M()},get children(){var t=Be();return t.firstChild,t.$$click=()=>{p({blockId:e.id}),h(``),_(`change`)},Z(t,()=>C(`addNote`),null),t}}),null),Z(t,K(q,{get each(){return N(e.id)},children:(t,n)=>(()=>{var r=Ue(),i=r.firstChild,a=i.nextSibling;return Z(i,()=>C(`verdict${t.verdict[0].toUpperCase()}${t.verdict.slice(1)}`)),Z(a,()=>t.comment),Z(r,K(J,{get when(){return!M()},get children(){var t=He();return t.$$click=()=>void I(e.id,n()),Z(t,()=>C(`remove`)),t}}),null),b(e=>fe(r,{[t.verdict]:!0},e)),r})()}),null),Z(t,K(J,{get when(){return Y(()=>f()?.blockId===e.id)()&&!M()},get children(){return K(Je,{draft:m,setDraft:h,verdict:g,setVerdict:_,onSave:()=>void te(e.id),onCancel:()=>p(void 0),t:C})}}),null),b(n=>{var i={[`is-`+e.status]:!0},o=R(e.status),s=e.html;return n.e=fe(t,i,n.e),o!==n.t&&ue(r,n.t=o),s!==n.a&&(a.innerHTML=n.a=s),n},{e:void 0,t:void 0,a:void 0}),t})()}),null),Z(r,K(J,{get when(){return Y(()=>!!(f()&&f().blockId===void 0))()&&!M()},get children(){var e=Ie();return Z(e,K(q,{get each(){return n()?.annotations.global??[]},children:(e,t)=>(()=>{var n=We(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling;return Z(r,()=>e.verdict),Z(i,()=>e.comment),a.$$click=()=>void I(void 0,t()),Z(a,()=>C(`remove`)),b(t=>fe(n,{[e.verdict]:!0},t)),n})()}),null),Z(e,K(Je,{draft:m,setDraft:h,verdict:g,setVerdict:_,onSave:()=>void te(void 0),onCancel:()=>p(void 0),t:C}),null),e}}),ne),Z(H,()=>C(`notesHint`),U),Z(H,()=>C(`noteCount`,{count:P()}),null),W.$$click=()=>void L(`deny`),Z(W,()=>C(`deny`)),G.$$click=()=>void L(`approve`),Z(G,()=>C(`approve`)),b(e=>{var t=M()||c()!==void 0,n=M()||c()!==void 0;return t!==e.e&&(W.disabled=e.e=t),n!==e.t&&(G.disabled=e.t=n),e},{e:void 0,t:void 0}),r})()}function Je(e){return(()=>{var t=Ge(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling;return Z(n,K(q,{each:[`change`,`suggest`,`question`],children:t=>(()=>{var n=Ke(),r=n.firstChild;return r.addEventListener(`change`,()=>e.setVerdict(t)),Z(n,()=>e.t(`verdict${t[0].toUpperCase()}${t.slice(1)}`),null),b(()=>n.classList.toggle(`active`,e.verdict()===t)),b(()=>r.checked=e.verdict()===t),n})()})),r.$$input=t=>e.setDraft(t.currentTarget.value),de(i,`click`,e.onCancel,!0),Z(i,()=>e.t(`cancel`)),de(a,`click`,e.onSave,!0),Z(a,()=>e.t(`save`)),b(t=>{var n=e.t(`notePlaceholder`),i=e.draft().trim()===``;return n!==t.e&&le(r,`placeholder`,t.e=n),i!==t.t&&(a.disabled=t.t=i),t},{e:void 0,t:void 0}),b(()=>r.value=e.draft()),t})()}ce([`click`,`input`]);var Ye=document.getElementById(`root`);Ye&&se(()=>K(qe,{}),Ye);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--bg:#14171d;--panel:#1b1f27;--panel-2:#20252f;--line:#2b323d;--text:#d7dce4;--dim:#8b94a3;--green:#3fb950;--amber:#d29922;--blue:#58a6ff;--red:#f85149;--radius:8px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);margin:0;font:14px/1.65 ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Noto Sans CJK SC,sans-serif}.page{max-width:980px;margin:0 auto;padding:0 20px 120px}.topbar{z-index:10;background:linear-gradient(var(--bg) 78%, transparent);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:14px 0 12px;display:flex;position:sticky;top:0}.topbar-left,.topbar-right{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.slug{font-weight:600}.version,.changed,.readonly{color:var(--dim);font-variant-numeric:tabular-nums}.readonly{color:var(--amber);border:1px solid var(--amber);border-radius:999px;padding:0 8px}button{font:inherit;cursor:pointer;border-radius:var(--radius);border:1px solid var(--line);background:var(--panel);color:var(--text);padding:6px 12px}button:hover:not(:disabled){background:var(--panel-2);border-color:#3a4350}button:disabled{opacity:.45;cursor:not-allowed}button.primary{color:#fff;background:#1f6feb;border-color:#1f6feb}button.approve{color:#fff;background:#1a7f37;border-color:#1a7f37}button.deny{background:#3d1f22;border-color:#6e2a2f}button.link{color:var(--blue);background:0 0;border:none;padding:0 4px;text-decoration:underline}.lang{min-width:52px}.error{border:1px solid var(--red);color:#ffb4ad;border-radius:var(--radius);margin:8px 0;padding:8px 12px}.banner{border:1px solid var(--amber);border-radius:var(--radius);color:#f0d08a;margin:8px 0;padding:8px 12px}.done{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);margin:12px 0;padding:16px}.done-title{font-size:18px;font-weight:600}.done-hint{color:var(--dim)}.history{border-bottom:1px solid var(--line);flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0 16px;display:flex}.history-label{color:var(--dim)}.chip{font-variant-numeric:tabular-nums;border-radius:999px;padding:2px 10px}.chip.active{border-color:var(--blue);color:var(--blue)}.chip-changed{color:var(--amber);margin-left:6px}.blocks{flex-direction:column;gap:14px;padding-top:18px;display:flex}.hidden-note{color:var(--dim);text-align:center;border:1px dashed var(--line);border-radius:var(--radius);padding:6px}.block{border:1px solid var(--line);border-left:4px solid var(--line);border-radius:var(--radius);background:var(--panel);padding:10px 14px}.block.is-added{border-left-color:var(--green)}.block.is-modified{border-left-color:var(--amber)}.block.is-moved{border-left-color:var(--blue)}.block.is-removed{border-left-color:var(--red);opacity:.75}.block.is-removed .block-body{color:var(--dim);text-decoration:line-through}.block-head{align-items:center;gap:8px;margin-bottom:6px;display:flex}.block-id{color:var(--dim);opacity:.6;font:11px/1 ui-monospace,monospace}.add{margin-left:auto;padding:2px 8px;font-size:12px}.block-body>:first-child{margin-top:0}.block-body>:last-child{margin-bottom:0}.block-body pre,.block-body code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.block-body pre{border:1px solid var(--line);border-radius:var(--radius);background:#0f1217;padding:10px 12px;overflow:auto}.block-body :not(pre)>code{background:#262c36;border-radius:4px;padding:1px 5px;font-size:.92em}.block-body a{color:var(--blue)}.block-body table{border-collapse:collapse}.block-body th,.block-body td{border:1px solid var(--line);padding:4px 8px}.block-body blockquote{border-left:3px solid var(--line);color:var(--dim);margin:0;padding-left:12px}.badge{border:1px solid var(--line);color:var(--dim);text-transform:uppercase;letter-spacing:.04em;border-radius:999px;padding:1px 8px;font-size:11px}.badge-unchanged{display:none}.badge-added{border-color:var(--green);color:var(--green)}.badge-modified{border-color:var(--amber);color:var(--amber)}.badge-moved{border-color:var(--blue);color:var(--blue)}.badge-removed{border-color:var(--red);color:var(--red)}.note{border-radius:var(--radius);background:var(--panel-2);border-left:3px solid var(--line);align-items:baseline;gap:8px;margin-top:8px;padding:6px 10px;display:flex}.note.change{border-left-color:var(--red)}.note.suggest{border-left-color:var(--blue)}.note.question{border-left-color:var(--dim)}.note-verdict{text-transform:uppercase;color:var(--dim);letter-spacing:.04em;font-size:11px}.note-text{white-space:pre-wrap;flex:1}.remove{padding:0 8px;font-size:12px}.editor,.global-panel{border:1px dashed var(--line);border-radius:var(--radius);background:var(--panel-2);margin-top:10px;padding:10px}.global-panel{margin:16px 0}.verdicts{color:var(--dim);gap:14px;margin-bottom:8px;display:flex}.verdicts label{cursor:pointer}.verdicts label.active{color:var(--text)}.verdicts input{margin-right:4px}.editor textarea{resize:vertical;width:100%;min-height:70px;color:var(--text);border:1px solid var(--line);border-radius:var(--radius);font:inherit;background:#0f1217;padding:8px}.editor-actions{justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.footer{border-top:1px solid var(--line);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#14171df0;justify-content:space-between;align-items:center;gap:16px;padding:12px 24px;display:flex;position:fixed;bottom:0;left:0;right:0}.hint{color:var(--dim);font-size:12px}.actions{gap:10px;display:flex}.empty{color:var(--dim)}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|