diff --git a/.changeset/global-provider-policy.md b/.changeset/global-provider-policy.md index 7343178..17c6325 100644 --- a/.changeset/global-provider-policy.md +++ b/.changeset/global-provider-policy.md @@ -2,6 +2,6 @@ "@jmfederico/pi-web": patch --- -Require Pi Coding Agent `>=0.81.1 <0.82` and build an immutable provider baseline at session-daemon startup. Globally installed extensions can register both config-form and native providers during startup bootstrap; every later extension registration or unregistration—including global replay, project same-ID replacement, lifecycle callbacks, and `/reload`—is ignored. Non-provider extension features still work, and ignored calls are de-duplicated in session-daemon logs by operation/provider ID without logging provider configuration or credentials or creating session warnings/notifications. +Require Pi Coding Agent `>=0.81.1 <0.82` and build an immutable provider baseline at session-daemon startup. Globally installed Pi extensions can register both config-form and native providers during startup bootstrap; every later Pi extension registration or unregistration—including global replay, project same-ID replacement, lifecycle callbacks, and `/reload`—is ignored. PI WEB browser plugins are a separate browser-only system and are unaffected. Non-provider Pi extension features still work, and ignored calls are de-duplicated in session-daemon logs by operation/provider ID without logging provider configuration or credentials or creating session warnings/notifications. -After updating PI WEB, or after installing, removing, or updating a globally installed extension that registers providers, manually restart `pi-web-sessiond.service` (`systemctl --user restart pi-web-sessiond`). Restarting only the web/API service and running `/reload` do not rebuild the provider baseline. +After updating PI WEB, or after installing, removing, or updating a globally installed Pi extension that registers providers, manually restart `pi-web-sessiond.service` (`systemctl --user restart pi-web-sessiond`). Restarting only the web/API service and running `/reload` do not rebuild the provider baseline. diff --git a/README.md b/README.md index cbde920..0127950 100644 --- a/README.md +++ b/README.md @@ -108,15 +108,13 @@ When a remote machine is selected, Settings tabs label their target. Pi packages Read more: [Fleet and machines guide](https://pi-web.dev/machines) -## Plugins +## PI WEB plugins -PI WEB supports trusted browser-side PI WEB plugins that can add actions, workspace panels, and workspace metadata. +PI WEB supports trusted browser-side plugins that can add actions, workspace panels, and workspace metadata. Use **Settings → PI WEB plugins** to enable or disable them on the selected machine. -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. +Pi packages are a separate Pi package-manager concept. A Pi package may include a PI WEB browser plugin, but installing a package and enabling its browser plugin are different operations. -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. - -Read more: [Plugin API](https://pi-web.dev/plugins) +Read more: [PI WEB plugin guide and API](https://pi-web.dev/plugins) ## Configuration diff --git a/docs/config.html b/docs/config.html index e12f0d8..f814d69 100644 --- a/docs/config.html +++ b/docs/config.html @@ -99,6 +99,7 @@ External path access Manual uploads Agent profile and companion CLI + Pi extension providers Session tools Completion tools @@ -175,7 +176,7 @@
pathAccess: applies on the next request; existing file views may need a browser refresh.uploads.defaultFolder: applies to newly opened Files upload dialogs and new direct drag/drop batches after config/workspace refresh.plugins: reload the browser tab after changing PI WEB plugin enablement./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 for those ordinary resources. If a globally installed extension adds, removes, or changes a provider, manually restart pi-web-sessiond.service; /reload cannot change the startup provider baseline. See Extension provider registrations./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. Reload the browser page separately for PI WEB browser plugin changes. If a global Pi extension adds, removes, or changes a provider, manually restart pi-web-sessiond.service; /reload cannot change the startup provider baseline. See Pi extension provider baseline.shortcuts: saved settings apply in the browser after config refresh/save.PI_WEB_AGENT_DIR (PI_CODING_AGENT_DIR for Pi compatibility)
+ This policy applies to Pi runtime extensions, not PI WEB browser plugins. Pi extensions
+ are runtime modules loaded by the session daemon and can call pi.registerProvider(...);
+ PI WEB plugins are browser-side UI modules and never run in the session daemon.
+
+ PI WEB shares one model runtime across all sessions. When the session daemon starts, before any project
+ resources load, it initializes global Pi extensions from the active agent profile
+ (agent.dir), including extensions supplied by globally configured Pi packages. Provider
+ registrations made by synchronous or awaited asynchronous extension factories during this bootstrap join
+ the shared baseline. PI WEB captures both config-form registrations
+ (pi.registerProvider("id", config)) and native-provider registrations
+ (pi.registerProvider(provider)), alongside Pi built-ins, environment credentials, and
+ providers from the active agent directory's models.json.
+
+ After startup capture, every later Pi extension provider registration, native registration, and
+ unregistration is a no-op, regardless of source or provider ID. This includes global extensions replayed
+ while sessions load, project extensions attempting to add or replace a provider, same-ID replacement or
+ unregistration, lifecycle callbacks such as session_start, and /reload. The
+ captured provider stays unchanged while non-provider Pi extension features continue to load and reload
+ normally.
+
+ Ignored mutations are written to the session-daemon log once per operation and provider ID. The log entry + contains no provider configuration or credentials, and PI WEB does not show a session warning or + notification. This prevents accidental provider, configuration, or credential contamination between + projects; it is not a security boundary because Pi extensions remain trusted daemon code. +
+
+ Configure providers before the daemon starts: use the active agent directory's
+ models.json, or install the Pi extension globally in that agent profile. Project Pi extensions
+ and project-level models.json files cannot add providers to PI WEB's shared baseline.
+
pi-web-sessiond.service
+ (systemctl --user restart pi-web-sessiond). Restarting only the web/API service and running
+ /reload do not rebuild the baseline.
+ spawnSessions
- 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.
+ Pi packages are distribution bundles managed by Pi (pi install,
+ pi remove, pi update). A Pi package can provide Pi 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.
+
+ Pi extensions are runtime modules loaded by the session daemon. They can register Pi + tools, hooks, commands, and model providers. They are not PI WEB plugins.
PI WEB plugins are browser-side 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. + installed Pi-package sources. They cannot register model providers or server-side hooks. Enabling or + disabling a PI WEB plugin is a PI WEB config task; installing, removing, or updating a Pi package is a + separate Pi package-manager task.
Use Settings → Pi packages to view configured Pi packages or install/remove/update a
@@ -156,47 +162,16 @@
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. For these ordinary resources, a routine session daemon restart is not required.
- Extension-provided global provider changes are the exception described below.
-
- PI WEB builds one provider baseline for the lifetime of the session daemon. At daemon startup, before any
- project resources load, it initializes globally installed, agent-dir extensions through Pi's
- session-services factory. Both config-form registrations
- (pi.registerProvider("id", config)) and native-provider registrations
- (pi.registerProvider(provider)) made during that initialization join the shared baseline,
- alongside Pi built-ins, environment credentials, and providers declared in the agent directory's
- models.json.
+ unsupported or unavailable instead of silently falling back to the gateway.
- After startup capture, every extension provider registration, native registration, and unregistration is
- a no-op, regardless of source or provider ID. This includes global extensions replayed while sessions
- load, project extensions adding a provider or replacing a global provider with the same ID, late lifecycle
- calls such as session_start, and /reload. The captured provider remains unchanged,
- while non-provider extension features continue to load and reload normally.
+ After installing, removing, or updating a Pi package, 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. Reload the browser page separately for newly
+ discovered or changed PI WEB browser plugins. A provider-registering Pi extension follows a separate
+ daemon-start policy; see
+ Pi extension provider baseline.
- Ignored mutations are written to the session-daemon log once per operation and provider ID. These entries - contain no provider configuration or credentials, and PI WEB does not show a session warning or - notification. The policy prevents accidental provider, configuration, or credential contamination between - projects; it is not a security boundary, because extensions remain trusted daemon code. -
-
- Configure providers globally before the daemon starts: use the agent directory's
- models.json, or install the extension globally in the agent directory. Project-level
- models.json files do not add providers to PI WEB sessions.
-
pi-web-sessiond.service (systemctl --user restart pi-web-sessiond). Restarting
- only the web/API service and running /reload do not recapture the baseline.
- - 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 + Open Settings → PI WEB plugins to review discovered bundled, local, dev, and + Pi-package-supplied PI WEB 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 command palette, base workspace tools, and themes are not managed through this plugin list.
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
+ provide PI WEB 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.