@firstpick/pi-package-webui 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -25
- package/bin/pi-webui.mjs +469 -106
- package/index.ts +10 -1
- package/lib/git-live-watcher.mjs +135 -0
- package/lib/git-message-artifacts.mjs +103 -0
- package/lib/git-workflow-preferences.mjs +10 -3
- package/lib/process-tree.mjs +3 -1
- package/lib/webui-output-mode.mjs +97 -0
- package/package.json +7 -6
- package/public/app.js +1170 -97
- package/public/fast-output-live.mjs +179 -0
- package/public/index.html +31 -5
- package/public/service-worker.js +2 -1
- package/public/styles.css +474 -12
- package/tests/app-runner-windows-conpty-harness.test.mjs +140 -0
- package/tests/danger-button-contrast-static.test.mjs +32 -0
- package/tests/fast-mode-client-static.test.mjs +121 -0
- package/tests/fast-mode-output-work.test.mjs +69 -0
- package/tests/fast-mode-sse-harness.test.mjs +204 -0
- package/tests/fast-output-live.test.mjs +106 -0
- package/tests/fixtures/fake-pi.mjs +59 -0
- package/tests/fixtures/fast-mode-output-events.mjs +50 -0
- package/tests/footer-middle-truncation.test.mjs +118 -0
- package/tests/git-live-watcher.test.mjs +93 -0
- package/tests/git-message-artifacts.test.mjs +59 -0
- package/tests/git-panel-live-updates-static.test.mjs +54 -0
- package/tests/git-panel-render-stability-static.test.mjs +1 -1
- package/tests/git-workflow-preferences.test.mjs +8 -2
- package/tests/guided-git-message-reliability-static.test.mjs +38 -0
- package/tests/http-endpoints-harness.test.mjs +61 -5
- package/tests/image-payload-hardening-harness.test.mjs +115 -0
- package/tests/mobile-static.test.mjs +79 -20
- package/tests/pi-footer-calibration-static.test.mjs +55 -0
- package/tests/remote-auth-settings-harness.test.mjs +1 -1
- package/tests/runtime-error-visibility.test.mjs +63 -0
- package/tests/side-panel-context-menu-static.test.mjs +74 -0
- package/tests/webui-output-mode.test.mjs +73 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import {
|
|
3
|
+
createFastOutputLiveState,
|
|
4
|
+
createSustainedFlushScheduler,
|
|
5
|
+
fastOutputLiveTextAndThinking,
|
|
6
|
+
reduceFastOutputLiveEvent,
|
|
7
|
+
seedFastOutputLiveState,
|
|
8
|
+
shouldConsumeFastOutputLiveEvent,
|
|
9
|
+
} from "../public/fast-output-live.mjs";
|
|
10
|
+
|
|
11
|
+
class FakeClock {
|
|
12
|
+
#now = 0;
|
|
13
|
+
#nextId = 1;
|
|
14
|
+
#timers = new Map();
|
|
15
|
+
|
|
16
|
+
now = () => this.#now;
|
|
17
|
+
setTimer = (callback, delay) => {
|
|
18
|
+
const id = this.#nextId++;
|
|
19
|
+
this.#timers.set(id, { callback, at: this.#now + delay });
|
|
20
|
+
return id;
|
|
21
|
+
};
|
|
22
|
+
clearTimer = (id) => this.#timers.delete(id);
|
|
23
|
+
advance(ms) {
|
|
24
|
+
this.#now += ms;
|
|
25
|
+
let due = [...this.#timers.entries()].filter(([, timer]) => timer.at <= this.#now).sort((a, b) => a[1].at - b[1].at);
|
|
26
|
+
while (due.length) {
|
|
27
|
+
for (const [id, timer] of due) {
|
|
28
|
+
this.#timers.delete(id);
|
|
29
|
+
timer.callback();
|
|
30
|
+
}
|
|
31
|
+
due = [...this.#timers.entries()].filter(([, timer]) => timer.at <= this.#now).sort((a, b) => a[1].at - b[1].at);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let state = createFastOutputLiveState();
|
|
37
|
+
let reduction = reduceFastOutputLiveEvent(state, { type: "message_update", assistantMessageEvent: { type: "text_delta", delta: "A🦄" } });
|
|
38
|
+
state = reduction.state;
|
|
39
|
+
assert.equal(reduction.changed, true);
|
|
40
|
+
assert.equal(state.text, "A🦄", "raw Unicode text deltas should be retained exactly");
|
|
41
|
+
|
|
42
|
+
reduction = reduceFastOutputLiveEvent(state, { type: "message_update", assistantMessageEvent: { type: "thinking_delta", delta: "plan\n" } });
|
|
43
|
+
state = reduction.state;
|
|
44
|
+
assert.equal(state.thinking, "plan\n", "thinking deltas should use a separate raw accumulator");
|
|
45
|
+
|
|
46
|
+
reduction = reduceFastOutputLiveEvent(state, { type: "message_update", assistantMessageEvent: { type: "toolcall_delta", delta: "{\"path\":", toolCall: { id: "tool-1", name: "read" } } });
|
|
47
|
+
state = reduction.state;
|
|
48
|
+
reduction = reduceFastOutputLiveEvent(reduction.state, { type: "message_update", assistantMessageEvent: { type: "toolcall_end", toolCall: { id: "tool-1", name: "read", arguments: { path: "README.md" } } } });
|
|
49
|
+
assert.equal(reduction.state.toolCall.id, "tool-1");
|
|
50
|
+
assert.equal(reduction.state.toolCall.name, "read");
|
|
51
|
+
assert.equal(reduction.state.toolCall.arguments, '{"path":"README.md"}');
|
|
52
|
+
assert.equal(reduction.state.toolCall.complete, true, "self-contained tool end should preserve direct completion data");
|
|
53
|
+
|
|
54
|
+
reduction = reduceFastOutputLiveEvent(reduction.state, { type: "message_update", assistantMessageEvent: { type: "text_end", content: "final ✅" } });
|
|
55
|
+
assert.equal(reduction.state.text, "final ✅", "self-contained text ends should reconcile from direct compact fields");
|
|
56
|
+
assert.equal(reduceFastOutputLiveEvent(reduction.state, { type: "message_update", assistantMessageEvent: { type: "error", errorMessage: "preserve normal error handling" } }).changed, false, "unrecognized/error shapes should remain available to normal diagnostics");
|
|
57
|
+
|
|
58
|
+
// A1: seed normal live content before compact deltas replace its DOM bubble.
|
|
59
|
+
const seededFromNormal = seedFastOutputLiveState({ text: "before switch", thinking: "reasoning before switch" });
|
|
60
|
+
assert.deepEqual(fastOutputLiveTextAndThinking(seededFromNormal), { text: "before switch", thinking: "reasoning before switch" }, "normal live text/thinking should seed one compact live state");
|
|
61
|
+
const continuedCompact = reduceFastOutputLiveEvent(seededFromNormal, { type: "message_update", assistantMessageEvent: { type: "text_delta", delta: " + compact delta" } });
|
|
62
|
+
assert.equal(continuedCompact.state.text, "before switch + compact delta", "compact deltas should continue the seeded normal text in one state");
|
|
63
|
+
|
|
64
|
+
// A2: snapshot compact state before normal rich rendering resumes.
|
|
65
|
+
assert.deepEqual(fastOutputLiveTextAndThinking(continuedCompact.state), { text: "before switch + compact delta", thinking: "reasoning before switch" }, "compact live text/thinking should transfer intact to normal mode");
|
|
66
|
+
|
|
67
|
+
// A3: recognized empty compact end variants have stripped snapshots, so consume
|
|
68
|
+
// them rather than falling into normal handlers that expect those snapshots.
|
|
69
|
+
const emptyCompactTextEnd = reduceFastOutputLiveEvent(createFastOutputLiveState(), { type: "message_update", assistantMessageEvent: { type: "text_end", content: "", delta: "" } });
|
|
70
|
+
const emptyCompactThinkingEnd = reduceFastOutputLiveEvent(createFastOutputLiveState(), { type: "message_update", assistantMessageEvent: { type: "thinking_end", content: "", delta: "" } });
|
|
71
|
+
assert.equal(emptyCompactTextEnd.changed, false, "empty self-contained ends should not request a DOM write");
|
|
72
|
+
assert.equal(emptyCompactTextEnd.kind, "text-end");
|
|
73
|
+
assert.equal(emptyCompactThinkingEnd.changed, false, "empty thinking ends should not request a DOM write");
|
|
74
|
+
assert.equal(emptyCompactThinkingEnd.kind, "thinking-end");
|
|
75
|
+
assert.equal(shouldConsumeFastOutputLiveEvent(emptyCompactTextEnd), true, "recognized empty text end variants should be consumed safely");
|
|
76
|
+
assert.equal(shouldConsumeFastOutputLiveEvent(emptyCompactThinkingEnd), true, "recognized empty thinking end variants should be consumed safely");
|
|
77
|
+
assert.equal(shouldConsumeFastOutputLiveEvent({ changed: false, kind: "ignored" }), false, "unknown compact shapes should still fall through to normal diagnostics");
|
|
78
|
+
|
|
79
|
+
const clock = new FakeClock();
|
|
80
|
+
const flushes = [];
|
|
81
|
+
const scheduler = createSustainedFlushScheduler({
|
|
82
|
+
flush: () => flushes.push(clock.now()),
|
|
83
|
+
now: clock.now,
|
|
84
|
+
setTimer: clock.setTimer,
|
|
85
|
+
clearTimer: clock.clearTimer,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
assert.equal(scheduler.request(), true, "the first pending output should flush immediately for liveness");
|
|
89
|
+
assert.deepEqual(flushes, [0]);
|
|
90
|
+
scheduler.request();
|
|
91
|
+
clock.advance(99);
|
|
92
|
+
assert.deepEqual(flushes, [0], "sustained output must wait for the 100 ms coalescing boundary");
|
|
93
|
+
clock.advance(1);
|
|
94
|
+
assert.deepEqual(flushes, [0, 100]);
|
|
95
|
+
scheduler.request();
|
|
96
|
+
clock.advance(25);
|
|
97
|
+
assert.equal(scheduler.flushNow(), true, "terminal boundaries synchronously flush pending output");
|
|
98
|
+
assert.deepEqual(flushes, [0, 100, 125]);
|
|
99
|
+
clock.advance(200);
|
|
100
|
+
assert.deepEqual(flushes, [0, 100, 125], "a terminal flush cancels its pending timer");
|
|
101
|
+
scheduler.request();
|
|
102
|
+
scheduler.cancel();
|
|
103
|
+
clock.advance(200);
|
|
104
|
+
assert.deepEqual(flushes, [0, 100, 125], "reset/tab/mode cancellation drops pending compact work");
|
|
105
|
+
|
|
106
|
+
console.log("fast-output-live.test.mjs passed");
|
|
@@ -307,6 +307,63 @@ function handleDocumentArtifactFixturePrompt(command, base) {
|
|
|
307
307
|
return true;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
function fastModeMessageUpdate(delta, accumulated) {
|
|
311
|
+
const partial = { role: "assistant", content: [{ type: "text", text: accumulated }] };
|
|
312
|
+
return {
|
|
313
|
+
type: "message_update",
|
|
314
|
+
message: partial,
|
|
315
|
+
assistantMessageEvent: { type: "text_delta", delta, contentIndex: 0, partial },
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function runFastModeFixtureFlow({ barrierOnly = false } = {}) {
|
|
320
|
+
const toolCallId = "fast-mode-tool";
|
|
321
|
+
const firstText = "fast mode first delta ";
|
|
322
|
+
const finalText = `${firstText}and final delta`;
|
|
323
|
+
const finish = () => {
|
|
324
|
+
emitEvent({ type: "message_end", message: { role: "assistant", content: [{ type: "text", text: finalText }] } });
|
|
325
|
+
emitEvent({ type: "agent_end" });
|
|
326
|
+
};
|
|
327
|
+
emitEvent({ type: "agent_start" });
|
|
328
|
+
emitEvent({ type: "message_start", message: { role: "assistant" } });
|
|
329
|
+
emitEvent(fastModeMessageUpdate(firstText, firstText));
|
|
330
|
+
if (barrierOnly) {
|
|
331
|
+
setTimeout(finish, 180);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
setTimeout(() => {
|
|
335
|
+
emitEvent({ type: "tool_execution_start", toolCallId, toolName: "read", args: { path: "fast-mode.txt" } });
|
|
336
|
+
emitEvent({ type: "tool_execution_update", toolCallId, toolName: "read", partialResult: { content: [{ type: "text", text: "intermediate tool work" }] } });
|
|
337
|
+
emitEvent({ type: "tool_execution_end", toolCallId, toolName: "read", isError: false, result: { content: [{ type: "text", text: "final tool result" }] } });
|
|
338
|
+
emitEvent({ type: "pi_stderr", text: "fast mode fixture diagnostic" });
|
|
339
|
+
emitEvent({ type: "extension_ui_request", id: "fast-mode-dialog", method: "confirm", title: "Fast mode dialog", message: "Preserve this dialog" });
|
|
340
|
+
emitEvent(fastModeMessageUpdate("and final delta", finalText));
|
|
341
|
+
finish();
|
|
342
|
+
}, 20);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function runFastModeHistoryFlow() {
|
|
346
|
+
let accumulated = "";
|
|
347
|
+
emitEvent({ type: "agent_start" });
|
|
348
|
+
emitEvent({ type: "message_start", message: { role: "assistant" } });
|
|
349
|
+
for (let index = 0; index < 512; index += 1) {
|
|
350
|
+
const delta = `h${String(index).padStart(3, "0")}`;
|
|
351
|
+
accumulated += delta;
|
|
352
|
+
emitEvent(fastModeMessageUpdate(delta, accumulated));
|
|
353
|
+
}
|
|
354
|
+
emitEvent({ type: "message_end", message: { role: "assistant", content: [{ type: "text", text: accumulated }] } });
|
|
355
|
+
emitEvent({ type: "agent_end" });
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function handleFastModeFixturePrompt(command, base) {
|
|
359
|
+
const message = String(command.message || "").trim();
|
|
360
|
+
if (!["fixture fast mode flow", "fixture fast mode barrier", "fixture fast mode history"].includes(message)) return false;
|
|
361
|
+
respond({ ...base, data: { output: "fast mode fixture accepted" } });
|
|
362
|
+
if (message.endsWith("history")) runFastModeHistoryFlow();
|
|
363
|
+
else runFastModeFixtureFlow({ barrierOnly: message.endsWith("barrier") });
|
|
364
|
+
return true;
|
|
365
|
+
}
|
|
366
|
+
|
|
310
367
|
function handleTransportFixturePrompt(command, base) {
|
|
311
368
|
const message = String(command.message || "").trim();
|
|
312
369
|
if (message === "fixture stderr diagnostic") {
|
|
@@ -439,6 +496,7 @@ rl.on("line", (line) => {
|
|
|
439
496
|
direction: "command",
|
|
440
497
|
type,
|
|
441
498
|
...(command.message !== undefined ? { message: String(command.message) } : {}),
|
|
499
|
+
...(Array.isArray(command.images) ? { images: command.images } : {}),
|
|
442
500
|
...(command.provider !== undefined ? { provider: String(command.provider) } : {}),
|
|
443
501
|
...(command.modelId !== undefined ? { modelId: String(command.modelId) } : {}),
|
|
444
502
|
});
|
|
@@ -509,6 +567,7 @@ rl.on("line", (line) => {
|
|
|
509
567
|
}
|
|
510
568
|
case "prompt":
|
|
511
569
|
if (handleWebuiHelperPrompt(command, base)) return;
|
|
570
|
+
if (handleFastModeFixturePrompt(command, base)) return;
|
|
512
571
|
if (handleTransportFixturePrompt(command, base)) return;
|
|
513
572
|
if (handleSubagentFixturePrompt(command, base)) return;
|
|
514
573
|
if (handleDocumentArtifactFixturePrompt(command, base)) return;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const DELTA_COUNT = 512;
|
|
2
|
+
const DELTA_BYTES = 32;
|
|
3
|
+
|
|
4
|
+
function fixedDelta(index) {
|
|
5
|
+
return `d${String(index).padStart(4, "0")}${"x".repeat(DELTA_BYTES - 5)}`;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function assistantSnapshot(text) {
|
|
9
|
+
return {
|
|
10
|
+
role: "assistant",
|
|
11
|
+
content: [{ type: "text", text }],
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createFastModeOutputEvents() {
|
|
16
|
+
const events = [
|
|
17
|
+
{ type: "agent_start", tabId: "fast-mode-trace" },
|
|
18
|
+
{ type: "tool_execution_start", tabId: "fast-mode-trace", toolCallId: "trace-tool", toolName: "read", args: { path: "trace.txt" } },
|
|
19
|
+
{ type: "tool_execution_end", tabId: "fast-mode-trace", toolCallId: "trace-tool", toolName: "read", isError: false, result: { content: [{ type: "text", text: "trace result" }] } },
|
|
20
|
+
{ type: "pi_stdout_parse_error", tabId: "fast-mode-trace", error: "trace diagnostic" },
|
|
21
|
+
{ type: "message_start", tabId: "fast-mode-trace", message: { role: "assistant" } },
|
|
22
|
+
];
|
|
23
|
+
let accumulated = "";
|
|
24
|
+
for (let index = 0; index < DELTA_COUNT; index += 1) {
|
|
25
|
+
const delta = fixedDelta(index);
|
|
26
|
+
accumulated += delta;
|
|
27
|
+
const snapshot = assistantSnapshot(accumulated);
|
|
28
|
+
events.push({
|
|
29
|
+
type: "message_update",
|
|
30
|
+
tabId: "fast-mode-trace",
|
|
31
|
+
contentIndex: 0,
|
|
32
|
+
message: snapshot,
|
|
33
|
+
assistantMessageEvent: {
|
|
34
|
+
type: "text_delta",
|
|
35
|
+
delta,
|
|
36
|
+
contentIndex: 0,
|
|
37
|
+
partial: assistantSnapshot(accumulated),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
events.push(
|
|
42
|
+
{ type: "message_end", tabId: "fast-mode-trace", message: assistantSnapshot(accumulated) },
|
|
43
|
+
{ type: "agent_end", tabId: "fast-mode-trace" },
|
|
44
|
+
);
|
|
45
|
+
return events;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function fixedFastModeTraceMetadata() {
|
|
49
|
+
return { deltaCount: DELTA_COUNT, deltaBytes: DELTA_BYTES, finalBytes: DELTA_COUNT * DELTA_BYTES };
|
|
50
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import vm from "node:vm";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
+
const [app, css] = await Promise.all([
|
|
9
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
function findFunctionSource(source, name) {
|
|
14
|
+
const signature = new RegExp(`function\\s+${name}\\s*\\(`, "m");
|
|
15
|
+
const match = signature.exec(source);
|
|
16
|
+
assert.ok(match, `${name} should be defined`);
|
|
17
|
+
let parenDepth = 0;
|
|
18
|
+
let openBrace = -1;
|
|
19
|
+
for (let index = match.index + match[0].length - 1; index < source.length; index += 1) {
|
|
20
|
+
const char = source[index];
|
|
21
|
+
if (char === "(") parenDepth += 1;
|
|
22
|
+
else if (char === ")") parenDepth -= 1;
|
|
23
|
+
else if (char === "{" && parenDepth === 0) {
|
|
24
|
+
openBrace = index;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
assert.notEqual(openBrace, -1, `${name} body should open`);
|
|
29
|
+
let depth = 0;
|
|
30
|
+
for (let index = openBrace; index < source.length; index += 1) {
|
|
31
|
+
const char = source[index];
|
|
32
|
+
if (char === "{") depth += 1;
|
|
33
|
+
else if (char === "}") {
|
|
34
|
+
depth -= 1;
|
|
35
|
+
if (depth === 0) return source.slice(match.index, index + 1);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
assert.fail(`${name} body should close`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const context = {
|
|
42
|
+
FOOTER_MIDDLE_TRUNCATION_END_CHARS: 16,
|
|
43
|
+
FOOTER_MIDDLE_TRUNCATION_MIN_START_CHARS: 6,
|
|
44
|
+
};
|
|
45
|
+
vm.runInNewContext(
|
|
46
|
+
`${findFunctionSource(app, "splitMiddleTruncationText")}\nthis.splitMiddleTruncationText = splitMiddleTruncationText;`,
|
|
47
|
+
context,
|
|
48
|
+
);
|
|
49
|
+
const { splitMiddleTruncationText } = context;
|
|
50
|
+
|
|
51
|
+
assert.deepEqual(
|
|
52
|
+
{ ...splitMiddleTruncationText("/tmp/project") },
|
|
53
|
+
{ start: "/tmp/project", end: "" },
|
|
54
|
+
"short paths should remain a single uninterrupted value",
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const boundary = "x".repeat(22);
|
|
58
|
+
assert.deepEqual(
|
|
59
|
+
{ ...splitMiddleTruncationText(boundary) },
|
|
60
|
+
{ start: boundary, end: "" },
|
|
61
|
+
"the split threshold should leave enough room for the visible prefix",
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const longPath = "/mnt/SSD_NVME_4TB/GitHub/laboratory-planning-app";
|
|
65
|
+
const split = { ...splitMiddleTruncationText(longPath) };
|
|
66
|
+
assert.equal(split.start + split.end, longPath, "split spans should preserve the complete path text and accessible name");
|
|
67
|
+
assert.equal(split.end, "/laboratory-planning-app", "the suffix should preserve the complete final POSIX path component");
|
|
68
|
+
assert.ok(split.start.startsWith("/mnt/"), "the flexible prefix should contain the path beginning");
|
|
69
|
+
|
|
70
|
+
const windowsPath = String.raw`C:\Users\Dev\Repos\project-tail-component`;
|
|
71
|
+
const windowsSplit = { ...splitMiddleTruncationText(windowsPath) };
|
|
72
|
+
assert.equal(windowsSplit.end, String.raw`\project-tail-component`, "the suffix should preserve the complete final Windows path component");
|
|
73
|
+
assert.equal(windowsSplit.start + windowsSplit.end, windowsPath, "Windows split spans should preserve the complete path");
|
|
74
|
+
|
|
75
|
+
const trailingSeparatorsPath = "/mnt/data/project-tail-component///";
|
|
76
|
+
const trailingSeparatorsSplit = { ...splitMiddleTruncationText(trailingSeparatorsPath) };
|
|
77
|
+
assert.equal(trailingSeparatorsSplit.end, "/project-tail-component///", "trailing separators should remain attached to the final component");
|
|
78
|
+
assert.equal(trailingSeparatorsSplit.start + trailingSeparatorsSplit.end, trailingSeparatorsPath, "trailing-separator paths should reconstruct exactly");
|
|
79
|
+
assert.deepEqual(
|
|
80
|
+
{ ...splitMiddleTruncationText(longPath, 0) },
|
|
81
|
+
{ start: longPath, end: "" },
|
|
82
|
+
"a disabled suffix should fall back to the untouched value",
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const unicodeBoundaryPath = `/long/prefix/${"x".repeat(20)}😀${"y".repeat(15)}`;
|
|
86
|
+
const unicodeSplit = { ...splitMiddleTruncationText(unicodeBoundaryPath) };
|
|
87
|
+
assert.equal(unicodeSplit.start + unicodeSplit.end, unicodeBoundaryPath, "Unicode paths should reconstruct exactly");
|
|
88
|
+
assert.ok(unicodeSplit.end.includes("😀"), "the suffix split should preserve an astral character at the boundary");
|
|
89
|
+
assert.doesNotMatch(unicodeSplit.start, /[\uD800-\uDBFF]$/, "the prefix should not end with an unpaired high surrogate");
|
|
90
|
+
assert.doesNotMatch(unicodeSplit.end, /^[\uDC00-\uDFFF]/, "the suffix should not begin with an unpaired low surrogate");
|
|
91
|
+
|
|
92
|
+
assert.match(
|
|
93
|
+
app,
|
|
94
|
+
/function setMiddleTruncatedText[\s\S]*?if \(!parts\.end\)[\s\S]*?classList\.remove\("middle-truncate-value"\)[\s\S]*?classList\.add\("middle-truncate-value"\)/,
|
|
95
|
+
"short unsplit CWD values should retain the normal end-ellipsis fallback",
|
|
96
|
+
);
|
|
97
|
+
assert.match(
|
|
98
|
+
app,
|
|
99
|
+
/function renderTuiFooterLine[\s\S]*?footer-tui-cwd[\s\S]*?middleTruncate: true/,
|
|
100
|
+
"the fallback TUI footer should middle-truncate its CWD",
|
|
101
|
+
);
|
|
102
|
+
assert.match(
|
|
103
|
+
app,
|
|
104
|
+
/function renderGitFooterPayloadMeta[\s\S]*?options\.middleTruncate = chip\.key === "cwd";[\s\S]*?footerMeta\(chip\.label, chip\.value/,
|
|
105
|
+
"the enhanced git footer should middle-truncate only its CWD chip",
|
|
106
|
+
);
|
|
107
|
+
assert.match(
|
|
108
|
+
app,
|
|
109
|
+
/function updateGitFooterChipNodeValue[\s\S]*?chip\.key === "cwd"[\s\S]*?setMiddleTruncatedText\(valueNode, nextValue\)/,
|
|
110
|
+
"dynamic CWD updates should retain structured middle truncation",
|
|
111
|
+
);
|
|
112
|
+
assert.match(
|
|
113
|
+
css,
|
|
114
|
+
/\.middle-truncate-start \{[\s\S]*?min-width:\s*6ch;[\s\S]*?text-overflow:\s*ellipsis[\s\S]*?\.middle-truncate-end \{[\s\S]*?flex:\s*0 0 auto/,
|
|
115
|
+
"responsive styling should shrink the prefix while keeping the suffix fixed",
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
console.log("footer-middle-truncation.test.mjs passed");
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { EventEmitter } from "node:events";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
5
|
+
import { createGitLiveWatcher } from "../lib/git-live-watcher.mjs";
|
|
6
|
+
|
|
7
|
+
const created = [];
|
|
8
|
+
const changes = [];
|
|
9
|
+
const errors = [];
|
|
10
|
+
|
|
11
|
+
function fakeWatch(root, options, listener) {
|
|
12
|
+
const watcher = new EventEmitter();
|
|
13
|
+
watcher.root = root;
|
|
14
|
+
watcher.options = options;
|
|
15
|
+
watcher.listener = listener;
|
|
16
|
+
watcher.closed = false;
|
|
17
|
+
watcher.close = () => {
|
|
18
|
+
watcher.closed = true;
|
|
19
|
+
};
|
|
20
|
+
created.push(watcher);
|
|
21
|
+
return watcher;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const manager = createGitLiveWatcher({
|
|
25
|
+
watch: fakeWatch,
|
|
26
|
+
debounceMs: 20,
|
|
27
|
+
onChange: (event) => changes.push(event),
|
|
28
|
+
onError: (event) => errors.push(event),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const firstRoot = path.resolve("/tmp/pi-webui-live-one");
|
|
32
|
+
const secondRoot = path.resolve("/tmp/pi-webui-live-two");
|
|
33
|
+
|
|
34
|
+
assert.equal(manager.subscribe("tab-a", firstRoot), true);
|
|
35
|
+
assert.equal(manager.subscribe("tab-b", firstRoot), true);
|
|
36
|
+
assert.equal(created.length, 1, "tabs in one repository should share one recursive watcher");
|
|
37
|
+
assert.deepEqual(created[0].options, { recursive: true, persistent: false });
|
|
38
|
+
assert.equal(manager.watchedRootCount(), 1);
|
|
39
|
+
|
|
40
|
+
created[0].listener("change", "file.txt");
|
|
41
|
+
created[0].listener("rename", "created.txt");
|
|
42
|
+
created[0].listener("change", "file.txt");
|
|
43
|
+
await delay(50);
|
|
44
|
+
assert.equal(changes.length, 1, "one filesystem burst should emit one debounced invalidation");
|
|
45
|
+
assert.equal(changes[0].root, firstRoot);
|
|
46
|
+
assert.match(changes[0].changedAt, /^\d{4}-\d{2}-\d{2}T/);
|
|
47
|
+
|
|
48
|
+
const maxWaitChanges = [];
|
|
49
|
+
const maxWaitManager = createGitLiveWatcher({
|
|
50
|
+
watch: fakeWatch,
|
|
51
|
+
debounceMs: 80,
|
|
52
|
+
maxWaitMs: 40,
|
|
53
|
+
onChange: (event) => maxWaitChanges.push(event),
|
|
54
|
+
});
|
|
55
|
+
assert.equal(maxWaitManager.subscribe("tab-max-wait", firstRoot), true);
|
|
56
|
+
const maxWaitWatcher = created.at(-1);
|
|
57
|
+
maxWaitWatcher.listener("change", "continuous.txt");
|
|
58
|
+
await delay(25);
|
|
59
|
+
maxWaitWatcher.listener("change", "continuous.txt");
|
|
60
|
+
await delay(30);
|
|
61
|
+
assert.equal(maxWaitChanges.length, 1, "sustained writes should emit by the bounded maximum wait");
|
|
62
|
+
maxWaitManager.closeAll();
|
|
63
|
+
|
|
64
|
+
assert.equal(manager.unsubscribe("tab-a"), true);
|
|
65
|
+
assert.equal(created[0].closed, false, "the shared watcher should remain while another tab subscribes");
|
|
66
|
+
assert.equal(manager.subscribe("tab-b", secondRoot), true, "moving a tab should subscribe its new repository");
|
|
67
|
+
assert.equal(created[0].closed, true, "moving the last subscriber should close the old watcher");
|
|
68
|
+
assert.equal(created.length, 3);
|
|
69
|
+
assert.equal(manager.subscribedRootForTab("tab-b"), secondRoot);
|
|
70
|
+
|
|
71
|
+
created.at(-1).emit("error", new Error("fixture watcher failed"));
|
|
72
|
+
assert.equal(errors.length, 1, "runtime watcher failures should be reported once");
|
|
73
|
+
assert.equal(errors[0].root, secondRoot);
|
|
74
|
+
assert.equal(manager.watchedRootCount(), 0, "a failed watcher should be removed");
|
|
75
|
+
assert.equal(manager.subscribedRootForTab("tab-b"), "", "failed roots should release tab subscriptions for later retry");
|
|
76
|
+
|
|
77
|
+
const throwingManager = createGitLiveWatcher({
|
|
78
|
+
watch: () => {
|
|
79
|
+
throw new Error("watch unsupported");
|
|
80
|
+
},
|
|
81
|
+
onError: (event) => errors.push(event),
|
|
82
|
+
});
|
|
83
|
+
assert.equal(throwingManager.subscribe("tab-c", firstRoot), false, "synchronous watcher startup errors should be non-fatal");
|
|
84
|
+
assert.match(errors.at(-1)?.error?.message || "", /watch unsupported/);
|
|
85
|
+
|
|
86
|
+
assert.equal(manager.subscribe("tab-d", firstRoot), true);
|
|
87
|
+
assert.equal(manager.subscribe("tab-e", secondRoot), true);
|
|
88
|
+
const latestWatchers = created.slice(-2);
|
|
89
|
+
manager.closeAll();
|
|
90
|
+
assert.equal(manager.watchedRootCount(), 0);
|
|
91
|
+
assert.equal(latestWatchers.every((watcher) => watcher.closed), true, "closeAll should release every watcher");
|
|
92
|
+
|
|
93
|
+
console.log("git-live-watcher.test.mjs passed");
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import {
|
|
6
|
+
gitMessageArtifactPairReadiness,
|
|
7
|
+
readStableGitMessageArtifactPair,
|
|
8
|
+
sameGitMessageArtifactPair,
|
|
9
|
+
sameGitMessageArtifactVersion,
|
|
10
|
+
} from "../lib/git-message-artifacts.mjs";
|
|
11
|
+
|
|
12
|
+
const root = await mkdtemp(path.join(tmpdir(), "pi-webui-git-messages-"));
|
|
13
|
+
const commitDir = path.join(root, "dev", "COMMIT");
|
|
14
|
+
const paths = {
|
|
15
|
+
shortPath: path.join(commitDir, "staged-commit-short.txt"),
|
|
16
|
+
longPath: path.join(commitDir, "staged-commit-long.txt"),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
await mkdir(commitDir, { recursive: true });
|
|
21
|
+
|
|
22
|
+
const missingBaseline = await readStableGitMessageArtifactPair(paths);
|
|
23
|
+
assert.equal(missingBaseline.short.exists, false);
|
|
24
|
+
assert.equal(missingBaseline.long.exists, false);
|
|
25
|
+
assert.equal(gitMessageArtifactPairReadiness(missingBaseline, missingBaseline).ready, false, "missing files must not be ready");
|
|
26
|
+
|
|
27
|
+
await writeFile(paths.shortPath, "feat: correlated message\n", "utf8");
|
|
28
|
+
await writeFile(paths.longPath, "feat: correlated message\n\n- feat: load both files\n", "utf8");
|
|
29
|
+
const firstPair = await readStableGitMessageArtifactPair(paths);
|
|
30
|
+
assert.equal(gitMessageArtifactPairReadiness(missingBaseline, firstPair).ready, true, "two new non-empty files should be ready");
|
|
31
|
+
assert.equal(sameGitMessageArtifactPair(firstPair, await readStableGitMessageArtifactPair(paths)), true, "unchanged stable pairs should compare equal");
|
|
32
|
+
|
|
33
|
+
await writeFile(paths.shortPath, "fix: only short changed\n", "utf8");
|
|
34
|
+
const partialPair = await readStableGitMessageArtifactPair(paths);
|
|
35
|
+
const partialReadiness = gitMessageArtifactPairReadiness(firstPair, partialPair);
|
|
36
|
+
assert.equal(partialReadiness.ready, false, "one stale member must keep the pair pending");
|
|
37
|
+
assert.deepEqual(partialReadiness.unchanged, ["long"]);
|
|
38
|
+
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
40
|
+
await writeFile(paths.shortPath, firstPair.short.text, "utf8");
|
|
41
|
+
await writeFile(paths.longPath, firstPair.long.text, "utf8");
|
|
42
|
+
const identicalRewrite = await readStableGitMessageArtifactPair(paths);
|
|
43
|
+
assert.equal(identicalRewrite.short.sha256, firstPair.short.sha256, "test setup keeps identical short content");
|
|
44
|
+
assert.equal(identicalRewrite.long.sha256, firstPair.long.sha256, "test setup keeps identical long content");
|
|
45
|
+
assert.equal(sameGitMessageArtifactVersion(firstPair.short, identicalRewrite.short), false, "metadata must identify an identical-content rewrite");
|
|
46
|
+
assert.equal(sameGitMessageArtifactVersion(firstPair.long, identicalRewrite.long), false, "both identical-content rewrites must be fresh");
|
|
47
|
+
assert.equal(gitMessageArtifactPairReadiness(firstPair, identicalRewrite).ready, true, "identical generated text is valid when both files were rewritten");
|
|
48
|
+
|
|
49
|
+
await writeFile(paths.shortPath, "", "utf8");
|
|
50
|
+
await writeFile(paths.longPath, "fix: long is present\n", "utf8");
|
|
51
|
+
const emptyPair = await readStableGitMessageArtifactPair(paths);
|
|
52
|
+
const emptyReadiness = gitMessageArtifactPairReadiness(identicalRewrite, emptyPair);
|
|
53
|
+
assert.equal(emptyReadiness.ready, false, "empty generated files must remain pending");
|
|
54
|
+
assert.deepEqual(emptyReadiness.empty, ["short"]);
|
|
55
|
+
|
|
56
|
+
console.log("git message artifact tests passed");
|
|
57
|
+
} finally {
|
|
58
|
+
await rm(root, { recursive: true, force: true });
|
|
59
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const [app, server, watcher, readme] = await Promise.all([
|
|
8
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
9
|
+
readFile(join(root, "bin", "pi-webui.mjs"), "utf8"),
|
|
10
|
+
readFile(join(root, "lib", "git-live-watcher.mjs"), "utf8"),
|
|
11
|
+
readFile(join(root, "README.md"), "utf8"),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
function functionBody(source, name) {
|
|
15
|
+
const syncStart = source.indexOf(`function ${name}(`);
|
|
16
|
+
const asyncStart = source.indexOf(`async function ${name}(`);
|
|
17
|
+
const start = syncStart === -1 ? asyncStart : asyncStart === -1 ? syncStart : Math.min(syncStart, asyncStart);
|
|
18
|
+
assert.notEqual(start, -1, `${name} should be defined`);
|
|
19
|
+
const nextSync = source.indexOf("\nfunction ", start + 1);
|
|
20
|
+
const nextAsync = source.indexOf("\nasync function ", start + 1);
|
|
21
|
+
const candidates = [nextSync, nextAsync].filter((index) => index !== -1);
|
|
22
|
+
return source.slice(start, candidates.length ? Math.min(...candidates) : source.length);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const loadRepository = functionBody(app, "loadGitPanelRepository");
|
|
26
|
+
const invalidateRepository = functionBody(app, "invalidateGitPanelRepository");
|
|
27
|
+
const ensureVisibleFresh = functionBody(app, "ensureGitPanelVisibleRepositoriesFresh");
|
|
28
|
+
const handleEvent = functionBody(app, "handleEvent");
|
|
29
|
+
|
|
30
|
+
assert.match(watcher, /watch\(root, \{ recursive: true, persistent: false \}/, "repository watches should be recursive and non-persistent");
|
|
31
|
+
assert.match(watcher, /record\.timer = setTimeout[\s\S]*onChange\(\{ root, changedAt:/, "filesystem bursts should debounce to a repository invalidation");
|
|
32
|
+
assert.match(watcher, /maximumWaitMs[\s\S]*remainingMs[\s\S]*Math\.min\(delayMs, remainingMs\)/, "continuous writes should still invalidate within a bounded maximum wait");
|
|
33
|
+
assert.match(watcher, /record\.tabs:|tabs: new Set\(\)/, "shared roots should track tab subscribers");
|
|
34
|
+
assert.match(watcher, /if \(!record\.tabs\.size\) closeRoot/, "the last tab unsubscribe should close its root watcher");
|
|
35
|
+
assert.match(watcher, /function closeAll\(\)[\s\S]*closeRoot\(root\)/, "server shutdown should release every root watcher");
|
|
36
|
+
|
|
37
|
+
assert.match(server, /createGitLiveWatcher\(\{[\s\S]*type: "webui_git_changed"[\s\S]*broadcastServerEvent/, "watcher changes should use the existing server-wide SSE channel");
|
|
38
|
+
assert.match(server, /env: \{ GIT_OPTIONAL_LOCKS: "0" \}/, "read-only Git commands should not feed optional index refreshes back into the watcher");
|
|
39
|
+
assert.match(server, /trackGitRepositoryForTab\(tab, await getGitRoot\(tab\.cwd\)\)/, "Git-root discovery should register the tab watcher");
|
|
40
|
+
assert.match(server, /trackGitRepositoryForTab\(tab, data\.root\)/, "Git-panel reads should ensure watcher registration");
|
|
41
|
+
assert.match(server, /async function updateTabCwd[\s\S]*gitLiveWatcher\.unsubscribe\(tab\.id\)/, "cwd changes should release old repository subscriptions");
|
|
42
|
+
assert.match(server, /async function closeTab[\s\S]*gitLiveWatcher\.unsubscribe\(tab\.id\)/, "tab closure should release repository subscriptions");
|
|
43
|
+
assert.match(server, /function shutdown[\s\S]*gitLiveWatcher\.closeAll\(\)/, "server shutdown should close all repository watches");
|
|
44
|
+
|
|
45
|
+
assert.match(loadRepository, /existing\?\.loading[\s\S]*refreshPending: true/, "an invalidation during a request should queue a follow-up refresh");
|
|
46
|
+
assert.match(loadRepository, /if \(refreshAgain\) queueMicrotask\(\(\) => loadGitPanelRepository\(card, \{ force: true \}\)\)/, "queued invalidations should trigger one follow-up Git snapshot");
|
|
47
|
+
assert.match(invalidateRepository, /error: ""[\s\S]*loadedAt: 0/, "a fresh SSE invalidation should clear a previous read error and expire the cache");
|
|
48
|
+
assert.match(invalidateRepository, /if \(!gitPanelSectionExpanded\(\)\) return;/, "collapsed Git sections should defer HTTP refresh work");
|
|
49
|
+
assert.match(ensureVisibleFresh, /snapshot\?\.error/, "persistent Git read errors should not cause an unbounded render/reload loop");
|
|
50
|
+
assert.match(ensureVisibleFresh, /gitPanelSnapshotFresh\(snapshot\)[\s\S]*loadGitPanelRepository\(card\)/, "visible stale repositories should refresh on render");
|
|
51
|
+
assert.match(handleEvent, /case "webui_git_changed":[\s\S]*invalidateGitPanelRepository\(event\.root\)/, "the browser event stream should route Git invalidations to the cache");
|
|
52
|
+
assert.match(readme, /live filesystem updates[\s\S]*SSE/, "README should document live watcher-driven Git refresh behavior");
|
|
53
|
+
|
|
54
|
+
console.log("git-panel-live-updates-static.test.mjs passed");
|
|
@@ -19,7 +19,7 @@ const renderContextMeter = functionBody("renderContextMeter");
|
|
|
19
19
|
const renderWorkspaceDashboard = functionBody("renderWorkspaceDashboard");
|
|
20
20
|
|
|
21
21
|
assert.match(app, /openFolders: new Map\(\)/, "Git panel state should persist folder toggles");
|
|
22
|
-
assert.match(renderGitPanelFolder, /const defaultOpen =
|
|
22
|
+
assert.match(renderGitPanelFolder, /const defaultOpen = true;/, "folder rendering should expand every directory depth by default");
|
|
23
23
|
assert.match(renderGitPanelFolder, /details\.open = gitPanelState\.openFolders\.has\(folderKey\) \? gitPanelState\.openFolders\.get\(folderKey\) : defaultOpen;/, "folder rendering should prefer a stored override over its default");
|
|
24
24
|
assert.match(renderGitPanelFolder, /if \(details\.open === defaultOpen\) gitPanelState\.openFolders\.delete\(folderKey\);/, "folder toggles back to the default should remove the override");
|
|
25
25
|
assert.match(renderGitPanelFolder, /else gitPanelState\.openFolders\.set\(folderKey, details\.open\);/, "folder toggles away from the default should store an override");
|
|
@@ -31,14 +31,18 @@ const settingsFile = path.join(root, "settings.json");
|
|
|
31
31
|
try {
|
|
32
32
|
await writeFile(settingsFile, `${JSON.stringify({ version: 1, remoteAuthEnabled: true }, null, 2)}\n`, "utf8");
|
|
33
33
|
const migrated = await readWebuiSettings(settingsFile);
|
|
34
|
-
assert.equal(migrated.version,
|
|
34
|
+
assert.equal(migrated.version, 4);
|
|
35
35
|
assert.equal(migrated.remoteAuthEnabled, true, "legacy Remote PIN state should survive schema migration");
|
|
36
|
+
assert.equal(migrated.outputModeDefault, "normal", "legacy settings should default browser output to normal");
|
|
36
37
|
assert.equal(isGitWorkflowSetupComplete(migrated.gitWorkflow), false);
|
|
37
38
|
assert.equal(migrated.resourceDefaults.tools.enabledTools, null, "legacy settings should inherit Pi's normal tool defaults");
|
|
38
39
|
assert.equal(migrated.resourceDefaults.skills.enabledSkills, null, "legacy settings should inherit Pi's normal skill defaults");
|
|
39
40
|
assert.equal(migrated.gitWorkflow.stagingPolicy, "review");
|
|
40
41
|
assert.equal(migrated.gitWorkflow.generation.thinkingLevel, "low");
|
|
41
42
|
|
|
43
|
+
await writeFile(settingsFile, `${JSON.stringify({ version: 4, remoteAuthEnabled: true, outputModeDefault: "unsupported" }, null, 2)}\n`, "utf8");
|
|
44
|
+
assert.equal((await readWebuiSettings(settingsFile)).outputModeDefault, "normal", "invalid persisted output modes must fail closed to normal");
|
|
45
|
+
|
|
42
46
|
const saved = await writeGitWorkflowPreferences({
|
|
43
47
|
generation: { provider: "fake", modelId: "fake-model", thinkingLevel: "off", unavailablePolicy: "ask" },
|
|
44
48
|
commit: { language: "de", defaultVariant: "long", scope: "required" },
|
|
@@ -53,6 +57,7 @@ try {
|
|
|
53
57
|
assert.equal(saved.stagingPolicy, "preserve");
|
|
54
58
|
|
|
55
59
|
await writeWebuiSettings({
|
|
60
|
+
outputModeDefault: "compact-v1",
|
|
56
61
|
resourceDefaults: {
|
|
57
62
|
tools: { enabledTools: ["read", " write ", "read", ""] },
|
|
58
63
|
skills: { enabledSkills: ["repo-explorer", "code-security"] },
|
|
@@ -65,8 +70,9 @@ try {
|
|
|
65
70
|
assert.equal(partiallyUpdated.deliveryMode, "current");
|
|
66
71
|
|
|
67
72
|
const persisted = JSON.parse(await readFile(settingsFile, "utf8"));
|
|
68
|
-
assert.equal(persisted.version,
|
|
73
|
+
assert.equal(persisted.version, 4);
|
|
69
74
|
assert.equal(persisted.remoteAuthEnabled, true);
|
|
75
|
+
assert.equal(persisted.outputModeDefault, "compact-v1", "output-mode default should persist beside existing Web UI settings");
|
|
70
76
|
assert.equal(persisted.gitWorkflow.generation.provider, "fake");
|
|
71
77
|
assert.deepEqual(persisted.resourceDefaults.tools.enabledTools, ["read", "write"], "global tool defaults should be normalized and deduplicated");
|
|
72
78
|
assert.deepEqual(persisted.resourceDefaults.skills.enabledSkills, ["repo-explorer", "code-security"], "global skill defaults should persist beside other Web UI settings");
|