@firstpick/pi-package-webui 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/DEVELOPMENT.md +20 -21
  2. package/README.md +7 -5
  3. package/TECHNICAL.md +6 -2
  4. package/bin/pi-webui.mjs +26 -60
  5. package/index.ts +1 -256
  6. package/package.json +1 -1
  7. package/public/app.js +145 -33
  8. package/public/index.html +10 -7
  9. package/public/service-worker.js +1 -1
  10. package/public/styles.css +51 -7
  11. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  12. package/tests/browser/interaction-continuity.spec.mjs +9 -3
  13. package/tests/codex-fast-mode-static.test.mjs +2 -2
  14. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  15. package/tests/control-visibility-static.test.mjs +3 -3
  16. package/tests/controls-layout-static.test.mjs +3 -3
  17. package/tests/events-tree-context-menu-static.test.mjs +3 -3
  18. package/tests/fast-mode-client-static.test.mjs +1 -1
  19. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  20. package/tests/file-viewer-image-static.test.mjs +3 -3
  21. package/tests/guided-git-activation-static.test.mjs +11 -4
  22. package/tests/guided-git-fallback-runtime.test.mjs +46 -21
  23. package/tests/guided-git-fallback-ui-static.test.mjs +3 -3
  24. package/tests/guided-git-publication-backend-static.test.mjs +10 -5
  25. package/tests/http-endpoints-harness.test.mjs +5 -9
  26. package/tests/intercom-conversation-viewer-static.test.mjs +3 -3
  27. package/tests/main-output-loading-static.test.mjs +18 -12
  28. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  29. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  30. package/tests/mobile-foundation-static.test.mjs +3 -3
  31. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  32. package/tests/mobile-static.test.mjs +11 -7
  33. package/tests/open-issue-wizard-static.test.mjs +1 -1
  34. package/tests/optional-feature-prompt-impact-static.test.mjs +67 -0
  35. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  36. package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
  37. package/tests/questionnaire-dialog.test.mjs +3 -3
  38. package/tests/resource-tui-extension.test.mjs +4 -18
  39. package/tests/session-sampling-ui-static.test.mjs +3 -3
  40. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  41. package/tests/streaming-ui-coupling.test.mjs +2 -0
  42. package/tests/subagent-observability-static.test.mjs +2 -2
  43. package/tests/syntax-highlighting-static.test.mjs +3 -3
  44. package/tests/theme-customizer-static.test.mjs +1 -1
  45. package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
  46. package/lib/tui-model-profile-selector.mjs +0 -183
  47. package/lib/tui-resource-selector.mjs +0 -173
  48. package/tests/tui-model-profile-selector.test.mjs +0 -102
  49. package/tests/tui-resource-selector.test.mjs +0 -74
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 text prompt (replaces blocking window.prompt): resolves with the entered string,
7973
- // or null when cancelled. `validate` may return an error message to keep the dialog open.
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 value = String(elements.textPromptInput?.value ?? "");
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
- elements.textPromptInput?.focus();
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 typed as exactly 'public' or 'private'. There is no default; nothing was published.");
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 promptGitPublishRepoName(tabId = activeTabId) {
34713
- const targetTab = tabs.find((tab) => tab.id === tabId) || activeTab();
34714
- const value = window.prompt("GitHub repository name to create", defaultGitInitRepoName(targetTab));
34715
- if (value === null) return null;
34716
- return cleanGitHubRepoNameInput(value);
34717
- }
34718
-
34719
- function promptGitPublishVisibility(repoName) {
34720
- const value = window.prompt(`Visibility for GitHub repository ${repoName} — type public or private (no default)`, "");
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
- "Publish this repository to GitHub with the authenticated GitHub CLI (gh) account instead?",
34735
- "Nothing is created until you choose a name, choose visibility explicitly, and confirm the final summary.",
34736
- ].join("\n"), { affected: "A new GitHub repository and the origin remote", confirmLabel: "Choose publication details", danger: false });
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
- repoName = promptGitPublishRepoName(tabId);
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: { repoName, visibility, confirmed: true }, runId, tabId });
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 tooltip = optionalFeatureTooltip(feature, status);
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
- title.append(make("strong", undefined, feature.label), make("span", `optional-feature-pill ${status.className}`, status.label));
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 active = [...mainOutputLoadingRequests].some(mainOutputLoadingRequestIsCurrent);
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 ([...mainOutputLoadingRequests].some(mainOutputLoadingRequestIsCurrent)) elements.mainOutputLoading.hidden = false;
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 loadingRequest = beginMainOutputLoading(tabContext);
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 (!authoritative && previousMessages.length > 1 && sessionKey === latestMessagesSessionKey) {
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);
package/public/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="manifest" href="/manifest.webmanifest" />
13
13
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
14
14
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
15
- <link rel="stylesheet" href="/styles.css?v=145" />
15
+ <link rel="stylesheet" href="/styles.css?v=152" />
16
16
  <script>
17
17
  // Public-only issue-bot runtime configuration. Keep disabled unless the gateway,
18
18
  // Turnstile site key, exact CORS origin, and private-report destination are approved.
@@ -297,10 +297,6 @@
297
297
  <button id="chatSearchCloseButton" class="chat-search-button" type="button" aria-label="Close search" title="Close (Escape)">✕</button>
298
298
  </div>
299
299
  <div class="main-output-surface">
300
- <div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>
301
- <span class="main-output-loading-spinner" aria-hidden="true"></span>
302
- <span>Loading agent output…</span>
303
- </div>
304
300
  <div id="chat" class="chat" aria-live="polite" aria-busy="false">
305
301
  <button id="stickyUserPromptButton" class="sticky-user-prompt-button" type="button" aria-controls="chat" hidden></button>
306
302
  </div>
@@ -311,7 +307,13 @@
311
307
  <span id="feedbackTraySummary">No action feedback queued.</span>
312
308
  <button id="sendFeedbackButton" type="button">Send &amp; create LEARNING</button>
313
309
  </div>
314
- <div id="statusBar" class="statusbar" aria-live="polite"></div>
310
+ <div class="footer-status-host">
311
+ <div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>
312
+ <span class="main-output-loading-spinner" aria-hidden="true"></span>
313
+ <span id="mainOutputLoadingLabel">Loading conversation history…</span>
314
+ </div>
315
+ <div id="statusBar" class="statusbar" aria-live="polite"></div>
316
+ </div>
315
317
  <section id="contextMeterBar" class="context-meter-bar" aria-live="polite"></section>
316
318
  <section id="gitWorkflowPanel" class="git-workflow-panel" aria-live="polite" hidden>
317
319
  <div class="git-workflow-header">
@@ -1455,6 +1457,7 @@
1455
1457
  <h2 id="textPromptTitle">Enter a value</h2>
1456
1458
  <p id="textPromptSummary" class="muted"></p>
1457
1459
  <input id="textPromptInput" class="dialog-input" type="text" autocomplete="off" spellcheck="false" aria-labelledby="textPromptTitle" />
1460
+ <select id="textPromptSelect" class="dialog-input" aria-labelledby="textPromptTitle" hidden></select>
1458
1461
  <p id="textPromptError" class="path-picker-error" hidden></p>
1459
1462
  <menu>
1460
1463
  <button id="textPromptCancelButton" type="button">Cancel</button>
@@ -1889,7 +1892,7 @@
1889
1892
  </form>
1890
1893
  </dialog>
1891
1894
 
1892
- <script id="webuiBootLoader" data-app-src="/app.js?v=177">
1895
+ <script id="webuiBootLoader" data-app-src="/app.js?v=182">
1893
1896
  (() => {
1894
1897
  "use strict";
1895
1898
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v145";
1
+ const CACHE_NAME = "pi-webui-pwa-v153";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",
package/public/styles.css CHANGED
@@ -4478,6 +4478,36 @@ button.subagent-gate-attempt:focus-visible {
4478
4478
  background: linear-gradient(90deg, var(--ctp-green), var(--ctp-yellow), var(--ctp-peach));
4479
4479
  box-shadow: 0 0 0.85rem rgba(148, 226, 213, 0.20);
4480
4480
  }
4481
+ .optional-feature-prompt-impact {
4482
+ display: inline-grid;
4483
+ place-items: center;
4484
+ box-sizing: border-box;
4485
+ flex: 0 0 auto;
4486
+ width: 2.8rem;
4487
+ min-width: 2.8rem;
4488
+ min-height: 1.15rem;
4489
+ padding: 0.08rem 0.2rem;
4490
+ border: 1px solid rgba(180, 190, 254, 0.2);
4491
+ border-radius: 0.42rem;
4492
+ color: var(--ctp-subtext);
4493
+ background: rgba(var(--ctp-surface-rgb), 0.48);
4494
+ font-family: var(--font-mono);
4495
+ font-size: var(--text-xs);
4496
+ font-weight: 900;
4497
+ line-height: 1;
4498
+ }
4499
+ .optional-feature-prompt-impact.initial {
4500
+ color: var(--ctp-peach);
4501
+ border-color: rgba(250, 179, 135, 0.34);
4502
+ }
4503
+ .optional-feature-prompt-impact.conditional {
4504
+ color: var(--ctp-yellow);
4505
+ border-color: rgba(249, 226, 175, 0.34);
4506
+ }
4507
+ .optional-feature-prompt-impact.none {
4508
+ color: var(--ctp-green);
4509
+ border-color: rgba(166, 227, 161, 0.28);
4510
+ }
4481
4511
  .optional-feature-row {
4482
4512
  position: relative;
4483
4513
  display: grid;
@@ -4578,17 +4608,25 @@ button.subagent-gate-attempt:focus-visible {
4578
4608
  .optional-feature-title {
4579
4609
  display: flex;
4580
4610
  flex-direction: column;
4581
- gap: 0.28rem;
4582
4611
  align-items: flex-start;
4612
+ gap: 0.28rem;
4583
4613
  min-width: 0;
4584
4614
  }
4585
4615
  .optional-feature-title strong {
4586
4616
  color: rgba(var(--ctp-text-rgb), 0.94);
4587
4617
  font-size: 0.82rem;
4588
4618
  }
4619
+ .optional-feature-status-tags {
4620
+ display: inline-flex;
4621
+ flex-wrap: wrap;
4622
+ align-items: center;
4623
+ gap: 0.34rem;
4624
+ }
4589
4625
  .optional-feature-pill {
4590
4626
  display: inline-flex;
4627
+ flex: 0 0 auto;
4591
4628
  align-items: center;
4629
+ justify-content: center;
4592
4630
  min-height: 1.15rem;
4593
4631
  padding: 0.12rem 0.42rem;
4594
4632
  border-radius: 999px;
@@ -5571,7 +5609,7 @@ button.subagent-gate-attempt:focus-visible {
5571
5609
  body.terminal-tabs-left .main-output-surface,
5572
5610
  body.terminal-tabs-left .run-indicator-host,
5573
5611
  body.terminal-tabs-left .feedback-tray,
5574
- body.terminal-tabs-left .statusbar,
5612
+ body.terminal-tabs-left .footer-status-host,
5575
5613
  body.terminal-tabs-left .context-meter-bar,
5576
5614
  body.terminal-tabs-left .git-workflow-panel,
5577
5615
  body.terminal-tabs-left .composer,
@@ -5585,10 +5623,9 @@ button.subagent-gate-attempt:focus-visible {
5585
5623
  body.terminal-tabs-left .subagent-terminal-view { grid-row: 1 / -1; }
5586
5624
  body.terminal-tabs-left .chat-search-bar { grid-row: 3; }
5587
5625
  body.terminal-tabs-left .main-output-surface { grid-row: 4; }
5588
- body.terminal-tabs-left .main-output-loading { top: 0.75rem; }
5589
5626
  body.terminal-tabs-left .run-indicator-host { grid-row: 5; }
5590
5627
  body.terminal-tabs-left .feedback-tray { grid-row: 6; }
5591
- body.terminal-tabs-left .statusbar { grid-row: 7; }
5628
+ body.terminal-tabs-left .footer-status-host { grid-row: 7; }
5592
5629
  body.terminal-tabs-left .context-meter-bar { grid-row: 8; }
5593
5630
  body.terminal-tabs-left .git-workflow-panel { grid-row: 9; }
5594
5631
  body.terminal-tabs-left .composer,
@@ -5622,7 +5659,7 @@ button.subagent-gate-attempt:focus-visible {
5622
5659
  body.terminal-tabs-left.terminal-tabs-sidebar-start .main-output-surface,
5623
5660
  body.terminal-tabs-left.terminal-tabs-sidebar-start .run-indicator-host,
5624
5661
  body.terminal-tabs-left.terminal-tabs-sidebar-start .feedback-tray,
5625
- body.terminal-tabs-left.terminal-tabs-sidebar-start .statusbar,
5662
+ body.terminal-tabs-left.terminal-tabs-sidebar-start .footer-status-host,
5626
5663
  body.terminal-tabs-left.terminal-tabs-sidebar-start .context-meter-bar,
5627
5664
  body.terminal-tabs-left.terminal-tabs-sidebar-start .git-workflow-panel,
5628
5665
  body.terminal-tabs-left.terminal-tabs-sidebar-start .composer,
@@ -8308,16 +8345,22 @@ button.git-workflow-step:hover:not(:disabled) {
8308
8345
  padding: 1rem;
8309
8346
  scroll-behavior: smooth;
8310
8347
  }
8348
+ .footer-status-host {
8349
+ position: relative;
8350
+ flex: 0 0 auto;
8351
+ min-width: 0;
8352
+ }
8311
8353
  .main-output-loading[hidden] { display: none !important; }
8312
8354
  .main-output-loading {
8313
8355
  position: absolute;
8314
8356
  z-index: 13;
8315
- top: 0.55rem;
8316
8357
  left: 50%;
8358
+ bottom: calc(100% + 0.3rem);
8317
8359
  display: inline-flex;
8318
8360
  align-items: center;
8319
8361
  gap: 0.48rem;
8320
- max-width: calc(100% - 1.2rem);
8362
+ width: max-content;
8363
+ max-width: calc(100% - 2rem);
8321
8364
  margin: 0;
8322
8365
  transform: translateX(-50%);
8323
8366
  padding: 0.42rem 0.7rem;
@@ -13075,6 +13118,7 @@ body:not(.mobile-keyboard-open) .composer-input-row:has(.composer-workflow-mode-
13075
13118
  body.subagent-terminal-active .workspace-dashboard,
13076
13119
  body.subagent-terminal-active .widget-area,
13077
13120
  body.subagent-terminal-active .main-output-surface,
13121
+ body.subagent-terminal-active .main-output-loading,
13078
13122
  body.subagent-terminal-active .feedback-tray,
13079
13123
  body.subagent-terminal-active .jump-to-latest-button,
13080
13124
  body.subagent-terminal-active .statusbar,