@jmfederico/pi-web 1.202610.1 → 1.202610.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 (144) hide show
  1. package/README.md +23 -134
  2. package/dist/cli.js +4 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/assets/index-DUsqiytv.js +4408 -0
  5. package/dist/client/assets/vendor-editor-core-C2PJX3uW.js +10 -0
  6. package/dist/client/assets/{vendor-editor-languages-DOCw3vc9.js → vendor-editor-languages-CS6n1J8n.js} +1 -1
  7. package/dist/client/index.html +4 -48
  8. package/dist/config.js +8 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/pi-packages/captains-log/dist/browser/index.js +30 -32
  11. package/dist/pi-packages/captains-log/package.json +4 -4
  12. package/dist/pi-packages/relays/extensions/index.js +60 -0
  13. package/dist/pi-packages/relays/package.json +10 -1
  14. package/dist/pi-packages/relays/pi-web-plugin.js +31 -1
  15. package/dist/pi-packages/relays/prompts/relay-worktree.md +6 -16
  16. package/dist/pi-packages/relays/prompts/relay.md +6 -33
  17. package/dist/pi-packages/relays/relayDispatch.js +67 -0
  18. package/dist/pi-packages/relays/relayIdentity.js +37 -0
  19. package/dist/pi-packages/relays/relaysPanelElement.js +37 -12
  20. package/dist/pi-packages/relays/skills/relay/SKILL.md +24 -68
  21. package/dist/pi-packages/relays/skills/relay-runner/SKILL.md +40 -219
  22. package/dist/pi-packages/workflows/browser/pi-web-plugin.js +33 -0
  23. package/dist/pi-packages/workflows/package.json +22 -0
  24. package/dist/pi-packages/workflows/prompts/worktree.md +12 -0
  25. package/dist/pi-web-plugins/files/browser/pi-web-plugin.js +49 -51
  26. package/dist/pi-web-plugins/git/browser/git-panel.js +0 -1
  27. package/dist/pi-web-plugins/git/server-plugin.js +11 -0
  28. package/dist/pi-web-plugins/git/workspace-discovery-notify.cjs +14 -0
  29. package/dist/pi-web-plugins/git/workspaceDiscoveryHooks.js +180 -0
  30. package/dist/pi-web-plugins/info/infoInternals.js +3 -3
  31. package/dist/pi-web-plugins/info/pi-web-plugin.js +1 -1
  32. package/dist/pi-web-plugins/mermaid/browser/mermaid-engine.js +1077 -414
  33. package/dist/pi-web-plugins/terminal/browser/pi-web-plugin.js +30 -30
  34. package/dist/pi-web-plugins/updates/pi-web-plugin.js +1 -1
  35. package/dist/piWebUpdate.js +2 -2
  36. package/dist/piWebUpdate.js.map +1 -1
  37. package/dist/plugin-api.d.ts +229 -8
  38. package/dist/server/activity/workspaceActivityService.js +4 -1
  39. package/dist/server/activity/workspaceActivityService.js.map +1 -1
  40. package/dist/server/app.js +5 -0
  41. package/dist/server/app.js.map +1 -1
  42. package/dist/server/configRoutes.js +6 -0
  43. package/dist/server/configRoutes.js.map +1 -1
  44. package/dist/server/knownAutoInstallPiPackages.js +6 -0
  45. package/dist/server/knownAutoInstallPiPackages.js.map +1 -1
  46. package/dist/server/navigationPreferenceRoutes.js +39 -0
  47. package/dist/server/navigationPreferenceRoutes.js.map +1 -0
  48. package/dist/server/plugins/projectPluginSettings.js +95 -0
  49. package/dist/server/plugins/projectPluginSettings.js.map +1 -0
  50. package/dist/server/plugins/serverPluginRuntime.js +26 -3
  51. package/dist/server/plugins/serverPluginRuntime.js.map +1 -1
  52. package/dist/server/sessiond/autoInstallPiPackages.js +3 -3
  53. package/dist/server/sessiond/workspaceCatalogRoutes.js +3 -1
  54. package/dist/server/sessiond/workspaceCatalogRoutes.js.map +1 -1
  55. package/dist/server/sessiond/workspaceNotificationRoutes.js +41 -0
  56. package/dist/server/sessiond/workspaceNotificationRoutes.js.map +1 -0
  57. package/dist/server/sessiond.js +40 -7
  58. package/dist/server/sessiond.js.map +1 -1
  59. package/dist/server/sessions/askUserDomain.js +232 -0
  60. package/dist/server/sessions/askUserDomain.js.map +1 -0
  61. package/dist/server/sessions/askUserTool.js +15 -17
  62. package/dist/server/sessions/askUserTool.js.map +1 -1
  63. package/dist/server/sessions/dockerEnvironmentFacts.js +8 -0
  64. package/dist/server/sessions/dockerEnvironmentFacts.js.map +1 -1
  65. package/dist/server/sessions/extensionSessionDispatch.js +76 -0
  66. package/dist/server/sessions/extensionSessionDispatch.js.map +1 -0
  67. package/dist/server/sessions/globalProviderPolicy.js +71 -16
  68. package/dist/server/sessions/globalProviderPolicy.js.map +1 -1
  69. package/dist/server/sessions/messageHistoryTarget.js +61 -0
  70. package/dist/server/sessions/messageHistoryTarget.js.map +1 -0
  71. package/dist/server/sessions/piSessionManagerGateway.js +23 -24
  72. package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
  73. package/dist/server/sessions/piSessionService.js +581 -262
  74. package/dist/server/sessions/piSessionService.js.map +1 -1
  75. package/dist/server/sessions/sessionArchiveStore.js +5 -1
  76. package/dist/server/sessions/sessionArchiveStore.js.map +1 -1
  77. package/dist/server/sessions/sessionArchiveTree.js +2 -2
  78. package/dist/server/sessions/sessionArchiveTree.js.map +1 -1
  79. package/dist/server/sessions/sessionCommandService.js +9 -3
  80. package/dist/server/sessions/sessionCommandService.js.map +1 -1
  81. package/dist/server/sessions/sessionImageDimensions.js +31 -0
  82. package/dist/server/sessions/sessionImageDimensions.js.map +1 -0
  83. package/dist/server/sessions/sessionMediaIndex.js +7 -1
  84. package/dist/server/sessions/sessionMediaIndex.js.map +1 -1
  85. package/dist/server/sessions/sessionMetadata.js +51 -0
  86. package/dist/server/sessions/sessionMetadata.js.map +1 -0
  87. package/dist/server/sessions/sessionNameGenerator.js +8 -28
  88. package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
  89. package/dist/server/sessions/sessionRoutes.js +10 -2
  90. package/dist/server/sessions/sessionRoutes.js.map +1 -1
  91. package/dist/server/sessions/sessionSummaryScanner.js +62 -5
  92. package/dist/server/sessions/sessionSummaryScanner.js.map +1 -1
  93. package/dist/server/sessions/spawnSessionTool.js +3 -1
  94. package/dist/server/sessions/spawnSessionTool.js.map +1 -1
  95. package/dist/server/sessions/spawnSubsessionTool.js +25 -17
  96. package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
  97. package/dist/server/sessions/subsessionCompletionDelivery.js +15 -0
  98. package/dist/server/sessions/subsessionCompletionDelivery.js.map +1 -0
  99. package/dist/server/sessions/subsessionCompletionInbox.js +134 -0
  100. package/dist/server/sessions/subsessionCompletionInbox.js.map +1 -0
  101. package/dist/server/sessions/subsessionProvenance.js +27 -0
  102. package/dist/server/sessions/subsessionProvenance.js.map +1 -0
  103. package/dist/server/status/machineStatusService.js +17 -5
  104. package/dist/server/status/machineStatusService.js.map +1 -1
  105. package/dist/server/storage/navigationPreferenceStore.js +137 -0
  106. package/dist/server/storage/navigationPreferenceStore.js.map +1 -0
  107. package/dist/server/workspaces/projectPiWebConfig.js +88 -6
  108. package/dist/server/workspaces/projectPiWebConfig.js.map +1 -1
  109. package/dist/server/workspaces/workspaceChangeNotifier.js +12 -0
  110. package/dist/server/workspaces/workspaceChangeNotifier.js.map +1 -0
  111. package/dist/server/workspaces/workspaceNotificationCommand.js +64 -0
  112. package/dist/server/workspaces/workspaceNotificationCommand.js.map +1 -0
  113. package/dist/server/workspaces/workspaceProviderRegistry.js +55 -0
  114. package/dist/server/workspaces/workspaceProviderRegistry.js.map +1 -1
  115. package/dist/server-plugin-api.d.ts +18 -0
  116. package/dist/server-plugin-api.js.map +1 -1
  117. package/dist/sessiond/sessionDaemonClient.js +3 -3
  118. package/dist/sessiond/sessionDaemonClient.js.map +1 -1
  119. package/dist/shared/apiTypes.js +2 -2
  120. package/dist/shared/apiTypes.js.map +1 -1
  121. package/dist/shared/federatedRoutes.js +5 -0
  122. package/dist/shared/federatedRoutes.js.map +1 -1
  123. package/dist/shared/machineStatus.js +11 -2
  124. package/dist/shared/machineStatus.js.map +1 -1
  125. package/dist/shared/navigationPreferences.js +6 -0
  126. package/dist/shared/navigationPreferences.js.map +1 -0
  127. package/dist/shared/pluginApiTypes.d.ts +2 -0
  128. package/dist/shared/sessionMedia.js +6 -0
  129. package/dist/shared/sessionMedia.js.map +1 -1
  130. package/dist/shared/streamingBehavior.js +7 -0
  131. package/dist/shared/streamingBehavior.js.map +1 -0
  132. package/dist/shared/themePreference.js +23 -0
  133. package/dist/shared/themePreference.js.map +1 -0
  134. package/dist/workspaceNotificationCli.js +95 -0
  135. package/dist/workspaceNotificationCli.js.map +1 -0
  136. package/docs/config.md +99 -86
  137. package/docs/plugins.md +103 -30
  138. package/examples/session-bridge-plugin/package.json +2 -2
  139. package/examples/workspace-provider-plugin/package.json +1 -1
  140. package/package.json +33 -33
  141. package/dist/client/assets/index-CBjDnBIN.js +0 -4178
  142. package/dist/client/assets/vendor-editor-core-YWog6mAR.js +0 -10
  143. package/dist/server/sessions/pendingAskStore.js +0 -275
  144. package/dist/server/sessions/pendingAskStore.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ const qualifiedThemeIdPattern = /^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/u;
2
+ /** Parse data only: theme availability is resolved after browser plugins load. */
3
+ export function parseThemePreference(value) {
4
+ if (!isRecord(value))
5
+ return undefined;
6
+ const record = value;
7
+ const themeId = record["themeId"];
8
+ const auto = record["auto"];
9
+ if (typeof themeId !== "string" || !qualifiedThemeIdPattern.test(themeId) || typeof auto !== "boolean")
10
+ return undefined;
11
+ return { themeId, auto };
12
+ }
13
+ function isRecord(value) {
14
+ return typeof value === "object" && value !== null && !Array.isArray(value);
15
+ }
16
+ export function requireDefaultThemePreference(value, source) {
17
+ const preference = parseThemePreference(value);
18
+ if (preference === undefined) {
19
+ throw new Error(`PI WEB config defaultTheme must contain a qualified themeId and a boolean auto: ${source}`);
20
+ }
21
+ return preference;
22
+ }
23
+ //# sourceMappingURL=themePreference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themePreference.js","sourceRoot":"","sources":["../../src/shared/themePreference.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG,sCAAsC,CAAC;AAEvE,kFAAkF;AAClF,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC;IACrB,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,KAAc,EAAE,MAAc;IAC1E,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,mFAAmF,MAAM,EAAE,CAAC,CAAC;IAC/G,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { resolve } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { isPiWebPluginId } from "./shared/pluginIds.js";
4
+ import { SessionDaemonClient } from "./sessiond/sessionDaemonClient.js";
5
+ const usage = "Usage: pi-web workspaces notify --project <projectId> --plugin <pluginId>";
6
+ const idMaxLength = 512;
7
+ /** These identifiers are opaque; preserve the original value rather than trimming it. */
8
+ export function requireWorkspaceNotificationProjectId(value) {
9
+ if (typeof value !== "string" || value.trim() === "" || value.length > idMaxLength) {
10
+ throw new Error("Workspace notification project id must be non-empty and at most 512 characters");
11
+ }
12
+ return value;
13
+ }
14
+ export function requireWorkspaceNotificationPluginId(value) {
15
+ if (typeof value !== "string" || value.length > idMaxLength || !isPiWebPluginId(value)) {
16
+ throw new Error("Workspace notification plugin id must match a PI WEB plugin id and be at most 512 characters");
17
+ }
18
+ return value;
19
+ }
20
+ /** Failures propagate to the CLI's nonzero exit boundary; integrations own best-effort policy. */
21
+ export async function runWorkspaceNotificationCli(args, dependencies = {}) {
22
+ const target = parseCommand(args);
23
+ if (target === undefined) {
24
+ (dependencies.writeLine ?? console.log)(usage);
25
+ return;
26
+ }
27
+ const client = dependencies.client ?? dependencies.createClient?.(target.daemonOptions) ?? new SessionDaemonClient(target.daemonOptions);
28
+ const response = await client.request("POST", `/workspace-notifications/projects/${encodeURIComponent(target.projectId)}`, { pluginId: target.pluginId }, { signal: AbortSignal.timeout(2_000) });
29
+ if (response.statusCode < 200 || response.statusCode >= 300) {
30
+ const detail = response.body.trim().slice(0, 1024);
31
+ throw new Error(`Workspace notification failed (HTTP ${String(response.statusCode)})${detail === "" ? "" : `: ${detail}`}`);
32
+ }
33
+ }
34
+ function parseCommand(args) {
35
+ if (args.length === 0
36
+ || (args.length === 1 && (args[0] === "help" || isHelp(args[0])))
37
+ || (args.length === 2 && args[0] === "notify" && isHelp(args[1]))) {
38
+ return undefined;
39
+ }
40
+ if (args[0] !== "notify")
41
+ throw new Error(usage);
42
+ const values = new Map();
43
+ for (let index = 1; index < args.length; index += 1) {
44
+ const arg = args[index];
45
+ if (arg === undefined)
46
+ continue;
47
+ const equals = arg.indexOf("=");
48
+ const option = equals === -1 ? arg : arg.slice(0, equals);
49
+ if (option !== "--project" && option !== "--plugin" && option !== "--daemon-url" && option !== "--daemon-socket") {
50
+ throw new Error(`Unknown workspaces notify option: ${arg}`);
51
+ }
52
+ if (values.has(option))
53
+ throw new Error(`Duplicate workspaces notify option: ${option}`);
54
+ const value = equals === -1 ? args[index + 1] : arg.slice(equals + 1);
55
+ if (value === undefined || value === "" || (equals === -1 && value.startsWith("-"))) {
56
+ throw new Error(`${option} requires a value`);
57
+ }
58
+ values.set(option, value);
59
+ if (equals === -1)
60
+ index += 1;
61
+ }
62
+ if (!values.has("--project") || !values.has("--plugin"))
63
+ throw new Error(usage);
64
+ if (values.has("--daemon-url") && values.has("--daemon-socket")) {
65
+ throw new Error("Specify only one of --daemon-url and --daemon-socket");
66
+ }
67
+ const daemonOptions = {};
68
+ const url = values.get("--daemon-url");
69
+ if (url !== undefined) {
70
+ const parsed = new URL(url);
71
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:")
72
+ throw new Error("--daemon-url requires an HTTP(S) URL");
73
+ daemonOptions.baseUrl = parsed.href;
74
+ }
75
+ const socket = values.get("--daemon-socket");
76
+ if (socket !== undefined)
77
+ daemonOptions.socketPath = socket;
78
+ return {
79
+ projectId: requireWorkspaceNotificationProjectId(values.get("--project")),
80
+ pluginId: requireWorkspaceNotificationPluginId(values.get("--plugin")),
81
+ daemonOptions,
82
+ };
83
+ }
84
+ function isHelp(value) {
85
+ return value === "--help" || value === "-h";
86
+ }
87
+ // Hook invocations use this lightweight entry instead of loading the service
88
+ // installation CLI. Both entrypoints share the same bounded request runner.
89
+ if (process.argv[1] !== undefined && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
90
+ runWorkspaceNotificationCli(process.argv.slice(2)).catch((error) => {
91
+ console.error(error instanceof Error ? error.message : String(error));
92
+ process.exitCode = 1;
93
+ });
94
+ }
95
+ //# sourceMappingURL=workspaceNotificationCli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaceNotificationCli.js","sourceRoot":"","sources":["../src/workspaceNotificationCli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAoE,MAAM,mCAAmC,CAAC;AAQ1I,MAAM,KAAK,GAAG,2EAA2E,CAAC;A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C,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC1E,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
package/docs/config.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  PI WEB configuration covers the machine-local and project-local settings you usually need: the web/API bind address, trusted development-host settings, UI preferences, desired plugin enablement/settings, server-plugin recovery, file-explorer path access, manual upload defaults, upload limits, the Pi agent state directory, and session-daemon tools.
4
4
 
5
- Use this reference for detailed configuration and operational behavior. For scannable settings tables with defaults, scopes, and restart requirements, see <https://pi-web.dev/config>.
5
+ Settings below describe available choices, scope, limitations, and restart requirements. An HTML version is available at <https://pi-web.dev/config>.
6
6
 
7
7
  ## Config files
8
8
 
@@ -11,7 +11,7 @@ PI WEB uses two config files:
11
11
  - **Global PI WEB config:** `$PI_WEB_CONFIG`, or `$XDG_CONFIG_HOME/pi-web/config.json`, or `~/.config/pi-web/config.json`.
12
12
  - **Project-local PI WEB config:** `<project>/.pi-web/config.json` for commit-able project settings.
13
13
 
14
- Each PI WEB machine has its own config. When using Fleet/machine federation, Settings uses the selected machine for config that affects work running there: session daemon tools, desired PI WEB plugin enablement/settings, external path access, and upload defaults. Gateway/browser-only settings stay local to the gateway: keyboard shortcuts, remote machine registry/tokens, and gateway host/port/allowed-hosts.
14
+ Each PI WEB machine has its own config. When using Fleet/machine federation, Settings uses the selected machine for config that affects work running there: session daemon tools, desired PI WEB plugin enablement/settings, external path access, and upload defaults. Gateway/browser-only settings stay local to the gateway: the default theme, keyboard shortcuts, remote machine registry/tokens, and gateway host/port/allowed-hosts.
15
15
 
16
16
  Pi package settings are separate from PI WEB config. They live in Pi's package-manager settings on the target machine and are managed by Pi (`pi install`, `pi remove`, `pi update`) or **Settings → Pi packages**. In a federated setup, **Settings → Pi packages** targets the currently selected machine. The PI WEB `plugins` config key controls desired enablement/settings for discovered browser-only, server-only, and dual-entry PI WEB plugins on that machine; it does not install, remove, or update Pi packages.
17
17
 
@@ -25,8 +25,8 @@ Pi package settings are separate from PI WEB config. They live in Pi's package-m
25
25
  | Override the path for one command | Supply a nonempty `PI_WEB_CONFIG` when invoking that command. This does not rewrite service definitions. |
26
26
  | Change the managed service config path | Run `pi-web install --config /path/to/config.json` to regenerate both web/API and sessiond service definitions. |
27
27
  | Upgrade from an installation that set the path only for the web service | Rerun that same install command so both services use the same config. |
28
- | systemd cannot verify the loaded service environment | The command fails rather than guesses if manager state is stale, the loaded fragment differs, or a PI WEB-managed environment value cannot be verified. Managed `Environment=` values (currently `PI_WEB_CONFIG`) must match the installed definition; unrelated variables are ignored. Drop-ins that leave managed values unchanged are allowed. |
29
- | systemd uses `EnvironmentFile=` | Accepted with a nonfatal warning. File contents are not included in systemctl's `Environment` property and PI WEB does not inspect them, so config overrides in those files cannot be verified. |
28
+ | systemd cannot verify the loaded service config | The command stops. Reinstall services with the intended config path and reload the service manager before retrying. |
29
+ | systemd uses `EnvironmentFile=` | Accepted with a warning; config-path overrides in that file cannot be verified. |
30
30
  | launchd has an old config path or a label loaded from another plist | `start` and `doctor` fail. `restart` reloads installed plists and can repair stale loaded state. |
31
31
 
32
32
  ## Startup model and thinking defaults
@@ -61,10 +61,17 @@ Process restarts depend on the key:
61
61
  - `pathAccess`: applies on the next request; existing file views may need a browser refresh.
62
62
  - `uploads.defaultFolder`: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.
63
63
  - `attachments.defaultFolder`: applies to new prompt-attachment saves after config/workspace refresh.
64
- - `plugins`: browser-only changes apply after a browser-tab reload. Any enablement, settings, package-source, or package-revision change affecting a `serverModule` requires a manual session-daemon restart, then a browser reload for its paired UI.
64
+ - `plugins`: browser-only changes need a tab reload. Server-backed enablement, settings, or package changes require a manual session-daemon restart, then a tab reload. See [Project plugin settings](#project-plugin-settings).
65
65
  - `serverPlugins.safeStart`: persistent offline recovery state applied before server-plugin discovery/import on the next sessiond start; use the `pi-web plugins safe-start ...` CLI rather than hand-editing it.
66
- - Pi package install/remove/update: not a PI WEB config key; after a mutation, type `/reload` in each idle PI WEB session on the target machine to refresh ordinary Pi resources such as extensions, skills, prompt templates, themes, and context/system prompt files. For a PI WEB package with `serverModule`, manually restart `pi-web-sessiond.service`, then reload the browser. If a global Pi extension adds or removes a model provider, or changes a provider's connection settings, the same manual sessiond restart is required; `/reload` cannot change either startup snapshot. A known Pi model provider refreshing only its own model list is applied without a restart. See [Pi extension provider baseline](#pi-extension-provider-baseline).
67
- - `shortcuts`: saved settings apply in the browser after config refresh/save.
66
+ - Pi package changes: use `/reload` in each idle session for ordinary extensions, skills, templates, and themes. Packages containing server plugins require a manual session-daemon restart and browser reload. Global provider registration or connection changes also require a daemon restart; model-list-only updates do not. See [Pi extension provider baseline](#pi-extension-provider-baseline).
67
+ - `shortcuts` / `defaultStreamingBehavior`: saved settings apply in the browser after config refresh/save; no service restart.
68
+ - `defaultTheme`: applies after settings save or browser config refresh when the browser has no local theme override; no service restart.
69
+
70
+ ### Streaming send default
71
+
72
+ In **Settings → Keyboard shortcuts → Send while agent is running**, choose **Steer** (the default) to deliver input before the next model call, or **Follow-up** to queue it until the current response finishes. This changes only the keyboard shortcut, not the chat buttons. During compaction, messages queue as follow-ups.
73
+
74
+ The global gateway key is `defaultStreamingBehavior`: `steer` or `followUp`. It is not project-local and needs no service restart.
68
75
 
69
76
  ## Global config example
70
77
 
@@ -72,6 +79,8 @@ Process restarts depend on the key:
72
79
  {
73
80
  "host": "127.0.0.1",
74
81
  "port": 8504,
82
+ "defaultTheme": { "themeId": "themes:pi-web-dark", "auto": true },
83
+ "defaultStreamingBehavior": "steer",
75
84
  "pathAccess": {
76
85
  "allowedPaths": ["~/SDKs", "/opt/reference"]
77
86
  },
@@ -121,50 +130,23 @@ Project-local `pathAccess.allowedPaths` entries are merged after the global list
121
130
 
122
131
  Project-local `uploads.defaultFolder` overrides the global upload destination for workspaces in that project, and project-local `attachments.defaultFolder` overrides the global prompt-attachment destination the same way. These defaults also apply when accessing the project through Fleet.
123
132
 
124
- Plugins may own separate project files, such as `.pi-web/tasks.json` for the built-in Workspace Tasks plugin.
133
+ Project-local `plugins.<id>.settings` supplies overrides for server plugins that support project settings, including Git. Only settings are allowed here: `plugins.<id>.enabled` is not supported; plugin enablement stays global. See [Project plugin settings](#project-plugin-settings) for merge and restart rules.
134
+
135
+ Plugins may also own separate project files, such as `.pi-web/tasks.json` for the built-in Workspace Tasks plugin.
125
136
 
126
137
  PI WEB also honors one optional project hook; see [Worktree pre-remove hook](#worktree-pre-remove-hook).
127
138
 
128
139
  ## Worktree pre-remove hook
129
140
 
130
- Before PI WEB removes a workspace — for Git projects, a secondary worktree — it gives the repository one chance to tear down project-owned infrastructure tied to that workspace. To use the hook, provide an executable script at:
131
-
132
- ```text
133
- .pi-web/hooks/worktree-pre-remove
134
- ```
135
-
136
- relative to the workspace where the deletion command runs. PI WEB runs the deletion command from the project's main workspace when it exists, so commit the hook there and it follows the repository.
137
-
138
- When the hook is present and executable, PI WEB dispatches the hook and the removal as one composed terminal command:
139
-
140
- ```sh
141
- '<hook path>' '<workspace path>' && <workspace removal command>
142
- ```
143
-
144
- For Git projects the removal command is `git worktree remove '<worktree path>'`.
145
-
146
- Contract:
141
+ Use an executable `.pi-web/hooks/worktree-pre-remove` script to stop containers or release workspace resources before removal. Place it relative to the workspace where the removal command runs—normally the project's main workspace.
147
142
 
148
- - **Arguments:** exactly one — the absolute path of the workspace being removed.
149
- - **Working directory:** the workspace the removal command runs in, not the workspace being removed.
150
- - **Exit codes:** `0` lets the removal proceed; any non-zero exit blocks it. The `&&` chain is the fail-closed guarantee — a failing hook keeps the worktree on disk.
151
- - **Absent hook:** a missing file, or a file without the executable bit (for example after a checkout that lost it), is treated as no hook; PI WEB then runs the removal command on its own.
152
-
153
- The composed command is dispatched like any other workspace deletion — same `Delete workspace: <branch>` terminal title — so hook output and failures are visible in the terminal run. If PI WEB cannot probe the hook path because of an unexpected filesystem error, the deletion request fails before any workspace terminals are closed.
154
-
155
- Example: a hook that stops and removes local dev containers that bind-mount the worktree, so deletion does not leave stale containers behind. The hook is an opaque extension point — the contract does not assume any specific tooling, so use whatever the repository standardizes on:
156
-
157
- ```sh
158
- #!/bin/sh
159
- # .pi-web/hooks/worktree-pre-remove
160
- set -eu
161
-
162
- worktree_path="$1"
163
-
164
- # Stop/remove local dev containers bind-mounting "$worktree_path",
165
- # release other per-worktree resources, etc.
166
- # Exit non-zero to block the worktree removal.
167
- ```
143
+ | Item | Behavior |
144
+ | --- | --- |
145
+ | Argument | One absolute path: the workspace being removed. |
146
+ | Success (`0`) | Continue with workspace removal. |
147
+ | Failure (nonzero) | Block removal; keep the workspace on disk. |
148
+ | Missing / not executable | Skip the hook and run removal normally. |
149
+ | Output | Visible in the workspace deletion terminal run. |
168
150
 
169
151
  ## Configuration matrix
170
152
 
@@ -185,8 +167,12 @@ Rows with JSON key `—` are runtime-only environment variables, not config-file
185
167
  | Agent can post question forms | `askUser` | `PI_WEB_ASK_USER` | Global/session daemon | Not supported locally | Restart session daemon on that machine |
186
168
  | Extension dialog auto-cancel timeout | `extensionDialogsTimeoutMs` | — | Global/session daemon | Not supported locally | Restart session daemon on that machine |
187
169
  | Session environment facts | `environmentFacts` | `PI_WEB_ENVIRONMENT_FACTS` | Global/session daemon | Not supported locally | Restart session daemon on that machine |
188
- | PI WEB plugin desired enablement/settings | `plugins.<id>.enabled`, `plugins.<id>.settings` | — | Global + sessiond startup snapshot for server entries | Not core local config; plugins may read their own project files | Browser-only: reload tab. Server-backed: manually restart sessiond, then reload tab |
170
+ | PI WEB plugin desired enablement | `plugins.<id>.enabled` | — | Global | Not supported locally | Browser-only: reload tab. Server-backed: manually restart sessiond, then reload tab |
171
+ | PI WEB plugin settings | `plugins.<id>.settings` | — | Global + project for server plugins supporting project settings | **Merges top-level setting keys** over global settings; no project enablement | Browser-only global settings: reload tab. Server-backed global/project settings: manually restart sessiond, then reload tab |
172
+ | Git worktree discovery hooks | `plugins.git.settings.workspaceDiscoveryHooks` | — | Global + project | Project boolean overrides global; default `true` | Manually restart session daemon; browser reload alone does not apply changes |
189
173
  | Server-plugin safe start | `serverPlugins.safeStart` | — | Global/offline recovery | Not supported locally; manage with `pi-web plugins safe-start ...` | Applied before discovery/import on next sessiond start |
174
+ | Default browser theme | `defaultTheme.themeId`, `defaultTheme.auto` | — | Gateway global | Not supported locally; device choices take precedence | Settings save / browser config refresh; no restart |
175
+ | Streaming send default | `defaultStreamingBehavior` | — | Global gateway | Not supported locally | Applies after settings save/config refresh; defaults to `steer` |
190
176
  | Keyboard shortcuts | `shortcuts.<actionId>` | — | Global | Not supported locally | Applies after settings save/config refresh |
191
177
  | Project config version | `version` | — | Project | Project-local only; must be `1` when present | Next project-config read |
192
178
  | **Runtime-only environment variables** | | | | | |
@@ -217,11 +203,11 @@ This setting does not change the PI WEB config file selected by `PI_WEB_CONFIG`
217
203
 
218
204
  ### Agent process environment
219
205
 
220
- Agent shells, terminals, and spawned sessions inherit the session daemon's environment almost as-is. When the daemon starts, it removes only `NODE_ENV` and `PORT` from the environment agent processes see, so development commands behave normally inside sessions — for example, `npm install` is not affected by a production `NODE_ENV` meant for the daemon. Ordinary variables (`PATH`, `HOME`, proxy settings, and the like) stay visible, and so do the daemon's `PI_WEB_*` configuration keys and the resolved `PI_CODING_AGENT_DIR` / `PI_CODING_AGENT_SESSION_DIR` values, so a `pi` CLI started from inside a session uses the same agent state — auth, models, and session storage — as the daemon. The daemon itself keeps using the values it captured at startup.
206
+ Agent shells, terminals, and child sessions inherit the daemon environment, including its Pi state paths. `NODE_ENV` and `PORT` are removed so they do not interfere with development commands.
221
207
 
222
- Every process spawned from a session also inherits `PI_WEB_SESSION=1`, marking it as nested inside the running PI WEB instance. The inherited `PI_WEB_*` values point at that live instance, so starting another PI WEB instance from inside a session fails loudly at startup because the live instance owns the state (see [Managed data directory](#managed-data-directory)); running one deliberately requires a distinct `PI_WEB_DATA_DIR`, `PI_WEB_SESSIOND_SOCKET` (or `PI_WEB_SESSIOND_PORT` / `PI_WEB_SESSIOND_HOST`), and `PI_WEB_PORT`.
208
+ `PI_WEB_SESSION=1` marks nested processes. Inherited `PI_WEB_*` values still point to the hosting instance. Use a separate data directory, daemon endpoint, and web port for a second instance. Do not restart the hosting session daemon from inside an active session you need to preserve.
223
209
 
224
- Session system prompts state these nesting facts — and, in a Docker deployment, the container layout facts — so agents learn the rules before discovering them by breaking their own session, including the precautions never to restart the hosting session daemon and to restart the web/API process before the session daemon. Set the `environmentFacts` config key to `false`, or `PI_WEB_ENVIRONMENT_FACTS=false` in the session daemon's environment, to leave environment facts out of session system prompts; they default to on.
210
+ `environmentFacts` includes nesting and deployment guidance in session system prompts by default. Set it to `false`, or use `PI_WEB_ENVIRONMENT_FACTS=false`, to omit that guidance. Restart sessiond after changing it.
225
211
 
226
212
  ### External path access
227
213
 
@@ -235,7 +221,7 @@ Accepted root forms:
235
221
  - Home-relative paths: `~/SDKs`
236
222
  - Windows absolute paths on Windows hosts: `C:\Users\dev\SDKs`
237
223
 
238
- When an absolute request is served, PI WEB expands `~`, canonicalizes the configured roots with `realpath`, requires roots to be existing directories, and rejects symlink escapes outside the allowed roots.
224
+ Roots must be existing directories. Symlink escapes outside allowed roots are rejected.
239
225
 
240
226
  In **Settings → General**, external filesystem roots are saved on the selected machine. Gateway host, port, and allowed-hosts fields stay on the gateway config.
241
227
 
@@ -258,7 +244,7 @@ The Files panel can upload one or more files in two ways:
258
244
  }
259
245
  ```
260
246
 
261
- The value must be a non-empty workspace-relative folder. PI WEB normalizes repeated separators and backslashes to `/`, and rejects absolute paths or `..` traversal. In the upload dialog only, clearing the destination field uploads that batch to the workspace root.
247
+ The value must be a non-empty workspace-relative folder, without absolute paths or `..` traversal. In the upload dialog only, clearing the destination uploads that batch to the workspace root.
262
248
 
263
249
  Uploads stay inside the workspace, create parent folders by default, and do not overwrite existing files unless you enable overwrite in the review dialog. Direct drag/drop never overwrites. Check the upload progress UI for completion, conflicts, and errors.
264
250
 
@@ -280,7 +266,7 @@ When the chat composer has pending attachments, its delivery selector offers **S
280
266
  }
281
267
  ```
282
268
 
283
- The value must be a non-empty workspace-relative folder. PI WEB normalizes repeated separators and backslashes to `/`, and rejects absolute paths or `..` traversal. Saved attachments always stay inside the workspace root, and an explicit per-request folder on the attachments API overrides the configured default.
269
+ The value must be a non-empty workspace-relative folder, without absolute paths or `..` traversal. Saved attachments stay inside the workspace. An explicit per-request folder overrides the configured default.
284
270
 
285
271
  In Fleet, Settings saves the global attachment default on the selected machine; the composer uses that project's effective destination.
286
272
 
@@ -298,9 +284,7 @@ PI_CODING_AGENT_SESSION_DIR=/opt/pi-profiles/lab-sessions
298
284
 
299
285
  The directory must use the data layout supported by the bundled Pi SDK; PI WEB does not load or convert incompatible formats, migrate profile data, or repartition PI WEB-managed archives when the directory changes.
300
286
 
301
- The session daemon resolves the directory once at startup and exports the resolved values to everything it starts, so sessions, terminals, the bash tool, and subsessions all observe the same `PI_CODING_AGENT_DIR` / `PI_CODING_AGENT_SESSION_DIR`. That resolved active directory stays fixed for the daemon lifetime: changing the environment takes effect on the next session-daemon restart on that machine, and until then sessions, Pi package operations, Pi-package-backed PI WEB plugin discovery, status/install detection, and update planning continue to use the daemon-owned active directory; a web/API restart recovers that same active directory instead of applying the new value.
302
-
303
- If the session daemon cannot report a valid active directory, profile-dependent Pi package and PI WEB plugin operations report unavailable instead of falling back to independently resolved values. A package-managed update command is shown only when the daemon reports a valid active directory and the `pi` command is on `PATH`, and the command pins that directory for the update. Restart the session daemon on the selected machine to establish the next active directory.
287
+ Changing either path requires a session-daemon restart on the target machine; restarting only web/API does not apply it. Sessions, terminals, and package operations use the daemon's active paths. If those paths are unavailable, profile-dependent operations are unavailable too.
304
288
 
305
289
  ### Pi extension provider baseline
306
290
 
@@ -308,17 +292,17 @@ Model providers are shared across all sessions on a machine. PI WEB loads them w
308
292
 
309
293
  Provider connection settings stay fixed until the daemon restarts. Project extensions and `/reload` cannot add, replace, or remove providers. Other Pi extension features continue to load and reload normally.
310
294
 
311
- Pi virtual models are unsupported in PI WEB, even from global extensions: their routers capture session-bound context that cannot safely be shared across sessions. Calls to `registerVirtualModel()` or `unregisterVirtualModel()` on the shared runtime raise explicit errors, reported in bootstrap diagnostics or session extension errors. Disable the extension's virtual-model feature and select a physical model instead; restarting the daemon does not enable it.
295
+ Pi virtual models are unsupported, including from global extensions. Disable the extension's virtual-model feature and select a physical model instead; restarting the daemon does not enable virtual models.
312
296
 
313
297
  #### Model list refresh for a known provider
314
298
 
315
299
  An extension may refresh an existing provider's **model list** without a restart, provided all other provider settings remain unchanged. Changes to credentials, connection settings, or provider implementation require a daemon restart. Accepted model-list updates are available to sessions immediately.
316
300
 
317
- Model lists are shared daemon-wide state. If extensions in two workspaces register different model lists for the same provider ID, the last registration wins. A model entry may also carry its own `baseUrl` and `headers`, which take precedence over the provider-level values for that model, so an accepted refresh can change where requests for those models are sent. Both are accepted trade-offs: a catalog is treated as a property of the provider rather than of the project, and Pi extensions are trusted daemon code.
301
+ Model lists are shared across the machine, not isolated per project. If two workspaces update the same provider's list, the last update wins. Pi extensions remain trusted code, and model entries can override provider connection details.
318
302
 
319
303
  #### Provider decisions in the daemon log
320
304
 
321
- Check the session-daemon log for ignored provider changes and applied model-list refreshes; these do not produce browser notifications. Log entries omit provider configuration and credentials.
305
+ Provider decisions are recorded in daemon logs, not browser notifications. Entries omit provider configuration and credentials. See [provider extension troubleshooting](https://pi-web.dev/faq#provider-extension-no-effect) for ignored changes.
322
306
 
323
307
  This prevents accidental provider, configuration, or credential contamination between projects; it is not a security boundary because Pi extensions remain trusted daemon code.
324
308
 
@@ -326,20 +310,11 @@ Configure providers before the daemon starts: use the active agent directory's `
326
310
 
327
311
  ### Background model catalog refresh
328
312
 
329
- PI WEB shares one model runtime across all sessions, and provider model catalogs are refreshed over the network only on the session daemon's own background schedule. Requests never start a catalog fetch of their own, so a slow or unreachable provider cannot stall opening the model selector, starting a session, or the auth dialogs on its own account.
330
-
331
- A refresh that is *already* in flight can still briefly delay starting or opening a session, because the shared runtime is read while that refresh is running. PI WEB says so while you wait: the session's activity line names the startup step it is on and adds `provider model lists are refreshing` when a background refresh is running at the same time. That note reports what is happening concurrently, not a proven cause.
332
-
333
- The session daemon runs the refresh:
334
-
335
- - **15 seconds after the daemon starts**, then **hourly**. Pi treats stored catalogs as fresh for four hours, so most hourly ticks make no network request at all; the shorter tick only makes sure a due refresh is not delayed to the next tick.
336
- - **Immediately after a provider login or logout**, bypassing that freshness window, because the cached catalog is known to be wrong.
337
-
338
- Each run is bounded: it is aborted after **60 seconds**, and a run that times out or cannot reach a provider earns **one retry after five minutes**; a provider that answers with an error status is retried on the next scheduled refresh instead. Failures never clear the stored catalogs — the last successfully fetched models stay in use and the daemon log records what failed. A refresh in flight is also aborted when the daemon shuts down.
313
+ PI WEB refreshes provider model catalogs automatically in the background and after login or logout. Reopen the model selector to see new models. Failed refreshes keep the last successful catalog and report problems in daemon logs. A refresh can briefly delay session startup; the activity line reports when model lists are refreshing.
339
314
 
340
- Models fetched by a background refresh appear the next time a client asks for the model list, so a model selector left open across a refresh may need to be reopened.
315
+ Set `PI_WEB_OFFLINE` or `PI_OFFLINE` in the web/API and session-daemon environment and restart both to disable release checks and catalog network refresh. Sessions then use stored catalogs. `PI_WEB_SKIP_VERSION_CHECK` and `PI_SKIP_VERSION_CHECK` disable only release checks.
341
316
 
342
- To turn the background refresh off entirely, set `PI_WEB_OFFLINE` or `PI_OFFLINE` in the session daemon's environment and restart it. In offline mode PI WEB performs no provider catalog network requests, including after logins, and sessions use the catalogs already stored in the agent directory. The `PI_WEB_SKIP_VERSION_CHECK` and `PI_SKIP_VERSION_CHECK` keys do **not** affect this refresh; they only suppress PI WEB release checks.
317
+ Unset or clear these flags to turn them off: any nonempty value, including `false` or `0`, enables them.
343
318
 
344
319
  ### Project trust for project-local resources
345
320
 
@@ -362,13 +337,11 @@ This mirrors the Pi CLI: with `defaultProjectTrust: "never"`, an opened workspac
362
337
 
363
338
  `subsessions` controls whether agents receive the tracked-subsession tools: `spawn_subsession`, `list_subsessions`, `check_subsession`, `read_subsession`, and `yield_to_subsessions`. It defaults to `true` and also requires `spawnSessions` to be enabled.
364
339
 
365
- Tracked subsessions are join-oriented. Calling `spawn_subsession` returns immediately, so the parent can continue independent work while the child runs. Work whose result the parent does not need to join belongs in the fire-and-forget `spawn_session` tool instead.
340
+ Independent sessions run in a workspace of the same project without returning output to their parent. Tracked subsessions run in the parent's working directory and return results automatically; the parent can keep working or wait for them. Delivered results are not automatically repeated, but remain available for review.
366
341
 
367
- A tracked subsession always runs in the spawning session's working directory, so it stays in that workspace's session tree next to its parent. `spawn_subsession` takes no `cwd`. To get work done elsewhere, instruct the child to work there from this workspace, or use `spawn_session`, which still targets any workspace of the project, for an independent session there.
342
+ Agent-created tracked subsessions are collapsed under their parent. Use **Agent subsessions** to expand them. User-created forks and clones, unknown-origin sessions, children without an available parent, and independent sessions remain visible.
368
343
 
369
- The parent can continue independent work or wait for its tracked children. Completion notices arrive automatically and wake an idle parent; no polling is needed. Child output is available to the parent when the child stops.
370
-
371
- Both `spawn_session` and `spawn_subsession` accept an optional `model` parameter, given as an exact `provider/model-id` such as `anthropic/claude-sonnet-4-5`. When set, the new session starts on that model instead of inheriting the dispatching session's model. The match is strict: an unknown or malformed value is rejected with an error. A `#provider/model-id` reference in the prompt (see [Prompt completions](#prompt-completions)) is how users ask for a specific model; agents forward that reference as this parameter. The new session also inherits the dispatching session's thinking level, clamped to its model's capabilities.
344
+ New sessions inherit the parent's model and thinking level unless another model is requested, for example with a `#provider/model-id` prompt reference. Thinking levels are limited to what the chosen model supports.
372
345
 
373
346
  In **Settings → Session daemon**, these keys are saved on the selected machine. Restart the session daemon on that machine after changing them.
374
347
 
@@ -378,13 +351,9 @@ In **Settings → Session daemon**, these keys are saved on the selected machine
378
351
 
379
352
  Use **Settings → Session daemon → Allow agents to ask questions** to change `askUser` on the selected machine. An environment override makes the toggle read-only.
380
353
 
381
- Agents can post a form with 1–20 questions, with free-text answers or up to 12 choices per question. Some questions allow multiple selections. A **Custom** free-text answer is always available, and you may leave any question unanswered.
382
-
383
- Calling `ask_user` posts the whole set as one browser form and ends the current agent run instead of waiting for the user. The open form is owned by the session daemon, so it survives a browser disconnect, browser reload, or web/API restart while that daemon keeps running. When the user submits, the answers arrive as a follow-up that wakes the session; each question is reported with its selected option values or free text, or explicitly as unanswered.
354
+ Agents can ask questions with choices or free-text answers. You may leave questions unanswered; partial submissions are confirmed before sending. Answering or skipping resumes the agent.
384
355
 
385
- PI WEB confirms a partial submission before sending it and names the unanswered questions. Only one ask can be open per session: a later `ask_user` call supersedes the earlier one, reports that fact and its unanswered questions to the model, and turns the earlier card into a read-only transcript record. Submitted and cancelled asks likewise remain readable in the transcript.
386
-
387
- Sending an ordinary chat message while a form is open voids the form: the card closes as cancelled and the model is told its questions went unanswered as part of the turn the message itself starts.
356
+ Forms are saved in the conversation and survive restarts. Only a form at the end of the active conversation is open; answering, skipping, or sending another message closes it. Earlier forms remain expandable for read-only review. Returning the conversation to a question reopens it; archived conversations remain read-only.
388
357
 
389
358
  Restart the session daemon after changing `askUser` or after upgrading PI WEB to a version that introduces this tool. For the systemd user service, run `systemctl --user restart pi-web-sessiond`.
390
359
 
@@ -392,7 +361,7 @@ Restart the session daemon after changing `askUser` or after upgrading PI WEB to
392
361
 
393
362
  Pi extensions can show confirmation, selection, and text-input dialogs inline in the session transcript, including while a session starts or a tool runs. Dialog support is always on; there is no enable flag. See [Pi extension dialogs in PI WEB](https://pi-web.dev/plugins#pi-extension-dialogs) for details.
394
363
 
395
- `extensionDialogsTimeoutMs` is the unattended-dialog safety valve: how long the session daemon waits for an answer before settling the dialog with its kind's cancel value (`false` for confirm, `undefined` for select and input). It defaults to `300000` (5 minutes); set it to `0` to wait forever. An extension's own `timeout` option still applies, and the effective deadline is the sooner of the two.
364
+ `extensionDialogsTimeoutMs` cancels unanswered extension dialogs after the configured interval. It defaults to `300000` (5 minutes); set it to `0` to wait forever. If the extension sets its own timeout, the sooner deadline applies.
396
365
 
397
366
  The key is edited directly in the global config file. Restart the session daemon after changing it — for the systemd user service, run `systemctl --user restart pi-web-sessiond`.
398
367
 
@@ -410,7 +379,33 @@ The `plugins` key controls desired enablement and JSON settings for PI WEB brows
410
379
  }
411
380
  ```
412
381
 
413
- Plugins are enabled by default unless their package metadata declares `defaultEnabled: false`, as Captain's Log does. Explicit `plugins.<id>.enabled` config overrides the package default. `plugins.<id>.enabled: false` hides a browser-only entry on the next page load. For a server-backed entry, desired disablement takes effect on the next sessiond start; its paired browser entry continues to follow the still-active server entry until that restart. The bundled `pi-web.terminal` plugin is required during normal startup: ordinary config cannot disable it, and Settings renders it non-editable. Server settings take effect at daemon startup; diagnostics do not expose their values.
382
+ Plugins are enabled by default unless their package metadata declares `defaultEnabled: false`, as Captain's Log does. Explicit `plugins.<id>.enabled` config overrides the package default. `plugins.<id>.enabled: false` hides a browser-only entry on the next page load. For a server-backed entry, desired disablement takes effect on the next sessiond start; its paired browser entry continues to follow the still-active server entry until that restart. The bundled `pi-web.terminal` plugin is required during normal startup: ordinary config cannot disable it, and Settings renders it non-editable. Global server settings are captured at daemon startup; diagnostics do not expose their values.
383
+
384
+ #### Project plugin settings
385
+
386
+ Supporting server plugins, including Git, accept `plugins.<id>.settings` in `<project>/.pi-web/config.json` at the registered project's path, not in individual worktrees. Project top-level keys override global settings; nested objects are replaced rather than deep-merged. Plugin enablement stays global.
387
+
388
+ After changing global or project server-plugin settings, manually restart the target session daemon, then reload the browser. A browser reload, web/API restart, or Pi's `/reload` is insufficient. The daemon restart can interrupt sessions and terminals; finish important work and restart from outside its hosted sessions.
389
+
390
+ #### Git worktree discovery hooks
391
+
392
+ `plugins.git.settings.workspaceDiscoveryHooks` enables automatic worktree discovery on supported Git builds (Git 2.54+). It defaults to `true` and preserves existing hooks. See [Automatic Git worktree discovery](https://pi-web.dev/plugins#automatic-git-worktree-discovery).
393
+
394
+ To opt out, merge this into machine config or the registered project's `.pi-web/config.json`:
395
+
396
+ ```json
397
+ {
398
+ "plugins": {
399
+ "git": {
400
+ "settings": {
401
+ "workspaceDiscoveryHooks": false
402
+ }
403
+ }
404
+ }
405
+ }
406
+ ```
407
+
408
+ Project values override the machine default. Changes require a manual session-daemon restart. Disabling hooks leaves the Git plugin and ordinary workspace discovery available.
414
409
 
415
410
  #### Desired versus active plugin state
416
411
 
@@ -449,6 +444,24 @@ pi-web plugins safe-start clear --restart
449
444
 
450
445
  Ordinary import/activation/start/health failures are quarantined when possible, but server plugins are trusted in-process code, share sessiond's event loop, and are not crash-isolated. `bundled-only` bypasses external plugin failures; `none` is the emergency level that also bypasses bundled server plugins. Setting, clearing, or disabling takes effect for server code only after sessiond restarts, and that restart may interrupt active sessions/runtime ownership.
451
446
 
447
+ ### Theme default and device choices
448
+
449
+ In **Settings → General → Theme**, choose a theme and **Auto** mode, then:
450
+
451
+ - **Use on this device** saves a choice for this browser only.
452
+ - **Set as default** shares a default without replacing existing device choices.
453
+ - **Use the default** clears this browser's override.
454
+
455
+ Device choices take precedence over the configured default, then the built-in default (PI WEB Dark with Auto on). Auto follows the device's light/dark preference for paired themes; unpaired themes stay selected. Unavailable themes temporarily fall back to Classic without erasing the choice.
456
+
457
+ The default belongs to the gateway, not a project or remote machine. Changes apply after settings save or browser config refresh, with no service restart.
458
+
459
+ ```json
460
+ { "defaultTheme": { "themeId": "themes:pi-web-dark", "auto": true } }
461
+ ```
462
+
463
+ Use a theme contribution ID rather than a display name. Built-in IDs are `themes:pi-web-dark`, `themes:pi-web-light`, and `themes:classic`.
464
+
452
465
  ### Shortcut config
453
466
 
454
467
  Shortcut values are keyed by action id. Values are shortcut strings such as `mod+k`, `g p`, or `shift+enter`; `null` disables that action's shortcut.
@@ -467,11 +480,11 @@ Shortcut values are keyed by action id. Values are shortcut strings such as `mod
467
480
 
468
481
  Prefer Settings → Keyboard for editing, recording, disabling, or resetting shortcuts. `mod` accepts Ctrl or ⌘. Browsers and operating systems may reserve some combinations.
469
482
 
470
- App shortcuts can be single keys or sequences. Unmodified and Shift-only shortcuts do not start inside inputs, textareas, selects, or contenteditable editors. Sequences expire after 1.2 seconds; Escape or a focus change cancels them. Custom bindings win over defaults; ties resolve by action id. A shorter binding shadows sequences with that prefix (for example, `g` shadows `g p`).
483
+ App shortcuts support single keys or sequences. Avoid conflicting bindings and browser-reserved combinations. Unmodified and Shift-only shortcuts do not start while editing text.
471
484
 
472
- The two **Chat composer** send bindings accept one key combination each, not sequences. **Send message — desktop** defaults to Enter; **Send message — touch or narrow screen** defaults to Shift+Enter. The latter applies when the browser reports a coarse primary pointer (typically touch) or a viewport at most 760px wide; otherwise, desktop applies. Its config key remains `composer.send.mobile`. Enter and Shift+Enter insert newlines when not assigned to send. Composer send bindings take priority over app shortcuts only inside the message editor, even when the draft is empty or sending is unavailable. Plain Enter accepts a selected completion first. `null` disables keyboard submission for that context; the send button remains available.
485
+ Composer send bindings accept one key combination, not sequences. Desktop defaults to Enter; touch or narrow screens default to Shift+Enter. The touch binding (`composer.send.mobile`) applies with a coarse primary pointer or a viewport at most 760px wide. Unassigned Enter/Shift+Enter insert newlines; Enter accepts a selected completion first. `null` disables keyboard submission, not the send button.
473
486
 
474
- Existing browser-local Enter preferences remain the fallback until the corresponding composer binding is configured. Reset removes the override and returns to that fallback. New bindings are saved in the gateway config, like other shortcuts; the old preference is not copied into shared configuration. Automatic touch-keyboard capitalization is ignored when interpreting Shift+Enter.
487
+ Existing browser-local Enter preferences remain the fallback until a composer binding is configured. Reset restores that fallback. New bindings are saved in gateway config.
475
488
 
476
489
  ## Prompt completions
477
490