@firstpick/pi-package-webui 0.9.4 → 0.9.6
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 +7 -2
- package/bin/pi-webui.mjs +90 -5
- package/lib/optional-feature-catalog.mjs +1 -1
- package/lib/session-actions.mjs +20 -2
- package/lib/ui-layout-settings.mjs +37 -6
- package/package.json +1 -1
- package/public/app.js +2311 -257
- package/public/index.html +82 -55
- package/public/service-worker.js +4 -1
- package/public/stream-derived-output.mjs +799 -0
- package/public/stream-markdown-tail.mjs +204 -0
- package/public/stream-output-controller.mjs +222 -51
- package/public/stream-render-scheduler.mjs +85 -0
- package/public/styles.css +276 -20
- package/public/transcript-renderer.mjs +73 -24
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/composer-action-grid-reorder.spec.mjs +114 -31
- package/tests/browser/control-deck-side-panels.spec.mjs +42 -0
- package/tests/browser/control-visibility.spec.mjs +396 -0
- package/tests/browser/mobile-foundation.spec.mjs +28 -0
- package/tests/browser/persistent-ui-layout.spec.mjs +9 -9
- package/tests/browser/stream-output-isolation.spec.mjs +308 -3
- package/tests/browser/user-noticeable-fixes.spec.mjs +204 -0
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-static.test.mjs +8 -7
- package/tests/control-deck-side-panels-static.test.mjs +3 -1
- package/tests/control-visibility-static.test.mjs +294 -0
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/cwd-footer-reliability-static.test.mjs +1 -1
- package/tests/fast-mode-client-static.test.mjs +1 -1
- package/tests/feature-decision-output-popup-static.test.mjs +2 -2
- package/tests/file-viewer-image-static.test.mjs +3 -3
- package/tests/fixtures/fake-pi.mjs +57 -10
- package/tests/fixtures/streaming-workloads.mjs +167 -0
- package/tests/footer-provider-usage-visual-static.test.mjs +15 -0
- package/tests/foreground-transcript-catch-up-static.test.mjs +7 -1
- package/tests/git-workflow-preferences.test.mjs +2 -2
- package/tests/http-endpoints-harness.test.mjs +4 -4
- package/tests/interaction-state-stability-static.test.mjs +3 -1
- package/tests/intercom-conversation-viewer-static.test.mjs +4 -4
- package/tests/intercom-conversations-http.test.mjs +16 -0
- package/tests/main-output-loading-static.test.mjs +3 -3
- package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +3 -3
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +77 -66
- package/tests/open-issue-wizard-static.test.mjs +2 -2
- package/tests/persistent-ui-layout-static.test.mjs +7 -7
- package/tests/prompt-input-vertical-scroll-static.test.mjs +26 -0
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/runtime-error-visibility.test.mjs +3 -3
- package/tests/session-auth-harness.test.mjs +26 -1
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/stream-derived-output.test.mjs +121 -0
- package/tests/stream-markdown-tail.test.mjs +218 -0
- package/tests/stream-output-controller.test.mjs +119 -4
- package/tests/stream-output-isolation-static.test.mjs +34 -6
- package/tests/stream-output-workloads.test.mjs +276 -0
- package/tests/stream-render-scheduler.test.mjs +115 -0
- package/tests/streaming-ui-coupling.test.mjs +1 -1
- package/tests/subagent-observability-static.test.mjs +2 -2
- package/tests/syntax-highlighting-static.test.mjs +3 -3
- package/tests/theme-customizer-static.test.mjs +1 -1
- package/tests/thinking-format-parser.test.mjs +15 -0
- package/tests/todo-filter-static.test.mjs +148 -0
- package/tests/transcript-markdown-tail.test.mjs +137 -0
- package/tests/ui-layout-settings.test.mjs +54 -7
- package/tests/webui-settings-locking.test.mjs +3 -3
|
@@ -30,14 +30,14 @@ assert.match(html, /id="composerActionOrderStatus"[^>]*role="status"[^>]*aria-li
|
|
|
30
30
|
|
|
31
31
|
assert.match(
|
|
32
32
|
css,
|
|
33
|
-
/body\.composer-action-grid-enabled \.composer-row\s*\{[\s\S]*--composer-action-cell-min-width:\s*3\.2rem[\s\S]*display:\s*grid[\s\S]*grid-template-columns:\s*repeat\(auto-fill,
|
|
34
|
-
"the desktop composer should use
|
|
33
|
+
/body\.composer-action-grid-enabled \.composer-row\s*\{[\s\S]*--composer-action-cell-min-width:\s*3\.2rem[\s\S]*display:\s*grid[\s\S]*grid-template-columns:\s*repeat\(auto-fill, var\(--composer-action-cell-min-width\)\)[\s\S]*grid-auto-flow:\s*dense/,
|
|
34
|
+
"the desktop composer should use fixed-width dense grid cells",
|
|
35
35
|
);
|
|
36
36
|
assert.match(css, /grid-column:\s*var\(--composer-action-grid-column, auto\) \/ span var\(--composer-action-grid-span\)/, "actions should support explicit sparse grid columns");
|
|
37
37
|
assert.match(css, /\[data-composer-action-span="2"\]\s*\{\s*--composer-action-grid-span:\s*2;/, "wide actions should span exactly two cells");
|
|
38
38
|
assert.match(css, /body\.composer-action-grid-enabled \.composer-row \[data-composer-action-id\]\.composer-publish-menu:hover,[\s\S]*\.composer-publish-menu:focus-within,[\s\S]*\.composer-publish-menu\.open \{\s*z-index:\s*100;/, "open composer dropdowns should stack above prompt tags and neighboring grid controls");
|
|
39
39
|
assert.match(css, /#newSessionButton\s*\{[\s\S]*display:\s*grid[\s\S]*place-items:\s*center[\s\S]*padding-inline:\s*0\.4rem[\s\S]*text-align:\s*center/, "New should center its label inside the one-cell button");
|
|
40
|
-
assert.match(css, /composer-action-drag-active[\s\S]*composer-action-grid-guide:not\(\[hidden\]\)[\s\S]*position:\s*absolute[\s\S]*inset:\s*0[\s\S]*grid-template-columns:\s*repeat\(auto-fill,
|
|
40
|
+
assert.match(css, /composer-action-drag-active[\s\S]*composer-action-grid-guide:not\(\[hidden\]\)[\s\S]*position:\s*absolute[\s\S]*inset:\s*0[\s\S]*grid-template-columns:\s*repeat\(auto-fill, var\(--composer-action-cell-min-width\)\)[\s\S]*gap:\s*0\.5rem/, "the drag-only guide should cover the complete composer row with the same responsive tracks");
|
|
41
41
|
assert.match(css, /\.composer-action-grid-cell\s*\{[\s\S]*min-width:\s*0[\s\S]*border:[\s\S]*background:/, "empty guide cells should render as full grid cells");
|
|
42
42
|
assert.match(css, /composer-action-dragging[\s\S]*cursor:\s*grabbing[\s\S]*composer-action-drag-before[\s\S]*composer-action-drag-after/, "dragging and occupied drop targets should have visible affordances");
|
|
43
43
|
assert.match(css, /composer-action-grid-cell-target[\s\S]*border-color:\s*var\(--ctp-teal\)/, "empty-cell drop targets should have a visible affordance");
|
|
@@ -48,7 +48,8 @@ assert.match(app, /function applyComposerActionOrder\(orderIds\)[\s\S]*knownIds[
|
|
|
48
48
|
assert.match(app, /function showComposerActionGridGuide\(\)[\s\S]*composerActionGridColumnCount\(\)[\s\S]*top - groups\.at\(-1\) > 4[\s\S]*columnCount \* rowCount[\s\S]*composer-action-drag-active[\s\S]*function hideComposerActionGridGuide/, "dragging should materialize every full-row guide cell without splitting near-equal action tops into false rows");
|
|
49
49
|
assert.match(app, /function composerActionGridColumnCount\(\)[\s\S]*--composer-action-cell-min-width[\s\S]*row\.clientWidth[\s\S]*Math\.floor\(\(availableWidth \+ gap\) \/ \(minWidth \+ gap\)\)/, "column counts should derive from the visible row width instead of overflow-created implicit tracks");
|
|
50
50
|
assert.match(app, /function readStoredComposerActionLayout\(\)[\s\S]*COMPOSER_ACTION_LAYOUT_STORAGE_KEY[\s\S]*function composerActionSlotCanFit[\s\S]*function persistComposerActionSlotLayout[\s\S]*positions:\s*Object\.fromEntries/, "sparse cell positions should be validated and persisted independently from order");
|
|
51
|
-
assert.match(app, /function
|
|
51
|
+
assert.match(app, /function projectComposerActionSlots\(entries, sourceColumns, targetColumns\)[\s\S]*continuesChunk[\s\S]*targetColumns - chunkWidth[\s\S]*lastTargetRow[\s\S]*projected\.set[\s\S]*function nearestAvailableComposerActionSlot[\s\S]*function restoreComposerActionSlotLayout\(\)[\s\S]*projectComposerActionSlots/, "saved sparse positions should project contiguous action groups without changing their visual order");
|
|
52
|
+
assert.doesNotMatch(app, /relativeColumn|remapComposerActionSlot/, "composer width changes must not proportionally or independently remap saved action columns");
|
|
52
53
|
assert.doesNotMatch(app, /if \(!stored \|\| stored\.columns !== columns\)/, "column-count changes should not discard saved sparse positions");
|
|
53
54
|
assert.match(app, /function captureComposerActionSlotLayout\(\)[\s\S]*composerActionGridGuide[\s\S]*function moveComposerActionToGridCell\(actionId, cell\)[\s\S]*composerActionSlotCanFit[\s\S]*composer-action-grid-cell-target/, "empty grid cells should capture and retain exact action slots");
|
|
54
55
|
assert.match(app, /function composerActionRootFromPoint\(clientX, clientY\)[\s\S]*elementFromPoint[\s\S]*function updateComposerActionPointerDrag\(event\)[\s\S]*Math\.hypot[\s\S]*COMPOSER_ACTION_POINTER_DRAG_THRESHOLD_PX[\s\S]*showComposerActionGridGuide\(\)[\s\S]*captureComposerActionSlotLayout\(\)[\s\S]*composerActionGridCellFromPoint[\s\S]*moveComposerActionToGridCell/, "pointer dragging should activate after the threshold and distinguish occupied from empty grid cells");
|
|
@@ -56,8 +57,8 @@ assert.match(app, /function initializeComposerActionOrdering\(\)[\s\S]*MutationO
|
|
|
56
57
|
assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreComposerActionOrder\(\)[\s\S]*event\.key === COMPOSER_ACTION_LAYOUT_STORAGE_KEY\) restoreComposerActionSlotLayout\(\)/, "other tabs should apply persisted composer order and sparse-layout changes");
|
|
57
58
|
assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
|
|
58
59
|
|
|
59
|
-
assert.match(html, /styles\.css\?v=
|
|
60
|
-
assert.match(html, /app\.js\?v=
|
|
61
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
60
|
+
assert.match(html, /styles\.css\?v=132/, "changed composer styles should advance the stylesheet revision");
|
|
61
|
+
assert.match(html, /app\.js\?v=157/, "changed composer behavior should advance the app revision");
|
|
62
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v123"/, "changed browser assets should advance the PWA cache identity");
|
|
62
63
|
|
|
63
64
|
console.log("composer-action-grid-reorder-static.test.mjs passed");
|
|
@@ -23,7 +23,7 @@ assert.match(html, /<div class="workspace-column">[\s\S]*<section class="chat-pa
|
|
|
23
23
|
assert.match(html, /<option value="left">Sidebar<\/option>/);
|
|
24
24
|
assert.match(html, /id="controlDeckPlacementSelect"[\s\S]*<option value="right">Right<\/option>[\s\S]*<option value="left">Left<\/option>[\s\S]*<option value="both">Both<\/option>/);
|
|
25
25
|
|
|
26
|
-
assert.match(app, /const UI_LAYOUT_SCHEMA_VERSION =
|
|
26
|
+
assert.match(app, /const UI_LAYOUT_SCHEMA_VERSION = 3;/);
|
|
27
27
|
assert.match(app, /const UI_LAYOUT_SIDE_PANEL_FIELDS = \["placement", "sectionLayout", "collapsedSectionIds", "hiddenSectionIds", "collapsedPanels", "panelWidths"\]/);
|
|
28
28
|
assert.match(app, /const CONTROL_DECK_LAYOUT_STORAGE_KEY = "pi-webui-control-deck-layout-v2"/);
|
|
29
29
|
assert.match(app, /function controlDeckSectionRecords\(\)[\s\S]*document\.querySelectorAll\("\[data-side-panel-section\]"\)/);
|
|
@@ -63,6 +63,8 @@ assert.match(css, /body\.terminal-tabs-left \.chat-search-bar[\s\S]*body\.termin
|
|
|
63
63
|
assert.match(css, /body\.terminal-tabs-left\.terminal-tabs-sidebar-start \.chat-panel[\s\S]*grid-template-columns:\s*minmax\(13rem, var\(--terminal-tabs-sidebar-width\)\) minmax\(0, 1fr\)/);
|
|
64
64
|
assert.match(css, /body\.terminal-tabs-left\.terminal-tabs-sidebar-start \.terminal-tabs-shell[\s\S]*grid-column:\s*1/);
|
|
65
65
|
assert.match(css, /body\.terminal-tabs-left\.terminal-tabs-sidebar-start \.chat[\s\S]*grid-column:\s*2/);
|
|
66
|
+
assert.match(css, /body\.embedded-split \.layout,[\s\S]*body\.embedded-split:not\(\.control-deck-left\):not\(\.control-deck-both\) \.layout \{[\s\S]*grid-template-columns:\s*minmax\(0, 1fr\);/, "embedded split terminals should override the more specific default Control Deck columns");
|
|
67
|
+
assert.match(css, /body\.embedded-split \.chat-panel,\s*body\.embedded-split\.terminal-tabs-left \.chat-panel \{[\s\S]*display:\s*flex;[\s\S]*flex-direction:\s*column;[\s\S]*overflow:\s*hidden;/, "embedded split terminals should ignore the saved sidebar grid at every iframe width");
|
|
66
68
|
assert.match(css, /\.workspace-column[\s\S]*body\.terminal-split-open \.workspace-column[\s\S]*body\.file-viewer-open \.workspace-column[\s\S]*body\.terminal-split-open\.file-viewer-open \.workspace-column/);
|
|
67
69
|
|
|
68
70
|
console.log("control-deck-side-panels-static.test.mjs passed");
|
|
@@ -0,0 +1,294 @@
|
|
|
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 [html, app, styles, serviceWorker] = await Promise.all([
|
|
8
|
+
readFile(join(root, "public", "index.html"), "utf8"),
|
|
9
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
|
+
readFile(join(root, "public", "service-worker.js"), "utf8"),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
// --- Approved stable catalog ------------------------------------------------
|
|
15
|
+
|
|
16
|
+
const catalog = [
|
|
17
|
+
// Workspace toolbar
|
|
18
|
+
["workspace.save", "Save workspace", "#workspaceSaveButton"],
|
|
19
|
+
["workspace.command-palette", "Command palette", "#commandPaletteButton"],
|
|
20
|
+
["workspace.overview", "Show workspace overview", "#workspaceDashboardToggleButton"],
|
|
21
|
+
["workspace.close-all-tabs", "Close all tabs", "#closeAllTabsButton"],
|
|
22
|
+
// Control Deck
|
|
23
|
+
["control-deck.sponsor", "Sponsor", ".sponsor-link"],
|
|
24
|
+
["control-deck.open-issue", "Open Issue", "#openIssueButton"],
|
|
25
|
+
// Composer actions
|
|
26
|
+
["composer.new", "New", '[data-composer-action-id="new"]'],
|
|
27
|
+
["composer.compact", "Compact", '[data-composer-action-id="compact"]'],
|
|
28
|
+
["composer.guided-git", "Guided Git workflow", '[data-composer-action-id="git"]'],
|
|
29
|
+
["composer.publish", "AUR/npm release dropdown", '[data-composer-action-id="publish"]'],
|
|
30
|
+
["composer.tools-skills", "Tools/skills setup dropdown", '[data-composer-action-id="native-command"]'],
|
|
31
|
+
["composer.common-options", "Common options", '[data-composer-action-id="options"]'],
|
|
32
|
+
["composer.app-runner", "App runner", '[data-composer-action-id="app-runner"]'],
|
|
33
|
+
["composer.steer", "Steer", '[data-composer-action-id="steer"]'],
|
|
34
|
+
["composer.follow-up", "Follow-up", '[data-composer-action-id="follow-up"]'],
|
|
35
|
+
["composer.btw", "/btw side question", '[data-composer-action-id="btw"]'],
|
|
36
|
+
// Prompt input-frame controls
|
|
37
|
+
["input.workflow", "Workflow controls", "#workflowModeControls"],
|
|
38
|
+
["input.attach-files", "Attach files", "#attachButton"],
|
|
39
|
+
// Prompt input-frame tag types
|
|
40
|
+
["tag.prompt-behavior", "Follow-up/Steer busy-prompt behavior tag", "#busyPromptBehaviorTag"],
|
|
41
|
+
["tag.skills", "Session skill tags", "#sessionSkillTags"],
|
|
42
|
+
["tag.agent-conversations", "Intercom agent-conversation tags", "#intercomConversationTags"],
|
|
43
|
+
["tag.feature-category", "Feature-category tag", "#featureCategoryTag"],
|
|
44
|
+
["tag.voice-mode", "Natural-conversation/voice tag", "#conversationModeChip"],
|
|
45
|
+
["tag.workflow-mode", "Workflow-mode tag", "#workflowModeChip"],
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const groupLabels = ["Workspace toolbar", "Control Deck", "Composer actions", "Input-frame controls", "Input-frame tags"];
|
|
49
|
+
|
|
50
|
+
for (const [id, label] of catalog) {
|
|
51
|
+
assert.ok(app.includes(`id: "${id}",`), `registry should keep the stable ${id} key`);
|
|
52
|
+
assert.ok(
|
|
53
|
+
html.includes(`data-visibility-key="${id}"`),
|
|
54
|
+
`the ${label} control should declare data-visibility-key="${id}" for direct hide targets`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
for (const label of groupLabels) {
|
|
58
|
+
assert.ok(app.includes(`"${label}"`), `the region menu should group entries under "${label}"`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --- Send exclusion ---------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
assert.doesNotMatch(
|
|
64
|
+
app,
|
|
65
|
+
/composer\.send/,
|
|
66
|
+
"Send must never be registered as a visibility toggle",
|
|
67
|
+
);
|
|
68
|
+
assert.doesNotMatch(
|
|
69
|
+
html,
|
|
70
|
+
/data-visibility-key="[^"]*send"/i,
|
|
71
|
+
"the Send button must not carry a visibility key",
|
|
72
|
+
);
|
|
73
|
+
{
|
|
74
|
+
const sendButtonMatch = html.match(/<button id="sendButton"[^>]*>/);
|
|
75
|
+
assert.ok(sendButtonMatch, "the composer should keep a Send button");
|
|
76
|
+
assert.doesNotMatch(sendButtonMatch[0], /data-visibility-key/, "the Send markup must stay unregistered");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// --- Durable schema and field ------------------------------------------------
|
|
80
|
+
|
|
81
|
+
assert.match(
|
|
82
|
+
app,
|
|
83
|
+
/const UI_LAYOUT_SCHEMA_VERSION = 3;/,
|
|
84
|
+
"the browser controller should send schema version 3 with the control visibility field",
|
|
85
|
+
);
|
|
86
|
+
assert.match(
|
|
87
|
+
app,
|
|
88
|
+
/const UI_LAYOUT_FIELDS = \[[^\]]*"controlVisibility"[^\]]*\];/,
|
|
89
|
+
"controlVisibility should travel through the revision-guarded interface-preferences writer",
|
|
90
|
+
);
|
|
91
|
+
assert.match(
|
|
92
|
+
app,
|
|
93
|
+
/case "controlVisibility":[\s{]*\n?\s*return \{ hiddenIds: readStoredControlVisibilityHiddenIds\(\) \};/,
|
|
94
|
+
"collecting the durable field should read the bounded local hidden-id list",
|
|
95
|
+
);
|
|
96
|
+
assert.match(
|
|
97
|
+
app,
|
|
98
|
+
/function applyDurableControlVisibility\(value\)[\s\S]*writeDurableLayoutCache\(CONTROL_VISIBILITY_HIDDEN_IDS_STORAGE_KEY[\s\S]*applyControlVisibility\(\)/,
|
|
99
|
+
"snapshot adoption should cache the hidden-key list and reapply it immediately",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// --- Class-based composition with runtime gating ------------------------------
|
|
103
|
+
|
|
104
|
+
assert.match(
|
|
105
|
+
styles,
|
|
106
|
+
/\.webui-user-hidden \{\s*display: none !important;\s*\}/,
|
|
107
|
+
"preference hiding needs a dedicated webui-user-hidden class",
|
|
108
|
+
);
|
|
109
|
+
assert.match(
|
|
110
|
+
app,
|
|
111
|
+
/element\.classList\.toggle\("webui-user-hidden", shouldHide\)/,
|
|
112
|
+
"showing a control only toggles the preference class instead of the hidden attribute",
|
|
113
|
+
);
|
|
114
|
+
assert.doesNotMatch(
|
|
115
|
+
app.match(/function applyControlVisibility[\s\S]*?function persistControlVisibilityHiddenIds/)?.[0] || "",
|
|
116
|
+
/\.hidden\s*=\s*[^)]/,
|
|
117
|
+
"the visibility applier must not assign or clear runtime hidden state",
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
// --- Empty-region grouped menu and direct hide menu ---------------------------
|
|
121
|
+
|
|
122
|
+
assert.match(
|
|
123
|
+
html,
|
|
124
|
+
/<div id="visibilityContextMenu"[^>]*role="menu"[^>]*hidden>/,
|
|
125
|
+
"the visibility recovery menu should be an initially empty menu container",
|
|
126
|
+
);
|
|
127
|
+
assert.match(
|
|
128
|
+
app,
|
|
129
|
+
/const CONTROL_VISIBILITY_GROUP_LABELS = \[[\s\:]*?\["workspace", "Workspace toolbar"\]/,
|
|
130
|
+
"the catalog should label its host regions",
|
|
131
|
+
);
|
|
132
|
+
for (const region of ["workspace", "control-deck", "composer", "inputframe"]) {
|
|
133
|
+
assert.ok(
|
|
134
|
+
html.includes(`data-visibility-region="${region}"`),
|
|
135
|
+
`the ${region} empty-area region should be marked in the markup`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
assert.match(
|
|
139
|
+
app,
|
|
140
|
+
/button\.setAttribute\("role", "menuitemcheckbox"\)/,
|
|
141
|
+
"the empty-region menu should expose menuitemcheckbox entries",
|
|
142
|
+
);
|
|
143
|
+
assert.match(
|
|
144
|
+
app,
|
|
145
|
+
/`Hide \$\{entry\.label\}`/,
|
|
146
|
+
"direct targets should offer a Hide <label> action",
|
|
147
|
+
);
|
|
148
|
+
for (const action of ["show-all", "reset-defaults"]) {
|
|
149
|
+
assert.ok(app.includes(`"${action}"`), `recovery action ${action} should exist`);
|
|
150
|
+
}
|
|
151
|
+
assert.match(
|
|
152
|
+
app,
|
|
153
|
+
/if \(action === "show-all"\)[\s\S]*showAllControls\(\)[\s\S]*else if \(action === "reset-defaults"\)[\s\S]*resetControlVisibilityDefaults\(\)/,
|
|
154
|
+
"Show all and Reset defaults remain distinct actions",
|
|
155
|
+
);
|
|
156
|
+
assert.match(
|
|
157
|
+
app,
|
|
158
|
+
/function showAllControls\(\) \{\s*persistControlVisibilityHiddenIds\(\[\]\);/,
|
|
159
|
+
"Show all should persist an explicit empty hidden-id list",
|
|
160
|
+
);
|
|
161
|
+
assert.match(
|
|
162
|
+
app,
|
|
163
|
+
/function resetControlVisibilityDefaults\(\) \{\s*persistControlVisibilityHiddenIds\(null\);/,
|
|
164
|
+
"Reset defaults should clear the preference back to null",
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
// --- Specialized menu preservation --------------------------------------------
|
|
168
|
+
|
|
169
|
+
assert.match(
|
|
170
|
+
app,
|
|
171
|
+
/target\.closest\?\.\("button, input, textarea, select, \[contenteditable='true'\], a"\)/,
|
|
172
|
+
"non-registered buttons, inputs, links, and editable contexts keep their native menu",
|
|
173
|
+
);
|
|
174
|
+
assert.match(
|
|
175
|
+
app,
|
|
176
|
+
/if \(target\.closest\?\.\("\.file-context-menu, dialog, \.composer-publish-menu-panel"\)\) return;[\s\S]*const direct/,
|
|
177
|
+
"open submenus and specialized context menus stay untouched before ancestor registry lookup",
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
// --- Accessible keyboard and dismissal behavior --------------------------------
|
|
181
|
+
|
|
182
|
+
assert.match(
|
|
183
|
+
app,
|
|
184
|
+
/event\.key !== "ContextMenu" && !\(event\.shiftKey && event\.key === "F10"\)/,
|
|
185
|
+
"Context Menu key and Shift+F10 should be keyboard-equivalent invocations",
|
|
186
|
+
);
|
|
187
|
+
assert.match(
|
|
188
|
+
app,
|
|
189
|
+
/addEventListener\("contextmenu", handleControlVisibilityContextMenu, \{ capture: true \}\)/,
|
|
190
|
+
"registered target handling should preempt owners of specialized menus",
|
|
191
|
+
);
|
|
192
|
+
{
|
|
193
|
+
const keydownBlock = app.match(/elements\.visibilityContextMenu\?\.addEventListener\("keydown", \(event\) => \{[\s\S]*?event\.key === "Home" \? 0 : items\.length - 1[\s\S]*?\}\);/)?.[0] || "";
|
|
194
|
+
for (const key of ["Escape", "ArrowDown", "ArrowUp", "Home", "End"]) {
|
|
195
|
+
assert.ok(keydownBlock.includes(`"${key}"`), `the menu should handle ${key}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
assert.match(
|
|
199
|
+
app,
|
|
200
|
+
/pointerdown[\s\S]*\.control-visibility-context-menu[\s\S]*closeVisibilityContextMenu\(\{ returnFocus: false \}\)/,
|
|
201
|
+
"outside clicks should dismiss the menu",
|
|
202
|
+
);
|
|
203
|
+
assert.match(
|
|
204
|
+
app,
|
|
205
|
+
/window\.addEventListener\("resize", \(\) => closeVisibilityContextMenu/,
|
|
206
|
+
"window resizing should dismiss the menu",
|
|
207
|
+
);
|
|
208
|
+
assert.match(
|
|
209
|
+
app,
|
|
210
|
+
/document\.addEventListener\("scroll",[\s\S]*closeVisibilityContextMenu\(\{ returnFocus: false \}\)/,
|
|
211
|
+
"document scrolling should dismiss the menu after the invocation grace period",
|
|
212
|
+
);
|
|
213
|
+
assert.match(
|
|
214
|
+
app,
|
|
215
|
+
/function positionControlVisibilityMenu\(clientX, clientY\)[\s\S]*window\.innerWidth - rect\.width[\s\S]*window\.innerHeight - rect\.height/,
|
|
216
|
+
"menu positioning should stay bounded inside the viewport",
|
|
217
|
+
);
|
|
218
|
+
assert.match(
|
|
219
|
+
app,
|
|
220
|
+
/wasHidden !== shouldHide && entry\.group === "composer"/,
|
|
221
|
+
"composer reflow detection must compare prior and next state so un-hiding also restores saved slots",
|
|
222
|
+
);
|
|
223
|
+
assert.match(
|
|
224
|
+
app,
|
|
225
|
+
/if \(composerChanged\) scheduleComposerActionSlotLayoutRestore\(\)/,
|
|
226
|
+
"composer action visibility changes should schedule a grid projection",
|
|
227
|
+
);
|
|
228
|
+
assert.match(
|
|
229
|
+
app,
|
|
230
|
+
/root\.classList\.contains\("webui-user-hidden"\)[\s\S]*repackComposerActionSlotLayout\(\{ persist: false \}\)/,
|
|
231
|
+
"hidden composer actions should project a dense grid without overwriting saved slots",
|
|
232
|
+
);
|
|
233
|
+
assert.match(
|
|
234
|
+
app,
|
|
235
|
+
/event\.key === CONTROL_VISIBILITY_HIDDEN_IDS_STORAGE_KEY\) \{\s*\/\/ [\s\S]*durableLayoutDirtyFields\.get\("controlVisibility"\)[\s\S]*applyControlVisibility\(dirtyVisibility \? dirtyVisibility\.value\?\.hiddenIds : undefined\)/,
|
|
236
|
+
"same-origin tabs should apply visibility cache updates immediately unless a local mutation is still pending",
|
|
237
|
+
);
|
|
238
|
+
assert.match(
|
|
239
|
+
app,
|
|
240
|
+
/durableLayoutDirtyFields\.delete\(field\);\s*if \(field === "controlVisibility"\) \{[\s\S]*writeDurableLayoutCache\(CONTROL_VISIBILITY_HIDDEN_IDS_STORAGE_KEY, JSON\.stringify\(entry\.value\?\.hiddenIds \?\? null\)\)[\s\S]*applyControlVisibility\(\)/,
|
|
241
|
+
"a successful visibility PUT should rewrite the acknowledged value into the same-origin cache",
|
|
242
|
+
);
|
|
243
|
+
assert.match(
|
|
244
|
+
styles,
|
|
245
|
+
/\.side-panel-context-menu-item\[aria-checked="true"\]::before \{\s*content: "✓";/,
|
|
246
|
+
"checked menu items should expose a visible check mark as well as aria-checked",
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
// --- Keyboard-only recovery from Send ------------------------------------------
|
|
250
|
+
|
|
251
|
+
assert.match(
|
|
252
|
+
app,
|
|
253
|
+
/const sendAnchor = entry \? null : target\.closest\?\.\("#sendButton"\);[\s\S]*if \(!entry && !sendAnchor && target\.closest\?\.\("button, input, textarea, select, \[contenteditable='true'\], a"\)\) return;/,
|
|
254
|
+
"Context Menu/Shift+F10 on the permanently visible Send button should open the grouped recovery menu",
|
|
255
|
+
);
|
|
256
|
+
{
|
|
257
|
+
const sendButtonMatch = html.match(/<button id="sendButton"[^>]*>/);
|
|
258
|
+
assert.ok(sendButtonMatch, "the composer should keep a Send button");
|
|
259
|
+
assert.match(
|
|
260
|
+
sendButtonMatch[0],
|
|
261
|
+
/aria-keyshortcuts="Alt\+ArrowLeft Alt\+ArrowRight Alt\+ArrowUp Alt\+ArrowDown ContextMenu Shift\+F10"/,
|
|
262
|
+
"Send should expose the keyboard recovery shortcut to assistive technology",
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
assert.match(
|
|
266
|
+
app,
|
|
267
|
+
/record\.id === "send"[\s\S]*"Alt\+ArrowLeft Alt\+ArrowRight Alt\+ArrowUp Alt\+ArrowDown ContextMenu Shift\+F10"/,
|
|
268
|
+
"the runtime composer-action shortcut wiring should keep the Send recovery shortcut",
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
// --- Focus restoration --------------------------------------------------------
|
|
272
|
+
|
|
273
|
+
assert.match(
|
|
274
|
+
app,
|
|
275
|
+
/function closeVisibilityContextMenu\(\{ returnFocus = true \} = \{\}\)[\s\S]*triggerSurvives[\s\S]*elements\.promptInput\?\.focus/,
|
|
276
|
+
"closing the menu should restore focus to a surviving trigger or the prompt input",
|
|
277
|
+
);
|
|
278
|
+
assert.match(
|
|
279
|
+
app,
|
|
280
|
+
/trigger\.matches\("button, a, input, select, textarea, \[tabindex\]"\)[\s\S]*\? trigger[\s\S]*: elements\.promptInput/,
|
|
281
|
+
"non-focusable region hosts should fall back to the prompt as the focus-restoration trigger",
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
// --- Cache identity -----------------------------------------------------------
|
|
285
|
+
|
|
286
|
+
assert.match(
|
|
287
|
+
serviceWorker,
|
|
288
|
+
/const CACHE_NAME = "pi-webui-pwa-v123";/,
|
|
289
|
+
"browser asset changes should advance the PWA cache identity",
|
|
290
|
+
);
|
|
291
|
+
assert.match(html, /styles\.css\?v=132/, "visibility styles should advance the stylesheet query revision");
|
|
292
|
+
assert.match(html, /data-app-src="\/app\.js\?v=157"/, "visibility behavior should advance the app query revision");
|
|
293
|
+
|
|
294
|
+
console.log("control-visibility-static.test.mjs passed");
|
|
@@ -15,8 +15,8 @@ assert.equal((html.match(/class="control-row-label"[^>]*data-tooltip=/g) || []).
|
|
|
15
15
|
assert.match(app, /function initializeControlSettingTooltips\(\)[\s\S]*#sidePanelSectionControls \.control-row-label\[data-tooltip\][\s\S]*bindStyledTooltipEvents\(label\)[\s\S]*showFooterTooltip\(label\)/, "Controls help should use the viewport-safe floating tooltip for hover and keyboard access");
|
|
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
|
-
assert.match(html, /styles\.css\?v=
|
|
19
|
-
assert.match(html, /app\.js\?v=
|
|
20
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
18
|
+
assert.match(html, /styles\.css\?v=132/, "Controls stylesheet changes should advance the cache query");
|
|
19
|
+
assert.match(html, /app\.js\?v=157/, "Controls tooltip wiring should advance the app cache query");
|
|
20
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v123"/, "Controls browser assets should advance the PWA cache identity");
|
|
21
21
|
|
|
22
22
|
console.log("controls-layout-static.test.mjs passed");
|
|
@@ -53,7 +53,7 @@ assert.match(
|
|
|
53
53
|
);
|
|
54
54
|
assert.match(
|
|
55
55
|
app,
|
|
56
|
-
/const
|
|
56
|
+
/const footerPayload = parseGitFooterWebuiPayloadRaw\(request\.statusText\);[\s\S]*?const validPayload = !!footerPayload;[\s\S]*?validPayload \? "ready" : "failed"/,
|
|
57
57
|
"a later valid live payload should recover failed or waiting footer state",
|
|
58
58
|
);
|
|
59
59
|
assert.match(
|
|
@@ -156,7 +156,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
156
156
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
157
157
|
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");
|
|
158
158
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
159
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
159
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=157"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
160
160
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
161
161
|
|
|
162
162
|
const events = createFastModeOutputEvents();
|
|
@@ -166,7 +166,7 @@ assert.match(functionSource("closeTerminalTabs"), /clearFeatureDecisionStateForT
|
|
|
166
166
|
assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab\(connectedTabId, \{ render: true \}\)[\s\S]*scheduleForegroundReconcile\("event stream reconnect", 0\)/, "reconnect should clear local state before authoritative replay");
|
|
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
|
-
assert.match(html, /\/styles\.css\?v=
|
|
170
|
-
assert.match(html, /\/app\.js\?v=
|
|
169
|
+
assert.match(html, /\/styles\.css\?v=132/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
+
assert.match(html, /\/app\.js\?v=157/, "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-
|
|
66
|
-
assert.match(html, /styles\.css\?v=
|
|
67
|
-
assert.match(html, /app\.js\?v=
|
|
65
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v123"/, "changed viewer assets should advance the PWA cache identity");
|
|
66
|
+
assert.match(html, /styles\.css\?v=132/, "changed image styles should advance the stylesheet revision");
|
|
67
|
+
assert.match(html, /app\.js\?v=157/, "changed image rendering should advance the app revision");
|
|
68
68
|
|
|
69
69
|
console.log("file viewer image static tests passed");
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
resolveSamplingParameterCapabilities,
|
|
31
31
|
} from "../../lib/sampling-parameter-capabilities.mjs";
|
|
32
32
|
import { validateSamplingParameterObject } from "../../public/sampling-parameter-controls.mjs";
|
|
33
|
+
import { longTranscriptMessages } from "./streaming-workloads.mjs";
|
|
33
34
|
|
|
34
35
|
const sessionIndex = process.argv.indexOf("--session");
|
|
35
36
|
const sessionFile = sessionIndex !== -1
|
|
@@ -119,6 +120,7 @@ let scriptedStreaming = false;
|
|
|
119
120
|
let continuityRun = 0;
|
|
120
121
|
let streamIsolationRun = 0;
|
|
121
122
|
const pendingStreamIsolationRuns = new Map();
|
|
123
|
+
let streamIsolationLongTranscriptPopulated = false;
|
|
122
124
|
let largeTranscriptEnabled = false;
|
|
123
125
|
const fixtureSubagentRuns = [];
|
|
124
126
|
const fixtureSubagentGates = [];
|
|
@@ -931,7 +933,13 @@ function handleFastModeFixturePrompt(command, base) {
|
|
|
931
933
|
return true;
|
|
932
934
|
}
|
|
933
935
|
|
|
934
|
-
function streamIsolationTextDelta(index) {
|
|
936
|
+
function streamIsolationTextDelta(index, scenario = "standard") {
|
|
937
|
+
if (scenario === "long-transcript") {
|
|
938
|
+
const line = `const v${String(index).padStart(4, "0")} = ${index};\n`;
|
|
939
|
+
if (index === 0) return `\`\`\`js\n${line}`;
|
|
940
|
+
if (index === 999) return `${line}\`\`\`\nLONG-STREAM-TAIL`;
|
|
941
|
+
return line;
|
|
942
|
+
}
|
|
935
943
|
const digit = String(index % 10);
|
|
936
944
|
if (index === 0) return `ISOLATION-TEXT-BEGIN ${digit}`;
|
|
937
945
|
if (index === 999) return `${digit} ISOLATION-TEXT-TAIL`;
|
|
@@ -942,11 +950,19 @@ function logStreamIsolationPhase(runId, mode, scenario, phase) {
|
|
|
942
950
|
logJsonLine({ direction: "isolation-phase", isolationRunId: runId, isolationMode: mode, isolationScenario: scenario, isolationPhase: phase });
|
|
943
951
|
}
|
|
944
952
|
|
|
953
|
+
function ensureStreamIsolationLongTranscript() {
|
|
954
|
+
if (streamIsolationLongTranscriptPopulated) return 1000;
|
|
955
|
+
for (const message of longTranscriptMessages(1000)) appendDynamicMessage(message);
|
|
956
|
+
streamIsolationLongTranscriptPopulated = true;
|
|
957
|
+
return 1000;
|
|
958
|
+
}
|
|
959
|
+
|
|
945
960
|
function runStreamIsolationFixtureFlow(mode, scenario = "standard") {
|
|
946
961
|
const runId = `stream-isolation-${mode}-${scenario}-${++streamIsolationRun}`;
|
|
962
|
+
const retainedMessageCount = scenario === "long-transcript" ? ensureStreamIsolationLongTranscript() : 0;
|
|
947
963
|
const toolCallId = `${runId}-execution`;
|
|
948
964
|
const streamedToolCallId = `${runId}-call`;
|
|
949
|
-
const textDeltas = Array.from({ length: 1_000 }, (_, index) => streamIsolationTextDelta(index));
|
|
965
|
+
const textDeltas = Array.from({ length: 1_000 }, (_, index) => streamIsolationTextDelta(index, scenario));
|
|
950
966
|
const finalText = textDeltas.join("");
|
|
951
967
|
const thinkingText = "ISOLATION-THINKING-PATH";
|
|
952
968
|
const toolCall = { type: "toolCall", id: streamedToolCallId, name: "read", arguments: { path: "isolation.txt" } };
|
|
@@ -993,7 +1009,30 @@ function runStreamIsolationFixtureFlow(mode, scenario = "standard") {
|
|
|
993
1009
|
emitScriptedEvent(tagged({ type: "message_update", assistantMessageEvent: { type: "thinking_end", delta: thinkingText } }, "raw"));
|
|
994
1010
|
},
|
|
995
1011
|
},
|
|
996
|
-
|
|
1012
|
+
];
|
|
1013
|
+
|
|
1014
|
+
if (scenario === "paced-pressure") {
|
|
1015
|
+
for (let start = 0; start < 1_000; start += 10) {
|
|
1016
|
+
const end = start + 10;
|
|
1017
|
+
steps.push({
|
|
1018
|
+
afterMs: start === 0 ? 100 : 8,
|
|
1019
|
+
run: () => {
|
|
1020
|
+
emitTextRange(start, end);
|
|
1021
|
+
if (end !== 1_000) return;
|
|
1022
|
+
// Alternating kinds intentionally defeat adjacent coalescing. The
|
|
1023
|
+
// final text_end snapshot remains authoritative, so this pressure
|
|
1024
|
+
// phase can exercise queue bounds without changing settled output.
|
|
1025
|
+
for (let pressureIndex = 0; pressureIndex < 260; pressureIndex += 1) {
|
|
1026
|
+
emitScriptedEvent(tagged({ type: "message_update", assistantMessageEvent: { type: "thinking_delta", delta: "p" } }, "pressure"));
|
|
1027
|
+
emitScriptedEvent(tagged({ type: "message_update", assistantMessageEvent: { type: "text_delta", contentIndex: 1, delta: "x" } }, "pressure"));
|
|
1028
|
+
}
|
|
1029
|
+
emitScriptedEvent(tagged({ type: "message_update", assistantMessageEvent: { type: "text_end", contentIndex: 1, text: finalText } }, "raw"));
|
|
1030
|
+
logStreamIsolationPhase(runId, mode, scenario, "text-complete");
|
|
1031
|
+
},
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
} else {
|
|
1035
|
+
steps.push({
|
|
997
1036
|
afterMs: 100,
|
|
998
1037
|
run: () => {
|
|
999
1038
|
if (scenario === "abort") {
|
|
@@ -1004,8 +1043,8 @@ function runStreamIsolationFixtureFlow(mode, scenario = "standard") {
|
|
|
1004
1043
|
logStreamIsolationPhase(runId, mode, scenario, "text-complete");
|
|
1005
1044
|
}
|
|
1006
1045
|
},
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1009
1048
|
|
|
1010
1049
|
if (scenario === "abort") {
|
|
1011
1050
|
// Keep a deterministic partial stream pending long enough for the browser
|
|
@@ -1057,7 +1096,10 @@ function runStreamIsolationFixtureFlow(mode, scenario = "standard") {
|
|
|
1057
1096
|
}
|
|
1058
1097
|
completionSteps.push(
|
|
1059
1098
|
{
|
|
1060
|
-
|
|
1099
|
+
// Keep the expensive long-transcript stream live long enough for the
|
|
1100
|
+
// browser ledger and continuity assertions to sample it before the
|
|
1101
|
+
// authoritative settlement replaces the transient bubble.
|
|
1102
|
+
afterMs: scenario === "long-transcript" ? 15_000 : 1_200,
|
|
1061
1103
|
run: () => {
|
|
1062
1104
|
emitScriptedEvent(tagged({ type: "tool_execution_end", toolCallId, toolName: "read", isError: false, result: { content: [{ type: "text", text: "ISOLATION-TOOL-RESULT" }] } }, "post-burst"));
|
|
1063
1105
|
logStreamIsolationPhase(runId, mode, scenario, "tool-complete");
|
|
@@ -1085,7 +1127,7 @@ function runStreamIsolationFixtureFlow(mode, scenario = "standard") {
|
|
|
1085
1127
|
pendingStreamIsolationRuns.delete(runId);
|
|
1086
1128
|
runScriptedSteps(scenario === "lifecycle" ? steps : [...steps, ...completionSteps]);
|
|
1087
1129
|
});
|
|
1088
|
-
return { runId, finalText };
|
|
1130
|
+
return { runId, finalText, retainedMessageCount };
|
|
1089
1131
|
}
|
|
1090
1132
|
|
|
1091
1133
|
function continueStreamIsolationFixture(runId) {
|
|
@@ -1097,12 +1139,17 @@ function continueStreamIsolationFixture(runId) {
|
|
|
1097
1139
|
|
|
1098
1140
|
function handleStreamIsolationFixturePrompt(command, base) {
|
|
1099
1141
|
if (!streamIsolationEnabled) return false;
|
|
1100
|
-
const
|
|
1142
|
+
const message = String(command.message || "").trim();
|
|
1143
|
+
if (message === "fixture stream isolation populate long transcript") {
|
|
1144
|
+
respond({ ...base, data: { output: "stream isolation long transcript populated", retainedMessageCount: ensureStreamIsolationLongTranscript() } });
|
|
1145
|
+
return true;
|
|
1146
|
+
}
|
|
1147
|
+
const match = message.match(/^fixture stream isolation (normal|compact)(?: (standard|abort|lifecycle|background|long-transcript|paced-pressure))?$/);
|
|
1101
1148
|
if (!match) return false;
|
|
1102
1149
|
const mode = match[1];
|
|
1103
1150
|
const scenario = match[2] || "standard";
|
|
1104
|
-
const { runId, finalText } = runStreamIsolationFixtureFlow(mode, scenario);
|
|
1105
|
-
respond({ ...base, data: { output: "stream isolation fixture accepted", runId, deltaCount: 1_000, mode, scenario, finalText } });
|
|
1151
|
+
const { runId, finalText, retainedMessageCount } = runStreamIsolationFixtureFlow(mode, scenario);
|
|
1152
|
+
respond({ ...base, data: { output: "stream isolation fixture accepted", runId, deltaCount: 1_000, retainedMessageCount, mode, scenario, finalText } });
|
|
1106
1153
|
return true;
|
|
1107
1154
|
}
|
|
1108
1155
|
|