From 64b2b3270519611874a1168e6427ac5460a5ebf8 Mon Sep 17 00:00:00 2001 From: Federico Jaramillo Martinez Date: Thu, 2 Jul 2026 10:32:57 +0200 Subject: [PATCH] feat: target settings to selected machine --- .changeset/selected-machine-settings.md | 5 + README.md | 8 +- docs/config.html | 49 +- docs/config.md | 30 +- docs/plugins.html | 29 +- docs/plugins.md | 8 +- src/client/src/api/clients.test.ts | 60 +- src/client/src/api/clients.ts | 14 +- .../src/api/federatedRouteContract.test.ts | 5 +- .../src/components/SettingsDialog.test.ts | 583 ++++++++++++++++++ src/client/src/components/SettingsDialog.ts | 331 ++++++++-- .../settings/SettingsGeneralPanel.test.ts | 229 +++++++ .../settings/SettingsGeneralPanel.ts | 281 ++++++--- .../settings/SettingsPluginsPanel.test.ts | 133 ++++ .../settings/SettingsPluginsPanel.ts | 10 +- .../settings/SettingsSessiondPanel.test.ts | 35 ++ .../settings/SettingsSessiondPanel.ts | 16 +- .../settings/settingsConfigDraft.test.ts | 77 ++- .../settings/settingsConfigDraft.ts | 83 ++- .../settingsMachineAccessConfig.test.ts | 86 +++ .../settings/settingsMachineAccessConfig.ts | 18 + .../settings/settingsMachineTarget.test.ts | 60 ++ .../settings/settingsMachineTarget.ts | 64 ++ .../settings/settingsPluginConfig.test.ts | 69 +++ .../settings/settingsPluginConfig.ts | 25 + .../settings/settingsSessiondConfig.test.ts | 64 ++ .../settings/settingsSessiondConfig.ts | 22 + src/server/app.test.ts | 141 +++++ src/server/app.ts | 4 +- src/server/configRoutes.test.ts | 97 ++- src/server/configRoutes.ts | 114 +++- src/server/machines/machineProxyRoutes.ts | 64 +- src/server/piWebStatus.test.ts | 7 +- src/shared/apiTypes.ts | 1 + src/shared/capabilities.test.ts | 10 +- src/shared/capabilities.ts | 2 + src/shared/federatedRoutes.ts | 3 + src/shared/piWebStatusParsing.test.ts | 10 +- 38 files changed, 2633 insertions(+), 214 deletions(-) create mode 100644 .changeset/selected-machine-settings.md create mode 100644 src/client/src/components/SettingsDialog.test.ts create mode 100644 src/client/src/components/settings/SettingsGeneralPanel.test.ts create mode 100644 src/client/src/components/settings/SettingsPluginsPanel.test.ts create mode 100644 src/client/src/components/settings/SettingsSessiondPanel.test.ts create mode 100644 src/client/src/components/settings/settingsMachineAccessConfig.test.ts create mode 100644 src/client/src/components/settings/settingsMachineAccessConfig.ts create mode 100644 src/client/src/components/settings/settingsMachineTarget.test.ts create mode 100644 src/client/src/components/settings/settingsMachineTarget.ts create mode 100644 src/client/src/components/settings/settingsPluginConfig.test.ts create mode 100644 src/client/src/components/settings/settingsPluginConfig.ts create mode 100644 src/client/src/components/settings/settingsSessiondConfig.test.ts create mode 100644 src/client/src/components/settings/settingsSessiondConfig.ts diff --git a/.changeset/selected-machine-settings.md b/.changeset/selected-machine-settings.md new file mode 100644 index 0000000..0c8161b --- /dev/null +++ b/.changeset/selected-machine-settings.md @@ -0,0 +1,5 @@ +--- +"@jmfederico/pi-web": patch +--- + +Make Settings edit machine-scoped PI WEB config on the selected machine for session daemon tools, plugin enablement, external path access, and upload defaults while keeping gateway/browser-only settings local, and show those forms as unavailable when a remote machine does not advertise support. diff --git a/README.md b/README.md index 26bf2cb..fbbc619 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,9 @@ Read more: [Remote-first development](https://pi-web.dev/remote-first) ## Machines and fleets -PI WEB can register other PI WEB runtimes as remote machines. One browser-facing PI WEB instance can proxy projects, files, git state, sessions, terminals, activity, and Pi package management from trusted remote machines. +PI WEB can register other PI WEB runtimes as remote machines. One browser-facing PI WEB instance can proxy projects, files, git state, sessions, terminals, activity, Pi package management, and selected-machine settings from trusted remote machines. -When a remote machine is selected, **Settings → Pi packages** installs, removes, and updates packages on that selected machine. Other Settings sections such as PI WEB plugin enablement and gateway configuration stay gateway-local unless they say otherwise. +When a remote machine is selected, Settings tabs label their target. Pi packages, PI WEB plugin enablement, session daemon toggles, external file access, and upload defaults target the selected machine. Gateway/server settings such as host, port, allowed hosts, registered machines/tokens, and keyboard shortcuts stay local to the gateway/browser. Read more: [Fleet and machines guide](https://pi-web.dev/machines) @@ -107,7 +107,7 @@ Read more: [Fleet and machines guide](https://pi-web.dev/machines) PI WEB supports trusted browser-side PI WEB plugins that can add actions, workspace panels, and workspace metadata. -Pi packages are managed separately through Pi's package manager or **Settings → Pi packages**. In a federated setup, the Pi packages panel targets the selected machine and labels where installs, updates, or removals will run. Use **Settings → PI WEB plugins** only to enable or disable discovered browser plugins for the gateway you opened. +Pi packages are managed separately through Pi's package manager or **Settings → Pi packages**. In a federated setup, the Pi packages panel targets the selected machine and labels where installs, updates, or removals will run. Use **Settings → PI WEB plugins** to enable or disable discovered browser plugins on the selected machine. After installing, updating, or removing a Pi package, type `/reload` in each idle PI WEB session on that machine to refresh Pi runtime resources such as extensions, skills, prompt templates, themes, and context/system prompt files. Reload the browser page separately for newly discovered or changed PI WEB plugins. @@ -128,7 +128,7 @@ Project-local PI WEB config lives at: /.pi-web/config.json ``` -Common configuration includes host/port, path access, uploads, PI WEB plugin enablement, shortcuts, and session daemon options. +Common configuration includes host/port, path access, uploads, PI WEB plugin enablement, shortcuts, and session daemon options. In Settings, machine-affecting config targets the selected machine; gateway host/port/allowed-hosts, remote machine registration, tokens, and keyboard shortcuts stay local. Read more: [Configuration reference](https://pi-web.dev/config) diff --git a/docs/config.html b/docs/config.html index 059579b..81a6443 100644 --- a/docs/config.html +++ b/docs/config.html @@ -110,15 +110,20 @@
  • Project config: <project>/.pi-web/config.json for commit-able project settings.
  • - Each PI WEB machine has its own config. When using Fleet/machine federation, edit a remote machine's - config by opening that machine directly or changing files on that machine. + 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, 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.

    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 for the gateway you opened. + 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.

    If you installed services with a custom config path, rerun @@ -144,9 +149,9 @@ and PI_WEB_SUBSESSIONS.