@hachej/boring-agent 0.1.41 → 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 +31 -252
  2. package/dist/{agentPluginEvents-CKrZLW3g.d.ts → agentPluginEvents-ZoOjcb5J.d.ts} +21 -0
  3. package/dist/server/index.d.ts +2 -2
  4. package/dist/server/index.js +363 -246
  5. package/dist/shared/index.d.ts +2 -2
  6. package/docs/ACCESSIBILITY.md +11 -13
  7. package/docs/API.md +86 -59
  8. package/docs/CSP.md +10 -9
  9. package/docs/ERROR_CODES.md +1 -1
  10. package/docs/KNOWN_LIMITATIONS.md +3 -3
  11. package/docs/MIGRATION.md +16 -16
  12. package/docs/PERFORMANCE.md +1 -1
  13. package/docs/PLUGINS.md +42 -12
  14. package/docs/README.md +89 -12
  15. package/docs/RISKS-MULTI-TAB.md +1 -1
  16. package/docs/STYLING.md +6 -4
  17. package/docs/UI-SHADCN.md +7 -7
  18. package/docs/runtime-provisioning.md +7 -3
  19. package/docs/runtime.md +68 -13
  20. package/docs/tools.md +37 -14
  21. package/package.json +2 -2
  22. /package/docs/plans/{AGENT_EVAL_FRAMEWORK.md → archive/AGENT_EVAL_FRAMEWORK.md} +0 -0
  23. /package/docs/plans/{agent-package-spec.md → archive/agent-package-spec.md} +0 -0
  24. /package/docs/plans/{harness-followup-capabilities.md → archive/harness-followup-capabilities.md} +0 -0
  25. /package/docs/plans/{harness-tool-ui-capabilities.md → archive/harness-tool-ui-capabilities.md} +0 -0
  26. /package/docs/plans/{pi-followup-history-projection.md → archive/pi-followup-history-projection.md} +0 -0
  27. /package/docs/plans/{pi-tools-migration.md → archive/pi-tools-migration.md} +0 -0
  28. /package/docs/plans/{reviews → archive/reviews}/pi-followup-history-codex-review.md +0 -0
  29. /package/docs/plans/{reviews → archive/reviews}/pi-followup-history-gpt-review.md +0 -0
  30. /package/docs/plans/{reviews → archive/reviews}/pi-followup-history-opus-review.md +0 -0
  31. /package/docs/plans/{reviews → archive/reviews}/pi-followup-history-xai-review.md +0 -0
  32. /package/docs/plans/{vercel-base-snapshot-template-plan.md → archive/vercel-base-snapshot-template-plan.md} +0 -0
  33. /package/docs/plans/{vercel-persistent-sandbox-adapter.md → archive/vercel-persistent-sandbox-adapter.md} +0 -0
@@ -1,5 +1,5 @@
1
- import { W as Workspace, S as Sandbox, F as FileSearch, A as AgentTool } from '../agentPluginEvents-CKrZLW3g.js';
2
- export { a as AgentHarness, C as CommandNotifyPayload, E as Entry, b as ExecOptions, c as ExecResult, I as IsolatedCodeInput, d as IsolatedCodeOutput, J as JSONSchema, R as RunContext, e as SandboxCapability, f as SandboxHandleRecord, g as SandboxHandleStore, h as SendMessageInput, i as Stat, T as TelemetryEvent, j as TelemetrySink, k as ToolExecContext, l as ToolResult, m as WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT, n as WORKSPACE_COMMAND_NOTIFY_EVENT, o as WorkspaceRuntimeContext, p as noopTelemetry, s as safeCapture } from '../agentPluginEvents-CKrZLW3g.js';
1
+ import { W as Workspace, S as Sandbox, F as FileSearch, A as AgentTool } from '../agentPluginEvents-ZoOjcb5J.js';
2
+ export { a as AgentHarness, C as CommandNotifyPayload, E as Entry, b as ExecOptions, c as ExecResult, I as IsolatedCodeInput, d as IsolatedCodeOutput, J as JSONSchema, R as RunContext, e as SandboxCapability, f as SandboxHandleRecord, g as SandboxHandleStore, h as SendMessageInput, i as Stat, T as TelemetryEvent, j as TelemetrySink, k as ToolExecContext, l as ToolResult, m as WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT, n as WORKSPACE_COMMAND_NOTIFY_EVENT, o as WorkspaceRuntimeContext, p as noopTelemetry, s as safeCapture } from '../agentPluginEvents-ZoOjcb5J.js';
3
3
  import { B as BoringChatPart, T as ToolUiMetadata } from '../piChatEvent-Ck1BAE_m.js';
4
4
  export { A as ApiErrorPayload, a as ApiErrorPayloadSchema, b as ApiErrorResponse, c as ApiErrorResponseSchema, d as BoringChatMessage, C as ChatAttachmentPayload, e as ChatError, f as ChatModelSelection, g as ChatSubmitPayload, h as CommandReceipt, E as ERROR_CODES, i as ErrorCode, j as ErrorLogFields, k as ErrorLogFieldsSchema, F as FollowUpPayload, l as FollowUpReceipt, I as InterruptPayload, m as InterruptReceipt, P as PiChatEvent, n as PiChatHeartbeatFrame, o as PiChatSnapshot, p as PiChatStatus, q as PiChatStreamFrame, r as PromptPayload, s as PromptReceipt, Q as QueueClearPayload, t as QueueClearReceipt, u as QueuedUserMessage, S as StopPayload, v as StopReceipt, w as ThinkingLevel, x as extractToolUiMetadata, y as isToolUiMetadata } from '../piChatEvent-Ck1BAE_m.js';
5
5
  export { S as SessionCtx, a as SessionDetail, b as SessionStore, c as SessionSummary } from '../session-BRovhe0D.js';
@@ -1,23 +1,22 @@
1
1
  # Accessibility Audit
2
2
 
3
- This document tracks accessibility status for `@boring/agent` UI surfaces.
3
+ This document tracks accessibility status for `@hachej/boring-agent` UI surfaces.
4
4
 
5
- ## Scope (boring-ui-v2-cop)
5
+ ## Scope
6
6
 
7
- - `packages/agent/src/front/ChatPanel.tsx`
8
- - `packages/agent/src/front-shadcn/ChatPanel.tsx`
9
- - `packages/agent/src/front-shadcn/primitives/*` (chat primitives)
10
- - CI browser check for the default agent app (`packages/agent/app`)
7
+ - `packages/agent/src/front/chat/PiChatPanel.tsx` (the `ChatPanel` export)
8
+ - `packages/agent/src/front/primitives/*` (chat primitives)
9
+ - CI browser check via the `apps/agent-playground` dev frontend
11
10
 
12
11
  ## Current Coverage
13
12
 
14
13
  ### Landmarks and live regions
15
14
 
16
- - ChatPanel roots now expose `role="region"` with
17
- `aria-label="Agent assistant"` in both front variants.
15
+ - The ChatPanel root exposes `role="region"` with
16
+ `aria-label="Agent assistant"`.
18
17
  - Message streams expose `role="log"` and `aria-live="polite"` as
19
18
  `aria-label="Agent conversation"`.
20
- - Error states are announced with `role="alert"` in both variants.
19
+ - Error states are announced with `role="alert"`.
21
20
 
22
21
  ### Interactive control names
23
22
 
@@ -28,8 +27,7 @@ This document tracks accessibility status for `@boring/agent` UI surfaces.
28
27
  ### Automated checks
29
28
 
30
29
  - Unit checks:
31
- - `src/front/__tests__/ChatPanel.test.tsx`
32
- - `src/front-shadcn/__tests__/ChatPanel.test.tsx`
30
+ - `src/front/chat/__tests__/PiChatPanel.test.tsx`
33
31
  - Browser axe check:
34
32
  - `packages/agent/e2e/a11y.spec.ts`
35
33
  - Fails on any **serious** or **critical** violation inside
@@ -44,12 +42,12 @@ This runs in CI automatically through the existing `pnpm e2e` job.
44
42
  story-level axe scan.
45
43
  2. Current automated axe gate targets the shipped chat surface only.
46
44
  Workspace pane-level a11y checks (file tree, editor panes, dock tabs) are
47
- outside this package and need dedicated coverage in `@boring/workspace`.
45
+ outside this package and need dedicated coverage in `@hachej/boring-workspace`.
48
46
  3. Manual screen-reader validation (VoiceOver/NVDA) is still pending.
49
47
 
50
48
  ## Next Increment
51
49
 
52
- 1. Stand up Storybook for `@boring/agent` primitives.
50
+ 1. Stand up Storybook for `@hachej/boring-agent` primitives.
53
51
  2. Enable addon-a11y and add story-level CI checks.
54
52
  3. Extend browser axe checks to `workspace-playground` once pane a11y owners
55
53
  land stable selectors/landmarks.
package/docs/API.md CHANGED
@@ -1,64 +1,91 @@
1
1
  # API
2
2
 
3
- This file documents the package API as it exists today in the v2 scaffold.
4
- Roadmap-only APIs are explicitly marked.
3
+ The package exposes four entry points. Browser code imports the top-level (or
4
+ `/front`) barrel; Node servers import `/server`; both share types from
5
+ `/shared`. The eval toolkit ships under `/eval`.
5
6
 
6
7
  ## Entry Points
7
8
 
8
- `@boring/agent` currently maps to the frontend entry (`dist/front.js`).
9
-
10
- Additional subpath exports:
11
-
12
- - `@boring/agent/front`
13
- - `@boring/agent/shared`
14
- - `@boring/agent/server`
15
-
16
- ## Current Runtime Surface
17
-
18
- ### `@boring/agent/server`
19
-
20
- Currently exported:
21
-
22
- - `createDirectSandbox` from `src/server/sandbox/direct/createDirectSandbox.ts`
23
-
24
- Notes:
25
-
26
- - This is the only runtime mode implementation currently available.
27
- - Local `bwrap` and remote `vercel-sandbox` adapters are planned.
28
-
29
- ### `@boring/agent/shared`
30
-
31
- Current contract files:
32
-
33
- - `harness.ts` — `AgentHarness`, streaming event contracts.
34
- - `tool.ts` — `AgentTool`, `ToolExecContext`, `ToolResult`.
35
- - `workspace.ts` platform-agnostic filesystem contract.
36
- - `sandbox.ts` command execution contract.
37
- - `session.ts` — `SessionStore` and session models.
38
- - `ui-bridge.ts` — `UiBridge`, `UiCommand`, `CommandResult`.
39
- - `catalog.ts`, `file-search.ts`, `message.ts`, `sandbox-handle-store.ts`.
40
-
41
- These files are the source of truth for TypeScript interfaces while higher-level
42
- helpers are still being implemented.
43
-
44
- ## Shipped High-Level API
45
-
46
- - `createAgentApp(config)` — standalone Fastify factory. Zero dependency on `@boring/core`. Powers `npx @boring/agent`. See `packages/agent/src/server/createAgentApp.ts`.
47
- - `ChatPanel` — React component exported from `@boring/agent/front` (and top-level barrel). See `packages/agent/src/front/index.ts:2`.
48
- - `useAgentChat(...)` React hook, same export surface.
49
-
50
- ## Planned High-Level API (Not Implemented Yet)
51
-
52
- - `registerAgentRoutes(app, opts)` new Fastify plugin export for embedding into a core-built server. Lands in agent M4 alongside core's integration milestone. Paths are absolute (`/api/v1/agent/*`); no `prefix` option.
53
-
54
- Track implementation progress in `docs/plans/agent-package-spec.md` and beads.
55
-
56
- ## Deferred HTTP Git Surface (v1.x)
57
-
58
- `/api/v1/git/*` routes are intentionally not part of agent v1.
59
-
60
- - Reason: there is no first-party git UI consumer in agent/workspace v1, so
61
- these routes would be dead code.
62
- - Current behavior: use the `bash` tool for git commands.
63
- - Activation point: when git UI returns (status/diff/badges), add the routes as
64
- thin wrappers over sandbox git execution.
9
+ | Import | Environment | Source barrel |
10
+ |---|---|---|
11
+ | `@hachej/boring-agent` | Browser | `src/front/index.ts` (alias of `/front`) |
12
+ | `@hachej/boring-agent/front` | Browser | `src/front/index.ts` |
13
+ | `@hachej/boring-agent/front/styles.css` | Browser | precompiled CSS |
14
+ | `@hachej/boring-agent/server` | Node | `src/server/index.ts` |
15
+ | `@hachej/boring-agent/shared` | Any | `src/shared/index.ts` |
16
+ | `@hachej/boring-agent/eval` | Node | `src/eval/index.ts` |
17
+
18
+ ## `@hachej/boring-agent/front`
19
+
20
+ The styled chat UI and its building blocks. Key exports:
21
+
22
+ - `ChatPanel` (alias of `PiChatPanel`) — the pane-embeddable chat component.
23
+ Props include `apiBaseUrl`, `sessionId`, and `toolRenderers`. See
24
+ `src/front/chat/PiChatPanel.tsx`.
25
+ - `usePiSessions` and session helpers (`readActiveSessionId`,
26
+ `writeActiveSessionId`, `PiSessionList`, `PiSessionBrowser`).
27
+ - Slash-command surface: `builtinCommands`, `createCommandRegistry`,
28
+ `parseSlashCommand`, `getAgentCommands`.
29
+ - Tool renderers: `defaultToolRenderers`, `mergeToolRenderers`,
30
+ `resolveToolRenderer`, `mergeShadcnToolRenderers`, `ToolCallGroup`.
31
+ - Primitives (`Message`, `Conversation`, `Reasoning`, `CodeBlock`,
32
+ `PromptInput`, …) and the `cn` class helper.
33
+ - `DebugDrawer`, `ChatEmptyState`, `ArtifactOpenProvider`/`useOpenArtifact`,
34
+ `uploadFile`.
35
+
36
+ > Note: there is no `useAgentChat` hook. The chat lifecycle lives inside
37
+ > `ChatPanel`/`PiChatPanel` and the `usePiSessions` hook.
38
+
39
+ ## `@hachej/boring-agent/server`
40
+
41
+ The Node runtime. Key exports:
42
+
43
+ - `createAgentApp(opts)` standalone Fastify factory. Zero dependency on
44
+ `@hachej/boring-core` or `@hachej/boring-workspace`. See
45
+ `src/server/createAgentApp.ts`.
46
+ - `registerAgentRoutes(app, opts)` — mounts the agent HTTP routes onto an
47
+ existing Fastify instance (used by `@hachej/boring-workspace`). Paths are
48
+ absolute under `/api/v1/agent/*`, `/api/v1/files`, etc.
49
+ - Sandbox adapters: `createDirectSandbox`, `createBwrapSandbox`, plus the
50
+ Vercel sandbox/snapshot helpers (`createVercelSandboxWorkspace`,
51
+ `bakeSnapshotIfNeeded`, deployment-snapshot providers, `FileHandleStore`).
52
+ - Workspace adapters: `createNodeWorkspace`, `createVercelSandboxWorkspace`.
53
+ - Mode resolution: `autoDetectMode`, `resolveMode`, `hasBwrap`. Custom execution backends are injected via the `runtimeModeAdapter` option see [runtime.md §Adding a custom runtime mode](./runtime.md#adding-a-custom-runtime-mode).
54
+ - Provisioning: `provisionRuntimeWorkspace`, `provisionWorkspaceRuntime`,
55
+ `getBoringAgentRuntimePaths`, `getBoringAgentRuntimeEnv`,
56
+ `createVercelProvisioningAdapter`.
57
+ - HTTP/CSP: `applyCspHeaders`; `fileRoutes` for mounting file routes alone.
58
+ - Harness: `createResourceSettingsManager` and the Pi harness option types.
59
+ - `createLogger`.
60
+
61
+ ## `@hachej/boring-agent/shared`
62
+
63
+ Platform-agnostic contracts (types + zod schemas). Source of truth for the
64
+ public interfaces:
65
+
66
+ - `harness.ts` — `AgentHarness`, `SendMessageInput`, `RunContext`,
67
+ `AgentHarnessFactory`.
68
+ - `tool.ts` / `tool-ui.ts` — `AgentTool`, `ToolExecContext`, `ToolResult`,
69
+ `JSONSchema`, `ToolUiMetadata`.
70
+ - `workspace.ts` — `Workspace`, `Entry`, `Stat`.
71
+ - `sandbox.ts` — `Sandbox`, `SandboxCapability`, `ExecOptions`, `ExecResult`.
72
+ - `catalog.ts` — `CatalogDeps`, `ToolCatalog`.
73
+ - `session.ts` — `SessionStore`, `SessionSummary`, `SessionDetail`.
74
+ - `config-schema.ts` — `ConfigSchema`, `EnvSchema`, `RuntimeModeSchema`,
75
+ `validateConfig`.
76
+ - `error-codes.ts` — `ErrorCode`, `ERROR_CODES`, error-envelope schemas
77
+ (see [ERROR_CODES.md](./ERROR_CODES.md)).
78
+ - `chat.ts` — `BoringChatMessage`, `PiChatEvent`, stream/snapshot frames and
79
+ their zod schemas.
80
+ - `capabilities.ts`, `telemetry.ts`, `runtime.ts`, `sandbox-handle-store.ts`,
81
+ `validateTool.ts`, `agentPluginEvents.ts`.
82
+
83
+ > There is no `ui-bridge.ts` or `message.ts` in `shared/`. UI-bridge tools
84
+ > (`exec_ui`, `get_ui_state`) and their types now live in
85
+ > `@hachej/boring-workspace` — `createAgentApp` ships zero UI tools by design.
86
+
87
+ ## Deferred HTTP Git Surface
88
+
89
+ `/api/v1/git/*` routes exist but are intentionally thin/minimal: there is no
90
+ first-party git UI consumer in the agent today, so git operations run through
91
+ the `bash` tool. See [KNOWN_LIMITATIONS.md](./KNOWN_LIMITATIONS.md).
package/docs/CSP.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CSP Compatibility
2
2
 
3
- `@boring/agent` is compatible with a strict CSP, with one required exception:
3
+ `@hachej/boring-agent` is compatible with a strict CSP, with one required exception:
4
4
  `style-src` must allow inline styles for editor/runtime integrations that do
5
5
  not support nonces end-to-end.
6
6
 
@@ -20,13 +20,14 @@ Content-Security-Policy:
20
20
 
21
21
  - `script-src` does **not** require `'unsafe-eval'`.
22
22
  - No `eval()` or `new Function()` usage is expected in audited agent UI surfaces
23
- (shadcn ChatPanel + example apps).
24
- - Shared helper lives at `src/server/http/csp.ts`; example servers consume it
25
- via `examples/csp.ts`.
23
+ (`ChatPanel` + example apps).
24
+ - Server helper `applyCspHeaders` lives at `src/server/http/csp.ts` (exported
25
+ from `@hachej/boring-agent/server`); example servers consume it via
26
+ `examples/csp.ts`.
26
27
 
27
- ## Audited Scope (tv4)
28
+ ## Audited Scope
28
29
 
29
- - `src/front/ChatPanel.tsx`
30
+ - `src/front/chat/PiChatPanel.tsx`
30
31
  - `examples/with-custom-tool/*`
31
32
  - `apps/agent-playground/*`
32
33
 
@@ -35,6 +36,6 @@ Content-Security-Policy:
35
36
  Even with this cleanup, downstream consumers that enable rich editor stacks
36
37
  (for example CodeMirror/Tiptap integrations in workspace-oriented shells) should
37
38
  keep `style-src 'unsafe-inline'` until upstream libraries expose nonce-safe
38
- style injection across the full stack. The default non-shadcn primitive
39
- stack (`src/front/primitives/*`) also still relies on inline style attributes,
40
- so `style-src 'unsafe-inline'` remains required there as well.
39
+ style injection across the full stack. The primitive stack
40
+ (`src/front/primitives/*`) also still relies on inline style attributes, so
41
+ `style-src 'unsafe-inline'` remains required there as well.
@@ -1,6 +1,6 @@
1
1
  # ERROR_CODES
2
2
 
3
- Canonical registry for stable `@boring/agent` error codes.
3
+ Canonical registry for stable `@hachej/boring-agent` error codes.
4
4
 
5
5
  All API failures must use the response envelope:
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Abandoned Vercel sandboxes (xzr)
4
4
 
5
- `@boring/agent` v1 intentionally does **not** implement a session-close release hook.
5
+ `@hachej/boring-agent` v1 intentionally does **not** implement a session-close release hook.
6
6
  If a process crashes or a client disappears before cleanup, the sandbox may remain
7
7
  alive until Vercel timeout/TTL.
8
8
 
@@ -68,8 +68,8 @@ v1 status: **accepted risk**, documented and monitored.
68
68
 
69
69
  ## GitHub Connect + `/api/v1/git/*` deferred to v1.x (nfx)
70
70
 
71
- Git HTTP routes are intentionally not shipped in v1. Both `@boring/agent` v1
72
- and `@boring/workspace` v1 dropped git UI consumers, so `/api/v1/git/*` would
71
+ Git HTTP routes are intentionally not shipped in v1. Both `@hachej/boring-agent` v1
72
+ and `@hachej/boring-workspace` v1 dropped git UI consumers, so `/api/v1/git/*` would
73
73
  be dead code today.
74
74
 
75
75
  ### Current v1 behavior
package/docs/MIGRATION.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # MIGRATION
2
2
 
3
3
  Migration notes for moving from legacy monorepo-integrated agent flows to
4
- `@boring/agent` in v2.
4
+ `@hachej/boring-agent` in v2.
5
5
 
6
6
  ## What Changes
7
7
 
@@ -14,37 +14,37 @@ v1-style app code typically mixed these concerns in one place:
14
14
 
15
15
  In v2, split responsibilities are intentional:
16
16
 
17
- - `@boring/agent`: runtime contracts + tool/harness/sandbox layers.
18
- - `@boring/workspace`: IDE-style layout package (frontend-only).
17
+ - `@hachej/boring-agent`: agent runtime, tool catalog, harness, sandbox/workspace
18
+ adapters, and the chat UI (`ChatPanel`).
19
+ - `@hachej/boring-workspace`: IDE-style layout/panes plus the UI-bridge tools
20
+ (`exec_ui`, `get_ui_state`) and `/api/v1/ui/*` routes.
19
21
  - App shell: final composition, mode selection, and product policy.
20
22
 
21
23
  ## Practical Migration Steps
22
24
 
23
- 1. Move chat/runtime logic into `@boring/agent` integration points.
24
- 2. Keep editor/file-tree/layout code in `@boring/workspace` or your own UI.
25
+ 1. Move chat/runtime logic into `@hachej/boring-agent` integration points.
26
+ 2. Keep editor/file-tree/layout code in `@hachej/boring-workspace` or your own UI.
25
27
  3. Route all filesystem and command execution through runtime mode adapters.
26
- 4. Replace ad-hoc shared types with imports from `@boring/agent/shared`.
28
+ 4. Replace ad-hoc shared types with imports from `@hachej/boring-agent/shared`.
27
29
  5. Keep server-only code in server entry points; avoid server imports in
28
30
  frontend/shared paths.
29
31
 
30
32
  ## Runtime Mode Migration
31
33
 
32
- Current scaffold status:
33
-
34
- - `direct` mode is available.
35
- - `local` (`bwrap`) and `vercel-sandbox` are planned.
36
-
37
- If you are migrating today, target `direct` first and keep your integration
38
- surface mode-agnostic so later adapter swaps are non-breaking.
34
+ All three modes ship: `direct`, `local` (`bwrap`), and `vercel-sandbox`. Select
35
+ via `mode` in `createAgentApp` or the `BORING_AGENT_MODE` env var. Keep your
36
+ integration surface mode-agnostic so adapter swaps are non-breaking. See
37
+ [runtime.md](./runtime.md).
39
38
 
40
39
  ## Contract Hygiene Checklist
41
40
 
42
41
  - No `node:*` imports in `src/shared/**`.
43
42
  - No `Buffer` in shared contracts (`Uint8Array` only).
44
- - Keep UI commands flowing through `UiBridge.postCommand`.
45
- - Keep session/tool/workspace behavior aligned with `@boring/agent/shared`.
43
+ - Keep session/tool/workspace behavior aligned with `@hachej/boring-agent/shared`.
46
44
 
47
45
  ## References
48
46
 
49
- - Agent spec + migration design rationale: `docs/plans/agent-package-spec.md`
47
+ - Runtime modes: [runtime.md](./runtime.md)
48
+ - API surface: [API.md](./API.md)
50
49
  - README quickstart/context: `../README.md`
50
+ - Historical design notes: `docs/plans/archive/` (archival; not current truth)
@@ -18,7 +18,7 @@
18
18
  Command used:
19
19
 
20
20
  ```bash
21
- pnpm --filter @boring/agent run bench:vercel-cold-start -- \
21
+ pnpm --filter @hachej/boring-agent run bench:vercel-cold-start -- \
22
22
  --iterations 10 \
23
23
  --runtime python3.13 \
24
24
  --snapshot-id <snapshot-id>
package/docs/PLUGINS.md CHANGED
@@ -1,22 +1,27 @@
1
1
  # PLUGINS
2
2
 
3
- Plugin and extension notes for `@boring/agent`.
3
+ Plugin and extension notes for `@hachej/boring-agent`.
4
4
 
5
- ## Current Status
5
+ ## Two extension paths
6
6
 
7
- The full plugin runtime is not shipped yet in this scaffold.
7
+ There are two ways to extend the agent, depending on host integration:
8
8
 
9
- Today:
9
+ 1. **Pi-native resources** (`package.json#pi`: `extensions`, `skills`,
10
+ `prompts`, `systemPrompt`) — discovered by the Pi harness in `direct`/`local`
11
+ mode and reloadable through `/reload`. This is the right place for portable,
12
+ hot-reloadable tools and skills. See [tools.md](./tools.md).
13
+ 2. **Trusted server plugins** (`@hachej/boring-workspace` `defineServerPlugin`)
14
+ — static/boot-time `agentTools`, routes, and provisioning declared by trusted
15
+ server code. See [tools.md](./tools.md) and
16
+ [runtime-provisioning.md](./runtime-provisioning.md).
10
17
 
11
- - Tool contracts are defined in `src/shared/tool.ts`.
12
- - Runtime catalog/harness integration is still under active implementation.
18
+ Both paths converge on the same `AgentTool` contract
19
+ (`src/shared/tool.ts`). The standalone `createAgentApp` ships no UI tools;
20
+ `exec_ui`/`get_ui_state` and UI routes are owned by `@hachej/boring-workspace`.
13
21
 
14
- ## Planned Integration Model
22
+ ## Tool contract
15
23
 
16
- The intended extension seam is "register additional tools into the catalog"
17
- without modifying core runtime internals.
18
-
19
- Each tool should provide:
24
+ Each tool provides:
20
25
 
21
26
  - Stable `name`
22
27
  - Clear `description`
@@ -29,6 +34,22 @@ Each tool should provide:
29
34
  - `toolCallId`
30
35
  - Optional progress callbacks (`onUpdate`)
31
36
 
37
+ Optional fields:
38
+
39
+ - `readinessRequirements?: ToolReadinessRequirement[]` — gates the tool on
40
+ runtime readiness. `mergeTools` assigns `['workspace-fs']` to plugin tools
41
+ that omit it (built-in/`extraTools` tools keep whatever they declare).
42
+ - `promptSnippet?` — extra guidance injected into the system prompt when the
43
+ tool is registered.
44
+
45
+ ## Trust & runtime modes
46
+
47
+ Plugin tools' `execute()` run in the **host Node process** and bypass the
48
+ sandbox by design — treat plugin code as trusted local/workspace code. Plugin
49
+ auto-discovery is local-mode-only (see the `vercel-sandbox` caveat below). For
50
+ the full internal-vs-external plugin trust model, see
51
+ `packages/workspace/docs/PLUGIN_SYSTEM.md` §1.1.
52
+
32
53
  ## Safety + Compatibility Rules
33
54
 
34
55
  - Validate all plugin input against schema before execution.
@@ -63,6 +84,12 @@ previous tool came from built-ins, `extraTools`, or another plugin.
63
84
 
64
85
  ## Discovery Sources (direct/local)
65
86
 
87
+ This section describes **Pi-native resource discovery** at the harness level.
88
+ Workspace runtime/generated plugins are a higher-level package format under
89
+ `.pi/extensions/<id>/package.json` documented in
90
+ `packages/workspace/docs/PLUGIN_SYSTEM.md`; those packages may themselves
91
+ declare `pi.extensions` resources.
92
+
66
93
  In `direct` and `local` mode, plugin discovery can load tools from:
67
94
 
68
95
  - `~/.pi/agent/extensions/*.js|*.mjs` (global)
@@ -104,5 +131,8 @@ When porting plugins from host modes to `vercel-sandbox`, expect differences:
104
131
 
105
132
  ## References
106
133
 
107
- - Canonical design: `docs/plans/agent-package-spec.md`
134
+ - Adding tools: [tools.md](./tools.md)
135
+ - Chat `/slash` commands as a plugin surface:
136
+ `packages/workspace/docs/PLUGIN_SYSTEM.md` §4.7
108
137
  - Minimal integration sketch: `examples/with-custom-tool/README.md`
138
+ - Historical design notes: `docs/plans/archive/` (archival; not current truth)
package/docs/README.md CHANGED
@@ -1,18 +1,95 @@
1
- # @boring/agent Docs
1
+ # @hachej/boring-agent Docs
2
2
 
3
- This folder contains user-facing package docs for `@boring/agent`.
3
+ `@hachej/boring-agent` is a pane-embeddable coding agent: an LLM agent loop, a
4
+ tool catalog, and a chat UI, with swappable execution backends. The same agent,
5
+ tools, and UI run in three modes — `direct` (host process), `local` (bwrap
6
+ sandbox), and `vercel-sandbox` (Firecracker microVM) — selected at construction.
7
+ It is consumed two ways: standalone via `createAgentApp` (Fastify server +
8
+ `ChatPanel`), or mounted into `@hachej/boring-workspace` for the full IDE shell.
4
9
 
5
- ## Start Here
10
+ ## Architecture
6
11
 
7
- - [API](./API.md) — current export surface and contract status.
8
- - [STYLING](./STYLING.md) CSS-variable theming contract and guardrails.
9
- - [PLUGINS](./PLUGINS.md) — extension model and runtime-mode caveats.
10
- - [runtime](./runtime.md) runtime cwd contract, `.boring-agent/` layout, provisioning examples, and doctor diagnostics.
11
- - [MIGRATION](./MIGRATION.md) — migration guidance for v1-style integrations.
12
+ ```
13
+ Chat UI (ChatPanel / front)
14
+ │ pi-chat SSE stream
15
+ Agent HTTP routes (registerAgentRoutes / createAgentApp)
16
+
17
+ Agent harness (pi-coding-agent loop) ── Tool catalog (AgentTool[])
18
+ │ │
19
+ Workspace (filesystem) Sandbox (command execution)
20
+ ```
12
21
 
13
- ## Scope
22
+ - **front** (`src/front`) — `ChatPanel` (= `PiChatPanel`), primitives, slash
23
+ commands, tool renderers, session hooks. Browser-only.
24
+ - **server** (`src/server`) — `createAgentApp`, `registerAgentRoutes`, the Pi
25
+ harness adapter, sandbox/workspace adapters, runtime provisioning, model
26
+ config, HTTP routes. Node-only.
27
+ - **shared** (`src/shared`) — platform-agnostic contracts and zod schemas
28
+ (`AgentHarness`, `Workspace`, `Sandbox`, `AgentTool`, `SessionStore`, chat
29
+ frames, error codes).
30
+ - **eval** (`src/eval`) — agent-behavior evaluation toolkit.
14
31
 
15
- These docs track the implementation status of the v2 scaffold and call out
16
- roadmap-only APIs explicitly to avoid over-promising.
32
+ Data flow: the browser opens a pi-chat SSE stream; the server drives the
33
+ pi-coding-agent harness; tools resolve filesystem ops through the `Workspace`
34
+ adapter and shell/exec through the `Sandbox` adapter. Workspace + Sandbox must
35
+ target the same filesystem substrate (the mode adapter enforces the pairing).
17
36
 
18
- For canonical design context, see `./plans/agent-package-spec.md`.
37
+ ## Key abstractions
38
+
39
+ The public surfaces a consumer or extender touches (all in
40
+ `@hachej/boring-agent/shared` unless noted):
41
+
42
+ - `AgentHarness` — the agent loop interface; pi-coding-agent is the v1 impl.
43
+ - `Workspace` / `Sandbox` — filesystem and command-execution adapters, swapped
44
+ per mode.
45
+ - `AgentTool` + `CatalogDeps` — the tool contract and the deps tools bind to.
46
+ - `SessionStore` — session listing/lifecycle.
47
+ - `createAgentApp` / `registerAgentRoutes` (`/server`) — entry points to run or
48
+ embed the server.
49
+ - `ChatPanel` (`/front`) — the embeddable UI.
50
+
51
+ ## Architectural decisions
52
+
53
+ Locked decisions live in the root [`docs/DECISIONS.md`](../../../docs/DECISIONS.md);
54
+ the agent ↔ workspace boundary is in
55
+ [`docs/WORKSPACE_CONTRACT.md`](../../../docs/WORKSPACE_CONTRACT.md). Highlights:
56
+
57
+ - Standalone CLI-shaped product; same code embeds into a host shell — decision 1.
58
+ - pi-coding-agent as the v1 harness behind a generic `AgentHarness` — decisions 4–5.
59
+ - `mode = direct | local | vercel-sandbox`; Workspace+Sandbox pairing invariant — decisions 7a–7f.
60
+ - Single Anthropic provider by default, but the model layer also supports custom
61
+ OpenAI-compatible and Infomaniak providers — decision 10.
62
+ - Plugins extend via Pi resources or trusted server plugins, not core edits — decision 8.
63
+ - Four export surfaces: top-level/`front`, `/server`, `/shared`, `/eval` — decision 15.
64
+
65
+ ## Documentation
66
+
67
+ **Surfaces & integration**
68
+
69
+ - [API](./API.md) — the four entry points and what each exports.
70
+ - [STYLING](./STYLING.md) — CSS-variable theming contract and public selectors.
71
+ - [UI-SHADCN](./UI-SHADCN.md) — `ChatPanel` styling model and tool-renderer overrides.
72
+ - [tools](./tools.md) — built-in tools, package-added tools, and how to add custom tools.
73
+ - [PLUGINS](./PLUGINS.md) — the two extension paths and tool-collision rules.
74
+ - [MIGRATION](./MIGRATION.md) — moving legacy integrations to the v2 split.
75
+
76
+ **Runtime & provisioning**
77
+
78
+ - [runtime](./runtime.md) — the three modes, the cwd invariant, and `.boring-agent/` layout.
79
+ - [runtime-provisioning](./runtime-provisioning.md) — when provisioning runs, package-authoring shape, trusted server provisioning.
80
+
81
+ **Contracts & operations**
82
+
83
+ - [ERROR_CODES](./ERROR_CODES.md) — the stable API error-code registry.
84
+ - [CSP](./CSP.md) — Content-Security-Policy compatibility.
85
+ - [ACCESSIBILITY](./ACCESSIBILITY.md) — a11y coverage and known gaps.
86
+
87
+ **Risk & cost notes**
88
+
89
+ - [KNOWN_LIMITATIONS](./KNOWN_LIMITATIONS.md) — accepted risks (orphaned sandboxes, deferred git routes).
90
+ - [RISKS-MULTI-TAB](./RISKS-MULTI-TAB.md) — last-write-wins behavior for concurrent edits.
91
+ - [VERCEL_COSTS](./VERCEL_COSTS.md) — Vercel sandbox cost model.
92
+ - [PERFORMANCE](./PERFORMANCE.md) — historical Vercel cold-start benchmark.
93
+
94
+ Historical plans and specs live under `docs/plans/archive/` — archival context only, not
95
+ current truth; verify against code before relying on them.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Scope
4
4
 
5
- This note documents current `@boring/agent` behavior when two browser tabs
5
+ This note documents current `@hachej/boring-agent` behavior when two browser tabs
6
6
  point at the same workspace and edit the same file.
7
7
 
8
8
  ## Observed Behavior (v1)
package/docs/STYLING.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # STYLING
2
2
 
3
- Styling contract for `@boring/agent` frontend surfaces.
3
+ Styling contract for `@hachej/boring-agent` frontend surfaces. For the full
4
+ agent/workspace Tailwind isolation model, see
5
+ [`docs/TAILWIND-V4-STYLE-ISOLATION.md`](../../../docs/TAILWIND-V4-STYLE-ISOLATION.md).
4
6
 
5
7
  ## Package CSS
6
8
 
@@ -8,12 +10,12 @@ Consumers import the precompiled package stylesheet once, after host/workspace
8
10
  base CSS and before app overrides:
9
11
 
10
12
  ```ts
11
- import "@boring/workspace/globals.css"
12
- import "@boring/agent/front/styles.css"
13
+ import "@hachej/boring-workspace/globals.css"
14
+ import "@hachej/boring-agent/front/styles.css"
13
15
  import "./app.css"
14
16
  ```
15
17
 
16
- The published `@boring/agent/front/styles.css` is consumer-safe: it contains no
18
+ The published `@hachej/boring-agent/front/styles.css` is consumer-safe: it contains no
17
19
  Tailwind `@source`, no Tailwind imports, and no repo-relative source paths.
18
20
 
19
21
  ## Public selectors
package/docs/UI-SHADCN.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # Agent UI
2
2
 
3
- `@boring/agent` exports the pane-embeddable `ChatPanel` and its frontend
3
+ `@hachej/boring-agent` exports the pane-embeddable `ChatPanel` and its frontend
4
4
  primitives. The default styled surface is packaged with precompiled CSS.
5
5
 
6
6
  ## Quickstart
7
7
 
8
8
  ```tsx
9
- import "@boring/workspace/globals.css"
10
- import "@boring/agent/front/styles.css"
11
- import { ChatPanel } from "@boring/agent"
9
+ import "@hachej/boring-workspace/globals.css"
10
+ import "@hachej/boring-agent/front/styles.css"
11
+ import { ChatPanel } from "@hachej/boring-agent"
12
12
 
13
13
  function App() {
14
14
  return <ChatPanel sessionId="my-session" />
@@ -18,8 +18,8 @@ function App() {
18
18
  Import app overrides after the package CSS when customizing:
19
19
 
20
20
  ```ts
21
- import "@boring/workspace/globals.css"
22
- import "@boring/agent/front/styles.css"
21
+ import "@hachej/boring-workspace/globals.css"
22
+ import "@hachej/boring-agent/front/styles.css"
23
23
  import "./app.css"
24
24
  ```
25
25
 
@@ -27,7 +27,7 @@ import "./app.css"
27
27
 
28
28
  | Concern | Contract |
29
29
  |---|---|
30
- | Package CSS | `@boring/agent/front/styles.css` |
30
+ | Package CSS | `@hachej/boring-agent/front/styles.css` |
31
31
  | Root selector | `[data-boring-agent]` |
32
32
  | Parts | `[data-boring-agent-part="composer"]`, `[data-boring-agent-part="tool-card"]`, etc. |
33
33
  | Message role | `[data-boring-agent-message-role="assistant"]` |