@firstpick/pi-package-webui 0.10.0 → 0.10.1
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 +7 -2
- package/README.md +5 -3
- package/TECHNICAL.md +4 -0
- package/bin/pi-webui.mjs +5 -4
- package/package.json +1 -1
- package/public/app.js +145 -33
- package/public/index.html +10 -7
- package/public/service-worker.js +1 -1
- package/public/styles.css +51 -7
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/interaction-continuity.spec.mjs +9 -3
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/control-visibility-static.test.mjs +3 -3
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/events-tree-context-menu-static.test.mjs +3 -3
- 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/guided-git-activation-static.test.mjs +3 -3
- package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
- package/tests/guided-git-publication-backend-static.test.mjs +10 -5
- package/tests/http-endpoints-harness.test.mjs +5 -9
- package/tests/intercom-conversation-viewer-static.test.mjs +3 -3
- package/tests/main-output-loading-static.test.mjs +18 -12
- 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 +8 -5
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-prompt-impact-static.test.mjs +67 -0
- package/tests/persistent-ui-layout-static.test.mjs +3 -3
- package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/streaming-ui-coupling.test.mjs +2 -0
- 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/windows-drive-cwd-picker-static.test.mjs +3 -3
package/DEVELOPMENT.md
CHANGED
|
@@ -51,7 +51,9 @@ node tests/http-endpoints-harness.test.mjs
|
|
|
51
51
|
|
|
52
52
|
Every `refreshMessages(tabContext)` call acquires its own object token in `mainOutputLoadingRequests` before requesting a transcript snapshot or delta and releases that exact token in `finally`. Visibility is derived only from tokens whose copied tab context still matches the active tab generation. This prevents an old tab response or one of several overlapping refreshes from hiding the current request’s status.
|
|
53
53
|
|
|
54
|
-
The transcript receives `aria-busy` immediately. The inline `#mainOutputLoading` status waits 120 ms before becoming visible, avoiding flashes on fast local responses while preserving polite assistive-technology state. It is
|
|
54
|
+
The transcript receives `aria-busy` immediately. The inline `#mainOutputLoading` status waits 120 ms before becoming visible, avoiding flashes on fast local responses while preserving polite assistive-technology state. It shares `.footer-status-host` with `#statusBar` and is positioned absolutely above the footer, so showing it does not resize the transcript. The newest active request supplies the visible label and updates it as the request checks for a delta, falls back to a complete transcript, and renders the result.
|
|
55
|
+
|
|
56
|
+
The status remains non-modal and pointer-transparent. Cached transcript content and controls remain interactive while the overlay is visible. The global reduced-motion policy reduces its spinner to one effectively static iteration. Dedicated subagent output hides this main-transcript status.
|
|
55
57
|
|
|
56
58
|
Focused contributor validation:
|
|
57
59
|
|
|
@@ -60,7 +62,7 @@ node --check public/app.js
|
|
|
60
62
|
node tests/main-output-loading-static.test.mjs
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
The focused test protects DOM/ARIA semantics, tab-generation and overlap ownership, `try`/`finally` cleanup, non-modal styling, reduced motion, Sidebar
|
|
65
|
+
The focused test protects DOM/ARIA semantics, plain-language stage labels, tab-generation and overlap ownership, `try`/`finally` cleanup, non-modal styling, reduced motion, placement above the footer in standard and Sidebar layouts, dedicated-subagent hiding, documentation, and browser/PWA cache revisions.
|
|
64
66
|
|
|
65
67
|
## Fenced code syntax highlighting
|
|
66
68
|
|
|
@@ -676,6 +678,7 @@ Session-specific tool and skill choices are independent and always win when thei
|
|
|
676
678
|
|
|
677
679
|
- **What it is:** A Pi package manager for Web UI-aware extensions, prompts, themes, and optional dashboards. Optional companions are separate from the Web UI core install.
|
|
678
680
|
- **What you can do:** See whether each companion is enabled, disabled, registered, local, migratable, missing, conflicting, or updateable; use separate **Enable/Disable** and **Setup** actions for configurable loaded companions; open browser-native Skills Setup and Tools Setup from the loaded TUI command companion rows; keep per-row Install/Update actions; restore previous companions through one combined confirmation; use panel-level **Install all** or section-level **Install missing** for missing/unregistered packages only; and recover partial failures with **Retry failed** or **Copy commands**. Native questionnaires read and update the active session's real `questionnaire` tool state through direct **Enable/Disable** controls and do not expose a separate setup action. Batches run sequentially through Pi, continue after individual failures, and auto-restart an idle affected tab while deferring **Restart tab** when it is busy.
|
|
681
|
+
- **Prompt-impact metadata:** The checked baseline is `reports/pi-default-system-prompt-evaluation.md` at the repository root. `OPTIONAL_FEATURES[].promptImpact` stores the browser indicator class. Package-level bundled skill declarations count as initial prompt text; tool schemas and ordinary user or tool messages stay outside this indicator.
|
|
679
682
|
|
|
680
683
|
### `/btw` side questions
|
|
681
684
|
|
|
@@ -792,6 +795,8 @@ For an existing repository, the workflow can:
|
|
|
792
795
|
5. Use the preferred generated short/long message, a generated single-file default such as `updated file.txt`, or a manual **Commit input** message.
|
|
793
796
|
6. Show an optional pre-commit verification reminder, then require explicit confirmation before push and PR delivery actions.
|
|
794
797
|
|
|
798
|
+
A push with no configured remote returns the validated Git root directory name to the browser. Publication asks only for `public` or `private` visibility and a final confirmation. The server ignores client-supplied repository names, derives the name again from the Git root, and runs `gh repo create <directory-name> --public|--private --source=. --remote=origin --push` from that root. The child process inherits the Web UI server's Git and GitHub CLI environment and configuration. Existing remotes still block this recovery path.
|
|
799
|
+
|
|
795
800
|
The saved setup includes:
|
|
796
801
|
|
|
797
802
|
- one required primary generation profile reused for commit messages, branch names, and PR descriptions, plus an optional different fallback profile with its own effort;
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Check the server at any time with:
|
|
|
65
65
|
5. Open the Control Deck for sessions, Git, app runners, themes, updates, and optional features. Under **Controls → Interface**, choose **Top bar** or **Sidebar** for terminal tabs, then choose **Right**, **Left**, or **Both** for the Control Deck. In **Sidebar**, **Both** is unavailable; choosing **Right** or **Left** swaps the Control Deck and terminal/tabs rails across the chat.
|
|
66
66
|
6. On desktop, drag the workspace-facing edge of any visible Control Deck—or the terminal/tabs rail in **Sidebar**—to choose a comfortable width. In **Both**, resize the left and right Control Decks independently; widths return on your next visit.
|
|
67
67
|
|
|
68
|
-
When session history is
|
|
68
|
+
When session history is loading, a small status overlay floats directly above the Git footer without resizing the transcript. It names the current step, such as **Checking for new messages…**, **Loading conversation history…**, or **Preparing your conversation…**. Existing transcript content and controls remain available; no popup interrupts your work.
|
|
69
69
|
|
|
70
70
|
Open **Events** to see bounded tool activity details such as status, duration, a safe target when available, and a shortened call ID. Use **Show** to isolate errors and failures, warnings, tool activity, or rows with **Tree…** available; **All events** restores the full browser-held history. Select a row to jump to its chat card. Right-click any row, or use its keyboard context-menu shortcut, to switch between **Detailed** and **Compact** display. Compact keeps the timestamp and summary while hiding secondary metadata; tool rows retain a colored lifecycle accent. Eligible tool rows also offer **Tree…** to confirm navigation to that exact point in the session; use `/tree` to navigate back. Repeated successful subagent Auto-Clear activity stays in one row whose finished-run count increases.
|
|
71
71
|
|
|
@@ -190,7 +190,9 @@ Launch detected development servers, tests, builds, scripts, and project-defined
|
|
|
190
190
|
|
|
191
191
|
Run `/git-guided-workflow` in the browser composer or use the **Guided Git workflow** button. The extension starts the workflow in the originating tab without sending a repository path, diff, or Git data in its activation request. Browser generation requires the extension-owned RPC commands and does not fall back to same-named prompt templates.
|
|
192
192
|
|
|
193
|
-
Move through review, staging, commit-message generation, commit, push, and pull-request steps with explicit confirmations.
|
|
193
|
+
Move through review, staging, commit-message generation, commit, push, and pull-request steps with explicit confirmations. If a repository has no remote, choose **Public** or **Private** from the visibility dropdown and confirm publication. Guided Git uses the local Git root directory name, runs the authenticated system `gh` command, adds `origin`, and pushes the current branch.
|
|
194
|
+
|
|
195
|
+
In **Guided Git Setup**, you can optionally choose a fallback model and its own reasoning effort. If the primary model reaches a final generation failure, Guided Git tries the fallback once, reports the change in the workflow, and restores the tab’s prior model and effort afterward. Large staged diffs use multiple model requests; a fallback attempt sends the complete staged evidence again to the configured fallback provider and can nearly double the request count and cost. Validation failures, cancellation, Git command failures, and a stopped Pi process do not trigger fallback.
|
|
194
196
|
|
|
195
197
|
#### Git branch picker
|
|
196
198
|
|
|
@@ -216,7 +218,7 @@ Inspect staged, unstaged, untracked, and incoming changes before asking Pi to co
|
|
|
216
218
|
|
|
217
219
|
**Optional feature needed:** None — the package manager panel is included in Pi Web UI core; each listed companion is installed separately.
|
|
218
220
|
|
|
219
|
-
Install, update, enable, disable, or configure supported companion packages from one panel.
|
|
221
|
+
Install, update, enable, disable, or configure supported companion packages from one panel. Each row shows its system-prompt impact: `+` adds to the initial system prompt, `+...` can add system-prompt text while the session is running, and `-` means no measured system-prompt text.
|
|
220
222
|
|
|
221
223
|
#### `/btw` side questions
|
|
222
224
|
|
package/TECHNICAL.md
CHANGED
|
@@ -117,6 +117,8 @@ Text and image reads remain scoped to the active tab's working directory and its
|
|
|
117
117
|
|
|
118
118
|
Every server start performs a bounded, read-only startup audit of optional companion packages. Missing, unregistered, or older companions appear in the Optional features panel without blocking the core Web UI. The Guided Git entry installs `@firstpick/pi-extension-git-guided-workflow`, which registers the launcher and native commit-message, branch-name, and pull-request generation commands as one Pi package.
|
|
119
119
|
|
|
120
|
+
Prompt-impact indicators distinguish initial system-prompt text (`+`), conditional text that can appear while a session is running (`+...`), and packages with no measured system-prompt text (`-`). Bundled skill declarations count toward the package indicator. Tool schemas and ordinary user or tool messages are not counted.
|
|
121
|
+
|
|
120
122
|
- **Migrate…** reviews and installs selected legacy companions.
|
|
121
123
|
- **Later** dismisses the startup reminder while leaving migration available in settings.
|
|
122
124
|
- **Retry failed** retries only failed package installs.
|
|
@@ -321,6 +323,8 @@ Install `@firstpick/pi-extension-git-guided-workflow` to make `/git-guided-workf
|
|
|
321
323
|
|
|
322
324
|
Browser generation accepts only RPC-capable extension provenance for `/git-staged-msg`, `/git-branch-name`, and `/pr`. A separately installed same-named prompt template is not a fallback for the native path.
|
|
323
325
|
|
|
326
|
+
Publishing a repository with no remote requires GitHub CLI (`gh`) to be installed and authenticated. Guided Git derives the GitHub repository name from the local Git root directory, asks you to choose **Public** or **Private** from a dropdown, then shows a final confirmation before it creates the repository, adds `origin`, and pushes. No visibility is preselected. The command uses your system Git and GitHub CLI configuration.
|
|
327
|
+
|
|
324
328
|
The launcher refuses immediately while the originating tab is running, compacting context, or has pending messages; it does not queue Guided Git for later. If the command does not open the workflow, confirm that the tab is idle, has no queued messages, and lists `/git-guided-workflow`, `/git-staged-msg`, `/git-branch-name`, and `/pr` as extension commands. Restart or reload the Pi tab after installing or updating the extension. Retrying after an uncertain activation is a manual decision; WebUI does not retry it automatically.
|
|
325
329
|
|
|
326
330
|
## Guided Git generation profiles
|
package/bin/pi-webui.mjs
CHANGED
|
@@ -8736,7 +8736,7 @@ function applyGitHubPublicationFailure(payload) {
|
|
|
8736
8736
|
payload.code = "AUTH";
|
|
8737
8737
|
payload.hint = "GitHub CLI is not authenticated. Run 'gh auth login' in a terminal, then retry.";
|
|
8738
8738
|
} else if (/name already exists on this account|repository .+ already exists/.test(text)) {
|
|
8739
|
-
payload.hint = "A GitHub repository with this name already exists for the authenticated account.
|
|
8739
|
+
payload.hint = "A GitHub repository with this directory name already exists for the authenticated account. Add that repository as a remote, or rename the local directory before retrying.";
|
|
8740
8740
|
}
|
|
8741
8741
|
return payload;
|
|
8742
8742
|
}
|
|
@@ -8887,21 +8887,22 @@ async function handleGitWorkflowRequest(pathname, body = {}, tabOrCwd = options.
|
|
|
8887
8887
|
payload.data.protectedBranch = protectedBranch;
|
|
8888
8888
|
payload.data.forceWithLease = forceWithLease;
|
|
8889
8889
|
if (remote) payload.data.remote = remote;
|
|
8890
|
+
else payload.data.repoName = path.basename(root);
|
|
8890
8891
|
}
|
|
8891
8892
|
return applyGitSyncFailure(payload, { push: true });
|
|
8892
8893
|
}
|
|
8893
8894
|
case "/api/git-workflow/publish": {
|
|
8894
|
-
const
|
|
8895
|
+
const root = await getGitRoot(cwd);
|
|
8896
|
+
const repoName = cleanGitHubRepoName(path.basename(root));
|
|
8895
8897
|
const visibility = String(body.visibility || "").trim();
|
|
8896
8898
|
if (visibility !== "public" && visibility !== "private") throw makeHttpError(400, "visibility must be 'public' or 'private'");
|
|
8897
8899
|
requireConfirmed(body, `Publishing GitHub repository ${repoName} as ${visibility}`);
|
|
8898
|
-
const root = await getGitRoot(cwd);
|
|
8899
8900
|
const remotes = await gitRemoteNames(root);
|
|
8900
8901
|
if (remotes.length) throw makeHttpError(409, "GitHub publication requires a repository with no configured remotes. Existing remotes are not changed or repaired.");
|
|
8901
8902
|
const branch = await currentGitBranch(root);
|
|
8902
8903
|
const protectedBranch = PROTECTED_GIT_BRANCHES.has(branch);
|
|
8903
8904
|
const payload = applyGitHubPublicationFailure(gitWorkflowCommandPayload(await runGitHubWorkflowCommand(
|
|
8904
|
-
["repo", "create", repoName, `--${visibility}`, "--source",
|
|
8905
|
+
["repo", "create", repoName, `--${visibility}`, "--source", ".", "--remote", "origin", "--push"],
|
|
8905
8906
|
{ cwd: root, timeoutMs: 15 * 60 * 1000 },
|
|
8906
8907
|
)));
|
|
8907
8908
|
if (payload.ok) Object.assign(payload.data, { repoName, visibility, remote: "origin", branch, protectedBranch });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firstpick/pi-package-webui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Pi Web UI companion package with a local browser UI CLI plus /webui-start and /webui-status commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Firstp1ck/pi-coding-agent-forge/tree/main/pi-package-webui#readme",
|
package/public/app.js
CHANGED
|
@@ -101,6 +101,7 @@ const elements = {
|
|
|
101
101
|
stickyUserPromptButton: $("#stickyUserPromptButton"),
|
|
102
102
|
chat: $("#chat"),
|
|
103
103
|
mainOutputLoading: $("#mainOutputLoading"),
|
|
104
|
+
mainOutputLoadingLabel: $("#mainOutputLoadingLabel"),
|
|
104
105
|
runIndicatorHost: $("#runIndicatorHost"),
|
|
105
106
|
chatSearchBar: $("#chatSearchBar"),
|
|
106
107
|
chatSearchInput: $("#chatSearchInput"),
|
|
@@ -477,6 +478,7 @@ const elements = {
|
|
|
477
478
|
textPromptTitle: $("#textPromptTitle"),
|
|
478
479
|
textPromptSummary: $("#textPromptSummary"),
|
|
479
480
|
textPromptInput: $("#textPromptInput"),
|
|
481
|
+
textPromptSelect: $("#textPromptSelect"),
|
|
480
482
|
textPromptError: $("#textPromptError"),
|
|
481
483
|
textPromptCancelButton: $("#textPromptCancelButton"),
|
|
482
484
|
textPromptConfirmButton: $("#textPromptConfirmButton"),
|
|
@@ -2804,6 +2806,7 @@ const APP_RUNNER_SEARCH_PATH_LIMIT = 24;
|
|
|
2804
2806
|
const OPTIONAL_FEATURES = [
|
|
2805
2807
|
{
|
|
2806
2808
|
id: "bangCommandAutocomplete",
|
|
2809
|
+
promptImpact: "none",
|
|
2807
2810
|
label: "! command autocomplete",
|
|
2808
2811
|
packageName: "@firstpick/pi-extension-bang-command-autocomplete",
|
|
2809
2812
|
capabilityLabel: "/bang-status or /bang-refresh",
|
|
@@ -2811,6 +2814,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2811
2814
|
},
|
|
2812
2815
|
{
|
|
2813
2816
|
id: "fishUserBash",
|
|
2817
|
+
promptImpact: "none",
|
|
2814
2818
|
label: "Fish user bash",
|
|
2815
2819
|
packageName: "@firstpick/pi-extension-fish-user-bash",
|
|
2816
2820
|
capabilityLabel: "/user-bash-shell",
|
|
@@ -2818,6 +2822,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2818
2822
|
},
|
|
2819
2823
|
{
|
|
2820
2824
|
id: "btwCommand",
|
|
2825
|
+
promptImpact: "none",
|
|
2821
2826
|
label: "/btw side questions",
|
|
2822
2827
|
packageName: "@firstpick/pi-extension-btw",
|
|
2823
2828
|
capabilityLabel: "/btw or btw:output widget event",
|
|
@@ -2825,6 +2830,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2825
2830
|
},
|
|
2826
2831
|
{
|
|
2827
2832
|
id: "gitWorkflow",
|
|
2833
|
+
promptImpact: "none",
|
|
2828
2834
|
label: "Guided Git workflow",
|
|
2829
2835
|
packageName: "@firstpick/pi-extension-git-guided-workflow",
|
|
2830
2836
|
capabilityLabel: "/git-guided-workflow",
|
|
@@ -2833,6 +2839,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2833
2839
|
},
|
|
2834
2840
|
{
|
|
2835
2841
|
id: "releaseNpm",
|
|
2842
|
+
promptImpact: "none",
|
|
2836
2843
|
label: "NPM Release",
|
|
2837
2844
|
packageName: "@firstpick/pi-extension-release-npm",
|
|
2838
2845
|
capabilityLabel: "/release-npm",
|
|
@@ -2840,6 +2847,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2840
2847
|
},
|
|
2841
2848
|
{
|
|
2842
2849
|
id: "releaseAur",
|
|
2850
|
+
promptImpact: "initial",
|
|
2843
2851
|
label: "AUR Release",
|
|
2844
2852
|
packageName: "@firstpick/pi-extension-release-aur",
|
|
2845
2853
|
capabilityLabel: "/release-aur",
|
|
@@ -2847,6 +2855,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2847
2855
|
},
|
|
2848
2856
|
{
|
|
2849
2857
|
id: "aurReview",
|
|
2858
|
+
promptImpact: "none",
|
|
2850
2859
|
label: "Manual repository review",
|
|
2851
2860
|
packageName: "@firstpick/pi-extension-aur-review",
|
|
2852
2861
|
capabilityLabel: "/aur-review or aur-review:rpc widget event",
|
|
@@ -2854,6 +2863,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2854
2863
|
},
|
|
2855
2864
|
{
|
|
2856
2865
|
id: "workflows",
|
|
2866
|
+
promptImpact: "initial",
|
|
2857
2867
|
label: "Workflows",
|
|
2858
2868
|
packageName: "@firstpick/pi-extension-workflows",
|
|
2859
2869
|
capabilityLabel: "/workflow or workflow subprocess widget event",
|
|
@@ -2862,6 +2872,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2862
2872
|
},
|
|
2863
2873
|
{
|
|
2864
2874
|
id: "featureSystemPrompt",
|
|
2875
|
+
promptImpact: "conditional",
|
|
2865
2876
|
label: "Feature workflow routing",
|
|
2866
2877
|
packageName: "@firstpick/pi-extension-feature-system-prompt",
|
|
2867
2878
|
capabilityLabel: "feature-category or feature-decision-output status event",
|
|
@@ -2869,6 +2880,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2869
2880
|
},
|
|
2870
2881
|
{
|
|
2871
2882
|
id: "safetyGuard",
|
|
2883
|
+
promptImpact: "none",
|
|
2872
2884
|
label: "Safety guard",
|
|
2873
2885
|
packageName: "@firstpick/pi-extension-safety-guard",
|
|
2874
2886
|
capabilityLabel: "/safety-guard or /safety-guard-setup command",
|
|
@@ -2877,6 +2889,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2877
2889
|
},
|
|
2878
2890
|
{
|
|
2879
2891
|
id: "tuiSkillsCommand",
|
|
2892
|
+
promptImpact: "none",
|
|
2880
2893
|
label: "TUI Skills command",
|
|
2881
2894
|
packageName: "@firstpick/pi-extension-setup-skills",
|
|
2882
2895
|
capabilityLabel: "RPC /skills from setup-skills extension",
|
|
@@ -2885,6 +2898,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2885
2898
|
},
|
|
2886
2899
|
{
|
|
2887
2900
|
id: "todoProgressWidget",
|
|
2901
|
+
promptImpact: "initial",
|
|
2888
2902
|
label: "Todo progress widget",
|
|
2889
2903
|
packageName: "@firstpick/pi-extension-todo-progress",
|
|
2890
2904
|
capabilityLabel: "/todo-progress-status or todo-progress widget event",
|
|
@@ -2892,6 +2906,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2892
2906
|
},
|
|
2893
2907
|
{
|
|
2894
2908
|
id: "tuiToolsCommand",
|
|
2909
|
+
promptImpact: "none",
|
|
2895
2910
|
label: "TUI Tools command",
|
|
2896
2911
|
packageName: "@firstpick/pi-extension-tools",
|
|
2897
2912
|
capabilityLabel: "RPC /tools from tools extension",
|
|
@@ -2900,6 +2915,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2900
2915
|
},
|
|
2901
2916
|
{
|
|
2902
2917
|
id: "remoteWebui",
|
|
2918
|
+
promptImpact: "none",
|
|
2903
2919
|
label: "Remote WebUI",
|
|
2904
2920
|
packageName: "@firstpick/pi-package-remote-webui",
|
|
2905
2921
|
capabilityLabel: "/remote",
|
|
@@ -2907,6 +2923,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2907
2923
|
},
|
|
2908
2924
|
{
|
|
2909
2925
|
id: "questionnaire",
|
|
2926
|
+
promptImpact: "initial",
|
|
2910
2927
|
label: "Native questionnaires",
|
|
2911
2928
|
packageName: "@firstpick/pi-package-questionnaire",
|
|
2912
2929
|
capabilityLabel: "questionnaire tool in /tools",
|
|
@@ -2915,6 +2932,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2915
2932
|
},
|
|
2916
2933
|
{
|
|
2917
2934
|
id: "naturalConversation",
|
|
2935
|
+
promptImpact: "conditional",
|
|
2918
2936
|
label: "Natural Conversation",
|
|
2919
2937
|
packageName: "@firstpick/pi-package-natural-conversation",
|
|
2920
2938
|
capabilityLabel: "/talk, /voice, or /conversation",
|
|
@@ -2922,6 +2940,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2922
2940
|
},
|
|
2923
2941
|
{
|
|
2924
2942
|
id: "gitFooterStatus",
|
|
2943
|
+
promptImpact: "none",
|
|
2925
2944
|
label: "Git footer status",
|
|
2926
2945
|
packageName: "@firstpick/pi-extension-git-footer-status",
|
|
2927
2946
|
capabilityLabel: "/git-footer-refresh or git-footer-webui status event",
|
|
@@ -2929,6 +2948,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2929
2948
|
},
|
|
2930
2949
|
{
|
|
2931
2950
|
id: "statsCommand",
|
|
2951
|
+
promptImpact: "none",
|
|
2932
2952
|
label: "Stats dashboard",
|
|
2933
2953
|
packageName: "@firstpick/pi-extension-stats",
|
|
2934
2954
|
capabilityLabel: "/stats",
|
|
@@ -2936,6 +2956,7 @@ const OPTIONAL_FEATURES = [
|
|
|
2936
2956
|
},
|
|
2937
2957
|
{
|
|
2938
2958
|
id: "codexFastMode",
|
|
2959
|
+
promptImpact: "none",
|
|
2939
2960
|
label: "Codex Fast mode",
|
|
2940
2961
|
packageName: "@firstpick/pi-extension-codex-fast-mode",
|
|
2941
2962
|
capabilityLabel: "/fast-mode",
|
|
@@ -2943,12 +2964,18 @@ const OPTIONAL_FEATURES = [
|
|
|
2943
2964
|
},
|
|
2944
2965
|
{
|
|
2945
2966
|
id: "themeBundle",
|
|
2967
|
+
promptImpact: "none",
|
|
2946
2968
|
label: "Theme bundle",
|
|
2947
2969
|
packageName: "@firstpick/pi-themes-bundle",
|
|
2948
2970
|
capabilityLabel: "/api/themes returned themes",
|
|
2949
2971
|
description: "Additional browser theme-picker and Pi theme resources.",
|
|
2950
2972
|
},
|
|
2951
2973
|
];
|
|
2974
|
+
const OPTIONAL_FEATURE_PROMPT_IMPACTS = Object.freeze({
|
|
2975
|
+
initial: Object.freeze({ symbol: "+", label: "Adds to the initial system prompt" }),
|
|
2976
|
+
conditional: Object.freeze({ symbol: "+...", label: "Can add system-prompt text while the session is running" }),
|
|
2977
|
+
none: Object.freeze({ symbol: "-", label: "No additional system-prompt text measured" }),
|
|
2978
|
+
});
|
|
2952
2979
|
const OPTIONAL_FEATURE_BY_ID = new Map(OPTIONAL_FEATURES.map((feature) => [feature.id, feature]));
|
|
2953
2980
|
// Optional features that arm a paid or stateful runtime mode must turn it off before the browser
|
|
2954
2981
|
// stops managing them, so a stale mode can never keep spending credits after a Disable click.
|
|
@@ -7969,9 +7996,10 @@ function confirmDiscardEdits({ what = "unsaved edits", target = "" } = {}) {
|
|
|
7969
7996
|
});
|
|
7970
7997
|
}
|
|
7971
7998
|
|
|
7972
|
-
// Application
|
|
7973
|
-
// or null when cancelled.
|
|
7999
|
+
// Application value prompt (replaces blocking window.prompt): resolves with the entered value,
|
|
8000
|
+
// or null when cancelled. Text prompts may validate and keep the dialog open.
|
|
7974
8001
|
let activeTextPromptResolve = null;
|
|
8002
|
+
let textPromptMode = "text";
|
|
7975
8003
|
|
|
7976
8004
|
function appPromptText({ title = "Enter a value", summary = "", defaultValue = "", placeholder = "", confirmLabel = "OK", validate = null, selectRange = null } = {}) {
|
|
7977
8005
|
const dialog = elements.textPromptDialog;
|
|
@@ -7980,11 +8008,14 @@ function appPromptText({ title = "Enter a value", summary = "", defaultValue = "
|
|
|
7980
8008
|
return Promise.resolve(value === null ? null : String(value));
|
|
7981
8009
|
}
|
|
7982
8010
|
if (activeTextPromptResolve) finishTextPrompt(null);
|
|
8011
|
+
textPromptMode = "text";
|
|
7983
8012
|
elements.textPromptTitle.textContent = title;
|
|
7984
8013
|
elements.textPromptSummary.textContent = summary;
|
|
7985
8014
|
elements.textPromptSummary.hidden = !summary;
|
|
8015
|
+
elements.textPromptInput.hidden = false;
|
|
7986
8016
|
elements.textPromptInput.value = defaultValue;
|
|
7987
8017
|
elements.textPromptInput.placeholder = placeholder;
|
|
8018
|
+
if (elements.textPromptSelect) elements.textPromptSelect.hidden = true;
|
|
7988
8019
|
elements.textPromptError.hidden = true;
|
|
7989
8020
|
elements.textPromptError.textContent = "";
|
|
7990
8021
|
elements.textPromptConfirmButton.textContent = confirmLabel;
|
|
@@ -8002,6 +8033,51 @@ function appPromptText({ title = "Enter a value", summary = "", defaultValue = "
|
|
|
8002
8033
|
});
|
|
8003
8034
|
}
|
|
8004
8035
|
|
|
8036
|
+
function appPromptSelect({ title = "Choose an option", summary = "", options = [], placeholder = "Choose…", confirmLabel = "Continue" } = {}) {
|
|
8037
|
+
const normalizedOptions = options
|
|
8038
|
+
.map((option) => ({ value: String(option?.value ?? ""), label: String(option?.label ?? option?.value ?? "") }))
|
|
8039
|
+
.filter((option) => option.value && option.label);
|
|
8040
|
+
const dialog = elements.textPromptDialog;
|
|
8041
|
+
if (!dialog?.showModal || !elements.textPromptSelect) {
|
|
8042
|
+
const lines = normalizedOptions.map((option, index) => `${index + 1}. ${option.label}`);
|
|
8043
|
+
const choice = window.prompt([title, summary, ...lines].filter(Boolean).join("\n"), "");
|
|
8044
|
+
if (choice === null) return Promise.resolve(null);
|
|
8045
|
+
const selected = normalizedOptions[Number.parseInt(String(choice), 10) - 1];
|
|
8046
|
+
return Promise.resolve(selected?.value || null);
|
|
8047
|
+
}
|
|
8048
|
+
if (activeTextPromptResolve) finishTextPrompt(null);
|
|
8049
|
+
textPromptMode = "select";
|
|
8050
|
+
elements.textPromptTitle.textContent = title;
|
|
8051
|
+
elements.textPromptSummary.textContent = summary;
|
|
8052
|
+
elements.textPromptSummary.hidden = !summary;
|
|
8053
|
+
elements.textPromptInput.hidden = true;
|
|
8054
|
+
const select = elements.textPromptSelect;
|
|
8055
|
+
select.hidden = false;
|
|
8056
|
+
select.replaceChildren();
|
|
8057
|
+
const placeholderOption = document.createElement("option");
|
|
8058
|
+
placeholderOption.value = "";
|
|
8059
|
+
placeholderOption.textContent = placeholder;
|
|
8060
|
+
placeholderOption.disabled = true;
|
|
8061
|
+
placeholderOption.selected = true;
|
|
8062
|
+
select.append(placeholderOption);
|
|
8063
|
+
for (const option of normalizedOptions) {
|
|
8064
|
+
const element = document.createElement("option");
|
|
8065
|
+
element.value = option.value;
|
|
8066
|
+
element.textContent = option.label;
|
|
8067
|
+
select.append(element);
|
|
8068
|
+
}
|
|
8069
|
+
select.value = "";
|
|
8070
|
+
elements.textPromptError.hidden = true;
|
|
8071
|
+
elements.textPromptError.textContent = "";
|
|
8072
|
+
elements.textPromptConfirmButton.textContent = confirmLabel;
|
|
8073
|
+
textPromptValidator = (value) => value ? "" : "Choose an option.";
|
|
8074
|
+
return new Promise((resolve) => {
|
|
8075
|
+
activeTextPromptResolve = resolve;
|
|
8076
|
+
dialog.showModal();
|
|
8077
|
+
queueMicrotask(() => select.focus());
|
|
8078
|
+
});
|
|
8079
|
+
}
|
|
8080
|
+
|
|
8005
8081
|
let textPromptValidator = null;
|
|
8006
8082
|
|
|
8007
8083
|
function finishTextPrompt(value) {
|
|
@@ -8013,12 +8089,13 @@ function finishTextPrompt(value) {
|
|
|
8013
8089
|
}
|
|
8014
8090
|
|
|
8015
8091
|
function submitTextPrompt() {
|
|
8016
|
-
const
|
|
8092
|
+
const control = textPromptMode === "select" ? elements.textPromptSelect : elements.textPromptInput;
|
|
8093
|
+
const value = String(control?.value ?? "");
|
|
8017
8094
|
const problem = textPromptValidator ? textPromptValidator(value) : "";
|
|
8018
8095
|
if (problem) {
|
|
8019
8096
|
elements.textPromptError.textContent = String(problem);
|
|
8020
8097
|
elements.textPromptError.hidden = false;
|
|
8021
|
-
|
|
8098
|
+
control?.focus();
|
|
8022
8099
|
return;
|
|
8023
8100
|
}
|
|
8024
8101
|
finishTextPrompt(value);
|
|
@@ -25116,6 +25193,10 @@ function reconcileGitWorkflowContinuation(workflowTabId = activeTabId) {
|
|
|
25116
25193
|
loadGitWorkflowBranchName({ requireFresh: true, retries: 3, runId: workflow.runId, tabId: workflowTabId });
|
|
25117
25194
|
} else if (workflow.step === "prGenerating") {
|
|
25118
25195
|
loadGitWorkflowPr({ requireFresh: true, retries: 3, runId: workflow.runId, tabId: workflowTabId });
|
|
25196
|
+
} else if (workflow.step === "readmeGenerating") {
|
|
25197
|
+
prepareGitInitFiles({ afterReadmePrompt: true, runId: workflow.runId, tabId: workflowTabId });
|
|
25198
|
+
} else if (workflow.step === "gitignoreGenerating") {
|
|
25199
|
+
prepareGitInitFiles({ afterGitignorePrompt: true, runId: workflow.runId, tabId: workflowTabId });
|
|
25119
25200
|
}
|
|
25120
25201
|
}
|
|
25121
25202
|
|
|
@@ -34704,20 +34785,22 @@ async function commitGitWorkflow(variant, tabId = gitWorkflowActionTabId()) {
|
|
|
34704
34785
|
function cleanGitPublishVisibilityInput(value) {
|
|
34705
34786
|
const visibility = String(value ?? "").trim().toLowerCase();
|
|
34706
34787
|
if (visibility !== "public" && visibility !== "private") {
|
|
34707
|
-
throw new Error("Repository visibility must be
|
|
34788
|
+
throw new Error("Repository visibility must be selected as 'public' or 'private'; nothing was published.");
|
|
34708
34789
|
}
|
|
34709
34790
|
return visibility;
|
|
34710
34791
|
}
|
|
34711
34792
|
|
|
34712
|
-
function
|
|
34713
|
-
const
|
|
34714
|
-
|
|
34715
|
-
|
|
34716
|
-
|
|
34717
|
-
}
|
|
34718
|
-
|
|
34719
|
-
|
|
34720
|
-
|
|
34793
|
+
async function promptGitPublishVisibility(repoName) {
|
|
34794
|
+
const value = await appPromptSelect({
|
|
34795
|
+
title: "Choose repository visibility",
|
|
34796
|
+
summary: `GitHub repository: ${repoName}`,
|
|
34797
|
+
options: [
|
|
34798
|
+
{ value: "public", label: "Public" },
|
|
34799
|
+
{ value: "private", label: "Private" },
|
|
34800
|
+
],
|
|
34801
|
+
placeholder: "Choose visibility…",
|
|
34802
|
+
confirmLabel: "Continue",
|
|
34803
|
+
});
|
|
34721
34804
|
if (value === null) return null;
|
|
34722
34805
|
return cleanGitPublishVisibilityInput(value);
|
|
34723
34806
|
}
|
|
@@ -34728,19 +34811,18 @@ async function publishGitWorkflowRepository(tabId, failure) {
|
|
|
34728
34811
|
if (!workflow) return false;
|
|
34729
34812
|
const runId = workflow.runId;
|
|
34730
34813
|
const branch = failure?.data?.branch || gitFooterCurrentBranch() || "the current branch";
|
|
34814
|
+
const targetTab = tabs.find((tab) => tab.id === tabId) || activeTab();
|
|
34815
|
+
const repoName = cleanGitHubRepoNameInput(failure?.data?.repoName || defaultGitInitRepoName(targetTab));
|
|
34731
34816
|
const publishRequested = await appConfirmText([
|
|
34732
34817
|
failure?.message || "git push found no configured push destination.",
|
|
34733
34818
|
"",
|
|
34734
|
-
|
|
34735
|
-
"Nothing is created until you choose
|
|
34736
|
-
].join("\n"), { affected: "A new GitHub repository and the origin remote", confirmLabel: "Choose
|
|
34819
|
+
`Publish this repository to GitHub as ${repoName} with the authenticated GitHub CLI (gh) account?`,
|
|
34820
|
+
"The repository name comes from the local Git root directory. Nothing is created until you choose visibility explicitly and confirm the final summary.",
|
|
34821
|
+
].join("\n"), { affected: "A new GitHub repository and the origin remote", confirmLabel: "Choose visibility", danger: false });
|
|
34737
34822
|
if (!publishRequested) return false;
|
|
34738
|
-
let repoName;
|
|
34739
34823
|
let visibility;
|
|
34740
34824
|
try {
|
|
34741
|
-
|
|
34742
|
-
if (!repoName) return false;
|
|
34743
|
-
visibility = promptGitPublishVisibility(repoName);
|
|
34825
|
+
visibility = await promptGitPublishVisibility(repoName);
|
|
34744
34826
|
if (!visibility) return false;
|
|
34745
34827
|
} catch (error) {
|
|
34746
34828
|
addEvent(error.message || String(error), "error");
|
|
@@ -34758,7 +34840,7 @@ async function publishGitWorkflowRepository(tabId, failure) {
|
|
|
34758
34840
|
].join("\n"), { affected: `New ${visibility} GitHub repository ${repoName}`, confirmLabel: "Publish repository" });
|
|
34759
34841
|
if (!confirmed) return false;
|
|
34760
34842
|
setGitWorkflow({ step: "pushing", busy: true, error: "", output: `Creating ${visibility} GitHub repository ${repoName} and pushing ${branch}…` }, { tabId });
|
|
34761
|
-
const result = await gitWorkflowRequest("/api/git-workflow/publish", { body: {
|
|
34843
|
+
const result = await gitWorkflowRequest("/api/git-workflow/publish", { body: { visibility, confirmed: true }, runId, tabId });
|
|
34762
34844
|
if (!result) return true;
|
|
34763
34845
|
setGitWorkflow({
|
|
34764
34846
|
step: "done",
|
|
@@ -41519,6 +41601,18 @@ function optionalFeatureWidgetHasSpecializedRenderer(key) {
|
|
|
41519
41601
|
return key.startsWith("btw:") || key.startsWith("release-npm:") || key.startsWith("release-aur:") || key === AUR_REVIEW_RPC_WIDGET_KEY || key === "workflow:subprocess" || key === WORKFLOW_INSPECTOR_WIDGET_KEY;
|
|
41520
41602
|
}
|
|
41521
41603
|
|
|
41604
|
+
function optionalFeaturePromptImpact(feature) {
|
|
41605
|
+
return OPTIONAL_FEATURE_PROMPT_IMPACTS[feature?.promptImpact] || OPTIONAL_FEATURE_PROMPT_IMPACTS.none;
|
|
41606
|
+
}
|
|
41607
|
+
|
|
41608
|
+
function renderOptionalFeaturePromptImpactBadge(feature) {
|
|
41609
|
+
const impact = optionalFeaturePromptImpact(feature);
|
|
41610
|
+
const badge = make("span", `optional-feature-prompt-impact ${feature?.promptImpact || "none"}`, impact.symbol);
|
|
41611
|
+
badge.title = impact.label;
|
|
41612
|
+
badge.setAttribute("aria-label", impact.label);
|
|
41613
|
+
return badge;
|
|
41614
|
+
}
|
|
41615
|
+
|
|
41522
41616
|
function renderOptionalFeatureBatchToolbar() {
|
|
41523
41617
|
const candidates = optionalFeatureBatchCandidates();
|
|
41524
41618
|
const migratable = optionalFeatureMigrationCandidates();
|
|
@@ -41692,7 +41786,8 @@ function renderOptionalFeatureRow(feature) {
|
|
|
41692
41786
|
const packageStatus = optionalFeaturePackageStatus(feature.id);
|
|
41693
41787
|
const status = optionalFeatureStatus(feature.id);
|
|
41694
41788
|
const row = make("div", `optional-feature-row ${status.className}`);
|
|
41695
|
-
const
|
|
41789
|
+
const impact = optionalFeaturePromptImpact(feature);
|
|
41790
|
+
const tooltip = `${optionalFeatureTooltip(feature, status)}\nSystem prompt impact: ${impact.label}.`;
|
|
41696
41791
|
row.dataset.tooltip = tooltip;
|
|
41697
41792
|
row.setAttribute("aria-label", tooltip.replace(/\s+/g, " "));
|
|
41698
41793
|
if (installing || accessChanging) row.setAttribute("aria-busy", "true");
|
|
@@ -41700,7 +41795,9 @@ function renderOptionalFeatureRow(feature) {
|
|
|
41700
41795
|
|
|
41701
41796
|
const main = make("div", "optional-feature-main");
|
|
41702
41797
|
const title = make("div", "optional-feature-title");
|
|
41703
|
-
|
|
41798
|
+
const statusTags = make("div", "optional-feature-status-tags");
|
|
41799
|
+
statusTags.append(renderOptionalFeaturePromptImpactBadge(feature), make("span", `optional-feature-pill ${status.className}`, status.label));
|
|
41800
|
+
title.append(make("strong", undefined, feature.label), statusTags);
|
|
41704
41801
|
main.append(title);
|
|
41705
41802
|
if (status.detail) {
|
|
41706
41803
|
const detail = make("div", `optional-feature-detail ${status.className === "failed" ? "error" : ""}`.trim(), status.detail);
|
|
@@ -46182,9 +46279,15 @@ function mainOutputLoadingRequestIsCurrent(request) {
|
|
|
46182
46279
|
return !!request?.tabContext && isCurrentTabContext(request.tabContext);
|
|
46183
46280
|
}
|
|
46184
46281
|
|
|
46282
|
+
function currentMainOutputLoadingRequest() {
|
|
46283
|
+
return [...mainOutputLoadingRequests].filter(mainOutputLoadingRequestIsCurrent).at(-1) || null;
|
|
46284
|
+
}
|
|
46285
|
+
|
|
46185
46286
|
function renderMainOutputLoading({ reveal = false } = {}) {
|
|
46186
|
-
const
|
|
46287
|
+
const request = currentMainOutputLoadingRequest();
|
|
46288
|
+
const active = !!request;
|
|
46187
46289
|
elements.chat?.setAttribute("aria-busy", active ? "true" : "false");
|
|
46290
|
+
if (elements.mainOutputLoadingLabel) elements.mainOutputLoadingLabel.textContent = request?.label || "Loading your conversation…";
|
|
46188
46291
|
clearTimeout(mainOutputLoadingRevealTimer);
|
|
46189
46292
|
mainOutputLoadingRevealTimer = null;
|
|
46190
46293
|
if (!elements.mainOutputLoading) return;
|
|
@@ -46192,23 +46295,29 @@ function renderMainOutputLoading({ reveal = false } = {}) {
|
|
|
46192
46295
|
elements.mainOutputLoading.hidden = true;
|
|
46193
46296
|
return;
|
|
46194
46297
|
}
|
|
46195
|
-
if (reveal) {
|
|
46298
|
+
if (reveal || !elements.mainOutputLoading.hidden) {
|
|
46196
46299
|
elements.mainOutputLoading.hidden = false;
|
|
46197
46300
|
return;
|
|
46198
46301
|
}
|
|
46199
46302
|
mainOutputLoadingRevealTimer = setTimeout(() => {
|
|
46200
46303
|
mainOutputLoadingRevealTimer = null;
|
|
46201
|
-
if (
|
|
46304
|
+
if (currentMainOutputLoadingRequest()) elements.mainOutputLoading.hidden = false;
|
|
46202
46305
|
}, MAIN_OUTPUT_LOADING_REVEAL_DELAY_MS);
|
|
46203
46306
|
}
|
|
46204
46307
|
|
|
46205
|
-
function beginMainOutputLoading(tabContext) {
|
|
46206
|
-
const request = { tabContext: { ...tabContext } };
|
|
46308
|
+
function beginMainOutputLoading(tabContext, label) {
|
|
46309
|
+
const request = { tabContext: { ...tabContext }, label };
|
|
46207
46310
|
mainOutputLoadingRequests.add(request);
|
|
46208
46311
|
renderMainOutputLoading();
|
|
46209
46312
|
return request;
|
|
46210
46313
|
}
|
|
46211
46314
|
|
|
46315
|
+
function updateMainOutputLoading(request, label) {
|
|
46316
|
+
if (!mainOutputLoadingRequests.has(request)) return;
|
|
46317
|
+
request.label = label;
|
|
46318
|
+
if (request === currentMainOutputLoadingRequest() && elements.mainOutputLoadingLabel) elements.mainOutputLoadingLabel.textContent = label;
|
|
46319
|
+
}
|
|
46320
|
+
|
|
46212
46321
|
function finishMainOutputLoading(request) {
|
|
46213
46322
|
mainOutputLoadingRequests.delete(request);
|
|
46214
46323
|
renderMainOutputLoading();
|
|
@@ -46216,12 +46325,13 @@ function finishMainOutputLoading(request) {
|
|
|
46216
46325
|
|
|
46217
46326
|
async function refreshMessages(tabContext = activeTabContext(), { authoritative = false } = {}) {
|
|
46218
46327
|
if (!tabContext.tabId) return;
|
|
46219
|
-
const
|
|
46328
|
+
const previousMessages = latestMessages;
|
|
46329
|
+
const sessionKey = resolveMessagesSessionKey(tabContext.tabId);
|
|
46330
|
+
const loadDelta = !authoritative && previousMessages.length > 1 && sessionKey === latestMessagesSessionKey;
|
|
46331
|
+
const loadingRequest = beginMainOutputLoading(tabContext, loadDelta ? "Checking for new messages…" : "Loading conversation history…");
|
|
46220
46332
|
try {
|
|
46221
|
-
const previousMessages = latestMessages;
|
|
46222
|
-
const sessionKey = resolveMessagesSessionKey(tabContext.tabId);
|
|
46223
46333
|
let nextMessages = null;
|
|
46224
|
-
if (
|
|
46334
|
+
if (loadDelta) {
|
|
46225
46335
|
// Delta fetch with a one-message overlap: the last known message is
|
|
46226
46336
|
// re-requested so retroactive changes are detected via mergeMessagesDelta.
|
|
46227
46337
|
const response = await api(`/api/messages?since=${previousMessages.length - 1}`, { tabId: tabContext.tabId });
|
|
@@ -46229,10 +46339,12 @@ async function refreshMessages(tabContext = activeTabContext(), { authoritative
|
|
|
46229
46339
|
nextMessages = mergeMessagesDelta(previousMessages, response.data);
|
|
46230
46340
|
}
|
|
46231
46341
|
if (!nextMessages) {
|
|
46342
|
+
updateMainOutputLoading(loadingRequest, "Loading conversation history…");
|
|
46232
46343
|
const response = await api("/api/messages", { tabId: tabContext.tabId });
|
|
46233
46344
|
if (!isCurrentTabContext(tabContext)) return;
|
|
46234
46345
|
nextMessages = response.data?.messages || [];
|
|
46235
46346
|
}
|
|
46347
|
+
updateMainOutputLoading(loadingRequest, "Preparing your conversation…");
|
|
46236
46348
|
latestMessages = nextMessages;
|
|
46237
46349
|
latestMessagesSessionKey = sessionKey;
|
|
46238
46350
|
cacheMessagesForTab(tabContext.tabId, latestMessages, latestMessagesSessionKey);
|