@jmfederico/pi-web 1.202606.7 → 1.202607.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -5
- package/dist/cli.js +291 -320
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/CodeViewer-uASb28Y1.js +4 -0
- package/dist/client/assets/TerminalPanel-DfTmykFw.js +187 -0
- package/dist/client/assets/UnifiedDiffViewer-laQN1x7P.js +39 -0
- package/dist/client/assets/index-Dhapi0oR.js +3093 -0
- package/dist/client/assets/vendor-editor-core-vUi74DnD.js +12 -0
- package/dist/client/assets/vendor-editor-languages-DoaXUodB.js +46 -0
- package/dist/client/assets/vendor-editor-legacy-CYBnW6ZU.js +1 -0
- package/dist/client/assets/vendor-terminal-BrP-ENHg.css +1 -0
- package/dist/client/assets/vendor-terminal-D8k4UKM2.js +35 -0
- package/dist/client/index.html +9 -6
- package/dist/client/manifest.webmanifest +4 -4
- package/dist/config.js +144 -2
- package/dist/config.js.map +1 -1
- package/dist/docker/piWebDockerCommandPlan.js +211 -0
- package/dist/docker/piWebDockerCommandPlan.js.map +1 -0
- package/dist/nativeServices/serviceDoctor.js +480 -0
- package/dist/nativeServices/serviceDoctor.js.map +1 -0
- package/dist/nativeServices/serviceInstall.js +35 -0
- package/dist/nativeServices/serviceInstall.js.map +1 -0
- package/dist/nativeServices/servicePlan.js +358 -0
- package/dist/nativeServices/servicePlan.js.map +1 -0
- package/dist/nativeServices/serviceProbe.js +447 -0
- package/dist/nativeServices/serviceProbe.js.map +1 -0
- package/dist/nativeServices/serviceRendering.js +122 -0
- package/dist/nativeServices/serviceRendering.js.map +1 -0
- package/dist/pi-web-plugins/updates/pi-web-plugin.js +27 -5
- package/dist/pi-web-plugins/updates/updatesLogic.js +37 -5
- package/dist/piWebVersionReport.js +4 -0
- package/dist/piWebVersionReport.js.map +1 -1
- package/dist/plugin-api.d.ts +3 -1
- package/dist/server/activeAgentProfileProvider.js +25 -0
- package/dist/server/activeAgentProfileProvider.js.map +1 -0
- package/dist/server/app.js +69 -13
- package/dist/server/app.js.map +1 -1
- package/dist/server/browserMessageProjection.js +56 -0
- package/dist/server/browserMessageProjection.js.map +1 -0
- package/dist/server/configRoutes.js +147 -6
- package/dist/server/configRoutes.js.map +1 -1
- package/dist/server/machines/machineClient.js +19 -9
- package/dist/server/machines/machineClient.js.map +1 -1
- package/dist/server/machines/machinePluginProxyRoutes.js +7 -4
- package/dist/server/machines/machinePluginProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineProxyRoutes.js +76 -11
- package/dist/server/machines/machineProxyRoutes.js.map +1 -1
- package/dist/server/machines/machineRoutes.js +1 -1
- package/dist/server/machines/machineRoutes.js.map +1 -1
- package/dist/server/machines/machineService.js +6 -28
- package/dist/server/machines/machineService.js.map +1 -1
- package/dist/server/piPackageRoutes.js +91 -0
- package/dist/server/piPackageRoutes.js.map +1 -0
- package/dist/server/piPackageService.js +101 -0
- package/dist/server/piPackageService.js.map +1 -0
- package/dist/server/piWebPluginService.js +91 -20
- package/dist/server/piWebPluginService.js.map +1 -1
- package/dist/server/piWebReleaseLookupCache.js +37 -0
- package/dist/server/piWebReleaseLookupCache.js.map +1 -0
- package/dist/server/piWebStatus.js +90 -37
- package/dist/server/piWebStatus.js.map +1 -1
- package/dist/server/piWebStatusCache.js +19 -6
- package/dist/server/piWebStatusCache.js.map +1 -1
- package/dist/server/realtime/sessionEventHub.js +34 -7
- package/dist/server/realtime/sessionEventHub.js.map +1 -1
- package/dist/server/sessiond/sessionDaemonStartup.js +49 -0
- package/dist/server/sessiond/sessionDaemonStartup.js.map +1 -0
- package/dist/server/sessiond.js +88 -62
- package/dist/server/sessiond.js.map +1 -1
- package/dist/server/sessions/authProviderOptions.js +30 -32
- package/dist/server/sessions/authProviderOptions.js.map +1 -1
- package/dist/server/sessions/authRoutes.js +14 -4
- package/dist/server/sessions/authRoutes.js.map +1 -1
- package/dist/server/sessions/authService.js +89 -29
- package/dist/server/sessions/authService.js.map +1 -1
- package/dist/server/sessions/builtinCommands.js +1 -1
- package/dist/server/sessions/builtinCommands.js.map +1 -1
- package/dist/server/sessions/oauthLoginFlowService.js +176 -53
- package/dist/server/sessions/oauthLoginFlowService.js.map +1 -1
- package/dist/server/sessions/piSessionManagerGateway.js +22 -21
- package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
- package/dist/server/sessions/piSessionService.js +715 -127
- package/dist/server/sessions/piSessionService.js.map +1 -1
- package/dist/server/sessions/sessionArchiveMigration.js +590 -0
- package/dist/server/sessions/sessionArchiveMigration.js.map +1 -0
- package/dist/server/sessions/sessionArchiveStore.js +58 -26
- package/dist/server/sessions/sessionArchiveStore.js.map +1 -1
- package/dist/server/sessions/sessionCommandService.js +16 -0
- package/dist/server/sessions/sessionCommandService.js.map +1 -1
- package/dist/server/sessions/sessionNameGenerator.js +27 -44
- package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
- package/dist/server/sessions/sessionRoutes.js +65 -3
- package/dist/server/sessions/sessionRoutes.js.map +1 -1
- package/dist/server/sessions/sessionService.js +2 -0
- package/dist/server/sessions/sessionService.js.map +1 -0
- package/dist/server/sessions/spawnSessionTool.js +9 -4
- package/dist/server/sessions/spawnSessionTool.js.map +1 -1
- package/dist/server/sessions/spawnSubsessionTool.js +79 -32
- package/dist/server/sessions/spawnSubsessionTool.js.map +1 -1
- package/dist/server/terminals/terminalService.js +10 -4
- package/dist/server/terminals/terminalService.js.map +1 -1
- package/dist/server/workspaces/fileSuggestions.js +7 -3
- package/dist/server/workspaces/fileSuggestions.js.map +1 -1
- package/dist/sessiond/activeAgentProfile.js +31 -0
- package/dist/sessiond/activeAgentProfile.js.map +1 -0
- package/dist/sessiond/sessionDaemonClient.js +38 -0
- package/dist/sessiond/sessionDaemonClient.js.map +1 -1
- package/dist/shared/activeAgentProfile.js +76 -0
- package/dist/shared/activeAgentProfile.js.map +1 -0
- package/dist/shared/activity.js +0 -15
- package/dist/shared/activity.js.map +1 -1
- package/dist/shared/apiTypes.d.ts +160 -3
- package/dist/shared/apiTypes.js +6 -0
- package/dist/shared/apiTypes.js.map +1 -1
- package/dist/shared/capabilities.js +33 -2
- package/dist/shared/capabilities.js.map +1 -1
- package/dist/shared/federatedRoutes.js +14 -0
- package/dist/shared/federatedRoutes.js.map +1 -1
- package/dist/shared/piWebStatusParsing.js +26 -8
- package/dist/shared/piWebStatusParsing.js.map +1 -1
- package/dist/shared/thinkingLevels.d.ts +1 -1
- package/dist/shared/thinkingLevels.js +1 -1
- package/dist/shared/thinkingLevels.js.map +1 -1
- package/docs/config.md +75 -19
- package/docs/plugins.md +46 -18
- package/package.json +36 -32
- package/dist/client/assets/CodeViewer-CQU9mJ74.js +0 -4
- package/dist/client/assets/TerminalPanel-DtfVBsqI.js +0 -126
- package/dist/client/assets/UnifiedDiffViewer-BZQQK99S.js +0 -34
- package/dist/client/assets/index-CbE7df66.js +0 -2742
- package/dist/client/assets/vendor-editor-core-C7aWiQy0.js +0 -12
- package/dist/client/assets/vendor-editor-languages-EW34FfVy.js +0 -26
- package/dist/client/assets/vendor-editor-legacy-B4QLsWF8.js +0 -1
- package/dist/client/assets/vendor-terminal-DDGTF8rc.css +0 -1
- package/dist/client/assets/vendor-terminal-DjQ08hXu.js +0 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { parseActiveAgentProfileDescriptor } from "./activeAgentProfile.js";
|
|
2
|
+
import { parseKnownPiWebCapabilities } from "./capabilities.js";
|
|
2
3
|
export function parsePiWebVersionResponse(value) {
|
|
3
4
|
if (!isRecord(value))
|
|
4
5
|
return undefined;
|
|
@@ -13,6 +14,21 @@ export function parsePiWebVersionResponse(value) {
|
|
|
13
14
|
return undefined;
|
|
14
15
|
return { packageName, generatedAt, components: { web, sessiond } };
|
|
15
16
|
}
|
|
17
|
+
export function parsePiWebRuntimeResponse(value) {
|
|
18
|
+
if (!isRecord(value))
|
|
19
|
+
return undefined;
|
|
20
|
+
const packageName = value["packageName"];
|
|
21
|
+
const generatedAt = value["generatedAt"];
|
|
22
|
+
const components = value["components"];
|
|
23
|
+
const capabilities = parseKnownPiWebCapabilities(value["capabilities"]);
|
|
24
|
+
if (typeof packageName !== "string" || packageName === "" || typeof generatedAt !== "string" || generatedAt === "" || !isRecord(components) || capabilities === undefined)
|
|
25
|
+
return undefined;
|
|
26
|
+
const web = parsePiWebRuntimeComponent(components["web"]);
|
|
27
|
+
const sessiond = parsePiWebRuntimeComponent(components["sessiond"]);
|
|
28
|
+
if (web === undefined || sessiond === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
return { packageName, generatedAt, components: { web, sessiond }, capabilities };
|
|
31
|
+
}
|
|
16
32
|
export function parsePiWebRuntimeComponent(value) {
|
|
17
33
|
if (!isRecord(value))
|
|
18
34
|
return undefined;
|
|
@@ -20,18 +36,23 @@ export function parsePiWebRuntimeComponent(value) {
|
|
|
20
36
|
const label = value["label"];
|
|
21
37
|
const runtimeVersion = value["runtimeVersion"];
|
|
22
38
|
const available = value["available"];
|
|
23
|
-
const capabilities =
|
|
39
|
+
const capabilities = parseKnownPiWebCapabilities(value["capabilities"]);
|
|
40
|
+
const activeAgentProfileValue = value["activeAgentProfile"];
|
|
41
|
+
const activeAgentProfile = activeAgentProfileValue === undefined ? undefined : parseActiveAgentProfileDescriptor(activeAgentProfileValue);
|
|
24
42
|
const error = value["error"];
|
|
25
43
|
if (component !== "web" && component !== "sessiond")
|
|
26
44
|
return undefined;
|
|
27
45
|
if (typeof label !== "string" || label === "" || typeof available !== "boolean" || capabilities === undefined)
|
|
28
46
|
return undefined;
|
|
47
|
+
if (activeAgentProfileValue !== undefined && (component !== "sessiond" || activeAgentProfile === undefined))
|
|
48
|
+
return undefined;
|
|
29
49
|
return {
|
|
30
50
|
component,
|
|
31
51
|
label,
|
|
32
52
|
...(typeof runtimeVersion === "string" ? { runtimeVersion } : {}),
|
|
33
53
|
available,
|
|
34
54
|
capabilities,
|
|
55
|
+
...(activeAgentProfile === undefined ? {} : { activeAgentProfile }),
|
|
35
56
|
...(typeof error === "string" ? { error } : {}),
|
|
36
57
|
};
|
|
37
58
|
}
|
|
@@ -61,11 +82,6 @@ export function parsePiWebComponentStatus(value) {
|
|
|
61
82
|
...(typeof error === "string" ? { error } : {}),
|
|
62
83
|
};
|
|
63
84
|
}
|
|
64
|
-
function parsePiWebCapabilities(value) {
|
|
65
|
-
if (!Array.isArray(value) || !value.every(isPiWebCapability))
|
|
66
|
-
return undefined;
|
|
67
|
-
return value;
|
|
68
|
-
}
|
|
69
85
|
export function parsePiWebInstallationInfo(value) {
|
|
70
86
|
if (!isRecord(value))
|
|
71
87
|
return undefined;
|
|
@@ -74,7 +90,8 @@ export function parsePiWebInstallationInfo(value) {
|
|
|
74
90
|
const source = value["source"];
|
|
75
91
|
const scope = value["scope"];
|
|
76
92
|
const npmRoot = value["npmRoot"];
|
|
77
|
-
|
|
93
|
+
const dockerMode = value["dockerMode"];
|
|
94
|
+
if (kind !== "pi-package" && kind !== "npm-global" && kind !== "local" && kind !== "docker" && kind !== "unknown")
|
|
78
95
|
return undefined;
|
|
79
96
|
return {
|
|
80
97
|
kind,
|
|
@@ -82,6 +99,7 @@ export function parsePiWebInstallationInfo(value) {
|
|
|
82
99
|
...(typeof source === "string" ? { source } : {}),
|
|
83
100
|
...(scope === "user" || scope === "project" ? { scope } : {}),
|
|
84
101
|
...(typeof npmRoot === "string" ? { npmRoot } : {}),
|
|
102
|
+
...(dockerMode === "runtime" || dockerMode === "dev" ? { dockerMode } : {}),
|
|
85
103
|
};
|
|
86
104
|
}
|
|
87
105
|
function isRecord(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piWebStatusParsing.js","sourceRoot":"","sources":["../../src/shared/piWebStatusParsing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"piWebStatusParsing.js","sourceRoot":"","sources":["../../src/shared/piWebStatusParsing.ts"],"names":[],"mappings":"AACA,OAAO,E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AK,YAAY,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACpI,OAAO;QACL,IAAI;QACJ,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7D,GAAG,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5E,CAAC;AACJ,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"}
|
|
@@ -7,7 +7,7 @@ export type { ThinkingLevel };
|
|
|
7
7
|
* either breaks, update this list and give the new level a label/description
|
|
8
8
|
* where thinking levels are presented.
|
|
9
9
|
*/
|
|
10
|
-
export declare const KNOWN_THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
10
|
+
export declare const KNOWN_THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
11
11
|
export declare function isKnownThinkingLevel(value: string): value is ThinkingLevel;
|
|
12
12
|
export declare function thinkingLevelLabel(level: string | undefined): string;
|
|
13
13
|
export interface ThinkingGauge {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* either breaks, update this list and give the new level a label/description
|
|
6
6
|
* where thinking levels are presented.
|
|
7
7
|
*/
|
|
8
|
-
export const KNOWN_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
8
|
+
export const KNOWN_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
9
9
|
export function isKnownThinkingLevel(value) {
|
|
10
10
|
return KNOWN_THINKING_LEVELS.some((level) => level === value);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinkingLevels.js","sourceRoot":"","sources":["../../src/shared/thinkingLevels.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"thinkingLevels.js","sourceRoot":"","sources":["../../src/shared/thinkingLevels.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAA6C,CAAC;AAE7I,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAyB;IAC1D,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7D,CAAC;AASD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB,EAAE,SAA4B;IACnF,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC;IACvE,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACvD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC"}
|
package/docs/config.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PI WEB configuration reference
|
|
2
2
|
|
|
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, plugin enablement, file-explorer path access, manual upload defaults, upload limits, and session-daemon tools.
|
|
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, plugin enablement, file-explorer path access, manual upload defaults, upload limits, Pi-compatible agent profiles and companion CLIs, and session-daemon tools.
|
|
4
4
|
|
|
5
5
|
This file is the markdown reference for agents and package consumers. The website page is <https://pi-web.dev/config>.
|
|
6
6
|
|
|
@@ -11,10 +11,18 @@ 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,
|
|
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: the Pi-compatible agent profile and companion CLI, session daemon tools, PI WEB plugin enablement, 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. Remote servers that do not advertise selected-machine settings support report those settings as unavailable instead of silently falling back to the gateway.
|
|
15
|
+
|
|
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 only enables or disables discovered PI WEB browser plugins on the machine whose config you are editing; it does not install, remove, or update Pi packages.
|
|
15
17
|
|
|
16
18
|
If you installed services with a custom config path, rerun `pi-web install --config /path/to/config.json` after changing that path or after upgrading from a version that only applied the custom path to the web service. This regenerates service files so the web/API and session daemon use the same `PI_WEB_CONFIG`.
|
|
17
19
|
|
|
20
|
+
## Reverse-proxy deployment paths
|
|
21
|
+
|
|
22
|
+
The deployment path is not a PI WEB config-file key or environment setting. The published client is portable: one build works at `/` and at canonical trailing-slash prefixes such as `/ai/` or `/test/ai/`.
|
|
23
|
+
|
|
24
|
+
For a nested deployment, redirect the slashless prefix to the trailing-slash URL, strip the prefix before forwarding to PI WEB, and proxy authenticated HTTP and WebSocket traffic through the same location. Relative browser and PWA URLs then stay within that prefix. See the [reverse proxy installation guide](https://pi-web.dev/install#reverse-proxy-prefix) for a complete Nginx example.
|
|
25
|
+
|
|
18
26
|
## Precedence and reloads
|
|
19
27
|
|
|
20
28
|
Machine-global runtime values are resolved as:
|
|
@@ -25,16 +33,17 @@ defaults → global config file → environment overrides
|
|
|
25
33
|
|
|
26
34
|
Supported project-local settings are then applied for that project's workspaces. For upload defaults, `<project>/.pi-web/config.json` overrides the global value.
|
|
27
35
|
|
|
28
|
-
Environment overrides include `PI_WEB_HOST`, `PI_WEB_PORT` / `PORT`, `PI_WEB_ALLOWED_HOSTS`, `PI_WEB_MAX_UPLOAD_BYTES`, `PI_WEB_SPAWN_SESSIONS`, and `PI_WEB_SUBSESSIONS`.
|
|
36
|
+
Environment overrides include `PI_WEB_HOST`, `PI_WEB_PORT` / `PORT`, `PI_WEB_ALLOWED_HOSTS`, `PI_WEB_MAX_UPLOAD_BYTES`, `PI_WEB_AGENT_COMMAND`, `PI_WEB_AGENT_DIR`, `PI_WEB_AGENT_SESSION_DIR`, `PI_CODING_AGENT_DIR` / `PI_CODING_AGENT_SESSION_DIR` for Pi compatibility, `PI_WEB_SPAWN_SESSIONS`, and `PI_WEB_SUBSESSIONS`.
|
|
29
37
|
|
|
30
38
|
Process restarts depend on the key:
|
|
31
39
|
|
|
32
|
-
- `host` / `port`: restart the web/API service or process.
|
|
33
|
-
- `maxUploadBytes`: restart both the web/API process and the session daemon.
|
|
34
|
-
- `spawnSessions` / `subsessions`: restart the session daemon.
|
|
40
|
+
- `host` / `port`: restart the gateway web/API service or process.
|
|
41
|
+
- `maxUploadBytes`: restart both the web/API process and the session daemon on that machine.
|
|
42
|
+
- `agent.command` / `agent.dir` / `spawnSessions` / `subsessions`: restart the session daemon on that machine.
|
|
35
43
|
- `pathAccess`: applies on the next request; existing file views may need a browser refresh.
|
|
36
44
|
- `uploads.defaultFolder`: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.
|
|
37
|
-
- `plugins`: reload the browser tab after changing plugin enablement.
|
|
45
|
+
- `plugins`: reload the browser tab after changing PI WEB plugin enablement.
|
|
46
|
+
- 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 Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files as supported by Pi. Reload the browser page separately for PI WEB browser plugin changes. A routine session daemon restart is not required.
|
|
38
47
|
- `shortcuts`: saved settings apply in the browser after config refresh/save.
|
|
39
48
|
|
|
40
49
|
## Global config example
|
|
@@ -50,6 +59,10 @@ Process restarts depend on the key:
|
|
|
50
59
|
"defaultFolder": ".pi-web/uploads"
|
|
51
60
|
},
|
|
52
61
|
"maxUploadBytes": 67108864,
|
|
62
|
+
"agent": {
|
|
63
|
+
"command": "pi",
|
|
64
|
+
"dir": "~/agent-profiles/research"
|
|
65
|
+
},
|
|
53
66
|
"spawnSessions": true,
|
|
54
67
|
"subsessions": false,
|
|
55
68
|
"plugins": {
|
|
@@ -88,7 +101,7 @@ Plugins may own separate project files, such as `.pi-web/tasks.json` for the bui
|
|
|
88
101
|
|
|
89
102
|
## Configuration matrix
|
|
90
103
|
|
|
91
|
-
Rows with JSON key `—` are runtime-only environment variables, not config-file keys.
|
|
104
|
+
Rows with JSON key `—` are runtime-only environment variables, not config-file keys. `Global` means machine-global. In Settings, selected-machine-safe global keys (`pathAccess`, `uploads`, `maxUploadBytes`, `agent`, `spawnSessions`, `subsessions`, and `plugins`) are edited for the selected machine; gateway host/port/allowed-hosts, keyboard shortcuts, and machine registry/tokens stay local.
|
|
92
105
|
|
|
93
106
|
| Config | JSON key | Env var | Scope | Project-local behavior | Applies / restart |
|
|
94
107
|
| --- | --- | --- | --- | --- | --- |
|
|
@@ -98,27 +111,35 @@ Rows with JSON key `—` are runtime-only environment variables, not config-file
|
|
|
98
111
|
| Dev-server allowed hosts | `allowedHosts` | `PI_WEB_ALLOWED_HOSTS` | Global | Not supported locally | Restart dev web/UI |
|
|
99
112
|
| External filesystem roots | `pathAccess.allowedPaths` | — | Global + project | **Merges**: global roots first, then project roots; duplicates removed | Next file request; refresh existing views if needed |
|
|
100
113
|
| Manual file upload default folder | `uploads.defaultFolder` | — | Global + project | **Overrides**: project value wins for workspaces in that project; otherwise global/default applies | New Upload dialogs and direct drag/drop batches after config/workspace refresh |
|
|
101
|
-
| Upload/body limit | `maxUploadBytes` | `PI_WEB_MAX_UPLOAD_BYTES` | Global | Not supported locally | Restart web/API and session daemon |
|
|
102
|
-
|
|
|
103
|
-
|
|
|
114
|
+
| Upload/body limit | `maxUploadBytes` | `PI_WEB_MAX_UPLOAD_BYTES` | Global | Not supported locally | Restart web/API and session daemon on that machine |
|
|
115
|
+
| Companion CLI command | `agent.command` | `PI_WEB_AGENT_COMMAND` | Global/session daemon | Not supported locally | Restart session daemon on that machine; affects doctor/status/update checks |
|
|
116
|
+
| Agent profile state directory | `agent.dir` | `PI_WEB_AGENT_DIR` (`PI_CODING_AGENT_DIR` for Pi compatibility) | Global/session daemon | Not supported locally | Restart session daemon on that machine; affects auth, models, settings, sessions, Pi packages, and package-backed plugins |
|
|
117
|
+
| Agent can spawn sessions | `spawnSessions` | `PI_WEB_SPAWN_SESSIONS` | Global/session daemon | Not supported locally | Restart session daemon on that machine |
|
|
118
|
+
| Tracked subsessions (beta) | `subsessions` | `PI_WEB_SUBSESSIONS` | Global/session daemon | Not supported locally; also requires `spawnSessions` | Restart session daemon on that machine |
|
|
104
119
|
| Plugin enablement/settings | `plugins.<id>.enabled`, `plugins.<id>.settings` | — | Global | Not core local config; plugins may read their own project files | Reload browser tab |
|
|
105
120
|
| Keyboard shortcuts | `shortcuts.<actionId>` | — | Global | Not supported locally | Applies after settings save/config refresh |
|
|
106
121
|
| Project config version | `version` | — | Project | Project-local only; must be `1` when present | Next project-config read |
|
|
107
122
|
| **Runtime-only environment variables** | | | | | |
|
|
108
123
|
| Global config file path | — | `PI_WEB_CONFIG` (`XDG_CONFIG_HOME` affects the default path) | Process/env | Selects the global config file; not a project config | Restart services/processes after changing env |
|
|
109
|
-
| Managed data directory | — | `PI_WEB_DATA_DIR` | Process/env | Not supported locally | Restart
|
|
124
|
+
| Managed data directory | — | `PI_WEB_DATA_DIR` | Process/env | Not supported locally | Restart web/API and session daemon |
|
|
110
125
|
| Session daemon socket | — | `PI_WEB_SESSIOND_SOCKET` | Web/API + session daemon env | Not supported locally | Restart daemon and web/API; both must match |
|
|
111
126
|
| Session daemon TCP port | — | `PI_WEB_SESSIOND_PORT` | Session daemon env | Not supported locally | Restart session daemon; set `PI_WEB_SESSIOND_URL` for web/API too |
|
|
112
127
|
| Session daemon TCP host | — | `PI_WEB_SESSIOND_HOST` | Session daemon env | Not supported locally | Restart session daemon |
|
|
113
128
|
| Web-to-daemon URL | — | `PI_WEB_SESSIOND_URL` | Web/API env | Not supported locally | Restart web/API |
|
|
114
129
|
| Projects storage file | — | `PI_WEB_PROJECTS_FILE` | Web/API + session daemon env | Not supported locally | Restart services; advanced state override |
|
|
115
130
|
| Remote machines storage file | — | `PI_WEB_MACHINES_FILE` | Web/API env | Not supported locally | Restart web/API; advanced state override |
|
|
116
|
-
|
|
|
117
|
-
|
|
|
131
|
+
| Agent profile session storage directory | — | `PI_WEB_AGENT_SESSION_DIR` (`PI_CODING_AGENT_SESSION_DIR` for Pi compatibility) | Session daemon env | Not supported locally | Restart session daemon; env-only session storage override |
|
|
132
|
+
| Agent profile state directory | — | `PI_WEB_AGENT_DIR` (`PI_CODING_AGENT_DIR` for Pi compatibility) | Web/API + session daemon env | Not supported locally | Restart services |
|
|
118
133
|
| Skip update checks | — | `PI_WEB_SKIP_VERSION_CHECK`, `PI_WEB_OFFLINE`, `PI_SKIP_VERSION_CHECK`, `PI_OFFLINE` | Web/API env | Not supported locally | Restart web/API after env changes |
|
|
119
134
|
|
|
120
135
|
## Key details
|
|
121
136
|
|
|
137
|
+
### Managed data directory
|
|
138
|
+
|
|
139
|
+
`PI_WEB_DATA_DIR` sets the root for PI WEB-managed runtime state and defaults to `~/.pi-web`. Unless a more specific path override is configured, PI WEB stores its project and machine registries, locally discovered plugins, default session-daemon socket, and session archives beneath this root.
|
|
140
|
+
|
|
141
|
+
This setting does not change the PI WEB config file selected by `PI_WEB_CONFIG` or Pi-owned state such as the active session files selected by `PI_CODING_AGENT_SESSION_DIR`.
|
|
142
|
+
|
|
122
143
|
### External path access
|
|
123
144
|
|
|
124
145
|
`pathAccess.allowedPaths` grants PI WEB's file explorer and absolute `@` path completions access to specific filesystem roots outside the current workspace.
|
|
@@ -133,6 +154,8 @@ Accepted root forms:
|
|
|
133
154
|
|
|
134
155
|
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.
|
|
135
156
|
|
|
157
|
+
In **Settings → General**, external filesystem roots are saved on the selected machine. Gateway host, port, and allowed-hosts fields stay on the gateway config.
|
|
158
|
+
|
|
136
159
|
This is not a sandbox for the underlying Pi Coding Agent or your OS user. It only controls PI WEB UI/API file exposure outside a workspace.
|
|
137
160
|
|
|
138
161
|
### Manual upload defaults
|
|
@@ -156,21 +179,54 @@ The value must be a non-empty workspace-relative folder. PI WEB normalizes repea
|
|
|
156
179
|
|
|
157
180
|
Manual uploads use the workspace file-write path: paths stay workspace-relative, parent folder creation is enabled by default, and overwrite is disabled by default. Direct drag/drop always keeps `overwrite` off; the review dialog lets you explicitly enable overwrite when needed. Browser-owned XHR progress is shown per batch/file, conflicts and errors stay visible in the upload progress UI, and the final file-write response is the source of truth.
|
|
158
181
|
|
|
159
|
-
For machine federation,
|
|
182
|
+
For machine federation, Settings saves the global upload default on the selected machine. Current remote PI WEB servers also return `workspace.effectiveConfig.uploads.defaultFolder` on the existing workspace-list response. Older remote servers can omit that optional field without breaking clients; the Files panel falls back to the global/default upload folder.
|
|
183
|
+
|
|
184
|
+
The per-request size limit is still controlled by `maxUploadBytes` / `PI_WEB_MAX_UPLOAD_BYTES` on the machine serving the upload.
|
|
185
|
+
|
|
186
|
+
### Pi-compatible agent profile and companion CLI
|
|
160
187
|
|
|
161
|
-
|
|
188
|
+
`agent.command` selects the Pi-compatible companion CLI used by `pi-web doctor` and, when it can be generated safely, package-managed update commands. It defaults to `pi`. This setting does **not** replace the embedded runtime: every session continues to use PI WEB's bundled Pi SDK.
|
|
189
|
+
|
|
190
|
+
`agent.dir` selects the Pi-compatible state profile used for auth providers, models, settings, sessions, Pi packages, and Pi-package-backed PI WEB plugin discovery. It defaults to `~/.pi/agent` only for a canonical Pi companion command. The directory must use the data layout supported by the bundled Pi SDK; PI WEB does not load or convert incompatible fork formats, migrate profile data, or repartition PI WEB-managed archives when the profile changes.
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"agent": {
|
|
195
|
+
"command": "pi-lab",
|
|
196
|
+
"dir": "/opt/pi-profiles/lab"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
An alternate command always requires an explicit state directory. The command must be a safe bare executable name such as `pi-lab` or a host-absolute executable path such as `/opt/pi/bin/pi`; relative paths, shell expressions, and launcher strings are rejected. The state directory must be host-absolute or start with `~`. In a federated save, the gateway transports Unix and Windows absolute paths without reinterpreting them, and the target machine validates and returns the persisted profile.
|
|
202
|
+
|
|
203
|
+
Environment variables take precedence over the config file. `PI_WEB_AGENT_COMMAND` selects the companion CLI, `PI_WEB_AGENT_DIR` sets the profile state directory, and `PI_WEB_AGENT_SESSION_DIR` overrides session storage separately from `agent.dir`. The legacy `PI_CODING_AGENT_DIR` and `PI_CODING_AGENT_SESSION_DIR` names apply only to a canonical Pi companion command; PI WEB never derives ambient environment-variable names from an arbitrary command. Use the explicit `PI_WEB_AGENT_*` names for alternate commands. `PI_WEB_AGENT_DIR` is an unconditional override, while a legacy `PI_CODING_AGENT_DIR` override stops applying when Settings selects an alternate command so the command and directory can transition together.
|
|
204
|
+
|
|
205
|
+
The session daemon resolves the persisted desired values plus its environment once at startup. That secret-free active profile stays fixed for the daemon lifetime. **Settings → Session daemon** saves command and directory together as desired configuration and shows whether the profile is active, needs a restart, or cannot be compared. Until the daemon restarts, sessions, Pi package operations, package-backed plugin discovery, status/install detection, and update planning continue to use the daemon-owned active profile; a web/API restart recovers that same active profile instead of applying the newly saved values.
|
|
206
|
+
|
|
207
|
+
If the session daemon cannot report a valid active profile, profile-dependent package and plugin operations report unavailable instead of falling back to independently resolved config. A package-managed update command is shown only when PI WEB can preserve the active profile with a recognized, safe Pi companion CLI; otherwise the command is omitted. Remote profile editing likewise requires advertised support, and the gateway rejects a remote save if the target does not return the requested profile. Restart the session daemon on the selected machine to establish the next active profile.
|
|
162
208
|
|
|
163
209
|
### Session daemon tools
|
|
164
210
|
|
|
165
211
|
`spawnSessions` controls whether agents receive the `spawn_session` tool. It defaults to `true`; set it to `false` if you do not want an agent to start independent PI WEB sessions.
|
|
166
212
|
|
|
167
|
-
`subsessions` is beta and controls whether agents receive the tracked-subsession tools: `spawn_subsession`, `list_subsessions`, `check_subsession`, and `
|
|
213
|
+
`subsessions` is beta and controls whether agents receive the tracked-subsession tools: `spawn_subsession`, `list_subsessions`, `check_subsession`, `read_subsession`, and `yield_to_subsessions`. It defaults to `false` and also requires `spawnSessions` to be enabled.
|
|
214
|
+
|
|
215
|
+
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.
|
|
216
|
+
|
|
217
|
+
At a join point, after finishing its independent work, the parent calls `yield_to_subsessions` alone as the final action in its tool batch. Pi ends a tool batch early only when every result in that batch is terminating. If any tracked child is still working, the action ends the current agent run so the parent becomes idle. If none are working, it does not end the run and clearly reports that there is nothing to wait for.
|
|
168
218
|
|
|
169
|
-
|
|
219
|
+
A completion notice wakes an idle parent or queues behind in-flight work. Each notice lists any other tracked children still working, so the parent can continue work or call `yield_to_subsessions` again at the next join point. Further notices arrive automatically; do not poll. The notice includes the child's final output when it fits. If that output is too long, PI WEB omits it entirely instead of adding a truncated duplicate to the parent's context and directs the parent to retrieve it with `check_subsession`.
|
|
220
|
+
|
|
221
|
+
`list_subsessions`, `check_subsession`, and `read_subsession` never yield or change control flow. They are for deliberate inspection or recovery, not completion polling. While a child works, agent-facing `check_subsession` and `read_subsession` withhold partial output and direct the parent to continue independent work or yield at the join point. Output becomes available when the child stops. Included output and transcripts follow a labeled marker and come last, after PI WEB guidance.
|
|
222
|
+
|
|
223
|
+
In **Settings → Session daemon**, these keys are saved on the selected machine. Restart the session daemon on that machine after changing them.
|
|
170
224
|
|
|
171
225
|
### Plugin config
|
|
172
226
|
|
|
173
|
-
|
|
227
|
+
The `plugins` key is only for PI WEB browser plugin enablement/settings on the machine whose config you are editing. It does not install, remove, or update Pi packages; use **Settings → Pi packages** or Pi's package manager for package operations. In a federated setup, **Settings → PI WEB plugins** and **Settings → Pi packages** both target the currently selected machine, and each panel labels where changes will be saved or run.
|
|
228
|
+
|
|
229
|
+
Plugins are enabled by default. Set `plugins.<id>.enabled` to `false` to remove a plugin from that machine's `/pi-web-plugins/manifest.json` before the browser imports it. Settings lists discovered plugins from the selected machine, including disabled entries exposed by that machine.
|
|
174
230
|
|
|
175
231
|
```json
|
|
176
232
|
{
|
package/docs/plugins.md
CHANGED
|
@@ -13,6 +13,18 @@ Plugins can currently:
|
|
|
13
13
|
|
|
14
14
|
They do **not** run in the session daemon, do not get a server-side hook API, and are not sandboxed.
|
|
15
15
|
|
|
16
|
+
## Pi packages vs PI WEB plugins
|
|
17
|
+
|
|
18
|
+
**Pi packages** are packages managed by Pi (`pi install`, `pi remove`, `pi update`). A Pi package can provide extensions, skills, prompt templates, themes, context/system prompt files, and/or PI WEB browser plugins. Many Pi packages do not include a PI WEB plugin.
|
|
19
|
+
|
|
20
|
+
**PI WEB plugins** are browser-side PI WEB UI modules discovered from bundled, local, dev, and installed Pi-package sources. Enabling or disabling a PI WEB plugin is a PI WEB config task; installing, removing, or updating a Pi package is a Pi package-manager task.
|
|
21
|
+
|
|
22
|
+
Use **Settings → Pi packages** to view configured Pi packages or install/remove/update a package. Enter only the package source, such as `npm:@scope/package`, a git/URL source, or a local path. PI WEB uses Pi's default package location, equivalent to `pi install <source>`, and does not ask for an install location.
|
|
23
|
+
|
|
24
|
+
When machine federation is enabled, **Settings → Pi packages** targets the currently selected machine. The panel labels whether changes will run on the local/gateway machine or on a selected remote PI WEB machine. If an older or unavailable remote PI WEB server does not expose package-management routes, PI WEB reports the package management operation as unsupported or unavailable instead of silently falling back to the gateway.
|
|
25
|
+
|
|
26
|
+
Use **Settings → PI WEB plugins** to enable or disable discovered PI WEB browser plugins before the browser imports them. In a federated setup, this plugin enablement surface targets the currently selected machine and labels where changes are saved. If an older or unavailable remote PI WEB server does not advertise selected-machine settings support, PI WEB reports the plugin settings as unsupported or unavailable instead of silently falling back to the gateway. After installing, removing, or updating a Pi package, type `/reload` in each idle PI WEB session on the target machine to refresh Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files as supported by Pi. Reload the browser page separately for newly discovered or changed PI WEB browser plugins. A routine session daemon restart is not required.
|
|
27
|
+
|
|
16
28
|
## Trust model
|
|
17
29
|
|
|
18
30
|
Plugins run as JavaScript in the browser app. Treat them as trusted code:
|
|
@@ -140,7 +152,7 @@ When [machine federation](https://pi-web.dev/machines) is enabled, PI WEB also l
|
|
|
140
152
|
- remote theme contributions are ignored for now because themes are app-wide;
|
|
141
153
|
- mixed PI WEB versions across federated machines are best-effort and not guaranteed compatible.
|
|
142
154
|
|
|
143
|
-
Remote plugin enablement is controlled by the remote machine's PI WEB plugin config. To edit or disable a remote machine plugin,
|
|
155
|
+
Remote plugin enablement is controlled by the remote machine's PI WEB plugin config. To edit or disable a remote machine plugin, select that machine and use **Settings → PI WEB plugins** when the remote server exposes selected-machine settings, or open that machine directly/update its config file.
|
|
144
156
|
|
|
145
157
|
Plugin package metadata may set `machineSpecific: true` when the plugin's meaning is tied to the selected PI WEB machine:
|
|
146
158
|
|
|
@@ -155,9 +167,11 @@ const url = new URL("./asset.json", import.meta.url);
|
|
|
155
167
|
|
|
156
168
|
If a remote plugin constructs absolute asset URLs, it should use the `pluginId` from `activate()` because PI WEB gives remote plugins a gateway-scoped runtime id. Hard-coded `/pi-web-plugins/<original-id>/...` URLs may point at the gateway instead of the remote machine.
|
|
157
169
|
|
|
158
|
-
## Manage plugins
|
|
170
|
+
## Manage PI WEB plugins
|
|
171
|
+
|
|
172
|
+
Open **Settings → PI WEB plugins** to review discovered bundled, local, dev, and Pi package plugins for the selected PI WEB machine. When the local machine is selected, this is the gateway plugin list; when a remote machine is selected, the list comes from that remote PI WEB server and includes disabled discovered plugins it exposes. PI WEB can disable any discovered selected-machine plugin before the browser imports it. Core app contributions such as the built-in command palette, base workspace tools, and themes are not managed through this plugin list.
|
|
159
173
|
|
|
160
|
-
|
|
174
|
+
This surface is only for PI WEB plugin enablement. To install, remove, or update Pi packages that may provide plugins or other Pi resources, use **Settings → Pi packages**. In a federated setup, both the Pi packages panel and the PI WEB plugins panel target the selected machine; plugin enablement still writes the PI WEB `plugins` config key rather than changing Pi package-manager settings.
|
|
161
175
|
|
|
162
176
|
Plugin preferences are stored under the top-level `plugins` config key in the PI WEB config file:
|
|
163
177
|
|
|
@@ -183,14 +197,16 @@ After changing plugin enablement, reload the PI WEB browser tab. Already-loaded
|
|
|
183
197
|
|
|
184
198
|
PI WEB ships core, discoverable plugins in the main `@jmfederico/pi-web` npm package. No separate `pi install` step is required: update PI WEB, reload the browser tab, and the bundled plugins appear in `/pi-web-plugins/manifest.json`.
|
|
185
199
|
|
|
186
|
-
Built-in plugins can be managed from **Settings →
|
|
200
|
+
Built-in plugins can be managed from **Settings → PI WEB plugins** or with the top-level `plugins` config key.
|
|
187
201
|
|
|
188
202
|
### Updates
|
|
189
203
|
|
|
190
204
|
**Plugin id:** `updates`
|
|
191
|
-
**What it does:** adds a conditional **Updates** workspace tab with PI WEB update, restart, and installed-service guidance.
|
|
205
|
+
**What it does:** adds a conditional **Updates** workspace tab with PI WEB update, restart, and installed-service guidance, plus a **Check for PI WEB Updates** action for the selected machine.
|
|
192
206
|
|
|
193
|
-
|
|
207
|
+
While a browser tab is connected, PI WEB refreshes the selected machine's status every 15 minutes. npm release lookups are cached on that machine for six hours, so the automatic refresh normally contacts npm at most once in that window. Run **Check for PI WEB Updates** from the action palette to bypass both caches and check immediately. Operator settings that skip remote version checks, such as `PI_WEB_OFFLINE`, are still respected.
|
|
208
|
+
|
|
209
|
+
Updates is enabled by default. It declares `machineSpecific: true` so the gateway Updates tab and action only appear for the local machine; while a remote machine is selected, that remote machine's Updates plugin is used if available. To hide it, disable `updates` in **Settings → PI WEB plugins** or set:
|
|
194
210
|
|
|
195
211
|
```json
|
|
196
212
|
{
|
|
@@ -206,7 +222,7 @@ Updates is enabled by default. It declares `machineSpecific: true` so the gatewa
|
|
|
206
222
|
**Config file:** `.pi-web/tasks.json`
|
|
207
223
|
**What it does:** adds a **Tasks** workspace tab for running configured shell commands in dedicated PI WEB terminals.
|
|
208
224
|
|
|
209
|
-
Workspace Tasks is enabled by default. To hide it, disable `workspace-tasks` in **Settings →
|
|
225
|
+
Workspace Tasks is enabled by default. To hide it, disable `workspace-tasks` in **Settings → PI WEB plugins** or set:
|
|
210
226
|
|
|
211
227
|
```json
|
|
212
228
|
{
|
|
@@ -223,11 +239,11 @@ Configure workspace tasks in `.pi-web/tasks.json`:
|
|
|
223
239
|
"version": 1,
|
|
224
240
|
"tasks": [
|
|
225
241
|
{
|
|
226
|
-
"id": "
|
|
227
|
-
"title": "Start
|
|
228
|
-
"group": "
|
|
229
|
-
"description": "Start the local
|
|
230
|
-
"command": "
|
|
242
|
+
"id": "app.start",
|
|
243
|
+
"title": "Start app",
|
|
244
|
+
"group": "Development",
|
|
245
|
+
"description": "Start the local development server.",
|
|
246
|
+
"command": "npm run dev"
|
|
231
247
|
},
|
|
232
248
|
{
|
|
233
249
|
"id": "db.reset",
|
|
@@ -273,7 +289,7 @@ PI WEB builds the gateway `/pi-web-plugins/manifest.json` from these sources:
|
|
|
273
289
|
|
|
274
290
|
Entries may be real directories or symlinks. This is the recommended development workflow.
|
|
275
291
|
|
|
276
|
-
3. Installed Pi packages that expose PI WEB plugin metadata. Pi packages may be user or project scoped.
|
|
292
|
+
3. Installed Pi packages that expose PI WEB plugin metadata. Pi packages may be user or project scoped. Installing/removing/updating Pi packages is done from **Settings → Pi packages** (or Pi's package manager), not from the PI WEB plugin enable/disable list.
|
|
277
293
|
|
|
278
294
|
Remote machines expose their own manifests through the gateway at `/api/machines/<machine-id>/pi-web-plugins/manifest.json`. Those plugin modules are rewritten to gateway-scoped asset URLs and registered under machine-scoped runtime ids so duplicate plugin ids on different machines do not collide.
|
|
279
295
|
|
|
@@ -309,7 +325,7 @@ Rules:
|
|
|
309
325
|
|
|
310
326
|
### Manifest and assets
|
|
311
327
|
|
|
312
|
-
The manifest contains each discovered plugin module:
|
|
328
|
+
The manifest contains each discovered plugin module. Current PI WEB releases emit `module` as a leading application-root reference:
|
|
313
329
|
|
|
314
330
|
```json
|
|
315
331
|
{
|
|
@@ -325,15 +341,25 @@ The manifest contains each discovered plugin module:
|
|
|
325
341
|
}
|
|
326
342
|
```
|
|
327
343
|
|
|
344
|
+
The browser maps leading application-root references into the current application base, so the same manifest works at the origin root or under a reverse-proxy path prefix. Keeping this output format also lets gateways from existing PI WEB releases consume plugins from an upgraded remote machine. For compatibility, federated gateways additionally accept explicit manifest-relative references such as `./my-plugin/pi-web-plugin.js` and legacy plugin-root-relative references such as `nested/pi-web-plugin.js`; all accepted forms are rewritten to deployment-portable, gateway-relative references.
|
|
345
|
+
|
|
328
346
|
`source` describes where the plugin came from (`bundled`, `local`, or the Pi package source). `scope` is `bundled`, `local`, `user`, or `project`. `machineSpecific` controls whether the gateway copy is valid for remote machines or only each selected machine's own copy can appear.
|
|
329
347
|
|
|
330
|
-
|
|
348
|
+
At an origin-root deployment, a plugin's static assets are available under:
|
|
331
349
|
|
|
332
350
|
```text
|
|
333
351
|
/pi-web-plugins/<plugin-id>/<path-inside-plugin-root>
|
|
334
352
|
```
|
|
335
353
|
|
|
336
|
-
|
|
354
|
+
Prefer module-relative asset URLs so they also work for remote machine plugins. For example, a built plugin module can reference an SVG shipped beside it:
|
|
355
|
+
|
|
356
|
+
```js
|
|
357
|
+
const iconUrl = new URL("./assets/icon.svg", import.meta.url);
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
The final installed plugin package must contain `assets/icon.svg` at that path relative to the final built module. PI WEB serves files that already exist in the package; it does not copy a source `public/` directory or apply Vite-style public-directory semantics. Configure the plugin build and package contents to emit or copy the asset into its final module-relative location.
|
|
361
|
+
|
|
362
|
+
PI WEB prevents asset path traversal outside the plugin root. JavaScript, JSON, CSS, HTML, and SVG files get appropriate content types; unknown file types are served as octet-stream.
|
|
337
363
|
|
|
338
364
|
## Plugin module shape
|
|
339
365
|
|
|
@@ -452,6 +478,7 @@ interface PluginRuntimeContext {
|
|
|
452
478
|
openTerminal: (options?: { terminalId?: string }) => void;
|
|
453
479
|
refreshFiles: () => void | Promise<void>;
|
|
454
480
|
refreshGit: () => void | Promise<void>;
|
|
481
|
+
checkForPiWebUpdates?: () => void | Promise<void>;
|
|
455
482
|
startSession: () => void | Promise<void>;
|
|
456
483
|
archiveSession: () => void | Promise<void>;
|
|
457
484
|
stopActiveWork: () => void | Promise<void>;
|
|
@@ -466,6 +493,7 @@ Notes:
|
|
|
466
493
|
- `enabled` is evaluated when the action palette asks for actions.
|
|
467
494
|
- `selectWorkspaceTool()` expects a qualified panel id such as `my-plugin:workspace.info`.
|
|
468
495
|
- `openTerminal()` switches to the built-in terminal panel. Pass `{ terminalId }` to deep-link to a specific terminal.
|
|
496
|
+
- `checkForPiWebUpdates()` forces a fresh update check on the selected machine and refreshes `state.piWebStatus`. It is optional so plugins remain compatible with older PI WEB hosts.
|
|
469
497
|
- Only fields documented here and declared in `plugin-api.d.ts` are stable public plugin API. Anything else is experimental: it may become public API later, change shape, or disappear.
|
|
470
498
|
|
|
471
499
|
### Prompt editor API
|
|
@@ -746,7 +774,7 @@ Labels should use the same helper through a plugin-owned cache because `items()`
|
|
|
746
774
|
const envCache = new Map();
|
|
747
775
|
|
|
748
776
|
function envKey(machine, workspace) {
|
|
749
|
-
return `${machine.id}:${workspace.id}
|
|
777
|
+
return `${machine.id}:${workspace.id}:.env.local`;
|
|
750
778
|
}
|
|
751
779
|
|
|
752
780
|
function loadEnvLabel(context) {
|
|
@@ -756,7 +784,7 @@ function loadEnvLabel(context) {
|
|
|
756
784
|
|
|
757
785
|
const pending = { status: "loading", label: undefined };
|
|
758
786
|
envCache.set(key, pending);
|
|
759
|
-
context.files.readFile("
|
|
787
|
+
context.files.readFile(".env.local")
|
|
760
788
|
.then((file) => {
|
|
761
789
|
pending.status = "ready";
|
|
762
790
|
pending.label = file.content.match(/^DEV_URL=(.+)$/m)?.[1];
|