@hachej/boring-agent 0.1.111 → 0.2.1
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.
- package/LICENSE +1 -1
- package/README.md +262 -51
- package/dist/agents.d.ts +75 -0
- package/dist/agents.js +91 -0
- package/dist/approval.d.ts +71 -0
- package/dist/approval.js +126 -0
- package/dist/artifacts.d.ts +53 -0
- package/dist/artifacts.js +129 -0
- package/dist/ask-user.d.ts +40 -0
- package/dist/ask-user.js +134 -0
- package/dist/attachment.d.ts +5 -0
- package/dist/attachment.js +4 -0
- package/dist/browser-task.d.ts +32 -0
- package/dist/browser-task.js +119 -0
- package/dist/chat-transport.d.ts +80 -0
- package/dist/chat-transport.js +306 -0
- package/dist/contracts.d.ts +40 -0
- package/dist/contracts.js +1 -0
- package/dist/conversations.d.ts +136 -0
- package/dist/conversations.js +366 -0
- package/dist/definitions.d.ts +37 -0
- package/dist/definitions.js +99 -0
- package/dist/delivery-input.d.ts +35 -0
- package/dist/delivery-input.js +56 -0
- package/dist/delivery.d.ts +33 -0
- package/dist/delivery.js +154 -0
- package/dist/durable-wait.d.ts +23 -0
- package/dist/durable-wait.js +79 -0
- package/dist/file-convert.d.ts +46 -0
- package/dist/file-convert.js +159 -0
- package/dist/file-guard.d.ts +50 -0
- package/dist/file-guard.js +177 -0
- package/dist/file-types.d.ts +17 -0
- package/dist/file-types.js +95 -0
- package/dist/gateway-provider.d.ts +24 -0
- package/dist/gateway-provider.js +42 -0
- package/dist/git.d.ts +34 -0
- package/dist/git.js +79 -0
- package/dist/harness-pool.d.ts +38 -0
- package/dist/harness-pool.js +134 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -0
- package/dist/json-schema-tool.d.ts +25 -0
- package/dist/json-schema-tool.js +19 -0
- package/dist/memory/optchat-core.d.ts +118 -0
- package/dist/memory/optchat-core.js +317 -0
- package/dist/memory/optchat.d.ts +156 -0
- package/dist/memory/optchat.js +432 -0
- package/dist/mentions.d.ts +56 -0
- package/dist/mentions.js +140 -0
- package/dist/metering.d.ts +183 -0
- package/dist/metering.js +443 -0
- package/dist/model-gateway.d.ts +86 -0
- package/dist/model-gateway.js +241 -0
- package/dist/native-version.d.ts +9 -0
- package/dist/native-version.js +7 -0
- package/dist/native.d.ts +4 -0
- package/dist/native.js +1 -0
- package/dist/presentation.d.ts +17 -0
- package/dist/presentation.js +39 -0
- package/dist/projection-format.d.ts +68 -0
- package/dist/projection-format.js +118 -0
- package/dist/projection-window.d.ts +9 -0
- package/dist/projection-window.js +93 -0
- package/dist/projection.d.ts +22 -0
- package/dist/projection.js +153 -0
- package/dist/question-response.d.ts +20 -0
- package/dist/question-response.js +75 -0
- package/dist/questions.d.ts +74 -0
- package/dist/questions.js +199 -0
- package/dist/self-evolving.d.ts +55 -0
- package/dist/self-evolving.js +239 -0
- package/dist/skills.d.ts +15 -0
- package/dist/skills.js +51 -0
- package/dist/tool-evidence.d.ts +14 -0
- package/dist/tool-evidence.js +54 -0
- package/dist/validation.d.ts +38 -0
- package/dist/validation.js +68 -0
- package/dist/workspaces.d.ts +107 -0
- package/dist/workspaces.js +212 -0
- package/package.json +145 -150
- package/dist/DebugDrawer-JNA43SVR.js +0 -8
- package/dist/admin-DORVQfLn.d.ts +0 -340
- package/dist/chunk-2BGLZZ7T.js +0 -10
- package/dist/chunk-42D6KAQV.js +0 -2882
- package/dist/chunk-4XOW57KJ.js +0 -343
- package/dist/chunk-72KT6VWV.js +0 -1338
- package/dist/chunk-7XAOVFSN.js +0 -28
- package/dist/chunk-KJIEMSQP.js +0 -198
- package/dist/chunk-KN72XWP7.js +0 -394
- package/dist/chunk-N6THTH7P.js +0 -110
- package/dist/chunk-V3H5A3BR.js +0 -22501
- package/dist/chunk-YGRQ4Q5P.js +0 -20
- package/dist/chunk-YTUZFKB3.js +0 -78
- package/dist/core/index.d.ts +0 -28
- package/dist/core/index.js +0 -617
- package/dist/createHarness-DOLOHA62.js +0 -18
- package/dist/eval/index.d.ts +0 -247
- package/dist/eval/index.js +0 -541
- package/dist/file-search-BUgMSKZE.d.ts +0 -289
- package/dist/front/artifacts.d.ts +0 -34
- package/dist/front/artifacts.js +0 -21
- package/dist/front/index.d.ts +0 -1082
- package/dist/front/index.js +0 -12912
- package/dist/front/styles.css +0 -5380
- package/dist/harness-qHlMJhZo.d.ts +0 -276
- package/dist/middleware-CaAEXpi5.d.ts +0 -115
- package/dist/piChatEvent-DpE0lIb9.d.ts +0 -450
- package/dist/piChatSessionService-CBct-hmz.d.ts +0 -86
- package/dist/sandbox-BMhut3kh.d.ts +0 -317
- package/dist/server/agent-host/testing/compositionRouteProof.d.ts +0 -8
- package/dist/server/agent-host/testing/compositionRouteProof.js +0 -78
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +0 -43
- package/dist/server/agent-host/testing/gatewayConformance.js +0 -605
- package/dist/server/index.d.ts +0 -2278
- package/dist/server/index.js +0 -274
- package/dist/server/pi-session-readability.d.ts +0 -12
- package/dist/server/pi-session-readability.js +0 -23
- package/dist/server/worker/index.d.ts +0 -68
- package/dist/server/worker/index.js +0 -377
- package/dist/share-entry-CxS6UJ_L.d.ts +0 -330
- package/dist/shared/index.d.ts +0 -2111
- package/dist/shared/index.js +0 -262
- package/dist/types-DcWoQMn8.d.ts +0 -1377
- package/docs/ACCESSIBILITY.md +0 -52
- package/docs/AGENT_GATEWAY_V0.md +0 -212
- package/docs/AGENT_PACKAGES.md +0 -90
- package/docs/API.md +0 -123
- package/docs/AUTHORING.md +0 -68
- package/docs/CSP.md +0 -41
- package/docs/ERROR_CODES.md +0 -229
- package/docs/KNOWN_LIMITATIONS.md +0 -100
- package/docs/MIGRATION.md +0 -50
- package/docs/PERFORMANCE.md +0 -68
- package/docs/PLUGINS.md +0 -138
- package/docs/README.md +0 -98
- package/docs/RISKS-MULTI-TAB.md +0 -46
- package/docs/SESSION_IDENTITY.md +0 -91
- package/docs/STYLING.md +0 -73
- package/docs/UI-SHADCN.md +0 -56
- package/docs/VERCEL_COSTS.md +0 -103
- package/docs/plans/archive/AGENT_EVAL_FRAMEWORK.md +0 -466
- package/docs/plans/archive/agent-package-spec.md +0 -1777
- package/docs/plans/archive/harness-followup-capabilities.md +0 -440
- package/docs/plans/archive/harness-tool-ui-capabilities.md +0 -144
- package/docs/plans/archive/pi-followup-history-projection.md +0 -229
- package/docs/plans/archive/pi-tools-migration.md +0 -1061
- package/docs/plans/archive/reviews/pi-followup-history-codex-review.md +0 -11
- package/docs/plans/archive/reviews/pi-followup-history-gpt-review.md +0 -64
- package/docs/plans/archive/reviews/pi-followup-history-opus-review.md +0 -43
- package/docs/plans/archive/reviews/pi-followup-history-xai-review.md +0 -43
- package/docs/plans/archive/vercel-base-snapshot-template-plan.md +0 -527
- package/docs/plans/archive/vercel-persistent-sandbox-adapter.md +0 -553
- package/docs/runtime-provisioning.md +0 -157
- package/docs/runtime.md +0 -296
- package/docs/tools.md +0 -102
package/docs/ACCESSIBILITY.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Accessibility Audit
|
|
2
|
-
|
|
3
|
-
This document tracks accessibility status for `@hachej/boring-agent` UI surfaces.
|
|
4
|
-
|
|
5
|
-
## Scope
|
|
6
|
-
|
|
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
|
|
10
|
-
|
|
11
|
-
## Current Coverage
|
|
12
|
-
|
|
13
|
-
### Landmarks and live regions
|
|
14
|
-
|
|
15
|
-
- The ChatPanel root exposes `role="region"` with
|
|
16
|
-
`aria-label="Agent assistant"`.
|
|
17
|
-
- Message streams expose `role="log"` and `aria-live="polite"` as
|
|
18
|
-
`aria-label="Agent conversation"`.
|
|
19
|
-
- Error states are announced with `role="alert"`.
|
|
20
|
-
|
|
21
|
-
### Interactive control names
|
|
22
|
-
|
|
23
|
-
- Icon-only conversation controls expose explicit names:
|
|
24
|
-
- `Scroll to latest message`
|
|
25
|
-
- `Download conversation`
|
|
26
|
-
|
|
27
|
-
### Automated checks
|
|
28
|
-
|
|
29
|
-
- Unit checks:
|
|
30
|
-
- `src/front/chat/__tests__/PiChatPanel.test.tsx`
|
|
31
|
-
- Browser axe check:
|
|
32
|
-
- `packages/agent/e2e/a11y.spec.ts`
|
|
33
|
-
- Fails on any **serious** or **critical** violation inside
|
|
34
|
-
`[data-boring-agent]`.
|
|
35
|
-
|
|
36
|
-
This runs in CI automatically through the existing `pnpm e2e` job.
|
|
37
|
-
|
|
38
|
-
## Known Gaps
|
|
39
|
-
|
|
40
|
-
1. A registered agent-component UI-review spec is not present yet, so there is
|
|
41
|
-
no fixture-level axe scan for agent primitives.
|
|
42
|
-
2. Current automated axe gate targets the shipped chat surface only.
|
|
43
|
-
Workspace pane-level a11y checks (file tree, editor panes, dock tabs) are
|
|
44
|
-
outside this package and need dedicated coverage in `@hachej/boring-workspace`.
|
|
45
|
-
3. Manual screen-reader validation (VoiceOver/NVDA) is still pending.
|
|
46
|
-
|
|
47
|
-
## Next Increment
|
|
48
|
-
|
|
49
|
-
1. Register deterministic agent-primitive checkpoints in `tools/ui-review`.
|
|
50
|
-
2. Add fixture-level axe hard gates to that registered spec.
|
|
51
|
-
3. Extend browser axe checks to `workspace-playground` once pane a11y owners
|
|
52
|
-
land stable selectors/landmarks.
|
package/docs/AGENT_GATEWAY_V0.md
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
# AgentGateway v0 — the session contract
|
|
2
|
-
|
|
3
|
-
**Kind:** technical contract. **Governs:** the gateway surface only.
|
|
4
|
-
**Does not govern:** sequencing (see `docs/DIRECTION.md`), architecture rulings
|
|
5
|
-
(see `docs/DECISIONS.md`), or history (see `docs/issues/909/plan.md`).
|
|
6
|
-
|
|
7
|
-
This file supersedes `docs/issues/909/plan.md` §6 as the binding description of
|
|
8
|
-
the gateway contract. §6 was written before implementation and drifted; it is
|
|
9
|
-
retained there as a historical record, not as a build target.
|
|
10
|
-
|
|
11
|
-
Source of truth is the code: `packages/agent/src/shared/gateway/types.ts` and
|
|
12
|
-
`errors.ts`. If this file and those files disagree, the code wins and this file
|
|
13
|
-
is a bug. Keep them together — that colocation is the point. The v0 contract
|
|
14
|
-
lived in an issue folder nobody updated, and it silently stopped matching the
|
|
15
|
-
types within one release.
|
|
16
|
-
|
|
17
|
-
## Scope discipline
|
|
18
|
-
|
|
19
|
-
`AuthorizedAgentScope` is an **issuer-owned runtime capability, not a transport
|
|
20
|
-
DTO**. It carries a `unique symbol` brand, so it cannot be forged by spreading
|
|
21
|
-
an object across a boundary. It must be re-checked against issuer identity and
|
|
22
|
-
current membership on every use — possession is not authorization.
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
interface AuthorizedAgentScope {
|
|
26
|
-
readonly workspaceScopeId: WorkspaceScopeId
|
|
27
|
-
readonly authSubjectId: AuthSubjectId
|
|
28
|
-
readonly [authorizedAgentScope]: true // brand
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Only the app-owned verifier returns identity facts, as
|
|
33
|
-
`VerifiedAgentScopeClaim`. `AgentSessionRef` deliberately carries **no
|
|
34
|
-
`hostId`** — session refs are `{ agentTypeId, sessionId }` and nothing else.
|
|
35
|
-
|
|
36
|
-
## The 8 methods (+ close, plus optional authorization hook)
|
|
37
|
-
|
|
38
|
-
```ts
|
|
39
|
-
interface AgentGateway {
|
|
40
|
-
authorizeAgentAccess?(input: { scope; agentTypeId; operation }): Promise<void>
|
|
41
|
-
listAgents(input: ListAgentsInput): Promise<readonly AgentSummary[]>
|
|
42
|
-
listSessions(input: AuthorizedAgentSessionQuery): Promise<AgentSessionPage>
|
|
43
|
-
createSession(input: CreateAgentSessionInput): Promise<AgentSessionRef>
|
|
44
|
-
connectSession(input: ConnectAgentSessionInput): Promise<AgentSessionConnection>
|
|
45
|
-
readSessionState(input: ReadAgentSessionStateInput): Promise<AgentSessionStateSnapshot>
|
|
46
|
-
renameSession(input: RenameAgentSessionInput): Promise<AgentSessionSummary>
|
|
47
|
-
setSessionArchived(input: SetAgentSessionArchivedInput): Promise<AgentSessionSummary>
|
|
48
|
-
deleteSession(input: DeleteAgentSessionInput): Promise<void>
|
|
49
|
-
close(): Promise<void>
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Input DTOs — scope is NESTED
|
|
54
|
-
|
|
55
|
-
**This is the correction.** §6 froze the scope fields as inherited
|
|
56
|
-
(`interface CreateAgentSessionInput extends AuthorizedAgentScope`). The shipped
|
|
57
|
-
contract nests scope under its own field on **every** input:
|
|
58
|
-
|
|
59
|
-
```ts
|
|
60
|
-
interface ListAgentsInput { scope }
|
|
61
|
-
interface AuthorizedAgentSessionQuery{ scope; agentTypeId?; cursor?; limit? }
|
|
62
|
-
interface CreateAgentSessionInput { scope; agentTypeId; requestId; title? }
|
|
63
|
-
interface ConnectAgentSessionInput { scope; ref; cursor? }
|
|
64
|
-
interface ReadAgentSessionStateInput { scope; ref }
|
|
65
|
-
interface RenameAgentSessionInput { scope; ref; requestId; title }
|
|
66
|
-
interface SetAgentSessionArchivedInput { scope; ref; requestId; archived }
|
|
67
|
-
interface DeleteAgentSessionInput { scope; ref; requestId }
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Nesting keeps the branded capability a single indivisible value instead of
|
|
71
|
-
scattering its fields across every DTO, which is why callers adopted it. Code
|
|
72
|
-
written against §6's inherited form does not typecheck.
|
|
73
|
-
|
|
74
|
-
Note `listAgents` takes `ListAgentsInput`, not a bare `AuthorizedAgentScope`.
|
|
75
|
-
|
|
76
|
-
### Output DTOs
|
|
77
|
-
|
|
78
|
-
`AgentSummary` (`agentTypeId`, `label`, `description?`, `definition?{version,digest?}`),
|
|
79
|
-
where `version` is the exact package declaration and `digest`, when available,
|
|
80
|
-
is the computed compiled-definition identity (not a re-hash of the response DTO),
|
|
81
|
-
`AgentSessionSummary` (`ref`, `title`, `status`, `createdAt`, `updatedAt`),
|
|
82
|
-
`AgentSessionPage` (`sessions`, `nextCursor?`), and the receipts
|
|
83
|
-
(`CommandReceipt`, `AgentSendReceipt`, `QueueClearReceipt`, `StopReceipt`) are
|
|
84
|
-
unchanged from §6, field for field.
|
|
85
|
-
|
|
86
|
-
Session activity is the extracted alias `AgentSessionActivity`:
|
|
87
|
-
`'idle' | 'running' | 'aborting' | 'error'`.
|
|
88
|
-
|
|
89
|
-
`AgentSessionStateSnapshot.state` is **`JsonSafe<PiChatSnapshot>`**, not the raw
|
|
90
|
-
snapshot §6 named — the transport boundary is expressed in the type.
|
|
91
|
-
|
|
92
|
-
`JsonSafe<T>` itself differs from §6's version: it hoists `unknown extends T` to
|
|
93
|
-
the top, maps functions to `never`, and terminates non-object/non-array at
|
|
94
|
-
`never`. Read it from `types.ts`; do not reimplement it from memory.
|
|
95
|
-
|
|
96
|
-
### Commands
|
|
97
|
-
|
|
98
|
-
`AgentPromptCommand` and `AgentFollowUpCommand` both require
|
|
99
|
-
**`{ requestId, clientNonce, content }`** — there is no `text` or `kind:'user'`
|
|
100
|
-
shorthand. Prompts add `displayContent?`, `model?`, `thinkingLevel?`,
|
|
101
|
-
`attachments?`; follow-ups add `clientSeq`.
|
|
102
|
-
|
|
103
|
-
## Error codes
|
|
104
|
-
|
|
105
|
-
Seventeen, exhaustive, order-stable, exported as both a const map and
|
|
106
|
-
`AGENT_GATEWAY_ERROR_CODES`:
|
|
107
|
-
|
|
108
|
-
`AGENT_TYPE_UNKNOWN` · `AGENT_SESSION_NOT_FOUND` · `AGENT_SCOPE_DENIED` ·
|
|
109
|
-
`AGENT_ENTITLEMENT_REQUIRED` · `AGENT_ACCESS_FORBIDDEN` ·
|
|
110
|
-
`AGENT_ACCESS_POLICY_UNAVAILABLE` ·
|
|
111
|
-
`AGENT_SESSION_REPLAY_GAP` · `AGENT_SESSION_CURSOR_AHEAD` ·
|
|
112
|
-
`AGENT_SESSION_CURSOR_EXPIRED` · `AGENT_SESSION_CURSOR_INVALID` ·
|
|
113
|
-
`AGENT_REQUEST_CONFLICT` · `AGENT_REQUEST_IN_PROGRESS` ·
|
|
114
|
-
`AGENT_REQUEST_OUTCOME_UNKNOWN` · `AGENT_RUNTIME_RESTART_REQUIRED` ·
|
|
115
|
-
`AGENT_COMMAND_INVALID_STATE` ·
|
|
116
|
-
`AGENT_SHARED_ENVIRONMENT_UNAVAILABLE` · `AGENT_GATEWAY_CLOSED`
|
|
117
|
-
|
|
118
|
-
HTTP mapping lives in `server/agent-host/httpProjection.ts`
|
|
119
|
-
(`statusForGatewayError`). Note `AGENT_REQUEST_CONFLICT`, `AGENT_REQUEST_IN_PROGRESS`,
|
|
120
|
-
`AGENT_RUNTIME_RESTART_REQUIRED`, and `AGENT_COMMAND_INVALID_STATE` project to
|
|
121
|
-
**409**.
|
|
122
|
-
|
|
123
|
-
## Conformance levels
|
|
124
|
-
|
|
125
|
-
- **Level B** — bounded replay within a process lifetime, plus snapshot
|
|
126
|
-
rehydrate. This is what ships. A cursor older than the replay window, or one
|
|
127
|
-
from before a restart, yields `REPLAY_GAP` / `CURSOR_AHEAD` and the client
|
|
128
|
-
refetches state. Never a silent gap.
|
|
129
|
-
- **Level D** — durable replay across restarts and processes. Specified,
|
|
130
|
-
deliberately skipped, and owner-annotated in
|
|
131
|
-
`server/agent-host/testing/gatewayConformance.ts`. Owned by the streaming
|
|
132
|
-
lane (#1009).
|
|
133
|
-
|
|
134
|
-
The suite is parameterized by `replayLevel`/`paginationLevel`; a Level D host
|
|
135
|
-
must pass the same file with the flag raised.
|
|
136
|
-
|
|
137
|
-
## Keyset pagination
|
|
138
|
-
|
|
139
|
-
Cursors are HMAC-signed and bound to scope and filter; tampering or reuse under
|
|
140
|
-
a different filter yields `AGENT_SESSION_CURSOR_INVALID`. Ordering is total, so
|
|
141
|
-
a session mutated between pages shifts predictably rather than vanishing.
|
|
142
|
-
|
|
143
|
-
## Known descope
|
|
144
|
-
|
|
145
|
-
§10 of the 909 plan carries an unchecked acceptance box demanding recursive
|
|
146
|
-
JSON/size/depth validation of attachment and path leaves on the transport
|
|
147
|
-
boundary. §6.4 descoped exactly that to v2, and the conformance suite skips it
|
|
148
|
-
(`v2 remote wire validates JSON event leaves, paths, depth, and size`). The
|
|
149
|
-
plan is internally inconsistent on this point; the descope is what shipped.
|
|
150
|
-
Anything relying on recursive leaf validation must not assume it exists.
|
|
151
|
-
|
|
152
|
-
## Construction
|
|
153
|
-
|
|
154
|
-
`createAgentHost()` is the single construction funnel — see
|
|
155
|
-
`server/agent-host/createAgentHost.ts` and Decision 29. It is a
|
|
156
|
-
deployment-static composition helper that returns a gateway and a `close()`; it
|
|
157
|
-
is **not** the AgentHost deployment/publication machinery that Decisions 25–28
|
|
158
|
-
rejected. Future internal/external host tiers belong to #905, not here.
|
|
159
|
-
|
|
160
|
-
`scripts/check-alignment-invariants.mjs` enforces that nothing outside an
|
|
161
|
-
allowlist calls it.
|
|
162
|
-
|
|
163
|
-
## Private backend seam
|
|
164
|
-
|
|
165
|
-
The session-runtime path below `EmbeddedAgentGateway` is the server-only
|
|
166
|
-
`AgentHarnessBackend`. It is private to the `createAgentHost()` construction
|
|
167
|
-
funnel: consumers still inject only `harnessFactory`, and there is no public
|
|
168
|
-
backend factory or second session path.
|
|
169
|
-
|
|
170
|
-
`AgentPromptPayload` is exposed from the shared chat barrel as a type only. Its
|
|
171
|
-
“server-only” contract means browser schemas never accept the `requireIdle`
|
|
172
|
-
selector.
|
|
173
|
-
|
|
174
|
-
`PiSessionHarnessBackend` is the sole production implementation today. It
|
|
175
|
-
adapts the unchanged `HarnessPiChatService` and owns the mapping from the
|
|
176
|
-
workspace-scoped backend address and attribution context into the legacy Pi
|
|
177
|
-
request context. The backend carries no credentials, membership authority, or
|
|
178
|
-
model catalog. Reload and slash-command host effects continue to use the
|
|
179
|
-
composition harness directly; they are host capabilities, not session-runtime
|
|
180
|
-
operations.
|
|
181
|
-
|
|
182
|
-
The Gateway request ledger is the only idempotency authority. A backend method
|
|
183
|
-
may be invoked again after a crash only through a ledger-admitted request; the
|
|
184
|
-
backend itself promises no deduplication. A runtime load failure before the
|
|
185
|
-
effect begins records a retryable state, so the same request key and payload can
|
|
186
|
-
atomically reclaim admission after recovery; completed, rejected, in-flight, and
|
|
187
|
-
outcome-unknown records retain their normal replay behavior. P1-B substitutes the adapter-private
|
|
188
|
-
replay source below `HarnessPiChatService`, not this interface. Later operations
|
|
189
|
-
may extend the interface only in their named slices (`resumePausedToolCall` in
|
|
190
|
-
A3b and `markTurnInterrupted` in A4); neither is part of the current seam.
|
|
191
|
-
|
|
192
|
-
An explicit retryable admission result, or a returned prompt-state guard denial,
|
|
193
|
-
releases its pending claim before any effect. The ledger persists
|
|
194
|
-
`pending-admission` with `retryable: true`; `prepare` must atomically consume
|
|
195
|
-
that marker before returning `ownership: 'reclaimed'`. The original key and
|
|
196
|
-
payload digest stay binding, and overlapping requests still receive
|
|
197
|
-
`AGENT_REQUEST_IN_PROGRESS`. This applies to both ordinary and strict-idle
|
|
198
|
-
prompt guards, with their existing idle/error admission policies.
|
|
199
|
-
|
|
200
|
-
Custom `AgentRequestLedger` implementations must implement
|
|
201
|
-
`markAdmissionRetryable` and atomic reclaim, and refuse `acceptAdmission` until
|
|
202
|
-
the released claim has been reclaimed. A thrown admission/guard error does not
|
|
203
|
-
release ownership. Reopening a durable ledger permits only an explicitly marked
|
|
204
|
-
retry; unmarked pending, admission-accepted, in-flight and outcome-unknown rows
|
|
205
|
-
are never automatically re-executed. This is not general crash reconciliation.
|
|
206
|
-
|
|
207
|
-
CI pins the boundary in three directions: Agent Host production code cannot
|
|
208
|
-
import a Pi runtime, only `harnessBackend/**` can reference the concrete Pi chat
|
|
209
|
-
service, and Workspace/Core/CLI/playground consumers cannot name the private
|
|
210
|
-
backend interface or module path. Retire the legacy `PiChatSessionService` when
|
|
211
|
-
the legacy `core/createAgent` path is removed; it is intentionally not widened
|
|
212
|
-
or migrated here.
|
package/docs/AGENT_PACKAGES.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Workspace agent packages
|
|
2
|
-
|
|
3
|
-
With `BORING_AGENT_FLEET=1`, a single-workspace host may discover an agent
|
|
4
|
-
definition from either the trusted repository's `.agents/personas/` packages
|
|
5
|
-
or a local package path registered in that workspace's
|
|
6
|
-
`.pi/settings.json#packages`. Registration makes an agent package discoverable.
|
|
7
|
-
It does not activate the agent: the class-B `.agents/factory/fleet.yaml` roster
|
|
8
|
-
must also seat the package's `boring.agent.definitionId`.
|
|
9
|
-
|
|
10
|
-
Agent fleet changes are boot-time changes. `/reload` can refresh ordinary
|
|
11
|
-
plugin resources, but installing, updating, seating, unseating, or removing an
|
|
12
|
-
agent requires restarting the workspace/CLI host.
|
|
13
|
-
|
|
14
|
-
The CLI workspaces hub has one Agent Host shared by every registered workspace.
|
|
15
|
-
Its global fleet therefore admits only personas from the trusted repository's
|
|
16
|
-
`.agents/personas/`; it does not admit agent definitions from any workspace's
|
|
17
|
-
local package registrations. Local packages keep their ordinary plugin
|
|
18
|
-
surfaces in their owning workspace. Seating workspace-local agent definitions
|
|
19
|
-
in workspaces mode requires a future workspace-scoped fleet boundary.
|
|
20
|
-
|
|
21
|
-
## Install and seat
|
|
22
|
-
|
|
23
|
-
From the workspace root, register a local package directory:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
boring-ui-plugin install --local --workspace . ../agent-packages/my-agent
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The package keeps all of its normal plugin surfaces. Its agent contribution is
|
|
30
|
-
still inert until the fleet roster names its definition id:
|
|
31
|
-
|
|
32
|
-
```yaml
|
|
33
|
-
seats:
|
|
34
|
-
- seat: my-agent
|
|
35
|
-
agentTypeId: my-agent-definition
|
|
36
|
-
skills: []
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Restart a single-workspace host with `BORING_AGENT_FLEET=1`. A valid seated
|
|
40
|
-
package appears in the agent catalog with its exact declared
|
|
41
|
-
`boring.agent.version` and computed definition digest. The Host `describe()`
|
|
42
|
-
inventory exposes the same values as `definitionVersion` and
|
|
43
|
-
`definitionDigest`. An installed package without a matching
|
|
44
|
-
seat remains inert and reports `AGENT_DEFINITION_UNSEATED` during fleet
|
|
45
|
-
composition. The shared CLI workspaces hub never admits the local agent
|
|
46
|
-
contribution, even when the global roster names its definition id.
|
|
47
|
-
|
|
48
|
-
## Update
|
|
49
|
-
|
|
50
|
-
1. Update the source directory and bump both package/agent versions as needed.
|
|
51
|
-
2. For repository personas under `.agents/personas/`, run
|
|
52
|
-
`pnpm write:skill-digests` from the repository root.
|
|
53
|
-
3. Restart the workspace/CLI host.
|
|
54
|
-
|
|
55
|
-
Digest refresh is intentionally repository-local in v1. The script reads only
|
|
56
|
-
`.agents/personas/`; it does not rewrite pins for agent packages installed from
|
|
57
|
-
another local directory. Such packages must already have matching
|
|
58
|
-
seat-authoritative skill pins. A package with a schema, preflight, conflict,
|
|
59
|
-
materialization, or digest mismatch is excluded with its stable diagnostic (for
|
|
60
|
-
example `AGENT_FLEET_SEAT_SKILL_DIGEST_MISMATCH`) while valid sibling seats
|
|
61
|
-
continue to boot. Invalid unseated discovery is likewise excluded because it
|
|
62
|
-
has no activation authority. A missing fleet file means no authored roster and
|
|
63
|
-
boots only the regular default Agent; a present but malformed fleet or policy
|
|
64
|
-
file remains a whole-fleet configuration error.
|
|
65
|
-
|
|
66
|
-
## Unseat or remove
|
|
67
|
-
|
|
68
|
-
To make a package inert but keep it installed, remove its seat from
|
|
69
|
-
`.agents/factory/fleet.yaml` and restart.
|
|
70
|
-
|
|
71
|
-
To remove its workspace registration as well:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
boring-ui-plugin remove --local --workspace . my-agent-plugin-id
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Then restart. Remove the roster seat before removing its registration. If the
|
|
78
|
-
roster still names the removed definition, that Agent is excluded with
|
|
79
|
-
`AGENT_FLEET_SEAT_PERSONA_INVALID` while the default and valid sibling seats
|
|
80
|
-
continue to boot.
|
|
81
|
-
|
|
82
|
-
## v1 distribution boundary
|
|
83
|
-
|
|
84
|
-
Repository personas may contribute agents to any fleet in v1. A
|
|
85
|
-
workspace-registered local package path may contribute an agent only to a
|
|
86
|
-
single-workspace host; it never enters the CLI workspaces hub's global fleet.
|
|
87
|
-
Git/npm package sources — including their materialized `.pi/git/` and
|
|
88
|
-
`.pi/npm/` directories — cannot contribute an agent until the
|
|
89
|
-
remote-distribution trust gate ships. All excluded packages' non-agent plugin
|
|
90
|
-
surfaces continue through the normal plugin pipeline unchanged.
|
package/docs/API.md
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# API
|
|
2
|
-
|
|
3
|
-
Browser code imports the top-level (or `/front`) barrel; Node servers import
|
|
4
|
-
`/server`; both share types from `/shared`. The eval toolkit ships under
|
|
5
|
-
`/eval`. Narrow server utilities use dedicated subpaths so they do not widen
|
|
6
|
-
the main server module graph.
|
|
7
|
-
|
|
8
|
-
## Entry Points
|
|
9
|
-
|
|
10
|
-
| Import | Environment | Source barrel |
|
|
11
|
-
|---|---|---|
|
|
12
|
-
| `@hachej/boring-agent` | Browser | `src/front/index.ts` (alias of `/front`) |
|
|
13
|
-
| `@hachej/boring-agent/front` | Browser | `src/front/index.ts` |
|
|
14
|
-
| `@hachej/boring-agent/front/styles.css` | Browser | precompiled CSS |
|
|
15
|
-
| `@hachej/boring-agent/server` | Node | `src/server/index.ts` |
|
|
16
|
-
| `@hachej/boring-agent/server/pi-session-readability` | Node | offline production-loader transcript validation |
|
|
17
|
-
| `@hachej/boring-agent/shared` | Any | `src/shared/index.ts` |
|
|
18
|
-
| `@hachej/boring-agent/eval` | Node | `src/eval/index.ts` |
|
|
19
|
-
|
|
20
|
-
## `@hachej/boring-agent/front`
|
|
21
|
-
|
|
22
|
-
The styled chat UI and its building blocks. Key exports:
|
|
23
|
-
|
|
24
|
-
- `ChatPanel` (alias of `PiChatPanel`) — the pane-embeddable chat component.
|
|
25
|
-
Props include `apiBaseUrl`, `sessionId`, and `toolRenderers`. See
|
|
26
|
-
`src/front/chat/PiChatPanel.tsx`.
|
|
27
|
-
- `usePiSessions` and session helpers (`readActiveSessionId`,
|
|
28
|
-
`writeActiveSessionId`, `PiSessionList`, `PiSessionBrowser`).
|
|
29
|
-
- Slash-command surface: `builtinCommands`, `createCommandRegistry`,
|
|
30
|
-
`parseSlashCommand`, `getAgentCommands`.
|
|
31
|
-
- Tool renderers: `defaultToolRenderers`, `mergeToolRenderers`,
|
|
32
|
-
`resolveToolRenderer`, `mergeShadcnToolRenderers`, `ToolCallGroup`.
|
|
33
|
-
- Primitives (`Message`, `Conversation`, `Reasoning`, `CodeBlock`,
|
|
34
|
-
`PromptInput`, …) and the `cn` class helper.
|
|
35
|
-
- `DebugDrawer`, `ChatEmptyState`, `ArtifactOpenProvider`/`useOpenArtifact`,
|
|
36
|
-
`uploadFile`.
|
|
37
|
-
|
|
38
|
-
> Note: there is no `useAgentChat` hook. The chat lifecycle lives inside
|
|
39
|
-
> `ChatPanel`/`PiChatPanel` and the `usePiSessions` hook.
|
|
40
|
-
|
|
41
|
-
## `@hachej/boring-agent/server`
|
|
42
|
-
|
|
43
|
-
The Node runtime. Key exports:
|
|
44
|
-
|
|
45
|
-
- `createAgentApp(opts)` — standalone Fastify factory. Zero dependency on
|
|
46
|
-
`@hachej/boring-core` or `@hachej/boring-workspace`. See
|
|
47
|
-
`src/server/createAgentApp.ts`.
|
|
48
|
-
- `registerAgentRoutes(app, opts)` — mounts the agent HTTP routes onto an
|
|
49
|
-
existing Fastify instance (used by `@hachej/boring-workspace`). Paths are
|
|
50
|
-
absolute under `/api/v1/agent/*`, `/api/v1/files`, etc.
|
|
51
|
-
- Sandbox adapters: `createDirectSandbox`, `createBwrapSandbox`, plus the
|
|
52
|
-
Vercel sandbox/snapshot helpers (`createVercelSandboxWorkspace`,
|
|
53
|
-
`bakeSnapshotIfNeeded`, deployment-snapshot providers, `FileHandleStore`).
|
|
54
|
-
- Workspace adapters: `createNodeWorkspace`, `createVercelSandboxWorkspace`.
|
|
55
|
-
- 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).
|
|
56
|
-
- Provisioning: `provisionRuntimeWorkspace`, `provisionWorkspaceRuntime`,
|
|
57
|
-
`getBoringAgentRuntimePaths`, `getBoringAgentRuntimeEnv`,
|
|
58
|
-
`createVercelProvisioningAdapter`.
|
|
59
|
-
- HTTP/CSP: `applyCspHeaders`; `fileRoutes` for mounting file routes alone.
|
|
60
|
-
- Harness: `createResourceSettingsManager` and the Pi harness option types.
|
|
61
|
-
- Declarative authoring: `compileAgentDirectory()` and
|
|
62
|
-
`materializeAgentDirectory()`; see [AUTHORING](./AUTHORING.md). The materialized
|
|
63
|
-
value contains no tools, plugin selectors, paths, or runtime handles.
|
|
64
|
-
- `createLogger`.
|
|
65
|
-
|
|
66
|
-
### Trusted workspace agent dispatch
|
|
67
|
-
|
|
68
|
-
`registerAgentRoutes` (and standalone `createAgentApp`) can publish a
|
|
69
|
-
`WorkspaceAgentDispatcherResolver` through the explicit
|
|
70
|
-
`onWorkspaceAgentDispatcher` composition callback. This is a trusted,
|
|
71
|
-
in-process host capability—not an HTTP endpoint—and resolves the same
|
|
72
|
-
workspace-scoped `Agent` and runtime binding used by the normal agent routes.
|
|
73
|
-
It does not expose runtime bindings, services, or filesystem paths.
|
|
74
|
-
|
|
75
|
-
The resolver and bound dispatcher do **no authorization**. A verified host
|
|
76
|
-
caller must authorize membership or service-principal access first, then pass
|
|
77
|
-
the verified `{ workspaceId, userId }`. Resolution fails closed when context is
|
|
78
|
-
missing, conflicts with an already-resolved request workspace, or cannot resolve
|
|
79
|
-
that workspace through the host's explicit `getTrustedWorkspaceRoot` callback.
|
|
80
|
-
Hosts with request-scoped root resolution must provide that separate requestless
|
|
81
|
-
callback for verified background callers; the dispatcher never falls back to a
|
|
82
|
-
raw workspace header.
|
|
83
|
-
|
|
84
|
-
The bound dispatcher injects its trusted context into `Agent.send()`,
|
|
85
|
-
`interrupt()`, and `stop()`. `send()` keeps normal session creation when no
|
|
86
|
-
`sessionId` is supplied, forwards model selection, and yields the full stream
|
|
87
|
-
through usage and terminal events. Control methods validate the legacy agent's
|
|
88
|
-
interrupt/stop receipts before returning the typed dispatcher contract and fail
|
|
89
|
-
with `AGENT_CONTROL_RECEIPT_INVALID` if the runtime violates it.
|
|
90
|
-
Runtime/generated plugins do not receive this
|
|
91
|
-
capability; app-owned composition may inject it only into trusted integrations.
|
|
92
|
-
|
|
93
|
-
## `@hachej/boring-agent/shared`
|
|
94
|
-
|
|
95
|
-
Platform-agnostic contracts (types + zod schemas). Source of truth for the
|
|
96
|
-
public interfaces:
|
|
97
|
-
|
|
98
|
-
- `harness.ts` — `AgentHarness`, `SendMessageInput`, `RunContext`,
|
|
99
|
-
`AgentHarnessFactory`.
|
|
100
|
-
- `tool.ts` / `tool-ui.ts` — `AgentTool`, `ToolExecContext`, `ToolResult`,
|
|
101
|
-
`JSONSchema`, `ToolUiMetadata`.
|
|
102
|
-
- `workspace.ts` — `Workspace`, `Entry`, `Stat`.
|
|
103
|
-
- `sandbox.ts` — `Sandbox`, `SandboxCapability`, `ExecOptions`, `ExecResult`.
|
|
104
|
-
- `catalog.ts` — `CatalogDeps`, `ToolCatalog`.
|
|
105
|
-
- `session.ts` — `SessionStore`, `SessionSummary`, `SessionDetail`.
|
|
106
|
-
- `config-schema.ts` — `ConfigSchema`, `EnvSchema`, `RuntimeModeSchema`,
|
|
107
|
-
`validateConfig`.
|
|
108
|
-
- `error-codes.ts` — `ErrorCode`, `ERROR_CODES`, error-envelope schemas
|
|
109
|
-
(see [ERROR_CODES.md](./ERROR_CODES.md)).
|
|
110
|
-
- `chat.ts` — `BoringChatMessage`, `PiChatEvent`, stream/snapshot frames and
|
|
111
|
-
their zod schemas.
|
|
112
|
-
- `capabilities.ts`, `telemetry.ts`, `runtime.ts`, `sandbox-handle-store.ts`,
|
|
113
|
-
`validateTool.ts`, `agentPluginEvents.ts`.
|
|
114
|
-
|
|
115
|
-
> There is no `ui-bridge.ts` or `message.ts` in `shared/`. UI-bridge tools
|
|
116
|
-
> (`exec_ui`, `get_ui_state`) and their types now live in
|
|
117
|
-
> `@hachej/boring-workspace` — `createAgentApp` ships zero UI tools by design.
|
|
118
|
-
|
|
119
|
-
## Deferred HTTP Git Surface
|
|
120
|
-
|
|
121
|
-
`/api/v1/git/*` routes exist but are intentionally thin/minimal: there is no
|
|
122
|
-
first-party git UI consumer in the agent today, so git operations run through
|
|
123
|
-
the `bash` tool. See [KNOWN_LIMITATIONS.md](./KNOWN_LIMITATIONS.md).
|
package/docs/AUTHORING.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Declarative agent authoring
|
|
2
|
-
|
|
3
|
-
An authored agent directory describes identity, safe display metadata, and
|
|
4
|
-
instructions. It does not select executable behavior.
|
|
5
|
-
|
|
6
|
-
```text
|
|
7
|
-
my-agent/
|
|
8
|
-
├── agent.json
|
|
9
|
-
└── instructions.md
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
```json
|
|
13
|
-
{
|
|
14
|
-
"schemaVersion": 1,
|
|
15
|
-
"definitionId": "claims-assistant",
|
|
16
|
-
"version": "2026.07.20",
|
|
17
|
-
"label": "Claims assistant",
|
|
18
|
-
"description": "Helps process insurance claims.",
|
|
19
|
-
"instructionsRef": "instructions.md"
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
`label` and `description` are optional. Labels are limited to 128 characters;
|
|
24
|
-
descriptions are limited to 1,024 characters. Both must be trimmed, valid
|
|
25
|
-
Unicode without control or bidi-spoofing characters.
|
|
26
|
-
|
|
27
|
-
The loader:
|
|
28
|
-
|
|
29
|
-
- reads only `agent.json` and `instructions.md`;
|
|
30
|
-
- requires regular, non-symlink files contained in the directory;
|
|
31
|
-
- limits the manifest to 64 KiB and instructions to 256 KiB before decoding;
|
|
32
|
-
- requires valid UTF-8 and non-whitespace instructions;
|
|
33
|
-
- returns a frozen `AuthoredAgentSourceV1` from
|
|
34
|
-
`materializeAgentDirectory()` containing only identity, metadata, and
|
|
35
|
-
instructions.
|
|
36
|
-
|
|
37
|
-
## Executable behavior belongs to trusted host policy
|
|
38
|
-
|
|
39
|
-
Tools, capabilities, skills, MCP servers, packages, models, credentials,
|
|
40
|
-
plugins, runtime modes, and Workspace roots are configured by trusted host and
|
|
41
|
-
plugin code. Authored JSON cannot enable them.
|
|
42
|
-
|
|
43
|
-
Legacy manifests may still contain these keys while being cleaned up:
|
|
44
|
-
|
|
45
|
-
- `capabilityRequirements`
|
|
46
|
-
- `toolRefs`
|
|
47
|
-
- `skillRefs`
|
|
48
|
-
- `mcpServerRefs`
|
|
49
|
-
|
|
50
|
-
Absent or empty arrays are accepted and stripped. A non-empty array fails with
|
|
51
|
-
`AUTHORED_AGENT_REFERENCE_UNSUPPORTED`; move the requested behavior to trusted
|
|
52
|
-
host/plugin configuration.
|
|
53
|
-
|
|
54
|
-
The removed server contracts are `AuthoredAgentToolCatalog`,
|
|
55
|
-
`MaterializeAgentDirectoryInput.toolCatalog`, and the materialized `tools` and
|
|
56
|
-
`declaredToolRefs` fields. This correction removes no HTTP or product endpoint.
|
|
57
|
-
|
|
58
|
-
## Validation
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
boring-ui agent validate ./my-agent
|
|
62
|
-
boring-ui agent validate ./my-agent --json
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Success reports only identity, optional metadata, and instruction byte length.
|
|
66
|
-
It never reports or resolves a tool catalog. Errors are field-specific and
|
|
67
|
-
redacted; unexpected failures return `INTERNAL_ERROR` without local paths or
|
|
68
|
-
secret-like source values.
|
package/docs/CSP.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# CSP Compatibility
|
|
2
|
-
|
|
3
|
-
`@hachej/boring-agent` is compatible with a strict CSP, with one required exception:
|
|
4
|
-
`style-src` must allow inline styles for editor/runtime integrations that do
|
|
5
|
-
not support nonces end-to-end.
|
|
6
|
-
|
|
7
|
-
## Recommended Policy
|
|
8
|
-
|
|
9
|
-
```http
|
|
10
|
-
Content-Security-Policy:
|
|
11
|
-
default-src 'self';
|
|
12
|
-
script-src 'self';
|
|
13
|
-
style-src 'self' 'unsafe-inline';
|
|
14
|
-
connect-src 'self';
|
|
15
|
-
img-src 'self' data: blob:;
|
|
16
|
-
font-src 'self';
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Notes
|
|
20
|
-
|
|
21
|
-
- `script-src` does **not** require `'unsafe-eval'`.
|
|
22
|
-
- No `eval()` or `new Function()` usage is expected in audited agent UI surfaces
|
|
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`.
|
|
27
|
-
|
|
28
|
-
## Audited Scope
|
|
29
|
-
|
|
30
|
-
- `src/front/chat/PiChatPanel.tsx`
|
|
31
|
-
- `examples/with-custom-tool/*`
|
|
32
|
-
- `apps/agent-playground/*`
|
|
33
|
-
|
|
34
|
-
## Remaining Caveat
|
|
35
|
-
|
|
36
|
-
Even with this cleanup, downstream consumers that enable rich editor stacks
|
|
37
|
-
(for example CodeMirror/Tiptap integrations in workspace-oriented shells) should
|
|
38
|
-
keep `style-src 'unsafe-inline'` until upstream libraries expose nonce-safe
|
|
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.
|