@hachej/boring-workspace 0.1.40 → 0.1.42

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 (33) hide show
  1. package/README.md +26 -261
  2. package/dist/{FileTree-DNIzusWa.js → FileTree-CVsvICGP.js} +1 -1
  3. package/dist/MarkdownEditor-BvaGmzWP.js +582 -0
  4. package/dist/{WorkspaceLoadingState-EratTJfG.js → WorkspaceLoadingState-yp4vNmrT.js} +21 -22
  5. package/dist/{WorkspaceProvider-uuxyAx3i.js → WorkspaceProvider-DkZAxsYo.js} +2902 -2741
  6. package/dist/app-front.d.ts +5 -0
  7. package/dist/app-front.js +221 -217
  8. package/dist/app-server.d.ts +2 -2
  9. package/dist/app-server.js +23 -5
  10. package/dist/{createInMemoryBridge-DSjZ9efK.d.ts → createInMemoryBridge-siFWq_R_.d.ts} +8 -0
  11. package/dist/plugin.d.ts +4 -2
  12. package/dist/server.d.ts +3 -3
  13. package/dist/server.js +23 -5
  14. package/dist/shared.d.ts +1 -1
  15. package/dist/{surface-obE7YwJk.d.ts → surface-DmIalUmP.d.ts} +2 -0
  16. package/dist/testing.d.ts +2 -0
  17. package/dist/testing.js +1 -1
  18. package/dist/workspace.css +112 -16
  19. package/dist/workspace.d.ts +8 -2
  20. package/dist/workspace.js +5 -5
  21. package/docs/INTERFACES.md +1 -1
  22. package/docs/PLUGIN_STRUCTURE.md +3 -3
  23. package/docs/PLUGIN_SYSTEM.md +46 -4
  24. package/docs/README.md +85 -22
  25. package/package.json +4 -4
  26. package/dist/MarkdownEditor-DhVfKSAq.js +0 -549
  27. /package/docs/plans/{ASK_USER_QUESTIONS_PLUGIN_SPEC.md → archive/ASK_USER_QUESTIONS_PLUGIN_SPEC.md} +0 -0
  28. /package/docs/plans/{FULL_PAGE_PANEL_ROUTE_SPEC.md → archive/FULL_PAGE_PANEL_ROUTE_SPEC.md} +0 -0
  29. /package/docs/plans/{GENERIC_EXPLORER_PLUGIN_PLAN.md → archive/GENERIC_EXPLORER_PLUGIN_PLAN.md} +0 -0
  30. /package/docs/plans/{PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md → archive/PANE_TO_AGENT_CHAT_ACTIONS_SPEC.md} +0 -0
  31. /package/docs/plans/{PLUGIN_OUTPUTS_ISOLATION_PLAN.md → archive/PLUGIN_OUTPUTS_ISOLATION_PLAN.md} +0 -0
  32. /package/docs/plans/{README.md → archive/README.md} +0 -0
  33. /package/docs/plans/{UI_BRIDGE_OWNERSHIP_REFACTOR.md → archive/UI_BRIDGE_OWNERSHIP_REFACTOR.md} +0 -0
package/docs/README.md CHANGED
@@ -1,24 +1,87 @@
1
1
  # Workspace Docs
2
2
 
3
- Current package docs live here. Active ownership plans stay in `docs/plans/`.
4
- Older implementation plans live in `docs/plans/archive/`.
5
-
6
- ## Current References
7
-
8
- - `PLUGIN_SYSTEM.md` - current normative spec for the plugin / agent layer:
9
- package manifest fields, public API for front + server authoring,
10
- hot-reload coverage table, prompt-location guidance, and key algorithms.
11
- Code cites it as `Per PLUGIN_SYSTEM.md §X`.
12
- - `PLUGIN_STRUCTURE.md` - quick layout guide for generated/runtime plugins vs
13
- app/internal publishable package plugins.
14
- - `INTERFACES.md` - package boundaries and public abstractions.
15
- - `plans/PLUGIN_OUTPUTS_ISOLATION_PLAN.md` - latest plugin ownership plan.
16
- - `plans/UI_BRIDGE_OWNERSHIP_REFACTOR.md` - UI bridge ownership decision.
17
- - `plans/archive/` - superseded implementation plans.
18
-
19
- ## Rules
20
-
21
- - Keep root package markdown to `README.md` and `CHANGELOG.md`.
22
- - Prefer short current-reference docs over long status reports.
23
- - Move old plans into `plans/archive/` instead of keeping them beside active
24
- ownership plans.
3
+ `@hachej/boring-workspace` is the workspace UI, layout, plugin, and bridge layer
4
+ for boring-ui apps. It composes chat, files, catalogs, editors, and app-specific
5
+ panes into an IDE-style workbench. The app shell owns auth, routing, persistence,
6
+ and the concrete chat component; the workspace owns the layout runtime, the
7
+ plugin registries, and the typed agent-to-browser bridge.
8
+
9
+ This folder holds the current normative docs. Read this index first, then jump to
10
+ the doc that matches your task.
11
+
12
+ ## Architecture at a glance
13
+
14
+ - **Layout runtime** Dockview-based panes (`IdeLayout`, `ChatLayout`,
15
+ `ResponsiveDockviewShell`) mounted by `WorkspaceProvider`. Panels open in the
16
+ center/right/bottom; left-tabs stay docked in the sidebar.
17
+ - **Plugin host** — `WorkspaceProvider` runs `bootstrap(plugins)` to populate the
18
+ panel, command, catalog, and surface-resolver registries. Lazy panel factories
19
+ are auto-wrapped in `React.lazy + Suspense + ErrorBoundary`.
20
+ - **UI bridge** — Agents/servers post `UiCommand` values (`src/shared/ui-bridge.ts`);
21
+ the front-end dispatches them against the workspace runtime over SSE with an
22
+ HTTP poll fallback.
23
+ - **Surface resolvers** Decouple agent "open X" requests from concrete panel
24
+ ids. A `SurfaceOpenRequest { kind, target, meta }` is resolved by plugin
25
+ surface resolvers into panel openings (`src/shared/types/surface.ts`).
26
+ - **Two plugin tiers** — App/internal package plugins (trusted, boot-time, may add
27
+ routes/agent tools/Pi resources) and runtime/generated `.pi/extensions` plugins
28
+ (a.k.a. *external* plugins: hot-reloaded for front/Pi, route-free, and loaded
29
+ only in local/direct-style host runtime contexts — not `vercel-sandbox`). See
30
+ `PLUGIN_SYSTEM.md` §1.1 for the trust model.
31
+
32
+ ## Key abstractions
33
+
34
+ | Abstraction | Where | What it is |
35
+ | --- | --- | --- |
36
+ | `WorkspaceProvider` | `src/front/provider` | Root provider; boots plugins, layout, bridge. |
37
+ | `definePlugin()` | `@hachej/boring-workspace/plugin` | Declarative front plugin: panels, leftTabs, commands, catalogs, bindings, providers, surfaceResolvers. |
38
+ | `defineServerPlugin()` | `@hachej/boring-workspace/server` | Trusted boot-time server plugin: routes, agent tools, system prompt, Pi packages, provisioning. |
39
+ | `PaneProps<T>` | `src/shared/types/panel.ts` | Props every panel/left-tab component receives (`params`, `api`, `containerApi`). |
40
+ | `UiCommand` / `UiBridge` | `src/shared/ui-bridge.ts` | Typed agent→browser command contract. |
41
+ | `SurfaceOpenRequest` | `src/shared/types/surface.ts` | Domain open request resolved to a panel. |
42
+ | `BoringPluginAssetManager` | `src/server/agentPlugins` | Scans plugin dirs, hashes signatures, emits load/unload/error events, backs `/api/v1/agent-plugins`. |
43
+
44
+ ## Architectural decisions
45
+
46
+ - **App shell owns auth/routing/persistence/chat; workspace owns chrome.** Keeps
47
+ the workspace package reusable and the chat component injected, not hardcoded.
48
+ - **Front/shared workspace code does not value-import `@hachej/boring-agent`.** The
49
+ dependency is inverted via the injected `chatPanel`, so the workbench builds and
50
+ ships without the agent package. Only `src/app/*` composition may import
51
+ documented agent server APIs.
52
+ - **Agents open domain targets through `openSurface`, not `openPanel`.** Surface
53
+ resolvers map requests to panels so workspace chrome never hardcodes plugin
54
+ panel ids or domain rules. Use `openPanel` only when the caller intentionally
55
+ names a concrete panel.
56
+ - **Plugin data APIs live under the owning plugin.** There is no shared
57
+ `front/data` compatibility layer; e.g. the filesystem client/hooks/events are
58
+ plugin-owned (`src/plugins/filesystemPlugin/front/data`).
59
+ - **Generated runtime plugins stay route-free; server changes are boot-time only.**
60
+ `/reload` refreshes front/Pi resources and tolerates per-plugin failures, but
61
+ does not hot-wire Fastify routes or agent tools. Server-file drift surfaces a
62
+ `requiresRestart` warning.
63
+ - **Chat-first boot.** `WorkspaceAgentFront` mounts immediately while readiness
64
+ warms in the background; workbench surfaces are locally gated by warmup state.
65
+ - **Style isolation.** Workspace owns public `--boring-*` tokens and Tailwind base
66
+ reset; agent consumes them under `[data-boring-agent]`. See
67
+ [`docs/TAILWIND-V4-STYLE-ISOLATION.md`](../../../docs/TAILWIND-V4-STYLE-ISOLATION.md).
68
+
69
+ ## Docs
70
+
71
+ Authoring:
72
+ - [`PLUGIN_STRUCTURE.md`](./PLUGIN_STRUCTURE.md) — quick layout guide for
73
+ generated/runtime plugins vs app/internal publishable package plugins.
74
+ - [`PLUGIN_SYSTEM.md`](./PLUGIN_SYSTEM.md) — normative spec for the plugin/agent
75
+ layer: manifest fields, front + server authoring API, hot-reload coverage,
76
+ and key algorithms. Code and tests cite it as `Per PLUGIN_SYSTEM.md §X`, so its
77
+ section numbering is stable.
78
+
79
+ Boundaries / contracts:
80
+ - [`INTERFACES.md`](./INTERFACES.md) — package boundaries, core contracts, and
81
+ ownership rules across `src/front`, `src/server`, `src/shared`, `src/plugins`,
82
+ and `src/app`.
83
+
84
+ History:
85
+ - [`plans/archive/`](./plans/archive/) — superseded implementation plans and specs
86
+ kept for historical context. Not normative; current behavior is described in the
87
+ docs above and verified against source.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-workspace",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Workspace UI, plugin, and bridge package for composing chat, files, catalogs, editors, and app-specific panes.",
@@ -135,9 +135,9 @@
135
135
  "tailwind-merge": "^2.0.0",
136
136
  "zod": "^3.23.0",
137
137
  "zustand": "^5.0.0",
138
- "@hachej/boring-agent": "0.1.40",
139
- "@hachej/boring-ui-kit": "0.1.40",
140
- "@hachej/boring-ui-plugin-cli": "0.1.40"
138
+ "@hachej/boring-agent": "0.1.42",
139
+ "@hachej/boring-ui-kit": "0.1.42",
140
+ "@hachej/boring-ui-plugin-cli": "0.1.42"
141
141
  },
142
142
  "devDependencies": {
143
143
  "@tailwindcss/postcss": "^4.0.0",