Local UI plugins?
+
+ Ask AI agents to add trusted local UI plugins from ~/.pi-web/plugins without rebuilding or
+ restarting the session daemon.
+
+ Ask AI agents to add trusted local UI plugins from ~/.pi-web/plugins without rebuilding or
+ restarting the session daemon.
+
@@ -254,6 +263,7 @@
diff --git a/docs/install.html b/docs/install.html index 81f1729..2a680b6 100644 --- a/docs/install.html +++ b/docs/install.html @@ -29,6 +29,7 @@Plugin development
++ Plugins are trusted browser-side ES modules. They can add actions, workspace panels, and compact workspace + labels to the Pi Web UI. +
+Plugins can add small, focused UI extensions to Pi Web:
++ Plugins cannot extend the session daemon or add server-side hooks. They run in the browser UI only. +
++ You do not need to hand-code plugins. Give an AI agent a clear goal, the workspace/project facts it + should use, and the Pi Web plugin rules. +
+Build a Pi Web plugin for this project.
+Goal: <describe the UI behavior>.
+Before coding, read the Pi Web plugin docs:
+https://pi-web.dev/plugins.html
+Full API reference:
+https://pi-web.dev/plugins.md
+Create it as a local plugin under ~/.pi-web/plugins/<plugin-id>.
+Use the appropriate extension points from the docs.
+Validate by checking /pi-web-plugins/manifest.json and explain how to reload/debug it.
+Do not modify Pi Web itself.
+ Improve the Pi Web plugin at <path>.
+Before coding, read the Pi Web plugin docs:
+https://pi-web.dev/plugins.html
+Full API reference:
+https://pi-web.dev/plugins.md
+Keep the plugin compatible with the documented v1 API.
+After editing, check the manifest endpoint and browser-console failure cases.
+ + Pi Web ships a real bundled Info plugin. It is the reference example because it uses all + current contribution types: one action, one workspace label, and one workspace panel. +
+pi-web-plugins/info/package.json shows the required metadata shape.pi-web-plugins/info/pi-web-plugin.js shows the browser module shape.
+ Read it on GitHub:
+ pi-web-plugins/info.
+ If you copy it, choose a new plugin id so it does not conflict with the bundled info plugin.
+
+ Local plugins work with the production npm/systemd install. Put each plugin under
+ ~/.pi-web/plugins/<plugin-id>/, or symlink it there while developing. No Pi Web rebuild or
+ session-daemon restart is required.
+
PI_WEB_DATA_DIR is set, use $PI_WEB_DATA_DIR/plugins instead of
+ ~/.pi-web/plugins.
+ $ mkdir -p ~/.pi-web/plugins
+$ ln -s /path/to/plugin-folder ~/.pi-web/plugins/plugin-id
+ + The full plugin reference is available as Markdown for AI agents to read, fetch, and follow: + plugins.md. +
++ If you want to understand the API yourself, ask an agent to read that file and explain the relevant + extension points for the plugin you want. The Markdown reference also marks which context fields are + stable and which Pi Web internals should be avoided unless necessary. +
+~/.pi-web/plugins and symlink it in.$ curl http://127.0.0.1:8504/pi-web-plugins/manifest.json
+ + For all contribution types and package metadata, read the + Plugin API reference. +
++ Plugins are not sandboxed. They run as JavaScript in the browser, can call Pi Web APIs available to the + current session, and can render arbitrary UI. Install only plugins you trust. +
++ Plugins do not run inside the session daemon and do not provide server-side hooks. +
+${workspace.label}
-${workspace.path}
-${workspace.label}
${workspace.path}
-Changed files: ${gitStatus?.files.length ?? 0}
Workspace
-${context.workspace.label}
-${context.workspace.path}
-Workspace
+${context.workspace.label}
+${context.workspace.path}
+Workspace
-${context.workspace.label}
-${context.workspace.path}
-Workspace
+${context.workspace.label}
+${context.workspace.path}
+