@jmfederico/pi-web 1.202608.1 → 1.202609.0

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.
Files changed (107) hide show
  1. package/dist/cli.js +220 -108
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/apple-touch-icon-dev.png +0 -0
  4. package/dist/client/assets/{CodeViewer-mEiBZFA5.js → CodeViewer-CGAlg9S8.js} +1 -1
  5. package/dist/client/assets/{TerminalPanel-O9381Eme.js → TerminalPanel-xhJRhOas.js} +1 -1
  6. package/dist/client/assets/{index-uI2AGFUy.js → index-DXQKhn1P.js} +570 -335
  7. package/dist/client/assets/vendor-editor-core-CXO8gGab.js +12 -0
  8. package/dist/client/assets/vendor-editor-languages-CpW4sJsX.js +46 -0
  9. package/dist/client/favicon-dev.svg +8 -0
  10. package/dist/client/index.html +4 -4
  11. package/dist/client/pwa-icon-dev-192.png +0 -0
  12. package/dist/client/pwa-icon-dev-512.png +0 -0
  13. package/dist/config.js +21 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/environment.js +4 -0
  16. package/dist/environment.js.map +1 -0
  17. package/dist/nativeServices/installedServiceDefinitions.js +601 -0
  18. package/dist/nativeServices/installedServiceDefinitions.js.map +1 -0
  19. package/dist/nativeServices/serviceAction.js +174 -0
  20. package/dist/nativeServices/serviceAction.js.map +1 -0
  21. package/dist/nativeServices/serviceDoctor.js +374 -71
  22. package/dist/nativeServices/serviceDoctor.js.map +1 -1
  23. package/dist/{pi-web-plugins → pi-packages}/relays/markdownDocument.js +1 -1
  24. package/dist/pi-packages/relays/package.json +11 -0
  25. package/dist/{pi-web-plugins → pi-packages}/relays/pi-web-plugin.js +1 -1
  26. package/dist/pi-packages/relays/prompts/relay-worktree.md +28 -0
  27. package/dist/pi-packages/relays/prompts/relay.md +45 -0
  28. package/dist/{pi-web-plugins → pi-packages}/relays/relayDiscovery.js +3 -3
  29. package/dist/{pi-web-plugins → pi-packages}/relays/relaysPanelElement.js +2 -2
  30. package/dist/pi-packages/relays/skills/relay/SKILL.md +94 -0
  31. package/dist/pi-packages/relays/skills/relay-runner/SKILL.md +245 -0
  32. package/dist/pi-web-plugins/info/infoInternals.js +15 -0
  33. package/dist/pi-web-plugins/updates/pi-web-plugin.js +44 -34
  34. package/dist/piWebVersionReport.js +63 -10
  35. package/dist/piWebVersionReport.js.map +1 -1
  36. package/dist/server/app.js +19 -3
  37. package/dist/server/app.js.map +1 -1
  38. package/dist/server/configRoutes.js +6 -1
  39. package/dist/server/configRoutes.js.map +1 -1
  40. package/dist/server/deploymentIdentity.js +67 -0
  41. package/dist/server/deploymentIdentity.js.map +1 -0
  42. package/dist/server/deploymentIdentityRoutes.js +22 -0
  43. package/dist/server/deploymentIdentityRoutes.js.map +1 -0
  44. package/dist/server/knownAutoInstallPiPackages.js +30 -0
  45. package/dist/server/knownAutoInstallPiPackages.js.map +1 -0
  46. package/dist/server/machines/machineService.js +1 -0
  47. package/dist/server/machines/machineService.js.map +1 -1
  48. package/dist/server/notices/serverNoticeRoutes.js +34 -0
  49. package/dist/server/notices/serverNoticeRoutes.js.map +1 -0
  50. package/dist/server/notices/serverNoticeService.js +26 -0
  51. package/dist/server/notices/serverNoticeService.js.map +1 -0
  52. package/dist/server/notices/serverNoticeStore.js +78 -0
  53. package/dist/server/notices/serverNoticeStore.js.map +1 -0
  54. package/dist/server/piPackageIdentity.js +25 -0
  55. package/dist/server/piPackageIdentity.js.map +1 -0
  56. package/dist/server/piPackageService.js +69 -8
  57. package/dist/server/piPackageService.js.map +1 -1
  58. package/dist/server/piWebStatus.js +14 -3
  59. package/dist/server/piWebStatus.js.map +1 -1
  60. package/dist/server/projectTrustRoutes.js +80 -0
  61. package/dist/server/projectTrustRoutes.js.map +1 -0
  62. package/dist/server/projects/projectService.js +3 -1
  63. package/dist/server/projects/projectService.js.map +1 -1
  64. package/dist/server/sessiond/autoInstallPiPackages.js +63 -0
  65. package/dist/server/sessiond/autoInstallPiPackages.js.map +1 -0
  66. package/dist/server/sessiond/sessionProxyRoutes.js +2 -0
  67. package/dist/server/sessiond/sessionProxyRoutes.js.map +1 -1
  68. package/dist/server/sessiond/sessionServiceDependencies.js +1 -0
  69. package/dist/server/sessiond/sessionServiceDependencies.js.map +1 -1
  70. package/dist/server/sessiond.js +36 -5
  71. package/dist/server/sessiond.js.map +1 -1
  72. package/dist/server/sessions/attachmentService.js +1 -5
  73. package/dist/server/sessions/attachmentService.js.map +1 -1
  74. package/dist/server/sessions/piSessionManagerGateway.js +171 -1
  75. package/dist/server/sessions/piSessionManagerGateway.js.map +1 -1
  76. package/dist/server/sessions/piSessionService.js +535 -20
  77. package/dist/server/sessions/piSessionService.js.map +1 -1
  78. package/dist/server/sessions/sessionModelScope.js +160 -0
  79. package/dist/server/sessions/sessionModelScope.js.map +1 -0
  80. package/dist/server/sessions/sessionNameGenerator.js +6 -6
  81. package/dist/server/sessions/sessionNameGenerator.js.map +1 -1
  82. package/dist/server/sessions/sessionRoutes.js +41 -0
  83. package/dist/server/sessions/sessionRoutes.js.map +1 -1
  84. package/dist/server/sessions/transcriptBranchCache.js +81 -0
  85. package/dist/server/sessions/transcriptBranchCache.js.map +1 -0
  86. package/dist/server/storage/piPackageDismissalStore.js +78 -0
  87. package/dist/server/storage/piPackageDismissalStore.js.map +1 -0
  88. package/dist/server/terminals/terminalService.js +18 -1
  89. package/dist/server/terminals/terminalService.js.map +1 -1
  90. package/dist/server/workspaces/projectPiWebConfig.js +6 -1
  91. package/dist/server/workspaces/projectPiWebConfig.js.map +1 -1
  92. package/dist/server/workspaces/workspaceRemovalService.js +16 -5
  93. package/dist/server/workspaces/workspaceRemovalService.js.map +1 -1
  94. package/dist/shared/apiTypes.js.map +1 -1
  95. package/dist/shared/federatedRoutes.js +10 -0
  96. package/dist/shared/federatedRoutes.js.map +1 -1
  97. package/dist/shared/piWebStatusParsing.js +4 -0
  98. package/dist/shared/piWebStatusParsing.js.map +1 -1
  99. package/dist/shared/pluginApiTypes.d.ts +2 -0
  100. package/docs/config.md +45 -4
  101. package/docs/plugins.md +25 -11
  102. package/package.json +6 -6
  103. package/dist/client/assets/vendor-editor-core-vUi74DnD.js +0 -12
  104. package/dist/client/assets/vendor-editor-languages-DoaXUodB.js +0 -46
  105. package/dist/pi-web-plugins/relays/package.json +0 -9
  106. /package/dist/{pi-web-plugins → pi-packages}/relays/vendor/README.md +0 -0
  107. /package/dist/{pi-web-plugins → pi-packages}/relays/vendor/marked.esm.js +0 -0
package/docs/plugins.md CHANGED
@@ -22,6 +22,8 @@ Browser entries run in the PI WEB page through browser plugin API v2. Declared s
22
22
 
23
23
  **PI WEB plugins** are packages discovered from bundled, local, dev, and installed Pi-package sources. A plugin can declare a browser `module`, a sessiond `serverModule`, or both. A server entry can participate only in the documented PI WEB plugin lifecycle and workspace-provider contract; it cannot register Pi model providers or arbitrary hooks.
24
24
 
25
+ Pi loads ordinary Pi resources from installed Pi packages and from its user and project resource locations. PI WEB plugin discovery loads only the browser and server entries declared in `piWeb.plugins`; enabling or disabling a PI WEB plugin does not add or remove the package's Pi extensions, skills, prompt templates, themes, or context/system prompt files.
26
+
25
27
  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.
26
28
 
27
29
  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.
@@ -161,7 +163,7 @@ export default {
161
163
 
162
164
  When copying the Info plugin, choose a new plugin id so it does not conflict with the bundled `info` plugin.
163
165
 
164
- The Info panel doubles as an always-available PI WEB status view: it renders the host-provided `context.state.piWebStatus` (versions, installation, release state, machine, and workspace details) without issuing its own requests, and its action copies a plain-text diagnostics summary suitable for bug reports.
166
+ The Info panel doubles as an always-available PI WEB status view: it renders the host-provided `context.state.piWebStatus` (PI WEB and Pi versions, installation, release state, machine, and workspace details) without issuing its own requests, and its action copies a plain-text diagnostics summary suitable for bug reports.
165
167
 
166
168
  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.
167
169
 
@@ -384,23 +386,23 @@ Review task configs before running them, especially in shared projects. Workspac
384
386
  ### Relays
385
387
 
386
388
  **Plugin id:** `relays`
387
- **What it does:** adds a read-only **Relays** workspace tab for browsing the workspace's relays, plus an **Open Workspace Relays** action for the selected workspace that opens the same tab.
389
+ **What it does:** the `@jmfederico/pi-relay` Pi package supplies a tool-agnostic `relay` foundation, the opinionated `relay-runner` software-delivery profile, a human-gated `/relay` preparation prompt, and `/relay-worktree` as its fresh-worktree compatibility alias. Its browser-only `relays` PI WEB plugin adds a read-only **Relays** workspace tab for browsing the workspace's relays, plus an **Open Workspace Relays** action for the selected workspace that opens the same tab.
390
+
391
+ Before dispatch, `/relay` performs bounded repository discovery and creates an incrementally refined four-document draft packet so the user can review the proposed goal and edges in the Relays UI. Draft creation is allowed before approval; only `spawn_session` is gated. The preparer establishes only the first bounded leg, not a roadmap, fixed leg count, or work-package plan, then requires explicit approval against the final drafts. In fresh-worktree mode, it may draft in the preparation checkout and moves the packet into the target worktree before dispatch without leaving a stale copy.
388
392
 
389
- A relay is a directory of markdown notes under `.pi-web/relays/<name>/` in the workspace root — the convention used by the Relay method for chaining agent sessions. The tab lists each relay's documents with `status.md`, `charter.md`, and `log.md` first (in that order), followed by any other files alphabetically, and opens `status.md` by default. Markdown documents render as sanitized HTML; other files render as preformatted text, and binary files have no preview. Truncated documents show a notice, and **Refresh** re-scans the workspace and reloads the open document.
393
+ The runner profile keeps `charter.md` focused on the plain-language goal and scope edges; repository bindings, verification, review, and delivery mechanics live separately in `operations.md`, while project skills and documentation remain the quality authority. Under this profile, Relay completion requires both the chartered outcome and the review, approval, and delivery gates recorded in `operations.md`. Review is evidence gathering, not a finding quota: unsupported hypothetical concerns do not block approval, and re-review carries earlier decisions forward instead of restarting defect hunting. The normal path is an initial whole-work review plus one re-review when needed. A third attempt is an exceptional, justified contingency; a Relay that remains blocked then stops for human intervention instead of continuing the automatic review/remediation loop.
394
+
395
+ Under the shipped `relay-runner` profile, a Relay packet is a directory of markdown notes under `.pi-web/relays/<name>/` in the workspace root. The tool-agnostic base method does not require this storage convention. The tab lists each relay's documents with `status.md`, `charter.md`, `operations.md`, and `log.md` first (in that order), followed by any other files alphabetically, and opens `status.md` by default. Markdown documents render as sanitized HTML; other files render as preformatted text, and binary files have no preview. Truncated documents show a notice, and **Refresh** re-scans the workspace and reloads the open document.
390
396
 
391
397
  Documents in subfolders are listed too. Folders appear as chips in the document strip, and expanding one inserts its files inline right after it — accordion-style, so expanding a folder collapses its siblings on the same level. An expanded folder wraps its chip and documents in a group bubble, so nested entries stay visually contained. Collapsing the folder that holds the open document keeps the selection and highlights the folder instead. Relay trees deeper than five levels, larger than 200 documents, or with more than 50 folders are listed partially, with a notice.
392
398
 
393
399
  With several relays, a picker pre-selects the most recently modified one; a single relay opens directly. A workspace without `.pi-web/relays/` shows an empty state explaining the convention. The tab never creates, edits, or deletes relay files.
394
400
 
395
- Relays is enabled by default. To hide it, disable `relays` in **Settings → PI WEB plugins** or set:
401
+ Relay ships as a standalone Pi package: its source lives at `pi-packages/relays/` and its built copy ships inside `@jmfederico/pi-web` at `dist/pi-packages/relays/`, alongside (but outside) the bundled plugins in `pi-web-plugins/`/`dist/pi-web-plugins/`. PI WEB does not discover it from those plugin directories. Installing `@jmfederico/pi-relay` for the active Pi agent profile lets Pi load its two prompt templates and two skills and lets PI WEB discover its browser plugin, just as it would for any other installed Pi package (see [Discovery and packaging](#discovery-and-packaging) and [Pi packages shipped alongside bundled plugins](#pi-packages-shipped-alongside-bundled-plugins)). After installing or removing the package, use `/reload` in each idle session to refresh Pi's resources and reload the browser page to refresh the plugin catalog.
396
402
 
397
- ```json
398
- {
399
- "plugins": {
400
- "relays": { "enabled": false }
401
- }
402
- }
403
- ```
403
+ Once the package is installed, `plugins.relays.enabled` controls only the Relays browser panel and action. Disabling it and reloading the page hides those PI WEB contributions without removing `/relay`, `/relay-worktree`, or the `relay` and `relay-runner` skills; re-enabling it restores the browser contributions without changing Pi's resources. Because the plugin is browser-only, changing this setting does not require a session-daemon restart.
404
+
405
+ PI WEB keeps the default setup zero-extra-steps: sessiond installs `@jmfederico/pi-relay` automatically for the active agent profile at startup if it is not already configured for that profile. Removing it from **Settings → Pi packages** removes the Pi resources and browser plugin and is remembered per profile (see [Pi packages shipped alongside bundled plugins](#pi-packages-shipped-alongside-bundled-plugins)), so a manual removal is not silently reinstalled later. A user who changes their mind can reinstall it again with one click from the same Settings screen, with no path to type.
404
406
 
405
407
  ## Discovery and packaging
406
408
 
@@ -513,6 +515,18 @@ The final installed plugin package must contain `assets/icon.svg` at that path r
513
515
 
514
516
  PI WEB returns executable JavaScript MIME types for both `.js` and `.mjs`. JSON, CSS, HTML, and SVG receive their corresponding content types; unknown file types are served as octet-stream.
515
517
 
518
+ ## Pi packages shipped alongside bundled plugins
519
+
520
+ `pi-packages/` ships real, independently identified Pi packages inside `@jmfederico/pi-web`'s npm package, built into `dist/pi-packages/<name>/` alongside — but separate from — the bundled PI WEB plugins in `pi-web-plugins/`/`dist/pi-web-plugins/`. A package shipped this way is *not* discovered by PI WEB's bundled/local directory scan; it only becomes an active PI WEB plugin once it is installed as a Pi package for the active agent profile, exactly like an externally published one (see [Discovery and packaging](#discovery-and-packaging)).
521
+
522
+ `pi-packages/relays/` is shaped this way: its `package.json` carries the real package identity `@jmfederico/pi-relay` alongside its `piWeb.plugins` entry, and its `prompts/` and `skills/` directories already follow pi's package conventions. Installing it as a Pi package — with a plain `pi install <path-to-dist/pi-packages/relays>`, through **Settings → Pi packages**' existing free-text install form, or with the one-click **Available packages** install button described below — makes `/relay`, `/relay-worktree`, and the `relay` and `relay-runner` skills available in any `pi` session, and makes the Relays PI WEB plugin (its browser tab and workspace action) available once installed for the active agent profile. Publishing the package to npm remains deferred follow-up work; today, installing it uses its local shipped path.
523
+
524
+ **Automatic install, with opt-out.** For a plain `pi` user this package is only ever installed by explicit `pi install`. For PI WEB, though, the session daemon reconciles a small registry of known auto-installable Pi packages (currently just `@jmfederico/pi-relay`) at startup, for the active agent profile: if a package matching one of these by its own declared `package.json` name is not already configured for that profile, sessiond installs it from its shipped local path automatically, the same way the Settings UI's Install action would. This reconciliation is best-effort — a failure (offline, a read-only agent directory, a package-manager error) is logged and never blocks or crashes session-daemon startup.
525
+
526
+ **Dismissal is remembered per profile.** Removing a known auto-installable package from **Settings → Pi packages** records that removal in a small store under `$PI_WEB_DATA_DIR` (state, not user-editable configuration — alongside `projects.json`/`machines.json`, not in `$PI_WEB_CONFIG`), keyed by the active agent profile directory and the package's declared name. Once dismissed for a profile, startup reconciliation does not reinstall it again for that profile; only an explicit reinstall brings it back.
527
+
528
+ **One-click reinstall.** A profile that dismissed (or never installed) a known auto-installable package can install it again from **Settings → Pi packages** without typing its on-disk path: an **Available packages** section lists every known package not currently configured for the selected target, each with an **Install** button that installs it from its shipped location directly. The section disappears once every known package is configured.
529
+
516
530
  ## Browser module shape and v2 migration
517
531
 
518
532
  TypeScript browser entries should use a type-only import from the published declaration entrypoint. The built JavaScript must not import PI WEB source internals:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmfederico/pi-web",
3
- "version": "1.202608.1",
3
+ "version": "1.202609.0",
4
4
  "description": "Web UI for persistent Pi Coding Agent sessions in real workspaces.",
5
5
  "license": "MIT",
6
6
  "author": "Federico Jaramillo Martinez",
@@ -56,7 +56,7 @@
56
56
  "typecheck": "tsc --noEmit",
57
57
  "typecheck:cached": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/pi-web/typecheck.tsbuildinfo",
58
58
  "knip": "knip",
59
- "lint": "eslint \"src/**/*.ts\" \"extensions/**/*.ts\" \"pi-web-plugins/**/*.ts\" vite.config.ts vitest.config.ts",
59
+ "lint": "eslint \"src/**/*.ts\" \"extensions/**/*.ts\" \"pi-web-plugins/**/*.ts\" \"pi-packages/**/*.ts\" vite.config.ts vitest.config.ts",
60
60
  "test": "vitest run --config vitest.config.ts",
61
61
  "verify": "npm run typecheck && npm run lint && npm run knip && npm test",
62
62
  "verify:staged": "node scripts/verify-staged.mjs",
@@ -103,9 +103,9 @@
103
103
  },
104
104
  "devDependencies": {
105
105
  "@changesets/cli": "^2.31.0",
106
- "@earendil-works/pi-agent-core": "^0.84.1",
107
- "@earendil-works/pi-ai": "^0.84.1",
108
- "@earendil-works/pi-coding-agent": "^0.84.1",
106
+ "@earendil-works/pi-agent-core": "^0.85.1",
107
+ "@earendil-works/pi-ai": "^0.85.1",
108
+ "@earendil-works/pi-coding-agent": "^0.85.1",
109
109
  "@eslint/js": "^10.0.1",
110
110
  "@types/node": "^24.13.3",
111
111
  "@types/ws": "^8.18.1",
@@ -137,7 +137,7 @@
137
137
  "peerDependencies": {
138
138
  "@earendil-works/pi-agent-core": ">=0.84.0",
139
139
  "@earendil-works/pi-ai": ">=0.84.0",
140
- "@earendil-works/pi-coding-agent": ">=0.84.0"
140
+ "@earendil-works/pi-coding-agent": ">=0.84.0 <0.85.0 || >=0.85.1"
141
141
  },
142
142
  "keywords": [
143
143
  "pi-package",