${message.title}${message.severity}
+ ${message.title}${message.severity}
${message.body}
${message.command === undefined ? null : html`${message.command}`}
diff --git a/.changeset/updates-plugin-rename.md b/.changeset/updates-plugin-rename.md new file mode 100644 index 0000000..1ddfd22 --- /dev/null +++ b/.changeset/updates-plugin-rename.md @@ -0,0 +1,5 @@ +--- +"@jmfederico/pi-web": patch +--- + +Rename the built-in Updates plugin id from `pi-web` to `updates` for clearer plugin configuration. diff --git a/README.md b/README.md index 74488f9..212fb36 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ PI WEB keeps its own state intentionally small: PI WEB production installs can load trusted local UI plugins without rebuilding PI WEB. Plugins are browser-side ES modules that can add action-palette actions, workspace panels, and workspace-label metadata. They do not run in the session daemon and are not sandboxed. -The supported package shape is intentionally singular: `piWeb.plugins` entries with explicit `id` and `module`, plus a browser module that exports `{ apiVersion: 1, name, activate }`. The bundled `pi-web-plugins/info` TypeScript source is the canonical minimal real example, `pi-web-plugins/pi-web` demonstrates a dynamic status panel, and built-in [Workspace Tasks](docs/plugins.md#workspace-tasks) adds a workspace tab for running configured shell commands in PI WEB terminals. +The supported package shape is intentionally singular: `piWeb.plugins` entries with explicit `id` and `module`, plus a browser module that exports `{ apiVersion: 1, name, activate }`. The bundled `pi-web-plugins/info` TypeScript source is the canonical minimal real example, `pi-web-plugins/updates` demonstrates a dynamic status panel, and built-in [Workspace Tasks](docs/plugins.md#workspace-tasks) adds a workspace tab for running configured shell commands in PI WEB terminals. A useful prompt for AI agents: diff --git a/docs/plugins.html b/docs/plugins.html index ffe07b3..f618e62 100644 --- a/docs/plugins.html +++ b/docs/plugins.html @@ -162,7 +162,7 @@ After editing, check the manifest endpoint and browser-console failure cases.info plugin.
- The bundled pi-web status plugin demonstrates dynamic visible and badge
+ The bundled updates plugin demonstrates dynamic visible and badge
callbacks for tabs that only appear when the host has status messages or needs extra install visibility.
+ Updates adds a conditional Updates workspace tab with PI WEB update, + restart, and installed-service guidance. It is built into PI WEB and enabled by default. +
+updates{
+ "plugins": {
+ "updates": { "enabled": false }
+ }
+}
+ Workspace Tasks adds a Tasks workspace tab for running configured shell diff --git a/docs/plugins.md b/docs/plugins.md index 74d1d1f..97d5fe8 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -112,7 +112,7 @@ export default { When copying the Info plugin, choose a new plugin id so it does not conflict with the bundled `info` plugin. -PI WEB also ships a `pi-web` status plugin that demonstrates dynamic `visible` and `badge` callbacks for tabs that only appear when the host has status messages or needs extra install visibility. +PI WEB also ships an `updates` plugin that demonstrates dynamic `visible` and `badge` callbacks for tabs that only appear when the host has status messages or needs extra install visibility. ## Local plugin usage @@ -157,6 +157,21 @@ PI WEB ships core, discoverable plugins in the main `@jmfederico/pi-web` npm pac Built-in plugins can be managed from **Settings → Plugins** or with the top-level `plugins` config key. +### Updates + +**Plugin id:** `updates` +**What it does:** adds a conditional **Updates** workspace tab with PI WEB update, restart, and installed-service guidance. + +Updates is enabled by default. To hide it, disable `updates` in **Settings → Plugins** or set: + +```json +{ + "plugins": { + "updates": { "enabled": false } + } +} +``` + ### Workspace Tasks **Plugin id:** `workspace-tasks` diff --git a/pi-web-plugins/pi-web/package.json b/pi-web-plugins/pi-web/package.json deleted file mode 100644 index 136c5cf..0000000 --- a/pi-web-plugins/pi-web/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@pi-web/status-plugin", - "private": true, - "piWeb": { - "plugins": [ - { "id": "pi-web", "module": "pi-web-plugin.js" } - ] - } -} diff --git a/pi-web-plugins/updates/package.json b/pi-web-plugins/updates/package.json new file mode 100644 index 0000000..e53b362 --- /dev/null +++ b/pi-web-plugins/updates/package.json @@ -0,0 +1,9 @@ +{ + "name": "@pi-web/updates-plugin", + "private": true, + "piWeb": { + "plugins": [ + { "id": "updates", "module": "pi-web-plugin.js" } + ] + } +} diff --git a/pi-web-plugins/pi-web/pi-web-plugin.ts b/pi-web-plugins/updates/pi-web-plugin.ts similarity index 71% rename from pi-web-plugins/pi-web/pi-web-plugin.ts rename to pi-web-plugins/updates/pi-web-plugin.ts index 800c276..fda5c17 100644 --- a/pi-web-plugins/pi-web/pi-web-plugin.ts +++ b/pi-web-plugins/updates/pi-web-plugin.ts @@ -19,7 +19,7 @@ function isLocalOrUnknownInstallation(installation: PiWebInstallationInfo | unde return installation === undefined || installation.kind === "local" || installation.kind === "unknown"; } -function shouldShowStatusPanel(state: AppState): boolean { +function shouldShowUpdatesPanel(state: AppState): boolean { const status = statusFor(state); if (messageCount(state) > 0) return true; if (status === undefined) return false; @@ -50,7 +50,7 @@ function renderComponent(html: HtmlTemplateTag, component: PiWebComponentStatus) ? "restart needed" : "current"; return html` -
${command}
@@ -87,7 +87,7 @@ function renderCommands(html: HtmlTemplateTag, status: PiWebStatusResponse): Tem
`;
}
-function renderStatusPanel(html: HtmlTemplateTag, state: AppState): TemplateResult {
+function renderUpdatesPanel(html: HtmlTemplateTag, state: AppState): TemplateResult {
const status = statusFor(state);
if (status === undefined) {
return html`
@@ -99,29 +99,29 @@ function renderStatusPanel(html: HtmlTemplateTag, state: AppState): TemplateResu
const messages = status.messages;
return html`
- No PI WEB update or restart messages.
` : messages.map((message) => html` -