@firstpick/pi-package-webui 0.10.8 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPMENT.md +12 -2
- package/README.md +4 -2
- package/TECHNICAL.md +7 -1
- package/bin/pi-webui.mjs +26 -16
- package/package.json +14 -8
- package/public/app.js +48 -24
- package/public/codex-speed-mode.mjs +36 -0
- package/public/index.html +6 -5
- package/public/service-worker.js +2 -1
- package/tests/boot-failure-diagnostics.test.mjs +2 -2
- package/tests/codex-fast-mode-static.test.mjs +12 -11
- package/tests/codex-speed-mode-browser-state.test.mjs +149 -0
- package/tests/codex-speed-mode.test.mjs +36 -0
- package/tests/composer-action-grid-reorder-static.test.mjs +2 -2
- package/tests/control-visibility-static.test.mjs +2 -2
- package/tests/controls-layout-static.test.mjs +2 -2
- package/tests/events-tree-context-menu-static.test.mjs +2 -2
- package/tests/fast-mode-client-static.test.mjs +1 -1
- package/tests/feature-decision-output-popup-static.test.mjs +1 -1
- package/tests/file-viewer-image-static.test.mjs +2 -2
- package/tests/fixtures/fake-pi.mjs +18 -8
- package/tests/guided-git-activation-static.test.mjs +2 -2
- package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
- package/tests/host-peer-dependencies.test.mjs +24 -0
- package/tests/http-endpoints-harness.test.mjs +52 -0
- package/tests/intercom-conversation-viewer-static.test.mjs +2 -2
- package/tests/main-output-loading-static.test.mjs +2 -2
- package/tests/middle-button-drag-scroll-static.test.mjs +2 -2
- package/tests/mobile-continuity-tablet-static.test.mjs +2 -2
- package/tests/mobile-foundation-static.test.mjs +2 -2
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/native-update-lifecycle.test.mjs +3 -1
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-prompt-impact-static.test.mjs +2 -2
- package/tests/persistent-ui-layout-static.test.mjs +2 -2
- package/tests/prompt-input-vertical-scroll-static.test.mjs +2 -2
- package/tests/questionnaire-dialog.test.mjs +2 -2
- package/tests/session-sampling-ui-static.test.mjs +2 -2
- package/tests/side-panel-section-height-removal-static.test.mjs +2 -2
- package/tests/subagent-observability-static.test.mjs +2 -2
- package/tests/syntax-highlighting-static.test.mjs +2 -2
- package/tests/theme-customizer-static.test.mjs +1 -1
- package/tests/windows-drive-cwd-picker-static.test.mjs +2 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import vm from "node:vm";
|
|
4
|
+
import * as modes from "../public/codex-speed-mode.mjs";
|
|
5
|
+
|
|
6
|
+
const source = await readFile(new URL("../public/app.js", import.meta.url), "utf8");
|
|
7
|
+
const start = source.indexOf("// Codex subscription Fast mode is owned");
|
|
8
|
+
const end = source.indexOf("function scheduleRefreshCodexUsage", start);
|
|
9
|
+
assert.ok(start >= 0 && end > start, "execute the actual browser speed-control implementation");
|
|
10
|
+
const controlSource = source.slice(start, end);
|
|
11
|
+
|
|
12
|
+
function harness({ confirm = true, eligible = true, enabledFeature = true } = {}) {
|
|
13
|
+
const calls = [];
|
|
14
|
+
const confirmations = [];
|
|
15
|
+
const events = [];
|
|
16
|
+
const ultrafastOption = { disabled: true };
|
|
17
|
+
const select = { value: "normal", disabled: true, querySelector: () => ultrafastOption };
|
|
18
|
+
let currentTab = "tab-one";
|
|
19
|
+
const data = (mode) => ({
|
|
20
|
+
available: true, statusKnown: true, enabled: mode !== "normal", mode, busy: false,
|
|
21
|
+
model: { provider: "openai-codex", id: eligible ? "gpt-6-astra" : "gpt-6-sol" },
|
|
22
|
+
modelEligible: true, ultrafastModelEligible: eligible, creditNotice: "Higher usage applies.",
|
|
23
|
+
});
|
|
24
|
+
const tabModes = new Map([["tab-one", "normal"], ["tab-two", "normal"]]);
|
|
25
|
+
const context = vm.createContext({
|
|
26
|
+
...modes,
|
|
27
|
+
elements: { codexFastModeSelect: select, setCodexFastModeButton: {}, codexFastModeStatus: { classList: { toggle() {} } } },
|
|
28
|
+
isOptionalFeatureEnabled: () => enabledFeature,
|
|
29
|
+
optionalFeatureUnavailableMessage: () => "Disabled",
|
|
30
|
+
optionalFeatureAvailability: {},
|
|
31
|
+
activeTabContext: () => ({ tabId: currentTab }),
|
|
32
|
+
isCurrentTabContext: (tab) => tab.tabId === currentTab,
|
|
33
|
+
tabs: [{ id: "tab-one", running: true }, { id: "tab-two", running: true }],
|
|
34
|
+
activeTabId: "tab-one",
|
|
35
|
+
currentState: { model: { provider: "openai-codex", id: "gpt-6-sol" } },
|
|
36
|
+
normalizeSelectedModel: (model) => model,
|
|
37
|
+
modelStateKey: (model) => `${model?.provider}/${model?.id}`,
|
|
38
|
+
renderStatus() {},
|
|
39
|
+
requestGitFooterWebuiPayload() {},
|
|
40
|
+
queueMicrotask,
|
|
41
|
+
async appConfirm(options) {
|
|
42
|
+
confirmations.push(options);
|
|
43
|
+
return typeof confirm === "function" ? confirm(() => { currentTab = "tab-two"; }) : confirm;
|
|
44
|
+
},
|
|
45
|
+
async api(path, options) {
|
|
46
|
+
calls.push({ path, options });
|
|
47
|
+
if (options.method === "PUT") tabModes.set(options.tabId, modes.codexSpeedModeFromIntent(options.body));
|
|
48
|
+
return { data: data(tabModes.get(options.tabId)) };
|
|
49
|
+
},
|
|
50
|
+
addEvent(message, level) { events.push({ message, level }); },
|
|
51
|
+
});
|
|
52
|
+
vm.runInContext(controlSource, context);
|
|
53
|
+
const modelStart = source.indexOf("function applyOptimisticModelSelection(");
|
|
54
|
+
const modelEnd = source.indexOf("function applyOptimisticThinkingSelection(", modelStart);
|
|
55
|
+
assert.ok(modelStart >= 0 && modelEnd > modelStart);
|
|
56
|
+
vm.runInContext(source.slice(modelStart, modelEnd), context);
|
|
57
|
+
context.applyCodexFastModeData(data("normal"));
|
|
58
|
+
vm.runInContext("codexFastModeLoaded = true", context);
|
|
59
|
+
context.renderCodexFastModeControl();
|
|
60
|
+
return { context, calls, confirmations, events, select, tabModes, ultrafastOption, data, setEligible(value) { eligible = value; } };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
const h = harness();
|
|
65
|
+
assert.equal(h.context.applyCodexFastModeStatus("ultrafast"), true);
|
|
66
|
+
assert.equal(h.select.value, "ultrafast");
|
|
67
|
+
assert.equal(h.context.codexFastModeStatusText(), "Ultrafast · This tab");
|
|
68
|
+
assert.equal(h.context.applyCodexFastModeStatus("ultrafast now"), false);
|
|
69
|
+
assert.equal(h.select.value, "ultrafast");
|
|
70
|
+
assert.equal(h.context.codexFastModeConfirmedOff({ statusKnown: true, mode: "ultrafast", enabled: false }), false);
|
|
71
|
+
assert.equal(h.context.codexFastModeConfirmedOff({ statusKnown: true, enabled: false }), true);
|
|
72
|
+
}
|
|
73
|
+
{
|
|
74
|
+
const h = harness({ confirm: false });
|
|
75
|
+
h.select.value = "ultrafast";
|
|
76
|
+
await h.context.applyCodexFastMode();
|
|
77
|
+
assert.equal(h.confirmations.length, 1);
|
|
78
|
+
assert.match(h.confirmations[0].summary, /8x.*6x/);
|
|
79
|
+
assert.equal(h.calls.length, 0, "cancelled cost confirmation must not mutate the extension");
|
|
80
|
+
assert.equal(h.select.value, "normal");
|
|
81
|
+
}
|
|
82
|
+
{
|
|
83
|
+
const h = harness();
|
|
84
|
+
h.select.value = "ultrafast";
|
|
85
|
+
await h.context.applyCodexFastMode();
|
|
86
|
+
assert.equal(h.confirmations.length, 1);
|
|
87
|
+
assert.equal(h.calls.length, 1);
|
|
88
|
+
assert.equal(h.calls[0].options.body.mode, "ultrafast");
|
|
89
|
+
assert.equal(h.select.value, "ultrafast");
|
|
90
|
+
h.select.value = "fast";
|
|
91
|
+
await h.context.applyCodexFastMode();
|
|
92
|
+
assert.equal(h.confirmations.length, 1, "ordinary Fast selection does not require the Ultrafast prompt");
|
|
93
|
+
assert.equal(h.calls[1].options.body.mode, "fast");
|
|
94
|
+
assert.equal(h.select.value, "fast");
|
|
95
|
+
}
|
|
96
|
+
{
|
|
97
|
+
const h = harness({ confirm: (switchTab) => { switchTab(); return true; } });
|
|
98
|
+
h.select.value = "ultrafast";
|
|
99
|
+
await h.context.applyCodexFastMode();
|
|
100
|
+
assert.equal(h.calls.length, 0, "changing tabs during cost confirmation must cancel the mutation");
|
|
101
|
+
}
|
|
102
|
+
{
|
|
103
|
+
const h = harness({ eligible: false });
|
|
104
|
+
assert.equal(h.ultrafastOption.disabled, true);
|
|
105
|
+
h.select.value = "ultrafast";
|
|
106
|
+
await h.context.applyCodexFastMode();
|
|
107
|
+
assert.equal(h.calls.length, 0);
|
|
108
|
+
assert.equal(h.confirmations.length, 0);
|
|
109
|
+
h.context.applyCodexFastModeData(h.data("ultrafast"));
|
|
110
|
+
assert.equal(h.context.codexFastModeStatusText(), "Ultrafast · Inactive for current model");
|
|
111
|
+
h.select.value = "normal";
|
|
112
|
+
await h.context.applyCodexFastMode();
|
|
113
|
+
assert.equal(h.calls[0].options.body.mode, "normal", "inactive Ultrafast must remain disarmable");
|
|
114
|
+
}
|
|
115
|
+
{
|
|
116
|
+
const h = harness();
|
|
117
|
+
h.tabModes.set("tab-one", "ultrafast");
|
|
118
|
+
h.tabModes.set("tab-two", "fast");
|
|
119
|
+
await h.context.disableCodexFastModeIntegration();
|
|
120
|
+
const mutations = h.calls.filter((call) => call.options.method === "PUT");
|
|
121
|
+
assert.equal(mutations.length, 2);
|
|
122
|
+
assert.ok(mutations.every((call) => call.options.body.enabled === false));
|
|
123
|
+
assert.equal(h.tabModes.get("tab-one"), "normal");
|
|
124
|
+
assert.equal(h.tabModes.get("tab-two"), "normal");
|
|
125
|
+
}
|
|
126
|
+
for (const options of [{ enabledFeature: false }, {}]) {
|
|
127
|
+
const h = harness(options);
|
|
128
|
+
if (options.enabledFeature !== false) h.context.applyCodexFastModeData({ ...h.data("normal"), busy: true });
|
|
129
|
+
h.select.value = "ultrafast";
|
|
130
|
+
await h.context.applyCodexFastMode();
|
|
131
|
+
assert.equal(h.calls.length, 0, "hidden or busy controls must not request a mode change");
|
|
132
|
+
}
|
|
133
|
+
{
|
|
134
|
+
const h = harness({ eligible: false });
|
|
135
|
+
assert.equal(h.ultrafastOption.disabled, true);
|
|
136
|
+
h.setEligible(true);
|
|
137
|
+
const refresh = h.context.refreshCodexFastMode;
|
|
138
|
+
let refreshed;
|
|
139
|
+
h.context.refreshCodexFastMode = (...args) => {
|
|
140
|
+
refreshed = refresh(...args);
|
|
141
|
+
return refreshed;
|
|
142
|
+
};
|
|
143
|
+
h.context.applyOptimisticModelSelection({ provider: "openai-codex", id: "gpt-6-astra" });
|
|
144
|
+
assert.ok(refreshed, "model selection must schedule the speed-eligibility refresh");
|
|
145
|
+
await refreshed;
|
|
146
|
+
assert.equal(h.ultrafastOption.disabled, false, "selecting Astra should refresh Ultrafast eligibility without reloading the tab");
|
|
147
|
+
assert.equal(h.calls.at(-1).path, "/api/codex-fast-mode");
|
|
148
|
+
}
|
|
149
|
+
console.log("codex-speed-mode-browser-state.test.mjs passed");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import {
|
|
3
|
+
codexSpeedModeFromData,
|
|
4
|
+
codexSpeedModeFromIntent,
|
|
5
|
+
codexSpeedModeFromStatus,
|
|
6
|
+
codexSpeedModeLabel,
|
|
7
|
+
isCodexSpeedMode,
|
|
8
|
+
} from "../public/codex-speed-mode.mjs";
|
|
9
|
+
|
|
10
|
+
for (const [status, mode] of [["off", "normal"], ["on", "fast"], ["ultrafast", "ultrafast"]]) {
|
|
11
|
+
assert.equal(codexSpeedModeFromStatus(status), mode);
|
|
12
|
+
assert.equal(codexSpeedModeFromStatus(` ${status.toUpperCase()} `), mode);
|
|
13
|
+
assert.equal(codexSpeedModeFromIntent({ mode }), mode);
|
|
14
|
+
assert.equal(codexSpeedModeFromIntent({ mode, enabled: mode !== "normal" }), mode);
|
|
15
|
+
assert.equal(codexSpeedModeFromData({ mode, enabled: mode !== "normal", statusKnown: true }), mode);
|
|
16
|
+
assert.equal(isCodexSpeedMode(mode), true);
|
|
17
|
+
}
|
|
18
|
+
for (const value of [undefined, null, "", "fast", "normal", "Fast mode: on", "on now", "ultra-fast", {}, 1]) {
|
|
19
|
+
assert.equal(codexSpeedModeFromStatus(value), null);
|
|
20
|
+
}
|
|
21
|
+
assert.equal(codexSpeedModeFromIntent({ enabled: true }), "fast");
|
|
22
|
+
assert.equal(codexSpeedModeFromIntent({ enabled: false }), "normal");
|
|
23
|
+
for (const body of [{}, undefined, null, { enabled: "yes" }, { mode: "turbo" }, { mode: null, enabled: true },
|
|
24
|
+
{ mode: "ultrafast", enabled: false }, { mode: "normal", enabled: true }, { mode: "fast", enabled: "yes" }]) {
|
|
25
|
+
assert.throws(() => codexSpeedModeFromIntent(body), TypeError);
|
|
26
|
+
}
|
|
27
|
+
assert.equal(codexSpeedModeFromData({ enabled: true, statusKnown: true }), "fast");
|
|
28
|
+
assert.equal(codexSpeedModeFromData({ enabled: false, statusKnown: true }), "normal");
|
|
29
|
+
assert.equal(codexSpeedModeFromData({ enabled: true, statusKnown: false }), null);
|
|
30
|
+
assert.equal(codexSpeedModeFromData({ mode: "turbo", enabled: true, statusKnown: true }), null);
|
|
31
|
+
assert.equal(codexSpeedModeFromData(undefined), null);
|
|
32
|
+
assert.equal(codexSpeedModeLabel("normal"), "Normal");
|
|
33
|
+
assert.equal(codexSpeedModeLabel("fast"), "Fast");
|
|
34
|
+
assert.equal(codexSpeedModeLabel("ultrafast"), "Ultrafast");
|
|
35
|
+
assert.equal(codexSpeedModeLabel(null), "Unknown");
|
|
36
|
+
console.log("codex-speed-mode.test.mjs passed");
|
|
@@ -58,7 +58,7 @@ assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreCom
|
|
|
58
58
|
assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
|
|
59
59
|
|
|
60
60
|
assert.match(html, /styles\.css\?v=154/, "changed composer styles should advance the stylesheet revision");
|
|
61
|
-
assert.match(html, /app\.js\?v=
|
|
62
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
61
|
+
assert.match(html, /app\.js\?v=185/, "changed composer behavior should advance the app revision");
|
|
62
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "changed browser assets should advance the PWA cache identity");
|
|
63
63
|
|
|
64
64
|
console.log("composer-action-grid-reorder-static.test.mjs passed");
|
|
@@ -348,10 +348,10 @@ assert.match(
|
|
|
348
348
|
|
|
349
349
|
assert.match(
|
|
350
350
|
serviceWorker,
|
|
351
|
-
/const CACHE_NAME = "pi-webui-pwa-
|
|
351
|
+
/const CACHE_NAME = "pi-webui-pwa-v156";/,
|
|
352
352
|
"browser asset changes should advance the PWA cache identity",
|
|
353
353
|
);
|
|
354
354
|
assert.match(html, /styles\.css\?v=154/, "visibility styles should advance the stylesheet query revision");
|
|
355
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
355
|
+
assert.match(html, /data-app-src="\/app\.js\?v=185"/, "visibility behavior should advance the app query revision");
|
|
356
356
|
|
|
357
357
|
console.log("control-visibility-static.test.mjs passed");
|
|
@@ -16,7 +16,7 @@ assert.match(app, /function initializeControlSettingTooltips\(\)[\s\S]*#sidePane
|
|
|
16
16
|
assert.match(html, /class="control-row remote-auth-control-row" hidden[\s\S]*id="remoteAuthToggle"/, "optional PIN protection should retain its guarded visibility");
|
|
17
17
|
assert.match(app, /remoteAuthToggle\?\.closest\("\.remote-auth-control-row"\)[\s\S]*remoteAuthRow\.hidden = false/, "loading remote status should reveal the optional PIN protection setting");
|
|
18
18
|
assert.match(html, /styles\.css\?v=154/, "Controls stylesheet changes should advance the cache query");
|
|
19
|
-
assert.match(html, /app\.js\?v=
|
|
20
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
19
|
+
assert.match(html, /app\.js\?v=185/, "Controls tooltip wiring should advance the app cache query");
|
|
20
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "Controls browser assets should advance the PWA cache identity");
|
|
21
21
|
|
|
22
22
|
console.log("controls-layout-static.test.mjs passed");
|
|
@@ -124,8 +124,8 @@ assert.match(styles, /\.event-log\[data-display-mode="compact"\] \.event\[data-e
|
|
|
124
124
|
assert.match(styles, /\.event-tree-context-menu \{[\s\S]*max-width: calc\(100vw - 1rem\)/, "the dedicated menu should remain viewport bounded");
|
|
125
125
|
|
|
126
126
|
// Cache tuple for this browser-asset change.
|
|
127
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
127
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156";/, "the PWA cache identity should advance");
|
|
128
128
|
assert.match(html, /styles\.css\?v=154/, "compact-mode styles should advance the stylesheet revision");
|
|
129
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
129
|
+
assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the app query revision should advance");
|
|
130
130
|
|
|
131
131
|
console.log("events-tree-context-menu-static.test.mjs passed");
|
|
@@ -159,7 +159,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
159
159
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
160
160
|
assert.match(html, /Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed/, "the sidebar should distinguish compact rendering from model inference");
|
|
161
161
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
162
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
162
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=185"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
163
163
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
164
164
|
|
|
165
165
|
const events = createFastModeOutputEvents();
|
|
@@ -167,6 +167,6 @@ assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab
|
|
|
167
167
|
assert.match(app, /statusKey === FEATURE_DECISION_OUTPUT_STATUS_KEY[\s\S]*handleFeatureDecisionOutputStatus[\s\S]*return;[\s\S]*statusKey === FEATURE_CATEGORY_STATUS_KEY[\s\S]*return;[\s\S]*statusEntries\.set/, "both feature statuses should be intercepted before generic footer storage while preserving category handling");
|
|
168
168
|
|
|
169
169
|
assert.match(html, /\/styles\.css\?v=154/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
-
assert.match(html, /\/app\.js\?v=
|
|
170
|
+
assert.match(html, /\/app\.js\?v=185/, "integrated app changes should advance the cache query");
|
|
171
171
|
|
|
172
172
|
console.log("feature decision-output popup static checks passed");
|
|
@@ -62,8 +62,8 @@ assert.match(css, /\.file-viewer-image img \{[\s\S]*max-width: 100%;[\s\S]*max-h
|
|
|
62
62
|
assert.match(readme, /PNG, JPEG, GIF, WebP, and AVIF/i, "the Files panel guide should list supported image formats");
|
|
63
63
|
assert.match(technical, /supported raster images[\s\S]*2 MiB/i, "the advanced reference should document image support and its size limit");
|
|
64
64
|
assert.match(development, /kind: "image"[\s\S]*base64/i, "the contributor guide should document the image response contract");
|
|
65
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
65
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "changed viewer assets should advance the PWA cache identity");
|
|
66
66
|
assert.match(html, /styles\.css\?v=154/, "changed image styles should advance the stylesheet revision");
|
|
67
|
-
assert.match(html, /app\.js\?v=
|
|
67
|
+
assert.match(html, /app\.js\?v=185/, "changed image rendering should advance the app revision");
|
|
68
68
|
|
|
69
69
|
console.log("file viewer image static tests passed");
|
|
@@ -43,7 +43,8 @@ let activeBash = 0;
|
|
|
43
43
|
let peakBash = 0;
|
|
44
44
|
let thinkingLevel = "off";
|
|
45
45
|
let conversationEnabled = false;
|
|
46
|
-
let
|
|
46
|
+
let codexSpeedMode = "normal";
|
|
47
|
+
let codexFixtureModel = null;
|
|
47
48
|
let rejectNextCodexFastModeMutation = false;
|
|
48
49
|
const fakeTools = [
|
|
49
50
|
{ name: "read", description: "Read files", sourceInfo: { source: "builtin", scope: "temporary", origin: "top-level" } },
|
|
@@ -667,12 +668,20 @@ function emitCodexFastModeStatus() {
|
|
|
667
668
|
id: randomUUID(),
|
|
668
669
|
method: "setStatus",
|
|
669
670
|
statusKey: "codex-fast-mode",
|
|
670
|
-
statusText:
|
|
671
|
+
statusText: codexSpeedMode === "ultrafast" ? "ultrafast" : codexSpeedMode === "fast" ? "on" : "off",
|
|
671
672
|
});
|
|
672
673
|
}
|
|
673
674
|
|
|
674
675
|
function handleCodexFastModePrompt(command, base) {
|
|
675
676
|
const message = String(command.message || "").trim();
|
|
677
|
+
if (message === "fixture codex astra" || message === "fixture codex reset") {
|
|
678
|
+
codexFixtureModel = message.endsWith("astra")
|
|
679
|
+
? { provider: "openai-codex", api: "openai-codex-responses", id: "gpt-6-astra" } : null;
|
|
680
|
+
emitEvent({ type: "agent_start" });
|
|
681
|
+
emitEvent({ type: "agent_settled" });
|
|
682
|
+
respond({ ...base, data: { output: "Codex model fixture updated" } });
|
|
683
|
+
return true;
|
|
684
|
+
}
|
|
676
685
|
if (message === "fixture reject next codex fast mode mutation") {
|
|
677
686
|
rejectNextCodexFastModeMutation = true;
|
|
678
687
|
// Prompt routing marks the tab active before RPC dispatch; settle this control-only fixture
|
|
@@ -682,7 +691,7 @@ function handleCodexFastModePrompt(command, base) {
|
|
|
682
691
|
respond({ ...base, data: { output: "next Codex Fast mode mutation will be rejected" } });
|
|
683
692
|
return true;
|
|
684
693
|
}
|
|
685
|
-
const match = message.match(/^\/fast-mode(?:\s+(on|off|status))?$/i);
|
|
694
|
+
const match = message.match(/^\/fast-mode(?:\s+(on|off|normal|fast|ultrafast|status))?$/i);
|
|
686
695
|
if (!match) return false;
|
|
687
696
|
const subcommand = String(match[1] || "").toLowerCase();
|
|
688
697
|
if (subcommand !== "status" && rejectNextCodexFastModeMutation) {
|
|
@@ -690,11 +699,12 @@ function handleCodexFastModePrompt(command, base) {
|
|
|
690
699
|
respond({ ...base, data: { output: "Fast mode mutation rejected while busy" } });
|
|
691
700
|
return true;
|
|
692
701
|
}
|
|
693
|
-
if (!subcommand)
|
|
694
|
-
else if (subcommand === "on")
|
|
695
|
-
else if (subcommand === "off")
|
|
702
|
+
if (!subcommand) codexSpeedMode = codexSpeedMode === "normal" ? "fast" : "normal";
|
|
703
|
+
else if (subcommand === "on" || subcommand === "fast") codexSpeedMode = "fast";
|
|
704
|
+
else if (subcommand === "off" || subcommand === "normal") codexSpeedMode = "normal";
|
|
705
|
+
else if (subcommand === "ultrafast") codexSpeedMode = "ultrafast";
|
|
696
706
|
emitCodexFastModeStatus();
|
|
697
|
-
respond({ ...base, data: { output: `
|
|
707
|
+
respond({ ...base, data: { output: `Codex speed ${codexSpeedMode}.` } });
|
|
698
708
|
return true;
|
|
699
709
|
}
|
|
700
710
|
|
|
@@ -1565,7 +1575,7 @@ rl.on("line", (line) => {
|
|
|
1565
1575
|
respond({
|
|
1566
1576
|
...base,
|
|
1567
1577
|
data: {
|
|
1568
|
-
model: { provider: "fake", id: "fake-model" },
|
|
1578
|
+
model: codexFixtureModel || { provider: "fake", id: "fake-model" },
|
|
1569
1579
|
thinkingLevel,
|
|
1570
1580
|
isStreaming: scriptedStreaming || guidedGitStateMode === "streaming",
|
|
1571
1581
|
isCompacting: guidedGitStateMode === "compacting",
|
|
@@ -90,8 +90,8 @@ test("fixture, cache revisions, and layered docs expose the migration contract",
|
|
|
90
90
|
assert.match(fakePi, /FAKE_PI_GUIDED_GIT_ACTIVATION/u);
|
|
91
91
|
assert.match(fakePi, /git-guided-workflow:webui-start/u);
|
|
92
92
|
assert.match(html, /styles\.css\?v=154/u);
|
|
93
|
-
assert.match(html, /app\.js\?v=
|
|
94
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
93
|
+
assert.match(html, /app\.js\?v=185/u);
|
|
94
|
+
assert.match(serviceWorker, /pi-webui-pwa-v156/u);
|
|
95
95
|
assert.match(serviceWorker, /"\/guided-git-command-state\.mjs"/u);
|
|
96
96
|
assert.match(readme, /pi-extension-git-guided-workflow/u);
|
|
97
97
|
assert.match(technical, /\/git-guided-workflow/u);
|
|
@@ -54,7 +54,7 @@ assert.match(readme, /fallback model and its own reasoning effort[\s\S]*tries th
|
|
|
54
54
|
assert.match(technical, /## Guided Git generation profiles[\s\S]*strict one-retry policy[\s\S]*active model and reasoning effort remain unchanged[\s\S]*dead Pi process cannot run the fallback/i, "technical reference should document configuration and operational limits");
|
|
55
55
|
assert.match(development, /### Fallback browser\/runtime contract[\s\S]*fallbackUsed: true[\s\S]*webui_git_workflow_generation_fallback_started[\s\S]*never sends a retry/, "development guide should preserve the response/event and browser ownership contract");
|
|
56
56
|
|
|
57
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
58
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
57
|
+
assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the changed browser app should use the next query revision");
|
|
58
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156";/, "the PWA cache identity should advance with browser behavior");
|
|
59
59
|
|
|
60
60
|
console.log("guided-git-fallback-ui-static.test.mjs passed");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
|
|
4
|
+
const manifest = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
|
|
5
|
+
const lock = JSON.parse(await readFile(new URL("../package-lock.json", import.meta.url), "utf8"));
|
|
6
|
+
const hostPackages = [
|
|
7
|
+
"@earendil-works/pi-ai",
|
|
8
|
+
"@earendil-works/pi-coding-agent",
|
|
9
|
+
"@earendil-works/pi-tui",
|
|
10
|
+
"typebox",
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
for (const name of hostPackages) {
|
|
14
|
+
assert.equal(manifest.dependencies?.[name], undefined, `${name} must come from the Pi host`);
|
|
15
|
+
assert.equal(manifest.optionalDependencies?.[name], undefined, `${name} must not install as an optional dependency`);
|
|
16
|
+
assert.equal(manifest.peerDependencies?.[name], "*", `${name} must accept the host's version`);
|
|
17
|
+
assert.ok(manifest.devDependencies?.[name], `${name} must remain available to local tests`);
|
|
18
|
+
}
|
|
19
|
+
assert.equal(manifest.dependencies?.["@earendil-works/pi-agent-core"], undefined);
|
|
20
|
+
for (const field of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
21
|
+
assert.deepEqual(lock.packages[""][field], manifest[field], `npm lock root must match ${field}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log("host-peer-dependencies.test.mjs passed");
|
|
@@ -3856,6 +3856,15 @@ try {
|
|
|
3856
3856
|
assert.equal(codexFastModeOn.status, 200, `Codex Fast mode on should succeed: ${codexFastModeOn.body?.error || ""}`);
|
|
3857
3857
|
assert.equal(codexFastModeOn.body?.data?.statusKnown, true);
|
|
3858
3858
|
assert.equal(codexFastModeOn.body?.data?.enabled, true, "PUT should return only extension-confirmed on state");
|
|
3859
|
+
assert.equal(codexFastModeOn.body?.data?.mode, "fast", "legacy enabled=true should select Fast");
|
|
3860
|
+
for (const body of [{ mode: "turbo" }, { mode: "ultrafast", enabled: false }, { mode: "normal", enabled: true }]) {
|
|
3861
|
+
const invalidMode = await request("127.0.0.1", "/api/codex-fast-mode", { method: "PUT", body: { ...body, tab: tabId } });
|
|
3862
|
+
assert.equal(invalidMode.status, 400, "invalid or contradictory mode intent must fail closed");
|
|
3863
|
+
}
|
|
3864
|
+
const unsupportedUltrafast = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3865
|
+
method: "PUT", body: { mode: "ultrafast", tab: tabId },
|
|
3866
|
+
});
|
|
3867
|
+
assert.equal(unsupportedUltrafast.status, 400, "Ultrafast should reject non-Astra models before dispatch");
|
|
3859
3868
|
|
|
3860
3869
|
const rejectNextCodexFastMode = await request("127.0.0.1", "/api/prompt", {
|
|
3861
3870
|
method: "POST",
|
|
@@ -3899,6 +3908,49 @@ try {
|
|
|
3899
3908
|
assert.equal(codexFastModeOff.status, 200, `Codex Fast mode off should succeed after the tab settles: ${codexFastModeOff.body?.error || ""}`);
|
|
3900
3909
|
assert.equal(codexFastModeOff.body?.data?.enabled, false);
|
|
3901
3910
|
assert.equal(codexFastModeOff.body?.data?.statusKnown, true, "off response should be extension-confirmed");
|
|
3911
|
+
assert.equal(codexFastModeOff.body?.data?.mode, "normal");
|
|
3912
|
+
|
|
3913
|
+
const astraFixture = await request("127.0.0.1", "/api/prompt", {
|
|
3914
|
+
method: "POST", body: { message: "fixture codex astra", tab: tabId },
|
|
3915
|
+
});
|
|
3916
|
+
assert.equal(astraFixture.status, 200);
|
|
3917
|
+
const astraSpeed = await request("127.0.0.1", `/api/codex-fast-mode?tab=${encodeURIComponent(tabId)}`);
|
|
3918
|
+
assert.equal(astraSpeed.body?.data?.ultrafastModelEligible, true);
|
|
3919
|
+
const ultrafast = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3920
|
+
method: "PUT", body: { mode: "ultrafast", tab: tabId },
|
|
3921
|
+
});
|
|
3922
|
+
assert.equal(ultrafast.status, 200, `Ultrafast should confirm: ${ultrafast.body?.error || ""}`);
|
|
3923
|
+
assert.equal(ultrafast.body?.data?.mode, "ultrafast");
|
|
3924
|
+
assert.equal(ultrafast.body?.data?.enabled, true);
|
|
3925
|
+
assert.equal(ultrafast.body?.data?.requested, "ultrafast");
|
|
3926
|
+
|
|
3927
|
+
await request("127.0.0.1", "/api/prompt", {
|
|
3928
|
+
method: "POST", body: { message: "fixture reject next codex fast mode mutation", tab: tabId },
|
|
3929
|
+
});
|
|
3930
|
+
const rejectedFastFromUltra = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3931
|
+
method: "PUT", body: { mode: "fast", tab: tabId },
|
|
3932
|
+
});
|
|
3933
|
+
assert.equal(rejectedFastFromUltra.status, 409, "enabled=true alone must not confirm Fast when Ultrafast is still selected");
|
|
3934
|
+
const stillUltra = await request("127.0.0.1", `/api/codex-fast-mode?tab=${encodeURIComponent(tabId)}`);
|
|
3935
|
+
assert.equal(stillUltra.body?.data?.mode, "ultrafast");
|
|
3936
|
+
|
|
3937
|
+
const legacyOnFromUltra = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3938
|
+
method: "PUT", body: { enabled: true, tab: tabId },
|
|
3939
|
+
});
|
|
3940
|
+
assert.equal(legacyOnFromUltra.status, 200);
|
|
3941
|
+
assert.equal(legacyOnFromUltra.body?.data?.mode, "fast", "legacy on must explicitly leave Ultrafast");
|
|
3942
|
+
await request("127.0.0.1", "/api/codex-fast-mode", { method: "PUT", body: { mode: "ultrafast", tab: tabId } });
|
|
3943
|
+
const legacyOffFromUltra = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3944
|
+
method: "PUT", body: { enabled: false, tab: tabId },
|
|
3945
|
+
});
|
|
3946
|
+
assert.equal(legacyOffFromUltra.status, 200);
|
|
3947
|
+
assert.equal(legacyOffFromUltra.body?.data?.mode, "normal", "legacy off must disarm Ultrafast too");
|
|
3948
|
+
const explicitNormal = await request("127.0.0.1", "/api/codex-fast-mode", {
|
|
3949
|
+
method: "PUT", body: { mode: "normal", tab: tabId },
|
|
3950
|
+
});
|
|
3951
|
+
assert.equal(explicitNormal.status, 200);
|
|
3952
|
+
assert.equal(explicitNormal.body?.data?.mode, "normal");
|
|
3953
|
+
await request("127.0.0.1", "/api/prompt", { method: "POST", body: { message: "fixture codex reset", tab: tabId } });
|
|
3902
3954
|
|
|
3903
3955
|
// Natural Conversation shell: /talk availability drives per-tab status and safety guards.
|
|
3904
3956
|
const conversationFeature = await request("127.0.0.1", `/api/features/natural-conversation?tab=${encodeURIComponent(tabId)}`);
|
|
@@ -97,8 +97,8 @@ assert.match(css, /\.extension-dialog\.intercom-conversation-dialog \{[\s\S]*wid
|
|
|
97
97
|
assert.match(css, /@media \(max-width: 720px\)[\s\S]*\.composer-intercom-tag \{ min-height: 44px;[\s\S]*\.extension-dialog\.intercom-conversation-dialog[\s\S]*width: calc\(100vw - 0\.7rem\)/, "tags and the dialog should remain reachable on narrow and coarse-pointer layouts");
|
|
98
98
|
|
|
99
99
|
assert.match(html, /\/styles\.css\?v=154/, "the stylesheet URL should advance for the bounded conversation tags");
|
|
100
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
101
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
100
|
+
assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the guarded app URL should advance for current browser wiring");
|
|
101
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "the PWA cache identity should advance with browser assets");
|
|
102
102
|
|
|
103
103
|
assert.match(readme, /one compact tag per conversation appears beneath the composer/i, "the README should explain the user-visible entry point");
|
|
104
104
|
assert.match(technical, /## Agent conversation viewer[\s\S]*Attachments, tool calls and results, thinking, stdout\/stderr, filesystem paths, raw session records/i, "the advanced guide should document privacy exclusions");
|
|
@@ -59,8 +59,8 @@ assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4
|
|
|
59
59
|
assert.match(css, /body\.subagent-terminal-active \.main-output-surface,[\s\S]*body\.subagent-terminal-active \.main-output-loading,/, "dedicated subagent output should hide the main transcript and its loading status");
|
|
60
60
|
|
|
61
61
|
assert.match(html, /styles\.css\?v=154/, "the stylesheet cache query should advance");
|
|
62
|
-
assert.match(html, /app\.js\?v=
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
62
|
+
assert.match(html, /app\.js\?v=185/, "the app cache query should advance");
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "the PWA cache identity should advance with browser assets");
|
|
64
64
|
assert.match(readme, /Loading conversation history/, "user documentation should describe the plain-language loading feedback");
|
|
65
65
|
assert.match(development, /main output loading/i, "developer documentation should preserve the request-ownership contract");
|
|
66
66
|
|
|
@@ -17,8 +17,8 @@ assert.match(app, /installMiddleButtonDragScroll\(\{[\s\S]*onDirection: \(\{ tar
|
|
|
17
17
|
assert.match(app, /event\?\.type === "middle-drag"\) return event\.deltaY > 0;/, "moving below the press point should be recognized as intent to read later chat output");
|
|
18
18
|
assert.match(css, /body\.middle-button-auto-scrolling,[\s\S]*cursor: all-scroll !important;[\s\S]*user-select: none !important;/, "active automatic scrolling should expose a directional-scroll affordance and suppress accidental selection");
|
|
19
19
|
assert.match(html, /styles\.css\?v=154/, "changed drag-scroll styles should advance the stylesheet revision");
|
|
20
|
-
assert.match(html, /app\.js\?v=
|
|
21
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
20
|
+
assert.match(html, /app\.js\?v=185/, "changed drag-scroll wiring should advance the app revision");
|
|
21
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156";[\s\S]*"\/middle-button-drag-scroll\.mjs"/, "offline PWA installs should refresh and cache the new controller module");
|
|
22
22
|
assert.match(JSON.parse(packageJson).scripts.check, /node --check public\/middle-button-drag-scroll\.mjs/, "the package check should parse the startup-critical controller module");
|
|
23
23
|
|
|
24
24
|
console.log("middle-button-drag-scroll-static.test.mjs passed");
|
|
@@ -47,9 +47,9 @@ assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-nav[\s\S]*?widt
|
|
|
47
47
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-surface[\s\S]*?width: min\(30rem, 72vw\)/, "tablet inspector must be a bounded right-side sheet");
|
|
48
48
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.file-viewer-pane[\s\S]*?position: fixed[\s\S]*?inset: 0/, "tablet files must default to full-screen replacement");
|
|
49
49
|
assert.match(css, /and \(pointer: coarse\)[\s\S]*?min-height: 44px/, "coarse tablet pointers must retain the 44px target floor");
|
|
50
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
50
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
51
|
assert.match(html, /styles\.css\?v=154/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
-
assert.match(html, /app\.js\?v=
|
|
52
|
+
assert.match(html, /app\.js\?v=185/, "continuity app logic must have a coherent HTML revision");
|
|
53
53
|
assert.match(technical, /tabletShell=v2[\s\S]*tabletShell=legacy/, "technical reference should document tablet preview and rollback");
|
|
54
54
|
|
|
55
55
|
console.log("mobile-continuity-tablet-static.test.mjs passed");
|
|
@@ -37,9 +37,9 @@ assert.match(pkg.scripts.check, /node --check public\/transcript-renderer\.mjs/,
|
|
|
37
37
|
assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server must serve typed startup modules from the public asset boundary");
|
|
38
38
|
assert.match(serviceWorker, /"\/mobile-shell-state\.mjs"/, "the PWA shell must cache the new startup module");
|
|
39
39
|
assert.match(serviceWorker, /"\/transcript-renderer\.mjs"/, "the PWA shell must cache the transcript startup module");
|
|
40
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
40
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "the cache identity must change with the startup graph");
|
|
41
41
|
assert.match(html, /styles\.css\?v=154/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
42
|
-
assert.match(html, /app\.js\?v=
|
|
42
|
+
assert.match(html, /app\.js\?v=185/, "the app revision must change with continuity/tablet wiring");
|
|
43
43
|
assert.match(serviceWorker, /const APP_SHELL_NETWORK_TIMEOUT_MS = 8_000;[\s\S]*?event\.waitUntil\([\s\S]*?cache\.put\(request, response\.clone\(\)\)[\s\S]*?return networkResponse;/, "runtime cache writes must extend the event lifetime without blocking bounded network responses");
|
|
44
44
|
assert.match(serviceWorker, /MOBILE_NAVIGATION_MESSAGE_TYPE = "pi-webui:navigate:v1"/, "the service worker must use a versioned active-client navigation message");
|
|
45
45
|
assert.match(serviceWorker, /client\.postMessage\(\{ type: MOBILE_NAVIGATION_MESSAGE_TYPE, target \}\)/, "existing clients must receive only a validated target message");
|
|
@@ -60,6 +60,6 @@ assert.match(css, /data-mobile-presentation="essential"/, "Essential presentatio
|
|
|
60
60
|
assert.match(css, /html\[data-mobile-shell="v2"\] body\.mobile-keyboard-open \.widget-area,[\s\S]*?\.composer-actions-button \{ display: block !important; \}/, "v2 keyboard mode must keep run widgets and the actions entry available");
|
|
61
61
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)/, "reduced-motion behavior is required");
|
|
62
62
|
assert.match(css, /@media \(forced-colors: active\)/, "forced-color affordances are required");
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|
|
@@ -47,7 +47,9 @@ try {
|
|
|
47
47
|
stdio: ["ignore", "pipe", "pipe"],
|
|
48
48
|
env: { ...process.env, PATH: `${bin}${path.delimiter}${process.env.PATH || ""}`,
|
|
49
49
|
PI_CODING_AGENT_DIR: path.join(temp, "agent"), PI_WEBUI_NPM_BIN: path.join(npmRoot, "bin", "npm-cli.js"),
|
|
50
|
-
PI_WEBUI_UPDATE_TEST_HOME: temp, NODE_ENV: "test", PI_OFFLINE: "1"
|
|
50
|
+
PI_WEBUI_UPDATE_TEST_HOME: temp, NODE_ENV: "test", PI_OFFLINE: "1",
|
|
51
|
+
// Supervised tabs are the only ones a fenced native restart can preserve; run-all disables the supervisor by default.
|
|
52
|
+
PI_WEBUI_RPC_SUPERVISOR: "1" },
|
|
51
53
|
});
|
|
52
54
|
child.stdout.on("data", (chunk) => { output += chunk; });
|
|
53
55
|
child.stderr.on("data", (chunk) => { output += chunk; });
|
|
@@ -68,7 +68,7 @@ assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server
|
|
|
68
68
|
assert.match(serviceWorker, /"\/issue-wizard-state\.mjs"/, "the PWA shell must keep caching the pure wizard module");
|
|
69
69
|
assert.match(serviceWorker, /"\/issue-bot-client\.mjs"/, "the PWA shell must cache the browser client module");
|
|
70
70
|
// Intent preserved: changing the public startup graph advances the PWA cache identity.
|
|
71
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
71
|
+
assert.match(serviceWorker, /pi-webui-pwa-v156/, "the PWA cache name must change with browser wiring updates");
|
|
72
72
|
assert.match(packageJson, /node --check public\/issue-wizard-state\.mjs/, "the package check must keep syntax-checking the pure wizard module");
|
|
73
73
|
assert.match(packageJson, /node --check public\/issue-bot-client\.mjs/, "the package check must syntax-check the browser client module");
|
|
74
74
|
|
|
@@ -61,7 +61,7 @@ assert.match(readme, /\+.*initial system prompt[\s\S]*?\+\.\.\..*session is runn
|
|
|
61
61
|
assert.match(technical, /prompt-impact indicators[\s\S]*?tool schemas and ordinary user or tool messages are not counted/i, "technical reference should state the measurement boundary");
|
|
62
62
|
assert.match(development, /reports\/pi-default-system-prompt-evaluation\.md[\s\S]*?promptImpact/, "contributor guide should identify the evidence source and catalog field");
|
|
63
63
|
assert.match(html, /styles\.css\?v=154/, "indicator styles should advance the stylesheet revision");
|
|
64
|
-
assert.match(html, /app\.js\?v=
|
|
65
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
64
|
+
assert.match(html, /app\.js\?v=185/, "indicator rendering should advance the app revision");
|
|
65
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "browser asset changes should advance the PWA cache identity");
|
|
66
66
|
|
|
67
67
|
console.log("optional-feature-prompt-impact-static.test.mjs passed");
|
|
@@ -271,8 +271,8 @@ assert.match(
|
|
|
271
271
|
|
|
272
272
|
// --- Coherent browser asset revisions --------------------------------------
|
|
273
273
|
|
|
274
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
274
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "changed browser assets should advance the PWA cache identity");
|
|
275
275
|
assert.match(html, /styles\.css\?v=154/, "the page should request the updated layout stylesheet revision");
|
|
276
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
276
|
+
assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the boot loader should request the updated app module revision");
|
|
277
277
|
|
|
278
278
|
console.log("persistent-ui-layout-static.test.mjs passed");
|
|
@@ -20,7 +20,7 @@ assert.match(css, /#promptInput \{[\s\S]*--prompt-input-block-chrome: calc\(1\.8
|
|
|
20
20
|
assert.match(resizePromptInput, /input\.style\.height = "auto";[\s\S]*borderTopWidth[\s\S]*borderBottomWidth[\s\S]*naturalHeight = input\.scrollHeight \+ borderBlock[\s\S]*isCapped \? "auto" : "hidden"/, "auto-resizing should include the textarea borders and enable vertical scrolling only after the six-line cap");
|
|
21
21
|
assert.doesNotMatch(resizePromptInput, /input\.style\.overflowY = "auto";/, "auto-resizing must not force a scrollbar below the six-line cap");
|
|
22
22
|
assert.match(html, /styles\.css\?v=154/, "the page should request the six-line prompt stylesheet revision");
|
|
23
|
-
assert.match(html, /app\.js\?v=
|
|
24
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
23
|
+
assert.match(html, /app\.js\?v=185/, "the page should request the current app revision");
|
|
24
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "the PWA cache identity should advance with the prompt scroll assets");
|
|
25
25
|
|
|
26
26
|
console.log("prompt-input-vertical-scroll-static.test.mjs passed");
|
|
@@ -505,7 +505,7 @@ assert.match(css, /\.questionnaire-options button\s*\{\s*min-height:\s*3\.35rem/
|
|
|
505
505
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)\s*\{[\s\S]*?\*, \*::before, \*::after[\s\S]*?transition-duration:\s*1ms !important/, "global reduced-motion rules must cover questionnaire transitions");
|
|
506
506
|
|
|
507
507
|
assert.match(html, /styles\.css\?v=154/, "questionnaire CSS needs the current stylesheet revision");
|
|
508
|
-
assert.match(html, /app\.js\?v=
|
|
509
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
508
|
+
assert.match(html, /app\.js\?v=185/, "questionnaire behavior needs the current app revision");
|
|
509
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "questionnaire public assets need a coherent PWA cache revision");
|
|
510
510
|
|
|
511
511
|
console.log("questionnaire-dialog.test.mjs passed");
|